estimateGas method
- EthereumAddress to,
- String calldata
override
Estimates the gas cost of a transaction.
to
: The address or contract to which the transaction is to be sent.calldata
: The calldata of the transaction.
Returns the estimated gas cost in wei.
Implementation
@override
Future<BigInt> estimateGas(EthereumAddress to, String calldata) {
return _makeRPCCall<String>('eth_estimateGas', [
{'to': to.hex, 'data': calldata}
]).then(hexToInt);
}