From b0e23e6952fcaae454cbcfccbd78fcc7d7b14d72 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Tue, 27 Jan 2015 16:40:27 -0300 Subject: [PATCH] . --- lib/model/txproposal.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/model/txproposal.js diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js new file mode 100644 index 0000000..deb81c3 --- /dev/null +++ b/lib/model/txproposal.js @@ -0,0 +1,26 @@ +'use strict'; + +function TxProposal(opts) { + opts = opts || {}; + + this.creatorId = opts.creatorId; + this.toAddress = opts.toAddress; + this.amount = opts.amount; + this.changeAddress = opts.changeAddress; + this.inputs = opts.inputs; +}; + +TxProposal.fromObj = function (obj) { + var x = new TxProposal(); + + x.creatorId = obj.creatorId; + x.toAddress = obj.toAddress; + x.amount = obj.amount; + x.changeAddress = obj.changeAddress; + x.inputs = obj.inputs; + x.raw = obj.raw; + + return x; +}; + +module.exports = TxProposal;