UNPKG

xiot-core-spec-ts

Version:
20 lines (19 loc) 677 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OwnershipTakenCodec = void 0; const OwnershipTaken_1 = require("../../../typedef/notice/owner/impl/OwnershipTaken"); class OwnershipTakenCodec { static encode(x) { return { timestamp: x.timestamp, appId: x.appId, ownerId: x.ownerId, did: x.did }; } static decode(o) { const { appId = '', ownerId = '', userId = '', did = '' } = o; return new OwnershipTaken_1.OwnershipTaken(o.timestamp || new Date().getTime(), appId, ownerId, userId, did); } } exports.OwnershipTakenCodec = OwnershipTakenCodec;