sfccxt
Version:
A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges
39 lines (23 loc) • 908 B
JavaScript
// ----------------------------------------------------------------------------
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')
}
}