UNPKG

@klayr-did/klayr-verifiable-credentials

Version:

A library for working with W3C verifiable credentials (VC) and verifiable presentations (VP) using Klayr DID

19 lines 923 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decodePresentation = exports.encodePresentation = void 0; const vc = require("@digitalcredentials/vc"); const klayr_decentralized_identifier_1 = require("@klayr-did/klayr-decentralized-identifier"); const klayr_sdk_1 = require("klayr-sdk"); function encodePresentation(unserializedVP) { const presentation = klayr_sdk_1.utils.objects.cloneDeep(unserializedVP); vc._checkPresentation(presentation); return klayr_decentralized_identifier_1.utils.object.encodeJSON(presentation); } exports.encodePresentation = encodePresentation; function decodePresentation(serializedVP) { const presentation = klayr_decentralized_identifier_1.utils.object.decodeJSON(serializedVP); vc._checkPresentation(presentation); return presentation; } exports.decodePresentation = decodePresentation; //# sourceMappingURL=presentation.js.map