chore(runway): cherry-pick fix(ramps): filter activity tab's transfer details for selected account -> cp-7.71.0#27865
Conversation
… details for selected account -> cp-7.71.0 (#27830) ## **Description** ### Activity — on-ramp orders scoped to the selected account The Activity **Orders** tab merges legacy fiat orders with V2 `RampsController` orders. Legacy rows were already limited to the **selected account group** via `getOrders`. V2 orders were not filtered, so purchase history from other wallets could appear. This change adds `selectRampsOrdersForSelectedAccountGroup`, which keeps only orders whose `walletAddress` matches any formatted address in the selected account group (same semantics as legacy, using `areAddressesEqual` for EVM vs non-EVM). Hook and modal consumers that should reflect “current wallet context” now use this selector instead of the raw controller list. ### Transak — preserve user-entered fiat amount on Build Quote (in-app) After **additional verification**, opening the KYC/payment webview called `navigateToKycWebview` with **`quote.fiatAmount`**, and the stack reset rewrote **RampAmountInput** params with that value. The quote total can differ from what the user typed (e.g. fees), so Build Quote could show **27.37** after the user entered **25**, and that value persisted after closing the sheet or going back. **Change:** `routeAfterAuthentication(..., amount)` already carried the typed fiat; `navigateToAdditionalVerificationCallback` now puts the same `amount` on **both** `RampAmountInput` and `RampAdditionalVerification` route params. **V2 Additional Verification** reads that param and passes **only** it into `navigateToKycWebview` (no `quote.fiatAmount` for this purpose). **Out of scope:** Order detail screens and stored order payloads are unchanged. The **Transak payment webview** URL is unchanged (no `fiatAmount` override in widget params); only in-app Build Quote / stack state matches the user’s input. ## **Changelog** CHANGELOG entry: Fixed Activity on-ramp (Orders) list showing V2 purchases from wallets other than the selected account group; fixed Transak unified buy flow so the fiat amount on Build Quote after additional verification matches the user-entered amount on the amount screen (in-app stack), without changing Transak’s payment widget totals. ### Tests - `selectRampsOrdersForSelectedAccountGroup` and ramp hook consumers (selector + hook unit tests). - `useTransakRouting`: IDPROOF / additional verification navigation with user `amount` set and omitted. - V2 `AdditionalVerification`: continue passes route `amount` into `navigateToKycWebview`. ## **Related issues** Refs: [TRAM-3361](https://consensyssoftware.atlassian.net/browse/TRAM-3361) ## **Manual testing steps** ```gherkin Feature: Activity on-ramp orders and Transak amount (TRAM-3361) Scenario: Orders tab shows only selected account group’s V2 on-ramp orders Given the user has two wallets (or account groups) with separate on-ramp purchase history And unified ramps V2 orders exist for more than one wallet address When the user selects account group A and opens Activity → Orders Then only on-ramp orders whose destination wallet belongs to account group A are listed When the user switches to account group B Then the Orders tab lists only orders for account group B Scenario: Custom fiat amount survives Transak additional verification on Build Quote Given the user is in unified Buy with Transak (native) as provider And the user enters a custom fiat amount (e.g. 25) on the amount screen When the user continues through flows that require additional verification And the user taps Continue on the additional verification screen Then Build Quote under the KYC/payment sheet still shows the entered amount (e.g. 25), not only the quote total When the user closes the webview or goes back from the flow Then the amount screen still shows the same entered amount (e.g. 25) ``` ## **Screenshots/Recordings** ### **Before** <!-- Add video: Activity Orders showing other wallet’s purchases / wrong fiat amount after verification or in widget --> https://github.com/user-attachments/assets/b26bb3cb-8219-48a3-8128-7c79026fdd18 ### **After** <!-- Add video: Activity Orders scoped to selected account / correct custom amount through verification and widget --> https://github.com/user-attachments/assets/3e1929e3-7e1a-42c9-98bd-ea8f7bc9b1eb https://github.com/user-attachments/assets/ef6d14ed-6533-4e04-a5a4-8cbd44477170 ## **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 - [x] I've included tests if applicable - [ ] 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-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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate UX/data-scoping change: filters which on-ramp orders appear based on multichain account selection and adjusts Transak navigation params, which could hide expected history or affect flow state if account/address resolution is off. > > **Overview** > Fixes unified ramp UI to **scope V2 `RampsController` orders to the selected account group**, preventing purchases from other wallets from showing up in Activity-derived surfaces. This introduces `selectRampsOrdersForSelectedAccountGroup` (address-matched via `areAddressesEqual`) and switches key consumers (`useRampsOrders`, `useRampsProviders`, `useRampsButtonClickData`, `ProviderSelectionModal`) from the unfiltered selector. > > Updates the Transak additional-verification flow to **preserve the user-entered fiat amount** through stack resets: `useTransakRouting` now carries `amount` into `RampAdditionalVerification` params, and `AdditionalVerification` uses that param (not `quote.fiatAmount`) when opening the KYC webview. Selector and routing behavior are covered with expanded unit tests. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 39d5861. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Impact assessment:
No dependent tags needed: The tag descriptions for SmokeRamps mention integration with SmokeWalletPlatform for wallet actions entry point, but the changes here are internal to the ramps flow (not the entry point from wallet home). No confirmations flow changes are present. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
Activity — on-ramp orders scoped to the selected account
The Activity Orders tab merges legacy fiat orders with V2
RampsControllerorders. Legacy rows were already limited to theselected account group via
getOrders. V2 orders were not filtered,so purchase history from other wallets could appear.
This change adds
selectRampsOrdersForSelectedAccountGroup, which keepsonly orders whose
walletAddressmatches any formatted address in theselected account group (same semantics as legacy, using
areAddressesEqualfor EVM vs non-EVM). Hook and modal consumers thatshould reflect “current wallet context” now use this selector instead of
the raw controller list.
Transak — preserve user-entered fiat amount on Build Quote (in-app)
After additional verification, opening the KYC/payment webview
called
navigateToKycWebviewwithquote.fiatAmount, and the stackreset rewrote RampAmountInput params with that value. The quote
total can differ from what the user typed (e.g. fees), so Build Quote
could show 27.37 after the user entered 25, and that value
persisted after closing the sheet or going back.
Change:
routeAfterAuthentication(..., amount)already carried thetyped fiat;
navigateToAdditionalVerificationCallbacknow puts the sameamounton bothRampAmountInputandRampAdditionalVerificationroute params. V2 Additional Verification reads that param and passes
only it into
navigateToKycWebview(noquote.fiatAmountfor thispurpose).
Out of scope: Order detail screens and stored order payloads are
unchanged. The Transak payment webview URL is unchanged (no
fiatAmountoverride in widget params); only in-app Build Quote / stackstate matches the user’s input.
Changelog
CHANGELOG entry: Fixed Activity on-ramp (Orders) list showing V2
purchases from wallets other than the selected account group; fixed
Transak unified buy flow so the fiat amount on Build Quote after
additional verification matches the user-entered amount on the amount
screen (in-app stack), without changing Transak’s payment widget totals.
Tests
selectRampsOrdersForSelectedAccountGroupand ramp hook consumers(selector + hook unit tests).
useTransakRouting: IDPROOF / additional verification navigation withuser
amountset and omitted.AdditionalVerification: continue passes routeamountintonavigateToKycWebview.Related issues
Refs:
TRAM-3361
Manual testing steps
Screenshots/Recordings
Before
ScreenRecording_03-18-2026.21-26-36_1.MP4
After
Recording.2026-03-23.200201.mp4
Recording.2026-03-23.200613.mp4
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Moderate UX/data-scoping change: filters which on-ramp orders appear
based on multichain account selection and adjusts Transak navigation
params, which could hide expected history or affect flow state if
account/address resolution is off.
Overview
Fixes unified ramp UI to scope V2
RampsControllerorders to theselected account group, preventing purchases from other wallets from
showing up in Activity-derived surfaces. This introduces
selectRampsOrdersForSelectedAccountGroup(address-matched viaareAddressesEqual) and switches key consumers (useRampsOrders,useRampsProviders,useRampsButtonClickData,ProviderSelectionModal) from the unfiltered selector.Updates the Transak additional-verification flow to preserve the
user-entered fiat amount through stack resets:
useTransakRoutingnowcarries
amountintoRampAdditionalVerificationparams, andAdditionalVerificationuses that param (notquote.fiatAmount) whenopening the KYC webview. Selector and routing behavior are covered with
expanded unit tests.
Written by Cursor
Bugbot for commit
39d5861. This will update automatically
on new commits. Configure
here.