Gathering detailed insights and metrics for @depay/web3-blockchains
Gathering detailed insights and metrics for @depay/web3-blockchains
Gathering detailed insights and metrics for @depay/web3-blockchains
Gathering detailed insights and metrics for @depay/web3-blockchains
⛓ JavaScript library containing aggregated information and abstractions for Web3 blockchains.
npm install @depay/web3-blockchains
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
6 Stars
146 Commits
4 Forks
3 Watching
1 Branches
2 Contributors
Updated on 10 Nov 2024
Minified
Minified + Gzipped
JavaScript (98.53%)
HTML (1.47%)
Cumulative downloads
Total Downloads
Last day
18.5%
1,229
Compared to previous day
Last week
27.7%
7,869
Compared to previous week
Last month
20.2%
27,191
Compared to previous month
Last year
118.6%
219,439
Compared to previous year
18
yarn add @depay/web3-blockchains
or
npm install --save @depay/web3-blockchains
1import Blockchains from '@depay/web3-blockchains' 2 3Blockchains.all 4// [ 5// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }, 6// { name: 'bsc', id: '0x38', label: 'Binance Smart Chain', logo: '...' }, 7// ... 8// ] 9 10Blockchains.findByName('ethereum') 11// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' } 12 13Blockchains.findById('0x1') 14// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' } 15 16Blockchains.findByNetworkId(1) 17// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }
or
1import { all, findByName, findById, findByNetworkId } from '@depay/web3-blockchains' 2 3all 4// [ 5// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }, 6// { name: 'bsc', id: '0x38', label: 'Binance Smart Chain', logo: '...' }, 7// ... 8// ] 9 10findByName('ethereum') 11// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' } 12 13findById('0x1') 14// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' } 15 16findByNetworkId(1) 17// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }
or
1import Blockchains from '@depay/web3-blockchains' 2 3Blockchains['ethereums'] 4// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }
This library supports the following blockchains:
Blockchain data is provided in the following structure:
1{ 2 name: String, // e.g. ethereum, bsc ... 3 id: String, // e.g. 0x1, 0x38, ... 4 networkId: String, // 1, 56, ... 5 namespace: String, // eip155, solana, ... 6 label: String, // Ethereum, Binance Smart Chain ... 7 fullName: String, // Ethereum Mainnet, Binance Smart Chain Mainnet ... 8 logo: String, // base64 data or URL (logo for colored or dark background) 9 logoBackgroundColor: String // hex color 10 logoWhiteBackground: String // base64 data or url (logos for white background) 11 currency: { Object 12 name: String, // Ether, Binance Coin, ... 13 symbol: String, // ETH, BNB, ... 14 decimals: String, // 18 15 address: String, // address or placeholder address 16 logo: String, // base64 data or URL, 17 }, 18 wrapped: { Object 19 address: String, // address of the wrapped native scurrency 20 decimals: Integer, // 18 21 logo: String, // base64 data or URL 22 }, 23 stables: { Object 24 usd: [ Array 25 { Object 26 address: String, // 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 27 decimals: Integer, // 18 28 }, ... 29 ] 30 }, 31 explorer: String (URL), // https://etherscan.io, https://bncscan.com, ... 32 explorerUrlFor: Function ({ transaction || token }) returns String, // https://etherscan.io/tx/..., https://etherscan.io/token/... 33 endpoints: [ Array 34 String (URL), // https://rpc.ankr.com/eth 35 ], 36 sockets: [ // Array || undefined 37 String (URL), // wss://mainnet-beta.solflare.network 38 ], 39 tokens: [ Array 40 { Object 41 address: String, // 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 42 symbol: String, // USDC 43 name: String, // USD Coin 44 decimals: Integer, // 6 45 logo: String(URL|Data URL), // https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png 46 type: String, // 20 47 }, 48 ], 49 zero: String, // 0x0000000000000000000000000000000000000000 50 maxInt: String, // 115792089237316195423570985008687907853269984665640564039457584007913129639935 51 permit2: String, // 0x000000000022D473030F116dDEE9F6B43aC78BA3 (Permit2 contract address) 52 blockTime: Integer, // in ms e.g. ethereum 12000 (12s) 53}
1blockchain.explorerUrlFor({ transaction: '0x51ae8875028b7ed004253f679076851abbd3a49e26faf8d7dac6bb283ca10536' }) 2// https://etherscan.io/tx/0x51ae8875028b7ed004253f679076851abbd3a49e26faf8d7dac6bb283ca10536
1blockchain.explorerUrlFor({ token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' }) 2// https://etherscan.io/token/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb
1blockchain.explorerUrlFor({ address: '0x08B277154218CCF3380CAE48d630DA13462E3950' }) 2// https://etherscan.io/address/0x08B277154218CCF3380CAE48d630DA13462E3950
1import Blockchains from '@depay/web3-blockchains' 2 3Blockchains.all 4// [ 5// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' }, 6// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }, 7// ... 8// ] 9
1import Blockchains from '@depay/web3-blockchains' 2 3Blockchains.findById('0x1') 4// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' } 5 6Blockchains.findById('0x38') 7// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
1import Blockchains from '@depay/web3-blockchains' 2 3Blockchains.findByName('ethereum') 4// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' } 5 6Blockchains.findByName('bsc') 7// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
1import Blockchains from '@depay/web3-blockchains' 2 3Blockchains.findByNetworkId(1) 4// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' } 5 6Blockchains.findByNetworkId('56') 7// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
yarn install
yarn dev
No vulnerabilities found.
No security vulnerabilities found.