estimateFees method

Future<TxFeeEstimateResult> estimateFees(
  1. TxInfoData txInfo,
  2. List params, {
  3. String? rawParam,
  4. String? jsApi,
})

Estimate tx fees, params will be ignored if we have rawParam.

Implementation

Future<TxFeeEstimateResult> estimateFees(TxInfoData txInfo, List params,
    {String? rawParam, String? jsApi}) async {
  final String param = rawParam != null ? rawParam : jsonEncode(params);
  final Map tx = txInfo.toJson();
  final res = await (service.estimateFees(tx, param, jsApi: jsApi));
  return TxFeeEstimateResult.fromJson(res as Map<String, dynamic>);
}