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
- React
- Javascript
- Python
- Go
const gasCostInGwei = await contract.estimator.currentGasPriceInGwei();
const gasCostInGwei = await contract.estimator.currentGasPriceInGwei();
Python SDK support for currentGasPriceInGwei is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for currentGasPriceInGwei is coming soon.
Want this feature sooner? Let us know in Discord!
Estimate Transaction Gas Cost
- React
- Javascript
- Python
- Go
const costOfClaim = await nftDrop?.estimator.gasCostOf("claim", [
"0x...", // receiver
1, // quantity
"0x...", // currency
1, // price per token
[], // proofs
1, // proof max quantity per transaction
]);
const costOfClaim = await nftDrop?.estimator.gasCostOf("claim", [
"0x...", // receiver
1, // quantity
"0x...", // currency
1, // price per token
[], // proofs
1, // proof max quantity per transaction
]);
Python SDK support for gasCostOf is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for gasCostOf is coming soon.
Want this feature sooner? Let us know in Discord!
Override Transaction Data
- React
- Javascript
- Python
- Go
contract.interceptor.overrideNextTransaction(() => ({
gasLimit: 3000000,
}));
contract.interceptor.overrideNextTransaction(() => ({
gasLimit: 3000000,
}));
Python SDK support for overrideNextTransaction is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for overrideNextTransaction is coming soon.
Want this feature sooner? Let us know in Discord!