Skip to content

feat: support EIP-7702 gasless swaps via Relay /execute endpoint#8133

Draft
matthewwalsh0 wants to merge 2 commits intomainfrom
feat/metamask-pay-relay-execute
Draft

feat: support EIP-7702 gasless swaps via Relay /execute endpoint#8133
matthewwalsh0 wants to merge 2 commits intomainfrom
feat/metamask-pay-relay-execute

Conversation

@matthewwalsh0
Copy link
Member

Explanation

On EIP-7702 supported chains, the Relay strategy now submits source transactions via Relay's /execute endpoint instead of adding them through the TransactionController. This enables gasless execution where Relay's relayer submits the transaction on behalf of the user.

  • Source calls (approve + deposit) are combined into a single delegation transaction using getDelegationTransaction
  • The combined transaction is submitted to Relay's /execute endpoint, which handles gas payment
  • Non-EIP-7702 chains continue using the existing addTransaction/addTransactionBatch flow
  • All Relay network interactions are encapsulated in a new relay-api.ts module
  • getEIP7702SupportedChains replaced with isEIP7702Chain(messenger, chainId) for cleaner call sites
  • Execute and quote URLs are configurable via feature flags for proxy support

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

@matthewwalsh0 matthewwalsh0 force-pushed the feat/metamask-pay-relay-execute branch from 3f21666 to 13ff3e1 Compare March 6, 2026 14:01
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