signUserOp

Sign a user operation.

Example

import { signUserOp } from "thirdweb/wallets/smart";
const userOp = createUnsignedUserOp(...);
const signedUserOp = await signUserOp({
userOp,
chain,
adminAccount,
});
function signUserOp(args: {
adminAccount: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
entrypointAddress?: string;
userOp: UserOperation;
}): Promise<UserOperation>;

Parameters

Type

let args: {
adminAccount: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
entrypointAddress?: string;
userOp: UserOperation;
};

Returns

let returnType: {
callData: Hex | Uint8Array;
callGasLimit: bigint;
initCode: Hex | Uint8Array;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
nonce: bigint;
paymasterAndData: Hex | Uint8Array;
preVerificationGas: bigint;
sender: Address;
signature: Hex | Uint8Array;
verificationGasLimit: bigint;
};
  • The user operation with the signature field populated