getUnbondingDelegationsForDelegatorsOnly static method

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

Implementation

static Future<List<UnbondingDelegation>>
    getUnbondingDelegationsForDelegatorsOnly(
        TerraRestfulService apiRequester, String delegator,
        {PaginationOptions? options}) async {
  String rootPath =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_STAKING_DELEGATORS_BASE}/$delegator/${CosmosStakingConstants.UNBONDING_DELEGATIONS}";

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

  var response =
      await apiRequester.getAsync<UnbondingDelegationJSON>(rootPath);
  if (response.successful!) {
    var result = UnbondingDelegationJSON.fromJson(response.result!);
    return result.unbonding_responses
        .map((w) => UnbondingDelegation.fromJSON(w))
        .toList();
  }

  throw Exception("");
}