ethEstimateGas static method
call eth_estimateGas, get gasLimit
from
is sender public address.
to
if send native token, is recevier address, if send erc20 token or nft, is contract address.
value
is native token amount in hex string.
data
transacion data
Implementation
static Future<String> ethEstimateGas(
String from, String? to, String value, String data) async {
const method = "eth_estimateGas";
final params = [
{"from": from, "to": to, "data": data, "value": value}
];
return await EvmService.rpc(method, params);
}