getTotalSupply method

Future<List<Coin>> getTotalSupply()

Implementation

Future<List<Coin>> getTotalSupply() async {
  String root =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_BANK_SUPPLY}";

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

    return CoinsExtensions.fromJSON(result.supply!);
  }

  throw Exception("Could not successfully fetch the total supply");
}