Documentation Index Fetch the complete documentation index at: https://docs.abs.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Viem’s sendCalls method following EIP-5792 can be used to sign and submit multiple transactions in a single call using the connected Abstract Global Wallet.
Usage
import { useSendCalls } from "wagmi" ;
import { encodeFunctionData , parseUnits } from "viem" ;
import { useAbstractClient } from "@abstract-foundation/agw-react" ;
export function SendCalls () {
const { data : abstractClient } = useAbstractClient ();
const { sendCalls } = useSendCalls ();
return (
< button
onClick = { () => {
if ( ! abstractClient ) return ;
sendCalls ({
calls: [
// 1 - Approval
{
to: TOKEN_ADDRESS ,
data: encodeFunctionData ({
abi: erc20Abi ,
functionName: "approve" ,
args: [ ROUTER_ADDRESS , parseUnits ( "100" , 18 )],
}),
},
// 2 - Swap
{
to: ROUTER_ADDRESS ,
data: encodeFunctionData ({
abi: routerAbi ,
functionName: "swapExactTokensForETH" ,
args: [
parseUnits ( "100" , 18 ),
BigInt ( 0 ),
[ TOKEN_ADDRESS , WETH_ADDRESS ],
abstractClient . account . address ,
BigInt ( Math . floor ( Date . now () / 1000 ) + 60 * 20 ),
],
}),
},
],
});
} }
>
Send Batch Calls
</ button >
);
}
Parameters
An array of calls. Each call can include the following fields: The recipient address of the call.
Contract code or a hashed method call with encoded args.
Contract ABI used to encode function calls.
Name of the function to call in the provided abi.
Arguments to pass to functionName. Will be ABI-encoded into data.
Additional data appended to the end of the calldata (e.g. a domain tag).
Value in wei sent with this call.
When true, the bundle executes atomically — if any call reverts, the whole
bundle reverts.
Advanced features to enable for the bundle (gas sponsorship, access lists,
etc.). paymaster
{ address: Address; data?: Hex } | undefined
Gas sponsorship via the specified Paymaster contract.
Returns
Returns a Promise<Hex> containing the bundle hash. Pass this hash to wallet_getCallsStatus to monitor execution status.