| … | … | @@ -1560,8 +1560,14 @@ const routes = { |
| 1560 | 1560 | } |
| 1561 | 1561 | const amountBigInt = amountValidation.amount |
| 1562 | 1562 | |
| 1563 | // Get current address index from storage |
| 1564 | const identity = await loadIdentity() |
| 1565 | await initializeStorage(identity) |
| 1566 | const currentAddr = await getCurrentAddress(chain) // Use full chain name (ethereum-usdt) |
| 1567 | const accountIndex = currentAddr ? currentAddr.index : 0 |
| 1568 | |
| 1563 | 1569 | const { wdk } = await initializeWDK(walletMnemonic, { testnet: network === 'testnet' }) |
| 1564 | | const account = await wdk.getAccount(baseChain, 0) |
| 1570 | const account = await wdk.getAccount(baseChain, accountIndex) // FIX: Use stored index, not hardcoded 0 |
| 1565 | 1571 | |
| 1566 | 1572 | // Quote token transfer (fee in ETH, not USDT) |
| 1567 | 1573 | const quote = await account.quoteTransfer({ |
| … | … | @@ -1598,8 +1604,14 @@ const routes = { |
| 1598 | 1604 | } |
| 1599 | 1605 | const amountBigInt = amountValidation.amount |
| 1600 | 1606 | |
| 1607 | // Get current address index from storage |
| 1608 | const identity = await loadIdentity() |
| 1609 | await initializeStorage(identity) |
| 1610 | const currentAddr = await getCurrentAddress(chain) |
| 1611 | const accountIndex = currentAddr ? currentAddr.index : 0 |
| 1612 | |
| 1601 | 1613 | const { wdk } = await initializeWDK(walletMnemonic, { testnet: network === 'testnet' }) |
| 1602 | | const account = await wdk.getAccount(chain, 0) |
| 1614 | const account = await wdk.getAccount(chain, accountIndex) // FIX: Use stored index, not hardcoded 0 |
| 1603 | 1615 | |
| 1604 | 1616 | const quote = await account.quoteSendTransaction({ |
| 1605 | 1617 | to, |