Standard
EIP-5792 defines a standard for smart contract wallets that introduced new JSON-RPC methods. These methods allow
batched, gas-sponsored, and conditional transactions through a simple interface.
These endpoints make it easier for dapps and wallets to interact with smart accounts without needing to understand account abstraction internals like ERC-4337.
EIP-5792 introduced the following functions:
- wallet_getCapabilities
- wallet_sendCalls
- wallet_getCallsStatus
- wallet_showCallsStatus
Support
As of 04/2025 EIP-5792 is still rolling out, and you can find a list of wallets that support it here.
The example below show how to handle wallet_getCapabilities
for atomic (batch transactions) and paymaster support, and sendCalls with for a batched transaction.
Example
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { parseEther } from 'viem';
...
const { primaryWallet} = useDynamicContext();
...
const signAtomicSponsoredTransactionExample = async () => {
if (primaryWallet) {
const chainId = (await primaryWallet.getNetwork());
const walletClient = await primaryWallet.getWalletClient();
const capabilities = await walletClient.getCapabilities();
if (capabilities && capabilities[chainId]) {
const chainCapabilities = capabilities[chainId];
const paymasterServiceSupported = chainCapabilities.paymasterService?.supported;
const atomicStatusSupported = chainCapabilities.atomic && (chainCapabilities.atomic.status == 'ready' || chainCapabilities.atomic.status == 'supported');
if (!atomicStatusSupported) {
console.log('atomic is not supported for chainId:', chainId);
return;
}
if (!paymasterServiceSupported) {
console.log('paymaster is not supported for chainId:', chainId);
}
const callParams = {
calls: [
{
to: '0x58e2C06939056c2fC760bE062Ef6dbbbCD4045e3',
value: parseEther('0.001')
},
{
to: '0x58e2C06939056c2fC760bE062Ef6dbbbCD4045e3',
value: parseEther('0.001')
},
]
};
if (paymasterServiceSupported) {
callParams.capabilities = {
paymasterService: {
url: undefined
}
};
}
const result = await walletClient.sendCalls(callParams);
return result;
}
}
};