Skip to content

4ley/nodejs-bitcoin-de-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS bitcoin.de API

NodeJS Client Library for the bitcoin.de Trading API

Installation

npm install bitcoinde-api

Example Usage

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 ...

Read on NodeJS: Error Propagation and Interception