Socket
Socket
Sign inDemoInstall

chain-node

Package Overview
Dependencies
74
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 3.1.1

LICENSE

35

http-utility.js

@@ -12,11 +12,3 @@ var request = require('request');

function HttpUtility(c) {
if(c.auth == null) {
c.auth = "GUEST-TOKEN";
};
this.auth = c.auth;
if (c.url == null) {
c.url = URL;
};
this.url = c.url;
this.url = c.url || URL;
}

@@ -41,10 +33,27 @@

request(r, function(err, resp, body) {
if (err) {
return cb(err);
}
if (Math.floor(resp.statusCode / 100) != 2) {
err = body;
err = new Error("Chain SDK error: bad status code " + resp.statusCode.toString() + ". See 'resp' property for more detail.");
err.resp = resp;
return cb(err);
}
if(usingJson) {
cb(err, body);
} else {
cb(err, JSON.parse(body));
return cb(err, body);
}
var parsed;
try {
parsed = JSON.parse(body);
} catch (e) {
err = new Error("Chain SDK error: could not decode JSON response. See 'error' and 'resp' properties for more detail.");
err.error = e;
err.resp = resp;
return cb(err);
}
cb(null, parsed);
});

@@ -51,0 +60,0 @@ };

{
"name": "chain-node",
"version": "3.1.0",
"version": "3.1.1",
"description": "The Official Node.js SDK for Chain's Bitcoin API",

@@ -28,2 +28,6 @@ "main": "index.js",

},
"devDependencies": {
"mocha": "~2.2.0",
"nock": "~1.6.0"
},
"files": [

@@ -30,0 +34,0 @@ "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc