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

Method miniTicker

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

* Websocket mini ticker * @param {function} callback - callback function * @return {string} the websocket endpoint

(callback)

Source from the content-addressed store, hash-verified

6750 * @return {string} the websocket endpoint
6751 */
6752 miniTicker(callback) {
6753 const reconnect = () => {
6754 if (this.Options.reconnect) this.miniTicker(callback);
6755 };
6756 const subscription = this.subscribe('!miniTicker@arr', function (data: any) {
6757 const markets = {};
6758 for (const obj of data) {
6759 markets[obj.s] = {
6760 close: obj.c,
6761 open: obj.o,
6762 high: obj.h,
6763 low: obj.l,
6764 volume: obj.v,
6765 quoteVolume: obj.q,
6766 eventTime: obj.E
6767 };
6768 }
6769 callback(markets);
6770 }, reconnect);
6771 return (subscription as any).url;
6772 }
6773
6774 /**
6775 * Spot WebSocket bookTicker (bid/ask quotes including price & amount)

Callers 1

reconnectMethod · 0.95

Calls 1

subscribeMethod · 0.95

Tested by

no test coverage detected