Represents a Cardano address in the blockchain ecosystem.

The Address class provides methods for creating, managing, and performing operations with Cardano addresses, including encoding/decoding and validation.

Properties

ptr: number

Pointer to the native Address object in memory.

Methods

  • Gets the reference count of the address object in the WASM context.

    Returns number

    The current reference count of the address object.

  • Converts the address to its raw byte representation.

    Returns Uint8Array

    A Uint8Array containing the raw byte representation of the address.

    If the operation fails.

  • Converts the address to a hexadecimal string representation.

    Returns string

    A string containing the hexadecimal representation of the address.

    If the operation fails.

  • Converts the address to string representation.

    Returns string

    A string containing the representation of the address.

    If the operation fails.

  • Creates an Address instance from raw bytes.

    Parameters

    • data: Uint8Array

      The raw byte data of the address.

    Returns Address

    A new Address instance.

    If the operation fails.

  • Creates an Address instance from a hexadecimal string.

    Parameters

    • hex: string

      The hexadecimal string representing the address.

    Returns Address

    A new Address instance.

    If the operation fails.

  • Creates an Address instance from a string.

    Parameters

    • address: string

      The string representing the address.

    Returns Address

    A new Address instance.

    If the operation fails.

  • Validates if a string is a valid address in any supported format.

    Parameters

    • address: string

      The address string to validate.

    Returns boolean

    True if the string is a valid address.

  • Validates if a string is a valid Bech32-encoded address.

    Parameters

    • bech32: string

      The Bech32-encoded string to validate.

    Returns boolean

    True if the string is a valid Bech32-encoded address.

  • Validates if a string is a valid Byron-encoded address.

    Parameters

    • byron: string

      The Byron-encoded string to validate.

    Returns boolean

    True if the string is a valid Byron-encoded address.