Repository navigation
refactor(transaction-pay-controller): decouple Polymarket withdraw helpers from the Relay strategy - #10799
Merged
Conversation
…s out of the Relay strategy
3 of 4 tasks
…lpers from Relay types
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
matthewwalsh0
marked this pull request as ready for review
October 13, 2026 10:20
mm-confirmations-pull-request-bot
Bot
requested a review
from pedronfigueiredo
October 13, 2026 11:00
Merged
2 of 4 tasks
pedronfigueiredo
approved these changes
Oct 13, 2026
This branch was successfully deployed
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.
Explanation
The Polymarket withdraw helpers live under the Relay strategy and take Relay quotes and statuses, but the server strategy also needs them to support Predict withdraws. This is a refactor with no change in behaviour.
strategy/relay/polymarket/toutils/polymarket/.getPolymarketDepositWalletOverridesreturns the deposit wallet and source token, and the Relay strategy applies them to its request body.strategy/relay/deposit-step.ts.References
Checklist
Note
Low Risk
Refactor with updated tests and call-site wiring; no intentional behavior change to payment or withdraw flows.
Overview
Decouples Polymarket Predict withdraw logic from Relay-specific types so the same helpers can be reused outside the Relay strategy (e.g. server strategy work in #10702). Behavior is intended to stay the same.
Polymarket code moves from
strategy/relay/polymarket/toutils/polymarket/. Withdraw, simulation, and sweep APIs now take plain inputs—deposit-step calldata, source amount, and anisRefundflag—instead ofRelayQuoteor Relay status strings. Quote-time deposit-wallet wiring is split:getPolymarketDepositWalletOverridesreturns the wallet and USDC.e source token whilerelay-quotesmutates the Relay request body. Predict withdraw gas behavior is unchanged but callers pass a deposit-step flag intogetPredictWithdrawSafeAddressand use newgetPredictWithdrawFeeTokenAccountfor fee-token lookup.Relay-only deposit-step detection is centralized in new
deposit-step.ts(hasRelayDepositStep,getRelayDepositData), with unit tests; Relay submit/validation pull deposit calldata through those helpers before calling Polymarket utils.Reviewed by Cursor Bugbot for commit a3a798b. Bugbot is set up for automated code reviews on this repo. Configure here.