useSendCalls
Defined in: account-kit/react/src/hooks/useSendCalls.ts:120
Hook for sending calls to a smart account or EOA wallet.
This hook provides functionality to execute calls on a smart account using Account Abstraction, or fall back to regular EOA transactions when connected to an EOA wallet. It handles the complete flow of preparing, signing, and sending calls.
<Note>
If using this hook with an ERC-20 paymaster in pre-operation mode with autoPermit, the contents of the permit will be hidden
from the user. It is recommended to use the usePrepareCalls hook instead to manually handle the permit signature.
</Note>
Example
Type Parameters
Parameters
Returns
UseSendCallsResult<TEntryPointVersion>
An object containing:
- sendCalls: Function to send calls synchronously (returns void)
- sendCallsAsync: Async function to send calls (returns Promise)
- sendCallsResult: The result of the last successful call execution
- isSendingCalls: Boolean indicating if calls are currently being sent
- error: Error from the last failed call execution, if any
Description
- When connected to an EOA wallet, only single calls are supported (batch execution is not allowed)
- For smart accounts, the returned idsare the prepared call IDs
- For EOA wallets, the returned idsare transaction hashes