useSignAndSendPreparedCalls
Defined in: account-kit/react/src/hooks/useSignAndSendPreparedCalls.ts:86
Hook for signing and sending prepared calls from a smart account.
This hook provides functionality to sign and send previously prepared calls to a smart account. It handles both the signing and sending of prepared calls in a single operation, and does not support EOA wallets.
Example
import { function useSignAndSendPreparedCalls(params: UseSignAndSendPreparedCallsParams): UseSignAndSendPreparedCallsResultHook for signing and sending prepared calls from a smart account.
This hook provides functionality to sign and send previously prepared calls to a smart account. It handles both the signing and sending of prepared calls in a single operation, and does not support EOA wallets.
useSignAndSendPreparedCalls } from "@account-kit/react";
const {
const signAndSendPreparedCalls: UseMutateFunction<{
preparedCallIds: `0x${string}`[];
}, Error, MutationParams, unknown>signAndSendPreparedCalls,
const signAndSendPreparedCallsAsync: UseMutateAsyncFunction<{
preparedCallIds: `0x${string}`[];
}, Error, MutationParams, unknown>signAndSendPreparedCallsAsync,
const isSigningAndSendingPreparedCalls: booleanisSigningAndSendingPreparedCalls,
const error: Error | nullerror,
} = function useSignAndSendPreparedCalls(params: UseSignAndSendPreparedCallsParams): UseSignAndSendPreparedCallsResultHook for signing and sending prepared calls from a smart account.
This hook provides functionality to sign and send previously prepared calls to a smart account. It handles both the signing and sending of prepared calls in a single operation, and does not support EOA wallets.
useSignAndSendPreparedCalls();
// Sign and send prepared calls
await const signAndSendPreparedCallsAsync: (variables: MutationParams, options?: MutateOptions<{
preparedCallIds: `0x${string}`[];
}, Error, MutationParams, unknown> | undefined) => Promise<{
preparedCallIds: `0x${string}`[];
}>signAndSendPreparedCallsAsync({
preparedCalls: never[]preparedCalls: [
// unsigned prepared call objects
],
});Parameters
Returns
UseSignAndSendPreparedCallsResult
An object containing:
signAndSendPreparedCalls: Function to sign and send prepared calls synchronously (returns void)signAndSendPreparedCallsAsync: Async function to sign and send prepared calls (returns Promise)signAndSendPreparedCallsResult: The result of the last successful prepared call executionisSigningAndSendingPreparedCalls: Boolean indicating if prepared calls are currently being signed and senterror: Error from the last failed prepared call execution, if any
Description
- This hook only works with smart accounts and does not support EOA wallets
- The hook handles both signing and sending of prepared calls in a single operation
- The returned result contains the prepared call IDs