Skip to content

chore(assets-controller): bump assets controller to 20.0.0 - #38308

Merged
Kriys94 merged 2 commits into
mainfrom
chore/bumpAssetsController20
Oct 29, 2026
Merged

Kriys94 merged 2 commits into
mainfrom
chore/bumpAssetsController20

Conversation

@Kriys94

@Kriys94 Kriys94 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Bumps @metamask/assets-controller from ^19.1.0 to ^20.0.0 and moves the two call sites that forced a price fetch onto AssetsController.syncAssetsPrices.

20.0.0 (core#10892) removes assetsForPriceUpdate from getAssets. An explicit price refresh is now syncAssetsPrices(assetIds), which force-fetches spot prices for a CAIP-19 list and merges them into state. The same release refetches metadata when symbol, name, decimals, image, aggregators, or occurrences is missing, prices a balance from the current response only when that asset has no stored price, skips hidden assets, and removes DetectionMiddleware plus the AssetsController:assetsDetected event.

Mobile called the removed option in two places:

  • useRefreshMusdFiatRate (Money home pull-to-refresh) now calls syncAssetsPrices with the Monad mUSD asset id. The selected-EVM-account guard, the in-flight promise dedupe, and the swallowed error log stay as they were.
  • useEnsurePayToken still registers the token with addCustomAsset on the pay account (or the selected account). The following price refresh calls syncAssetsPrices with 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 assert syncAssetsPrices.

Changelog

CHANGELOG entry: null

Related issues

Refs: No tracking issue. Companion to MetaMask/metamask-extension#47400 and MetaMask/core#10892.

Manual testing steps

Feature: assets controller 20 price refresh

  Scenario: Money home pull-to-refresh updates the mUSD fiat value
    Given the app is built from this branch and unlocked on an account that can open Money home
    And Money home shows an mUSD balance

    When the user pulls to refresh on Money home
    Then the mUSD fiat value finishes loading
    And the refresh spinner clears

  Scenario: a zero-balance withdraw pay token gets a fiat rate
    Given a withdraw confirmation whose pay-with sheet lists a non-native token with a zero balance

    When the user selects that token as the pay token
    Then the confirmation shows the token with a fiat rate
    And the confirmation does not stay waiting on a price

  Scenario: the wallet asset list still shows balances and prices
    Given the app is unlocked on an account that holds tokens on Ethereum Mainnet

    When the user opens the home asset list
    Then symbols, balances, and fiat prices appear

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)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

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-controller to ^20.0.0 (and @metamask/transaction-pay-controller to ^30.3.0 with lockfile churn) because v20 drops getAssets’s assetsForPriceUpdate option in favor of syncAssetsPrices(assetIds) for forced spot-price fetches.

Money home (useRefreshMusdFiatRate): pull-to-refresh now calls syncAssetsPrices with the Monad mUSD CAIP-19 id instead of getAssets with 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): after addCustomAsset, the best-effort fiat refresh uses syncAssetsPrices([token CAIP-19]) rather than account-scoped getAssets. 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.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added size-S pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Oct 27, 2026
@socket-security

socket-security Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​ramps-controller@​27.1.0 ⏵ 28.1.0100 +210080 +1100 +1100
Updatednpm/​@​metamask/​transaction-pay-controller@​30.2.0 ⏵ 30.3.099 +510081 +1100 +1100

View full report

@socket-security

socket-security Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Potential code anomaly (AI signal): npm @metamask/transaction-pay-controller is 96.0% likely to have a medium risk anomaly

Notes: This code implements a server-quote transaction flow and is not clearly malware. It signs quote-provided typed data and sends signatures to a quote-provided endpoint, and submits quote-derived transactions with requireApproval:false; a malicious or compromised quote source could therefore cause unauthorized signing or transaction submission. No fixed domain, URL, IP, credential target, or environment-variable access is present in the fragment. Severity is medium to high depending on validation and trust controls outside this file.

Confidence: 0.96

Severity: 0.63

From: package.json → npm/@metamask/transaction-pay-controller@30.3.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/transaction-pay-controller@30.3.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@Kriys94 Kriys94 added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags: ALL

AI Confidence: 100

E2E reasoning

Expand to read

This PR makes two key changes:

  1. Controller version bumps (package.json - CRITICAL): @metamask/assets-controller v19→v20 (major) and @metamask/transaction-pay-controller v30.2→v30.3 (minor). The major assets-controller bump introduces a new API (syncAssetsPrices replacing getAssets for price updates), which is the core change in this PR.

  2. API migration in useRefreshMusdFiatRate.ts: Switches from AssetsController.getAssets() to AssetsController.syncAssetsPrices(). This hook is used in MoneyHomeView — directly affecting the SmokeMoney flow (MetaMask Card home screen and fiat flows).

  3. API migration in useEnsurePayToken.ts: Same API switch, used in pay-with-modal (the gas fee token payment modal in confirmations). This affects SmokeConfirmations — specifically EIP-7702 advanced gas fee token payment flows.

  4. Documentation change (canonical-portfolio-activity-catalog-contract.md): Pure table formatting/whitespace changes — cosmetic, no functional impact, no test selection needed.

Tag selection rationale:

  • SmokeMoney: useRefreshMusdFiatRate is directly used in MoneyHomeView, which is the Card home screen. The mUSD fiat rate refresh is core to the Money/Card flow.
  • SmokeConfirmations: useEnsurePayToken is used in pay-with-modal which is part of the transaction confirmation flow for gas fee token payments (EIP-7702). Per tag description, also select SmokeConfirmations when SmokeMoney flows execute transactions.
  • SmokeSwap: Per SmokeMoney tag description, when selecting SmokeMoney for flows that execute swaps, also select SmokeSwap. The assets-controller major version bump could affect token price data used in swap flows.
  • SmokeWalletPlatform: Per SmokeMoney tag description, when changes touch wallet home or actions entry to buy/sell, also select SmokeWalletPlatform. The assets-controller price sync affects token display across the wallet.

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 syncAssetsPrices API is a simpler interface that reduces parameters, and both hooks have comprehensive unit test coverage updated in this PR. Running the directly impacted flows plus their dependent tags provides adequate coverage without running all tests.

View run

@Kriys94
Kriys94 marked this pull request as ready for review October 28, 2026 09:20
@Kriys94
Kriys94 requested review from a team as code owners October 28, 2026 09:20
@Kriys94
Kriys94 enabled auto-merge October 28, 2026 16:04
Matt561
Matt561 previously approved these changes Oct 28, 2026

@Matt561 Matt561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kriys94 I don't have capacity to test but Earn-owned changes make sense and pass static analysis. Approving 👍.

@Kriys94
Kriys94 disabled auto-merge October 28, 2026 23:19
@Kriys94
Kriys94 requested a review from a team as a code owner October 29, 2026 08:37
@sonarqubecloud

Copy link
Copy Markdown

@Kriys94
Kriys94 enabled auto-merge October 29, 2026 10:20
@Kriys94
Kriys94 disabled auto-merge October 29, 2026 10:22
@Kriys94
Kriys94 added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 97ebd24 Oct 29, 2026
151 of 178 checks passed
@Kriys94
Kriys94 deleted the chore/bumpAssetsController20 branch October 29, 2026 10:32
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2026
@metamask-ci metamask-ci Bot added the release-8.19.0 Issue or pull request that will be included in release 8.19.0 label Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-8.19.0 Issue or pull request that will be included in release 8.19.0 size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants