CosmJS for web and TypeScript
CosmJS is the standard TypeScript SDK for Cosmos chains. Use it for web dashboards, Node scripts, and React Native (see React Native).
Prerequisites
- Node.js 20+
- Funded testnet account: faucet
npm i @cosmjs/stargate @cosmjs/proto-signing @cosmjs/encoding
Constants
export const RPC = 'https://rpc.testnet.safrochain.com:443';
export const REST = 'https://rest.testnet.safrochain.com';
export const CHAIN_ID = 'safro-testnet-1';
export const DENOM = 'usaf';
Wallet prefix: addr_safro.
What to read next
| Task | Page |
|---|---|
| Read-only queries | Query the chain |
| Sign and broadcast | Signing overview |
| Browser wallets | Cosmos Kit |
| First tx walkthrough | First transaction |
Production
Use Cosmos Kit or another wallet signer in browser apps. Mnemonics in process.env are for scripts and local dev only.