UNPKG

850 BJavaScriptView Raw
1
2const bittrex = require('../node.bittrex.api');
3const APIKEY = 'KEY';
4const APISECRET = 'SECRET';
5
6bittrex.options({
7 'apikey' : APIKEY,
8 'apisecret' : APISECRET,
9 'stream' : false,
10 'verbose' : false,
11 'cleartext' : false
12});
13
14/**
15 * sendCustomRequest example
16 */
17bittrex.sendCustomRequest( 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-ltc', function( data ) {
18 console.log( data );
19}, true);
20
21/**
22 * getmarkethistory example
23 */
24bittrex.getmarkethistory( { market : 'BTC-LTC' }, function( data ) {
25 console.log( data.result );
26});
27
28/**
29 * getorderbook example
30 */
31bittrex.getorderbook( { market : 'BTC-PIVX', depth : 10, type : 'both' }, function( data ) {
32
33 data.result.buy.forEach(function(dataset) { console.log(dataset); });
34 data.result.sell.forEach(function(dataset) { console.log(dataset); });
35});