fix(client-utils): require chainId on ramp activity items - #9777
Merged
Conversation
georgeweiler
temporarily deployed
to
default-branch
August 4, 2026 09:30 — with
GitHub Actions
Inactive
Contributor
Author
|
@metamaskbot publish-previews |
georgeweiler
added a commit
that referenced
this pull request
Aug 4, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
georgeweiler
added a commit
that referenced
this pull request
Aug 4, 2026
Use toStrictEqual in addPrecreatedOrder tests, merge Unreleased Changed changelog sections, and regenerate messenger action types after making chainId required. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
7 tasks
wenfix
previously approved these changes
Aug 4, 2026
8 tasks
georgeweiler
enabled auto-merge
August 4, 2026 11:04
FrederikBolding
previously approved these changes
Aug 4, 2026
n3ps
previously approved these changes
Aug 4, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 4, 2026
Make rampBuy/rampSell ActivityItem.chainId required like every other kind. mapRampsOrder returns null when no CAIP chain can be resolved, matching mobile's existing hide-if-unresolved behavior. Also require a non-empty chainId on RampsController.addPrecreatedOrder so checkout stubs always seed network before pending flips. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Preview/release pipelines own the version bump; leave the breaking change under Unreleased. Co-authored-by: Cursor <cursoragent@cursor.com>
Use toStrictEqual in addPrecreatedOrder tests, merge Unreleased Changed changelog sections, and regenerate messenger action types after making chainId required. Co-authored-by: Cursor <cursoragent@cursor.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 4, 2026
Rebase onto main after Release/1172.0.0 moved prior Unreleased entries into 19.0.0. Ensure the addPrecreatedOrder chainId BREAKING note stays in Unreleased so merge-queue changelog validation passes. Co-authored-by: Cursor <cursoragent@cursor.com>
georgeweiler
dismissed stale reviews from n3ps, FrederikBolding, and wenfix
via
August 4, 2026 13:10
a795eb7
georgeweiler
force-pushed
the
feat/client-utils-required-ramp-chainid
branch
from
August 4, 2026 13:10
87b5a39 to
a795eb7
Compare
Contributor
Author
Changelog fix for merge-queueAfter rebasing onto Removed the duplicate from |
n3ps
approved these changes
Aug 4, 2026
georgeweiler
enabled auto-merge
August 4, 2026 13:26
wenfix
approved these changes
Aug 4, 2026
georgeweiler
added a commit
that referenced
this pull request
Aug 4, 2026
Publish the #9777 breaking change that requires chainId on rampBuy/rampSell ActivityItem variants. Co-authored-by: Cursor <cursoragent@cursor.com>
pull Bot
pushed a commit
to dmrazzy/core
that referenced
this pull request
Aug 4, 2026
## Explanation Releasing `@metamask/client-utils@2.0.0` to ship the breaking ramp activity `chainId` change from MetaMask#9777. ## Changes - **`@metamask/client-utils` `1.6.0` → `2.0.0`** - **BREAKING:** `rampBuy` / `rampSell` `ActivityItem` variants require `chainId`; `mapRampsOrder` returns `null` when no CAIP chain can be resolved - Dependency bumps for `@metamask/transaction-controller` and `@metamask/core-backend` already present under Unreleased ## Client follow-ups - Extension: MetaMask/metamask-extension#45143 - Mobile: MetaMask/metamask-mobile#34246 (ramps-controller side already shipped in 20.0.0) ## 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/processes/updating-changelogs.md) - [x] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
pull Bot
pushed a commit
to GoddessofPazkar/metamask-extension
that referenced
this pull request
Aug 5, 2026
## **Description** Bumps `@metamask/client-utils` to published `^2.0.0` (resolves to `2.0.0`) from [MetaMask/core#9777](MetaMask/core#9777). ### Changes - Replace Yarn `previewBuilds` preview (`1.6.0-preview-*`) with published `@metamask/client-utils@^2.0.0` - Required `chainId` on ramp Activity items; `mapRampsOrder` returns `null` when chainId cannot be resolved - Keep Activity type re-export simple (no `Exclude` workaround for ramps) - Treat a missing token `amount` with `symbol`/`assetId` as `0` in `getHumanReadableTokenAmount`, since client-utils still omits zero native `txParams.value` (keeps Activity showing `-0 ETH`) - Refresh `yarn.lock`, LavaMoat webpack policies, and attributions - Synced branch with latest `origin/main` ### Out of scope - Does **not** bump `@metamask/ramps-controller` (remains `^15.0.0` unless a follow-up requires it) ## **Changelog** CHANGELOG entry: null ## **Related issues** Related to: TRAM-3718 Core: MetaMask/core#9777 Stacked / related feature work: MetaMask#45184 ## **Manual testing steps** 1. Load a development build of the extension (`yarn start`). 2. Unlock a wallet and open **Activity** on Mainnet. 3. Confirm the activity list loads without type/runtime errors. 4. Send a zero-value transaction (or open a zero-value contract interaction) and confirm the Activity row shows `-0 ETH` rather than a blank amount. 5. Confirm `@metamask/client-utils` resolves to `2.0.0` (`yarn why @metamask/client-utils`). <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **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 - [ ] 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] > **Medium Risk** > Dependency upgrade across activity mapping and transaction-controller with LavaMoat policy changes; localized app logic mitigates zero-value display regressions but upstream mapper behavior changes could still affect Activity. > > **Overview** > Upgrades **`@metamask/client-utils`** from a Yarn-patched **1.2.0** to published **`^2.0.0`**, dropping the local patch that added extra CAIP native-asset entries (those chains are expected to ship in the upstream package). The lockfile pulls in related MetaMask core bumps (e.g. **`transaction-controller`**, **`core-backend`**, **`account-tree-controller`**, **`profile-sync-controller`**) and refreshes **LavaMoat** webpack policies and **attributions**. > > Activity display is adjusted so **`getHumanReadableTokenAmount`** treats a missing `amount` with token **`symbol`/`assetId`** as **`0`**, matching client-utils omitting zero native `txParams.value` so rows still show amounts like **`-0 ETH`**. Tests cover that behavior and the non-EVM activity selector setup is updated for Solana send classification. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit dde55ff. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com> Co-authored-by: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
Bigshmow
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Aug 5, 2026
## **Description** Bumps `@metamask/client-utils` to published `^2.0.0` (resolves to `2.0.0`) from [MetaMask/core#9777](MetaMask/core#9777). ### Changes - Replace Yarn `previewBuilds` preview (`1.6.0-preview-*`) with published `@metamask/client-utils@^2.0.0` - Required `chainId` on ramp Activity items; `mapRampsOrder` returns `null` when chainId cannot be resolved - Keep Activity type re-export simple (no `Exclude` workaround for ramps) - Treat a missing token `amount` with `symbol`/`assetId` as `0` in `getHumanReadableTokenAmount`, since client-utils still omits zero native `txParams.value` (keeps Activity showing `-0 ETH`) - Refresh `yarn.lock`, LavaMoat webpack policies, and attributions - Synced branch with latest `origin/main` ### Out of scope - Does **not** bump `@metamask/ramps-controller` (remains `^15.0.0` unless a follow-up requires it) ## **Changelog** CHANGELOG entry: null ## **Related issues** Related to: TRAM-3718 Core: MetaMask/core#9777 Stacked / related feature work: #45184 ## **Manual testing steps** 1. Load a development build of the extension (`yarn start`). 2. Unlock a wallet and open **Activity** on Mainnet. 3. Confirm the activity list loads without type/runtime errors. 4. Send a zero-value transaction (or open a zero-value contract interaction) and confirm the Activity row shows `-0 ETH` rather than a blank amount. 5. Confirm `@metamask/client-utils` resolves to `2.0.0` (`yarn why @metamask/client-utils`). <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **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 - [ ] 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] > **Medium Risk** > Dependency upgrade across activity mapping and transaction-controller with LavaMoat policy changes; localized app logic mitigates zero-value display regressions but upstream mapper behavior changes could still affect Activity. > > **Overview** > Upgrades **`@metamask/client-utils`** from a Yarn-patched **1.2.0** to published **`^2.0.0`**, dropping the local patch that added extra CAIP native-asset entries (those chains are expected to ship in the upstream package). The lockfile pulls in related MetaMask core bumps (e.g. **`transaction-controller`**, **`core-backend`**, **`account-tree-controller`**, **`profile-sync-controller`**) and refreshes **LavaMoat** webpack policies and **attributions**. > > Activity display is adjusted so **`getHumanReadableTokenAmount`** treats a missing `amount` with token **`symbol`/`assetId`** as **`0`**, matching client-utils omitting zero native `txParams.value` so rows still show amounts like **`-0 ETH`**. Tests cover that behavior and the non-EVM activity selector setup is updated for Solana send classification. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit dde55ff. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com> Co-authored-by: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
n3ps
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Aug 6, 2026
## **Description** Bumps `@metamask/client-utils` to published `^2.0.0` (resolves to `2.0.0`) from [MetaMask/core#9777](MetaMask/core#9777). ### Changes - Replace Yarn `previewBuilds` preview (`1.6.0-preview-*`) with published `@metamask/client-utils@^2.0.0` - Required `chainId` on ramp Activity items; `mapRampsOrder` returns `null` when chainId cannot be resolved - Keep Activity type re-export simple (no `Exclude` workaround for ramps) - Treat a missing token `amount` with `symbol`/`assetId` as `0` in `getHumanReadableTokenAmount`, since client-utils still omits zero native `txParams.value` (keeps Activity showing `-0 ETH`) - Refresh `yarn.lock`, LavaMoat webpack policies, and attributions - Synced branch with latest `origin/main` ### Out of scope - Does **not** bump `@metamask/ramps-controller` (remains `^15.0.0` unless a follow-up requires it) ## **Changelog** CHANGELOG entry: null ## **Related issues** Related to: TRAM-3718 Core: MetaMask/core#9777 Stacked / related feature work: #45184 ## **Manual testing steps** 1. Load a development build of the extension (`yarn start`). 2. Unlock a wallet and open **Activity** on Mainnet. 3. Confirm the activity list loads without type/runtime errors. 4. Send a zero-value transaction (or open a zero-value contract interaction) and confirm the Activity row shows `-0 ETH` rather than a blank amount. 5. Confirm `@metamask/client-utils` resolves to `2.0.0` (`yarn why @metamask/client-utils`). <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **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 - [ ] 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] > **Medium Risk** > Dependency upgrade across activity mapping and transaction-controller with LavaMoat policy changes; localized app logic mitigates zero-value display regressions but upstream mapper behavior changes could still affect Activity. > > **Overview** > Upgrades **`@metamask/client-utils`** from a Yarn-patched **1.2.0** to published **`^2.0.0`**, dropping the local patch that added extra CAIP native-asset entries (those chains are expected to ship in the upstream package). The lockfile pulls in related MetaMask core bumps (e.g. **`transaction-controller`**, **`core-backend`**, **`account-tree-controller`**, **`profile-sync-controller`**) and refreshes **LavaMoat** webpack policies and **attributions**. > > Activity display is adjusted so **`getHumanReadableTokenAmount`** treats a missing `amount` with token **`symbol`/`assetId`** as **`0`**, matching client-utils omitting zero native `txParams.value` so rows still show amounts like **`-0 ETH`**. Tests cover that behavior and the non-EVM activity selector setup is updated for Solana send classification. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit dde55ff. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com> Co-authored-by: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
rampBuy/rampSellwere the onlyActivityItemkinds with optionalchainId, which softenschainIdacross the whole union for TypeScript consumers (notably MetaMask Extension Activity).mapRampOrder(returnsnullwhen chain cannot be resolved).Changes
@metamask/client-utils: MakechainIdrequired on ramp activity items;mapRampsOrderreturnsnullwhen no CAIP chain can be resolved.@metamask/ramps-controller: Require non-emptychainIdonaddPrecreatedOrderso checkout stubs always seednetworkbefore pending flips.Client follow-ups
client-utilspreview build; drops ActivityExclude/ optional-chainIdsafeguards.ramps-controllerpreview build; requireschainIdataddPrecreatedOrdercall sites.Manual Testing Steps
yarn workspace @metamask/client-utils test --testPathPatterns=ramps-order-mapper --coverage=falseyarn workspace @metamask/ramps-controller test --testPathPatterns=RampsController.test --testNamePattern=addPrecreatedOrder --coverage=falsenetwork: 'ethereum'viacryptoCurrency.chainId/assetId.Changelog
Updated
@metamask/client-utilsand@metamask/ramps-controllerchangelogs under Unreleased (BREAKING).Note
Medium Risk
Breaking API changes in two packages require Extension/Mobile upgrades; behavior change hides ramp rows that previously appeared without chain, which is intentional but affects activity lists.
Overview
Breaking:
rampBuy/rampSellActivityItemvariants now requirechainIdlike every other activity kind, so TypeScript consumers no longer treatchainIdas optional on the whole union.In
@metamask/client-utils,mapRampsOrderresolves chain id up front and returnsnullwhen no CAIP-2 id can be derived (empty network, unparseable provider network strings withoutcryptoCurrencyfallbacks, invalidassetId), instead of emitting rows with missingchainId. The ramp types drop the special optional-chainIdintersection.In
@metamask/ramps-controller,addPrecreatedOrderrequires a non-emptychainId(decimal, hex, or CAIP-2); whitespace-only values are ignored like invalidorderId, and stubs always setnetwork.chainIdfrom the caller so pending activity can map before API enrichment.Reviewed by Cursor Bugbot for commit a795eb7. Bugbot is set up for automated code reviews on this repo. Configure here.