feat: Withdrawal to any token (Predict)#7783
Merged
Conversation
This was referenced Jan 30, 2026
dan437
commented
Jan 30, 2026
dan437
commented
Jan 30, 2026
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts
Outdated
Show resolved
Hide resolved
matthewwalsh0
requested changes
Jan 30, 2026
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/utils/source-amounts.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts
Outdated
Show resolved
Hide resolved
7 tasks
5b8062c to
8b20558
Compare
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>
packages/transaction-pay-controller/src/strategy/relay/relay-quotes.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
…al-to-any-token
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>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
…al-to-any-token
matthewwalsh0
requested changes
Feb 11, 2026
| * @param relayParamCount - Number of relay-only params (excludes prepended original tx). | ||
| * @returns The transaction type. | ||
| */ | ||
| function getTransactionType( |
Member
There was a problem hiding this comment.
Minor, exported functions at the top, internal below?
Contributor
Author
There was a problem hiding this comment.
Will include it in the next PR!
matthewwalsh0
approved these changes
Feb 11, 2026
| * `calculateTransactionGasCost`, independent of any bridge quote fees. | ||
| * Only populated on totals, not on individual quotes. | ||
| */ | ||
| transactionGas?: FiatValue; |
Member
There was a problem hiding this comment.
Afraid I totally missed this, was this added between reviews?
We shouldn't need to expose the transaction specific gas externally, as it becomes part of the Relay quote deposit, so it should be encapsulated by the sourceNetwork fee.
We can remove in the upcoming gas fee PR.
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
Adds support for "post-quote" withdrawal flows, enabling users to withdraw funds to any token/chain (e.g., Predict withdrawals).
Changes:
References
Checklist
Note
Medium Risk
Touches quote construction and Relay batch submission logic (including transaction typing and gas handling), which can impact correctness of on-chain execution for withdrawals. Changes are feature-gated by the new
isPostQuoteflag but broaden behavior in core transaction-pay flows.Overview
Adds post-quote (withdrawal) support across Transaction Pay by introducing
isPostQuoteintoTransactionData/QuoteRequestand persisting it ontoTransactionMeta.metamaskPay(also extendingMetamaskPayMetadataintransaction-controller).Replaces
setIsMaxAmountwith a callback-basedsetTransactionConfig, and ensures togglingisPostQuotere-triggers source-amount and quote refresh.Updates Relay quoting/submission to handle post-quote semantics: keep
targetAmountMinimum=0requests whenisPostQuote, useEXACT_INPUT, skip transaction preprocessing, avoid Hyperliquid-deposit normalization in post-quote mode, and submit as a batch that prepends the original transaction ahead of relay steps with corrected type/gasLimit handling.Adds post-quote-specific source amount derivation (including new
source*fields and same-token-same-chain skip logic viaisSameToken), includes original transaction gas asfees.transactionGasin totals, and fixes a nested-transfer detection edge case (findIndexreturning-1).Written by Cursor Bugbot for commit 685847e. This will update automatically on new commits. Configure here.