Alchemy Logo

dropAndReplaceUserOperation

function dropAndReplaceUserOperation<
  TTransport,
  TChain,
  TAccount,
  TContext,
  TEntryPointVersion,
>(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.

import {
 createSmartAccountClient,
} from "@aa-sdk/core";
 
// smart account client is already extended with dropAndReplaceUserOperation
const client = createSmartAccountClient(...);
const { request } = await client.sendUserOperation(...);
const result = await client.dropAndReplaceUserOperation({
 uoToDrop: request,
 account, // only required if the client above is not connected to an account
});

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>

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

Promise<SendUserOperationResult<TEntryPointVersion>>

A promise that resolves to the result of sending the new user operation

Was this page helpful?