getDelegationsForDelegatorsOnly static method

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

Implementation

static Future<List<StakingDelegationResponse>>
    getDelegationsForDelegatorsOnly(
        TerraRestfulService apiRequester, String delegator,
        {PaginationOptions? options}) async {
  String rootPath =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_STAKING_DELEGATIONS_BASE}/$delegator";

  // 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("");
}