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.

Hierarchy

  • Args

Constructors

  • Constructor to either serialize or deserialize data passed from/to DApps and remote Smart contracts.

    Parameters

    • Optional serialized: number[] | Uint8Array

      The optional serialized arguments to deserialize.

    • Optional offset: number

      The optional offset to start deserializing from.

    Returns utils.arguments.Args

Properties

argsList: any
getNextData: any

Returns the data of requested size for current offset

Param

The data size

Returns

the slice of the serialized internal buffer

offset: any
serialized: any

Methods

  • Adds a boolean to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • value: boolean

      the boolean to add.

    Returns utils.arguments.Args

  • Adds a floating number to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • value: number

      the number to add.

    Returns utils.arguments.Args

  • Adds a long floating number to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • value: number

      the number to add.

    Returns utils.arguments.Args

  • Adds a signed integer to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • value: number

      the number to add.

    Returns utils.arguments.Args

  • Adds a signed long integer to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • bigInt: bigint

    Returns utils.arguments.Args

  • Adds a serializable object to the serialized arguments.

    Remarks

    The object must implement the ISerializable interface

    See

    ISerializable

    Returns

    the serialized arguments to be able to chain add method calls.

    Type Parameters

    • T

    Parameters

    Returns utils.arguments.Args

  • Adds an array of serializable objects to the serialized arguments.

    Remarks

    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.

    See

    ISerializable

    Returns

    the serialized arguments to be able to chain add method calls.

    Type Parameters

    Parameters

    • arg: T[]

      the argument to add

    Returns utils.arguments.Args

  • Adds a string to the serialized arguments.

    Remarks

    Works only if the argument is an instance of a handled type (String of 4294967295 characters maximum)

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • value: string

      the number to add.

    Returns utils.arguments.Args

  • Adds an unsigned long integer to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • bigInt: bigint

    Returns utils.arguments.Args

  • Adds an unsigned long integer to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • bigInt: bigint

    Returns utils.arguments.Args

  • Adds an unsigned integer to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • value: number

      the number to add.

    Returns utils.arguments.Args

  • Adds an unsigned long integer to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • bigInt: bigint

    Returns utils.arguments.Args

  • Adds a unsigned byte to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • value: number

      the number to add.

    Returns utils.arguments.Args

  • Adds a byte array integer to the serialized arguments.

    Returns

    the serialized arguments to be able to chain add method calls.

    Parameters

    • array: Uint8Array

      the array to add.

    Returns utils.arguments.Args

  • Returns the current deserialization offset of the serialized byte array.

    Returns

    the current offset

    Returns number

  • Returns the next array of ArgTypes objects in the serialized byte array

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the next array of object that are native type

    Type Parameters

    • T

    Parameters

    Returns T[]

  • Returns the next boolean in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized boolean.

    Returns boolean

  • Returns the next floating number in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns number

  • Returns the next long floating number in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns number

  • Returns the next signed integer in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns number

  • Returns the next signed long integer in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns bigint

  • Returns the next ISerializable object in the serialized byte array

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized object T

    Type Parameters

    Parameters

    • ctor: (new () => T)

      the class constructor prototype T.prototype

        • new (): T
        • Returns T

    Returns T

  • Returns the next array of ISerializable objects in the serialized byte array

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized array of object that implement ISerializable

    Type Parameters

    Parameters

    • ctor: (new () => T)

      the class constructor prototype T.prototype

        • new (): T
        • Returns T

    Returns T[]

  • Returns the next string in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized string

    Returns string

  • Returns the next uint128 in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns bigint

  • Returns the next uint256 in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns bigint

  • Returns the next unsigned integer in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number

    Returns number

  • Returns the next long integer in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns bigint

  • Returns the next unsigned byte in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized number.

    Returns bigint

  • Returns the next sub byte array in the serialized byte array.

    Remarks

    Increments to offset to point the data after the one that as been deserialized in the byte array.

    Returns

    the deserialized byte array.

    Returns Uint8Array

  • Returns the serialized byte array.

    Returns

    A byte array.

    Returns number[]

  • Internal function to concat to Uint8Array.

    Returns

    the concatenated array

    Parameters

    • a: Uint8Array

      first array to concat

    • b: Uint8Array

      second array to concat

    Returns Uint8Array

Generated using TypeDoc