Skip to content

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

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

Usage

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

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.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