numbers.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * A constant for the order N for the secp256k1 curve.
  3. *
  4. * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)
  5. */
  6. export const N: bigint = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
  7. /**
  8. * A constant for the number of wei in a single ether.
  9. *
  10. * (**i.e.** ``1000000000000000000n``)
  11. */
  12. export const WeiPerEther: bigint = BigInt("1000000000000000000");
  13. /**
  14. * A constant for the maximum value for a ``uint256``.
  15. *
  16. * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
  17. */
  18. export const MaxUint256: bigint = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
  19. /**
  20. * A constant for the minimum value for an ``int256``.
  21. *
  22. * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)
  23. */
  24. export const MinInt256: bigint = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1);
  25. /**
  26. * A constant for the maximum value for an ``int256``.
  27. *
  28. * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
  29. */
  30. export const MaxInt256: bigint = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");