getClientStates method

Future<List<IdentifiedClientState>> getClientStates()

Implementation

Future<List<IdentifiedClientState>> getClientStates() async {
  String rootPath =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_IBC_CORE_CLIENT_CLIENTSTATES}";
  // if (options != null)
  // {
  //     rootPath += PaginationOptionExtensions.GetPaginationRules(options);
  // }

  var response = await apiRequester.getAsync<CommonIBCParamsJson>(rootPath);
  if (response.successful!) {
    var result = CommonIBCParamsJson.fromJson(response.result!);
    return result.client_states
        .map((w) => IdentifiedClientState(w.client_id, w.client_state))
        .toList();
  }

  throw Exception(
      "Could not successfully fetch the allowance information for grantee:");
}