Constructor to either serialize or deserialize data passed from/to DApps and remote Smart contracts.
Optional
serialized: number[] | Uint8ArrayThe optional serialized arguments to deserialize.
Optional
offset: numberThe optional offset to start deserializing from.
Private
argsPrivate
getReturns the data of requested size for current offset
The data size
the slice of the serialized internal buffer
Private
offsetPrivate
serializedAdds an array of objects to the serialized arguments.
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.
the serialized arguments to be able to chain add
method calls.
the argument to add
Adds a serializable object to the serialized arguments.
The object must implement the ISerializable interface
the serialized arguments to be able to chain add
method calls.
the object to add
Adds an array of serializable objects to the serialized arguments.
Each object must implement the ISerializable interface. This will perform a deep copy of your objects thanks to the serialize method you define in your class.
the serialized arguments to be able to chain add
method calls.
the argument to add
Adds a string to the serialized arguments.
Works only if the argument is an instance of a handled type (String of 4294967295 characters maximum)
the serialized arguments to be able to chain add
method calls.
the number to add.
Returns the next array of ArgTypes objects in the serialized byte array
Increments to offset to point the data after the one that as been deserialized in the byte array.
the next array of object that are native type
the type of the elements in the array.
Returns the next ISerializable object in the serialized byte array
Increments to offset to point the data after the one that as been deserialized in the byte array.
the deserialized object T
the class constructor prototype T.prototype
Returns the next array of ISerializable objects in the serialized byte array
Increments to offset to point the data after the one that as been deserialized in the byte array.
the deserialized array of object that implement ISerializable
the class constructor prototype T.prototype
Static
concatGenerated using TypeDoc
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.