Function registerCBORDecoder

  • Registers a CBOR decoder for tag 24 (encoded-cbor-data-item) with the cbor2 library. This enables automatic decoding of CBOR data containing a Memo when using the cbor2 library's decode function.

    Returns

    A cleanup function that, when called, will restore the previous decoder (if any) that was registered for the tagged-address format. This is useful when used in an existing cbor2 use-case.

    Example

    // Register the decoder
    const cleanup = registerCBORDecoder();
    // Use the decoder
    const memo = decode(cborBytes); // Returns Memo if format matches
    // Later, unregister the decoder
    cleanup();

    Returns (() => void)

      • (): void
      • Returns void

Generated using TypeDoc