Class CLTypeResult

Represents a Result type in the Casper type system. This class implements the CLType interface, allowing for Result types with defined Ok and Err types.

Hierarchy

  • CLTypeResult

Implements

Constructors

Properties

innerErr: CLType

The CLType of the Err value in the Result.

innerOk: CLType

The CLType of the Ok value in the Result.

Methods

  • Converts the CLTypeResult instance to its byte representation. This includes the type ID for Result, followed by the byte representations of the Ok and Err types.

    Returns

    A Uint8Array representing the CLTypeResult.

    Returns Uint8Array

  • Converts the CLTypeResult instance to a JSON-compatible representation. The JSON object includes a "Result" key containing the JSON representations of the Ok and Err types.

    Returns

    A JSON object representing the Result type and its Ok and Err types.

    Returns {
        [key: string]: {
            err: CLType;
            ok: CLType;
        };
    }

  • Creates a CLTypeResult instance from a JSON representation. Parses JSON input to determine the Ok and Err types for the Result.

    Returns

    A new CLTypeResult instance with parsed Ok and Err types.

    Throws

    If the JSON structure is invalid.

    Parameters

    • source: any

      The JSON representation of the CLTypeResult.

    Returns CLTypeResult

Generated using TypeDoc