Class EntityAddr

Represents an entity address in the system. This class supports addresses for three types of entities: system, account, and smart contract. The address type is indicated by either the system, account, or smartContract property being set.

Hierarchy

  • EntityAddr

Constructors

  • Creates a new EntityAddr instance.

    Parameters

    • Optional system: Hash

      The hash representing a system entity.

    • Optional account: Hash

      The hash representing an account entity.

    • Optional smartContract: Hash

      The hash representing a smart contract entity.

    Returns EntityAddr

Properties

account?: Hash

The account hash, if this is an account entity.

smartContract?: Hash

The smart contract hash, if this is a smart contract entity.

system?: Hash

The system hash, if this is a system entity.

Methods

  • Converts the EntityAddr to a byte array. The first byte represents the entity type, followed by the bytes of the associated hash.

    Returns

    The byte array representation of the EntityAddr.

    Throws

    If the EntityAddr type is unexpected.

    Returns Uint8Array

  • Converts the EntityAddr to its JSON representation.

    Returns

    The JSON string representation of the EntityAddr.

    Returns string

  • Returns a prefixed string representation of the EntityAddr, with different prefixes for each entity type.

    Returns

    The prefixed string representation, with "entity-system-", "entity-account-", or "entity-contract-" based on entity type.

    Returns string

  • Creates an EntityAddr from its JSON representation.

    Returns

    A new EntityAddr instance.

    Parameters

    • json: string

      The JSON string representation of the EntityAddr.

    Returns EntityAddr

  • Creates an EntityAddr from a prefixed string representation.

    Returns

    A new EntityAddr instance.

    Throws

    If the format is invalid.

    Parameters

    • source: string

      The prefixed string representation of the EntityAddr.

    Returns EntityAddr

Generated using TypeDoc