…order refresh (#8251)
## 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.getOrder` was unconditionally appending the
`wallet` query param to the order URL. When `order.walletAddress` is
`undefined` in Redux state (which can happen for Transak Native
fiat→crypto orders), `URLSearchParams.set('wallet', undefined)` coerces
`undefined` to the string `"undefined"`. The on-ramp API rejects
`wallet=undefined` with a 400 validation error.
Changes:
1. **`RampsService`** — Only append the `wallet` query param when it has
a real value. This is the primary fix: prevents the 400 error when
`walletAddress` is absent from the stored order.
2. **`RampsController`** — When storing a refreshed order, use
`order.walletAddress || wallet` so 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 the `wallet`
param if the API response omits it.
## Link to metamask-mobile
link to:
[MetaMask/metamask-mobile/pull/27709](MetaMask/metamask-mobile#27709)
## References
[TRAM-3349](https://consensyssoftware.atlassian.net/browse/TRAM-3349)
## 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
- [ ] 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
## Metamask Mobile
No need to change in mobile code.
### Before
<img width="356" height="689" alt="Screenshot 2026-03-18 234503"
src="https://github.com/user-attachments/assets/3da8e2a1-01cb-4c93-99e8-435dfe3111b6"
/>
### After
https://github.com/user-attachments/assets/ece43027-1ada-46a0-813a-dfc912d58000
<img width="366" height="667" alt="Screenshot 2026-03-19 003734"
src="https://github.com/user-attachments/assets/5cbd97e4-1e4a-4035-8594-bf016e3817dd"
/>
<!-- CURSOR_SUMMARY -->
---
> [!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 `getOrder` wallet handling to prevent invalid order refreshes
and keep controller state consistent.
>
> `RampsService.getOrder` now only appends the `wallet` query param when
it’s non-empty, avoiding `wallet=undefined`/empty-string requests that
can yield 400s. `RampsController.getOrder` now “heals” refreshed orders
by ensuring `walletAddress` (fallback to the passed wallet) and
`providerOrderId` are persisted and returned, so callers and
`RampsController:orderStatusChanged` listeners see consistent data.
>
> Tests were updated/added to cover missing/empty `walletAddress`
scenarios, to assert the wallet query param is omitted when empty, and
to normalize test mocks via a `createMockProvider` helper; changelog
updated accordingly.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
434bd0c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Description
Integration PR to validate MetaMask/core changes in mobile CI/E2E by resolving
@metamask/ramps-controllerfrom a preview npm package (previewBuildsinpackage.json+ updatedyarn.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
previewBuildsand bumpdependenciesto the real version before merge.Changelog
CHANGELOG entry: null
Related issues
Fixes: N/A (validation / dependency preview only)
Manual testing steps
Screenshots/Recordings
N/A — dependency-only change.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk because this is a dependency source/version switch for
@metamask/ramps-controllerwith no application code changes; main risk is behavior changes introduced by the preview package at runtime.Overview
Switches
@metamask/ramps-controllerto a preview build viapreviewBuildsinpackage.jsonandyarn.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.Note
Low Risk
Low risk patch-level dependency update; main risk is any runtime behavior changes in
@metamask/ramps-controlleraffecting ramp flows, plus potential test fixture mismatches if state shape changes again.Overview
Updates
@metamask/ramps-controllerfrom12.0.0to12.0.1(including lockfile resolution changes).Aligns the default E2E/unit fixture (
default-fixture.json) with the newerRampsControllerstate shape by adding persisted sub-state for countries, providers/payment methods/tokens, native provider (Transak) auth/kyc/user details, requests, and orders.Written by Cursor Bugbot for commit 0b2fc2f. This will update automatically on new commits. Configure here.