Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@ethersproject/networks
Advanced tools
@ethersproject/networks is a part of the ethers.js library, which provides a collection of utilities for interacting with Ethereum networks. This package specifically deals with network configurations and provides utilities to define and work with different Ethereum networks.
Get Network Information
This feature allows you to retrieve information about a specific Ethereum network by its name or chain ID. In this example, we get the network information for the 'homestead' network, which is the main Ethereum network.
const { getNetwork } = require('@ethersproject/networks');
const network = getNetwork('homestead');
console.log(network);
Define Custom Network
This feature allows you to define a custom network by specifying its name and chain ID. In this example, we create a custom network with the name 'custom' and chain ID 12345.
const { Network } = require('@ethersproject/networks');
const customNetwork = new Network('custom', 12345);
console.log(customNetwork);
The web3.js library is a comprehensive collection of modules that allow you to interact with an Ethereum blockchain. It includes functionalities for network configurations similar to @ethersproject/networks, but also provides a broader range of features for interacting with smart contracts, accounts, and more.
ethjs is a lightweight JavaScript library for interacting with the Ethereum blockchain. It provides utilities for network configurations and other Ethereum-related functionalities. Compared to @ethersproject/networks, ethjs is more minimalistic and focuses on providing a simple API for common Ethereum tasks.
This sub-module is part of the ethers project.
It is responsible for tracking common networks along with important parameters for each.
For more information, see the documentation.
Most users will prefer to use the umbrella package, but for those with more specific needs, individual components can be imported.
const {
getNetwork,
// Types
Network,
Networkish
} = require("@ethersproject/networks");
MIT License
FAQs
Network definitions for ethers.
The npm package @ethersproject/networks receives a total of 686,394 weekly downloads. As such, @ethersproject/networks popularity was classified as popular.
We found that @ethersproject/networks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.