Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@chain-registry/client
Advanced tools
A Client for chain-registry
that allows you to dynamically fetch data.
import { ChainRegistryFetcher, ChainRegistryFetcherOptions } from '@chain-registry/client';
const options: ChainRegistryFetcherOptions = {
urls: [
'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/chain.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/assetlist.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/assetlist.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/secretnetwork/assetlist.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/juno-osmosis.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/osmosis-secretnetwork.json'
]
};
const registry = new ChainRegistryFetcher(options);
await registry.fetchUrls();
We currently only support fetching JSON schemas as defined in https://github.com/cosmos/chain-registry. Supported are assetlist.schema.json
, chain.schema.json
and ibc_data.schema.json
.
You can set the ChainRegistry.urls
property and call ChainRegistry.fetchUrls()
registry.urls = [
// urls to fetch
];
await registry.fetchUrls();
Or, you can simply call ChainRegistry.fetch()
await registry.fetch('https://some-json-schema.com/some-schema.json');
You can get generated asset lists directly from the registry:
// generated asset lists
const generated: AssetList[] = registry.getGeneratedAssetLists('osmosis');
You can get generated AssetList[]
objects directly from the ChainRegistry
via the assetLists
method:
// you can also get generated assets from ChainInfo object
const chainInfo: Chain = registry.getChainInfo('osmosis');
const generatedAssets: AssetList[] = chainInfo.assetLists;
You can get Chain
object directly from the ChainRegistry
via the getChain
method:
// get Chain from registry
const chain: Chain = registry.getChain('osmosis');
or get the ChainInfo
object:
const chainInfo: ChainInfo = registry.getChainInfo('osmosis');
// AssetList[] of the generated assets
const assetes: AssetList[] = chainInfo.assetLists;
// Chain
const chain: Chain = chainInfo.chain;
// AssetList[] of the native assets
const assetes: AssetList[] = chainInfo.nativeAssetLists;
Checkout these related projects:
🛠 Built by Cosmology — if you like our tools, please consider delegating to our validator ⚛️
FAQs
Chain Registry Client
The npm package @chain-registry/client receives a total of 15,038 weekly downloads. As such, @chain-registry/client popularity was classified as popular.
We found that @chain-registry/client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.