tardis-dev 18.10.1 → 18.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/dist/handy.d.ts +2 -3
  2. package/dist/handy.d.ts.map +1 -1
  3. package/dist/handy.js +3 -12
  4. package/dist/handy.js.map +1 -1
  5. package/dist/mappers/ascendex.js +4 -4
  6. package/dist/mappers/ascendex.js.map +1 -1
  7. package/dist/mappers/aster.js +5 -5
  8. package/dist/mappers/aster.js.map +1 -1
  9. package/dist/mappers/backpack.d.ts.map +1 -1
  10. package/dist/mappers/backpack.js +7 -19
  11. package/dist/mappers/backpack.js.map +1 -1
  12. package/dist/mappers/binance.js +6 -6
  13. package/dist/mappers/binance.js.map +1 -1
  14. package/dist/mappers/binancedex.js +3 -3
  15. package/dist/mappers/binancedex.js.map +1 -1
  16. package/dist/mappers/binanceeuropeanoptions.js +11 -33
  17. package/dist/mappers/binanceeuropeanoptions.js.map +1 -1
  18. package/dist/mappers/bitfinex.js +5 -9
  19. package/dist/mappers/bitfinex.js.map +1 -1
  20. package/dist/mappers/bitflyer.js +3 -3
  21. package/dist/mappers/bitflyer.js.map +1 -1
  22. package/dist/mappers/bitget.js +9 -14
  23. package/dist/mappers/bitget.js.map +1 -1
  24. package/dist/mappers/bithumb.js +2 -2
  25. package/dist/mappers/bithumb.js.map +1 -1
  26. package/dist/mappers/bitmex.js +5 -5
  27. package/dist/mappers/bitmex.js.map +1 -1
  28. package/dist/mappers/bitnomial.js +2 -2
  29. package/dist/mappers/bitnomial.js.map +1 -1
  30. package/dist/mappers/bitstamp.js +3 -3
  31. package/dist/mappers/bitstamp.js.map +1 -1
  32. package/dist/mappers/bitvavo.js +3 -3
  33. package/dist/mappers/bitvavo.js.map +1 -1
  34. package/dist/mappers/blockchaincom.js +2 -2
  35. package/dist/mappers/blockchaincom.js.map +1 -1
  36. package/dist/mappers/bullish.js +7 -7
  37. package/dist/mappers/bullish.js.map +1 -1
  38. package/dist/mappers/bybit.js +11 -11
  39. package/dist/mappers/bybit.js.map +1 -1
  40. package/dist/mappers/bybitspot.d.ts +3 -3
  41. package/dist/mappers/bybitspot.d.ts.map +1 -1
  42. package/dist/mappers/bybitspot.js +3 -3
  43. package/dist/mappers/bybitspot.js.map +1 -1
  44. package/dist/mappers/coinbase.js +3 -3
  45. package/dist/mappers/coinbase.js.map +1 -1
  46. package/dist/mappers/coinbasederivatives.js +4 -4
  47. package/dist/mappers/coinbasederivatives.js.map +1 -1
  48. package/dist/mappers/coinbaseinternational.js +8 -8
  49. package/dist/mappers/coinbaseinternational.js.map +1 -1
  50. package/dist/mappers/coinflex.js +3 -3
  51. package/dist/mappers/coinflex.js.map +1 -1
  52. package/dist/mappers/cryptocom.js +5 -8
  53. package/dist/mappers/cryptocom.js.map +1 -1
  54. package/dist/mappers/cryptofacilities.js +6 -6
  55. package/dist/mappers/cryptofacilities.js.map +1 -1
  56. package/dist/mappers/delta.js +4 -4
  57. package/dist/mappers/delta.js.map +1 -1
  58. package/dist/mappers/delta_india.js +8 -14
  59. package/dist/mappers/delta_india.js.map +1 -1
  60. package/dist/mappers/deribit.js +17 -20
  61. package/dist/mappers/deribit.js.map +1 -1
  62. package/dist/mappers/dydx.js +3 -3
  63. package/dist/mappers/dydx.js.map +1 -1
  64. package/dist/mappers/dydxv4.js +4 -4
  65. package/dist/mappers/dydxv4.js.map +1 -1
  66. package/dist/mappers/ftx.js +5 -5
  67. package/dist/mappers/ftx.js.map +1 -1
  68. package/dist/mappers/gateio.js +6 -6
  69. package/dist/mappers/gateio.js.map +1 -1
  70. package/dist/mappers/gateiofutures.js +6 -6
  71. package/dist/mappers/gateiofutures.js.map +1 -1
  72. package/dist/mappers/gemini.js +5 -5
  73. package/dist/mappers/gemini.js.map +1 -1
  74. package/dist/mappers/hitbtc.js +2 -2
  75. package/dist/mappers/hitbtc.js.map +1 -1
  76. package/dist/mappers/huobi.js +20 -27
  77. package/dist/mappers/huobi.js.map +1 -1
  78. package/dist/mappers/hyperliquid.js +5 -8
  79. package/dist/mappers/hyperliquid.js.map +1 -1
  80. package/dist/mappers/kraken.js +6 -6
  81. package/dist/mappers/kraken.js.map +1 -1
  82. package/dist/mappers/kucoin.js +3 -3
  83. package/dist/mappers/kucoin.js.map +1 -1
  84. package/dist/mappers/kucoinfutures.js +4 -4
  85. package/dist/mappers/kucoinfutures.js.map +1 -1
  86. package/dist/mappers/lighter.js +5 -5
  87. package/dist/mappers/lighter.js.map +1 -1
  88. package/dist/mappers/mapper.d.ts +3 -3
  89. package/dist/mappers/mexc.d.ts +4 -4
  90. package/dist/mappers/mexc.d.ts.map +1 -1
  91. package/dist/mappers/mexc.js +3 -3
  92. package/dist/mappers/mexc.js.map +1 -1
  93. package/dist/mappers/mexcfutures.d.ts +5 -5
  94. package/dist/mappers/mexcfutures.d.ts.map +1 -1
  95. package/dist/mappers/mexcfutures.js +3 -3
  96. package/dist/mappers/mexcfutures.js.map +1 -1
  97. package/dist/mappers/okex.js +19 -21
  98. package/dist/mappers/okex.js.map +1 -1
  99. package/dist/mappers/okexspreads.d.ts +3 -3
  100. package/dist/mappers/okexspreads.d.ts.map +1 -1
  101. package/dist/mappers/okexspreads.js +3 -3
  102. package/dist/mappers/okexspreads.js.map +1 -1
  103. package/dist/mappers/phemex.js +18 -12
  104. package/dist/mappers/phemex.js.map +1 -1
  105. package/dist/mappers/poloniex.js +4 -4
  106. package/dist/mappers/poloniex.js.map +1 -1
  107. package/dist/mappers/polymarket.js +3 -3
  108. package/dist/mappers/polymarket.js.map +1 -1
  109. package/dist/mappers/serum.js +3 -3
  110. package/dist/mappers/serum.js.map +1 -1
  111. package/dist/mappers/upbit.js +2 -2
  112. package/dist/mappers/upbit.js.map +1 -1
  113. package/dist/mappers/whitebit.js +8 -12
  114. package/dist/mappers/whitebit.js.map +1 -1
  115. package/dist/mappers/woox.js +10 -12
  116. package/dist/mappers/woox.js.map +1 -1
  117. package/dist/realtimefeeds/delta.d.ts.map +1 -1
  118. package/dist/realtimefeeds/delta.js +3 -0
  119. package/dist/realtimefeeds/delta.js.map +1 -1
  120. package/dist/realtimefeeds/ftx.d.ts.map +1 -1
  121. package/dist/realtimefeeds/ftx.js +5 -4
  122. package/dist/realtimefeeds/ftx.js.map +1 -1
  123. package/dist/realtimefeeds/huobi.d.ts +3 -3
  124. package/dist/realtimefeeds/huobi.d.ts.map +1 -1
  125. package/dist/realtimefeeds/huobi.js +21 -12
  126. package/dist/realtimefeeds/huobi.js.map +1 -1
  127. package/dist/realtimefeeds/phemex.d.ts.map +1 -1
  128. package/dist/realtimefeeds/phemex.js +1 -0
  129. package/dist/realtimefeeds/phemex.js.map +1 -1
  130. package/dist/realtimefeeds/whitebit.d.ts.map +1 -1
  131. package/dist/realtimefeeds/whitebit.js +9 -4
  132. package/dist/realtimefeeds/whitebit.js.map +1 -1
  133. package/package.json +1 -1
  134. package/src/handy.ts +5 -15
  135. package/src/mappers/ascendex.ts +4 -4
  136. package/src/mappers/aster.ts +5 -5
  137. package/src/mappers/backpack.ts +7 -19
  138. package/src/mappers/binance.ts +6 -6
  139. package/src/mappers/binancedex.ts +3 -3
  140. package/src/mappers/binanceeuropeanoptions.ts +11 -39
  141. package/src/mappers/bitfinex.ts +5 -9
  142. package/src/mappers/bitflyer.ts +3 -3
  143. package/src/mappers/bitget.ts +9 -14
  144. package/src/mappers/bithumb.ts +2 -2
  145. package/src/mappers/bitmex.ts +5 -5
  146. package/src/mappers/bitnomial.ts +2 -2
  147. package/src/mappers/bitstamp.ts +3 -3
  148. package/src/mappers/bitvavo.ts +3 -3
  149. package/src/mappers/blockchaincom.ts +2 -2
  150. package/src/mappers/bullish.ts +7 -7
  151. package/src/mappers/bybit.ts +11 -11
  152. package/src/mappers/bybitspot.ts +3 -3
  153. package/src/mappers/coinbase.ts +3 -3
  154. package/src/mappers/coinbasederivatives.ts +4 -4
  155. package/src/mappers/coinbaseinternational.ts +9 -9
  156. package/src/mappers/coinflex.ts +3 -3
  157. package/src/mappers/cryptocom.ts +5 -8
  158. package/src/mappers/cryptofacilities.ts +6 -6
  159. package/src/mappers/delta.ts +4 -4
  160. package/src/mappers/delta_india.ts +8 -14
  161. package/src/mappers/deribit.ts +17 -21
  162. package/src/mappers/dydx.ts +3 -3
  163. package/src/mappers/dydxv4.ts +4 -4
  164. package/src/mappers/ftx.ts +5 -5
  165. package/src/mappers/gateio.ts +6 -6
  166. package/src/mappers/gateiofutures.ts +6 -6
  167. package/src/mappers/gemini.ts +5 -5
  168. package/src/mappers/hitbtc.ts +2 -2
  169. package/src/mappers/huobi.ts +21 -29
  170. package/src/mappers/hyperliquid.ts +6 -9
  171. package/src/mappers/kraken.ts +6 -6
  172. package/src/mappers/kucoin.ts +3 -3
  173. package/src/mappers/kucoinfutures.ts +4 -4
  174. package/src/mappers/lighter.ts +5 -5
  175. package/src/mappers/mapper.ts +3 -3
  176. package/src/mappers/mexc.ts +3 -3
  177. package/src/mappers/mexcfutures.ts +3 -3
  178. package/src/mappers/okex.ts +19 -25
  179. package/src/mappers/okexspreads.ts +3 -3
  180. package/src/mappers/phemex.ts +18 -12
  181. package/src/mappers/poloniex.ts +4 -4
  182. package/src/mappers/polymarket.ts +3 -3
  183. package/src/mappers/serum.ts +3 -3
  184. package/src/mappers/upbit.ts +2 -2
  185. package/src/mappers/whitebit.ts +8 -14
  186. package/src/mappers/woox.ts +10 -13
  187. package/src/realtimefeeds/delta.ts +4 -0
  188. package/src/realtimefeeds/ftx.ts +6 -4
  189. package/src/realtimefeeds/huobi.ts +27 -12
  190. package/src/realtimefeeds/phemex.ts +1 -0
  191. package/src/realtimefeeds/whitebit.ts +9 -4
@@ -32,7 +32,7 @@ class GateIOV4OrderBookV2ChangeMapper implements Mapper<'gate-io', BookChange> {
32
32
  return message.channel === 'spot.obu' && message.event === 'update'
33
33
  }
34
34
 
35
- getFilters(symbols?: string[]) {
35
+ getFilters(symbols: string[] = []) {
36
36
  symbols = upperCaseSymbols(symbols)
37
37
 
38
38
  return [
@@ -102,7 +102,7 @@ class GateIOV4BookChangeMapper implements Mapper<'gate-io', BookChange> {
102
102
  return message.channel.endsWith('order_book_update')
103
103
  }
104
104
 
105
- getFilters(symbols?: string[]) {
105
+ getFilters(symbols: string[] = []) {
106
106
  symbols = upperCaseSymbols(symbols)
107
107
 
108
108
  return [
@@ -256,7 +256,7 @@ class GateIOV4BookTickerMapper implements Mapper<'gate-io', BookTicker> {
256
256
  return message.channel.endsWith('book_ticker')
257
257
  }
258
258
 
259
- getFilters(symbols?: string[]) {
259
+ getFilters(symbols: string[] = []) {
260
260
  symbols = upperCaseSymbols(symbols)
261
261
 
262
262
  return [
@@ -300,7 +300,7 @@ class GateIOV4TradesMapper implements Mapper<'gate-io', Trade> {
300
300
  return message.channel.endsWith('trades')
301
301
  }
302
302
 
303
- getFilters(symbols?: string[]) {
303
+ getFilters(symbols: string[] = []) {
304
304
  symbols = upperCaseSymbols(symbols)
305
305
 
306
306
  return [
@@ -337,7 +337,7 @@ class GateIOTradesMapper implements Mapper<'gate-io', Trade> {
337
337
  return message.method === 'trades.update'
338
338
  }
339
339
 
340
- getFilters(symbols?: string[]) {
340
+ getFilters(symbols: string[] = []) {
341
341
  symbols = upperCaseSymbols(symbols)
342
342
 
343
343
  return [
@@ -394,7 +394,7 @@ class GateIOBookChangeMapper implements Mapper<'gate-io', BookChange> {
394
394
  return message.method === 'depth.update'
395
395
  }
396
396
 
397
- getFilters(symbols?: string[]) {
397
+ getFilters(symbols: string[] = []) {
398
398
  symbols = upperCaseSymbols(symbols)
399
399
 
400
400
  return [
@@ -23,7 +23,7 @@ class GateIOFuturesOrderBookV2Mapper implements Mapper<'gate-io-futures', BookCh
23
23
  return message.channel === 'futures.obu' && (message.event === 'update' || message.event === 'all')
24
24
  }
25
25
 
26
- getFilters(symbols?: string[]) {
26
+ getFilters(symbols: string[] = []) {
27
27
  return [{ channel: 'obu', symbols: upperCaseSymbols(symbols) } as const]
28
28
  }
29
29
 
@@ -50,7 +50,7 @@ class GateIOFuturesLiquidationsMapper implements Mapper<'gate-io-futures', Liqui
50
50
  return message.channel === 'futures.public_liquidates' && message.event === 'update'
51
51
  }
52
52
 
53
- getFilters(symbols?: string[]) {
53
+ getFilters(symbols: string[] = []) {
54
54
  return [{ channel: 'public_liquidates', symbols: upperCaseSymbols(symbols) } as const]
55
55
  }
56
56
 
@@ -79,7 +79,7 @@ class GateIOFuturesTradesMapper implements Mapper<'gate-io-futures', Trade> {
79
79
  return message.channel === 'futures.trades' && message.event === 'update'
80
80
  }
81
81
 
82
- getFilters(symbols?: string[]) {
82
+ getFilters(symbols: string[] = []) {
83
83
  symbols = upperCaseSymbols(symbols)
84
84
 
85
85
  return [
@@ -124,7 +124,7 @@ class GateIOFuturesBookChangeMapper implements Mapper<'gate-io-futures', BookCha
124
124
  return message.channel === 'futures.order_book' && (message.event === 'all' || message.event === 'update')
125
125
  }
126
126
 
127
- getFilters(symbols?: string[]) {
127
+ getFilters(symbols: string[] = []) {
128
128
  symbols = upperCaseSymbols(symbols)
129
129
 
130
130
  return [
@@ -183,7 +183,7 @@ class GateIOFuturesDerivativeTickerMapper implements Mapper<'gate-io-futures', D
183
183
  return message.channel === 'futures.tickers' && message.event === 'update'
184
184
  }
185
185
 
186
- getFilters(symbols?: string[]) {
186
+ getFilters(symbols: string[] = []) {
187
187
  symbols = upperCaseSymbols(symbols)
188
188
 
189
189
  return [
@@ -234,7 +234,7 @@ class GateIOFuturesBookTickerMapper implements Mapper<'gate-io-futures', BookTic
234
234
  return message.channel === 'futures.book_ticker' && message.event === 'update'
235
235
  }
236
236
 
237
- getFilters(symbols?: string[]) {
237
+ getFilters(symbols: string[] = []) {
238
238
  symbols = upperCaseSymbols(symbols)
239
239
 
240
240
  return [
@@ -21,7 +21,7 @@ const geminiTradesMapper: Mapper<'gemini', Trade> = {
21
21
  return message.type === 'trade'
22
22
  },
23
23
 
24
- getFilters(symbols?: string[]) {
24
+ getFilters(symbols: string[] = []) {
25
25
  symbols = upperCaseSymbols(symbols)
26
26
 
27
27
  return [
@@ -59,7 +59,7 @@ const geminiBookChangeMapper: Mapper<'gemini', BookChange> = {
59
59
  return message.type === 'l2_updates'
60
60
  },
61
61
 
62
- getFilters(symbols?: string[]) {
62
+ getFilters(symbols: string[] = []) {
63
63
  symbols = upperCaseSymbols(symbols)
64
64
 
65
65
  return [
@@ -109,7 +109,7 @@ class GeminiV3TradesMapper implements Mapper<'gemini', Trade> {
109
109
  return 't' in message
110
110
  }
111
111
 
112
- getFilters(symbols?: string[]) {
112
+ getFilters(symbols: string[] = []) {
113
113
  return [{ channel: 'trade', symbols: upperCaseSymbols(symbols) } as const]
114
114
  }
115
115
 
@@ -135,7 +135,7 @@ class GeminiV3BookChangeMapper implements Mapper<'gemini', BookChange> {
135
135
  return message.e === 'depthUpdate'
136
136
  }
137
137
 
138
- getFilters(symbols?: string[]) {
138
+ getFilters(symbols: string[] = []) {
139
139
  return [{ channel: 'depth', symbols: upperCaseSymbols(symbols) } as const]
140
140
  }
141
141
 
@@ -170,7 +170,7 @@ class GeminiV3BookTickerMapper implements Mapper<'gemini', BookTicker> {
170
170
  return 'B' in message
171
171
  }
172
172
 
173
- getFilters(symbols?: string[]) {
173
+ getFilters(symbols: string[] = []) {
174
174
  return [{ channel: 'bookTicker', symbols: upperCaseSymbols(symbols) } as const]
175
175
  }
176
176
 
@@ -17,7 +17,7 @@ const hitBtcTradesMapper: Mapper<'hitbtc', Trade> = {
17
17
  return message.method !== undefined && message.method === 'updateTrades'
18
18
  },
19
19
 
20
- getFilters(symbols?: string[]) {
20
+ getFilters(symbols: string[] = []) {
21
21
  symbols = upperCaseSymbols(symbols)
22
22
 
23
23
  return [
@@ -60,7 +60,7 @@ const hitBtcBookChangeMapper: Mapper<'hitbtc', BookChange> = {
60
60
  return message.method === 'snapshotOrderbook' || message.method === 'updateOrderbook'
61
61
  },
62
62
 
63
- getFilters(symbols?: string[]) {
63
+ getFilters(symbols: string[] = []) {
64
64
  symbols = upperCaseSymbols(symbols)
65
65
 
66
66
  return [
@@ -54,7 +54,7 @@ class HuobiTradesMapper implements Mapper<'huobi' | 'huobi-dm' | 'huobi-dm-swap'
54
54
  return message.ch.endsWith('.trade.detail')
55
55
  }
56
56
 
57
- getFilters(symbols?: string[]) {
57
+ getFilters(symbols: string[] = []) {
58
58
  symbols = normalizeSymbols(symbols)
59
59
 
60
60
  return [
@@ -98,7 +98,7 @@ class HuobiBookChangeMapper implements Mapper<
98
98
  return message.ch.includes('.depth.')
99
99
  }
100
100
 
101
- getFilters(symbols?: string[]) {
101
+ getFilters(symbols: string[] = []) {
102
102
  symbols = normalizeSymbols(symbols)
103
103
 
104
104
  return [
@@ -156,7 +156,7 @@ class HuobiMBPBookChangeMapper implements Mapper<'huobi', BookChange> {
156
156
  return channel.includes('.mbp.')
157
157
  }
158
158
 
159
- getFilters(symbols?: string[]) {
159
+ getFilters(symbols: string[] = []) {
160
160
  symbols = normalizeSymbols(symbols)
161
161
 
162
162
  return [
@@ -266,18 +266,15 @@ class HuobiMBPBookChangeMapper implements Mapper<'huobi', BookChange> {
266
266
  }
267
267
  }
268
268
 
269
- function normalizeSymbols(symbols?: string[]) {
270
- if (symbols !== undefined) {
271
- return symbols.map((s) => {
272
- // huobi-dm and huobi-dm-swap expect symbols to be upper cased
273
- if (s.includes('_') || s.includes('-')) {
274
- return s.toUpperCase()
275
- }
276
- // huobi global expects lower cased symbols
277
- return s.toLowerCase()
278
- })
279
- }
280
- return
269
+ function normalizeSymbols(symbols: string[]) {
270
+ return symbols.map((s) => {
271
+ // huobi-dm and huobi-dm-swap expect symbols to be upper cased
272
+ if (s.includes('_') || s.includes('-')) {
273
+ return s.toUpperCase()
274
+ }
275
+ // huobi global expects lower cased symbols
276
+ return s.toLowerCase()
277
+ })
281
278
  }
282
279
 
283
280
  class HuobiDerivativeTickerMapper implements Mapper<'huobi-dm' | 'huobi-dm-swap' | 'huobi-dm-linear-swap', DerivativeTicker> {
@@ -297,7 +294,7 @@ class HuobiDerivativeTickerMapper implements Mapper<'huobi-dm' | 'huobi-dm-swap'
297
294
  return false
298
295
  }
299
296
 
300
- getFilters(symbols?: string[]) {
297
+ getFilters(symbols: string[] = []) {
301
298
  symbols = upperCaseSymbols(symbols)
302
299
 
303
300
  const filters: FilterForExchange['huobi-dm-swap'][] = [
@@ -381,7 +378,7 @@ class HuobiLiquidationsMapper implements Mapper<'huobi-dm' | 'huobi-dm-swap' | '
381
378
  return message.topic.endsWith('.liquidation_orders')
382
379
  }
383
380
 
384
- getFilters(symbols?: string[]) {
381
+ getFilters(symbols: string[] = []) {
385
382
  symbols = upperCaseSymbols(symbols)
386
383
 
387
384
  if (this._exchange === 'huobi-dm') {
@@ -389,9 +386,7 @@ class HuobiLiquidationsMapper implements Mapper<'huobi-dm' | 'huobi-dm-swap' | '
389
386
  // not futures names like 'BTC_NW'
390
387
  // see https://huobiapi.github.io/docs/dm/v1/en/#subscribe-liquidation-order-data-no-authentication-sub
391
388
 
392
- if (symbols !== undefined) {
393
- symbols = symbols.map((s) => s.split('_')[0])
394
- }
389
+ symbols = symbols.map((s) => s.split('_')[0])
395
390
 
396
391
  // we also need to subscribe to contract_info which will provide us information that will allow us to map
397
392
  // liquidation message symbol and contract code to symbols we expect (BTC_NW etc)
@@ -463,14 +458,11 @@ class HuobiOptionsSummaryMapper implements Mapper<'huobi-dm-options', OptionSumm
463
458
  return message.ch.endsWith('.open_interest') || message.ch.endsWith('.option_index') || message.ch.endsWith('.option_market_index')
464
459
  }
465
460
 
466
- getFilters(symbols?: string[]) {
467
- const indexes =
468
- symbols !== undefined
469
- ? symbols.map((s) => {
470
- const symbolParts = s.split('-')
471
- return `${symbolParts[0]}-${symbolParts[1]}`
472
- })
473
- : undefined
461
+ getFilters(symbols: string[] = []) {
462
+ const indexes = symbols.map((s) => {
463
+ const symbolParts = s.split('-')
464
+ return `${symbolParts[0]}-${symbolParts[1]}`
465
+ })
474
466
 
475
467
  return [
476
468
  {
@@ -571,7 +563,7 @@ class HuobiBookTickerMapper implements Mapper<'huobi' | 'huobi-dm' | 'huobi-dm-s
571
563
  return message.ch.endsWith('.bbo')
572
564
  }
573
565
 
574
- getFilters(symbols?: string[]) {
566
+ getFilters(symbols: string[] = []) {
575
567
  symbols = normalizeSymbols(symbols)
576
568
 
577
569
  return [
@@ -33,18 +33,15 @@ function getApiSymbolId(symbol: string) {
33
33
 
34
34
  return symbol
35
35
  }
36
- function getSymbols(symbols?: string[]) {
37
- if (symbols !== undefined) {
38
- return symbols.map(getApiSymbolId)
39
- }
40
- return
36
+ function getSymbols(symbols: string[]) {
37
+ return symbols.map(getApiSymbolId)
41
38
  }
42
39
  class HyperliquidTradesMapper implements Mapper<'hyperliquid', Trade> {
43
40
  canHandle(message: HyperliquidTradeMessage) {
44
41
  return message.channel === 'trades'
45
42
  }
46
43
 
47
- getFilters(symbols?: string[]) {
44
+ getFilters(symbols: string[] = []) {
48
45
  symbols = getSymbols(symbols)
49
46
 
50
47
  return [
@@ -101,7 +98,7 @@ class HyperliquidBookChangeMapper implements Mapper<'hyperliquid', BookChange> {
101
98
  return this.filterChannel === 'fastBook' ? isFastBook : message.channel === 'l2Book' && isFastBook === false
102
99
  }
103
100
 
104
- getFilters(symbols?: string[]) {
101
+ getFilters(symbols: string[] = []) {
105
102
  symbols = getSymbols(symbols)
106
103
 
107
104
  return [
@@ -131,7 +128,7 @@ class HyperliquidBookTickerMapper implements Mapper<'hyperliquid', BookTicker> {
131
128
  return message.channel === 'bbo'
132
129
  }
133
130
 
134
- getFilters(symbols?: string[]) {
131
+ getFilters(symbols: string[] = []) {
135
132
  symbols = getSymbols(symbols)
136
133
 
137
134
  return [
@@ -170,7 +167,7 @@ class HyperliquidDerivativeTickerMapper implements Mapper<'hyperliquid', Derivat
170
167
  return message.channel === 'activeAssetCtx'
171
168
  }
172
169
 
173
- getFilters(symbols?: string[]) {
170
+ getFilters(symbols: string[] = []) {
174
171
  symbols = getSymbols(symbols)
175
172
 
176
173
  return [
@@ -30,7 +30,7 @@ const krakenTradesMapper: Mapper<'kraken', Trade> = {
30
30
  return channel === 'trade'
31
31
  },
32
32
 
33
- getFilters(symbols?: string[]) {
33
+ getFilters(symbols: string[] = []) {
34
34
  return [
35
35
  {
36
36
  channel: 'trade',
@@ -88,7 +88,7 @@ const krakenBookChangeMapper: Mapper<'kraken', BookChange> = {
88
88
  return channel.startsWith('book')
89
89
  },
90
90
 
91
- getFilters(symbols?: string[]) {
91
+ getFilters(symbols: string[] = []) {
92
92
  return [
93
93
  {
94
94
  channel: 'book',
@@ -144,7 +144,7 @@ const krakenBookTickerMapper: Mapper<'kraken', BookTicker> = {
144
144
  return channel === 'spread'
145
145
  },
146
146
 
147
- getFilters(symbols?: string[]) {
147
+ getFilters(symbols: string[] = []) {
148
148
  return [
149
149
  {
150
150
  channel: 'spread',
@@ -234,7 +234,7 @@ class KrakenV2TradesMapper implements Mapper<'kraken', Trade> {
234
234
  return message.channel === 'trade' && message.type === 'update'
235
235
  }
236
236
 
237
- getFilters(symbols?: string[]) {
237
+ getFilters(symbols: string[] = []) {
238
238
  return [{ channel: 'trade', symbols } as const]
239
239
  }
240
240
 
@@ -264,7 +264,7 @@ class KrakenV2BookChangeMapper implements Mapper<'kraken', BookChange> {
264
264
  return message.channel === 'book'
265
265
  }
266
266
 
267
- getFilters(symbols?: string[]) {
267
+ getFilters(symbols: string[] = []) {
268
268
  return [{ channel: 'book', symbols } as const]
269
269
  }
270
270
 
@@ -300,7 +300,7 @@ class KrakenV2BookTickerMapper implements Mapper<'kraken', BookTicker> {
300
300
  return message.channel === 'ticker'
301
301
  }
302
302
 
303
- getFilters(symbols?: string[]) {
303
+ getFilters(symbols: string[] = []) {
304
304
  return [{ channel: 'ticker', symbols } as const]
305
305
  }
306
306
 
@@ -19,7 +19,7 @@ class KucoinTradesMapper implements Mapper<'kucoin', Trade> {
19
19
  return message.type === 'message' && message.topic.startsWith('/market/match')
20
20
  }
21
21
 
22
- getFilters(symbols?: string[]) {
22
+ getFilters(symbols: string[] = []) {
23
23
  symbols = upperCaseSymbols(symbols)
24
24
 
25
25
  return [
@@ -69,7 +69,7 @@ class KucoinBookChangeMapper implements Mapper<'kucoin', BookChange> {
69
69
  return message.type === 'message' && message.topic.startsWith('/market/level2')
70
70
  }
71
71
 
72
- getFilters(symbols?: string[]) {
72
+ getFilters(symbols: string[] = []) {
73
73
  symbols = upperCaseSymbols(symbols)
74
74
  return [
75
75
  {
@@ -242,7 +242,7 @@ class KucoinBookTickerMapper implements Mapper<'kucoin', BookTicker> {
242
242
  return message.type === 'message' && message.topic.startsWith('/market/ticker')
243
243
  }
244
244
 
245
- getFilters(symbols?: string[]) {
245
+ getFilters(symbols: string[] = []) {
246
246
  symbols = upperCaseSymbols(symbols)
247
247
  return [
248
248
  {
@@ -19,7 +19,7 @@ class KucoinFuturesTradesMapper implements Mapper<'kucoin-futures', Trade> {
19
19
  return message.type === 'message' && message.topic.startsWith('/contractMarket/execution')
20
20
  }
21
21
 
22
- getFilters(symbols?: string[]) {
22
+ getFilters(symbols: string[] = []) {
23
23
  symbols = upperCaseSymbols(symbols)
24
24
 
25
25
  return [
@@ -64,7 +64,7 @@ class KucoinFuturesBookChangeMapper implements Mapper<'kucoin-futures', BookChan
64
64
  return message.type === 'message' && message.topic.startsWith('/contractMarket/level2')
65
65
  }
66
66
 
67
- getFilters(symbols?: string[]) {
67
+ getFilters(symbols: string[] = []) {
68
68
  symbols = upperCaseSymbols(symbols)
69
69
  return [
70
70
  {
@@ -249,7 +249,7 @@ class KucoinFuturesBookTickerMapper implements Mapper<'kucoin-futures', BookTick
249
249
  return message.type === 'message' && message.topic.startsWith('/contractMarket/tickerV2')
250
250
  }
251
251
 
252
- getFilters(symbols?: string[]) {
252
+ getFilters(symbols: string[] = []) {
253
253
  symbols = upperCaseSymbols(symbols)
254
254
  return [
255
255
  {
@@ -296,7 +296,7 @@ class KucoinFuturesDerivativeTickerMapper implements Mapper<'kucoin-futures', De
296
296
  )
297
297
  }
298
298
 
299
- getFilters(symbols?: string[]) {
299
+ getFilters(symbols: string[] = []) {
300
300
  symbols = upperCaseSymbols(symbols)
301
301
  return [
302
302
  {
@@ -39,7 +39,7 @@ class LighterTradesMapper<T extends LighterExchange> implements Mapper<T, Trade>
39
39
  return message.type === 'update/trade'
40
40
  }
41
41
 
42
- getFilters(symbols?: string[]) {
42
+ getFilters(symbols: string[] = []) {
43
43
  return [
44
44
  {
45
45
  channel: 'trade' as const,
@@ -72,7 +72,7 @@ class LighterLiquidationMapper<T extends LighterExchange> implements Mapper<T, L
72
72
  return message.type === 'update/trade'
73
73
  }
74
74
 
75
- getFilters(symbols?: string[]) {
75
+ getFilters(symbols: string[] = []) {
76
76
  return [
77
77
  {
78
78
  channel: 'trade' as const,
@@ -113,7 +113,7 @@ class LighterBookChangeMapper<T extends LighterExchange> implements Mapper<T, Bo
113
113
  return message.type === 'subscribed/order_book' || message.type === 'update/order_book'
114
114
  }
115
115
 
116
- getFilters(symbols?: string[]) {
116
+ getFilters(symbols: string[] = []) {
117
117
  return [
118
118
  {
119
119
  channel: 'order_book' as const,
@@ -153,7 +153,7 @@ class LighterBookTickerMapper<T extends LighterExchange> implements Mapper<T, Bo
153
153
  return message.type === 'update/ticker' || message.type === 'subscribed/ticker'
154
154
  }
155
155
 
156
- getFilters(symbols?: string[]) {
156
+ getFilters(symbols: string[] = []) {
157
157
  return [
158
158
  {
159
159
  channel: 'ticker' as const,
@@ -189,7 +189,7 @@ class LighterDerivativeTickerMapper<T extends LighterExchange> implements Mapper
189
189
  return message.type === 'update/market_stats' || message.type === 'subscribed/market_stats'
190
190
  }
191
191
 
192
- getFilters(_symbols?: string[]) {
192
+ getFilters(_symbols: string[] = []) {
193
193
  return [
194
194
  {
195
195
  channel: 'market_stats' as const,
@@ -8,9 +8,9 @@ export type Mapper<T extends Exchange, U extends NormalizedData> = {
8
8
  /**
9
9
  * Returns the channel filters this mapper needs for the requested symbols.
10
10
  *
11
- * `undefined` and `[]` both mean all symbols, in the argument and in returned filters.
12
- * Mappers that narrow symbols per channel must check `isNullOrEmptyArray(symbols)` before filtering,
13
- * so that an empty request is not mistaken for "no matching symbols".
11
+ * Replay and streaming pass `[]` when no symbols are requested; `[]` means all symbols.
12
+ * Every returned filter carries a `symbols` array: the requested symbols, or their
13
+ * channel-specific identifiers. Do not narrow them by instrument type; `map` decides output.
14
14
  */
15
15
  getFilters: (symbols?: string[]) => FilterForExchange[T][]
16
16
  }
@@ -19,7 +19,7 @@ export class MexcTradesMapper implements Mapper<'mexc', Trade> {
19
19
  return message.channel?.startsWith(`${this.channel}@`) === true && 'publicAggreDeals' in message
20
20
  }
21
21
 
22
- getFilters(symbols?: string[]) {
22
+ getFilters(symbols: string[] = []) {
23
23
  return [{ channel: this.channel, symbols: upperCaseSymbols(symbols) } as const]
24
24
  }
25
25
 
@@ -56,7 +56,7 @@ export class MexcBookChangeMapper implements Mapper<'mexc', BookChange> {
56
56
  : message.channel?.startsWith(`${this.channel}@`) === true && 'publicAggreDepths' in message
57
57
  }
58
58
 
59
- getFilters(symbols?: string[]) {
59
+ getFilters(symbols: string[] = []) {
60
60
  const normalizedSymbols = upperCaseSymbols(symbols)
61
61
 
62
62
  return [
@@ -209,7 +209,7 @@ export class MexcBookTickerMapper implements Mapper<'mexc', BookTicker> {
209
209
  return message.channel?.startsWith(`${this.channel}@`) === true && 'publicAggreBookTicker' in message
210
210
  }
211
211
 
212
- getFilters(symbols?: string[]) {
212
+ getFilters(symbols: string[] = []) {
213
213
  return [{ channel: this.channel, symbols: upperCaseSymbols(symbols) } as const]
214
214
  }
215
215
 
@@ -18,7 +18,7 @@ export class MexcFuturesTradesMapper implements Mapper<'mexc-futures', Trade> {
18
18
  return message.channel === 'push.deal'
19
19
  }
20
20
 
21
- getFilters(symbols?: string[]) {
21
+ getFilters(symbols: string[] = []) {
22
22
  return [{ channel: 'push.deal', symbols: upperCaseSymbols(symbols) } as const]
23
23
  }
24
24
 
@@ -51,7 +51,7 @@ export class MexcFuturesBookChangeMapper implements Mapper<'mexc-futures', BookC
51
51
  return message.channel === 'push.depth' || message.channel === 'push.depth.snapshot'
52
52
  }
53
53
 
54
- getFilters(symbols?: string[]) {
54
+ getFilters(symbols: string[] = []) {
55
55
  const normalizedSymbols = upperCaseSymbols(symbols)
56
56
 
57
57
  return [
@@ -200,7 +200,7 @@ export class MexcFuturesDerivativeTickerMapper implements Mapper<'mexc-futures',
200
200
  return message.channel === 'push.ticker' || message.channel === 'push.funding.rate'
201
201
  }
202
202
 
203
- getFilters(symbols?: string[]) {
203
+ getFilters(symbols: string[] = []) {
204
204
  const normalizedSymbols = upperCaseSymbols(symbols)
205
205
 
206
206
  return [