Serializes a Serializable value to its BCS representation.
This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
Converts the BCS-serialized bytes of a value into a Hex instance. This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
Check if the MoveOption has a value.
Returns true if there is exactly one value in the MoveOption.
Retrieves the inner value of the MoveOption.
This method is inspired by Rust's Option<T>.unwrap(), where attempting to unwrap a None value results in a panic.
This method will throw an error if the value is not present.
The contained value if present.
StaticBoolFactory method to generate a MoveOptionboolean or undefined.
Optionalvalue: null | booleanthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticMoveFactory method to generate a MoveOptionstring or undefined.
Optionalvalue: null | stringthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU128Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: null | AnyNumberthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU16Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: null | numberthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU256Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: null | AnyNumberthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU32Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: null | numberthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU64Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: null | AnyNumberthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU8Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: null | numberthe value used to fill the MoveOption. If value is undefined
the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
Serialize an argument to BCS-serialized bytes.
The serializer instance used for serialization.
Serialize 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.
The serializer used to convert the argument.
Optionalvalue: null | TReturns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Staticdeserialize
Represents an argument for entry functions, providing methods to serialize the argument to BCS-serialized bytes and convert it to different formats.