hyperweb-io / hyperweb-io/chain-registry

FEATURE REQ: query ChainRegistryClient.getChainInfo by chain_id

Open
#155 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
70
Forks
39
PR merge metrics
No merged PRs in 30d

Description

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: 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.