diff --git a/modules/rwallet/components/folk-wallet-viewer.ts b/modules/rwallet/components/folk-wallet-viewer.ts index 1295d11..865b486 100644 --- a/modules/rwallet/components/folk-wallet-viewer.ts +++ b/modules/rwallet/components/folk-wallet-viewer.ts @@ -800,13 +800,29 @@ class FolkWalletViewer extends HTMLElement { const incoming: any[] = []; const outgoing: any[] = []; const results = data.results || []; + const addr = this.address.toLowerCase(); for (const tx of results) { + // Outgoing: Safe-initiated multisig transactions if (tx.txType === "MULTISIG_TRANSACTION") { outgoing.push(tx); } + // Incoming: external ETH/token transfers to Safe + if (tx.txType === "ETHEREUM_TRANSACTION") { + if (tx.from && tx.value && tx.value !== "0") { + incoming.push({ + type: "ETHER_TRANSFER", + from: tx.from, + to: this.address, + value: tx.value, + executionDate: tx.executionDate, + blockTimestamp: tx.executionDate, + }); + } + } + // Embedded transfers (both tx types may have these) if (tx.transfers) { for (const t of tx.transfers) { - if (t.to?.toLowerCase() === this.address.toLowerCase()) { + if (t.to?.toLowerCase() === addr && t.from?.toLowerCase() !== addr) { incoming.push(t); } } @@ -2606,7 +2622,13 @@ class FolkWalletViewer extends HTMLElement { } const sorted = allBals - .filter(b => parseFloat(b.fiatBalance || "0") > 0.01 || BigInt(b.balance || "0") > 0n) + .filter(b => { + const fiat = parseFloat(b.fiatBalance || "0"); + if (fiat > 0.01) return true; + if (b.chainId === "local" || b.tokenAddress?.startsWith("crdt:")) return true; + if (!b.tokenAddress && BigInt(b.balance || "0") > 0n) return true; + return false; + }) .sort((a, b) => parseFloat(b.fiatBalance || "0") - parseFloat(a.fiatBalance || "0")); const totalUSD = sorted.reduce((sum, b) => sum + parseFloat(b.fiatBalance || "0"), 0); @@ -2679,7 +2701,13 @@ class FolkWalletViewer extends HTMLElement { } const sorted = allBals - .filter(b => parseFloat(b.fiatBalance || "0") > 0.01 || BigInt(b.balance || "0") > 0n) + .filter(b => { + const fiat = parseFloat(b.fiatBalance || "0"); + if (fiat > 0.01) return true; + if (b.chainId === "local" || b.tokenAddress?.startsWith("crdt:")) return true; + if (!b.tokenAddress && BigInt(b.balance || "0") > 0n) return true; + return false; + }) .sort((a, b) => parseFloat(b.fiatBalance || "0") - parseFloat(a.fiatBalance || "0")); const totalUSD = sorted.reduce((sum, b) => sum + parseFloat(b.fiatBalance || "0"), 0); @@ -2732,8 +2760,9 @@ class FolkWalletViewer extends HTMLElement { for (const ch of chains) { totalChains.add(ch.chainId); for (const b of ch.balances) { - if (parseFloat(b.fiatBalance || "0") > 0.01 || BigInt(b.balance || "0") > 0n) { - grandTotal += parseFloat(b.fiatBalance || "0"); + const fiat = parseFloat(b.fiatBalance || "0"); + if (fiat > 0.01 || (!b.tokenAddress && BigInt(b.balance || "0") > 0n)) { + grandTotal += fiat; totalTokens++; } } @@ -3047,7 +3076,13 @@ class FolkWalletViewer extends HTMLElement { if (unified.length === 0) return '