ethers.js/src.ts/constants/numbers.ts
2022-09-05 16:14:43 -04:00

58 lines
1.2 KiB
TypeScript

/**
* A constant for the BigInt of -1.
*/
const NegativeOne = BigInt(-1);
/**
* A constant for the BigInt of 0.
*/
const Zero = BigInt(0);
/**
* A constant for the BigInt of 1.
*/
const One = BigInt(1);
/**
* A constant for the BigInt of 2.
*/
const Two = BigInt(2);
/**
* A constant for the order N for the secp256k1 curve.
*/
const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
/**
* A constant for the number of wei in a single ether.
*/
const WeiPerEther = BigInt("1000000000000000000");
/**
* A constant for the maximum value for a ``uint256``.
*/
const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
/**
* A constant for the minimum value for an ``int256``.
*/
const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * NegativeOne;
/**
* A constant for the maximum value for an ``int256``.
*/
const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
export {
NegativeOne,
Zero,
One,
Two,
N,
WeiPerEther,
MaxUint256,
MinInt256,
MaxInt256,
};