| … | … | @@ -1668,8 +1668,14 @@ const routes = { |
| 1668 | 1668 | } |
| 1669 | 1669 | const amountBigInt = amountValidation.amount |
| 1670 | 1670 | |
| 1671 | // Get current address index from storage |
| 1672 | const identity = await loadIdentity() |
| 1673 | await initializeStorage(identity) |
| 1674 | const currentAddr = await getCurrentAddress(chain) // Use full chain name (ethereum-usdt) |
| 1675 | const accountIndex = currentAddr ? currentAddr.index : 0 |
| 1676 | |
| 1671 | 1677 | const { wdk } = await initializeWDK(walletMnemonic, { testnet: network === 'testnet' }) |
| 1672 | | const account = await wdk.getAccount(baseChain, 0) |
| 1678 | const account = await wdk.getAccount(baseChain, accountIndex) // FIX: Use stored index, not hardcoded 0 |
| 1673 | 1679 | |
| 1674 | 1680 | // Check token balance |
| 1675 | 1681 | const tokenBalance = await account.getTokenBalance(tokenInfo.contractAddress) |
| … | … | @@ -1739,8 +1745,14 @@ const routes = { |
| 1739 | 1745 | } |
| 1740 | 1746 | const amountBigInt = amountValidation.amount |
| 1741 | 1747 | |
| 1748 | // Get current address index from storage |
| 1749 | const identity = await loadIdentity() |
| 1750 | await initializeStorage(identity) |
| 1751 | const currentAddr = await getCurrentAddress(chain) |
| 1752 | const accountIndex = currentAddr ? currentAddr.index : 0 |
| 1753 | |
| 1742 | 1754 | const { wdk } = await initializeWDK(walletMnemonic, { testnet: network === 'testnet' }) |
| 1743 | | const account = await wdk.getAccount(chain, 0) |
| 1755 | const account = await wdk.getAccount(chain, accountIndex) // FIX: Use stored index, not hardcoded 0 |
| 1744 | 1756 | |
| 1745 | 1757 | const balance = await account.getBalance() |
| 1746 | 1758 | |