Skip to main content
CosmJS provides two parallel client hierarchies — Stargate for standard Cosmos SDK chains and CosmWasm for chains with smart contract support. Each hierarchy has a read-only client for queries and a signing client for transactions.
Read-only clients connect to a chain’s RPC endpoint and expose query methods. They never need a wallet or private key.

StargateClient

The primary read-only client for Cosmos SDK chains.

Factory Methods

Query Methods

Options

CosmWasmClient

The read-only client for CosmWasm-enabled chains. Provides common query methods (getBalance, getAccount, getBlock, getTx, searchTx) plus smart contract queries.

CosmWasm-Specific Query Methods

Query Extensions

Both clients use a QueryClient internally that can be extended with module query support. StargateClient wires up Auth, Bank, Staking, and Tx extensions by default. CosmWasmClient wires up Auth, Bank, Wasm, and Tx. For advanced use, you can create a QueryClient directly with any combination of extensions:

Available Extensions

Next Steps

Signing Clients

Build and broadcast transactions with a signing client.

Query Guide

Explore query methods and extensions in depth.