feat: remove provider ID normalization and update related functionality#9448
Merged
Conversation
…ion and removal of normalizeProviderCode export
The messenger-action-types:check CI step failed because RampsController-method-action-types.ts embeds the getBuyWidgetData method JSDoc, which changed when the providerCode param doc was updated to describe canonical (non-prefixed) provider codes. Regenerated via messenger-action-types --generate.
1bf463e to
d67a44d
Compare
wenfix
previously approved these changes
Jul 10, 2026
wenfix
previously approved these changes
Jul 10, 2026
…efix-providers # Conflicts: # packages/ramps-controller/CHANGELOG.md
wenfix
approved these changes
Jul 10, 2026
pull Bot
pushed a commit
to dmrazzy/core
that referenced
this pull request
Jul 13, 2026
## Explanation This is the release PR for **Release 1116.0.0** of the core monorepo. It bumps the root monorepo version from 1115.0.0 to 1116.0.0 and publishes new versions of two packages: - **`@metamask/ramps-controller` 15.1.0 → 16.0.0 (major)**: Releases the breaking change from MetaMask#9448, which removes normalization of provider IDs (the `/providers/` prefix is no longer stripped). `RampsController.getQuotes` now matches provider IDs from the providers list, quotes, custom actions, and sort order as-is, and a precreated stub order's `provider.id` is the canonical provider code passed to the create-order call. Consumers must supply non-prefixed (canonical) provider IDs. Also includes the MIT license text update from MetaMask#9472. - **`@metamask/transaction-pay-controller` 24.0.2 → 24.0.3 (patch)**: Bumps its `@metamask/ramps-controller` dependency to `^16.0.0` and includes the MIT license text update from MetaMask#9472. No source code changes are included in this PR itself; it only contains version bumps, changelog updates, and the corresponding `yarn.lock` update. ## References - Includes MetaMask#9448 (breaking `ramps-controller` provider ID change) - Includes MetaMask#9472 (MIT license text update) - Previous release: MetaMask#9470 (Release 1115.0.0) ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] 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) - [ ] 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 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > The release surfaces a major breaking change in ramps provider ID handling; downstream apps must adopt canonical IDs and stop using `normalizeProviderCode`, though this PR itself only bumps versions. > > **Overview** > Release **1116.0.0** bumps the root monorepo and publishes two packages with **no runtime code changes in this PR**—only versions, changelogs, and `yarn.lock`. > > **`@metamask/ramps-controller` 16.0.0** ships the breaking ramps behavior from MetaMask#9448: provider IDs are no longer normalized (no `/providers/` prefix stripping), `normalizeProviderCode` is removed, and callers must use canonical provider IDs for quotes and create-order. Changelog also records the MIT **LICENSE** text update (MetaMask#9472). > > **`@metamask/transaction-pay-controller` 24.0.3** is a patch that raises its **`@metamask/ramps-controller`** dependency to `^16.0.0` (MetaMask#9481) and includes the same LICENSE changelog note (MetaMask#9472). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8fb0397. 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: Darius Costolas <10818970+meltingice1337@users.noreply.github.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
@metamask/ramps-controllernormalized provider IDs by stripping a/providers/prefix through anormalizeProviderCodehelper. This normalization was applied in two places: across thegetQuotesscope-aware selection logic (matching the providers list, each quote'sprovider, custom-action provider IDs, and the sort-order IDs) and when building a precreated stub order, where the provider code was re-wrapped as/providers/<code>. The Ramps backend now returns canonical, non-prefixed provider IDs, so this normalization is unnecessary and inconsistent with the new contract.This PR removes provider-ID normalization entirely so IDs are compared and stored as-is (canonical). Concretely: the
normalizeProviderCodefunction and its public export are removed; the sixnormalizeProviderCode(...)call sites in thegetQuotesselection logic are dropped so the map keys and lookups use the raw provider IDs; and a precreated stub order'sprovider.idis now the canonical provider code passed to the create-order call rather than a/providers/-prefixed value. The dedicatednormalizeProviderCodeunit test is removed and the stub-order test now expects the canonicalpaypalID.One detail worth calling out for reviewers: the six removed call sites were added recently in #9353 (scope-aware in-app provider widening). Because normalization is removed uniformly from both sides of every map key and lookup, matching behavior is preserved for consistently-formatted IDs, and the existing
getQuotestests continue to pass unchanged (308 tests green).This is a breaking change:
normalizeProviderCodeis no longer exported, and the precreated stub order'sprovider.idchanges shape from/providers/<code>to<code>. Consumers must supply non-prefixed (canonical) provider IDs. The mobile consumer PR removes allnormalizeProviderCodeusages and the app-side normalization to adopt this.References
getQuotesnormalization removed here)Checklist
Note
Medium Risk
Breaking API and state shape changes for buy/quote flows; wrong IDs from consumers that still pass
/providers/-prefixed values could break quote selection or order polling until clients migrate.Overview
Breaking change:
@metamask/ramps-controllerdrops/providers/prefix normalization so provider IDs are compared and stored as canonical codes (e.g.paypal,transak).The
normalizeProviderCodehelper and its public export are removed. IngetQuotesscope-aware selection, maps and lookups now use rawprovider.id, quoteprovider, custom-actionproviderId, and sort-order IDs with no stripping.addPrecreatedOrdersets stubprovider.idto the passedproviderCodeinstead of/providers/<code>.JSDoc and the changelog document the contract. Tests drop the normalizer suite, expect canonical
paypalon stubs, and add coverage for plain-ID matching in scoped quote selection.Reviewed by Cursor Bugbot for commit e352e4f. Bugbot is set up for automated code reviews on this repo. Configure here.