Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
chartUpdate: function(pairName, interval, next) {
binance.candlesticks(pairName, interval, function(error, ticks, pairName) {
next(error, pairName, ticks)
})
},
startChartUpdate: function(pairName, interval, next) {
let candlesPromise = new Promise((resolve, reject) => {
let options = {
limit: limit,
endTime: typeof endTime === 'number' ? endTime : endTime.getTime()
};
binance.candlesticks(ticker, interval, (error, ticks, symbol) => {
if (error) return reject(error);
let candles = ticks.map(tick => {
let [time, open, high, low, close, volume, closeTime, assetVolume, trades, buyBaseVolume, buyAssetVolume, ignored] = tick;
return {
time: time,
ticker: symbol,
open: parseFloat(open),
high: parseFloat(high),
low: parseFloat(low),
close: parseFloat(close),
volume: parseFloat(volume),
trades: trades,
final: true,
backfilled: true
};
});