> ## Documentation Index
> Fetch the complete documentation index at: https://cosmos-docs-cosmjs-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# IBC Queries

> Query IBC channels, connections, clients, and transfer denomination traces

The IBC extension provides queries for channels, connections, clients, and transfer denominations. It is the largest extension, organized into four namespaces: `channel`, `client`, `connection`, and `transfer`.

```typescript theme={"system"}
import { QueryClient, setupIbcExtension } from "@cosmjs/stargate";
import { connectComet } from "@cosmjs/tendermint-rpc";

const cometClient = await connectComet("https://rpc.my-chain.network");
const queryClient = QueryClient.withExtensions(cometClient, setupIbcExtension);
```

## Channels

```typescript theme={"system"}
const channel = await queryClient.ibc.channel.channel("transfer", "channel-0");
const allChannels = await queryClient.ibc.channel.allChannels();
const connChannels = await queryClient.ibc.channel.allConnectionChannels("connection-0");
```

## Connections

```typescript theme={"system"}
const connection = await queryClient.ibc.connection.connection("connection-0");
const allConnections = await queryClient.ibc.connection.allConnections();
```

## Clients

```typescript theme={"system"}
const clientState = await queryClient.ibc.client.state("07-tendermint-0");
const allStates = await queryClient.ibc.client.allStates();
const allStatesTm = await queryClient.ibc.client.allStatesTm();
```

## Transfer

```typescript theme={"system"}
const denomTrace = await queryClient.ibc.transfer.denomTrace("hash...");
const allDenomTraces = await queryClient.ibc.transfer.allDenomTraces();
const transferParams = await queryClient.ibc.transfer.params();
```

<Tip>
  The IBC extension provides `all*` helper methods that automatically paginate through all results internally, so you don't need to handle pagination yourself.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Pagination" icon="forward" href="/cosmjs/v0.38.x/guides/query/pagination">
    Manual pagination for IBC queries that don't have `all*` helpers.
  </Card>

  <Card title="Querying Overview" icon="magnifying-glass" href="/cosmjs/v0.38.x/guides/query/querying">
    All available query extensions.
  </Card>
</CardGroup>
