Skip to content

feat: enable metamask pay in dapps via feature flag#40514

Open
matthewwalsh0 wants to merge 3 commits intomainfrom
feat/metamask-pay-dapps-feature-flag
Open

feat: enable metamask pay in dapps via feature flag#40514
matthewwalsh0 wants to merge 3 commits intomainfrom
feat/metamask-pay-dapps-feature-flag

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Mar 1, 2026

Description

Replace the MM_PAY_DAPPS_ENABLED build-time environment variable with a dappsEnabled property under the confirmations_pay remote feature flag (defaults to false).

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Manual testing steps

Screenshots/Recordings

Before

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
Changes the enablement mechanism for MetaMask Pay in dapps from build-time env to a runtime remote feature flag, which can affect rollout behavior and visibility. Also adjusts confirmation UI/test selectors for PayWithRow, risking minor UI regressions in the confirmations flow.

Overview
MetaMask Pay in dapps is no longer controlled by the build-time MM_PAY_DAPPS_ENABLED env var; TransactionPaySection now renders only when the runtime remote flag confirmations_pay_dapps.enabled is true via the new selector selectIsMetaMaskPayDappsEnabled (defaulting to false), with updated unit tests.

The confirmations UI updates PayWithRow to support a smaller pill-style variant and a default inline row that uses ConfirmInfoAlertRow (with new test ids like pay-with-pill), and CustomAmountInfo now renders the small variant. Dependency @metamask/eip-5792-middleware is pinned/upgraded to 3.0.0 (lockfile updated), and the build config removes the MM_PAY_DAPPS_ENABLED entry.

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

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Mar 1, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 1, 2026

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (8 files, +194 -88)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 info/
            • 📁 custom-amount-info/
              • 📄 custom-amount-info.tsx +3 -1
          • 📁 rows/
            • 📁 pay-with-row/
              • 📄 pay-with-row.stories.tsx +7 -1
              • 📄 pay-with-row.test.tsx +46 -27
              • 📄 pay-with-row.tsx +43 -40
            • 📁 transaction-pay-section/
              • 📄 transaction-pay-section.test.tsx +8 -18
              • 📄 transaction-pay-section.tsx +5 -1
        • 📁 selectors/
          • 📄 feature-flags.test.ts +59 -0
          • 📄 feature-flags.ts +23 -0

@matthewwalsh0 matthewwalsh0 changed the title feat: replace MetaMask Pay dapps env var with remote feature flag feat: enable metamask pay in dapps via feature flag Mar 1, 2026
@github-actions github-actions bot added the size-S label Mar 1, 2026
@github-actions github-actions bot added size-M and removed size-S labels Mar 1, 2026
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review March 1, 2026 12:33
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner March 1, 2026 12:33
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 1, 2026

Builds ready [b52cce4]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28826730817304308
total28826730817304308
Confirm Txconfirm_tx6054601661223860656122
total6054601661223860656122
Bridge User Actionsbridge_load_page25322230731268307
bridge_load_asset_picker21818327534235275
bridge_search_token72670475720733757
total1197110912737012721273
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14751234179710615231682
load1244103615179712821416
domContentLoaded1236102915109612761409
domInteractive2919101182679
firstPaint174731434151221372
backgroundConnect21819531018222252
firstReactRender20134562032
initialActions105124
loadScripts103582512979510841209
setupStore1363151722
numNetworkReqs312292192282
Power User HomeuiStartup17391396210612018021943
load11611016163913411641533
domContentLoaded11461007160712611501502
domInteractive3520177223563
firstPaint182811515158229343
backgroundConnect29626440927301355
firstReactRender23165772436
initialActions106113
loadScripts92980514011279291288
setupStore1574151823
numNetworkReqs59381482457122
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202172242221224
srpButtonToSrpForm98979819898
confirmSrpToPwForm22212202222
pwFormToMetricsScreen16151601516
metricsToWalletReadyScreen17161811718
doneButtonToHomeScreen1225588169443415881694
openAccountMenuToAccountListLoaded74757018803839578488038
total9014897590603190209060
Onboarding New WalletcreateWalletToSocialScreen2192172212221221
srpButtonToPwForm1071051123110112
createPwToRecoveryScreen888088
skipBackupToMetricsScreen37353813838
agreeButtonToOnboardingSuccess17161711717
doneButtonToAssetList53547469593485695
total9208571079928751079
Asset DetailsassetClickToPriceChart35324033640
total35324033640
Solana Asset DetailsassetClickToPriceChart49484914949
total49484914949
Import Srp HomeloginToHomeScreen2119208621854621852185
openAccountMenuAfterLogin43365884758
homeAfterImportWithNewWallet23052034260519724382605
total4394436744292644294429
Send TransactionsopenSendPageFromHome342048103848
selectTokenToSendFormLoaded20192112121
reviewTransactionToConfirmationPage1025853135519011211355
total1078911142219411651422
SwapopenSwapPageFromHome883912532113125
fetchAndDisplaySwapQuotes56314572638680262386386
total57194635648783263636487
🌐 Dapp Page Load Benchmarks

Current Commit: b52cce4 | Date: 3/1/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 955ms (±38ms) 🟢 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 672ms (±35ms) 🟢 | historical mean value: 739ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±9ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 955ms 38ms 930ms 1.23s 992ms 1.23s
domContentLoaded 672ms 35ms 653ms 932ms 700ms 932ms
firstPaint 75ms 9ms 64ms 148ms 84ms 148ms
firstContentfulPaint 75ms 9ms 64ms 148ms 84ms 148ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 1.34 KiB (0.02%)
  • common: 20 Bytes (0%)

Use alternate feature flag.
Bump middleware.
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​eip-5792-middleware@​2.1.0 ⏵ 3.0.09910076 +193100

View full report

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 2, 2026

Builds ready [2836d7f]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account30426635031325350
total30426635031325350
Confirm Txconfirm_tx6079606760921060856092
total6079606760921060856092
Bridge User Actionsbridge_load_page27225428211279282
bridge_load_asset_picker23012630271298302
bridge_search_token73170974514741745
total1241111414039912821403
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14681281190711114911694
load1235106416709812671413
domContentLoaded1228105816619712511392
domInteractive3117100212688
firstPaint1727150390232354
backgroundConnect22120138921225248
firstReactRender20135062133
initialActions2011225
loadScripts102485414489710511199
setupStore1473251722
numNetworkReqs312296202284
Power User HomeuiStartup17421441220113718131994
load11651037165412711641485
domContentLoaded11521029164612611511480
domInteractive3619201263576
firstPaint1706745877238292
backgroundConnect29726837221306334
firstReactRender22165062335
initialActions106112
loadScripts93382414231249291246
setupStore1594151624
numNetworkReqs59391622457114
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172201219220
srpButtonToSrpForm92909319293
confirmSrpToPwForm21212102121
pwFormToMetricsScreen15151601616
metricsToWalletReadyScreen17161911719
doneButtonToHomeScreen68558480093754800
openAccountMenuToAccountListLoaded73136645802954978438029
total84847805897851389158978
Onboarding New WalletcreateWalletToSocialScreen2192172211220221
srpButtonToPwForm1151091225117122
createPwToRecoveryScreen999099
skipBackupToMetricsScreen37373803838
agreeButtonToOnboardingSuccess18162011820
doneButtonToAssetList983470134832613261348
total1392860175032617201750
Asset DetailsassetClickToPriceChart39384014040
total39384014040
Solana Asset DetailsassetClickToPriceChart452462175862
total452462175862
Import Srp HomeloginToHomeScreen2012191921117520802111
openAccountMenuAfterLogin47395455054
homeAfterImportWithNewWallet2187208922857022012285
total43084154455815644154558
Send TransactionsopenSendPageFromHome281848133948
selectTokenToSendFormLoaded21212102121
reviewTransactionToConfirmationPage8608498718863871
total90488792314911923
SwapopenSwapPageFromHome100971053105105
fetchAndDisplaySwapQuotes53094579624175862276241
total54094677634575863246345
🌐 Dapp Page Load Benchmarks

Current Commit: 2836d7f | Date: 3/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±78ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 747ms (±87ms) 🟢 | historical mean value: 741ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 92ms (±128ms) 🟢 | historical mean value: 82ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 78ms 1.01s 1.44s 1.28s 1.44s
domContentLoaded 747ms 87ms 709ms 1.30s 960ms 1.30s
firstPaint 92ms 128ms 64ms 1.37s 92ms 1.37s
firstContentfulPaint 92ms 128ms 64ms 1.37s 92ms 1.37s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 385 Bytes (0.01%)
  • ui: 1.8 KiB (0.02%)
  • common: 50 Bytes (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants