Dependencies
This document provides a reference for the required dependencies when using Telescope-generated code.
Required Dependencies
When using code generated by Telescope, you need to install several CosmJS packages as dependencies:
yarn add @cosmjs/amino @cosmjs/proto-signing @cosmjs/stargate @cosmjs/tendermint-rpc
Or using npm:
npm install @cosmjs/amino @cosmjs/proto-signing @cosmjs/stargate @cosmjs/tendermint-rpc
Core Dependencies
Package | Description | Required For |
---|---|---|
@cosmjs/amino | Implements the Amino encoding format | Amino encoding support, transaction signing |
@cosmjs/proto-signing | Provides Protobuf-based transaction signing | Direct signing, registry management |
@cosmjs/stargate | High-level client for interacting with Cosmos SDK chains | Stargate client functionality |
@cosmjs/tendermint-rpc | Tendermint RPC client implementation | Lower-level blockchain interaction |
Optional Dependencies
Depending on which Telescope features you're using, you may need additional dependencies:
LCD Clients
If you're using the LCD Client functionality:
yarn add @cosmology/lcd
React Query Integration
If you're using the React Query integration:
yarn add @tanstack/react-query
Vue Query Integration
If you're using the Vue Query integration:
yarn add @tanstack/vue-query
Recoil Integration
If you're using the Recoil state management:
yarn add recoil
Pinia Integration
If you're using the Pinia state management:
yarn add pinia
Mobx Integration
If you're using the Mobx state management:
yarn add mobx mobx-react
CosmWasm Integration
If you're working with CosmWasm contracts:
yarn add @cosmjs/cosmwasm-stargate
Peer Dependencies
The following packages are often used alongside Telescope-generated code but are not strictly required:
Package | Description |
---|---|
@cosmjs/crypto | Cryptographic primitives |
@cosmjs/encoding | Encoding utilities |
@cosmjs/math | Mathematical utilities, including Decimal type |
@cosmjs/utils | General utilities |
Development Dependencies
When setting up a new project with Telescope, you'll need:
yarn add --dev @cosmology/telescope
Version Compatibility
Ensure that your CosmJS packages have compatible versions. Typically, you should install the same version for all CosmJS packages.
Current recommended CosmJS version:
yarn add @cosmjs/amino@0.31.1 @cosmjs/proto-signing@0.31.1 @cosmjs/stargate@0.31.1 @cosmjs/tendermint-rpc@0.31.1
Example package.json
Here's an example package.json
dependencies section for a project using Telescope-generated code with React:
{
"dependencies": {
"@cosmjs/amino": "^0.31.1",
"@cosmjs/proto-signing": "^0.31.1",
"@cosmjs/stargate": "^0.31.1",
"@cosmjs/tendermint-rpc": "^0.31.1",
"@cosmology/lcd": "^0.12.0",
"@tanstack/react-query": "^4.29.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@cosmology/telescope": "^1.0.0",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"typescript": "^5.0.4"
}
}