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 U8s.
StaticBoolFactory method to generate a MoveVector of Bools from an array of booleans.
a MoveVector<Bool>
StaticdeserializeDeserialize 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 *
StaticMoveFactory method to generate a MoveVector of MoveStrings from an array of strings.
a MoveVector<MoveString>
StaticU128Factory method to generate a MoveVector of U128s from an array of numbers or bigints.
a MoveVector<U128>
StaticU16Factory method to generate a MoveVector of U16s from an array of numbers.
a MoveVector<U16>
StaticU256Factory method to generate a MoveVector of U256s from an array of numbers or bigints.
a MoveVector<U256>
StaticU32Factory method to generate a MoveVector of U32s from an array of numbers.
a MoveVector<U32>
StaticU64Factory method to generate a MoveVector of U64s from an array of numbers or bigints.
a MoveVector<U64>
StaticU8Factory 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>, whereTrepresents 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, whereTis 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