MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / futuresKlineHandler

Function futuresKlineHandler

deprecated/node-binance-api.js:1047–1063  ·  view source on GitHub ↗
(symbol, kline, firstTime = 0)

Source from the content-addressed store, hash-verified

1045 * @return {undefined}
1046 */
1047 const futuresKlineHandler = (symbol, kline, firstTime = 0) => {
1048 // eslint-disable-next-line no-unused-vars
1049 let { e: eventType, E: eventTime, k: ticks } = kline;
1050 // eslint-disable-next-line no-unused-vars
1051 let { o: open, h: high, l: low, c: close, v: volume, i: interval, x: isFinal, q: quoteVolume, V: takerBuyBaseVolume, Q: takerBuyQuoteVolume, n: trades, t: time, T: closeTime } = ticks;
1052 if (time <= firstTime) return;
1053 if (!isFinal) {
1054 // if ( typeof Binance.futuresRealtime[symbol][interval].time !== 'undefined' ) {
1055 // if ( Binance.futuresRealtime[symbol][interval].time > time ) return;
1056 // }
1057 Binance.futuresRealtime[symbol][interval] = { time, closeTime, open, high, low, close, volume, quoteVolume, takerBuyBaseVolume, takerBuyQuoteVolume, trades, isFinal };
1058 return;
1059 }
1060 const first_updated = Object.keys(Binance.futuresTicks[symbol][interval]).shift();
1061 if (first_updated) delete Binance.futuresTicks[symbol][interval][first_updated];
1062 Binance.futuresTicks[symbol][interval][time] = { time, closeTime, open, high, low, close, volume, quoteVolume, takerBuyBaseVolume, takerBuyQuoteVolume, trades, isFinal: false };
1063 };
1064
1065 /**
1066 * Converts the futures liquidation stream data into a friendly object

Callers 2

handleFuturesKlineStreamFunction · 0.85
getFuturesKlineSnapshotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected