|
|
@ -134,7 +134,7 @@ ClientLib.prototype.createWallet = function(walletName, copayerName, m, n, netwo |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
ClientLib.prototype._joinWallet = function(data, secret, copayerName, cb) { |
|
|
|
ClientLib.prototype._joinWallet = function(data, secret, copayerName, cb) { |
|
|
|
var self = this; |
|
|
|
data = data || {}; |
|
|
|
|
|
|
@ -143,7 +143,7 @@ ClientLib.prototype._joinWallet = function(data, secret, copayerName, cb) { |
|
|
|
|
|
|
|
var walletPrivKey = Bitcore.PrivateKey.fromString(secretSplit[1]); |
|
|
|
var network = secretSplit[2] == 'T' ? 'testnet' : 'livenet'; |
|
|
|
data.xPrivKey = _createXPrivKey(network); |
|
|
|
data.xPrivKey = _createXPrivKey(network); |
|
|
|
|
|
|
|
var xPubKey = new Bitcore.HDPublicKey(data.xPrivKey); |
|
|
|
var xPubKeySignature = SignUtils.sign(xPubKey.toString(), walletPrivKey); |
|
|
@ -408,7 +408,7 @@ ClientLib.prototype.sign = function(txp, cb) { |
|
|
|
//Derive proper key to sign, for each input
|
|
|
|
var privs = [], |
|
|
|
derived = {}; |
|
|
|
|
|
|
|
|
|
|
|
var network = new Bitcore.Address(txp.toAddress).network.name; |
|
|
|
var xpriv = new Bitcore.HDPrivateKey(data.xPrivKey, network); |
|
|
|
|
|
|
@ -434,12 +434,17 @@ ClientLib.prototype.sign = function(txp, cb) { |
|
|
|
signatures.push(s); |
|
|
|
}); |
|
|
|
|
|
|
|
var url = '/v1//'; |
|
|
|
var signature = _signRequest(url, args, data.signingPrivKey); |
|
|
|
var url = '/v1/txproposals/' + txp.id + '/signatures/'; |
|
|
|
var args = { |
|
|
|
signatures: signatures |
|
|
|
}; |
|
|
|
var reqSignature = _signRequest(url, args, data.signingPrivKey); |
|
|
|
console.log('[clientlib.js.441:reqSignature:]',url, args, reqSignature); //TODO
|
|
|
|
|
|
|
|
request({ |
|
|
|
headers: { |
|
|
|
'x-identity': data.copayerId, |
|
|
|
'x-signature': signature, |
|
|
|
'x-signature': reqSignature, |
|
|
|
}, |
|
|
|
method: 'post', |
|
|
|
url: _getUrl(url), |
|
|
@ -453,9 +458,6 @@ ClientLib.prototype.sign = function(txp, cb) { |
|
|
|
} |
|
|
|
return cb(null, body); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return signatures; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|