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: UserOperationV06 | UserOperationV07,
) => Promise<PaymasterResult>;
userOp: UserOperationV06 | UserOperationV07;
}): Promise<PaymasterResult>;

Parameters

The userOp and options

Type

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

Returns

let returnType: {
callGasLimit?: bigint;
preVerificationGas?: bigint;
verificationGasLimit?: bigint;
} & (
| { paymasterAndData: string }
| {
paymaster: string;
paymasterData: string;
paymasterPostOpGasLimit?: bigint;
paymasterVerificationGasLimit?: bigint;
}
);
  • The paymaster and data details for the user operation.