Quickstart
yarn add @depay/web3-blockchains
or
npm install --save @depay/web3-blockchains
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.all
Blockchain.findById('0x1')
Blockchain.findByName('ethereum')
Blockchain.findByNetworkId(1)
Support
This library supports the following blockchains:
Data Structure
Blockchain data is provided in the following structure:
{
name: String,
id: String,
networkId: String,
label: String,
fullName: String,
logo: String (base64 encoded PNG),
currency: { Object
name: String,
symbol: String,
decimals: String,
},
explorer: String (URL),
explorerUrlFor: Function ({ transaction (with id) }) returns String,
rpc: String (URL)
}
Functionalities
all: Retreive all information for all blockchains
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.all
findById: Get blockchain by blockchain id
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.findById('0x1')
Blockchain.findById('0x38')
findByName: Get blockchain by blockchain name
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.findByName('ethereum')
Blockchain.findByName('bsc')
findByNetworkId: Get blockchain by network id
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.findByNetworkId(1)
Blockchain.findByNetworkId('56')
Development
Get started
yarn install
yarn dev
Release
npm publish