Skip to main content
CosmJS is the official JavaScript/TypeScript client library for interacting with Cosmos SDK blockchains. It enables web and Node.js applications to query on-chain state, construct and sign transactions, and broadcast them to the network.

Packages

CosmJS is published as a set of scoped npm packages. Use the ones that match your needs:
PackageDescription
@cosmjs/stargateHigh-level client for querying and broadcasting on Cosmos SDK 0.40+ chains
@cosmjs/proto-signingWallet primitives and Protobuf-based transaction signing
@cosmjs/cosmwasmClient for CosmWasm-enabled chains
@cosmjs/aminoAmino signing support for legacy compatibility
@cosmjs/tendermint-rpcLow-level Tendermint/CometBFT RPC client
@cosmjs/encodingEncoding utilities (hex, base64, bech32, UTF-8)
@cosmjs/mathInteger and decimal math for blockchain amounts
@cosmjs/cryptoCryptographic primitives (secp256k1, SHA-256, etc.)

Key Features

  • Query chain state — balances, accounts, staking, governance, and arbitrary module queries via Tendermint/CometBFT RPC
  • Sign transactions — Protobuf (SIGN_MODE_DIRECT) and Amino (SIGN_MODE_LEGACY_AMINO_JSON) signing
  • Broadcast transactions — submit signed transactions and monitor results
  • Wallet support — generate wallets from mnemonics or integrate browser extensions like Keplr and Leap
  • Custom modules — register custom message types for application-specific chains
  • CosmWasm — first-class support for deploying, instantiating, and executing smart contracts

Getting Started

Quick Start

Install CosmJS, connect to a node, query state, and send your first transaction.

Clients

Understand read-only and signing clients.

Querying

Query balances, accounts, staking, governance, and more.

Transactions

Send tokens and broadcast arbitrary messages.

Further Resources