Docs

estimateGas

Estimates the gas required to execute a transaction. The gas is returned as a bigint and in gwei units.

Example

import { estimateGas } from "thirdweb";
const gas = await estimateGas({
transaction,
});

Parameters

Returns

A promise that resolves to the estimated gas as a bigint.