Socket
Socket
Sign inDemoInstall

ethereumjs-common

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereumjs-common

Resources common to all Ethereum implementations


Version published
Weekly downloads
112K
decreased by-4.21%
Maintainers
3
Weekly downloads
 
Created

What is ethereumjs-common?

The ethereumjs-common package is a JavaScript library that provides common Ethereum constants, parameters, and functions. It is used to define and access chain and hardfork parameters, which are essential for Ethereum blockchain development and interaction.

What are ethereumjs-common's main functionalities?

Chain Parameters

This feature allows you to define and access chain parameters for different Ethereum networks. In this example, a custom chain based on the mainnet is created with specific network and chain IDs.

const Common = require('ethereumjs-common').default;
const mainnetCommon = Common.forCustomChain('mainnet', {
  name: 'customchain',
  networkId: 1,
  chainId: 1
}, 'petersburg');
console.log(mainnetCommon.chainName());

Hardfork Parameters

This feature allows you to define and access hardfork parameters for different Ethereum networks. In this example, a custom chain based on the Ropsten testnet is created with the 'byzantium' hardfork.

const Common = require('ethereumjs-common').default;
const ropstenCommon = Common.forCustomChain('ropsten', {
  name: 'customropsten',
  networkId: 3,
  chainId: 3
}, 'byzantium');
console.log(ropstenCommon.hardfork());

EIP Support

This feature allows you to check the EIPs (Ethereum Improvement Proposals) supported by a specific chain and hardfork. In this example, the EIPs supported by the 'istanbul' hardfork on the mainnet are logged.

const Common = require('ethereumjs-common').default;
const common = new Common({ chain: 'mainnet', hardfork: 'istanbul' });
console.log(common.eips());

Other packages similar to ethereumjs-common

Keywords

FAQs

Package last updated on 11 Dec 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc