chore(runway): cherry-pick feat: support deposit-wallet polymarket withdraw#30265
Open
runway-github[bot] wants to merge 5 commits into
Open
chore(runway): cherry-pick feat: support deposit-wallet polymarket withdraw#30265runway-github[bot] wants to merge 5 commits into
runway-github[bot] wants to merge 5 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
Adopts the new Polymarket deposit-wallet support landed in [@metamask/transaction-pay-controller@22.5.0](MetaMask/core#8754) so Polymarket users whose pUSD lives in a deposit wallet (a per-user batch contract on Polygon) can withdraw cross-chain through MetaMask Pay. Highlights: - Lets Polymarket deposit-wallet users withdraw cross-chain through MetaMask Pay. - Gated behind a new remote feature flag, with the existing "withdraw unavailable" sheet preserved when off. - Polishes Predict withdraw activity rendering. CHANGELOG entry: null <!-- Internal --> ```gherkin Feature: Polymarket deposit-wallet withdraw Scenario: deposit-wallet user with the flag on Given enableDepositWalletWithdraw is on And the user has a Polymarket deposit wallet with pUSD balance on Polygon When the user taps Withdraw on the Predict balance Then the standard Pay confirmation opens And confirming submits via the Polymarket strategy with no Polygon gas Scenario: deposit-wallet user with the flag off Given enableDepositWalletWithdraw is off When the user taps Withdraw on the Predict balance Then the existing "Withdraw unavailable" sheet is shown ``` <img width="300" alt="Activity" src="https://github.com/user-attachments/assets/13d5a0e9-a39d-4c0a-9fde-468c5a0a7743" /> - [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 - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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. - [ ] I've tested on Android - [ ] I've tested with a power user scenario - [ ] I've instrumented key operations with Sentry traces for production performance metrics - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes withdrawal behavior and MetaMask Pay transaction configuration for Polymarket `predictWithdraw`, including new controller callbacks and retry logic; mistakes could impact withdraw routing/fees for affected users. Gated by a remote feature flag, limiting blast radius. > > **Overview** > Enables Polymarket *deposit-wallet* users to run `predictWithdraw` through MetaMask Pay when the new `confirmations_pay_extended.enableDepositWalletWithdraw` flag is on; when off, the existing “withdraw unavailable” handling remains. > > Updates Predict/Pay plumbing for deposit-wallet withdraws: `PredictController.prepareWithdraw` now omits `gasFeeToken` for deposit-wallet accounts, `useTransactionPayPostQuote` skips `refundTo` and marks `isPolymarketDepositWallet`, and Transaction Pay initialization wires new Polymarket callbacks that can derive deposit-wallet addresses and submit deposit-wallet batches (with “wallet busy” retries + keyring signing support). > > Polishes confirmations activity rendering for `predictWithdraw` by adding a dedicated `predict_withdraw` title and treating it as a receive-summary type using the source token/network metadata. Tests are added/updated accordingly, and `@metamask/transaction-pay-controller` is bumped to `22.5.0`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 054697c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
a9bbef3 to
72cf037
Compare
…flicts from pay controller bump
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release/7.77.0 #30265 +/- ##
=================================================
Coverage ? 43.05%
=================================================
Files ? 5334
Lines ? 141836
Branches ? 32344
=================================================
Hits ? 61074
Misses ? 74975
Partials ? 5787 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…nflicts from pay controller bump
… incompatibility with network-controller@30
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release branch (release/*) All E2E tests pre-selected. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Adopts the new Polymarket deposit-wallet support landed in
@metamask/transaction-pay-controller@22.5.0
so Polymarket users whose pUSD lives in a deposit wallet (a per-user
batch contract on Polygon) can withdraw cross-chain through MetaMask
Pay.
Highlights:
MetaMask Pay.
unavailable" sheet preserved when off.
Changelog
CHANGELOG entry: null
Related issues
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
performance metrics
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Changes withdrawal behavior and MetaMask Pay transaction configuration
for Polymarket
predictWithdraw, including new controller callbacks andretry logic; mistakes could impact withdraw routing/fees for affected
users. Gated by a remote feature flag, limiting blast radius.
Overview
Enables Polymarket deposit-wallet users to run
predictWithdrawthrough MetaMask Pay when the new
confirmations_pay_extended.enableDepositWalletWithdrawflag is on;when off, the existing “withdraw unavailable” handling remains.
Updates Predict/Pay plumbing for deposit-wallet withdraws:
PredictController.prepareWithdrawnow omitsgasFeeTokenfordeposit-wallet accounts,
useTransactionPayPostQuoteskipsrefundToand marks
isPolymarketDepositWallet, and Transaction Payinitialization wires new Polymarket callbacks that can derive
deposit-wallet addresses and submit deposit-wallet batches (with “wallet
busy” retries + keyring signing support).
Polishes confirmations activity rendering for
predictWithdrawbyadding a dedicated
predict_withdrawtitle and treating it as areceive-summary type using the source token/network metadata. Tests are
added/updated accordingly, and
@metamask/transaction-pay-controllerisbumped to
22.5.0.Reviewed by Cursor Bugbot for commit
054697c. Bugbot is set up for automated
code reviews on this repo. Configure
here.