gasPrice method

Future<int?> gasPrice()

The current price per gas in wei.

Implementation

Future<int?> gasPrice() async {
  const method = EthereumRpcMethods.gasPrice;
  final dynamic res = await _client.rpcClient.request(method);
  if (res != null && res.containsKey(EthereumConstants.ethResultKey)) {
    return EthereumUtilities.hexToInt(res[EthereumConstants.ethResultKey]);
  }
  _client.processError(method, res);
  return null;
}