Commit 8f743b4
chore(runway): cherry-pick fix(ramps): filter activity tab's transfer details for selected account -> cp-7.71.0 (#27865)
- fix(ramps): filter activity tab's transfer 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 -->
[4661cdb](4661cdb)
---------
Co-authored-by: Yu-Gi-Oh! <54774811+imyugioh@users.noreply.github.com>1 parent 6ebe482 commit 8f743b4
11 files changed
Lines changed: 436 additions & 23 deletions
File tree
- app
- components/UI/Ramp
- Views
- Modals/ProviderSelectionModal
- NativeFlow
- hooks
- selectors/rampsController
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | | - | |
50 | | - | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
8 | 22 | | |
9 | 23 | | |
10 | 24 | | |
| |||
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
38 | | - | |
| 52 | + | |
39 | 53 | | |
40 | 54 | | |
41 | 55 | | |
| |||
54 | 68 | | |
55 | 69 | | |
56 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
57 | 110 | | |
58 | 111 | | |
59 | 112 | | |
| |||
78 | 131 | | |
79 | 132 | | |
80 | 133 | | |
81 | | - | |
| 134 | + | |
82 | 135 | | |
83 | 136 | | |
84 | 137 | | |
| |||
88 | 141 | | |
89 | 142 | | |
90 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
91 | 157 | | |
92 | 158 | | |
93 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
| 485 | + | |
489 | 486 | | |
490 | 487 | | |
491 | 488 | | |
| |||
494 | 491 | | |
495 | 492 | | |
496 | 493 | | |
497 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
498 | 544 | | |
499 | 545 | | |
500 | 546 | | |
501 | 547 | | |
502 | 548 | | |
503 | 549 | | |
504 | 550 | | |
| 551 | + | |
505 | 552 | | |
506 | 553 | | |
507 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
0 commit comments