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

bitcoin

Package Overview
Dependencies
Maintainers
1
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.1.1 to 1.1.2

.gitignore

16

lib/bitcoin/client.js

@@ -51,10 +51,12 @@

// Client
// Either pass in 4 arguments, or a single object with host, port, user, pass
//===----------------------------------------------------------------------===//
function Client(host, port, user, pass) {
this.host = host;
this.port = port;
this.user = user;
this.pass = pass;
this.rpc = new rpc.Client(port, host, user, pass);
function Client() {
var args = [].slice.call(arguments);
this.host = args[0].host || args[0];
this.port = args[0].port || args[1];
this.user = args[0].user || args[2];
this.pass = args[0].pass || args[3];
this.rpc = new rpc.Client(this.port, this.host, this.user, this.pass);
}

@@ -61,0 +63,0 @@

{
"name": "bitcoin",
"description": "Communicate with bitcoind via JSON-RPC",
"version": "1.1.1",
"version": "1.1.2",
"main": "./lib/bitcoin",

@@ -23,3 +23,6 @@ "keywords": [

"node": "*"
},
"scripts": {
"test": "node test/api.js"
}
}

@@ -1,2 +0,1 @@

# node-bitcoin

@@ -33,10 +32,10 @@

## Example
```js
var bitcoin = require('bitcoin');
var client = new bitcoin.Client('localhost', 8332, 'username', 'password');
var bitcoin = require('bitcoin');
var client = new bitcoin.Client('localhost', 8332, 'username', 'password');
client.getBalance(function(err, balance) {
if (err) return console.log(err);
console.log("Balance:", balance);
});
client.getBalance(function(err, balance) {
if (err) return console.log(err);
console.log("Balance:", balance);
});
```

@@ -8,4 +8,11 @@ var path = require('path');

account: "test"
}
};
var config = {
host: 'localhost',
port: 8332,
user: 'jb55',
pass: 'thisisthepassword'
};
// end test variables

@@ -19,3 +26,3 @@

function makeClient() {
return new bitcoin.Client('localhost', 8332, 'jb55', 'thisisthepassword');
return new bitcoin.Client(config.host, config.port, config.user, config.pass);
}

@@ -102,2 +109,21 @@

},
'client creation with single object': {
topic: function(client){
var client2 = new bitcoin.Client(config);
var self = this;
client2.getWork(function(err, work) {
self.callback(err, work, client2, client);
});
},
'should have same params': function(err, work, client2, client) {
assert.isNull(err);
assert.equal(client2.host, client.host);
assert.equal(client2.port, client.port);
assert.equal(client2.user, client.user);
assert.equal(client2.pass, client.pass);
},
'getWork should be an object': function(work) {
assert.isObject(work);
}
},
},

@@ -104,0 +130,0 @@

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