estimateUserOpGas

Estimate the gas cost of a user operation.

Example

import { estimateUserOpGas } from "thirdweb/wallets/smart";
const gasCost = await estimateUserOpGas({
userOp,
options,
});
function estimateUserOpGas(
args: {
options: BundlerOptions;
userOp: UserOperationV06 | UserOperationV07;
},
stateOverrides?: {},
): Promise<EstimationResult>;

Parameters

The options for estimating the gas cost of a user operation.

Type

let args: {
options: BundlerOptions;
userOp: UserOperationV06 | UserOperationV07;
};

Returns

let returnType: Promise<EstimationResult>;

The estimated gas cost of the user operation.