Skip to content

[pull] main from MetaMask:main#283

Merged
pull[bot] merged 1 commit into
dmrazzy:mainfrom
MetaMask:main
Aug 15, 2025
Merged

[pull] main from MetaMask:main#283
pull[bot] merged 1 commit into
dmrazzy:mainfrom
MetaMask:main

Conversation

@pull

@pull pull Bot commented Aug 15, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

…ng (#6285)

## Explanation

The PR introduces change to remove the centralized selectors and instead
places a centralized calculation logic that clients can use to create
their own selectors.

- Current: aggregated percent/amount change for balances lives in client
selectors with platform-specific nuances.
- Change: introduce a pure calculator to centralize portfolio change
computation and move the logic out of selectors. Callers
(mobile/extension) can now request 1d/7d/30d change consistently.
- Details:
- EVM: uses TokenRatesController.marketData price and
pricePercentChange{1d|7d|30d}, converted via CurrencyRateController.
- Non‑EVM: uses MultichainAssetsRatesController.conversionRates with
marketData.pricePercentChange.{P1D|P7D|P30D}.
- Previous totals reconstructed via current / (1 + percent/100); amount
and percent change computed from that.
- Honors enabled-network filtering map (same semantics as totals
calculation).

## References

- Internal: ASSETS-1129
- Package: @metamask/assets-controllers
- Related PR: 
Mobile : MetaMask/metamask-mobile#18315
Extension : MetaMask/metamask-extension#35012
## 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, highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to adopt the new calculator

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Salim TOUBAL <salim.toubal@outlook.com>
@pull pull Bot locked and limited conversation to collaborators Aug 15, 2025
@pull pull Bot added the ⤵️ pull label Aug 15, 2025
@pull pull Bot merged commit b7b8be4 into dmrazzy:main Aug 15, 2025
0 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant