{"id":13470976,"url":"https://github.com/cosmos/cosmjs","last_synced_at":"2025-05-13T17:12:03.219Z","repository":{"id":37471529,"uuid":"235533792","full_name":"cosmos/cosmjs","owner":"cosmos","description":"The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.","archived":false,"fork":false,"pushed_at":"2025-03-14T17:22:05.000Z","size":144809,"stargazers_count":678,"open_issues_count":200,"forks_count":371,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-08T23:06:42.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cosmos.github.io/cosmjs/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-22T08:55:48.000Z","updated_at":"2025-05-07T17:15:30.000Z","dependencies_parsed_at":"2023-10-13T07:11:49.080Z","dependency_job_id":"e830146c-f76e-4073-84aa-2e5668570437","html_url":"https://github.com/cosmos/cosmjs","commit_stats":{"total_commits":3331,"total_committers":40,"mean_commits":83.275,"dds":0.4404082858000601,"last_synced_commit":"e8e65aa0c145616ccb58625c32bffe08b46ff574"},"previous_names":["cosmwasm/cosmjs","confio/cosmwasm-js"],"tags_count":141,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Fcosmjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Fcosmjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Fcosmjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Fcosmjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmos","download_url":"https://codeload.github.com/cosmos/cosmjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253187651,"owners_count":21868164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:00:37.966Z","updated_at":"2025-05-13T17:11:58.207Z","avatar_url":"https://github.com/cosmos.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Learn More","Client Libraries","others","UI","Cryptocurrencies"],"sub_categories":["JavaScript"],"readme":"\u003ch1\u003e\u003cp align=\"center\"\u003e\u003cimg alt=\"CosmJS\" src=\"docs/logo-vertical-light.png\" width=\"180\" /\u003e\u003c/p\u003e\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/cosmos/cosmjs/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"License: Apache-2.0\" src=\"https://img.shields.io/github/license/cosmos/cosmjs.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nCosmJS is the Swiss Army knife to power JavaScript based client solutions\nranging from Web apps/explorers over browser extensions to server-side clients\nlike faucets/scrapers in the Cosmos ecosystem.\n\n\"Cosm\" is short for Cosmos and \"JS\" is short for _runs everywhere_ – we actually\ndevelop in TypeScript.\n\n## Documentation\n\n[Here is a list of examples][guided tour] using the Stargate package for use\nwith [Cosmos SDK 0.41] applications (like [gaia 4]). Take a look at the wiki\npage,\n[\"What can CosmJS do for me?\"](https://github.com/cosmos/cosmjs/wiki/What-can-CosmJS-do-for-me%3F)\nand various tests\n([ex](https://github.com/cosmos/cosmjs/blob/main/packages/stargate/src/signingstargateclient.spec.ts))\nfor more example usage of the packages.\n\n[guided tour]:\n  https://gist.github.com/webmaster128/8444d42a7eceeda2544c8a59fbd7e1d9\n[cosmos sdk 0.41]: https://github.com/cosmos/cosmos-sdk/tree/v0.41.0\n[gaia 4]: https://github.com/cosmos/gaia/tree/v4.0.0\n\n### API documentation\n\nThe full API documentation is hosted at [cosmos.github.io/cosmjs]. This is a bit\ntricky to navigate and requires basic TypeScript understanding. It is helpful if\nyou want to look up details for advanced use cases. This documentation is\nauto-generated based on the current main branch and can occasionally diverge\nfrom the latest release.\n\n[cosmos.github.io/cosmjs]: https://cosmos.github.io/cosmjs\n\n### Using custom Stargate modules\n\nDocumentation on how to use your own custom modules with CosmJS for Stargate\nchains (Cosmos SDK v0.41) can be found\n[here](https://github.com/cosmos/cosmjs/blob/main/packages/stargate/CUSTOM_PROTOBUF_CODECS.md).\n\n## Packages\n\nCosmJS is a library that consists of many smaller npm packages within the\n[@cosmjs namespace](https://www.npmjs.com/org/cosmjs), a so-called monorepo.\nHere are some of them to get an idea:\n\n| Package                                                 | Description                                                                                                                                                                                                                              | Latest                                                                                                                                |\n| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |\n| [@cosmjs/stargate](packages/stargate)                   | A client library for the Cosmos SDK 0.40+ (Stargate)                                                                                                                                                                                     | [![npm version](https://img.shields.io/npm/v/@cosmjs/stargate.svg)](https://www.npmjs.com/package/@cosmjs/stargate)                   |\n| [@cosmjs/faucet](packages/faucet)                       | A faucet application for node.js                                                                                                                                                                                                         | [![npm version](https://img.shields.io/npm/v/@cosmjs/faucet.svg)](https://www.npmjs.com/package/@cosmjs/faucet)                       |\n| [@cosmjs/cosmwasm-stargate](packages/cosmwasm-stargate) | Client for Stargate chains with the CosmWasm module enabled                                                                                                                                                                              | [![npm version](https://img.shields.io/npm/v/@cosmjs/cosmwasm-stargate.svg)](https://www.npmjs.com/package/@cosmjs/cosmwasm-stargate) |\n| [@cosmjs/crypto](packages/crypto)                       | Cryptography for blockchain projects, e.g. hashing (SHA-2, Keccak256, Ripemd160), signing (secp256k1, ed25519), HD key derivation (BIP-39, SLIP-0010), KDFs and symmetric encryption for key storage (PBKDF2, Argon2, XChaCha20Poly1305) | [![npm version](https://img.shields.io/npm/v/@cosmjs/crypto.svg)](https://www.npmjs.com/package/@cosmjs/crypto)                       |\n| [@cosmjs/encoding](packages/encoding)                   | Encoding helpers for blockchain projects                                                                                                                                                                                                 | [![npm version](https://img.shields.io/npm/v/@cosmjs/encoding.svg)](https://www.npmjs.com/package/@cosmjs/encoding)                   |\n| [@cosmjs/math](packages/math)                           | Safe integers; decimals for handling financial amounts                                                                                                                                                                                   | [![npm version](https://img.shields.io/npm/v/@cosmjs/math.svg)](https://www.npmjs.com/package/@cosmjs/math)                           |\n\n### Modularity\n\nWe're pretty proud of the modularity and a clean dependency tree in this\nmonorepo. This ensures software quality on our side and lets users pick exactly\nwhat they need. Here you see how everything fits together (every item is a npm\npackage; right depends on left):\n\n![CosmJS dependency tree](docs/cosmjs-tree.png)\n\nIf this was not enough to scare you away, check out the version including app\nruntime dependencies: [cosmjs-tree-full.png](docs/cosmjs-tree-full.png).\n\n\u003c!--\nBuild with depsight (https://github.com/webmaster128/depsight), using:\n\nfrom_npm . | depsight --include \"^@cosmjs\" --format png --dpi 150 --output docs/cosmjs-tree.png\nfrom_npm . | depsight --exclude cosmjs-monorepo-root --format png --dpi 150 --output docs/cosmjs-tree-full.png\noptipng docs/cosmjs-tree*.png\n--\u003e\n\n### Supported JS environments\n\nCurrently the codebase supports the following runtime environments:\n\n1. Node.js 14+\n2. Modern browsers (Chromium/Firefox/Safari, no Internet Explorer or\n   [Edge Spartan](https://en.wikipedia.org/wiki/Microsoft_Edge#Development))\n3. Browser extensions (Chromium/Firefox)\n\nOur current JavaScript target standard is ES2020. We use WebAssembly to\nimplement certain cryptographic functions.\n\nWe're happy to adjust this list according to users' needs as long as you don't\nask for Internet Explorer support. If your environment does not support Wasm, we\ncan work on a solution with swappable implementations.\n\n## Webpack Configs\n\nWith WebPack 5, you have to be explicit about the usage of Node.js types and\nmodules that were simply replaced with re-implementations for browsers in\nWebpack 4.\n\nConfigs for 0.28 and later:\n\n```js\nmodule.exports = [\n  {\n    // ...\n    plugins: [\n      ...,\n      new webpack.ProvidePlugin({\n        Buffer: [\"buffer\", \"Buffer\"],\n      }),\n    ],\n    // ...\n    resolve: {\n      fallback: {\n        buffer: false,\n        crypto: false,\n        events: false,\n        path: false,\n        stream: false,\n        string_decoder: false,\n      },\n    },\n  },\n];\n```\n\nConfigs for CosmJS \u003c 0.28\n\n```js\nmodule.exports = [\n  {\n    // ...\n    plugins: [\n      ...,\n      new webpack.ProvidePlugin({\n        Buffer: [\"buffer\", \"Buffer\"],\n      }),\n    ],\n    // ...\n    resolve: {\n      fallback: {\n        buffer: false,\n        crypto: false,\n        events: false,\n        path: false,\n        stream: require.resolve(\"stream-browserify\"),\n        string_decoder: false,\n      },\n    },\n  },\n];\n```\n\n## Roadmap\n\nWe maintain a [development board](https://github.com/orgs/cosmos/projects/6),\nuse [release milestones](https://github.com/cosmos/cosmjs/milestones) and share\nimportant updates in the [CosmWasm Community Call]. For higher level roadmap\ndiscussion please reach out to the team.\n\n[cosmwasm community call]:\n  https://github.com/CosmWasm/cosmwasm/issues?q=label%3A%22Community+Call+%F0%9F%97%BA%F0%9F%93%9E%22\n\n## Known limitations\n\n### 0.26\n\n1. When connecting to a Cosmos SDK 0.44+ backend, the verified queries from\n   `AuthExtension` and `BankExtension` as well as\n   `StargateClient.getAccountVerified` will fail because the storage keys are\n   not stable. Unverified queries can be used instead. Those queries are\n   deprecated now and will be removed in 0.27 ([#910]).\n\n[#910]: https://github.com/cosmos/cosmjs/pull/910\n\n### 0.25\n\n1. Decoding blocks of height 1 is unsupported. This is fixed in [#815] and will\n   be released as part of CosmJS 0.26.\n\n[#815]: https://github.com/cosmos/cosmjs/pull/815\n\n### 0.24\n\n1. `AuthExtension` and all higher level Stargate clients only support\n   `BaseAccount`s for all functionality, including getting account numbers and\n   sequences for transaction signing. This will be implemented for all common\n   Cosmos SDK account types in the 0.25 series.\n\n## Get in touch\n\nThe CosmJS development team is happy to get in touch with you for all questions\nand suggestions.\n\n- [GitHub issues](https://github.com/cosmos/cosmjs/issues) for bugs and feature\n  requests\n- The `#dev-chat` channel, or `#dev-support-ai` on the\n  [interchain Discord server](https://discord.gg/interchain) for\n  questions and open discussions\n- [#CosmJS on Twitter](https://twitter.com/search?q=%23CosmJS) to spread the\n  word\n\n## Development\n\nSee [HACKING.md](HACKING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmos%2Fcosmjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmos%2Fcosmjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmos%2Fcosmjs/lists"}