Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for EIP-5792 batch transactions #434

Merged
merged 10 commits into from
Jan 21, 2025

Conversation

ted-palmer
Copy link
Member

This PR adds support for atomic batch transactions when using smart wallets. This allows the approval and deposit/swap steps to be combined into a single transaction when the wallet supports this capability.

Changes

  • Added supportsAtomicBatch and handleBatchTransactionStep methods to AdaptedWallet interface
  • Implemented atomic batch support in the viem wallet adapter
  • Modified sendTransactionSafely to handle both single and batched transactions
  • Added utility functions to prepare batch transactions
  • Added a useAtomicBatchSupport hook for checking if the connected wallet supports this capability

Copy link

changeset-bot bot commented Jan 14, 2025

🦋 Changeset detected

Latest commit: 80aba91

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@reservoir0x/relay-bitcoin-wallet-adapter Major
@reservoir0x/relay-ethers-wallet-adapter Major
@reservoir0x/relay-svm-wallet-adapter Major
@reservoir0x/relay-kit-hooks Minor
@reservoir0x/relay-sdk Minor
@reservoir0x/relay-kit-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
relay-sdk-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 2:23pm

packages/sdk/src/types/AdaptedWallet.ts Show resolved Hide resolved
packages/sdk/src/utils/executeSteps.ts Outdated Show resolved Hide resolved
packages/sdk/src/utils/transaction.ts Outdated Show resolved Hide resolved
packages/hooks/src/hooks/useAtomicBatchSupport.ts Outdated Show resolved Hide resolved
@ted-palmer ted-palmer merged commit 53d323b into main Jan 21, 2025
3 checks passed
@ted-palmer ted-palmer deleted the ted/relay-6504-support-erc-5792-send-calls branch January 21, 2025 14:25
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.

2 participants