queryEthGasParams method

Future<EvmGasParams> queryEthGasParams({
  1. int gasLimit = 200000,
})

Implementation

Future<EvmGasParams> queryEthGasParams({int gasLimit = 200000}) async {
  final data = await service.queryEthGasParams();
  return EvmGasParams(
    gasLimit: gasLimit,
    gasPrice: double.parse(data['estimatedBaseFee']),
    estimatedBaseFee: double.parse(data['estimatedBaseFee']),
    estimatedFee: {
      EstimatedFeeLevel.low: EvmGasParamsEIP1559(
          maxFeePerGas: double.parse(data['low']['suggestedMaxFeePerGas']),
          maxPriorityFeePerGas:
              double.parse(data['low']['suggestedMaxPriorityFeePerGas'])),
      EstimatedFeeLevel.medium: EvmGasParamsEIP1559(
          maxFeePerGas: double.parse(data['medium']['suggestedMaxFeePerGas']),
          maxPriorityFeePerGas:
              double.parse(data['medium']['suggestedMaxPriorityFeePerGas'])),
      EstimatedFeeLevel.high: EvmGasParamsEIP1559(
          maxFeePerGas: double.parse(data['high']['suggestedMaxFeePerGas']),
          maxPriorityFeePerGas:
              double.parse(data['high']['suggestedMaxPriorityFeePerGas']))
    },
  );
}