diff --git a/app.go b/app.go index 3aa0bc6..7881cdd 100644 --- a/app.go +++ b/app.go @@ -1027,6 +1027,12 @@ func (a *App) GetTokenPortfolio() map[string]interface{} { if resultMap, ok := result.(map[string]interface{}); ok { if balances, ok := resultMap["balances"].(map[string]interface{}); ok { for scid, balance := range balances { + // Native DERO is the base coin, not a contract token. Skip the + // zero SCID so it never appears in the contract-token list (its + // balance/send live on the Dashboard). Mirrors GetTrackedTokens. + if scid == deroSCID { + continue + } token := map[string]interface{}{ "scid": scid, "balance": balance, @@ -1049,12 +1055,6 @@ func (a *App) GetTokenPortfolio() map[string]interface{} { } } - if scid == deroSCID { - token["name"] = "DERO" - token["symbol"] = "DERO" - token["native"] = true - } - tokens = append(tokens, token) } } diff --git a/frontend/src/lib/components/TokenPortfolio.svelte b/frontend/src/lib/components/TokenPortfolio.svelte index b937a41..4f854f0 100644 --- a/frontend/src/lib/components/TokenPortfolio.svelte +++ b/frontend/src/lib/components/TokenPortfolio.svelte @@ -144,16 +144,14 @@ let result = null; let useXSWD = false; - // If local wallet is open, ALWAYS try GetTrackedTokens first (it includes native DERO) + // If local wallet is open, try GetTrackedTokens first. The list is + // contract-assets only — native DERO is the base coin and lives on the + // Dashboard, not here. if (localWalletOpen) { result = await GetTrackedTokens(); if (result.success) { tokens = result.tokens || []; - tokens.sort((a, b) => { - if (a.native) return -1; - if (b.native) return 1; - return (b.balance || 0) - (a.balance || 0); - }); + tokens.sort((a, b) => (b.balance || 0) - (a.balance || 0)); error = null; loading = false; maybeAutoScan(); @@ -166,11 +164,7 @@ result = await GetTokenPortfolio(); if (result.success) { tokens = result.tokens || []; - tokens.sort((a, b) => { - if (a.native) return -1; - if (b.native) return 1; - return (b.balance || 0) - (a.balance || 0); - }); + tokens.sort((a, b) => (b.balance || 0) - (a.balance || 0)); useXSWD = true; error = null; loading = false; @@ -236,7 +230,7 @@ } } - // Auto-scan once per mount when the portfolio holds nothing but native DERO — + // Auto-scan once per mount when the portfolio holds no contract tokens — // mirrors Engram's first-view rescan. Runs quietly: a no-result auto-scan // shows no toast, and if Gnomon isn't running the backend just returns an // error we swallow (the manual Scan button surfaces it on demand). @@ -244,8 +238,9 @@ if (scanning || !localWalletOpen) return; const addr = $walletState.address; if (!addr || autoScannedWallets.has(addr)) return; - const onlyNative = tokens.length <= 1 && tokens.every(t => t.native); - if (!onlyNative) return; + // No contract tokens held yet — auto-scan to discover any. (Native DERO is + // never in this list, so an empty list means "no tokens".) + if (tokens.length > 0) return; // Don't auto-scan against a half-built index. Right after a filter-change // re-index (or any cold start), Gnomon's candidate set isn't complete yet, so // a scan would find nothing and falsely conclude the wallet holds no tokens. @@ -375,7 +370,8 @@ {:else if tokens.length === 0}
-

No tokens found

+

No contract tokens yet

+

This list holds DERO-native contract assets. Your DERO balance lives on the Dashboard.

{#if localWalletOpen && !gnomonRunning}

Start Gnomon in Settings to auto-detect tokens your wallet holds.

{/if} @@ -390,17 +386,15 @@ {:else}
{#each tokens as token} -
+
{#if shouldShowIcon(token.icon)} {token.name handleIconError(token.icon)} /> - {:else if token.native} - {:else} {/if}
- +
{token.name || 'Unknown Token'} @@ -410,11 +404,9 @@
{formatSCID(token.scid)} - {#if !token.native} - - {/if} +
@@ -428,7 +420,7 @@ XSWD *server* is running — always, on most setups — which hid these buttons permanently rather than only for remote portfolios. -->
- {#if !token.native && localWalletOpen} + {#if localWalletOpen} {/if} - {#if !token.native && localWalletOpen} + {#if localWalletOpen}