getValidatorCommission method

Future<List<Coin>> getValidatorCommission(
  1. String validator
)

Implementation

Future<List<Coin>> getValidatorCommission(String validator) async {
  String root =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_DISTRIBUTION_VALIDATORS}/$validator/${CosmosDistributionResources.COMMISSION}";

  var response = await apiRequester.getAsync<CommissionInfoApiJson>(root);
  if (response.successful!) {
    var rewards = CommissionInfoApiJson.fromJson(response.result!);

    return CoinsExtensions.fromJSON(rewards.commission!.commission!);
  }

  throw Exception("");
}