getExchangeRates method

Future<List<Coin>> getExchangeRates()

Implementation

Future<List<Coin>> getExchangeRates() async {
  var rootPath =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_ORACLE_DENOMS_EXCHANGE_RATES}";

  var response =
      await apiRequester.getAsync<OracleApiExchangeRatesApi>(rootPath);
  if (response.successful!) {
    var result = OracleApiExchangeRatesApi.fromJson(response.result!);
    return CoinsExtensions.fromJSON(result.exchange_rates).toList();
  }

  throw Exception("");
}