An Address, as an immutable object.

Constructors

  • Creates an address object, given a raw string (whether a hex pubkey or a Bech32 address), a sequence of bytes, or another Address object.

    Parameters

    • value: string | Uint8Array<ArrayBufferLike> | Address
    • Optionalhrp: string

    Returns Address

Methods

  • Returns the human-readable-part of the bech32 addresses.

    Returns string

  • Returns the pubkey as raw bytes (buffer)

    Returns Buffer

  • Returns whether the address is empty.

    Returns boolean

  • Returns whether the address is a smart contract address.

    Returns boolean

  • Returns the bech32 representation of the address

    Returns string

  • Returns the hex representation of the address (pubkey)

    Returns string

  • Converts the address to a pretty, plain JavaScript object.

    Returns object

  • Returns the bech32 representation of the address

    Returns string

  • Creates an empty address object. Generally speaking, this should not be used by client code (internal use only).

    Returns Address

  • Parameters

    • buffer: Buffer
    • Optionalhrp: string

    Returns Address

    Use the constructor, instead.

  • Performs address validation without throwing errors

    Parameters

    • value: string

    Returns boolean

  • Creates an address object from a bech32-encoded string

    Parameters

    • value: string

    Returns Address

  • Creates an address object from a hex-encoded string

    Parameters

    • value: string
    • Optionalhrp: string

    Returns Address

  • Creates the Zero address (the one that should be used when deploying smart contracts). Generally speaking, this should not be used by client code (internal use only).

    Returns Address