getClientStateByID method

Future<IdentifiedClientState> getClientStateByID(
  1. String clientId
)

Implementation

Future<IdentifiedClientState> getClientStateByID(String clientId) async {
  String rootPath =
      "${TerraClientConfiguration.blockchainResourcePath}${CosmosBaseConstants.COSMOS_IBC_CORE_CLIENT_CLIENTSTATES}/$clientId";

  var response = await apiRequester.getAsync<IBCApiClientStates>(rootPath);
  if (response.successful!) {
    var result = IBCApiClientStates.fromJson(response.result!);
    return IdentifiedClientState(clientId, result.client_state);
  }

  throw Exception(
      "Could not successfully fetch the client state information for client Id: $clientId");
}