Class TransactionInvocationTarget

Represents a transaction invocation target, which can be one of the following:

  • By hash
  • By name
  • By package hash
  • By package name

Hierarchy

  • TransactionInvocationTarget

Constructors

Properties

byHash?: Hash

Invocation target by hash, if specified.

byName?: string

Invocation target by name, if specified.

Invocation target by package hash, if specified.

Invocation target by package name, if specified.

Methods

  • Deserializes a Uint8Array into a TransactionInvocationTarget instance.

    This method reconstructs a TransactionInvocationTarget object from its serialized byte array representation. The type of invocation target is determined by the tag extracted from the serialized data.

    Returns

    A deserialized TransactionInvocationTarget instance.

    Throws

    Error - If the byte array is invalid, missing required fields, or contains an unrecognized tag.

    Tags and Their Associated Targets:

    • 0: Represents an invocation target identified by a hash (ByHash).
    • 1: Represents an invocation target identified by a name (ByName).
    • 2: Represents an invocation target identified by a package hash and an optional version (ByPackageHash).
    • 3: Represents an invocation target identified by a package name and an optional version (ByPackageName).

    Example

    const bytes = new Uint8Array([...]); // Provide valid TransactionInvocationTarget bytes
    const invocationTarget = TransactionInvocationTarget.fromBytes(bytes);
    console.log(invocationTarget); // Parsed TransactionInvocationTarget instance

    Parameters

    • bytes: Uint8Array

      The serialized byte array representing a TransactionInvocationTarget.

    Returns TransactionInvocationTarget

Generated using TypeDoc