prepareUserOp

Prepare a user operation for signing.

Example

import { prepareUserOp } from "thirdweb/wallets/smart";
const userOp = await prepareUserOp({
transactions,
adminAccount,
client,
smartWalletOptions,
});

You can then sign the user operation with signUserOp(). and send it to the bundler with bundlerUserOp().

function prepareUserOp(options: {
adminAccount: Account;
client: ThirdwebClient;
isDeployedOverride?: boolean;
smartWalletOptions: SmartWalletOptions;
transactions: Array<PreparedTransaction>;
waitForDeployment?: boolean;
}): Promise<UserOperationV06 | UserOperationV07>;

Parameters

The options for preparing the user operation

Type

let options: {
adminAccount: Account;
client: ThirdwebClient;
isDeployedOverride?: boolean;
smartWalletOptions: SmartWalletOptions;
transactions: Array<PreparedTransaction>;
waitForDeployment?: boolean;
};

Returns

let returnType: Promise<UserOperationV06 | UserOperationV07>;
  • The prepared user operation