forked from ccxt/ccxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.fetchTicker.js
38 lines (23 loc) · 908 Bytes
/
test.fetchTicker.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
'use strict'
// ----------------------------------------------------------------------------
const testTicker = require ('./test.ticker.js')
// ----------------------------------------------------------------------------
module.exports = async (exchange, symbol) => {
const method = 'fetchTicker'
const skippedExchanges = [
'digifinex',
'currencycom'
]
if (skippedExchanges.includes (exchange.id)) {
console.log (exchange.id, 'found in ignored exchanges, skipping ' + method + '...')
return
}
if (exchange.has[method]) {
const ticker = await exchange[method] (symbol)
testTicker (exchange, ticker, method, symbol)
console.log (symbol, method, ticker['datetime'], 'bid:', ticker['bid'], 'ask:', ticker['ask'])
return ticker
} else {
console.log (symbol, method + '() is not supported')
}
}