getValidator method

Future<ValidatorList?> getValidator({
  1. String? limit,
})

Returns the validator slots the caller's org has claimed.

Returns the validator slots the caller's org has claimed. One entry per claimed slot with its node identity, its live-ish node status and the owner-gated registration queued for it, if any. Slots are org-scoped by the validated identity, so a caller can only ever see their own — a slot claimed by another org is not merely hidden from this list, it is unreachable through the whole surface.

Parameters:

  • String limit: Limit is how many slots to return, as a decimal string in the ?limit= query. Absent, unparseable or non-positive means 200; over 1000 is clamped to 1000. It is a string rather than a number because the parse that has always served this route trims surrounding whitespace, and one parse rule is better than two.

Implementation

Future<ValidatorList?> getValidator({ String? limit, }) async {
  final response = await getValidatorWithHttpInfo( limit: limit, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ValidatorList',) as ValidatorList;

  }
  return null;
}