GasCostEstimator
Estimates the gas cost of Contract calls
class GasCostEstimator<TContract extends BaseContract> {}
function constructor<TContract extends BaseContract>( contractWrapper: ContractWrapper<TContract>,
Returns the current gas price in gwei
Get the current gas price in gwei
const gasCostInGwei = await contract.estimator.currentGasPriceInGwei();
function currentGasPriceInGwei(): Promise<string>;
Estimates the cost of gas in native token of the current chain Pass in the same parameters as the contract's function.
Estimate the cost of gas in native token of the current chain
const costOfClaim = await nftDrop?.estimator.gasCostOf("claim", [ "0x...", // receiver 1, // quantity "0x...", // currency 1, // price per token [], // proofs 1, // proof max quantity per transaction]);
function gasCostOf( fn: (string & {}) | keyof TContract["functions"], args: | Array<any> | Parameters< TContract["functions"][ | (string & {}) | keyof TContract["functions"]] >,): Promise<string>;
Estimates the gas limit of a transaction Pass in the same parameters as the contract's function.
Estimates the gas limit of a transaction
const gasLimitOfClaim = await nftDrop?.estimator.gasLimitOf("claim", [ "0x...", // receiver 1, // quantity "0x...", // currency 1, // price per token [], // proofs 1, // proof max quantity per transaction]);
function gasLimitOf( fn: (string & {}) | keyof TContract["functions"], args: | Array<any> | Parameters< TContract["functions"][ | (string & {}) | keyof TContract["functions"]] >,): Promise<BigNumber>;