Skip to content

Cosmjs docs#251

Open
codingki wants to merge 17 commits intomainfrom
cosmjs-docs
Open

Cosmjs docs#251
codingki wants to merge 17 commits intomainfrom
cosmjs-docs

Conversation

@codingki
Copy link
Copy Markdown
Member

No description provided.

codingki and others added 10 commits April 24, 2026 05:18
…de.js version requirement, enhance error descriptions, and improve code formatting for clarity.
…date RPC endpoint examples; and improve overall clarity and structure.
…arify gas estimation processes, and enhance error handling examples. Improve overall structure and add next steps sections for better navigation.
… sections with additional resources; update crypto and encoding API references for clarity and accuracy; improve gas and fees documentation for better understanding.
evanorti and others added 7 commits April 24, 2026 05:20
Removed redundant section on relative imports and CosmJS documentation.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Verified every fix against cosmos/cosmjs main branch on GitHub.

API reference fixes:
- stream.mdx: dropDuplicates valueToKey is required, not optional
- stargate.mdx: remove nonexistent auth.accounts method
- tendermint-rpc.mdx: fix CometClient as union type (not interface),
  WebsocketClient.listen returns Stream<SubscriptionEvent> (not JsonRpcEvent),
  add missing HttpClient timeout param, fix HttpBatchClient Partial<> options,
  correct date helper return types to DateWithNanoseconds
- proto-signing.mdx: decodePubkey accepts Any (not null), add decodeOptionalPubkey,
  makeAuthInfoBytes feeGranter/feePayer are required positional args,
  DirectEthSecp256k1HdWallet differs from DirectSecp256k1HdWallet
- math.mdx: Uint64 uses bigint internally, not string
- cosmwasm.mdx: toBinary/fromBinary use any, not JsonObject

Concept page fixes:
- errors/queries.mdx: getContract throws on not-found, does not return null
- cosmos-evm/signing-client.mdx: add warning about simulate() pubkey encoding
- protobuf-encoding.mdx: signMode is global, not per-signer
- dynamic-gas-pricing.mdx: document Osmosis vs feemarket query paths
- signing-clients.mdx: simulate() memo is required (string | undefined)

Made-with: Cursor
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refreshes CosmJS references in the Cosmos SDK v0.50 “run a node” docs and introduces a new, versioned CosmJS documentation section (v0.38.x) with quick start, conceptual guides, how-to guides, and API references.

Changes:

  • Replace outdated “CosmJS docs are WIP” blurbs in SDK v0.50 run-node docs with links to a dedicated CosmJS guide.
  • Add a new cosmjs/v0.38.x documentation set including overview + quick start.
  • Add CosmJS guides/concepts pages covering connectivity, querying, transactions, extending, transports, errors, fees/gas, and CosmWasm workflows.

Reviewed changes

Copilot reviewed 106 out of 107 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sdk/v0.50/user/run-node/txs.mdx Updates CosmJS section copy and links to the new CosmJS quick start.
sdk/v0.50/user/run-node/interact-node.mdx Updates CosmJS section copy and links to the new CosmJS quick start.
cosmjs/v0.38.x/quick-start.mdx Adds a CosmJS quick start walkthrough (install, connect, query, sign, broadcast).
cosmjs/v0.38.x/overview.mdx Adds a high-level CosmJS overview and package map.
cosmjs/v0.38.x/guides/transactions/simulating-gas.mdx Adds a guide on automatic/manual gas simulation and explicit fees.
cosmjs/v0.38.x/guides/transactions/signing-broadcasting.mdx Adds guidance for sign+broadcast flows, sync broadcast, and split sign/broadcast.
cosmjs/v0.38.x/guides/transactions/send-transactions.mdx Adds an end-to-end transaction lifecycle guide with prerequisites and next steps.
cosmjs/v0.38.x/guides/transactions/events-and-lookups.mdx Adds guidance on reading events and looking up/searching transactions.
cosmjs/v0.38.x/guides/transactions/error-handling.mdx Adds transaction error-mode patterns (CheckTx, DeliverTx failure, timeouts).
cosmjs/v0.38.x/guides/transactions/confirmation.mdx Adds guidance on polling/timeout configuration and timeout handling.
cosmjs/v0.38.x/guides/transactions/building-messages.mdx Adds examples for constructing EncodeObjects/messages (bank + staking, multi-msg).
cosmjs/v0.38.x/guides/query/staking.mdx Adds staking query extension examples and method reference table.
cosmjs/v0.38.x/guides/query/slashing-authz-feegrant.mdx Adds slashing/authz/feegrant query extension examples.
cosmjs/v0.38.x/guides/query/pagination.mdx Adds pagination patterns and a module-by-module paginated-method overview.
cosmjs/v0.38.x/guides/query/ibc.mdx Adds IBC query extension examples and navigation to pagination guidance.
cosmjs/v0.38.x/guides/query/governance.mdx Adds governance query extension examples and method reference table.
cosmjs/v0.38.x/guides/query/error-handling.mdx Adds common query error-handling patterns and “not found” behaviors.
cosmjs/v0.38.x/guides/query/distribution-and-mint.mdx Adds distribution/mint query extension examples and method reference table.
cosmjs/v0.38.x/guides/query/custom-extensions.mdx Adds patterns for custom query extensions with/without protobuf definitions.
cosmjs/v0.38.x/guides/query/cosmwasm.mdx Adds a guide for CosmWasm querying via CosmWasmClient and wasm extension.
cosmjs/v0.38.x/guides/query/blocks-and-chain-info.mdx Adds examples for chain status, block data, and direct CometBFT client usage.
cosmjs/v0.38.x/guides/query/bank.mdx Adds bank query extension examples plus total supply pagination example.
cosmjs/v0.38.x/guides/query/accounts.mdx Adds account querying patterns and custom AccountParser guidance.
cosmjs/v0.38.x/guides/extending/query-extensions.mdx Adds a deep dive on the query extension pattern, composition, and pagination.
cosmjs/v0.38.x/guides/extending/extending.mdx Adds an “Extending CosmJS” index page linking to extension guides.
cosmjs/v0.38.x/guides/extending/amino-converters.mdx Adds guidance for implementing and wiring Amino converters for custom types.
cosmjs/v0.38.x/guides/cosmwasm/uploading.mdx Adds a guide for uploading Wasm code (incl. access restrictions) via CosmJS.
cosmjs/v0.38.x/guides/cosmwasm/querying.mdx Adds a guide for querying contracts (smart/raw/metadata/discovery).
cosmjs/v0.38.x/guides/cosmwasm/instantiating.mdx Adds instantiation patterns including options and instantiate2 address prediction.
cosmjs/v0.38.x/guides/cosmwasm/executing.mdx Adds execution patterns incl. funds, executeMultiple, and event parsing.
cosmjs/v0.38.x/guides/cosmwasm/cosmwasm.mdx Adds a CosmWasm-focused entry guide and navigation across contract lifecycle docs.
cosmjs/v0.38.x/guides/cosmwasm/administration.mdx Adds migration/admin update/clear guidance and lifecycle summary.
cosmjs/v0.38.x/guides/connect/websocket.mdx Adds a WebSocket transport guide including subscriptions and reconnection.
cosmjs/v0.38.x/guides/connect/version-detection.mdx Adds documentation on CometBFT version auto-detection and skipping it.
cosmjs/v0.38.x/guides/connect/timeouts.mdx Adds transport and broadcast timeout configuration guidance.
cosmjs/v0.38.x/guides/connect/http.mdx Adds HTTP transport and batching guidance.
cosmjs/v0.38.x/guides/connect/errors.mdx Adds transport/broadcast error taxonomy and handling patterns.
cosmjs/v0.38.x/guides/connect/custom-endpoints.mdx Adds guidance for authenticated RPC endpoints via HttpEndpoint and batching.
cosmjs/v0.38.x/guides/connect/connect.mdx Adds connection overview, transport selection, and disconnecting guidance.
cosmjs/v0.38.x/concepts/transports/websocket.mdx Adds deeper conceptual documentation for WebsocketClient streaming/subscriptions.
cosmjs/v0.38.x/concepts/transports/timeouts.mdx Adds conceptual overview of timeouts/error handling across transports.
cosmjs/v0.38.x/concepts/transports/rpc-client.mdx Documents the RpcClient/RpcStreamingClient interfaces and transport selection.
cosmjs/v0.38.x/concepts/transports/json-rpc-streams.mdx Documents JSON-RPC and reactive-stream building blocks used by transports.
cosmjs/v0.38.x/concepts/transports/http.mdx Adds a conceptual guide to HttpClient/HttpBatchClient behavior and limitations.
cosmjs/v0.38.x/concepts/transactions/sign-broadcast.mdx Adds conceptual explanation of signing/broadcasting flows and convenience methods.
cosmjs/v0.38.x/concepts/transactions/direct-vs-amino.mdx Explains Direct vs Amino signing and how the client selects signing mode.
cosmjs/v0.38.x/concepts/transactions/custom-messages.mdx Documents registering custom protobuf/Amino message types.
cosmjs/v0.38.x/concepts/transactions/cosmwasm.mdx Adds conceptual guide for CosmWasm transaction workflows with SigningCosmWasmClient.
cosmjs/v0.38.x/concepts/transactions/advanced.mdx Adds advanced patterns (offline signing, IBC transfer, decoding, result checks).
cosmjs/v0.38.x/concepts/messages-encoding/transaction-structure.mdx Documents TxRaw structure and message type URLs.
cosmjs/v0.38.x/concepts/messages-encoding/registry.mdx Documents the Registry’s role, default types, custom registrations, and flow.
cosmjs/v0.38.x/concepts/messages-encoding/protobuf-encoding.mdx Documents Direct/protobuf signing bytes and helper APIs.
cosmjs/v0.38.x/concepts/messages-encoding/encoding-decoding.mdx Documents encoding utilities and decoding tx bytes with registry.
cosmjs/v0.38.x/concepts/messages-encoding/encode-objects.mdx Documents EncodeObject and typed encode objects.
cosmjs/v0.38.x/concepts/messages-encoding/amino-encoding.mdx Documents Amino signing format and AminoTypes conversion layer.
cosmjs/v0.38.x/concepts/fees-gas/simulation.mdx Explains simulation, “auto” multiplier behavior, and caveats.
cosmjs/v0.38.x/concepts/fees-gas/fee-grants.mdx Documents fee grant usage and query patterns.
cosmjs/v0.38.x/concepts/fees-gas/dynamic-gas-pricing.mdx Documents dynamic gas pricing configuration and chain-registry sourcing.
cosmjs/v0.38.x/concepts/errors/transport.mdx Documents transport-level errors across HTTP/WS/JSON-RPC.
cosmjs/v0.38.x/concepts/errors/transaction-execution.mdx Documents DeliverTx failures and CosmWasm convenience-method throwing behavior.
cosmjs/v0.38.x/concepts/errors/signing-wallet.mdx Documents wallet/signing errors and common chain rejections (sequence mismatch).
cosmjs/v0.38.x/concepts/errors/queries.mdx Documents query “not found” and ABCI/contract query error behaviors.
cosmjs/v0.38.x/concepts/errors/ledger.mdx Documents Ledger-specific error messages.
cosmjs/v0.38.x/concepts/errors/gas-estimation.mdx Documents missing gas price / simulation failure error cases.
cosmjs/v0.38.x/concepts/errors/error-handling.mdx Documents a recommended end-to-end error-handling pattern.
cosmjs/v0.38.x/concepts/errors/error-classes.mdx Documents TimeoutError and BroadcastTxError structures and usage patterns.
cosmjs/v0.38.x/concepts/errors/encoding.mdx Documents registry/bech32/hex/base64/pubkey encoding/decoding error cases.
cosmjs/v0.38.x/concepts/cosmos-evm/wallets.mdx Documents EVM wallet classes and generation patterns.
cosmjs/v0.38.x/concepts/cosmos-evm/signing.mdx Documents keccak vs sha signing, pubkey type URLs, and algo identifiers.
cosmjs/v0.38.x/concepts/cosmos-evm/signing-client.mdx Documents SigningStargateClient behavior/limitations with EVM wallets.
cosmjs/v0.38.x/concepts/cosmos-evm/querying.mdx Documents querying behavior on EVM-compatible Cosmos chains.
cosmjs/v0.38.x/concepts/cosmos-evm/packages.mdx Documents relevant exports and known EVM support limitations.
cosmjs/v0.38.x/concepts/cosmos-evm/key-differences.mdx Documents key derivation/signing differences between standard Cosmos and EVM chains.
cosmjs/v0.38.x/concepts/cosmos-evm/full-example.mdx Provides an end-to-end EVM-compatible example.
cosmjs/v0.38.x/concepts/cosmos-evm/address-derivation.mdx Documents raw address derivation differences (RIPEMD160/SHA vs Keccak).
cosmjs/v0.38.x/concepts/clients/stargate-vs-cosmwasm.mdx Compares Stargate vs CosmWasm client families and when to use each.
cosmjs/v0.38.x/concepts/account/offline-signers.mdx Documents OfflineSigner interfaces and common signer implementations.
cosmjs/v0.38.x/concepts/account/local-wallets.mdx Documents local wallet creation, generation, multi-account derivation, and serialization notes.
cosmjs/v0.38.x/concepts/account/injected-wallets.mdx Documents browser wallet injection patterns and choosing signing modes.
cosmjs/v0.38.x/concepts/account/bech32-addresses.mdx Documents bech32 encoding/derivation and common prefixes.
cosmjs/v0.38.x/concepts/account/account.mdx Documents on-chain account fields and AccountData vs Account distinction.
cosmjs/v0.38.x/api-reference/utils.mdx Adds API reference for @cosmjs/utils exports.
cosmjs/v0.38.x/api-reference/stream.mdx Adds API reference for @cosmjs/stream utilities and types.
cosmjs/v0.38.x/api-reference/socket.mdx Adds API reference for @cosmjs/socket types and behavior.
cosmjs/v0.38.x/api-reference/math.mdx Adds API reference for @cosmjs/math numeric/decimal utilities.
cosmjs/v0.38.x/api-reference/ledger-amino.mdx Adds API reference for @cosmjs/ledger-amino usage and types.
cosmjs/v0.38.x/api-reference/json-rpc.mdx Adds API reference for @cosmjs/json-rpc types/parsers/guards.
cosmjs/v0.38.x/api-reference/faucet-client.mdx Adds API reference for @cosmjs/faucet-client usage.
cosmjs/v0.38.x/api-reference/encoding.mdx Adds API reference for @cosmjs/encoding functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +11
- **Node.js** v22 or later
- **npm**, **yarn**, or **pnpm**
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prerequisite "Node.js v22 or later" is likely unnecessarily strict and inconsistent with the repo’s own tooling (CI workflows use Node 18, and the site build deps don’t require 22). Consider changing this to a safer baseline like “Node.js 18+ (LTS)” or “latest LTS” to avoid blocking users on older-but-supported Node versions.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +26
```bash npm
npm install @cosmjs/stargate @cosmjs/proto-signing
```
```bash yarn
yarn add @cosmjs/stargate @cosmjs/proto-signing
```
```bash pnpm
pnpm add @cosmjs/stargate @cosmjs/proto-signing
```
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The install commands don’t include cosmjs-types, but later in this quick start you import from cosmjs-types/... (MsgDelegate). This will fail for readers who follow the steps verbatim; either add cosmjs-types to the install step or adjust the later example to avoid that dependency.

Copilot uses AI. Check for mistakes.
Comment on lines +90 to +115
<Tab title="Keplr wallet (browser)">

```typescript
const chainId = "cosmoshub-4";
await window.keplr.enable(chainId);
const offlineSigner = window.keplr.getOfflineSigner(chainId);
const [{ address }] = await offlineSigner.getAccounts();
console.log("Keplr address:", address);
```

</Tab>
</Tabs>

</Step>
<Step title="Send tokens">

Connect a signing client and broadcast a token transfer:

```typescript
import { SigningStargateClient, GasPrice } from "@cosmjs/stargate";

const signingClient = await SigningStargateClient.connectWithSigner(
rpcEndpoint,
wallet, // or offlineSigner from Keplr
{ gasPrice: GasPrice.fromString("0.025uatom") },
);
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Keplr tab you define offlineSigner, but the subsequent "Send tokens" step uses wallet as the signer argument. If a reader follows the Keplr flow, this snippet won’t work without manual edits. Consider using a single variable name (e.g. signer) across both tabs and in connectWithSigner to keep the walkthrough copy/pasteable.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +12
- **Node.js** v22 or later
- `@cosmjs/stargate` and `@cosmjs/proto-signing` installed
- An RPC endpoint for the target chain
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prerequisite "Node.js v22 or later" is likely too restrictive for a general CosmJS guide (and doesn’t match the Node 18 baseline used in this repo’s automation). Consider using “Node.js 18+ (LTS)” / “latest LTS” instead to reduce friction for users.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants