networkTransactions method

Future<List<Transaction>> networkTransactions(
  1. String type,
  2. int page, {
  3. String request = Transaction.kTransactionQueryAllFields,
})

Query the network to list the transaction on the type @param {String} The type of transaction @param {int} The page @param {String} request List of informations to retrieve in the GraphQL Query Returns the content scalar type represents transaction content List<Transaction>. Depending if the content can displayed it will be rendered as plain text otherwise in hexadecimal

Implementation

Future<List<Transaction>> networkTransactions(
  String type,
  int page, {
  String request = Transaction.kTransactionQueryAllFields,
}) async {
  final body =
      'query { networkTransactions(type: "$type", page: $page) { $request } }';

  final result = await _client
      .withLogger(
        'networkTransactions',
        logsActivation: logsActivation,
      )
      .query(
        QueryOptions(
          document: gql(body),
          parserFn: (json) {
            return TransactionsResponseData.fromJson(json)
                .networkTransactions!;
          },
        ),
      );

  if (result.exception?.linkException != null) {
    throw ArchethicConnectionException(
      result.exception!.linkException.toString(),
    );
  }

  return result.parsedData ?? [];
}