# @civic/civic-eth-provider

This library builds Provider instances for various EVM chains.

## Adding a new EVM chain
1. Add a mapping from chainId to network name in [chainIdMap.json](./src/chainIdMap.json)
2. Add a provider URL in [ethProvider.ts](./src/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'
```