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

Method futuresAggTradeStream

src/node-binance-api.ts:5704–5719  ·  view source on GitHub ↗

* Futures WebSocket aggregated trades * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @return {string} the websocket endpoint

(symbols: string[] | string, callback: Callback)

Source from the content-addressed store, hash-verified

5702 * @return {string} the websocket endpoint
5703 */
5704 futuresAggTradeStream(symbols: string[] | string, callback: Callback) {
5705 const reconnect = () => {
5706 if (this.Options.reconnect) this.futuresAggTradeStream(symbols, callback);
5707 };
5708 let subscription;
5709 const cleanCallback = data => callback(this.fAggTradeConvertData(data));
5710 if (Array.isArray(symbols)) {
5711 if (!this.isArrayUnique(symbols)) throw Error('futuresAggTradeStream: "symbols" cannot contain duplicate elements.');
5712 const streams = symbols.map(symbol => symbol.toLowerCase() + '@aggTrade');
5713 subscription = this.futuresSubscribe(streams, cleanCallback, { reconnect });
5714 } else {
5715 const symbol = symbols as string;
5716 subscription = this.futuresSubscribeSingle(symbol.toLowerCase() + '@aggTrade', cleanCallback, { reconnect });
5717 }
5718 return (subscription as any).url;
5719 }
5720
5721 /**
5722 * Futures WebSocket mark price

Callers 2

reconnectMethod · 0.95

Calls 3

isArrayUniqueMethod · 0.95
futuresSubscribeMethod · 0.95

Tested by

no test coverage detected