Define a schema to encode / decode convert type T to type E.

Hierarchy (view full)

Constructors

Methods

  • Decodes the encoded data using the schema.

    Parameters

    • encoded: Uint8Array
    • Optionalvalidate: boolean

    Returns StatusMessage

  • Parameters

    • bytes: Uint8Array

    Returns {
        generalStatus: number;
        protocolId: number;
        protocolStatus: number;
        remainingBytes: undefined | Uint8Array;
    }

    • generalStatus: number
    • protocolId: number
    • protocolStatus: number
    • remainingBytes: undefined | Uint8Array
  • Encodes the value using the schema.

    Parameters

    Returns Uint8Array

  • Parameters

    Returns Uint8Array

  • Optional validator that can be used to enforce constraints on the data before encoding / after decoding.

    Parameters

    Returns void