0.0.5 • Published 1 year ago
@xcvproject/chainlist v0.0.5
chainlist
Install
npm install @xcvproject/chainlist
or
yarn add @xcvproject/chainlist
Usage
import { chainById, getRpcUrlById } from '@xcvproject/chainlist';
const ethereumChain = getChainById(1);
const ethereumChain = getChainById(1, true); // return hex chainId for add network to metamask
/**
{
chainId: 1,
rpcUrls: [
'https://cloudflare-eth.com',
'https://rpc.ankr.com/eth'
],
chainName: 'Ethereum',
nativeCurrency: {
name: 'Ethereum',
symbol: 'ETH',
decimals: 18
},
blockExplorerUrls: ['https://etherscan.io']
}
*/
const ethereumRpcUrl = getRpcUrlById(1);
// https://cloudflare-eth.com