Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE REQ: query ChainRegistryClient.getChainInfo by chain_id #155

Open
rayraspberry opened this issue Oct 12, 2024 · 0 comments
Open

Comments

@rayraspberry
Copy link

rayraspberry commented Oct 12, 2024

in circumstances where the chains queried are unknown and the information about a chain needs to be gathered without prior knowledge beyond the chain id , it would be helpful to be able to query by chain_id (osmosis-1 or osmo-test-5, for example)

const chain = unknownData.ChainId; // osmosis-1

const client = new ChainRegistryClient({
    chainNames: [chain]
});
const chainInfo = client.getChainInfo(chain);

chainInfo is returned as follows:

Chain Info: <ref *1> ChainInfo {
  chainName: 'osmosis-1',
  fetcher: ChainRegistryClient {
    urls: [
      'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis-1/chain.json',
      'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis-1/assetlist.json'
    ],
    _assetLists: [],
    _chains: [],
    _ibcData: [],
    chainInfoList: [ [Circular *1] ],
    _options: {
      chainNames: [Array],
      baseUrl: 'https://raw.githubusercontent.com/cosmos/chain-registry/master',
      assetListNames: undefined,
      ibcNamePairs: undefined
    }
  },
  _chain: undefined,
  _assetList: undefined,
  _assetLists: [],
  _ibcData: []
}

the URLs result in 404 NOT FOUND

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

No branches or pull requests

1 participant