bitcore-wallet-service/lib/model/txproposalaction.js

24 lines
512 B
JavaScript
Raw Normal View History

2015-01-30 06:50:07 -08:00
'use strict';
function TxProposalAction(opts) {
2015-02-02 12:07:18 -08:00
opts = opts || {};
2015-01-30 06:50:07 -08:00
2015-02-02 12:07:18 -08:00
this.createdOn = Math.floor(Date.now() / 1000);
this.copayerId = opts.copayerId;
2015-02-05 10:50:18 -08:00
this.type = opts.type || (opts.signatures ? 'accept' : 'reject');
this.signatures = opts.signatures;
2015-01-30 06:50:07 -08:00
};
TxProposalAction.fromObj = function (obj) {
2015-02-02 12:07:18 -08:00
var x = new TxProposalAction();
2015-01-30 06:50:07 -08:00
2015-02-02 12:07:18 -08:00
x.createdOn = obj.createdOn;
x.copayerId = obj.copayerId;
x.type = obj.type;
2015-02-05 10:50:18 -08:00
x.signatures = obj.signatures;
2015-01-30 06:50:07 -08:00
2015-02-02 12:07:18 -08:00
return x;
2015-01-30 06:50:07 -08:00
};
module.exports = TxProposalAction;