Socket
Socket
Sign inDemoInstall

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.2 to 0.0.3

LICENCE

18

lib/walletutils.js

@@ -16,2 +16,8 @@ 'use strict';

WalletUtils.PATHS = {
BASE_ADDRESS_DERIVATION: "m/45'",
REQUEST_KEY: "m/1'/0",
TXPROPOSAL_KEY: "m/1'/1",
};
/* TODO: It would be nice to be compatible with bitcoind signmessage. How

@@ -55,4 +61,4 @@ * the hash is calculated there? */

WalletUtils.deriveAddress = function(publicKeyRing, path, m, network) {
var publicKeys = _.map(publicKeyRing, function(xPubKey) {
var xpub = new Bitcore.HDPublicKey(xPubKey);
var publicKeys = _.map(publicKeyRing, function(item) {
var xpub = new Bitcore.HDPublicKey(item.xPubKey);
return xpub.derive(path).publicKey;

@@ -71,5 +77,9 @@ });

WalletUtils.getProposalHash = function(toAddress, amount, message) {
return toAddress + '|' + amount + '|' + (message || '');
return [toAddress, amount, (message || '')].join('|');
};
WalletUtils.getCopayerHash = function(name, xPubKey, requestPubKey) {
return [name, xPubKey, requestPubKey].join('|');
};
WalletUtils.xPubToCopayerId = function(xpub) {

@@ -150,3 +160,3 @@ var hash = sjcl.hash.sha256.hash(xpub);

var network = new Bitcore.Address(txp.toAddress).network.name;
var xpriv = new Bitcore.HDPrivateKey(xPrivKey, network);
var xpriv = new Bitcore.HDPrivateKey(xPrivKey, network).derive(WalletUtils.PATHS.BASE_ADDRESS_DERIVATION);

@@ -153,0 +163,0 @@ _.each(txp.inputs, function(i) {

@@ -5,3 +5,3 @@ {

"author": "BitPay Inc",
"version": "0.0.2",
"version": "0.0.3",
"main": "index.js",

@@ -8,0 +8,0 @@ "keywords": [

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