Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrouid/evm-chains
Package to get chain data from ethereum-lists/chains
https://github.com/pedrouid/evm-chains
Last synced: about 2 months ago
JSON representation
Package to get chain data from ethereum-lists/chains
- Host: GitHub
- URL: https://github.com/pedrouid/evm-chains
- Owner: pedrouid
- License: mit
- Created: 2019-06-17T14:15:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T22:03:31.000Z (almost 2 years ago)
- Last Synced: 2024-11-09T16:02:36.134Z (about 2 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/evm-chains
- Size: 824 KB
- Stars: 33
- Watchers: 4
- Forks: 8
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# evm-chains
Package to query chain data from [ethereum-lists/chains](https://github.com/ethereum-lists/chains)
## Install
```sh
npm install --save evm-chains#or
yarn add evm-chains
```## API
```typescript
function getAllChains(): IChainData[];
function getChain(chainId: number): IChainData;
function getChainByChainId(chainId: number): IChainData;
function getChainByKeyValue(key: string, value: any): IChainData;
function getChainByNetworkId(networkId: number): number;
function convertNetworkIdToChainId(networkId: number): number;
function convertChainIdToNetworkId(chainId: number): number;
```## Types
```typescript
interface IChainData {
name: string;
chainId: number;
shortName: string;
chain: string;
network: string;
networkId: number;
nativeCurrency: {
name: string;
symbol: string;
decimals: number;
};
rpc: string[];
faucets: string[];
infoURL: string;
}
```## Data Source
[https://github.com/ethereum-lists/chains](https://github.com/ethereum-lists/chains)