Class CLTypeByteArray

Represents a fixed-size ByteArray type within the Casper type system. This class allows for defining a ByteArray with a specific size, and includes methods to handle its serialization, string representation, and conversion to JSON format.

Hierarchy

  • CLTypeByteArray

Implements

Constructors

Properties

size: number

Methods

  • Converts the CLTypeByteArray instance into a byte representation. This includes the type ID and the size of the byte array.

    Returns

    A Uint8Array that represents the CLTypeByteArray.

    Returns Uint8Array

  • Converts the CLTypeByteArray instance to a JSON-compatible representation. The JSON object contains a single key-value pair, where the key is "ByteArray" and the value is the size of the array.

    Returns

    An object with the ByteArray size.

    Returns {
        [key: string]: number;
    }

    • [key: string]: number
  • Constructs a CLTypeByteArray instance from a JSON representation.

    Returns

    A new CLTypeByteArray instance.

    Throws

    Will throw an error if the input type is not a number.

    Parameters

    • source: any

      The JSON input containing the size of the ByteArray.

    Returns CLTypeByteArray

Generated using TypeDoc