Skip to main content

Gas Estimation and Overrides

The SDK allows you to:

  • View the current gas cost in gwei
  • Estimate the gas cost of a transaction at the current point in time
  • Override parts of a transaction (e.g. gas limit, gas price, nonce, from, value, etc...)

Current Gas Price

const gasCostInGwei = await contract.estimator.currentGasPriceInGwei();

Estimate Transaction Gas Cost

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

Override Transaction Data

contract.interceptor.overrideNextTransaction(() => ({
gasLimit: 3000000,
}));