bitcore-wallet-utils
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -1,1 +0,2 @@ | ||
module.exports = require('./lib/walletutils'); | ||
var utils = module.exports = require('./lib/walletutils'); | ||
utils.Bitcore = require('bitcore'); |
@@ -148,3 +148,22 @@ 'use strict'; | ||
WalletUtils.buildTx = function(txp) { | ||
var t = new Bitcore.Transaction(); | ||
_.each(txp.inputs, function(i) { | ||
t.from(i, i.publicKeys, txp.requiredSignatures); | ||
}); | ||
t.to(txp.toAddress, txp.amount) | ||
.change(txp.changeAddress.address); | ||
// Shuffle outputs for improved privacy | ||
t.sortOutputs(function(outputs) { | ||
return _.map(txp.outputOrder, function(i) { | ||
return outputs[i]; | ||
}); | ||
}); | ||
return t; | ||
}; | ||
WalletUtils.signTxp = function(txp, xPrivKey) { | ||
@@ -167,11 +186,4 @@ var self = this; | ||
var t = new Bitcore.Transaction(); | ||
var t = WalletUtils.buildTx(txp); | ||
_.each(txp.inputs, function(i) { | ||
t.from(i, i.publicKeys, txp.requiredSignatures); | ||
}); | ||
t.to(txp.toAddress, txp.amount) | ||
.change(txp.changeAddress.address); | ||
var signatures = _.map(privs, function(priv, i) { | ||
@@ -178,0 +190,0 @@ return t.getSignatures(priv); |
@@ -5,3 +5,3 @@ { | ||
"author": "BitPay Inc", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "index.js", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"dependencies": { | ||
"bitcore": "^0.11.2", | ||
"bitcore": "git+https://github.com/bitpay/bitcore#9ffe2def469d251ca769150bb0b9d133373b458a", | ||
"coveralls": "^2.11.2", | ||
@@ -26,0 +26,0 @@ "lodash": "^3.3.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13527
247
1
1
- Removedbitcore@0.11.7(transitive)
Updatedbitcore@git+https://github.com/bitpay/bitcore#9ffe2def469d251ca769150bb0b9d133373b458a