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 898 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decodeCredential = exports.encodeCredential = void 0; const vc = require("@digitalcredentials/vc"); const klayr_sdk_1 = require("klayr-sdk"); const klayr_decentralized_identifier_1 = require("@klayr-did/klayr-decentralized-identifier"); function encodeCredential(unserializedVC) { const credential = klayr_sdk_1.utils.objects.cloneDeep(unserializedVC); vc._checkCredential({ credential }); return klayr_decentralized_identifier_1.utils.object.encodeJSON(credential); } exports.encodeCredential = encodeCredential; function decodeCredential(serializedVC) { const credential = klayr_decentralized_identifier_1.utils.object.decodeJSON(serializedVC); vc._checkCredential({ credential }); return credential; } exports.decodeCredential = decodeCredential; //# sourceMappingURL=credentials.js.map