estimateGas function

Future<BigInt> estimateGas({
  1. required String from,
  2. required String to,
  3. BigInt? value,
  4. String? data,
})

Implementation

Future<BigInt> estimateGas({
  required String from,
  required String to,
  BigInt? value,
  String? data,
}) async {
  var result = await ethereum!.request("eth_estimateGas", [
    {
      "from": from,
      "to": to,
      "value": value,
      "data": data,
    }
  ]);
  return BigInt.parse(result.toString());
}