OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet-desktop commits / ed26ef3

Fix send endpoints to use current address index from storage
BUG: Send endpoints were hardcoded to use address index 0, causing sends to fail when user's current address was at a different index. FIXED: - Token send (line 1672): Now gets current address from storage - Native send (line 1749): Now gets current address from storage Both endpoints now: 1. Load identity and initialize storage 2. Get current address for the chain: getCurrentAddress(chain) 3. Use stored index: wdk.getAccount(chain, accountIndex) This fixes the error: "missing revert data" when trying to send USDT from address index 2 (where funds actually are). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
ed26ef3490e42041a458084e1b631230649d7e0f
by plankatron <fleeky@gmail.com> · 2026-01-29T16:53:04.000Z

Changed files (1) +14 -2

wallet-server.cjs +14 -2
……@@ -1668,8 +1668,14 @@ const routes = {
16681668 }
16691669 const amountBigInt = amountValidation.amount
16701670
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
16711677 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
16731679
16741680 // Check token balance
16751681 const tokenBalance = await account.getTokenBalance(tokenInfo.contractAddress)
……@@ -1739,8 +1745,14 @@ const routes = {
17391745 }
17401746 const amountBigInt = amountValidation.amount
17411747
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
17421754 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
17441756
17451757 const balance = await account.getBalance()
17461758