feat(transaction-pay-controller): subsidized submit#9298
Draft
matthewwalsh0 wants to merge 1 commit into
Draft
Conversation
…lay/subsidize Subsidized Relay quotes (non-zero fees.subsidized.amountUsd) now bypass /execute and submit through the intents-API POST /relay/subsidize endpoint instead. The client signs two ERC20BalanceChange + LimitedCalls delegations server-side; the server JIT-fetches a fresh Relay quote, pairs each delegation with a step, builds redeemDelegations calldata, and submits to Relay — returning a new request ID for status polling. Key changes: - utils/delegation.ts: buildAndSignSubsidizedDelegation with ERC20BalanceChange and LimitedCalls caveats, ANY_BENEFICIARY delegate, 20% amount buffer - relay-api.ts: submitRelaySubsidize() calling POST /relay/subsidize - relay-submit.ts: submitViaRelaySubsidize signs 2 delegations in parallel and sends delegations:[ctx0,ctx1] matching server schema; isSubsidizedRelayQuote detects subsidized quotes from fees.subsidized.amountUsd - types.ts: RelaySubsidizeRequest / RelaySubsidizeResponse - feature-flags.ts: relaySubsidizeUrl flag with DEFAULT_RELAY_SUBSIDIZE_URL default; fix localhost hardcoded URLs for relayQuoteUrl and relaySubsidizeUrl Fix crash when subsidized preview quotes have steps: undefined — server toSafeSubsidizedQuote() strips steps entirely; submitTransactions now uses quote.original.steps ?? [] and submitViaRelaySubsidize initialises quote.original.steps ??= [] before element access.
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
References
Checklist