diff --git a/lib/model/index.js b/lib/model/index.js index e67a537..0230138 100644 --- a/lib/model/index.js +++ b/lib/model/index.js @@ -10,5 +10,6 @@ Model.Email = require('./email'); Model.TxNote = require('./txnote'); Model.Session = require('./session'); Model.PushNotificationSub = require('./pushnotificationsub'); +Model.TxConfirmationSub = require('./txconfirmationsub'); module.exports = Model; diff --git a/lib/model/txconfirmationsub.js b/lib/model/txconfirmationsub.js new file mode 100644 index 0000000..969f390 --- /dev/null +++ b/lib/model/txconfirmationsub.js @@ -0,0 +1,30 @@ +'use strict'; + +function TxConfirmationSub() {}; + +TxConfirmationSub.create = function(opts) { + opts = opts || {}; + + var x = new TxConfirmationSub(); + + x.version = 1; + x.createdOn = Math.floor(Date.now() / 1000); + x.copayerId = opts.copayerId; + x.txid = opts.txid; + x.isActive = true; + return x; +}; + +TxConfirmationSub.fromObj = function(obj) { + var x = new TxConfirmationSub(); + + x.version = obj.version; + x.createdOn = obj.createdOn; + x.copayerId = obj.copayerId; + x.txid = obj.txid; + x.isActive = obj.isActive; + return x; +}; + + +module.exports = TxConfirmationSub;