getUnbondingDelegation method

Future<List<UnbondingDelegation>> getUnbondingDelegation(
  1. String delegator,
  2. String validator
)

Implementation

Future<List<UnbondingDelegation>> getUnbondingDelegation(
    String delegator, String validator) async {
  if (delegator.isNotEmpty && validator.isNotEmpty) {
    var response = await UnbondingDelegationHelper
        .getUnbondingDelegationsForAllValuesReady(
            apiRequester, delegator, validator);
    return [response];
  } else if (delegator.isNotEmpty && validator.isEmpty) {
    return await UnbondingDelegationHelper
        .getUnbondingDelegationsForDelegatorsOnly(apiRequester, delegator);
  } else if (delegator.isEmpty && validator.isNotEmpty) {
    return await UnbondingDelegationHelper
        .getUnbondingDelegationsForValidatorsOnly(apiRequester, delegator);
  }

  throw Exception("arguments delegator and validator cannot both be empty");
}