sendUserOperation

1function sendUserOperation<
2 TTransport,
3 TChain,
4 TAccount,
5 TContext,
6 TEntryPointVersion,
7>(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.

Example

1import { createSmartAccountClient, toSmartContractAccount } from "@aa-sdk/core";
2
3const account = await toSmartContractAccount(...);
4const result = await createSmartAccountClient(...).sendUserOperation({
5 uo: {
6 target: "0x...",
7 data: "0x...", // or "0x",
8 value: 0n, // optional
9 }
10});

Type Parameters

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>

Parameters

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

Returns

Promise<SendUserOperationResult<TEntryPointVersion>>

a Promise containing the result of the user operation