xiot-core-spec-ts
Version:
XIOT Specification Codec
20 lines (19 loc) • 709 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OwnerDeviceRemovedCodec = void 0;
const OwnerDeviceRemoved_1 = require("../../../typedef/notice/owner/impl/OwnerDeviceRemoved");
class OwnerDeviceRemovedCodec {
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 OwnerDeviceRemoved_1.OwnerDeviceRemoved(o.timestamp || new Date().getTime(), appId, ownerId, userId, did);
}
}
exports.OwnerDeviceRemovedCodec = OwnerDeviceRemovedCodec;