Estimates the gas required to execute a transaction. The gas is returned as a bigint and in gwei units.
bigint
import { estimateGas } from "thirdweb";const gas = await estimateGas({ transaction, from: "0x...",});
function estimateGas( options: EstimateGasOptions,): Promise<EstimateGasResult>;
The options for estimating gas.
let options: Prettify< { transaction: PreparedTransaction<any> } & ( | { account: Account; from?: never } | { account?: never; from?: string } )>;
let returnType: bigint;
A promise that resolves to the estimated gas as a bigint.