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.
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.
Returns 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.
Returns 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
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.