eth_estimateGas
Estimate gas needed for execution of given contract
web3.eth.estimateGas(callObject [, callback])
- 1.A transaction object.
- 2.(optional) Optional callback, returns an error object as first parameter and the result as second.
the used gas for the simulated call/transaction.
web3.eth.estimateGas({
from : account1,
to : account2
}).then(console.log);
> 21000
Last modified 1yr ago