feat: implement Pay With Perps section#30124
Conversation
…nfig and adjust renderTrailing function
…sk/metamask-mobile into vs/pay-with-bottom-sheet-skeleton
…ed on transaction metadata
…ability in transaction selection
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…th Pay With bottom sheet enabled
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8663914. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are feature-flag gated ( Performance Test Selection: |
|
geositta
left a comment
There was a problem hiding this comment.
Approve. The Perps Pay With bottom sheet changes keep Perps balance selection explicit, preserve crypto token selection behavior, and include focused coverage for the new section, dismissal guard, token filtering, and section ordering.




Description
Adds the Perps section to the redesigned Pay with bottom sheet. On
perpsDepositAndOrderconfirmations, a Perps account row now renders above the Crypto section with an inline Add button that routes to the standalone Perps deposit confirmation. Visibility mirrors the existing legacy-modal rule (perpsDepositAndOrderonly —perpsDepositis filtered out to avoid a recursive "deposit to deposit" loop).The Perps row is an Add CTA, not a selection row. Payment-source state for perps flows lives in a dual-state machinery (
PerpsController.selectedPaymentTokenfor the UX choice +TransactionPayController.payTokenfor the real on-chain funding source) that the legacy modal already orchestrates — there is no on-row "selected token" to display.All changes are dark-launched behind
MM_DEV_PAY_WITH_BOTTOM_SHEETand have no effect in production.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1362
Manual testing steps
Screenshots/Recordings
WhatsApp.Video.2026-05-15.at.16.56.55.mp4
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches confirmations payment-selection and navigation flows (including multi-pop dismissal logic) for
perpsDepositAndOrder, which could cause incorrect pay token selection or route-dismissal issues despite being dev-flag gated.Overview
Adds a new Perps section to the redesigned
Pay withbottom sheet forperpsDepositAndOrder, showing aPerps accountrow with inlineAddthat launches the Perps deposit confirmation and a tap that selects Perps balance.Updates Perps pay-token selection to support lightweight
{address, chainId}inputs, adjusts the Crypto section so checkmarks/selected rows don’t conflict when Perps balance or fiat payment implicitly owns selection, and wires the Perps order screen to open the new bottom sheet when enabled.Improves picker dismissal/navigation robustness:
PayWithModalcan now atomically pop multiple routes (dismissOnSelectCount) to avoid Android double-pop crashes, anduseDismissOnPaymentChangenow guards against dismissing when the route isn’t focused. Adds/updates unit tests and English strings for the new Perps labels.Reviewed by Cursor Bugbot for commit 94d8917. Bugbot is set up for automated code reviews on this repo. Configure here.