-
Notifications
You must be signed in to change notification settings - Fork 3
/
testBittrexAPI.js
65 lines (38 loc) · 1.44 KB
/
testBittrexAPI.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const {Bittrex} = require('./BittrexAPI');
require('dotenv').config();
const apiKey = process.env.APIKEY;
const apiSecret = process.env.APISECRET;
let bittrex = new Bittrex({apiKey, apiSecret});
testAPI();
async function testAPI(){
let pair1 = 'btc';
let pair2 = 'eth';
let type = 'both';
let tickInterval = 'hour'
let startTime = Date.now()
console.log('PUBLIC');
console.log('TEST 1: ');
console.log( await bittrex.getmarkets() );
console.log('TEST 2: ');
console.log( await bittrex.getcurrencies() );
console.log('TEST 3: ');
console.log( await bittrex.getticker(pair1, pair2) );
console.log('TEST 4: ');
console.log( await bittrex.getmarketsummaries() );
console.log('TEST 5: ');
console.log( await bittrex.getmarketsummary(pair1, pair2) );
console.log('TEST 6: ');
console.log( await bittrex.getorderbook(pair1, pair2, type) );
console.log('TEST 7: ');
console.log( await bittrex.getmarkethistory(pair1, pair2) );
// https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-LUN&tickInterval=fiveMin&startTime=1503680400
console.log('TEST 8: ');
console.log( await bittrex.getcandles(pair1, pair2, tickInterval, startTime) );
console.log('PRIVATE');
console.log('TEST 8: ');
console.log(await bittrex.getbalance({currency:'BTC'}));
console.log('TEST 9: ');
console.log(await bittrex.getbalances());
console.log('TEST 10: ');
console.log(await bittrex.getorderhistory());
}