You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Explanation
The feature to hide tokens is available for EVM assets but not for
non-EVM assets. This task involves implementing a similar token hiding
feature for non-EVM assets. This is crucial for improving user
experience by allowing users to hide unwanted tokens, especially in
light of spam and malicious token issues. The implementation should be
prioritized to align with upcoming Solana campaigns.
NOTE:
- Changes are needed on Mobile and extension to support this
<!--
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
https://consensyssoftware.atlassian.net/browse/ASSETS-1425
<!--
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/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces `allIgnoredAssets` with `ignoreAssets` action to hide
non‑EVM assets per account and updates detection, selectors, and balance
calculations to exclude ignored assets, including cleanup on account
removal.
>
> - **MultichainAssetsController**:
> - Add `allIgnoredAssets` to state and expose `ignoreAssets` action;
register handler.
> - Filter ignored assets in `accountAssetListUpdated` flow; remove
ignored and active assets on account removal.
> - Keep `assetsMetadata` handling unchanged; add metadata/state
exposure for UI/persist.
> - **Balances**:
> - Update `calculateBalanceForAllWallets`,
`calculateBalanceChangeForAllWallets`, and
`calculateBalanceChangeForAccountGroup` signatures to accept
`MultichainAssetsController` state.
> - Exclude ignored non‑EVM assets from totals and change calculations.
> - **Selectors** (`token-selectors.ts`):
> - Include `allIgnoredAssets` in selector state; exclude ignored
multichain assets from returned asset lists.
> - **Tests**:
> - Add coverage for ignoring/filtering assets, detection behavior, and
cleanup on account removal; adjust balance tests to pass new controller
state.
> - **Changelog**:
> - Note addition of `ignoreAssets` for non‑EVM chains.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f79eece. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments