getTaxRate method

Future<double> getTaxRate()

Implementation

Future<double> getTaxRate() async {
  var rootPath =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_TREASURY_TAX_RATE}";

  var response = await apiRequester.getAsync<TreasuryTaxCap>(rootPath);
  if (response.successful!) {
    var result = TreasuryTaxCap.fromJson(response.result!);
    return double.parse(result.tax_rate);
  }

  throw Exception("");
}