getPaymasterAndData

Get paymaster and data details for a user operation.

Example

import { getPaymasterAndData } from "thirdweb/wallets/smart";
const userOp = createUnsignedUserOp(...);
const paymasterAndData = await getPaymasterAndData({
userOp,
client,
chain,
});
function getPaymasterAndData(args: {
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
entrypointAddress?: string;
paymasterOverride?: (
userOp: UserOperation,
) => Promise<PaymasterResult>;
userOp: UserOperation;
}): Promise<PaymasterResult>;

Parameters

The userOp and options

Type

let args: {
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
entrypointAddress?: string;
paymasterOverride?: (
userOp: UserOperation,
) => Promise<PaymasterResult>;
userOp: UserOperation;
};

Returns

let returnType: {
callGasLimit?: bigint;
paymasterAndData: string;
preVerificationGas?: bigint;
verificationGasLimit?: bigint;
};
  • The paymaster and data details for the user operation.