> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# EIP-5792 (Batched Calls)

> Use wallet_getCapabilities and wallet_sendCalls to batch and sponsor EVM transactions.

[EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) adds a small set of JSON-RPC methods that let dapps ask wallets for advanced capabilities — atomic batches, paymaster sponsorship, and conditional execution — without needing to understand ERC-4337 internals.

The standard introduces:

* `wallet_getCapabilities`
* `wallet_sendCalls`
* `wallet_getCallsStatus`
* `wallet_showCallsStatus`

Support is rolling out across wallets. See the [EIP-5792 ecosystem tracker](https://www.eip5792.xyz/ecosystem/wallets) for the current list. The Viem `WalletClient` returned by [`createWalletClientForWalletAccount`](/javascript/reference/evm/getting-viem-wallet-client) exposes these methods directly.

## Check capabilities

Use `getCapabilities()` to see which features the wallet supports for a given chain before sending calls.

```javascript theme={"system"}
import { createWalletClientForWalletAccount } from '@dynamic-labs-sdk/evm/viem';
import { getActiveNetworkData } from '@dynamic-labs-sdk/client';

const checkCapabilities = async (walletAccount) => {
  const walletClient = await createWalletClientForWalletAccount({ walletAccount });
  const { networkData } = await getActiveNetworkData({ walletAccount });
  const chainId = networkData.chainId;

  const capabilities = await walletClient.getCapabilities();
  const chainCapabilities = capabilities?.[chainId];

  if (!chainCapabilities) {
    return { atomic: false, paymaster: false };
  }

  const atomicSupported =
    chainCapabilities.atomic?.status === 'ready' ||
    chainCapabilities.atomic?.status === 'supported';

  const paymasterSupported = Boolean(
    chainCapabilities.paymasterService?.supported
  );

  return { atomic: atomicSupported, paymaster: paymasterSupported };
};
```

## Batch calls

`sendCalls` submits multiple calls atomically when the wallet supports it. Optionally include `paymasterService` capabilities to request gas sponsorship.

```javascript theme={"system"}
import { parseEther } from 'viem';
import { createWalletClientForWalletAccount } from '@dynamic-labs-sdk/evm/viem';
import { getActiveNetworkData } from '@dynamic-labs-sdk/client';

const sendBatchedCalls = async (walletAccount) => {
  const walletClient = await createWalletClientForWalletAccount({ walletAccount });
  const { networkData } = await getActiveNetworkData({ walletAccount });
  const chainId = networkData.chainId;

  const capabilities = await walletClient.getCapabilities();
  const chainCapabilities = capabilities?.[chainId];

  const atomicSupported =
    chainCapabilities?.atomic?.status === 'ready' ||
    chainCapabilities?.atomic?.status === 'supported';

  if (!atomicSupported) {
    throw new Error(`Atomic batching not supported on chain ${chainId}`);
  }

  const callParams: Parameters<typeof walletClient.sendCalls>[0] = {
    calls: [
      {
        to: '0x1111111111111111111111111111111111111111',
        value: parseEther('0.001'),
      },
      {
        to: '0x2222222222222222222222222222222222222222',
        value: parseEther('0.001'),
      },
    ],
  };

  if (chainCapabilities?.paymasterService?.supported) {
    callParams.capabilities = {
      paymasterService: { url: undefined },
    };
  }

  const { id } = await walletClient.sendCalls(callParams);
  return id;
};
```

## Track status

`getCallsStatus` returns the execution state for a batch. Poll it (or `waitForCallsStatus`) until the batch settles.

```javascript theme={"system"}
const status = await walletClient.getCallsStatus({ id });

if (status.status === 'success') {
  console.log('Batch executed:', status.receipts);
}
```

`showCallsStatus` lets the wallet present a transaction status UI to the user — handy for relayer-style flows.

## Notes

* If the wallet doesn't support EIP-5792, `getCapabilities` and `sendCalls` will throw or return empty capabilities. Always check capabilities first and fall back to a sequential `sendTransaction` loop.
* Atomic batching is a wallet-level guarantee — the wallet decides whether to submit calls atomically, sequentially, or via account abstraction.
* Paymaster sponsorship requires both wallet support **and** a configured paymaster URL. If you're using ZeroDev for sponsorship, see the [Gas Sponsorship Quickstart](/javascript/reference/zerodev/gas-sponsorship-quickstart) for a more direct ERC-4337 path.

## Related functions

* [Getting a Viem WalletClient](/javascript/reference/evm/getting-viem-wallet-client)
* [Get Active Network](/javascript/reference/wallets/get-active-network)
* [Sign Typed Data (EIP-712)](/javascript/reference/evm/sign-typed-data)
* [Sign a Transaction](/javascript/reference/evm/sign-transaction)
* [ZeroDev Gas Sponsorship Quickstart](/javascript/reference/zerodev/gas-sponsorship-quickstart)
