* 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)
| 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 |
no test coverage detected