function buildUserOperation<
TTransport,
TChain,
TAccount,
TContext,
TEntryPointVersion,
>(client_, args): Promise<UserOperationStruct<TEntryPointVersion>>;Defined in: aa-sdk/core/src/actions/smartAccount/buildUserOperation.ts:42
Builds a user operation using the provided client and operation parameters. Ensures that the account exists and the client is compatible.
import { createSmartAccountClient } from "@aa-sdk/core";
// smart account client is already extended with buildUserOperation
const client = createSmartAccountClient(...);
const result = await client.buildUserOperation({
uo: {
target: "0x...",
data: "0x...", // or "0x",
value: 0n, // optional
},
account, // only required if the client above is not connected to an account
});| Type Parameter | Default type |
|---|---|
| |
|
|
| | |
|
|
|
|
| Parameter | Type | Description |
|---|---|---|
|
| the client instance used to build the user operation |
|
| the parameters required to build the user operation, including account, overrides, and context |
Promise<UserOperationStruct<TEntryPointVersion>>
a promise that resolves to a UserOperationStruct object containing the built user operation details