fix(send): fix Taproot balance showing 0 in address type selector (OK-52631)#11085
Open
PatrickChoo wants to merge 3 commits intoOneKeyHQ:xfrom
Open
fix(send): fix Taproot balance showing 0 in address type selector (OK-52631)#11085PatrickChoo wants to merge 3 commits intoOneKeyHQ:xfrom
PatrickChoo wants to merge 3 commits intoOneKeyHQ:xfrom
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
originalix
requested changes
Apr 7, 2026
packages/kit/src/components/AddressTypeSelector/AddressTypeFiat.tsx
Outdated
Show resolved
Hide resolved
originalix
approved these changes
Apr 7, 2026
…-52631)
The tokenMap key matching used split('_') + slice to extract the account
key segment, which failed for UTXO xpub-based keys where the format
didn't split cleanly. Replace with includes() matching against all
account key candidates (xpub, address, displayAddress, etc.), which is
the same approach the original implementation used reliably.
… lookup (OK-52631) Root cause: BTC Taproot accounts use xpubSegwit (native descriptor) as the account identifier in token map keys, but the candidate set only included xpub. Restore exact segment matching (slice) instead of loose substring matching (includes) and add xpubSegwit to candidates.
d340934 to
e7412af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AddressTypeFiatto useincludes()instead ofsplit('_') + slicenetworkId_accountKey_tokenAddresssegmentsRoot cause: PR #10931 changed the matching from simple
key.includes(xpub)to a structuredsplit('_').slice(1, -1)extraction. This broke for BTC/LTC where the tokenMap key contains xpub as the account identifier — the structured extraction couldn't reliably parse it back out.Jira
OK-52631
Test plan