Gets the offset to start deserializing from.
the offset
This method adds an argument to the serialized byte array if the argument is an
instance of a handled type (bool, String of u32.MAX_VALUE characters maximum,
Uint8Array, StaticArray
the argument to add
the modified Arg instance
If the type of the object to add isn't handled, it returns an error message: "args doesn't know how to serialize the given type."
This method adds an array of elements that implement Serializable
.
the argument to add
the modified Arg instance
This will perform a deep copy of your objects thanks to the serialize
method you define in your class.
Deserializes a boolean from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing false and an error message: "can't deserialize bool from given argument: out of range".
Deserializes a bytes array from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing an empty StaticArray of u8 and an error message: "can't deserialize bytes from given argument: out of range". In this case, the offset will not be changed.
Deserializes an F32 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize f32 from given argument: out of range".
Deserializes an f64 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize f64 from given argument: out of range".
Deserializes an array of fixed size elements starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result object containing an empty array and an error message: "can't deserialize length of array from given argument". In this case, the offset will not be changed.
Deserializes an i16 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize i16 from given argument: out of range".
Deserializes an i256 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize i256 from given argument: out of range".
Deserializes an i32 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize i32 from given argument: out of range".
Deserializes an I64 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize i64 from given argument: out of range".
Deserialize an object by calling its deserialize
method.
a Result object:
If the deserialization failed, it returns a Result containing the object and an error message: "Can't deserialize object " + type of the object.
Deserializes an array of serializable objects from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing an empty array and an error message: "can't deserialize length of array from given argument".
Deserializes a string from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result object containing an empty string and an error message: "can't deserialize string from given argument: out of range". In this case, the offset will not be changed.
Deserializes an array of strings starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result object containing an empty array and an error message: "can't deserialize length of array from given argument". In this case, the offset will not be changed.
Deserializes an U128 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize u128 from given argument: out of range".
Deserializes an u16 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize u16 from given argument: out of range".
Deserializes an u256 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize u256 from given argument: out of range".
Deserializes an u32 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize u32 from given argument: out of range".
Deserializes an U64 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize u64 from given argument: out of range".
Deserializes an u8 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing 0 and an error message: "can't deserialize u8 from given argument: out of range".
Deserializes an array of u8 from a serialized array starting from the current offset.
a Result object:
If the deserialization failed, it returns a Result containing an empty Uint8Array and an error message: "can't deserialize Uint8Array from given argument: out of range".
Generated using TypeDoc
Args for remote function call.
Remarks
This class can serialize assembly script native types into bytes, in order to make smart-contract function call easier.
In a smart-contract exposed function, use this class to deserialize the string argument, using the
next...
methods.In a smart-contract, to call another smart-contract function, use this class to serialize the arguments you want to pass to the smart-contract function call.