dropAndReplaceUserOperation

Drops an existing user operation and replaces it with a new one while ensuring the appropriate fees and overrides are applied.

Import

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

Usage

1import {
2createSmartAccountClient,
3} from "@aa-sdk/core";
4
5// smart account client is already extended with dropAndReplaceUserOperation
6const client = createSmartAccountClient(...);
7const { request } = await client.sendUserOperation(...);
8const result = await client.dropAndReplaceUserOperation({
9uoToDrop: request,
10account, // only required if the client above is not connected to an account
11});

Parameters

client_

Client<TTransport, TChain, TAccount> The client instance with the transport, chain, and account information

args

DropAndReplaceUserOperationParameters<TAccount, TContext> The parameters required for dropping and replacing the user operation including the account, operation to drop, overrides, and context

Returns

Promise<SendUserOperationResult<TEntryPointVersion>> A promise that resolves to the result of sending the new user operation