chore: filter out Tron staking special assets#40540
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
c38b3d0 to
54dca0d
Compare
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (1 files, +7 -11)
💎 @MetaMask/metamask-assets (1 files, +2 -2)
🔄 @MetaMask/swaps-engineers (3 files, +27 -48)
|
Builds ready [54dca0d]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
54dca0d to
383775f
Compare
Builds ready [383775f]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
383775f to
2ff1a4f
Compare
2ff1a4f to
441486b
Compare
441486b to
5526661
Compare
5526661 to
b0538c7
Compare
b0538c7 to
6fa57ea
Compare
Builds ready [6fa57ea]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
6fa57ea to
e740aa7
Compare
c4358e7 to
e0dcd58
Compare
Builds ready [e0dcd58]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
e0dcd58 to
a4b3db4
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
a4b3db4 to
060402d
Compare
Builds ready [060402d]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
060402d to
b47825b
Compare
## Explanation Tweak the symbols to match both MetaMask/metamask-extension#40540 and MetaMask/metamask-mobile#26360 ## References n/a ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] 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) - [x] 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
Builds ready [b47825b]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Made-with: Cursor
b47825b to
03583ad
Compare
Builds ready [03583ad]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|



Description
As part of Tron's staking experience improvements we will be sending more special assets from the Snap to the Extension. These special assets are not tradeable tokens and should be filtered out from selectors like we already do for Staked TRX for example.
This PR:
Changelog
CHANGELOG entry: null
Related issues
Closes: NEB-582, NEB-584, NEB-586
Manual testing steps
All existing Tron functionality should remain unchanged
Screenshots/Recordings
As you can see, the new assets being loaded from the preview build of MetaMask/snap-tron-wallet#226 are not being shown here.
Before
n/a
After
Screen.Recording.2026-03-04.at.16.23.04.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes token/balance filtering across several UI and bridge selectors based on CAIP parsing; misclassification could hide legitimate Tron assets or affect displayed totals, though covered by new/updated tests.
Overview
Adds a CAIP-based definition of Tron “special assets” (resources plus new staking-state pseudo-assets) via
TRON_SPECIAL_ASSET_CAIP_TYPESand a newisTronSpecialAsset()helper.Updates token lists, bridge asset selectors, and
useMultichainBalancesto filter these special assets byassetIdso they don’t appear in user-facing pickers/lists or contribute to fiat totals, and renames the Tron-assets selector togetAssetsBySelectedAccountGroupWithTronSpecialAssets.Refreshes Tron resource handling in
useTronResourcesto identify energy/bandwidth via CAIP types (ignoring other staking-state assets) and expands unit tests to cover the new filtering behavior.Written by Cursor Bugbot for commit 03583ad. This will update automatically on new commits. Configure here.