Prerequisites
- Node.js v22 or later
- npm, yarn, or pnpm
- A Cosmos SDK chain RPC endpoint (e.g.
https://rpc.my-chain.networkfor the Cosmos Hub)
Create a signer
To send transactions you need a signer. You can create one from a mnemonic for development, or connect a browser wallet like Keplr in production.
- From mnemonic
- Keplr wallet (browser)
Send tokens
Connect a signing client and broadcast a token transfer:
Setting fee to
"auto" lets CosmJS simulate the transaction and estimate gas automatically. You can also pass an explicit StdFee object for fine-grained control.Next Steps
Clients
Understand read-only and signing client architecture.
Querying
Query balances, staking, governance, and custom modules.
Fees & Gas
Configure gas pricing, simulation, and fee calculation.
CosmWasm
Deploy, instantiate, and execute smart contracts.