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 || token }) returns String,
rpc: String (URL)
}
explorerUrlFor
Transaction
blockchain.explorerUrlFor({ transaction: { id: '0x51ae8875028b7ed004253f679076851abbd3a49e26faf8d7dac6bb283ca10536' } })
Token
blockchain.explorerUrlFor({ token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' })
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