-
Notifications
You must be signed in to change notification settings - Fork 5.4k
chore: prioritize price-api for currencyRateController exchange rates… #36986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: prioritize price-api for currencyRateController exchange rates… #36986
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. |
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [5ed1d3d]
UI Startup Metrics (1252 ± 82 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [aaef5d0]
UI Startup Metrics (1251 ± 60 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [7ed57a5]
UI Startup Metrics (1234 ± 88 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [4516fb4]
UI Startup Metrics (1299 ± 99 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [0928c64]
UI Startup Metrics (1279 ± 102 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…er (#6863) ## Explanation PR to update the `CurrencyRatesController` so it uses the Price API for exchange rates, with CryptoCompare as a fallback. ## References * Related to extension: MetaMask/metamask-extension#36986 * Related to mobile: MetaMask/metamask-mobile#21523 ## 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/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > CurrencyRateController now uses the Price API (with CryptoCompare fallback) via a new required tokenPricesService, and CodefiTokenPricesServiceV2 adds fetchExchangeRates. > > - **Controllers**: > - **CurrencyRateController**: Fetches exchange rates from Price API via `tokenPricesService.fetchExchangeRates`, with fallback to CryptoCompare; updates polling and state mapping; requires new constructor arg `tokenPricesService` (BREAKING). > - **Token Prices Service**: > - **Abstract API**: Adds `ExchangeRate`/`ExchangeRatesByCurrency` types and new `fetchExchangeRates(args)`. > - **CodefiTokenPricesServiceV2**: Implements `fetchExchangeRates` using `/v1/exchange-rates`, supports optional USD rate merging, retries/circuit-breaker hooks, and filtering. > - **Tests**: > - Update `CurrencyRateController.test.ts` to assert Price API path, fallback behavior, USD inclusion, and polling; adjust mocks across related tests to include `fetchExchangeRates`. > - **Docs/Meta**: > - Update `CHANGELOG.md` with breaking change and new functionality. > - Minor lint threshold updates. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d22e0af. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [2ab1ee7]
UI Startup Metrics (1261 ± 98 ms)
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [3ad4311]
UI Startup Metrics (1244 ± 74 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
PR to introduce fetching exchangeRates from price api and fallback to crypto compare.
Do not merge until this goes in MetaMask/core#6863
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2025-10-22.at.14.35.00.mov
After
Screen.Recording.2025-10-22.at.14.31.27.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Integrates Codefi price API into
CurrencyRateControllerand includes multichain asset state in balance calculations; wiresallIgnoredAssetsacross state/Sentry and bumps key deps.CodefiTokenPricesServiceV2intoCurrencyRateControllerviatokenPricesService; update init and tests/mocks.getAllIgnoredAssetsand include{ accountsAssets, assetsMetadata, allIgnoredAssets }in balance and balance-change selectors (selectBalanceForAllWallets, etc.).metamask.allIgnoredAssetsto app state, Sentry background/UI masks, mock states, and snapshots.@metamask/assets-controllersto^85.0.0and@metamask/controller-utilsto^11.15.0; remove yarn patch for controller-utils and lockfile updates.allIgnoredAssets.Written by Cursor Bugbot for commit 3ad4311. This will update automatically on new commits. Configure here.