Skip to content
Alchemy Logo

sendUserOperation

function sendUserOperation<
  TTransport,
  TChain,
  TAccount,
  TContext,
  TEntryPointVersion,
>(client_, args): Promise<SendUserOperationResult<TEntryPointVersion>>;

Defined in: aa-sdk/core/src/actions/smartAccount/sendUserOperation.ts:39

Sends a user operation or batch of user operations using the connected account. Before executing, sendUserOperation will run the user operation through the middleware pipeline.

import { createSmartAccountClient, toSmartContractAccount } from "@aa-sdk/core";
 
const account = await toSmartContractAccount(...);
const result = await createSmartAccountClient(...).sendUserOperation({
 uo: {
   target: "0x...",
   data: "0x...", // or "0x",
   value: 0n, // optional
 }
});

Type ParameterDefault type

TTransport extends Transport

Transport

TChain extends undefined | Chain

undefined | Chain

TAccount extends | undefined | SmartContractAccount

| undefined | SmartContractAccount

TContext extends | undefined | UserOperationContext

| undefined | UserOperationContext

TEntryPointVersion extends keyof EntryPointRegistryBase<unknown>

GetEntryPointFromAccount<TAccount>

ParameterTypeDescription

client_

Client<TTransport, TChain, TAccount>

the smart account client to use for RPC requests

args

any

contains the UO or batch to send, context, overrides, and account if not hoisted on the client

Promise<SendUserOperationResult<TEntryPointVersion>>

a Promise containing the result of the user operation

Was this page helpful?