getUTXOs method

Future<List<Map<String, dynamic>>> getUTXOs({
  1. required String address,
  2. bool testNetwork = true,
})

Implementation

Future<List<Map<String, dynamic>>> getUTXOs(
    {required String address, bool testNetwork = true}) async {
  final res = await networkClient.getRequest(
      "https://blockstream.info${testNetwork ? '/testnet' : ''}/api/address/$address/utxo");

  if (res.isSuccess) {
    return List<Map<String, dynamic>>.from(res.data);
  } else {
    throw Exception(res.data);
  }
}