Class CLValueList

Represents a List value in the Casper type system. This class provides methods to manage and manipulate lists of CLValues.

Hierarchy

  • CLValueList

Constructors

Properties

elements: CLValue[]

The elements contained in the list.

The type of the list elements.

Methods

  • Converts the list to its byte representation, including the length and each element's bytes.

    Returns

    A Uint8Array representing the bytes of the list.

    Returns Uint8Array

  • Gets the element at the specified index.

    Returns

    The CLValue at the specified index.

    Throws

    Error if the index is out of bounds.

    Parameters

    • index: number

      The index of the element to get.

    Returns CLValue

  • Checks if the list is empty.

    Returns

    true if the list is empty, false otherwise.

    Returns boolean

  • Removes and returns the last element from the list.

    Returns

    The last element of the list, or undefined if the list is empty.

    Returns undefined | CLValue

  • Removes an element from the list at the specified index.

    Parameters

    • index: number

      The index of the element to remove.

    Returns void

  • Sets the element at the specified index.

    Throws

    Error if the index is out of bounds.

    Parameters

    • index: number

      The index at which to set the element.

    • item: CLValue

      The CLValue to set at the specified index.

    Returns void

  • Returns the number of elements in the list.

    Returns

    The number of elements in the list.

    Returns number

  • Converts the list to a JSON-compatible representation.

    Returns

    An array of string representations of the list elements.

    Returns string[]

  • Provides a string representation of the list.

    Returns

    A string in the format "[elem1, elem2, ...]".

    Returns string

  • Creates a CLValueList instance from a Uint8Array. Parses the byte array to interpret the length of the list and each element in the list.

    Returns

    An object containing the new CLValueList instance and any remaining bytes.

    Parameters

    • source: Uint8Array

      The Uint8Array containing the byte representation of the List value.

    • clType: CLTypeList

      The CLTypeList representing the type of the list.

    Returns IResultWithBytes<CLValueList>

Generated using TypeDoc