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

Method deliveryCandlesticks

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

* Websocket delivery candlesticks * @param {array/string} symbols - an array or string of symbols to query * @param {string} interval - the time interval * @param {function} callback - callback function * @return {string} the websocket endpoint

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

Source from the content-addressed store, hash-verified

6095 * @return {string} the websocket endpoint
6096 */
6097 deliveryCandlesticks(symbols: string[] | string, interval: Interval, callback: Callback) {
6098 const reconnect = () => {
6099 if (this.Options.reconnect) this.deliveryCandlesticks(symbols, interval, callback);
6100 };
6101 let subscription;
6102 if (Array.isArray(symbols)) {
6103 if (!this.isArrayUnique(symbols)) throw Error('deliveryCandlesticks: "symbols" array cannot contain duplicate elements.');
6104 const streams = symbols.map(symbol => symbol.toLowerCase() + '@kline_' + interval);
6105 subscription = this.deliverySubscribe(streams, callback, { reconnect });
6106 } else {
6107 const symbol = symbols.toLowerCase();
6108 subscription = this.deliverySubscribeSingle(symbol + '@kline_' + interval, callback, { reconnect });
6109 }
6110 return (subscription as any).url;
6111 }
6112
6113 /**
6114 * Userdata websockets function

Callers 1

reconnectMethod · 0.95

Calls 3

isArrayUniqueMethod · 0.95
deliverySubscribeMethod · 0.95

Tested by

no test coverage detected