@aptos-labs/ts-sdk - v7.4.0
    Preparing search index...

    Class FixedBytes

    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.

    const yourCustomSerializedBytes = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
    const fixedBytes = new FixedBytes(yourCustomSerializedBytes);
    const payload = await generateTransactionPayload({
    function: "0xbeefcafe::your_module::your_function_that_requires_custom_serialization",
    functionArguments: [yourCustomBytes],
    });

    This class is particularly useful when you want to handle a fixed-size byte array without the overhead of
    length prepending, such as when dealing with 32-byte addresses stored as U8 in a MoveVector<U8>.

    For example, if you store each of the 32 bytes for an address as a U8 in a MoveVector<U8>, when you
    serialize that MoveVector<U8>, it will be serialized to 33 bytes. If you solely want to pass around
    the 32 bytes as a Serializable class that *does not* prepend the length to the BCS-serialized representation,
    use this class.*

    HexInput representing a sequence of Uint8 bytes.

    A Serializable FixedBytes instance, which when serialized, does not prepend the length of the bytes.

    EntryFunctionBytes

    Hierarchy (View Summary)

    Implements

    Index
    value: Uint8Array