bitcore-wallet-service
Version:
A service for Mutisig HD Bitcoin Wallets
36 lines • 1.26 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Notification = void 0;
const lodash_1 = __importDefault(require("lodash"));
class Notification {
static create(opts) {
opts = opts || {};
const x = new Notification();
x.version = '1.0.0';
const now = Date.now();
x.createdOn = Math.floor(now / 1000);
x.id = lodash_1.default.padStart(now.toString(), 14, '0') + lodash_1.default.padStart(opts.ticker || 0, 4, '0');
x.type = opts.type || 'general';
x.data = opts.data;
x.walletId = opts.walletId;
x.creatorId = opts.creatorId;
x.isCreator = opts.isCreator;
return x;
}
static fromObj(obj) {
const x = new Notification();
x.version = obj.version;
x.createdOn = obj.createdOn;
x.id = obj.id;
(x.type = obj.type), (x.data = obj.data);
x.walletId = obj.walletId;
x.creatorId = obj.creatorId;
x.isCreator = obj.isCreator;
return x;
}
}
exports.Notification = Notification;
//# sourceMappingURL=notification.js.map