chain-node
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -39,7 +39,10 @@ var request = require('request'); | ||
} | ||
request(r, function(err, msg, resp) { | ||
request(r, function(err, resp, body) { | ||
if (Math.floor(resp.statusCode / 100) != 2) { | ||
err = body; | ||
} | ||
if(usingJson) { | ||
cb(err, resp); | ||
cb(err, body); | ||
} else { | ||
cb(err, JSON.parse(resp)); | ||
cb(err, JSON.parse(body)); | ||
} | ||
@@ -46,0 +49,0 @@ }); |
@@ -77,2 +77,6 @@ var bitcoin = require('bitcoinjs-lib'); | ||
Chain.prototype.getTransactionConfidence = function(hash, cb) { | ||
this.dataApi.get('/transactions/' + hash + '/confidence', cb); | ||
}; | ||
Chain.prototype.sendTransaction = function(hex, cb) { | ||
@@ -143,3 +147,3 @@ this.dataApi.post('/transactions', {hex: hex}, cb); | ||
if(err == null) { | ||
var signedTemplate = Signer(this.blockChainConfig, resp, keys); | ||
var signedTemplate = Signer(blockChainConfig, resp, keys); | ||
that.sendTransaction(signedTemplate, cb); | ||
@@ -146,0 +150,0 @@ } else { |
{ | ||
"name": "chain-node", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "The Official Node.js SDK for Chain's Bitcoin API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13386
223