node-client
Node.js SDK for the BlockCypher Web services. See https://www.blockcypher.com/dev/bitcoin/ for detailed documentation.
To install, just use npm:
npm install blockcypher
Examples
bcypher = require('blockcypher');
var bcapi = new bcypher('btc','main',process.env.TOKEN);
function printResponse(err, data) {
if (err !== null) {
console.log(err);
} else {
console.log(data);
}
}
bcapi.getChain(printResponse);
bcapi.getBlock(300000, printResponse);
bcapi.getBlock(300000, {txstart:2}, printResponse);
var webhook = {
event: "unconfirmed-tx",
address: "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh",
url: "https://my.domain.com/callbacks/new-tx"
};
bcapi.createHook(webhook, printResponse);
bcapi.listHooks(printResponse);