configFeeValue static method

String configFeeValue({
  1. required String? beanValue,
  2. required String? offsetValue,
})

Calculate gas price to send transaction

Implementation

static String configFeeValue({
  required String? beanValue,
  required String? offsetValue,
}) {
  beanValue = beanValue?.replaceAll("null", "0");
  offsetValue = offsetValue?.replaceAll("null", "0");
  Decimal gasValue = Decimal.parse(beanValue ?? "0") *
      Decimal.fromInt(10).pow(9).toDecimal();
  gasValue = gasValue * Decimal.parse(offsetValue ?? "0");
  var feeValue =
      (gasValue / Decimal.fromInt(10).pow(18).toDecimal()).toDecimal();
  return feeValue.toStringAsFixed(6);
}