All Projects → taylorjdawson → eth-chains

taylorjdawson / eth-chains

Licence: other
Helper module for getting Ethereum chains info from chainlist.org.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to eth-chains

web3-token
Web3 Token is a new way to authenticate users in a hybrid dApps using signed messages. Implementation of EIP-4361.
Stars: ✭ 356 (+812.82%)
Mutual labels:  web3
zksync-dapp-checkout
zkCheckout — trustable permissionless DeFi payment gateway. Brand new zkSync dApp w/t all L2 perks: fast&cheap transfers / simple&quick withdrawal
Stars: ✭ 37 (-5.13%)
Mutual labels:  web3
connect-metamask-react-dapp
Build a simple React / Web3 Dapp that replicates a small portion of the Uniswap v2 interface
Stars: ✭ 204 (+423.08%)
Mutual labels:  web3
docs
Unleash Bitcoin's full potential with decentralized apps and smart contracts. The documentation covers key aspects of the Stacks network and technology and provides tutorials and other helpful content for developers.
Stars: ✭ 134 (+243.59%)
Mutual labels:  web3
metaverse-development
Certified Web3 and Metaverse Developer Syllabus and Details by Panaverse
Stars: ✭ 195 (+400%)
Mutual labels:  web3
start-here
Join our community and build with us. This repository is for Community help and support 💜 ✨
Stars: ✭ 67 (+71.79%)
Mutual labels:  web3
oxo-chat-client
基于websocket、json、blockchain的公告、聊天(客户端到客户端加密)客户端。账号无需注册,本地生成!
Stars: ✭ 52 (+33.33%)
Mutual labels:  web3
web3-mock
🤡 JavaScript library to mock web3 responses either by emulating web3 wallets or web3 RPC requests.
Stars: ✭ 54 (+38.46%)
Mutual labels:  web3
SkyGallery
Create galleries by uploading images and videos. Powered by Sia Skynet.
Stars: ✭ 23 (-41.03%)
Mutual labels:  web3
web3together
🗣 Public open-ended discussions about Blockchain, Web3, NFTs, DeFi, ...
Stars: ✭ 58 (+48.72%)
Mutual labels:  web3
nextjs-dapp-starter-ts
A fullstack monorepo template to develop ethereum dapps
Stars: ✭ 228 (+484.62%)
Mutual labels:  web3
matic-docs
The official documentation for all Polygon products.
Stars: ✭ 181 (+364.1%)
Mutual labels:  web3
anchor-escrow
Escrow program implemented in Anchor
Stars: ✭ 142 (+264.1%)
Mutual labels:  web3
geth-connector
This repository served as an experiment playground for the alpha version of AKASHA desktop application. Now it is considered deprecated and seen as a stepping stone in the R&D of the AKASHA world framework. 🚀🌍🚀
Stars: ✭ 52 (+33.33%)
Mutual labels:  web3
dtube
Decentralized video sharing & social media platform on Ethereum blockchain.
Stars: ✭ 70 (+79.49%)
Mutual labels:  web3
react-mix
Everything you need to use React with Brownie!
Stars: ✭ 58 (+48.72%)
Mutual labels:  web3
ethereum-php
Ethereum Client for PHP.
Stars: ✭ 50 (+28.21%)
Mutual labels:  web3
safe-core-sdk
Software developer tools that facilitate the interaction with the Safe contracts and services.
Stars: ✭ 93 (+138.46%)
Mutual labels:  web3
LunDAO
LunDAO 是一個鼓勵撰寫與 Ethereum 社群相關的中深度的中文文章,透過一個短期的實驗專案嘗試 DAO 可以如何進行社群治理以及回饋社群貢獻。
Stars: ✭ 50 (+28.21%)
Mutual labels:  web3
create-react-native-dapp
Your next Ethereum application starts here. ⚛️ 💪 🦄
Stars: ✭ 410 (+951.28%)
Mutual labels:  web3

Publish npm

Eth Chains

Helper module for getting Ethereum chains info from chainid.network.

Install

yarn add eth-chains
npm install eth-chains

Usage

Import chains methods and enums:

import chains, { ChainId, ChainName } from 'eth-chains'

Easily get most popular chains:

import { chain } from 'eth-chains'

console.log(chain.ethereum.rinkeby)

console.log(chain.polygon.mumbai)

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:

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

Chain by Name:

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

Get all Chains:

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

Typescript Types:

import { Chain, NativeCurrency, Explorer } from 'eth-chains'
const ethereum: Chain = chains.getById(ChainId.EthereumMainnet)
ethereum.chain // 'ETH'

TODO:

  • Add webhook that watches the chains repo and triggers an update to this package whenever that repo gets updated
    • Add check in the deploy script to make sure that the types are correct before publishing
  • Add Tests
    • Once quicktype is added, test with different chains.json objects to make sure it can handle new types
  • Use quicktype to autogen types from json
  • Autogen Chain Id enum
  • Autogen Chain Name enum
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].