useCallsStatus
Defined in: account-kit/react/src/hooks/useCallsStatus.ts:55
Hook to retrieve the status of prepared calls from the Wallet API.
This hook queries the status of a specific call ID that was returned from wallet_sendPreparedCalls.
The status indicates whether the batch of calls has been processed, confirmed, or failed on-chain.
Example
import { function useCallsStatus(params: UseCallsStatusParams): UseCallsStatusResultHook to retrieve the status of prepared calls from the Wallet API.
This hook queries the status of a specific call ID that was returned from wallet_sendPreparedCalls. The status indicates whether the batch of calls has been processed, confirmed, or failed on-chain.
useCallsStatus } from "@account-kit/react";
function function MyComponent(): voidMyComponent() {
const {
data: {
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
} | undefinedThe last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
data: const callsStatus: {
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
} | undefinedThe last successfully resolved data for the query.
callsStatus,
const isLoading: booleanIs true whenever the first fetch for a query is in-flight.
Is the same as isFetching && isPending.
isLoading,
const error: Error | nullThe error object for the query, if an error was thrown.
Defaults to null.
error,
} = function useCallsStatus(params: UseCallsStatusParams): UseCallsStatusResultHook to retrieve the status of prepared calls from the Wallet API.
This hook queries the status of a specific call ID that was returned from wallet_sendPreparedCalls. The status indicates whether the batch of calls has been processed, confirmed, or failed on-chain.
useCallsStatus({
client: {
account: SupportedAccounts;
batch?: {
multicall?: boolean | Prettify<MulticallBatchOptions> | undefined;
} | undefined;
cacheTime: number;
ccipRead?: false | {
request?: (parameters: CcipRequestParameters) => Promise<CcipRequestReturnType>;
} | undefined;
chain: Chain | undefined;
experimental_blockTag?: BlockTag | undefined;
key: string;
... 81 more ...;
extend: <const client extends {
...;
} & ExactPartial<...>>(fn: (client: Client<...>) => client) => Client<...>;
} | {
...;
} | {
...;
} | {
...;
} | undefinedclient: anysmartWalletClient,
callId: `0x${string}` | undefinedcallId: "0x1234...", // The call ID from sendPreparedCalls
queryOptions?: Omit<UseQueryOptions<{
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, Error, {
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, readonly unknown[]>, "queryKey" | "queryFn"> | undefinedqueryOptions: {
// Refetch every 2 sec while pending.
refetchInterval?: number | false | ((query: Query<{
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, Error, {
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, readonly unknown[]>) => number | false | undefined) | undefinedIf set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency Defaults to false.
refetchInterval: (q: Query<{
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, Error, {
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, readonly unknown[]>q) => (q: Query<{
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, Error, {
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, readonly unknown[]>q.Query<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | ... 3 more ... | 600; }, Error, { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | ... 3 more ... | 600; }, readonly unknown[]>.state: QueryState<{
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
}, Error>state.QueryState<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | ... 3 more ... | 600; }, Error>.data: {
receipts?: {
status: `0x${string}`;
logs: {
address: `0x${string}`;
data: `0x${string}`;
topics: `0x${string}`[];
}[];
blockHash: `0x${string}`;
blockNumber: `0x${string}`;
gasUsed: `0x${string}`;
transactionHash: `0x${string}`;
}[] | undefined;
id: `0x${string}`;
chainId: `0x${string}`;
atomic: boolean;
status: 200 | 100 | 400 | 500 | 600;
} | undefineddata?.status: 200 | 100 | 400 | 500 | 600 | undefinedstatus === 100 ? 2000 : false),
},
});
}Parameters
Returns
Query result