waitForUserOperationTransaction

Waits for a user operation transaction to be confirmed by checking the receipt periodically until it is found or a maximum number of retries is reached.

Import

1import { waitForUserOperationTransaction } from "@aa-sdk/core";

Usage

1import { createSmartAccountClient } from "@aa-sdk/core";
2
3// smart account client is already extended with waitForUserOperationTransaction
4const client = createSmartAccountClient(...);
5const result = await client.waitForUserOperationTransaction({
6hash: "0x...",
7retries: {...} // optional param to configure the retry amounts
8});

Parameters

client_

Client<TTransport, TChain, any> The client instance used to interact with the blockchain

args

WaitForUserOperationTxParameters The parameters for the transaction to wait for

args.hash

Hex The transaction hash to wait for

args.tag

string The tag to use for the UO status. “pending” or “latest”. Defaults to “latest”.

args.retries

WaitForUserOperationTxParameters["retries"] Optional retry parameters

args.retries.maxRetries

number The maximum number of retry attempts

args.retries.intervalMs

number The interval in milliseconds between retries

args.retries.multiplier

number The multiplier for the interval between retries

Returns

Promise<Hex> A promise that resolves to the transaction hash when the transaction is confirmed