| … | … | @@ -1630,7 +1630,9 @@ async function loadWalletAddressSelector() { |
| 1630 | 1630 | select.innerHTML = '<option value="">Loading...</option>' |
| 1631 | 1631 | |
| 1632 | 1632 | try { |
| 1633 | | const res = await authFetch(`/api/addresses/${selectedNetwork}-${selectedCurrency}`) |
| 1633 | // For tokens (ethereum-usdt, ethereum-usdc), use base chain for addresses |
| 1634 | const addressChain = selectedChain // Always use base chain, not token-specific |
| 1635 | const res = await authFetch(`/api/addresses/${selectedNetwork}-${addressChain}`) |
| 1634 | 1636 | const data = await res.json() |
| 1635 | 1637 | |
| 1636 | 1638 | if (data.error) { |
| … | … | @@ -1669,7 +1671,9 @@ async function onWalletAddressChange() { |
| 1669 | 1671 | if (isNaN(selectedIndex)) return |
| 1670 | 1672 | |
| 1671 | 1673 | try { |
| 1672 | | const res = await authFetch(`/api/addresses/${selectedNetwork}-${selectedCurrency}/${selectedIndex}/current`, { |
| 1674 | // For tokens, use base chain for address management |
| 1675 | const addressChain = selectedChain |
| 1676 | const res = await authFetch(`/api/addresses/${selectedNetwork}-${addressChain}/${selectedIndex}/current`, { |
| 1673 | 1677 | method: 'POST' |
| 1674 | 1678 | }) |
| 1675 | 1679 | |
| … | … | @@ -1850,6 +1854,7 @@ async function loadEthereumBalances() { |
| 1850 | 1854 | } |
| 1851 | 1855 | |
| 1852 | 1856 | // Select asset for Ethereum chain (null = ETH, 'usdt' = USDT, 'usdc' = USDC) |
| 1857 | // NOTE: All Ethereum tokens share the same address - only visual selection changes |
| 1853 | 1858 | function selectAsset(asset, evt) { |
| 1854 | 1859 | selectedAsset = asset |
| 1855 | 1860 | localStorage.setItem('asset', asset || '') |
| … | … | @@ -1867,8 +1872,8 @@ function selectAsset(asset, evt) { |
| 1867 | 1872 | } |
| 1868 | 1873 | }) |
| 1869 | 1874 | |
| 1870 | | // Update QR code and transactions for selected asset |
| 1871 | | loadCurrentQRCode() |
| 1875 | // For tokens (USDT/USDC), don't reload QR/address - they share the same ETH address |
| 1876 | // Only reload transactions which may be filtered by token type |
| 1872 | 1877 | loadTransactions() |
| 1873 | 1878 | } |
| 1874 | 1879 | |