Socket
Socket
Sign inDemoInstall

bitcore-lib-cash

Package Overview
Dependencies
Maintainers
3
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcore-lib-cash - npm Package Compare versions

Comparing version 10.0.11 to 10.0.13

15

lib/address.js

@@ -107,3 +107,3 @@ 'use strict';

} else if (data instanceof PublicKey) {
return Address._transformPublicKey(data);
return Address._transformPublicKey(data, network, type);
} else if (data instanceof Script) {

@@ -228,6 +228,8 @@ return Address._transformScript(data, network);

* @param {PublicKey} pubkey - An instance of PublicKey
* @param {string} network - mainnet, testnet, or regtest
* @param {string} type - Either 'pubkeyhash' or 'scripthash'
* @returns {Object} An object with keys: hashBuffer, type
* @private
*/
Address._transformPublicKey = function(pubkey) {
Address._transformPublicKey = function(pubkey, network, type) {
var info = {};

@@ -238,3 +240,3 @@ if (!(pubkey instanceof PublicKey)) {

info.hashBuffer = Hash.sha256ripemd160(pubkey.toBuffer());
info.type = Address.PayToPublicKeyHash;
info.type = type || Address.PayToPublicKeyHash;
return info;

@@ -432,7 +434,8 @@ };

* @param {PublicKey} data
* @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'
* @param {Network|string} network - either a Network instance, 'livenet', or 'testnet'
* @param {string} type - 'pubkeyhash' (default) or 'scripthash'
* @returns {Address} A new valid and frozen instance of an Address
*/
Address.fromPublicKey = function(data, network) {
var info = Address._transformPublicKey(data);
Address.fromPublicKey = function(data, network, type) {
var info = Address._transformPublicKey(data, network, type);
network = network || Networks.defaultNetwork;

@@ -439,0 +442,0 @@ return new Address(info.hashBuffer, network, info.type);

7

lib/publickey.js

@@ -365,8 +365,9 @@ 'use strict';

*
* @param {String|Network=} network - Which network should the address be for
* @param {string|Network} network - Which network should the address be for
* @param {string} type - 'pubkeyhash' (default) or 'scripthash'
* @returns {Address} An address generated from the public key
*/
PublicKey.prototype.toAddress = function(network) {
PublicKey.prototype.toAddress = function(network, type) {
var Address = require('./address');
return Address.fromPublicKey(this, network || this.network);
return Address.fromPublicKey(this, network || this.network, type);
};

@@ -373,0 +374,0 @@

{
"name": "bitcore-lib-cash",
"version": "10.0.11",
"version": "10.0.13",
"description": "A pure and powerful JavaScript Bitcoin Cash library.",

@@ -55,3 +55,3 @@ "author": "BitPay <dev@bitpay.com>",

"license": "MIT",
"gitHead": "bfe8e147cf8cc1bf1b4abe74aa4af06f03f94e18"
"gitHead": "78af07dba16dc5bc7a84c7519e6d3df60c1ca37a"
}
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