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>
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.