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

bitcoin

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

3

Changelog.md
# node-bitcoin changelog
## v1.6.2 (2013/03/21)
* shrink package size via .npmignore
## v1.6.1 (2013/03/13)

@@ -4,0 +7,0 @@ * add node v0.10.x support (rejectUnauthorized defaults to true in 0.10.x)

29

index.js

@@ -7,28 +7,18 @@ var deprecate = require('deprecate'),

// Client
// Pass in an object with host, port, user, pass
//===----------------------------------------------------------------------===//
function Client() {
var args = [].slice.call(arguments);
var args = [].slice.call(arguments),
opts = {};
if (args.length > 1) {
deprecate('calling bitcoin.Client with more than one argument is deprecated');
this.host = args[0];
this.port = args[1];
this.user = args[2];
this.pass = args[3];
this.ssl = false;
this.sslStrict = false;
this.sslCa = null;
opts.host = args[0];
opts.port = args[1];
opts.user = args[2];
opts.pass = args[3];
} else {
this.host = args[0].host;
this.port = args[0].port;
this.user = args[0].user;
this.pass = args[0].pass;
this.ssl = args[0].ssl ? true : false;
this.sslStrict = (typeof args[0].sslStrict === 'undefined' || args[0].sslStrict);
this.sslCa = args[0].sslCa;
opts = args[0];
}
this.rpc = new rpc.Client(this.port, this.host, this.user, this.pass,
this.ssl, this.sslStrict, this.sslCa);
this.rpc = new rpc.Client(opts);
}

@@ -39,3 +29,2 @@

// cmd
// Call custom jsonrpc commands
//===----------------------------------------------------------------------===//

@@ -42,0 +31,0 @@ Client.prototype.cmd = function() {

var http = require('http'),
https = require('https');
var Client = function(port, host, user, password, ssl, sslStrict, sslCa) {
this.port = port;
this.host = host;
this.user = user;
this.password = password;
this.ssl = ssl ? true : false;
this.sslStrict = sslStrict ? true : false;
this.http = this.ssl ? https : http;
this.sslCa = sslCa;
var Client = function(opts) {
this.opts = opts || {};
this.http = this.opts.ssl ? https : http;
};

@@ -44,21 +37,21 @@

var requestOptions = {
host: this.host,
port: this.port,
host: this.opts.host,
port: this.opts.port,
method: 'POST',
path: path || '/',
headers: {
'Host': this.host,
'Host': this.opts.host,
'Content-Length': requestJSON.length
},
agent: false,
rejectUnauthorized: this.ssl && this.sslStrict
rejectUnauthorized: this.opts.ssl && this.opts.sslStrict !== false
};
if (this.ssl && this.sslCa) {
requestOptions.ca = this.sslCa;
if (this.opts.ssl && this.opts.sslCa) {
requestOptions.ca = this.opts.sslCa;
}
// use HTTP auth if user and password set
if (this.user && this.password) {
requestOptions.auth = this.user + ':' + this.password;
if (this.opts.user && this.opts.pass) {
requestOptions.auth = this.opts.user + ':' + this.opts.pass;
}

@@ -65,0 +58,0 @@

{
"name": "bitcoin",
"description": "Communicate with bitcoind via JSON-RPC",
"version": "1.6.1",
"version": "1.6.2",
"main": "index.js",

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

Sorry, the diff of this file is not supported yet

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