Creates an instance of the class with a specified hexadecimal input. The value is converted from hexadecimal format to a Uint8Array.
The hexadecimal input to be converted.
Serializes the fixed bytes value using the provided serializer. This function is essential for converting the fixed bytes into a format suitable for storage or transmission.
The serializer instance used for serialization.
Serializes the current instance for an entry function using the provided serializer. This allows the instance to be converted into a format suitable for transmission or storage.
The serializer used to perform the serialization.
Serializes the current instance using the provided serializer. This function is essential for preparing data to be passed as arguments in script functions.
The serializer instance used to perform the serialization.
Static
deserializeDeserializes a fixed-length byte array from the provided deserializer. This function helps in reconstructing a FixedBytes object from the serialized data.
The deserializer instance used to read the byte data.
The length of the byte array to be deserialized.
Represents a contiguous sequence of already serialized BCS bytes.
This class differs from most other Serializable classes in that its internal byte buffer is serialized to BCS bytes exactly as-is, without prepending the length of the bytes. It is ideal for scenarios where custom serialization is required, such as passing serialized bytes as transaction arguments. Additionally, it serves as a representation of type-agnostic BCS bytes, akin to a vector.
An example use case includes handling bytes resulting from entry function arguments that have been serialized for an entry function.
Example
Param: value
HexInput representing a sequence of Uint8 bytes.
Returns
A Serializable FixedBytes instance, which when serialized, does not prepend the length of the bytes.
See
EntryFunctionBytes