Skip to content

feat(transaction-pay-controller): subsidized submit#9298

Draft
matthewwalsh0 wants to merge 1 commit into
mainfrom
feat/pay-subsidized-submit
Draft

feat(transaction-pay-controller): subsidized submit#9298
matthewwalsh0 wants to merge 1 commit into
mainfrom
feat/pay-subsidized-submit

Conversation

@matthewwalsh0

@matthewwalsh0 matthewwalsh0 commented Jun 28, 2026

Copy link
Copy Markdown
Member

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

…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.
@matthewwalsh0 matthewwalsh0 changed the title feat(transaction-pay-controller): add subsidized Relay submit via /relay/subsidize feat(transaction-pay-controller): subsidized submit Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant