Skip to content

feat: Add Perps Withdraw button into Developer Options, show new Perps Withdraw UI#27792

Merged
dan437 merged 7 commits into
mainfrom
perps-withdraw-ui
Mar 24, 2026
Merged

feat: Add Perps Withdraw button into Developer Options, show new Perps Withdraw UI#27792
dan437 merged 7 commits into
mainfrom
perps-withdraw-ui

Conversation

@dan437
Copy link
Copy Markdown
Contributor

@dan437 dan437 commented Mar 23, 2026

Description

Adds the UI scaffolding for the Perps Withdraw confirmation flow. When triggered from Developer Options, the "Perps Withdraw" button navigates to a full-screen CustomAmountInfo confirmation page that displays the user's available Perps balance and uses the post-quote "Receive as" token picker pattern (same as Predict Withdraw).

This is the UI-only foundation — the end-to-end withdrawal execution (HyperLiquid signatures, Relay integration) will follow in a subsequent PR.

Changes:

  • Added "Perps Withdraw" button and useAddPerpsTransactionBatch hook in Developer Options
  • Created PerpsWithdrawInfo component that wires CustomAmountInfo with Perps balance display
  • Created PerpsWithdrawBalance component showing available Perps balance from live account data
  • Added perpsWithdraw to FULL_SCREEN_CONFIRMATIONS and POST_QUOTE_TRANSACTION_TYPES
  • Added perpsWithdraw routing in info-root.tsx
  • Updated useButtonLabel to show "Withdraw" for perpsWithdraw transactions
  • Added locale strings for Perps Withdraw title and available balance

Changelog

CHANGELOG entry: Add Perps Withdraw button into Developer Options, show new Perps Withdraw UI

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1072

Manual testing steps

Feature: Perps Withdraw confirmation UI

  Background:
    Given I am logged into MetaMask Mobile
    And I have Developer Options enabled (export MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS="true" in .js.env)

  Scenario: user triggers Perps Withdraw from Developer Options
    Given I am on the Developer Options screen (Settings -> Developer options)
    And I scroll to the Perps Withdraw section

    When user taps the "Withdraw" button under "Perps Withdraw"
    Then the Perps Withdraw confirmation page should appear
    And the page title should show "Withdraw"
    And the available Perps balance should be displayed
    And the "Withdraw" action button should be visible at the bottom

Screenshots/Recordings

Before

N/A

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • 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.

Note

Medium Risk
Adds a new perpsWithdraw transaction type path through the confirmations UI (routing, labels, constants) and a developer-only trigger that creates batched transactions; changes are mostly UI scaffolding but touch confirmation flow selection logic and transaction batching.

Overview
Introduces a Perps Withdraw confirmation flow scaffold: a new Developer Options button triggers a perpsWithdraw transaction batch on Arbitrum USDC and navigates into the Perps confirmation stack.

Adds a new PerpsWithdrawInfo full-screen CustomAmountInfo view that registers Arbitrum USDC, uses the post-quote Receive as pattern, and shows an available Perps balance via the new PerpsWithdrawBalance component.

Updates confirmations plumbing to recognize TransactionType.perpsWithdraw (info routing, full-screen + post-quote type lists, withdraw button labeling, locales) and adds targeted unit tests/snapshots. Also bumps @metamask/bridge-status-controller and @metamask/transaction-controller dependency versions.

Written by Cursor Bugbot for commit 6d73fcc. This will update automatically on new commits. Configure here.

@dan437 dan437 requested a review from a team as a code owner March 23, 2026 10:57
@github-actions
Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Mar 23, 2026
@github-actions github-actions Bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 23, 2026
@dan437 dan437 requested a review from pedronfigueiredo March 23, 2026 13:01
@dan437 dan437 force-pushed the perps-withdraw-ui branch from e7e25c1 to f86f1b9 Compare March 23, 2026 13:11
@github-actions github-actions Bot added size-L risk-medium Moderate testing recommended · Possible bug introduction risk and removed size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 23, 2026
@dan437 dan437 force-pushed the perps-withdraw-ui branch from f86f1b9 to 682611b Compare March 24, 2026 09:55
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 24, 2026
dan437 added 6 commits March 24, 2026 11:46
…s Withdraw UI

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
@dan437 dan437 force-pushed the perps-withdraw-ui branch from 682611b to 6468d64 Compare March 24, 2026 10:47
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 24, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@dan437 dan437 added the skip-e2e skip E2E test jobs label Mar 24, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeCard, SmokePerps, SmokeRamps, SmokeMultiChainAPI, SmokePredictions, FlaskBuildTests
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller, @metamask/transaction-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller, @metamask/transaction-controller. Running all tests.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@dan437 dan437 enabled auto-merge March 24, 2026 12:50
@dan437 dan437 added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit d23e31c Mar 24, 2026
147 of 156 checks passed
@dan437 dan437 deleted the perps-withdraw-ui branch March 24, 2026 13:21
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 24, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-high Extensive testing required · High bug introduction risk size-L skip-e2e skip E2E test jobs team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants