Gathering detailed insights and metrics for @chain-registry/osmosis
Gathering detailed insights and metrics for @chain-registry/osmosis
Gathering detailed insights and metrics for @chain-registry/osmosis
Gathering detailed insights and metrics for @chain-registry/osmosis
npm install @chain-registry/osmosis
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
62 Stars
1,384 Commits
35 Forks
12 Watching
99 Branches
13 Contributors
Updated on 28 Nov 2024
TypeScript (99.96%)
JavaScript (0.04%)
Cumulative downloads
Total Downloads
Last day
38.4%
281
Compared to previous day
Last week
-15.6%
1,329
Compared to previous week
Last month
-9.3%
5,669
Compared to previous month
Last year
173.7%
62,687
Compared to previous year
1
The npm package for the Official Cosmos chain registry
npm install chain-registry
A unified store of chains info, assets, asset lists, and IBC channels for the Cosmos ecosystem. Get everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
β οΈ This repository now contains two versions of the chain-registry:
snake_case
naming conventions.camelCase
naming conventions based on developer feedback.*We encourage developers to migrate to v2 for improved consistency and readability.
chain-registry
Fetch data from chain-registry
:
1import { assets, chains, ibc } from 'chain-registry'; 2 3const assetList = assets.find(({chain_name})=>chain_name==='osmosis'); 4 5console.log(assetList);
will output:
1{ 2 '$schema': '../assetlist.schema.json', 3 chain_name: 'osmosis', 4 assets: [ 5 { 6 description: 'The native token of Osmosis', 7 denom_units: [Array], 8 base: 'uosmo', 9 name: 'Osmosis', 10 display: 'osmo', 11 symbol: 'OSMO', 12 logo_URIs: [Object], 13 coingecko_id: 'osmosis' 14 }, 15 { 16 denom_units: [Array], 17 base: 'uion', 18 name: 'Ion', 19 display: 'ion', 20 symbol: 'ION', 21 logo_URIs: [Object], 22 coingecko_id: 'ion' 23 } 24 ] 25}
@chain-registry/client
for dynamic dataDynamically fetch data:
1import { ChainRegistryClient } from '@chain-registry/client'; 2 3// create an instance of ChainRegistryClient by passing in the chain names 4const client = new ChainRegistryClient({ 5 chainNames: [ 6 'osmosis', 7 'juno', 8 'stargaze' 9 ] 10}); 11 12// chain info, assets and ibc data will be downloaded dynamically by invoking fetchUrls method 13await client.fetchUrls(); 14// get chain data 15const chain = client.getChain('osmosis'); 16// get asset list 17const assetList = client.getChainAssetList('osmosis'); 18// get ibc data 19const ibcData = client.getChainIbcData('osmosis'); 20// get asset list (including ibc assets) 21const generatedAssetList = client.getGeneratedAssetLists('osmosis');
chain-registry
Tree-shaking is a modern JavaScript feature that allows for smaller bundle sizes by only including the code that is actually used in your project. The chain-registry
package supports tree-shaking, ensuring that only the specified imports are included in your bundle. Below are examples of how to import different datasets according to your needs.
You can directly import assets and chain information based on the network type - mainnet, testnet, or devnet. Hereβs how you can import data for each network type:
1import { assets, chains } from 'chain-registry/mainnet';
1import { assets, chains } from 'chain-registry/testnet';
1import { assets, chains } from 'chain-registry/devnet';
If you are interested in a specific chain, such as Osmosis on the mainnet, you can import data related to that particular chain only:
1import { assets, chain } from 'chain-registry/mainnet/osmosis';
1import assets from 'chain-registry/mainnet/osmosis/assets';
1import chain from 'chain-registry/mainnet/osmosis/chain';
To include data from non-Cosmos chains, use the following import:
1import { assets } from 'chain-registry/noncosmos';
An npm module for the Official chain-registry
for the Cosmos βοΈ
A Client for chain-registry
that allows you to dynamically fetch data.
Types for chain-registry
.
Keplr integration for the chain-registry returning keplr's ChainInfo
type from @chain-registry/types
Chain
type.
Asset lists for the Cosmos βοΈ
Chain Registry info for Osmosis, including asset lists.
Chain Registry info for Juno, including asset lists.
Utility functions for chain-registry
.
Checkout the repository run yarn to initialize the workspace:
1# Clone the repo. 2git clone https://github.com/cosmology-tech/chain-registry 3yarn
1yarn build
First, cd
into the root folder of the project:
1cd /your/path/to/chain-registry
Second, update the git submodules:
1git submodule update --remote
Third, generate the code:
1yarn codegen
Finally, commit and publish the code!
1git commit -am "new registry updates" 2lerna publish
Use the following Makefile commands to update the data in the submodules. These commands will ensure that your submodules are synchronized with their respective remote repositories.
cosmos/chain-registry
repository. This should be used to pull the most current production data into your local environment.make update-registry
cosmology-tech/chain-registry-fixtures
repository. Use this for testing purposes to ensure that your tests are running against stable, controlled data sets.make update-fixtures
Checkout these related projects:
π Built by Cosmology βΒ if you like our tools, please consider delegating to our validator βοΈ
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED βAS ISβ, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
No vulnerabilities found.
No security vulnerabilities found.