Skip to main content

GasCostEstimator class

Estimates the gas cost of Contract calls

Signature:

export declare class GasCostEstimator<TContract extends BaseContract>

Constructors

ConstructorModifiersDescription
(constructor)(contractWrapper)Constructs a new instance of the GasCostEstimator class

Methods

MethodModifiersDescription
currentGasPriceInGwei()Returns the current gas price in gwei
gasCostOf(fn, args)Estimates the cost of gas in native token of the current chain Pass in the same parameters as the contract's function.
gasLimitOf(fn, args)Estimates the gas limit of a transaction Pass in the same parameters as the contract's function.