Skip to content

EIP-5792 transaction batching for bridge operations #804

Description

@dmytrotkk

Right now every bridge action that needs multiple transactions (approve → transfer, wrap → transfer, etc.) sends them one at a time - each with its own wallet popup. EIP-5792 wallet_sendCalls lets us batch same-chain calls into a single wallet approval.

This applies to all multi-transaction steps that happen on the same chain within a single action. For example, in TransferERC20S2S.execute() the approve + transferToSchainERC20 are both on sChain1 — those can be batched. Same for WrapERC20S (approve + wrap), TransferERC20M2S (approve + deposit), etc.

What changes

  • Extend viem wallet client with eip5792Actions()
  • Add capability detection using wallet_getCapabilities — check if the connected wallet supports sendCalls and atomic execution
  • For each action class that does approve + main call on the same chain: if wallet supports EIP-5792, use sendCalls with both calls in one batch; if not, fall back to current sequential behavior
  • Track batch status via wallet_getCallsStatus
  • Update transactions.ts (or create a new batchTransactions.ts) with a helper that takes an array of contract calls and routes through sendCalls or sequential fallback

Wallets with EIP-5792 support (as of March 2026): MetaMask, Coinbase Wallet, Rainbow, Trust Wallet.

Acceptance criteria

  • MetaMask/Coinbase users see a single approval prompt for approve + transfer operations
  • Wallets without EIP-5792 support still work via sequential transactions (no regression)
  • All bridge routes work: S→S, M→S, S→M, wrap, unwrap
  • Batch status tracking works (pending → confirmed)
  • Error handling works correctly for both batched and sequential paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions