Blockchain Commons Components TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class JSON

    A CBOR-tagged container for UTF-8 JSON text.

    Wraps UTF-8 JSON text as a CBOR byte string with tag 262. This allows JSON data to be embedded within CBOR structures while maintaining type information through the tag.

    Implements

    • CborTaggedEncodable
    • CborTaggedDecodable<JSON>
    Index

    Methods

    • Return the data as a UTF-8 string slice.

      Returns string

      Error if the data is not valid UTF-8.

    • Returns the CBOR tags associated with JSON.

      Returns Tag[]

    • Returns the untagged CBOR encoding (as a byte string).

      Returns Cbor

    • Returns the tagged CBOR encoding.

      Returns Cbor

    • Returns the tagged value in CBOR binary representation.

      Returns Uint8Array

    • Creates a JSON by decoding it from untagged CBOR.

      Parameters

      • cborValue: Cbor

      Returns JSON

    • Creates a JSON by decoding it from tagged CBOR.

      Parameters

      • cborValue: Cbor

      Returns JSON

    • Static method to decode from tagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns JSON

    • Static method to decode from untagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns JSON