Skip to main content

GasCostEstimator.gasLimitOf() method

Estimates the gas limit of a transaction Pass in the same parameters as the contract's function.

Example

const gasLimitOfClaim = await nftDrop?.estimator.gasLimitOf("claim", [
"0x...", // receiver
1, // quantity
"0x...", // currency
1, // price per token
[], // proofs
1, // proof max quantity per transaction
]);

Signature:

gasLimitOf(fn: keyof TContract["functions"] | (string & {}), args: Parameters<TContract["functions"][typeof fn]> | any[]): Promise<BigNumber>;

Parameters

ParameterTypeDescription
fnkeyof TContract["functions"] | (string & {})
argsParameters<TContract["functions"][typeof fn]> | any[]

Returns:

Promise<BigNumber>

the estimated gas limit of the transaction

Remarks

Estimates the gas limit of a transaction