Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@depay/web3-blockchains
Advanced tools
JavaScript library containing aggregated information and abstractions for web3 blockchains.
yarn add @depay/web3-blockchains
or
npm install --save @depay/web3-blockchains
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.all
// [
// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' },
// { name: 'bsc', id: '0x38', label: 'Binance Smart Chain', logo: '...' },
// ...
// ]
Blockchain.findByName('ethereum')
// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }
Blockchain.findById('0x1')
// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }
Blockchain.findByNetworkId(1)
// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }
This library supports the following blockchains:
Blockchain data is provided in the following structure:
{
name: String, // e.g. ethereum, bsc ...
id: String, // e.g. 0x1, 0x38, ...
networkId: String, // 1, 56, ...
namespace: String, // eip155, solana, ...
label: String, // Ethereum, Binance Smart Chain ...
fullName: String, // Ethereum Mainnet, Binance Smart Chain Mainnet ...
logo: String (SVG),
currency: { Object
name: String, // Ether, Binance Coin, ...
symbol: String, // ETH, BNB, ...
decimals: String, // 18
},
explorer: String (URL), // https://etherscan.io, https://bncscan.com, ...
explorerUrlFor: Function ({ transaction || token }) returns String, // https://etherscan.io/tx/..., https://etherscan.io/token/...
rpc: String (URL) // ...
}
blockchain.explorerUrlFor({ transaction: '0x51ae8875028b7ed004253f679076851abbd3a49e26faf8d7dac6bb283ca10536' })
// https://etherscan.io/tx/0x51ae8875028b7ed004253f679076851abbd3a49e26faf8d7dac6bb283ca10536
blockchain.explorerUrlFor({ token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' })
// https://etherscan.io/token/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb
blockchain.explorerUrlFor({ address: '0x08B277154218CCF3380CAE48d630DA13462E3950' })
// https://etherscan.io/address/0x08B277154218CCF3380CAE48d630DA13462E3950
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.all
// [
// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' },
// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' },
// ...
// ]
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.findById('0x1')
// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' }
Blockchain.findById('0x38')
// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.findByName('ethereum')
// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' }
Blockchain.findByName('bsc')
// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
import { Blockchain } from '@depay/web3-blockchains'
Blockchain.findByNetworkId(1)
// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' }
Blockchain.findByNetworkId('56')
// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
yarn install
yarn dev
FAQs
JavaScript library containing aggregated information and abstractions for web3 blockchains.
The npm package @depay/web3-blockchains receives a total of 4,542 weekly downloads. As such, @depay/web3-blockchains popularity was classified as popular.
We found that @depay/web3-blockchains demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.