getFirstUtxos method

Future<List> getFirstUtxos(
  1. List<String> scriptsList, [
  2. int first = 10
])

Implementation

Future<List> getFirstUtxos(List<String> scriptsList, [int first = 10]) async {
  final QueryOptions options = QueryOptions(
    document: gql(getFirstUtxosQuery),
    variables: <String, dynamic>{
      'scripts': scriptsList,
      'first': first,
    },
  );

  final QueryResult result = await _client.query(options);

  if (result.hasException) {
    printIfDebug(result.exception.toString());
    throw Exception('Unexpected error happened in graphql request');
  } else {
    List<dynamic> utxos = List.from(result.data!['firstUtxosOfScripts']);
    return utxos;
  }
}