createUnsignedUserOp
Creates an unsigned user operation from a prepared transaction.
import { createUnsignedUserOp } from "thirdweb/wallets/smart"; const transaction = prepareContractCall(...); const userOp = await createUnsignedUserOp({ transaction, factoryContract, accountContract, adminAddress, sponsorGas, overrides,});
function createUnsignedUserOp(args: { adminAddress: string; overrides?: { accountAddress?: string; accountSalt?: string; bundlerUrl?: string; createAccount?: ( entrypointAddress?: string; erc20Paymaster?: { address: string; token: string }; execute?: ( transaction: SendTransactionOption, executeBatch?: ( transactions: Array<SendTransactionOption>, getAccountNonce?: ( ) => Promise<bigint>; predictAddress?: ( ) => Promise<string>; }; sponsorGas: boolean;
The prepared transaction and options
let args: { adminAddress: string; overrides?: { accountAddress?: string; accountSalt?: string; bundlerUrl?: string; createAccount?: ( entrypointAddress?: string; erc20Paymaster?: { address: string; token: string }; execute?: ( transaction: SendTransactionOption, executeBatch?: ( transactions: Array<SendTransactionOption>, getAccountNonce?: ( ) => Promise<bigint>; predictAddress?: ( ) => Promise<string>; }; sponsorGas: boolean;};
let returnType: { callGasLimit: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: bigint; preVerificationGas: bigint; sender: Address; verificationGasLimit: bigint;};
The unsigned user operation