Constructs a new instance with a specified value. This ensures that the value is validated to be within the acceptable range.
The number to be validated and assigned, which must be between 0 and MAX_U256_BIG_INT.
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.
Deserializes a U256 value from the provided deserializer.
The deserializer instance used to read the U256 data.
Serializes the value using the provided serializer. This function is essential for converting the value into a format suitable for transmission or storage.
The serializer instance used to perform the serialization.
Serializes the current instance for use in an entry function by converting it to a byte sequence. This allows the instance to be properly formatted for serialization in transactions.
The serializer instance used to serialize the byte sequence.
Serializes the current instance for use in a script function. This allows for the conversion of the instance into a format suitable for transmission or storage.
The serializer used to perform the serialization.
Returns 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.
Static
deserialize
Represents a boolean value that can be serialized and deserialized. This class extends the Serializable class and provides methods to serialize the boolean value for different contexts, such as entry functions and script functions.