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.0.1 to 1.1.0

6

lib/jsonrpc.js
var sys = require('sys');
var http = require('http');
var METHOD_NOT_ALLOWED = "Method Not Allowed\n";

@@ -64,3 +63,6 @@ var INVALID_REQUEST = "Invalid Request\n";

var decoded = JSON.parse(buffer);
if(decoded.hasOwnProperty('result')) {
if(decoded.hasOwnProperty('error') && decoded.error != null) {
if (errback)
errback(decoded.error)
} else if(decoded.hasOwnProperty('result')) {
if (callback)

@@ -67,0 +69,0 @@ callback(decoded.result);

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

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

@@ -5,8 +5,7 @@

doCmd('getWork');
function doCmd(cmd) {
client[cmd](function(data) {
client[cmd](function(err, data) {
console.log(cmd);
console.log(data);
console.log("err: ", err);
console.log('');

@@ -16,1 +15,2 @@ });

doCmd('getWork');

@@ -7,3 +7,3 @@ var path = require('path');

var test = {
account: "test"
account: "test"
}

@@ -36,3 +36,3 @@

'is valid': function(address){
assert.ok(address, "Update test variables with a valid address?");
assert.ok(address);
},

@@ -46,4 +46,18 @@ 'after getting the account name again': {

}
}
},
},
'listTransactions with specific amount': {
topic: function(client){
client.listTransactions(test.account, 15, this.callback);
},
'should not be empty': function(txs){ assert.ok(txs); },
'is an array': function(txs) { assert.isTrue(txs instanceof Array); }
},
'listTransactions without specific amount': {
topic: function(client){
client.listTransactions(test.account, this.callback);
},
'should not be empty': function(txs){ assert.ok(txs); },
'is an array': function(txs) { assert.isTrue(txs instanceof Array); }
},
'account addresses': {

@@ -81,2 +95,6 @@ topic: function(client){

},
'getWork': {
topic: function(client) { client.getWork(this.callback); },
'should not be empty': notEmpty,
},
'getTransaction': {

@@ -88,4 +106,4 @@ topic: "TODO: get valid transaction",

}).run();
}).export(module);
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