Skip to content

revert: revert: staking improvements' special assets#226

Merged
ulissesferreira merged 2 commits into
mainfrom
revert/staking-improvements-revert
Mar 5, 2026
Merged

revert: revert: staking improvements' special assets#226
ulissesferreira merged 2 commits into
mainfrom
revert/staking-improvements-revert

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

This reverts commit 6c5902b.

Explanation

We had to revert some changes because we wanted to release a new version of the Snap without them (they need client changes to match). This PR brings those changes back by simply reverting the revert

References

Relates to: NEB-581, NEB-583, NEB-585

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@ulissesferreira ulissesferreira changed the title Revert "Revert staking improvements special assets (#222)" revert: revert: staking improvements' special assets Mar 4, 2026
@ulissesferreira ulissesferreira force-pushed the revert/staking-improvements-revert branch from 1d9b55b to ad1da3d Compare March 4, 2026 15:47
@ulissesferreira ulissesferreira marked this pull request as ready for review March 4, 2026 16:03
@ulissesferreira ulissesferreira requested a review from a team as a code owner March 4, 2026 16:03
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/tron-wallet-snap": "1.22.1-preview-9433cd9"
}

@ulissesferreira ulissesferreira merged commit b5fdee0 into main Mar 5, 2026
11 of 12 checks passed
@ulissesferreira ulissesferreira deleted the revert/staking-improvements-revert branch March 5, 2026 02:14
github-merge-queue Bot pushed a commit to MetaMask/metamask-mobile that referenced this pull request Mar 6, 2026
## **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:
- Adds the new special assets that should be ignored by the selectors
- Renames the variables that deal with this logic to be more inclusive
of assets that are not resources (only Energy and Bandwidth are
resources)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Closes:
[NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582),
[NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584),
[NEB-586](https://consensyssoftware.atlassian.net/browse/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**

n/a

## **Pre-merge author checklist**

- [x] I've followed MetaMask Contributor Docs and MetaMask Mobile Coding
Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using JSDoc format if applicable
- [x] I've applied the right labels on the PR

[NEB-582]:
https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-584]:
https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-586]:
https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes token/asset filtering for Tron by excluding additional
Snap-provided “special assets” from sorted asset lists and unified
multichain token lists, which could inadvertently hide tokens if symbols
collide or filtering is misapplied. Scope is contained to Tron
selectors/utilities and related UI consumers, with broad test updates.
> 
> **Overview**
> Introduces a broader Tron *“special assets”* concept (resources +
staking lifecycle assets) and filters these virtual tokens out of
user-facing asset/token lists.
> 
> Renames and expands the Tron selector from
`selectTronResourcesBySelectedAccountGroup` to
`selectTronSpecialAssetsBySelectedAccountGroup` (and `TronResourcesMap`
to `TronSpecialAssetsMap`), adding mappings for `trxReadyForWithdrawal`,
`trxStakingRewards`, and `trxInLockPeriod` while preserving
`totalStakedTrx` computation.
> 
> Centralizes special-asset detection in `core/Multichain/utils` via
`isTronSpecialAsset` and reuses it in
`selectSortedAssetsBySelectedAccountGroup`,
`selectAccountTokensAcrossChainsUnified`, and Bridge `isTradableToken`;
updates related Earn/TokenDetails/AssetOverview hooks and tests
accordingly.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
893e98a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
github-merge-queue Bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Mar 6, 2026
## **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:
- Adds the new special assets that should be ignored by the selectors
- Renames the variables that deal with this logic to be more inclusive
of assets that are not resources (only Energy and Bandwidth are
resources)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/40540?quickstart=1)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Closes:
[NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582),
[NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584),
[NEB-586](https://consensyssoftware.atlassian.net/browse/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**


https://github.com/user-attachments/assets/1b4f445f-ab72-486e-a8b5-e177a33b5d8f

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


[NEB-582]:
https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-584]:
https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-586]:
https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


<!-- CURSOR_SUMMARY -->
---

> [!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_TYPES` and a new `isTronSpecialAsset()` helper.
> 
> Updates token lists, bridge asset selectors, and
`useMultichainBalances` to filter these special assets by `assetId` so
they don’t appear in user-facing pickers/lists or contribute to fiat
totals, and renames the Tron-assets selector to
`getAssetsBySelectedAccountGroupWithTronSpecialAssets`.
> 
> Refreshes Tron resource handling in `useTronResources` to identify
energy/bandwidth via CAIP types (ignoring other staking-state assets)
and expands unit tests to cover the new filtering behavior.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
03583ad. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
github-merge-queue Bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Mar 6, 2026
## **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:
- Adds the new special assets that should be ignored by the selectors
- Renames the variables that deal with this logic to be more inclusive
of assets that are not resources (only Energy and Bandwidth are
resources)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/40540?quickstart=1)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Closes:
[NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582),
[NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584),
[NEB-586](https://consensyssoftware.atlassian.net/browse/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**


https://github.com/user-attachments/assets/1b4f445f-ab72-486e-a8b5-e177a33b5d8f

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


[NEB-582]:
https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-584]:
https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-586]:
https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


<!-- CURSOR_SUMMARY -->
---

> [!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_TYPES` and a new `isTronSpecialAsset()` helper.
> 
> Updates token lists, bridge asset selectors, and
`useMultichainBalances` to filter these special assets by `assetId` so
they don’t appear in user-facing pickers/lists or contribute to fiat
totals, and renames the Tron-assets selector to
`getAssetsBySelectedAccountGroupWithTronSpecialAssets`.
> 
> Refreshes Tron resource handling in `useTronResources` to identify
energy/bandwidth via CAIP types (ignoring other staking-state assets)
and expands unit tests to cover the new filtering behavior.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
03583ad. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
montelaidev pushed a commit to MetaMask/metamask-extension that referenced this pull request Mar 12, 2026
## **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:
- Adds the new special assets that should be ignored by the selectors
- Renames the variables that deal with this logic to be more inclusive
of assets that are not resources (only Energy and Bandwidth are
resources)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/40540?quickstart=1)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Closes:
[NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582),
[NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584),
[NEB-586](https://consensyssoftware.atlassian.net/browse/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**


https://github.com/user-attachments/assets/1b4f445f-ab72-486e-a8b5-e177a33b5d8f

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


[NEB-582]:
https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-584]:
https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NEB-586]:
https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


<!-- CURSOR_SUMMARY -->
---

> [!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_TYPES` and a new `isTronSpecialAsset()` helper.
> 
> Updates token lists, bridge asset selectors, and
`useMultichainBalances` to filter these special assets by `assetId` so
they don’t appear in user-facing pickers/lists or contribute to fiat
totals, and renames the Tron-assets selector to
`getAssetsBySelectedAccountGroupWithTronSpecialAssets`.
> 
> Refreshes Tron resource handling in `useTronResources` to identify
energy/bandwidth via CAIP types (ignoring other staking-state assets)
and expands unit tests to cover the new filtering behavior.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
03583ad. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants