history method

Future<Map<String, dynamic>?> history(
  1. String pubkey, [
  2. int? pageSize,
  3. String? cursor
])

Implementation

Future<Map<String, dynamic>?> history(String pubkey,
    [int? pageSize, String? cursor]) async {
  final QueryOptions options = QueryOptions(
    document: gql(getHistoryQuery),
    variables: <String, dynamic>{
      'pubkey': pubkey,
      'number': pageSize ?? 100,
      'cursor': cursor,
    },
  );
  final QueryResult result = await _client.query(options);

  if (result.hasException) {
    printIfDebug(result.exception.toString());
    throw Exception('Unexpected error happened in graphql request');
  } else if (result.data != null) {
    return result.data;
  }
  return null;
}