GithubHelp home page GithubHelp logo

turbocrime / chain-registry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cosmology-tech/chain-registry

0.0 0.0 0.0 43.22 MB

Cosmos chain registry ⚛️

Home Page: https://cosmology.zone/products/chain-registry

License: MIT License

JavaScript 0.07% TypeScript 99.93% Makefile 0.01%

chain-registry's Introduction

chain-registry

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.

example

Fetch data from chain-registry:

import { assets, chains, ibc } from 'chain-registry';

const assetList = assets.find(({chain_name})=>chain_name==='osmosis');

console.log(assetList);

will output:

{
  '$schema': '../assetlist.schema.json',
  chain_name: 'osmosis',
  assets: [
    {
      description: 'The native token of Osmosis',
      denom_units: [Array],
      base: 'uosmo',
      name: 'Osmosis',
      display: 'osmo',
      symbol: 'OSMO',
      logo_URIs: [Object],
      coingecko_id: 'osmosis'
    },
    {
      denom_units: [Array],
      base: 'uion',
      name: 'Ion',
      display: 'ion',
      symbol: 'ION',
      logo_URIs: [Object],
      coingecko_id: 'ion'
    }
  ]
}

Dynamically fetch data:

import { ChainRegistryClient } from '@chain-registry/client';

// create an instance of ChainRegistryClient by passing in the chain names
const client = new ChainRegistryClient({
  chainNames: [
    'osmosis',
    'juno',
    'stargaze'
  ]
});

// chain info, assets and ibc data will be downloaded dynamically by invoking fetchUrls method
await client.fetchUrls();
// get chain data
const chain = client.getChain('osmosis');
// get asset list
const assetList = client.getChainAssetList('osmosis');
// get ibc data
const ibcData = client.getChainIbcData('osmosis);
// get asset list (including ibc assets)
const generatedAssetList = client.getGeneratedAssetLists('osmosis);

packages

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.

Developing

Checkout the repository and bootstrap the yarn workspace:

# Clone the repo.
git clone https://github.com/cosmology-tech/chain-registry
yarn
yarn bootstrap

Building

yarn build

Publishing

First, cd into the root folder of the project:

cd /your/path/to/chain-registry

Second, update the git submodules:

git submodule update --remote

Third, generate the code (this takes a bit since it does some linting):

yarn codegen

Finally, commit and publish the code!

git commit -am "new registry updates"
lerna publish

Related

Checkout these related projects:

  • @cosmology/telescope Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
  • @cosmwasm/ts-codegen Convert your CosmWasm smart contracts into dev-friendly TypeScript classes.
  • chain-registry Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
  • cosmos-kit Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface.
  • create-cosmos-app Set up a modern Cosmos app by running one command.
  • interchain-ui The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
  • starship Unified Testing and Development for the Interchain.

Credits

🛠 Built by Cosmology — if you like our tools, please consider delegating to our validator ⚛️

Disclaimer

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.

chain-registry's People

Contributors

pyramation avatar zetazzz avatar marslavish avatar fatsheep1919 avatar ryoid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.