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.
NOTE: This function will only work when the inner values in the MoveVector
are U8
s.
Static
BoolFactory method to generate a MoveVector of Bools from an array of booleans.
a MoveVector<Bool>
Static
deserializeDeserialize a MoveVector of type T, specifically where T is a Serializable and Deserializable type.
NOTE: This only works with a depth of one. Generics will not work.
NOTE: This will not work with types that aren't of the Serializable class.
If you're looking for a more flexible deserialization function, you can use the deserializeVector function in the Deserializer class.
a MoveVector of the corresponding class T *
Static
MoveFactory method to generate a MoveVector of MoveStrings from an array of strings.
a MoveVector<MoveString>
Static
U128Factory method to generate a MoveVector of U128s from an array of numbers or bigints.
a MoveVector<U128>
Static
U16Factory method to generate a MoveVector of U16s from an array of numbers.
a MoveVector<U16>
Static
U256Factory method to generate a MoveVector of U256s from an array of numbers or bigints.
a MoveVector<U256>
Static
U32Factory method to generate a MoveVector of U32s from an array of numbers.
a MoveVector<U32>
Static
U64Factory method to generate a MoveVector of U64s from an array of numbers or bigints.
a MoveVector<U64>
Static
U8Factory method to generate a MoveVector of U8s from an array of numbers.
a MoveVector<U8>
This class is the Aptos Typescript SDK representation of a Move
vector<T>
, whereT
represents either a primitive type (bool
,u8
,u64
, ...) or a BCS-serializable struct itself.It is a BCS-serializable, array-like type that contains an array of values of type
T
, whereT
is a class that implementsSerializable
.The purpose of this class is to facilitate easy construction of BCS-serializable Move
vector<T>
types.Example
Params
values: an Array of values where T is a class that implements Serializable
Returns
a
MoveVector<T>
with the valuesvalues