1.30.1 • Published 5 months ago

@chalabi/keplr v1.30.1

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
5 months ago

@chain-registry/keplr

Keplr integration for the chain-registry returning keplr's ChainInfo type from @chain-registry/types Chain type.

npm install @chain-registry/keplr
import { assets, chains } from 'chain-registry';
import { chainRegistryChainToKeplr } from '@chain-registry/keplr';
import { ChainInfo } from '@keplr-wallet/types';

const chain = chains.find(({chain_name})=>chain_name==='osmosis');
const config: ChainInfo = chainRegistryChainToKeplr(chain, assets);

// you can add options as well to choose endpoints 
const config: ChainInfo = chainRegistryChainToKeplr(chain, assets, {
    getExplorer: () => 'https://myexplorer.com',
    getRestEndpoint: (chain) => chain.apis?.rest[1]?.address
    getRpcEndpoint: (chain) => chain.apis?.rpc[1]?.address
});

Credits

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