Constructor to either serialize or deserialize data passed from/to DApps and remote Smart contracts.
The optional serialized arguments to deserialize.
The optional offset to start deserializing from.
Private
argsThe optional offset to start deserializing from.
The optional serialized arguments to deserialize.
Adds an array of objects to the serialized arguments.
the argument to add
the serialized arguments to be able to chain add
method calls.
If the type of the values of the array is not native type, this will serialize the pointers, which is certainly
not what you want! You can only serialize properly array of native types or array of Serializable
object.
Adds a serializable object to the serialized arguments.
the object to add
the serialized arguments to be able to chain add
method calls.
Adds an array of serializable objects to the serialized arguments.
the argument to add
the serialized arguments to be able to chain add
method calls.
Each object must implement the ISerializable interface. This will perform a deep copy of your objects thanks to the ISerializable.serialize method you define in your class.
Private
getReturns the next array of ArgTypes objects in the serialized byte array
the type of the elements in the array.
the next array of object that are native type
Increments to offset to point the data after the one that as been deserialized in the byte array.
Private
nextReturns the next ISerializable object in the serialized byte array
the deserialized object T
Increments to offset to point the data after the one that as been deserialized in the byte array.
Returns the next array of ISerializable objects in the serialized byte array
the deserialized array of object that implement ISerializable
Increments to offset to point the data after the one that as been deserialized in the byte array.
Static
concat
Storage and serialization class for remote function call arguments.
Remarks
This class can serialize typescript native types into bytes, in order to make smart-contract function call easier. It also can deserialize bytes.