Commit 67fcea3
chore: prioritize price-api for currencyRateController exchange rates… (#36986)
## **Description**
PR to introduce fetching exchangeRates from price api and fallback to
crypto compare.
Do not merge until this goes in
MetaMask/core#6863
[](https://codespaces.new/MetaMask/metamask-extension/pull/36986?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
1. Go to this page...
2.
3.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/a8dc4ac7-9810-48a5-8fdd-19f0bc9f8b92
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/dcb1c517-5b9c-464d-aa27-853c7c99a781
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Integrates Codefi price API into `CurrencyRateController` and includes
multichain asset state in balance calculations; wires `allIgnoredAssets`
across state/Sentry and bumps key deps.
>
> - **Rates/Controller Init**:
> - Inject `CodefiTokenPricesServiceV2` into `CurrencyRateController`
via `tokenPricesService`; update init and tests/mocks.
> - **Selectors/Balances**:
> - Add `getAllIgnoredAssets` and include `{ accountsAssets,
assetsMetadata, allIgnoredAssets }` in balance and balance-change
selectors (`selectBalanceForAllWallets`, etc.).
> - **State/Telemetry**:
> - Add `metamask.allIgnoredAssets` to app state, Sentry background/UI
masks, mock states, and snapshots.
> - **Dependencies**:
> - Bump `@metamask/assets-controllers` to `^85.0.0` and
`@metamask/controller-utils` to `^11.15.0`; remove yarn patch for
controller-utils and lockfile updates.
> - **Misc**:
> - Update storybook test data and integration/e2e fixtures to include
`allIgnoredAssets`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3ad4311. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Bernardo Garces Chapero <[email protected]>
Co-authored-by: juanmigdr <[email protected]>1 parent ca58ee1 commit 67fcea3
File tree
18 files changed
+116
-313
lines changed- .storybook
- .yarn/patches
- app/scripts
- constants
- controller-init
- test
- data
- e2e
- fixtures
- tests/metrics
- state-snapshots
- integration/data
- ui/selectors
18 files changed
+116
-313
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| 693 | + | |
693 | 694 | | |
694 | 695 | | |
695 | 696 | | |
| |||
Lines changed: 0 additions & 261 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
18 | 30 | | |
19 | 31 | | |
20 | 32 | | |
| |||
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
| 44 | + | |
32 | 45 | | |
33 | 46 | | |
34 | 47 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 244 | + | |
253 | 245 | | |
254 | 246 | | |
255 | 247 | | |
| |||
277 | 269 | | |
278 | 270 | | |
279 | 271 | | |
280 | | - | |
| 272 | + | |
281 | 273 | | |
282 | 274 | | |
283 | 275 | | |
284 | 276 | | |
285 | 277 | | |
286 | 278 | | |
287 | 279 | | |
288 | | - | |
| 280 | + | |
289 | 281 | | |
290 | 282 | | |
291 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2340 | 2340 | | |
2341 | 2341 | | |
2342 | 2342 | | |
| 2343 | + | |
| 2344 | + | |
2343 | 2345 | | |
2344 | 2346 | | |
2345 | 2347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
| 907 | + | |
907 | 908 | | |
908 | 909 | | |
909 | 910 | | |
| |||
0 commit comments