Socket
Book a DemoInstallSign in
Socket

@revoke.cash/chains

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@revoke.cash/chains

Helper module for getting EVM chains info.

latest
npmnpm
Version
71.0.0
Version published
Maintainers
1
Created
Source

Publish npm

Eth Chains

Helper module for getting EVM chain info from chainid.network.

Note: This package was initially created by @taylorjdawson. We forked the repository so we can control the release process with an automated script and make additional changes. The original package can be found here.

Installation

yarn add @revoke.cash/chains

Note on versioning

@revoke.cash/chains uses a weekly automated release script that updates its chain data. This release script takes breaking changes into account, so breaking changes (e.g. renamed chains) are released as a new major version, while non-breaking changes (e.g. new chains) are released as a new minor version.

Usage

Import chains methods and enums:

import allChains, { ChainId, ChainName } from '@revoke.cash/chains'

Chain names and ids via Enums:

console.log(ChainId.EthereumMainnet) // 1
console.log(ChainId.BinanceSmartChainMainnet) // 56
console.log(ChainName.EthereumMainnet) // "Ethereum Mainnet"
console.log(ChainName.Rinkeby) // "Rinkeby"

Chain by ID:

getChainById(ChainId.EthereumMainnet) // { name: "Ethereum Mainnet", ..., "infoURL": "https://ethereum.org" }
// Equivalent
getChainById(1)

Chain by Name:

getChainByName(ChainName.EthereumMainnet) // { name: "Ethereum Mainnet", ..., "infoURL": "https://ethereum.org" }
// Equivalent
getChainByName('Ethereum Mainnet')

Get all Chains:

const chains = allChains()
// { 1: { name: "Ethereum Mainnet", ..., "infoURL": "https://ethereum.org" }, 2: {...}}

Typescript Types:

import { Chain, NativeCurrency, Explorer } from '@revoke.cash/chains'
const ethereum: Chain = getChainById(ChainId.EthereumMainnet)
ethereum.chain // 'ETH'

FAQs

Package last updated on 09 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts