getNodeList method
Query the node infos Returns a List<Node> with infos
Implementation
Future<List<Node>> getNodeList() async {
const body =
'query {nodes {authorized available averageAvailability firstPublicKey geoPatch ip lastPublicKey networkPatch port rewardAddress authorizationDate enrollmentDate}}';
final result = await _client.withLogger('getNodeList').query(
QueryOptions(
document: gql(body),
parserFn: (json) => NodesResponseData.fromJson(json).nodes!,
),
);
if (result.exception?.linkException != null) {
throw ArchethicConnectionException(
result.exception!.linkException.toString(),
);
}
return result.parsedData ?? [];
}