fix(ramps): Prevent wallet=undefined param and heal walletAddress in order refresh#8251
Merged
Merged
Conversation
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Contributor
Author
|
I tested again - that works! |
7 tasks
amitabh94
approved these changes
Mar 19, 2026
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 20, 2026
## Explanation This PR cuts **monorepo release `875.0.0`** and publishes a new **`@metamask/ramps-controller`** version so consumers can pick up ramps work that is already on `main` but was **not** included in the previous npm publish train. **Current state** - `main` includes ramps updates (notably messenger exposure and `getOrder` wallet/query handling), documented under **Unreleased** in `packages/ramps-controller/CHANGELOG.md`. - Without a release, clients stay on the last published `@metamask/ramps-controller` and do not get those fixes/features from the registry. **What this change does** - Bumps the monorepo root version to **`875.0.0`** (release branch convention). - Releases **`@metamask/ramps-controller@12.0.1`**, with changelog entries moved from **Unreleased** into **`[12.0.1]`** per [Keep a Changelog](https://keepachangelog.com/). - **Added:** public `RampsController` methods exposed via the messenger ([#8221](#8221)). - **Fixed:** `getOrder` wallet handling so requests and `orderStatusChanged` payloads stay consistent ([#8251](#8251)). **Note for reviewers** - If this branch also bumps **other** workspace packages (lockfile / dependents), that is to satisfy release tooling and dependency constraints for anything else selected for **875**—not arbitrary scope creep. --- ## References - Ramps fixes / API surface: [#8221](#8221), [#8251](#8251) - Internal tracking (if applicable): **TRAM-3349** - Changelog guidelines: [updating changelogs](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - Consumer follow-up: bump `@metamask/ramps-controller` in **MetaMask mobile/extension** (and any other consumers) after this version is on npm --- ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate _(N/A — release-only if no code changes on this branch)_ - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate _(N/A unless this PR adds docs)_ - [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 _(unchecked — **patch** release; no breaking changes expected)_ --- <!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Low risk release-only change: version bumps and changelog/link updates with no functional code modifications. > > **Overview** > Cuts the monorepo release by bumping the root version to `875.0.0`. > > Publishes a patch release of `@metamask/ramps-controller` (`12.0.1`) by bumping its package version and moving the existing *Unreleased* changelog entries into a new `12.0.1` section, updating the compare links accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5b33da9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
imyugioh
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Mar 23, 2026
github-merge-queue Bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Mar 23, 2026
…71.0 (#27709) ## **Description** Integration PR to validate **MetaMask/core** changes in mobile CI/E2E by resolving `@metamask/ramps-controller` from a **preview** npm package (`previewBuilds` in `package.json` + updated `yarn.lock`). No application code changes. **Core PR:** MetaMask/core#8251 After core merges and a **released** version is published, this PR should be updated to remove `previewBuilds` and bump `dependencies` to the real version before merge. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A (validation / dependency preview only) ## **Manual testing steps** ```gherkin Feature: ramps-controller preview validation Scenario: app resolves preview package Given a clean install from this branch When the app bundles and runs Then @metamask/ramps-controller resolves to the preview version from previewBuilds Scenario: ramps flows still work Given the app is built from this branch When user exercises on-ramp flows that use ramps-controller Then no regressions vs main (same UX; underlying package is preview) ``` ## **Screenshots/Recordings** N/A — dependency-only change. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. --- <!-- Optional: paste below into GitHub if you use Cursor Bugbot summary --> > [!NOTE] > **Low Risk** > Low risk because this is a dependency source/version switch for `@metamask/ramps-controller` with no application code changes; main risk is behavior changes introduced by the preview package at runtime. > > **Overview** > Switches `@metamask/ramps-controller` to a **preview build** via `previewBuilds` in `package.json` and `yarn.lock` (e.g. `@metamask-previews/ramps-controller@12.0.0-preview-434bd0c`). Update the preview version string if the bot publishes a newer build for core#8251. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk patch-level dependency update; main risk is any runtime behavior changes in `@metamask/ramps-controller` affecting ramp flows, plus potential test fixture mismatches if state shape changes again. > > **Overview** > Updates `@metamask/ramps-controller` from `12.0.0` to `12.0.1` (including lockfile resolution changes). > > Aligns the default E2E/unit fixture (`default-fixture.json`) with the newer `RampsController` state shape by adding persisted sub-state for countries, providers/payment methods/tokens, native provider (Transak) auth/kyc/user details, requests, and orders. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0b2fc2f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
runway-github Bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Mar 23, 2026
…etaMask/core#8251 -> cp-7.71.0 (#27709) ## **Description** Integration PR to validate **MetaMask/core** changes in mobile CI/E2E by resolving `@metamask/ramps-controller` from a **preview** npm package (`previewBuilds` in `package.json` + updated `yarn.lock`). No application code changes. **Core PR:** MetaMask/core#8251 After core merges and a **released** version is published, this PR should be updated to remove `previewBuilds` and bump `dependencies` to the real version before merge. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A (validation / dependency preview only) ## **Manual testing steps** ```gherkin Feature: ramps-controller preview validation Scenario: app resolves preview package Given a clean install from this branch When the app bundles and runs Then @metamask/ramps-controller resolves to the preview version from previewBuilds Scenario: ramps flows still work Given the app is built from this branch When user exercises on-ramp flows that use ramps-controller Then no regressions vs main (same UX; underlying package is preview) ``` ## **Screenshots/Recordings** N/A — dependency-only change. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. --- <!-- Optional: paste below into GitHub if you use Cursor Bugbot summary --> > [!NOTE] > **Low Risk** > Low risk because this is a dependency source/version switch for `@metamask/ramps-controller` with no application code changes; main risk is behavior changes introduced by the preview package at runtime. > > **Overview** > Switches `@metamask/ramps-controller` to a **preview build** via `previewBuilds` in `package.json` and `yarn.lock` (e.g. `@metamask-previews/ramps-controller@12.0.0-preview-434bd0c`). Update the preview version string if the bot publishes a newer build for core#8251. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk patch-level dependency update; main risk is any runtime behavior changes in `@metamask/ramps-controller` affecting ramp flows, plus potential test fixture mismatches if state shape changes again. > > **Overview** > Updates `@metamask/ramps-controller` from `12.0.0` to `12.0.1` (including lockfile resolution changes). > > Aligns the default E2E/unit fixture (`default-fixture.json`) with the newer `RampsController` state shape by adding persisted sub-state for countries, providers/payment methods/tokens, native provider (Transak) auth/kyc/user details, requests, and orders. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0b2fc2f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
7 tasks
imyugioh
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Mar 23, 2026
…etaMask/core#8251 -> cp-7.71.0 (#27823) - chore(deps): ramps-controller preview for MetaMask/core#8251 -> cp-7.71.0 (#27709) ## **Description** Integration PR to validate **MetaMask/core** changes in mobile CI/E2E by resolving `@metamask/ramps-controller` from a **preview** npm package (`previewBuilds` in `package.json` + updated `yarn.lock`). No application code changes. **Core PR:** MetaMask/core#8251 After core merges and a **released** version is published, this PR should be updated to remove `previewBuilds` and bump `dependencies` to the real version before merge. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A (validation / dependency preview only) ## **Manual testing steps** ```gherkin Feature: ramps-controller preview validation Scenario: app resolves preview package Given a clean install from this branch When the app bundles and runs Then @metamask/ramps-controller resolves to the preview version from previewBuilds Scenario: ramps flows still work Given the app is built from this branch When user exercises on-ramp flows that use ramps-controller Then no regressions vs main (same UX; underlying package is preview) ``` ## **Screenshots/Recordings** N/A — dependency-only change. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. --- <!-- Optional: paste below into GitHub if you use Cursor Bugbot summary --> > [!NOTE] > **Low Risk** > Low risk because this is a dependency source/version switch for `@metamask/ramps-controller` with no application code changes; main risk is behavior changes introduced by the preview package at runtime. > > **Overview** > Switches `@metamask/ramps-controller` to a **preview build** via `previewBuilds` in `package.json` and `yarn.lock` (e.g. `@metamask-previews/ramps-controller@12.0.0-preview-434bd0c`). Update the preview version string if the bot publishes a newer build for core#8251. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk patch-level dependency update; main risk is any runtime behavior changes in `@metamask/ramps-controller` affecting ramp flows, plus potential test fixture mismatches if state shape changes again. > > **Overview** > Updates `@metamask/ramps-controller` from `12.0.0` to `12.0.1` (including lockfile resolution changes). > > Aligns the default E2E/unit fixture (`default-fixture.json`) with the newer `RampsController` state shape by adding persisted sub-state for countries, providers/payment methods/tokens, native provider (Transak) auth/kyc/user details, requests, and orders. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0b2fc2f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [4a4f0ae](4a4f0ae) Co-authored-by: Yu-Gi-Oh! <54774811+imyugioh@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
Fixes a bug where tapping a Transak Native order in "Processing" status in the Activity tab shows "Something went wrong" (HTTP 400).
Root cause:
RampsService.getOrderwas unconditionally appending thewalletquery param to the order URL. Whenorder.walletAddressisundefinedin Redux state (which can happen for Transak Native fiat→crypto orders),URLSearchParams.set('wallet', undefined)coercesundefinedto the string"undefined". The on-ramp API rejectswallet=undefinedwith a 400 validation error.Changes:
RampsService— Only append thewalletquery param when it has a real value. This is the primary fix: prevents the 400 error whenwalletAddressis absent from the stored order.RampsController— When storing a refreshed order, useorder.walletAddress || walletso that if the API response returns the wallet address (e.g. after the provider maps it correctly), it heals the previously missing value in Redux state. Falls back to thewalletparam if the API response omits it.Link to metamask-mobile
link to: MetaMask/metamask-mobile/pull/27709
References
TRAM-3349
Checklist
Metamask Mobile
No need to change in mobile code.
Before
After
Screen.Recording.2026-03-19.003710.mp4
Note
Medium Risk
Changes how order refresh requests are built and how refreshed orders are persisted/returned; mistakes could break order polling or state consistency for on-ramp flows.
Overview
Fixes
getOrderwallet handling to prevent invalid order refreshes and keep controller state consistent.RampsService.getOrdernow only appends thewalletquery param when it’s non-empty, avoidingwallet=undefined/empty-string requests that can yield 400s.RampsController.getOrdernow “heals” refreshed orders by ensuringwalletAddress(fallback to the passed wallet) andproviderOrderIdare persisted and returned, so callers andRampsController:orderStatusChangedlisteners see consistent data.Tests were updated/added to cover missing/empty
walletAddressscenarios, to assert the wallet query param is omitted when empty, and to normalize test mocks via acreateMockProviderhelper; changelog updated accordingly.Written by Cursor Bugbot for commit 434bd0c. This will update automatically on new commits. Configure here.