NodeJS Client Library for the bitcoin.de Trading API
npm install bitcoinde-api
var BitcoindeClient = require('bitcoinde-api');
var bitcoinde = new BitcoindeClient({
key: 'api_key',
secret: 'api_secret'
});
// Orderbook
bitcoinde.get('orders', { type: 'sell' })
.then((result) => {
console.log(result.orders);
})
.catch((error) => {
console.error(error);
});
// Account Info
bitcoinde.get('account', null)
.then((result) => {
console.log(result.data);
})
.catch((error) => {
console.error(error);
});
// Catch Error Event
bitcoinde.on('error', function(error) {
console.error(error);
});
Note
... if an 'error' event handler is not provided, the error will be thrown, causing the Node.js process to report an unhandled exception and crash ...