fetchGasPrice method

Future<EvmNetworkFees> fetchGasPrice()

Fetch Gas Prices

Implementation

Future<EvmNetworkFees> fetchGasPrice() async {
  final gasOracleEndpoint = "${base}&module=gastracker&action=gasoracle";

  final result = await fetchEtherscanWithRatelimitRetries(gasOracleEndpoint);
  if (result is! Json) {
    throw Exception("Failed to fetch gas price");
  }
  final entity = EvmNetworkFees.fromJson(result);

  return entity;
}