Skip to content

feat(perps): add perpsWithdraw transaction display and activity support#28026

Merged
dan437 merged 1 commit into
mainfrom
perps-withdraw-display
Mar 27, 2026
Merged

feat(perps): add perpsWithdraw transaction display and activity support#28026
dan437 merged 1 commit into
mainfrom
perps-withdraw-display

Conversation

@dan437

@dan437 dan437 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Description

Adds TransactionType.perpsWithdraw support across the activity list, transaction details, analytics, metrics, and notifications — mirroring the existing patterns for predictWithdraw and perpsDeposit.

This is the first of two PRs for Perps Withdraw. It makes the app correctly display, label, and handle perpsWithdraw transactions without any changes to the confirmation flow. All additions are to existing arrays/switch statements and are dormant until the transaction type is actually used.

Changelog

CHANGELOG entry: Add Perps Withdraw transaction display and activity support

Related issues

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

Manual testing steps

Feature: Perps Withdraw transaction display

  Scenario: user views a completed perpsWithdraw transaction in Activity
    Given the user has a completed perpsWithdraw transaction

    When user opens the Activity tab
    Then the transaction displays as "Perps withdraw" with the correct fiat value

  Scenario: user views perpsWithdraw transaction details
    Given the user has a completed perpsWithdraw transaction

    When user taps the transaction in the Activity list
    Then the transaction details page shows "Withdrawal" as the title
    And the fee row shows "Provider fee" instead of "Bridge fee"

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
Mostly additive wiring for a new TransactionType.perpsWithdraw, but it touches shared transaction decoding, metrics/analytics classification, and notification-suppression lists which could affect reporting or user-visible notifications if misclassified.

Overview
Adds end-to-end display support for TransactionType.perpsWithdraw in Activity and the new Transaction Details screen, including correct titles, network badge chain selection, totals/fee labeling (using Provider fee for withdrawals), and post-quote metamaskPay.targetFiat amount display.

Extends transaction action-key mapping/decoding, analytics monetization classification, MetaMetrics transaction-type values, MetaMask Pay metrics handling, and the notification skip list to recognize perpsWithdraw, with corresponding unit tests and new i18n strings (e.g., tx_review_perps_withdraw, transaction_details.title.perps_withdraw).

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

@dan437 dan437 requested review from a team as code owners March 27, 2026 10:45
@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 27, 2026
@github-actions github-actions Bot added size-S risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokePredictions, SmokeTrade, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR adds full support for TransactionType.perpsWithdraw across the transaction lifecycle:

  1. SmokePerps (primary): The core feature being added is the Perps withdrawal flow. Changes to TransactionElement, transaction-details components, util/transactions/index.js, and localization strings directly implement the Perps withdraw transaction display in the activity/history view. The SmokePerps tests cover balance updates and the Perps interface which would exercise this new withdrawal flow.

  2. SmokeWalletPlatform (required by SmokePerps): Per tag description, selecting SmokePerps requires also selecting SmokeWalletPlatform (Trending section). Additionally, TransactionElement/index.js and NotificationManager.js are shared components used in transaction history display, which is tested by SmokeWalletPlatform (incoming/outgoing transactions, transaction history).

  3. SmokePredictions (risk mitigation): The transaction-details-bridge-fee-row was refactored from isPredictWithdraw to isWithdraw (now includes both predictWithdraw and perpsWithdraw). The transaction-details-total-row and transaction-details-account-row also share logic between predict and perps withdraw types. These shared component changes could inadvertently affect Predictions withdraw display. Per tag description, selecting SmokePredictions requires SmokeWalletPlatform (already included) and SmokeConfirmations.

  4. SmokeTrade (risk mitigation): The transaction-details-hero component's SUPPORTED_TYPES array was modified (adding perpsWithdraw), and TransactionElement/utils.js getPostQuoteDisplay was updated. These components are shared with bridge/swap transaction details. Per tag description, selecting SmokeTrade requires SmokeConfirmations.

  5. SmokeConfirmations (required by SmokeTrade and SmokePredictions): Required as a dependent tag per the descriptions of SmokeTrade and SmokePredictions. Also, the transaction details components modified are part of the activity/confirmation flow.

Not selected: SmokeAccounts, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeMultiChainAPI, SmokeRamps, SmokeCard, FlaskBuildTests - these are unrelated to perps/transaction history changes.

Performance Test Selection:
The changes are focused on adding a new transaction type (perpsWithdraw) to existing display logic, analytics tracking, and notification suppression. These are additive changes to transaction classification and UI rendering for a specific transaction type. There are no changes to list rendering performance, data loading patterns, Redux state management, app startup, or other performance-sensitive areas. The transaction details components modified are detail views (not list views), so no performance test tags are warranted.

View GitHub Actions results

@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

@sonarqubecloud

Copy link
Copy Markdown

@dan437 dan437 enabled auto-merge March 27, 2026 11:52
@dan437 dan437 added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 992adc4 Mar 27, 2026
119 checks passed
@dan437 dan437 deleted the perps-withdraw-display branch March 27, 2026 12:29
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2026
@metamaskbot metamaskbot added the release-7.73.0 Issue or pull request that will be included in release 7.73.0 label Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants