| … | … | @@ -1745,6 +1745,7 @@ async function loadCurrentBalance() { |
| 1745 | 1745 | |
| 1746 | 1746 | // Load unified Ethereum balances (ETH + USDT + USDC) |
| 1747 | 1747 | async function loadEthereumBalances() { |
| 1748 | console.log('loadEthereumBalances called, selectedChain:', selectedChain, 'selectedNetwork:', selectedNetwork) |
| 1748 | 1749 | const container = document.getElementById('wallet-balance-display') |
| 1749 | 1750 | |
| 1750 | 1751 | // Show loading with asset placeholders |
| … | … | @@ -1849,19 +1850,22 @@ async function loadEthereumBalances() { |
| 1849 | 1850 | } |
| 1850 | 1851 | |
| 1851 | 1852 | // Select asset for Ethereum chain (null = ETH, 'usdt' = USDT, 'usdc' = USDC) |
| 1852 | | function selectAsset(asset) { |
| 1853 | function selectAsset(asset, evt) { |
| 1853 | 1854 | selectedAsset = asset |
| 1854 | 1855 | localStorage.setItem('asset', asset || '') |
| 1855 | 1856 | |
| 1856 | 1857 | // Update selectedCurrency for backwards compatibility |
| 1857 | 1858 | selectedCurrency = getSelectedCurrency() |
| 1858 | 1859 | |
| 1859 | | document.querySelectorAll('.asset-row').forEach(row => { |
| 1860 | // Update visual selection |
| 1861 | document.querySelectorAll('.asset-row').forEach((row, index) => { |
| 1860 | 1862 | row.classList.remove('selected') |
| 1863 | // ETH is index 0, USDT is index 1, USDC is index 2 |
| 1864 | const rowAsset = index === 0 ? null : index === 1 ? 'usdt' : 'usdc' |
| 1865 | if (rowAsset === asset) { |
| 1866 | row.classList.add('selected') |
| 1867 | } |
| 1861 | 1868 | }) |
| 1862 | | if (event && event.currentTarget) { |
| 1863 | | event.currentTarget.classList.add('selected') |
| 1864 | | } |
| 1865 | 1869 | |
| 1866 | 1870 | // Update QR code and transactions for selected asset |
| 1867 | 1871 | loadCurrentQRCode() |