getAssetUnspents method

Future<List<List<ScripthashUnspent>>> getAssetUnspents(
  1. List<String> scripthashes
)

returns unspents in the same order as scripthashes passed in

Implementation

Future<List<List<ScripthashUnspent>>> getAssetUnspents(
  List<String> scripthashes,
) async {
  var futures = <Future<List<ScripthashUnspent>>>[];
  peer.withBatch(() {
    for (var scripthash in scripthashes) {
      futures.add(getAssetUnspent(scripthash));
    }
  });
  List<List<ScripthashUnspent>> results =
      await Future.wait<List<ScripthashUnspent>>(futures);
  return results;
}