feat(tron-wallet-snap): remove assets migration feature-flag routing - #97
Draft
ulissesferreira wants to merge 3 commits into
Draft
Conversation
ulissesferreira
marked this pull request as draft
August 3, 2026 09:19
ulissesferreira
force-pushed
the
WPN-1497-core-adapter-routing
branch
from
August 4, 2026 13:45
1a63feb to
3dc547d
Compare
ulissesferreira
force-pushed
the
WPN-1497-remove-assets-migration-flag
branch
2 times, most recently
from
August 4, 2026 13:54
313552f to
03454c3
Compare
ulissesferreira
force-pushed
the
WPN-1497-core-adapter-routing
branch
from
August 4, 2026 13:54
3dc547d to
d387059
Compare
cursor
Bot
force-pushed
the
WPN-1497-core-adapter-routing
branch
from
August 5, 2026 10:16
d387059 to
ea6cdf4
Compare
jeremytsng
pushed a commit
that referenced
this pull request
Aug 5, 2026
## Explanation This PR extends the Snap’s transaction handling by introducing a `TransactionMapper` that classifies/massages Horizon on-chain transactions into MetaMask keyring transaction shapes (send/swap/change-trust/receive), while also standardizing keyring “asset” payloads to include `unit`, `amount`, and `fungible` fields and adding some supporting formatting utilities/constants. **Changes:** - Added `TransactionMapper` (+ tests + Horizon fixtures) to map Horizon transactions into keyring transactions and to skip dust payments. - Expanded transaction utilities with operation/transaction-type detectors (swap/receive/change-trust/dust/status helpers). - Standardized keyring transaction request `asset` shapes and added a shared `removeTrailingZeros` helper (plus tests) and a dust-amount constant. <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
cursor
Bot
force-pushed
the
WPN-1497-core-adapter-routing
branch
from
August 5, 2026 18:11
ea6cdf4 to
619915e
Compare
cursor
Bot
force-pushed
the
WPN-1497-remove-assets-migration-flag
branch
from
August 5, 2026 18:21
03454c3 to
087ea4d
Compare
cursor
Bot
force-pushed
the
WPN-1497-core-adapter-routing
branch
from
August 5, 2026 18:22
619915e to
bfa488d
Compare
2 tasks
cursor
Bot
changed the base branch from
WPN-1497-core-adapter-routing
to
ulissesferreira/wpn-1497-core-adapter-routing-9863
August 5, 2026 18:24
cursor
Bot
force-pushed
the
WPN-1497-remove-assets-migration-flag
branch
from
August 5, 2026 18:24
087ea4d to
d243286
Compare
cursor
Bot
force-pushed
the
ulissesferreira/wpn-1497-core-adapter-routing-9863
branch
from
August 5, 2026 18:29
bfa488d to
327dfab
Compare
cursor
Bot
force-pushed
the
WPN-1497-remove-assets-migration-flag
branch
4 times, most recently
from
August 5, 2026 18:54
b5592e2 to
0d032f7
Compare
cursor
Bot
force-pushed
the
ulissesferreira/wpn-1497-core-adapter-routing-9863
branch
2 times, most recently
from
August 5, 2026 19:34
6769ec9 to
4d766ab
Compare
cursor
Bot
force-pushed
the
WPN-1497-remove-assets-migration-flag
branch
from
August 5, 2026 19:34
0d032f7 to
6fe7f9f
Compare
Always route fungible asset reads through Core AssetsController via AssetsProvider. Keep snap-owned protocol assets on SnapAssetsAdapter for sync, reads, and keyring events. Drop RemoteFeatureFlagController:getState messenger endowment and the remote-feature-flag-controller dependency. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
…etsAdapter Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
cursor
Bot
force-pushed
the
WPN-1497-remove-assets-migration-flag
branch
from
August 5, 2026 19:35
6fe7f9f to
64f08a9
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
SnapsAssetsMigrationStage/ remote feature-flag resolution fromAssetsServiceandSnapAssetsAdaptergetAccountAssetByID,getAccountAssetsByIDs,getAccountAssetsByScope) through CoreAssetsControllerviaAssetsProviderRemoteFeatureFlagController:getStatemessenger endowment and@metamask/remote-feature-flag-controllerdevDependencyPR chain
#90 → #91 → #92 → #95 → #96 → this PR
Test plan
yarn workspace @metamask/tron-wallet-snap run jest --no-coverage src/services/assets/AssetsService.test.ts