getDelegationsForValidatorsOnly static method

Future<List<StakingDelegationResponse>> getDelegationsForValidatorsOnly(
  1. TerraRestfulService apiRequester,
  2. String validator, {
  3. PaginationOptions? options,
})

Implementation

static Future<List<StakingDelegationResponse>>
    getDelegationsForValidatorsOnly(
        TerraRestfulService apiRequester, String validator,
        {PaginationOptions? options}) async {
  String rootPath =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_STAKING_VALIDATORS_BASE}/$validator/${CosmosStakingConstants.DELEGATIONS}";

  // if (options != null)
  // {
  //     rootPath += PaginationOptionExtensions.GetPaginationRules(options);
  // }

  var response = await apiRequester.getAsync<StakingCommonJson>(rootPath);
  if (response.successful!) {
    return StakingCommonJson.fromJson(response.result!).delegation_responses;
  }

  throw Exception("");
}