Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ethAddress

Hierarchy

  • ethAddress

Constructors

constructor

  • Parameters

    • buf: Buffer

    Returns ethAddress

Properties

Readonly buf

buf: Buffer

Methods

equals

  • Is address equal to another.

    Parameters

    Returns boolean

isPrecompileOrSystemAddress

  • isPrecompileOrSystemAddress(): boolean
  • True if address is in the address range defined by EIP-1352

    Returns boolean

isZero

  • isZero(): boolean
  • Is address zero.

    Returns boolean

toBuffer

  • toBuffer(): Buffer
  • Returns Buffer representation of address.

    Returns Buffer

toString

  • toString(): string
  • Returns hex encoding of address.

    Returns string

Static fromPrivateKey

  • Returns an address for a given private key.

    Parameters

    • privateKey: Buffer

      A private key must be 256 bits wide

    Returns ethAddress

Static fromPublicKey

  • Returns an address for a given public key.

    Parameters

    • pubKey: Buffer

      The two points of an uncompressed key

    Returns ethAddress

Static fromString

  • Returns an Address object from a hex-encoded string.

    Parameters

    • str: string

      Hex-encoded address

    Returns ethAddress

Static generate

  • Generates an address for a newly created contract.

    Parameters

    • from: ethAddress

      The address which is creating this new address

    • nonce: BN

      The nonce of the from account

    Returns ethAddress

Static generate2

  • Generates an address for a contract created using CREATE2.

    Parameters

    • from: ethAddress

      The address which is creating this new address

    • salt: Buffer

      A salt

    • initCode: Buffer

      The init code of the contract being created

    Returns ethAddress

Static zero

  • Returns the zero address.

    Returns ethAddress

Generated using TypeDoc