OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet-desktop commits / 78e70ec

Fix estimate-fee endpoint to use current address index
BUG: estimate-fee endpoint was also hardcoded to use index 0, causing fee estimation to fail when user's current address was at a different index. FIXED: - Token fee estimation (line 1564): Now gets current address from storage - Native fee estimation (line 1608): Now gets current address from storage This completes the fix for all endpoints that were using hardcoded index 0 instead of the stored current address index. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
78e70ec98161c5a9e903a911e64e302851275374
by plankatron <fleeky@gmail.com> · 2026-01-29T16:57:02.000Z

Changed files (1) +14 -2

wallet-server.cjs +14 -2
……@@ -1560,8 +1560,14 @@ const routes = {
15601560 }
15611561 const amountBigInt = amountValidation.amount
15621562
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
15631569 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
15651571
15661572 // Quote token transfer (fee in ETH, not USDT)
15671573 const quote = await account.quoteTransfer({
……@@ -1598,8 +1604,14 @@ const routes = {
15981604 }
15991605 const amountBigInt = amountValidation.amount
16001606
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
16011613 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
16031615
16041616 const quote = await account.quoteSendTransaction({
16051617 to,