estimateUserOpGasCost

Estimate the gas cost of a user operation.

Example

import { estimateUserOpGasCost } from "thirdweb/wallets/smart";
const gasCost = await estimateUserOpGasCost({
transactions,
adminAccount,
client,
smartWalletOptions,
});
function estimateUserOpGasCost(args: {
adminAccount: Account;
client: ThirdwebClient;
smartWalletOptions: SmartWalletOptions;
transactions: Array<PreparedTransaction>;
}): Promise<{ ether: string; wei: bigint }>;

Parameters

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

Type

let args: {
adminAccount: Account;
client: ThirdwebClient;
smartWalletOptions: SmartWalletOptions;
transactions: Array<PreparedTransaction>;
};

Returns

let returnType: Promise<{ ether: string; wei: bigint }>;

The estimated gas cost of the user operation.