chain-node
Advanced tools
Comparing version 0.0.5 to 0.0.6
35
index.js
@@ -23,6 +23,12 @@ var request = require('request'); | ||
}, | ||
getTransaction: function(hash, cb) { | ||
getAddressTransactions: function(addr, options, cb) { | ||
options = options || {}; | ||
if (typeof(options) == 'function') { | ||
cb = options; | ||
options = {}; | ||
} | ||
request({ | ||
method: 'GET', | ||
uri: URL + '/v1/bitcoin/transactions/' + hash, | ||
uri: URL + '/v1/bitcoin/addresses/' + addr + '/transactions', | ||
qs: options, | ||
strictSSL: true, | ||
@@ -35,18 +41,17 @@ cert: PEM, | ||
}, | ||
sendTransaction: function(hex, cb) { | ||
getAddressUnspents: function(addr, cb) { | ||
request({ | ||
method: 'PUT', | ||
uri: URL + '/v1/bitcoin/transactions/', | ||
method: 'GET', | ||
uri: URL + '/v1/bitcoin/addresses/' + addr + '/unspents', | ||
strictSSL: true, | ||
cert: PEM, | ||
auth: {user: this.getKey()}, | ||
json: {hex: hex}, | ||
}, function(err, msg, resp) { | ||
cb(err, resp); | ||
cb(err, JSON.parse(resp)); | ||
}); | ||
}, | ||
getAddressUnspents: function(addr, cb) { | ||
getTransaction: function(hash, cb) { | ||
request({ | ||
method: 'GET', | ||
uri: URL + '/v1/bitcoin/addresses/' + addr + '/unspents', | ||
uri: URL + '/v1/bitcoin/transactions/' + hash, | ||
strictSSL: true, | ||
@@ -58,3 +63,15 @@ cert: PEM, | ||
}); | ||
}, | ||
sendTransaction: function(hex, cb) { | ||
request({ | ||
method: 'PUT', | ||
uri: URL + '/v1/bitcoin/transactions/', | ||
strictSSL: true, | ||
cert: PEM, | ||
auth: {user: this.getKey()}, | ||
json: {hex: hex}, | ||
}, function(err, msg, resp) { | ||
cb(err, resp); | ||
}); | ||
} | ||
}; |
{ | ||
"name": "chain-node", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "The Official Node.js SDK for Chain's Bitcoin API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8037
72
1