estimateGasCost

Estimate the gas cost of a transaction in ether and wei.

Example

import { estimateGasCost } from "thirdweb";
const gasCost = await estimateGasCost({ transaction });
function estimateGasCost(

Parameters

Type

let options: Prettify<
{ transaction: PreparedTransaction<any> } & (
| { account: Account; from?: never }
| { account?: never; from?: string }
)
>;

Returns

let returnType: { ether: string; wei: bigint };