Class ByteCode

Represents a byte code in the system, providing support for V1 Casper WASM or an empty byte code.

Hierarchy

  • ByteCode

Constructors

  • Constructs a new ByteCode instance.

    Parameters

    • Optional V1CasperWasm: Hash

      The hash representing V1 Casper WASM byte code.

    • isEmpty: boolean = false

      Whether the byte code is empty. Default is false.

    Returns ByteCode

Properties

V1CasperWasm?: Hash
isEmpty: boolean

Methods

  • Determines if the ByteCode instance represents an empty byte code.

    Returns

    True if the byte code is empty; otherwise, false.

    Returns boolean

  • Converts the ByteCode instance to a byte array representation.

    Returns

    The byte array representation of the ByteCode.

    Throws

    Error if the ByteCode type is unexpected.

    Returns Uint8Array

  • Converts the ByteCode instance to its JSON string representation.

    Returns

    The JSON string representation of the ByteCode.

    Returns string

  • Returns a prefixed string representation of the ByteCode.

    Returns

    A prefixed string based on the byte code type.

    Throws

    Error if the ByteCode type is unexpected.

    Returns string

  • Creates a ByteCode from a JSON string representation.

    Returns

    A new ByteCode instance.

    Throws

    ByteCodeError.ErrInvalidByteCodeFormat if the format is invalid.

    Parameters

    • data: string

      The JSON string representation of the ByteCode.

    Returns ByteCode

  • Converts a byte to its corresponding ByteCodeKind.

    Returns

    The corresponding ByteCodeKind.

    Throws

    ByteCodeError.ErrInvalidByteCodeKind if the byte doesn't match a valid ByteCodeKind.

    Parameters

    • tag: number

      The byte to convert.

    Returns ByteCodeKind

Generated using TypeDoc