Prepare a user operation for signing.
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>;
The options for preparing the user operation
let options: { adminAccount: Account; client: ThirdwebClient; isDeployedOverride?: boolean; smartWalletOptions: SmartWalletOptions; transactions: Array<PreparedTransaction>; waitForDeployment?: boolean;};
let returnType: Promise<UserOperationV06 | UserOperationV07>;
The prepared user operation