Removing Current
This commit is contained in:
1 parent
d6c5e91290
commit
a4ed878fcd
4379 files changed
No files matched your search
+55
@@ -0,0 +1,55 @@
|
||||
'use strict'
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
const log = require ('ololog')
|
||||
, ansi = require ('ansicolor').nice
|
||||
, chai = require ('chai')
|
||||
, expect = chai.expect
|
||||
, assert = chai.assert
|
||||
, testTicker = require ('./test.ticker.js')
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
const printTickerOneLiner = (ticker, method, symbol) => {
|
||||
|
||||
log (symbol.toString ().green,
|
||||
method,
|
||||
ticker['datetime'],
|
||||
'bid: ' + (ticker['bid']),
|
||||
'ask: ' + (ticker['ask']))
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
module.exports = async (exchange, symbol) => {
|
||||
|
||||
const method = 'fetchTicker'
|
||||
|
||||
const skippedExchanges = [
|
||||
'digifinex',
|
||||
]
|
||||
|
||||
if (skippedExchanges.includes (exchange.id)) {
|
||||
log (exchange.id, 'found in ignored exchanges, skipping ' + method + '...')
|
||||
return
|
||||
}
|
||||
|
||||
if (exchange.has[method]) {
|
||||
|
||||
// log (symbol.green, 'fetching ticker...')
|
||||
|
||||
let ticker = await exchange.fetchTicker (symbol)
|
||||
|
||||
testTicker (exchange, ticker, method, symbol)
|
||||
|
||||
printTickerOneLiner (ticker, method, symbol)
|
||||
|
||||
return ticker
|
||||
|
||||
} else {
|
||||
|
||||
log (symbol.green, 'fetchTicker () not supported')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user