Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ethersproject/constants

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/constants

Error utility functions for ethers.

  • 5.0.0-beta.125
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
967K
increased by4.38%
Maintainers
1
Weekly downloads
 
Created

What is @ethersproject/constants?

@ethersproject/constants is a package that provides a collection of common constants used in Ethereum development. These constants include predefined values for addresses, hashes, and other frequently used Ethereum-related data.

What are @ethersproject/constants's main functionalities?

Addresses

Provides a constant for the zero address, which is often used as a placeholder or default address in Ethereum applications.

const { AddressZero } = require('@ethersproject/constants');
console.log(AddressZero); // Output: '0x0000000000000000000000000000000000000000'

Hashes

Provides a constant for the zero hash, which is a hash filled with zeros and is often used as a default or placeholder hash.

const { HashZero } = require('@ethersproject/constants');
console.log(HashZero); // Output: '0x0000000000000000000000000000000000000000000000000000000000000000'

Ether Units

Provides a constant for the number of wei per ether, which is useful for converting between ether and wei units.

const { WeiPerEther } = require('@ethersproject/constants');
console.log(WeiPerEther.toString()); // Output: '1000000000000000000'

Negative One

Provides a constant for the value negative one, which can be useful in various calculations and comparisons.

const { NegativeOne } = require('@ethersproject/constants');
console.log(NegativeOne.toString()); // Output: '-1'

Other packages similar to @ethersproject/constants

Keywords

FAQs

Package last updated on 19 Apr 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