Optional
value: null | TSerialize an argument to BCS-serialized bytes.
Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
Static
BoolFactory method to generate a MoveOptionboolean
or undefined
.
Optional
value: null | booleana MoveOptionvalue
Static
deserializeStatic
MoveFactory method to generate a MoveOptionstring
or undefined
.
Optional
value: null | stringa MoveOptionvalue
MoveOption.MoveString("hello").isSome() === true;
MoveOption.MoveString("").isSome() === true;
MoveOption.MoveString().isSome() === false;
MoveOption.MoveString(undefined).isSome() === false;
value: the value used to fill the MoveOption. If value
is undefined
the resulting MoveOption's .isSome() method will return false.
Static
U128Factory method to generate a MoveOptionnumber
or a bigint
or undefined
.
Optional
value: null | AnyNumbera MoveOptionvalue
Static
U16Factory method to generate a MoveOptionnumber
or undefined
.
Optional
value: null | numbera MoveOptionvalue
Static
U256Factory method to generate a MoveOptionnumber
or a bigint
or undefined
.
Optional
value: null | AnyNumbera MoveOptionvalue
Static
U32Factory method to generate a MoveOptionnumber
or undefined
.
Optional
value: null | numbera MoveOptionvalue
Static
U64Factory method to generate a MoveOptionnumber
or a bigint
or undefined
.
Optional
value: null | AnyNumbera MoveOptionvalue
Static
U8Factory method to generate a MoveOptionnumber
or undefined
.
Optional
value: null | numbera MoveOptionvalue
Serializes a
Serializable
value to its BCS representation. This function is the Typescript SDK equivalent ofbcs::to_bytes
in Move.