Repository navigation
chore(assets-controller): bump assets controller to 20.0.0 - #38308
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
|
Smart E2E Test SelectionSelected E2E tags: ALL AI Confidence: 100 E2E reasoningExpand to readThis PR makes two key changes:
Tag selection rationale:
The hard rule seed specified ALL tags due to controller version updates, but the actual changes are narrowly scoped to: (a) the Money/Card flow for mUSD price refresh, and (b) the pay-with-modal in confirmations. The new |
b60afdc
|



Description
Bumps
@metamask/assets-controllerfrom^19.1.0to^20.0.0and moves the two call sites that forced a price fetch ontoAssetsController.syncAssetsPrices.20.0.0(core#10892) removesassetsForPriceUpdatefromgetAssets. An explicit price refresh is nowsyncAssetsPrices(assetIds), which force-fetches spot prices for a CAIP-19 list and merges them into state. The same release refetches metadata whensymbol,name,decimals,image,aggregators, oroccurrencesis missing, prices a balance from the current response only when that asset has no stored price, skips hidden assets, and removesDetectionMiddlewareplus theAssetsController:assetsDetectedevent.Mobile called the removed option in two places:
useRefreshMusdFiatRate(Money home pull-to-refresh) now callssyncAssetsPriceswith the Monad mUSD asset id. The selected-EVM-account guard, the in-flight promise dedupe, and the swallowed error log stay as they were.useEnsurePayTokenstill registers the token withaddCustomAsseton the pay account (or the selected account). The following price refresh callssyncAssetsPriceswith that token's CAIP-19 id. Registration and the price refresh stay best-effort.@metamask/bridge-controller(^83.1.1) and@metamask/transaction-pay-controller(^30.3.0) move with the bump because they depend on assets-controller 20. Unit tests for both hooks assertsyncAssetsPrices.Changelog
CHANGELOG entry: null
Related issues
Refs: No tracking issue. Companion to MetaMask/metamask-extension#47400 and MetaMask/core#10892.
Manual testing steps
Screenshots/Recordings
N/A — the screens stay the same. This PR swaps the price-refresh API and bumps the controller.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
A major assets-controller bump plus a narrower price-refresh API could affect mUSD and pay-token fiat display if syncAssetsPrices behaves differently than the old getAssets path.
Overview
Upgrades
@metamask/assets-controllerto ^20.0.0 (and@metamask/transaction-pay-controllerto ^30.3.0 with lockfile churn) because v20 dropsgetAssets’sassetsForPriceUpdateoption in favor ofsyncAssetsPrices(assetIds)for forced spot-price fetches.Money home (
useRefreshMusdFiatRate): pull-to-refresh now callssyncAssetsPriceswith the Monad mUSD CAIP-19 id instead ofgetAssetswith account, chain,forceUpdate, and price filters. The selected-EVM-account guard, in-flight promise dedupe, and logged/swallowed errors are unchanged.Withdraw/pay confirmations (
useEnsurePayToken): afteraddCustomAsset, the best-effort fiat refresh usessyncAssetsPrices([token CAIP-19])rather than account-scopedgetAssets. Registration and account-override behavior stay the same.Unit tests for both hooks now mock and assert
syncAssetsPrices. There is also unrelated markdown table column alignment in a PredictNext contract doc.Reviewed by Cursor Bugbot for commit b60afdc. Bugbot is set up for automated code reviews on this repo. Configure here.