Class TransactionRuntime

Represents a runtime environment for Casper transactions. This class distinguishes between different versions of the Casper Virtual Machine (VM).

Hierarchy

  • TransactionRuntime

Constructors

Properties

_tag: number = TransactionRuntime.VM_CASPER_V1_TAG

The tag used to identify the current VM version.

TAG_FIELD_INDEX: 0 = 0

The index of the field used for tag serialization.

VM_CASPER_V1_TAG: 0 = 0

Internal tag representing Casper VM Version 1.

VM_CASPER_V2_TAG: 1 = 1

Internal tag representing Casper VM Version 2.

Methods

  • Serializes the current TransactionRuntime to a byte array.

    Returns

    A Uint8Array containing the serialized transaction runtime data.

    Returns Uint8Array

  • Serializes the current TransactionRuntime to a JSON string.

    Returns

    A JSON string representing the type of the transaction runtime.

    Throws

    Will throw an error if the tag does not match known VM versions.

    Returns string

  • Creates an instance of TransactionRuntime from a JSON string.

    Returns

    A TransactionRuntime instance matching the specified type.

    Throws

    Will throw an error if the provided JSON does not match known VM versions.

    Parameters

    • json: string

      The JSON string representing the type of the transaction runtime.

    Returns TransactionRuntime

Generated using TypeDoc