From fc8d9d6f9243eb67536c418e110ffe63421e9cba Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 25 Mar 2015 16:44:47 -0300 Subject: [PATCH 1/3] add paypro to createTx --- lib/server.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/server.js b/lib/server.js index 40d7a0b..dc43cc4 100644 --- a/lib/server.js +++ b/lib/server.js @@ -351,13 +351,13 @@ WalletService.prototype._getBlockExplorer = function(provider, network) { return this.blockExplorer; switch (provider) { - default: + default:; case 'insight': switch (network) { default: - case 'livenet': + case 'livenet': url = 'https://insight.bitpay.com:443'; - break; + break; case 'testnet': url = 'https://test-insight.bitpay.com:443' break; @@ -535,14 +535,14 @@ WalletService.prototype._selectTxInputs = function(txp, cb) { }); }; - /** * Creates a new transaction proposal. * @param {Object} opts * @param {string} opts.toAddress - Destination address. * @param {number} opts.amount - Amount to transfer in satoshi. * @param {string} opts.message - A message to attach to this transaction. - * @param {string} opts.proposalSignature - S(toAddress|amount|message). Used by other copayers to verify the proposal. + * @param {string} opts.proposalSignature - S(toAddress|amount|message|payProUrl). Used by other copayers to verify the proposal. + * @param {string} opts.payProUrl - Options: Paypro URL for peers to verify TX * @returns {TxProposal} Transaction proposal. */ WalletService.prototype.createTx = function(opts, cb) { @@ -585,6 +585,7 @@ WalletService.prototype.createTx = function(opts, cb) { amount: opts.amount, message: opts.message, proposalSignature: opts.proposalSignature, + payProUrl: opts.payProUrl, changeAddress: changeAddress, requiredSignatures: wallet.m, requiredRejections: Math.min(wallet.m, wallet.n - wallet.m + 1), From 8b4a946497ded19d59e38ce5c9c3aa30eb777a86 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 26 Mar 2015 17:52:59 -0300 Subject: [PATCH 2/3] add payproUrl to model --- lib/model/txproposal.js | 2 ++ lib/server.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js index 2f6ca79..025ada5 100644 --- a/lib/model/txproposal.js +++ b/lib/model/txproposal.js @@ -24,6 +24,7 @@ TxProposal.create = function(opts) { x.toAddress = opts.toAddress; x.amount = opts.amount; x.message = opts.message; + x.payProUrl = opts.payProUrl; x.proposalSignature = opts.proposalSignature; x.changeAddress = opts.changeAddress; x.inputs = []; @@ -48,6 +49,7 @@ TxProposal.fromObj = function(obj) { x.toAddress = obj.toAddress; x.amount = obj.amount; x.message = obj.message; + x.payProUrl = obj.payProUrl; x.proposalSignature = obj.proposalSignature; x.changeAddress = obj.changeAddress; x.inputs = obj.inputs; diff --git a/lib/server.js b/lib/server.js index dc43cc4..6a2ebaa 100644 --- a/lib/server.js +++ b/lib/server.js @@ -557,7 +557,7 @@ WalletService.prototype.createTx = function(opts, cb) { if (!wallet.isComplete()) return cb(new ClientError('Wallet is not complete')); var copayer = wallet.getCopayer(self.copayerId); - var hash = WalletUtils.getProposalHash(opts.toAddress, opts.amount, opts.message); + var hash = WalletUtils.getProposalHash(opts.toAddress, opts.amount, opts.message, opts.payProUrl); if (!self._verifySignature(hash, opts.proposalSignature, copayer.requestPubKey)) return cb(new ClientError('Invalid proposal signature')); From 329f5dee414542387b012b392721b95f929c0809 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 26 Mar 2015 17:55:25 -0300 Subject: [PATCH 3/3] v0.0.15 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index db3ff0a..b538c9b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "bitcore-wallet-service", "description": "A service for Mutisig HD Bitcoin Wallets", "author": "BitPay Inc", - "version": "0.0.14", + "version": "0.0.15", "keywords": [ "bitcoin", "copay", @@ -19,7 +19,7 @@ }, "dependencies": { "async": "^0.9.0", - "bitcore-wallet-utils": "^0.0.6", + "bitcore-wallet-utils": "^0.0.7", "bitcore-explorers": "^0.9.1", "body-parser": "^1.11.0", "coveralls": "^2.11.2",