From 6142b27c498b08a4ba8dba236b05b034f1f748f3 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Mon, 18 May 2026 05:13:50 +0800 Subject: [PATCH] separate Multi Coins and Monero into distinct account types with startup login choice - Removed monero from shared networks array; monero is now its own separate account type - Added accountType state (null/'multi'/'monero') to wallet, stored in memory only - Added login(type) method: chooses between EVM vault flow and Monero RPC flow - Added logout() method that resets all per-account state - On app startup, user picks Multi Coins (ETH/BSC/Polygon) or Monero - isLocked getter now checks accountType === 'multi' instead of excluding monero by network id - Moved ETH/BSC/Polygon routes under /multicoin/ base path - /multicoin, /multicoin/bsc, /multicoin/polygon with updated navTarget routing - Root / shows welcome/login choice, redirects if already logged in - Fixed moneroListWallets timing: runs inside login('monero') after RPC manager exists - Removed cross-tab links between monero and multicoin, only logout remains --- .../src/lib/components/EvmDashboard.svelte | 612 +++++++++--------- apps/desktop/src/lib/states/wallet.svelte.ts | 66 +- apps/desktop/src/routes/about.svelte | 5 - apps/desktop/src/routes/index.svelte | 49 +- apps/desktop/src/routes/monero/index.svelte | 60 +- .../routes/{ => multicoin}/bsc/index.svelte | 0 .../desktop/src/routes/multicoin/index.svelte | 7 + .../{ => multicoin}/polygon/index.svelte | 0 .../src/routes/tx/[chainid]/[hash].svelte | 2 +- 9 files changed, 468 insertions(+), 333 deletions(-) delete mode 100644 apps/desktop/src/routes/about.svelte rename apps/desktop/src/routes/{ => multicoin}/bsc/index.svelte (100%) create mode 100644 apps/desktop/src/routes/multicoin/index.svelte rename apps/desktop/src/routes/{ => multicoin}/polygon/index.svelte (100%) diff --git a/apps/desktop/src/lib/components/EvmDashboard.svelte b/apps/desktop/src/lib/components/EvmDashboard.svelte index 30ed49d..2aece46 100644 --- a/apps/desktop/src/lib/components/EvmDashboard.svelte +++ b/apps/desktop/src/lib/components/EvmDashboard.svelte @@ -65,320 +65,356 @@ }) function navTarget(id: NetworkId): string { - if (id === 'eth') return '/' - return `/${id}` + if (id === 'eth') return '/multicoin' + return `/multicoin/${id}` } let initStarted = false $effect(() => { if (!initStarted) { initStarted = true - w.init().then(() => w.switchNetwork(networkId)) + w.init().then(async () => { + if (w.accountType === 'multi') { + await w.switchNetwork(networkId) + } + }) } }) {#if !w.ready} -{:else if !w.vaultExists} - - - Import Wallet - - Enter your seed phrase to save it securely in your system keychain - - - -
-