fix(tron-wallet-snap): correct behavior for trc20 transfer type transactions - #134
Open
gabrieledm wants to merge 9 commits into
Open
fix(tron-wallet-snap): correct behavior for trc20 transfer type transactions#134gabrieledm wants to merge 9 commits into
gabrieledm wants to merge 9 commits into
Conversation
gabrieledm
temporarily deployed
to
default-branch
August 6, 2026 14:37 — with
GitHub Actions
Inactive
…of-0' of https://github.com/MetaMask/internal-snaps into fix/tron/WPN-1745_sun-USDT-swap-incorrect-total-amount-of-0
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
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.
Explanation
Fixes Tron transaction activity displaying
0 SUNor-0 SUNfor SUN -> USDT swaps routed through Rango and SunSwap.TronGrid returns a zero-value
Approvalevent before the actual outgoing SUNTransfer.The transaction mapper previously selected the first event sent by the account, causing the approval to be treated as the swap’s source leg.
Swap detection now considers only
Transferevents when selecting source and destination token movements.This preserves existing approval handling while displaying the actual SUN amount in activity history.
A regression test covers the reported event ordering and verifies that
276.791363098075785381 SUN -> 4.891342 USDTis mapped correctly.Testing
References
Fixes: WPN-1745
Before
After
Checklist