Optional anyOptional boolOptional byteOptional i32Optional i64Optional keyOptional listOptional mapOptional optionOptional publicOptional resultOptional stringOptional tuple1Optional tuple2Optional tuple3Optional ui128Optional ui256Optional ui32Optional ui512Optional ui64Optional ui8Optional unitOptional urefPrivate getStatic newCLAnyStatic newCLByteStatic newCLInt32Static newCLInt64Static newCLKeyStatic newCLListStatic newCLMapStatic newCLOptionCreates a new CLValue instance that represents an optional value.
This method allows you to wrap a given CLValue as an optional type (Option),
which can either contain a value or be null. This is useful for scenarios where
a value may or may not be present.
If inner is null, the method will use the provided clType as the type of the option.
If clType is not provided, it defaults to CLTypeAny. If inner is not null,
its type is used instead of clType.
A new CLValue instance containing:
CLTypeOption representing the type of the optional value.CLValueOption that holds the inner value or null.// Example of an option containing a value
const innerValue = CLValue.fromU32(42);
const optionValue = CLValue.newCLOption(innerValue);
// Example of an empty option with an explicitly defined type
const emptyOptionValue = CLValue.newCLOption(null, CLType.U32);
// Example of an empty option with no type provided (defaults to CLTypeAny)
const emptyOptionValueDefault = CLValue.newCLOption(null);
Static newCLPublicStatic newCLResultStatic newCLStringStatic newCLTuple1Static newCLTuple2Static newCLTuple3Static newCLUInt128Static newCLUInt256Static newCLUInt32Static newCLUInt512Static newCLUint64Static newCLUint8Static newCLUnitStatic newCLUrefStatic newCLValueGenerated using TypeDoc
Represents a CLValue in the Casper type system. CLValue is a container for various types of values used in smart contracts.