getFeeRate method

Future<double> getFeeRate({
  1. bool testNetwork = true,
})

Implementation

Future<double> getFeeRate({bool testNetwork = true}) async {
  final res = await networkClient.getRequest(
      'https://blockstream.info${testNetwork ? '/testnet' : ''}/api/fee-estimates');
  if (res.isSuccess) {
    return res.data['6'];
  } else {
    throw Exception(res.data);
  }
}