Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitcore-wallet-utils

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcore-wallet-utils - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

3

index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc