@civic/civic-eth-provider
This library builds Provider instances for various EVM chains.
Adding a new EVM chain
- Add a mapping from chainId to network name in chainIdMap.json
- Add a provider URL in ethProvider.ts
Looking up a chain ID by network name
import { lookupEvmChainIdByNetwork } from '@civic/civic-eth-provider';
const networkName = lookupEvmChainIdByNetwork('xdcApothem'); // returns 51
Looking up a network name by chain ID
import { lookupEvmChainIdByNetwork, lookupEvmChainNetworkById } from '@civic/civic-eth-provider';
const networkName = lookupEvmChainNetworkById(51); // returns 'xdcApothem'