dropAndReplaceUserOperation

1function dropAndReplaceUserOperation<
2 TTransport,
3 TChain,
4 TAccount,
5 TContext,
6 TEntryPointVersion,
7>(client_, args): Promise<SendUserOperationResult<TEntryPointVersion>>;

Defined in: aa-sdk/core/src/actions/smartAccount/dropAndReplaceUserOperation.ts:50

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

Example

1import {
2 createSmartAccountClient,
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({
9 uoToDrop: request,
10 account, // only required if the client above is not connected to an account
11});

Type Parameters

Type ParameterDefault type

TTransport extends Transport

Transport

TChain extends undefined | Chain

undefined | Chain

TAccount extends any

any

TContext extends any

any

TEntryPointVersion extends GetEntryPointFromAccount<TAccount>

GetEntryPointFromAccount<TAccount>

Parameters

ParameterTypeDescription

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