tardis-dev 18.10.1 → 18.11.0

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 (345) hide show
  1. package/README.md +2 -0
  2. package/dist/handy.d.ts +2 -3
  3. package/dist/handy.d.ts.map +1 -1
  4. package/dist/handy.js +3 -12
  5. package/dist/handy.js.map +1 -1
  6. package/dist/mappers/ascendex.js +4 -4
  7. package/dist/mappers/ascendex.js.map +1 -1
  8. package/dist/mappers/aster.js +5 -8
  9. package/dist/mappers/aster.js.map +1 -1
  10. package/dist/mappers/backpack.d.ts.map +1 -1
  11. package/dist/mappers/backpack.js +16 -25
  12. package/dist/mappers/backpack.js.map +1 -1
  13. package/dist/mappers/binance.js +6 -6
  14. package/dist/mappers/binance.js.map +1 -1
  15. package/dist/mappers/binancedex.js +3 -3
  16. package/dist/mappers/binancedex.js.map +1 -1
  17. package/dist/mappers/binanceeuropeanoptions.js +11 -33
  18. package/dist/mappers/binanceeuropeanoptions.js.map +1 -1
  19. package/dist/mappers/bitfinex.js +5 -9
  20. package/dist/mappers/bitfinex.js.map +1 -1
  21. package/dist/mappers/bitflyer.js +3 -3
  22. package/dist/mappers/bitflyer.js.map +1 -1
  23. package/dist/mappers/bitget.js +9 -14
  24. package/dist/mappers/bitget.js.map +1 -1
  25. package/dist/mappers/bithumb.js +2 -2
  26. package/dist/mappers/bithumb.js.map +1 -1
  27. package/dist/mappers/bitmex.js +5 -5
  28. package/dist/mappers/bitmex.js.map +1 -1
  29. package/dist/mappers/bitnomial.js +2 -2
  30. package/dist/mappers/bitnomial.js.map +1 -1
  31. package/dist/mappers/bitstamp.js +3 -3
  32. package/dist/mappers/bitstamp.js.map +1 -1
  33. package/dist/mappers/bitvavo.js +12 -11
  34. package/dist/mappers/bitvavo.js.map +1 -1
  35. package/dist/mappers/blockchaincom.js +2 -2
  36. package/dist/mappers/blockchaincom.js.map +1 -1
  37. package/dist/mappers/bullish.js +7 -7
  38. package/dist/mappers/bullish.js.map +1 -1
  39. package/dist/mappers/bybit.js +11 -11
  40. package/dist/mappers/bybit.js.map +1 -1
  41. package/dist/mappers/bybitspot.d.ts +3 -3
  42. package/dist/mappers/bybitspot.d.ts.map +1 -1
  43. package/dist/mappers/bybitspot.js +3 -3
  44. package/dist/mappers/bybitspot.js.map +1 -1
  45. package/dist/mappers/coinbase.js +3 -3
  46. package/dist/mappers/coinbase.js.map +1 -1
  47. package/dist/mappers/coinbasederivatives.js +4 -4
  48. package/dist/mappers/coinbasederivatives.js.map +1 -1
  49. package/dist/mappers/coinbaseinternational.js +8 -8
  50. package/dist/mappers/coinbaseinternational.js.map +1 -1
  51. package/dist/mappers/coinflex.js +3 -3
  52. package/dist/mappers/coinflex.js.map +1 -1
  53. package/dist/mappers/cryptocom.js +5 -8
  54. package/dist/mappers/cryptocom.js.map +1 -1
  55. package/dist/mappers/cryptofacilities.js +6 -6
  56. package/dist/mappers/cryptofacilities.js.map +1 -1
  57. package/dist/mappers/delta.js +4 -4
  58. package/dist/mappers/delta.js.map +1 -1
  59. package/dist/mappers/delta_india.js +8 -14
  60. package/dist/mappers/delta_india.js.map +1 -1
  61. package/dist/mappers/deribit.js +21 -24
  62. package/dist/mappers/deribit.js.map +1 -1
  63. package/dist/mappers/dydx.js +3 -3
  64. package/dist/mappers/dydx.js.map +1 -1
  65. package/dist/mappers/dydxv4.js +4 -4
  66. package/dist/mappers/dydxv4.js.map +1 -1
  67. package/dist/mappers/ftx.js +5 -5
  68. package/dist/mappers/ftx.js.map +1 -1
  69. package/dist/mappers/gateio.js +6 -6
  70. package/dist/mappers/gateio.js.map +1 -1
  71. package/dist/mappers/gateiofutures.js +6 -6
  72. package/dist/mappers/gateiofutures.js.map +1 -1
  73. package/dist/mappers/gemini.js +5 -5
  74. package/dist/mappers/gemini.js.map +1 -1
  75. package/dist/mappers/hitbtc.js +2 -2
  76. package/dist/mappers/hitbtc.js.map +1 -1
  77. package/dist/mappers/huobi.js +20 -27
  78. package/dist/mappers/huobi.js.map +1 -1
  79. package/dist/mappers/hyperliquid.js +5 -8
  80. package/dist/mappers/hyperliquid.js.map +1 -1
  81. package/dist/mappers/kraken.js +6 -6
  82. package/dist/mappers/kraken.js.map +1 -1
  83. package/dist/mappers/kucoin.js +3 -3
  84. package/dist/mappers/kucoin.js.map +1 -1
  85. package/dist/mappers/kucoinfutures.js +4 -4
  86. package/dist/mappers/kucoinfutures.js.map +1 -1
  87. package/dist/mappers/lighter.js +5 -5
  88. package/dist/mappers/lighter.js.map +1 -1
  89. package/dist/mappers/mapper.d.ts +3 -3
  90. package/dist/mappers/mexc.d.ts +4 -4
  91. package/dist/mappers/mexc.d.ts.map +1 -1
  92. package/dist/mappers/mexc.js +3 -3
  93. package/dist/mappers/mexc.js.map +1 -1
  94. package/dist/mappers/mexcfutures.d.ts +5 -5
  95. package/dist/mappers/mexcfutures.d.ts.map +1 -1
  96. package/dist/mappers/mexcfutures.js +3 -3
  97. package/dist/mappers/mexcfutures.js.map +1 -1
  98. package/dist/mappers/okex.js +19 -21
  99. package/dist/mappers/okex.js.map +1 -1
  100. package/dist/mappers/okexspreads.d.ts +3 -3
  101. package/dist/mappers/okexspreads.d.ts.map +1 -1
  102. package/dist/mappers/okexspreads.js +3 -3
  103. package/dist/mappers/okexspreads.js.map +1 -1
  104. package/dist/mappers/phemex.js +18 -12
  105. package/dist/mappers/phemex.js.map +1 -1
  106. package/dist/mappers/poloniex.js +4 -4
  107. package/dist/mappers/poloniex.js.map +1 -1
  108. package/dist/mappers/polymarket.js +3 -3
  109. package/dist/mappers/polymarket.js.map +1 -1
  110. package/dist/mappers/serum.js +3 -3
  111. package/dist/mappers/serum.js.map +1 -1
  112. package/dist/mappers/upbit.js +2 -2
  113. package/dist/mappers/upbit.js.map +1 -1
  114. package/dist/mappers/whitebit.js +8 -12
  115. package/dist/mappers/whitebit.js.map +1 -1
  116. package/dist/mappers/woox.js +10 -12
  117. package/dist/mappers/woox.js.map +1 -1
  118. package/dist/realtimefeeds/aster.d.ts +3 -2
  119. package/dist/realtimefeeds/aster.d.ts.map +1 -1
  120. package/dist/realtimefeeds/aster.js +12 -2
  121. package/dist/realtimefeeds/aster.js.map +1 -1
  122. package/dist/realtimefeeds/backpack.d.ts +3 -2
  123. package/dist/realtimefeeds/backpack.d.ts.map +1 -1
  124. package/dist/realtimefeeds/backpack.js +9 -2
  125. package/dist/realtimefeeds/backpack.js.map +1 -1
  126. package/dist/realtimefeeds/binance.d.ts +7 -5
  127. package/dist/realtimefeeds/binance.d.ts.map +1 -1
  128. package/dist/realtimefeeds/binance.js +42 -9
  129. package/dist/realtimefeeds/binance.js.map +1 -1
  130. package/dist/realtimefeeds/binanceeuropeanoptions.d.ts +2 -2
  131. package/dist/realtimefeeds/binanceeuropeanoptions.d.ts.map +1 -1
  132. package/dist/realtimefeeds/binanceeuropeanoptions.js +5 -5
  133. package/dist/realtimefeeds/binanceeuropeanoptions.js.map +1 -1
  134. package/dist/realtimefeeds/bitget.d.ts +2 -1
  135. package/dist/realtimefeeds/bitget.d.ts.map +1 -1
  136. package/dist/realtimefeeds/bitget.js +10 -0
  137. package/dist/realtimefeeds/bitget.js.map +1 -1
  138. package/dist/realtimefeeds/bitstamp.d.ts +1 -1
  139. package/dist/realtimefeeds/bitstamp.d.ts.map +1 -1
  140. package/dist/realtimefeeds/bitstamp.js +2 -2
  141. package/dist/realtimefeeds/bitstamp.js.map +1 -1
  142. package/dist/realtimefeeds/bitvavo.d.ts +2 -1
  143. package/dist/realtimefeeds/bitvavo.d.ts.map +1 -1
  144. package/dist/realtimefeeds/bitvavo.js +10 -0
  145. package/dist/realtimefeeds/bitvavo.js.map +1 -1
  146. package/dist/realtimefeeds/bullish.d.ts +2 -2
  147. package/dist/realtimefeeds/bullish.d.ts.map +1 -1
  148. package/dist/realtimefeeds/bullish.js +4 -4
  149. package/dist/realtimefeeds/bullish.js.map +1 -1
  150. package/dist/realtimefeeds/bybit.d.ts +3 -2
  151. package/dist/realtimefeeds/bybit.d.ts.map +1 -1
  152. package/dist/realtimefeeds/bybit.js +18 -3
  153. package/dist/realtimefeeds/bybit.js.map +1 -1
  154. package/dist/realtimefeeds/coinbase.d.ts +4 -1
  155. package/dist/realtimefeeds/coinbase.d.ts.map +1 -1
  156. package/dist/realtimefeeds/coinbase.js +22 -0
  157. package/dist/realtimefeeds/coinbase.js.map +1 -1
  158. package/dist/realtimefeeds/coinbasederivatives.d.ts +3 -7
  159. package/dist/realtimefeeds/coinbasederivatives.d.ts.map +1 -1
  160. package/dist/realtimefeeds/coinbasederivatives.js +10 -12
  161. package/dist/realtimefeeds/coinbasederivatives.js.map +1 -1
  162. package/dist/realtimefeeds/cryptofacilities.d.ts +2 -1
  163. package/dist/realtimefeeds/cryptofacilities.d.ts.map +1 -1
  164. package/dist/realtimefeeds/cryptofacilities.js +6 -0
  165. package/dist/realtimefeeds/cryptofacilities.js.map +1 -1
  166. package/dist/realtimefeeds/delta.d.ts +2 -1
  167. package/dist/realtimefeeds/delta.d.ts.map +1 -1
  168. package/dist/realtimefeeds/delta.js +9 -0
  169. package/dist/realtimefeeds/delta.js.map +1 -1
  170. package/dist/realtimefeeds/delta_india.d.ts +4 -3
  171. package/dist/realtimefeeds/delta_india.d.ts.map +1 -1
  172. package/dist/realtimefeeds/delta_india.js +22 -17
  173. package/dist/realtimefeeds/delta_india.js.map +1 -1
  174. package/dist/realtimefeeds/deribit.d.ts +2 -1
  175. package/dist/realtimefeeds/deribit.d.ts.map +1 -1
  176. package/dist/realtimefeeds/deribit.js +11 -0
  177. package/dist/realtimefeeds/deribit.js.map +1 -1
  178. package/dist/realtimefeeds/ftx.d.ts +2 -2
  179. package/dist/realtimefeeds/ftx.d.ts.map +1 -1
  180. package/dist/realtimefeeds/ftx.js +9 -8
  181. package/dist/realtimefeeds/ftx.js.map +1 -1
  182. package/dist/realtimefeeds/gateio.d.ts +2 -1
  183. package/dist/realtimefeeds/gateio.d.ts.map +1 -1
  184. package/dist/realtimefeeds/gateio.js +10 -0
  185. package/dist/realtimefeeds/gateio.js.map +1 -1
  186. package/dist/realtimefeeds/gateiofutures.d.ts +5 -4
  187. package/dist/realtimefeeds/gateiofutures.d.ts.map +1 -1
  188. package/dist/realtimefeeds/gateiofutures.js +24 -14
  189. package/dist/realtimefeeds/gateiofutures.js.map +1 -1
  190. package/dist/realtimefeeds/gemini.d.ts +4 -1
  191. package/dist/realtimefeeds/gemini.d.ts.map +1 -1
  192. package/dist/realtimefeeds/gemini.js +25 -0
  193. package/dist/realtimefeeds/gemini.js.map +1 -1
  194. package/dist/realtimefeeds/hitbtc.d.ts +2 -1
  195. package/dist/realtimefeeds/hitbtc.d.ts.map +1 -1
  196. package/dist/realtimefeeds/hitbtc.js +10 -0
  197. package/dist/realtimefeeds/hitbtc.js.map +1 -1
  198. package/dist/realtimefeeds/huobi.d.ts +8 -7
  199. package/dist/realtimefeeds/huobi.d.ts.map +1 -1
  200. package/dist/realtimefeeds/huobi.js +49 -21
  201. package/dist/realtimefeeds/huobi.js.map +1 -1
  202. package/dist/realtimefeeds/index.d.ts +1 -1
  203. package/dist/realtimefeeds/index.d.ts.map +1 -1
  204. package/dist/realtimefeeds/index.js +2 -2
  205. package/dist/realtimefeeds/index.js.map +1 -1
  206. package/dist/realtimefeeds/kucoin.d.ts +2 -1
  207. package/dist/realtimefeeds/kucoin.d.ts.map +1 -1
  208. package/dist/realtimefeeds/kucoin.js +10 -0
  209. package/dist/realtimefeeds/kucoin.js.map +1 -1
  210. package/dist/realtimefeeds/kucoinfutures.d.ts +4 -3
  211. package/dist/realtimefeeds/kucoinfutures.d.ts.map +1 -1
  212. package/dist/realtimefeeds/kucoinfutures.js +15 -4
  213. package/dist/realtimefeeds/kucoinfutures.js.map +1 -1
  214. package/dist/realtimefeeds/lighter.d.ts +2 -1
  215. package/dist/realtimefeeds/lighter.d.ts.map +1 -1
  216. package/dist/realtimefeeds/lighter.js +10 -0
  217. package/dist/realtimefeeds/lighter.js.map +1 -1
  218. package/dist/realtimefeeds/mexc.d.ts +2 -1
  219. package/dist/realtimefeeds/mexc.d.ts.map +1 -1
  220. package/dist/realtimefeeds/mexc.js +10 -0
  221. package/dist/realtimefeeds/mexc.js.map +1 -1
  222. package/dist/realtimefeeds/mexcfutures.d.ts +2 -1
  223. package/dist/realtimefeeds/mexcfutures.d.ts.map +1 -1
  224. package/dist/realtimefeeds/mexcfutures.js +11 -0
  225. package/dist/realtimefeeds/mexcfutures.js.map +1 -1
  226. package/dist/realtimefeeds/okex.d.ts +7 -5
  227. package/dist/realtimefeeds/okex.d.ts.map +1 -1
  228. package/dist/realtimefeeds/okex.js +32 -11
  229. package/dist/realtimefeeds/okex.js.map +1 -1
  230. package/dist/realtimefeeds/phemex.d.ts.map +1 -1
  231. package/dist/realtimefeeds/phemex.js +1 -0
  232. package/dist/realtimefeeds/phemex.js.map +1 -1
  233. package/dist/realtimefeeds/poloniex.d.ts +2 -1
  234. package/dist/realtimefeeds/poloniex.d.ts.map +1 -1
  235. package/dist/realtimefeeds/poloniex.js +11 -0
  236. package/dist/realtimefeeds/poloniex.js.map +1 -1
  237. package/dist/realtimefeeds/polymarket.d.ts +1 -1
  238. package/dist/realtimefeeds/polymarket.d.ts.map +1 -1
  239. package/dist/realtimefeeds/polymarket.js +3 -3
  240. package/dist/realtimefeeds/polymarket.js.map +1 -1
  241. package/dist/realtimefeeds/realtimefeed.d.ts +20 -4
  242. package/dist/realtimefeeds/realtimefeed.d.ts.map +1 -1
  243. package/dist/realtimefeeds/realtimefeed.js +41 -3
  244. package/dist/realtimefeeds/realtimefeed.js.map +1 -1
  245. package/dist/realtimefeeds/whitebit.d.ts +4 -11
  246. package/dist/realtimefeeds/whitebit.d.ts.map +1 -1
  247. package/dist/realtimefeeds/whitebit.js +23 -19
  248. package/dist/realtimefeeds/whitebit.js.map +1 -1
  249. package/dist/realtimefeeds/woox.d.ts +2 -1
  250. package/dist/realtimefeeds/woox.d.ts.map +1 -1
  251. package/dist/realtimefeeds/woox.js +11 -0
  252. package/dist/realtimefeeds/woox.js.map +1 -1
  253. package/dist/stream.d.ts +4 -2
  254. package/dist/stream.d.ts.map +1 -1
  255. package/dist/stream.js +10 -9
  256. package/dist/stream.js.map +1 -1
  257. package/package.json +1 -1
  258. package/src/handy.ts +5 -15
  259. package/src/mappers/ascendex.ts +4 -4
  260. package/src/mappers/aster.ts +5 -11
  261. package/src/mappers/backpack.ts +17 -23
  262. package/src/mappers/binance.ts +6 -6
  263. package/src/mappers/binancedex.ts +3 -3
  264. package/src/mappers/binanceeuropeanoptions.ts +11 -39
  265. package/src/mappers/bitfinex.ts +5 -9
  266. package/src/mappers/bitflyer.ts +3 -3
  267. package/src/mappers/bitget.ts +9 -14
  268. package/src/mappers/bithumb.ts +2 -2
  269. package/src/mappers/bitmex.ts +5 -5
  270. package/src/mappers/bitnomial.ts +2 -2
  271. package/src/mappers/bitstamp.ts +3 -3
  272. package/src/mappers/bitvavo.ts +21 -19
  273. package/src/mappers/blockchaincom.ts +2 -2
  274. package/src/mappers/bullish.ts +7 -7
  275. package/src/mappers/bybit.ts +11 -11
  276. package/src/mappers/bybitspot.ts +3 -3
  277. package/src/mappers/coinbase.ts +3 -3
  278. package/src/mappers/coinbasederivatives.ts +4 -4
  279. package/src/mappers/coinbaseinternational.ts +9 -9
  280. package/src/mappers/coinflex.ts +3 -3
  281. package/src/mappers/cryptocom.ts +5 -8
  282. package/src/mappers/cryptofacilities.ts +6 -6
  283. package/src/mappers/delta.ts +4 -4
  284. package/src/mappers/delta_india.ts +8 -14
  285. package/src/mappers/deribit.ts +21 -25
  286. package/src/mappers/dydx.ts +3 -3
  287. package/src/mappers/dydxv4.ts +4 -4
  288. package/src/mappers/ftx.ts +5 -5
  289. package/src/mappers/gateio.ts +6 -6
  290. package/src/mappers/gateiofutures.ts +6 -6
  291. package/src/mappers/gemini.ts +5 -5
  292. package/src/mappers/hitbtc.ts +2 -2
  293. package/src/mappers/huobi.ts +21 -29
  294. package/src/mappers/hyperliquid.ts +6 -9
  295. package/src/mappers/kraken.ts +6 -6
  296. package/src/mappers/kucoin.ts +3 -3
  297. package/src/mappers/kucoinfutures.ts +4 -4
  298. package/src/mappers/lighter.ts +5 -5
  299. package/src/mappers/mapper.ts +3 -3
  300. package/src/mappers/mexc.ts +3 -3
  301. package/src/mappers/mexcfutures.ts +3 -3
  302. package/src/mappers/okex.ts +19 -25
  303. package/src/mappers/okexspreads.ts +3 -3
  304. package/src/mappers/phemex.ts +18 -12
  305. package/src/mappers/poloniex.ts +4 -4
  306. package/src/mappers/polymarket.ts +3 -3
  307. package/src/mappers/serum.ts +3 -3
  308. package/src/mappers/upbit.ts +2 -2
  309. package/src/mappers/whitebit.ts +8 -14
  310. package/src/mappers/woox.ts +10 -13
  311. package/src/realtimefeeds/aster.ts +21 -3
  312. package/src/realtimefeeds/backpack.ts +17 -3
  313. package/src/realtimefeeds/binance.ts +68 -11
  314. package/src/realtimefeeds/binanceeuropeanoptions.ts +14 -5
  315. package/src/realtimefeeds/bitget.ts +13 -1
  316. package/src/realtimefeeds/bitstamp.ts +8 -2
  317. package/src/realtimefeeds/bitvavo.ts +13 -1
  318. package/src/realtimefeeds/bullish.ts +11 -4
  319. package/src/realtimefeeds/bybit.ts +27 -4
  320. package/src/realtimefeeds/coinbase.ts +34 -1
  321. package/src/realtimefeeds/coinbasederivatives.ts +18 -13
  322. package/src/realtimefeeds/cryptofacilities.ts +9 -1
  323. package/src/realtimefeeds/delta.ts +13 -1
  324. package/src/realtimefeeds/delta_india.ts +31 -17
  325. package/src/realtimefeeds/deribit.ts +13 -1
  326. package/src/realtimefeeds/ftx.ts +17 -8
  327. package/src/realtimefeeds/gateio.ts +13 -1
  328. package/src/realtimefeeds/gateiofutures.ts +37 -17
  329. package/src/realtimefeeds/gemini.ts +28 -1
  330. package/src/realtimefeeds/hitbtc.ts +13 -1
  331. package/src/realtimefeeds/huobi.ts +92 -22
  332. package/src/realtimefeeds/index.ts +3 -2
  333. package/src/realtimefeeds/kucoin.ts +12 -1
  334. package/src/realtimefeeds/kucoinfutures.ts +24 -5
  335. package/src/realtimefeeds/lighter.ts +12 -1
  336. package/src/realtimefeeds/mexc.ts +12 -1
  337. package/src/realtimefeeds/mexcfutures.ts +13 -1
  338. package/src/realtimefeeds/okex.ts +76 -11
  339. package/src/realtimefeeds/phemex.ts +1 -0
  340. package/src/realtimefeeds/poloniex.ts +13 -1
  341. package/src/realtimefeeds/polymarket.ts +4 -3
  342. package/src/realtimefeeds/realtimefeed.ts +53 -5
  343. package/src/realtimefeeds/whitebit.ts +30 -18
  344. package/src/realtimefeeds/woox.ts +13 -1
  345. package/src/stream.ts +37 -8
@@ -1,4 +1,4 @@
1
- import { asNonZeroNumberOrUndefined, asNumberOrUndefined, fromMicroSecondsToDate, isNullOrEmptyArray, upperCaseSymbols } from '../handy.ts'
1
+ import { asNonZeroNumberOrUndefined, asNumberOrUndefined, fromMicroSecondsToDate, upperCaseSymbols } from '../handy.ts'
2
2
  import type { BookChange, BookTicker, DerivativeTicker, OptionSummary, Trade } from '../types.ts'
3
3
  import { type Mapper, PendingTickerInfoHelper } from './mapper.ts'
4
4
  import { exchangeMappers } from './registry.ts'
@@ -18,7 +18,7 @@ class DeltaIndiaTradesMapper implements Mapper<'delta-india', Trade> {
18
18
  return message.type === 'trades'
19
19
  }
20
20
 
21
- getFilters(symbols?: string[]) {
21
+ getFilters(symbols: string[] = []) {
22
22
  return [{ channel: 'trades', symbols: upperCaseSymbols(symbols) } as const]
23
23
  }
24
24
 
@@ -44,7 +44,7 @@ class DeltaIndiaBookChangeMapper implements Mapper<'delta-india', BookChange> {
44
44
  return message.type === 'ob_updates' && (message.action === 'snapshot' || message.action === 'update')
45
45
  }
46
46
 
47
- getFilters(symbols?: string[]) {
47
+ getFilters(symbols: string[] = []) {
48
48
  return [{ channel: 'ob_updates', symbols: upperCaseSymbols(symbols) } as const]
49
49
  }
50
50
 
@@ -79,7 +79,7 @@ class DeltaIndiaBookTickerMapper implements Mapper<'delta-india', BookTicker> {
79
79
  return message.type === 'ob_l1'
80
80
  }
81
81
 
82
- getFilters(symbols?: string[]) {
82
+ getFilters(symbols: string[] = []) {
83
83
  return [{ channel: 'ob_l1', symbols: upperCaseSymbols(symbols) } as const]
84
84
  }
85
85
 
@@ -105,18 +105,12 @@ class DeltaIndiaDerivativeTickerMapper implements Mapper<'delta-india', Derivati
105
105
  return message.type === 'ticker' || message.type === 'mark_price' || message.type === 'funding_rate'
106
106
  }
107
107
 
108
- getFilters(symbols?: string[]) {
108
+ getFilters(symbols: string[] = []) {
109
109
  symbols = upperCaseSymbols(symbols)
110
- const markPriceSymbols = symbols?.filter(isDerivative).map((symbol) => `MARK:${symbol}`) ?? []
111
- const perpetualSymbols = symbols?.filter((symbol) => !symbol.includes('-') && !symbol.includes('_')) ?? []
112
110
  return [
113
111
  { channel: 'ticker', symbols } as const,
114
- ...(isNullOrEmptyArray(symbols) || markPriceSymbols.length > 0
115
- ? [{ channel: 'mark_price', symbols: markPriceSymbols } as const]
116
- : []),
117
- ...(isNullOrEmptyArray(symbols) || perpetualSymbols.length > 0
118
- ? [{ channel: 'funding_rate', symbols: perpetualSymbols } as const]
119
- : [])
112
+ { channel: 'mark_price', symbols: symbols.map((symbol) => `MARK:${symbol}`) } as const,
113
+ { channel: 'funding_rate', symbols } as const
120
114
  ]
121
115
  }
122
116
 
@@ -169,7 +163,7 @@ class DeltaIndiaOptionSummaryMapper implements Mapper<'delta-india', OptionSumma
169
163
  return message.type === 'ticker'
170
164
  }
171
165
 
172
- getFilters(symbols?: string[]) {
166
+ getFilters(symbols: string[] = []) {
173
167
  return [{ channel: 'ticker', symbols: upperCaseSymbols(symbols) } as const]
174
168
  }
175
169
 
@@ -16,24 +16,20 @@ export const deribitMappers = exchangeMappers({
16
16
  }
17
17
  })
18
18
 
19
- function deribitCasing(symbols?: string[]) {
20
- if (symbols !== undefined) {
21
- return symbols.map((symbol) => {
22
- if (symbol.endsWith('-C') || symbol.endsWith('-P')) {
23
- const parts = symbol.split('-')
24
- if (parts[2] !== undefined && parts[2].toUpperCase().includes('D')) {
25
- parts[2] = parts[2].replace('D', 'd')
26
- return parts.join('-')
27
- } else {
28
- return symbol.toUpperCase()
29
- }
19
+ function deribitCasing(symbols: string[]) {
20
+ return symbols.map((symbol) => {
21
+ if (symbol.endsWith('-C') || symbol.endsWith('-P')) {
22
+ const parts = symbol.split('-')
23
+ if (parts[2] !== undefined && parts[2].toUpperCase().includes('D')) {
24
+ parts[2] = parts[2].replace('D', 'd')
25
+ return parts.join('-')
30
26
  } else {
31
27
  return symbol.toUpperCase()
32
28
  }
33
- })
34
- }
35
-
36
- return
29
+ } else {
30
+ return symbol.toUpperCase()
31
+ }
32
+ })
37
33
  }
38
34
 
39
35
  const deribitTradesMapper: Mapper<'deribit', Trade> = {
@@ -46,7 +42,7 @@ const deribitTradesMapper: Mapper<'deribit', Trade> = {
46
42
  return channel.startsWith('trades')
47
43
  },
48
44
 
49
- getFilters(symbols?: string[]) {
45
+ getFilters(symbols: string[] = []) {
50
46
  symbols = deribitCasing(symbols)
51
47
 
52
48
  return [
@@ -93,7 +89,7 @@ class DeribitBookChangeMapper implements Mapper<'deribit', BookChange> {
93
89
  return channel.startsWith('book')
94
90
  }
95
91
 
96
- getFilters(symbols?: string[]) {
92
+ getFilters(symbols: string[] = []) {
97
93
  symbols = deribitCasing(symbols)
98
94
 
99
95
  return [
@@ -106,11 +102,11 @@ class DeribitBookChangeMapper implements Mapper<'deribit', BookChange> {
106
102
 
107
103
  *map(message: DeribitBookMessage, localTimestamp: Date): IterableIterator<BookChange> {
108
104
  const deribitBookChange = message.params.data
109
- // snapshots do not have prev_change_id set
105
+ // Preserve legacy zero-ID snapshots; explicit changes may omit the link on duplicates.
110
106
  const isSnapshot =
111
- (deribitBookChange.type !== undefined && deribitBookChange.type === 'snapshot') ||
112
- deribitBookChange.prev_change_id === undefined ||
113
- deribitBookChange.prev_change_id === 0
107
+ deribitBookChange.type === 'snapshot' ||
108
+ deribitBookChange.prev_change_id === 0 ||
109
+ (deribitBookChange.type === undefined && deribitBookChange.prev_change_id === undefined)
114
110
 
115
111
  if (isSnapshot) {
116
112
  this._snapshotChangeIds.set(deribitBookChange.instrument_name, deribitBookChange.change_id)
@@ -147,7 +143,7 @@ class DeribitDerivativeTickerMapper implements Mapper<'deribit', DerivativeTicke
147
143
  return channel.startsWith('ticker') && (message.params.data.greeks === undefined || message.params.data.combo_state === 'active')
148
144
  }
149
145
 
150
- getFilters(symbols?: string[]) {
146
+ getFilters(symbols: string[] = []) {
151
147
  symbols = deribitCasing(symbols)
152
148
 
153
149
  return [
@@ -176,7 +172,7 @@ class DeribitDerivativeTickerMapper implements Mapper<'deribit', DerivativeTicke
176
172
  }
177
173
 
178
174
  class DeribitOptionSummaryMapper implements Mapper<'deribit', OptionSummary> {
179
- getFilters(symbols?: string[]) {
175
+ getFilters(symbols: string[] = []) {
180
176
  symbols = deribitCasing(symbols)
181
177
 
182
178
  return [
@@ -265,7 +261,7 @@ const deribitLiquidationsMapper: Mapper<'deribit', Liquidation> = {
265
261
  return channel.startsWith('trades')
266
262
  },
267
263
 
268
- getFilters(symbols?: string[]) {
264
+ getFilters(symbols: string[] = []) {
269
265
  symbols = deribitCasing(symbols)
270
266
 
271
267
  return [
@@ -313,7 +309,7 @@ const deribitBookTickerMapper: Mapper<'deribit', BookTicker> = {
313
309
  return channel.startsWith('ticker')
314
310
  },
315
311
 
316
- getFilters(symbols?: string[]) {
312
+ getFilters(symbols: string[] = []) {
317
313
  symbols = deribitCasing(symbols)
318
314
 
319
315
  return [
@@ -16,7 +16,7 @@ class DydxTradesMapper implements Mapper<'dydx', Trade> {
16
16
  return message.channel === 'v3_trades' && message.type === 'channel_data'
17
17
  }
18
18
 
19
- getFilters(symbols?: string[]) {
19
+ getFilters(symbols: string[] = []) {
20
20
  symbols = upperCaseSymbols(symbols)
21
21
 
22
22
  return [
@@ -52,7 +52,7 @@ class DydxBookChangeMapper implements Mapper<'dydx', BookChange> {
52
52
  return message.channel === 'v3_orderbook'
53
53
  }
54
54
 
55
- getFilters(symbols?: string[]) {
55
+ getFilters(symbols: string[] = []) {
56
56
  symbols = upperCaseSymbols(symbols)
57
57
 
58
58
  return [
@@ -164,7 +164,7 @@ class DydxDerivativeTickerMapper implements Mapper<'dydx', DerivativeTicker> {
164
164
  return message.channel === 'v3_markets' || (message.channel === 'v3_trades' && message.type === 'channel_data')
165
165
  }
166
166
 
167
- getFilters(symbols?: string[]) {
167
+ getFilters(symbols: string[] = []) {
168
168
  symbols = upperCaseSymbols(symbols)
169
169
 
170
170
  return [
@@ -17,7 +17,7 @@ class DydxV4TradesMapper implements Mapper<'dydx-v4', Trade> {
17
17
  return message.channel === 'v4_trades' && message.type === 'channel_data'
18
18
  }
19
19
 
20
- getFilters(symbols?: string[]) {
20
+ getFilters(symbols: string[] = []) {
21
21
  symbols = upperCaseSymbols(symbols)
22
22
 
23
23
  return [
@@ -63,7 +63,7 @@ class DydxV4BookChangeMapper implements Mapper<'dydx-v4', BookChange> {
63
63
  return message.channel === 'v4_orderbook'
64
64
  }
65
65
 
66
- getFilters(symbols?: string[]) {
66
+ getFilters(symbols: string[] = []) {
67
67
  symbols = upperCaseSymbols(symbols)
68
68
 
69
69
  return [
@@ -118,7 +118,7 @@ class DydxV4DerivativeTickerMapper implements Mapper<'dydx-v4', DerivativeTicker
118
118
  return message.channel === 'v4_markets' || (message.channel === 'v4_trades' && message.type === 'channel_data')
119
119
  }
120
120
 
121
- getFilters(symbols?: string[]) {
121
+ getFilters(symbols: string[] = []) {
122
122
  symbols = upperCaseSymbols(symbols)
123
123
 
124
124
  return [
@@ -209,7 +209,7 @@ class DydxV4LiquidationsMapper implements Mapper<'dydx-v4', Liquidation> {
209
209
  return message.channel === 'v4_trades' && message.type === 'channel_data'
210
210
  }
211
211
 
212
- getFilters(symbols?: string[]) {
212
+ getFilters(symbols: string[] = []) {
213
213
  symbols = upperCaseSymbols(symbols)
214
214
 
215
215
  return [
@@ -31,7 +31,7 @@ class FTXTradesMapper implements Mapper<'ftx' | 'ftx-us', Trade> {
31
31
  return message.channel === 'trades'
32
32
  }
33
33
 
34
- getFilters(symbols?: string[]) {
34
+ getFilters(symbols: string[] = []) {
35
35
  symbols = upperCaseSymbols(symbols)
36
36
 
37
37
  return [
@@ -80,7 +80,7 @@ class FTXBookChangeMapper implements Mapper<'ftx' | 'ftx-us', BookChange> {
80
80
  return message.channel === 'orderbook'
81
81
  }
82
82
 
83
- getFilters(symbols?: string[]) {
83
+ getFilters(symbols: string[] = []) {
84
84
  symbols = upperCaseSymbols(symbols)
85
85
 
86
86
  return [
@@ -126,7 +126,7 @@ class FTXDerivativeTickerMapper implements Mapper<'ftx', DerivativeTicker> {
126
126
  return message.channel === 'instrument'
127
127
  }
128
128
 
129
- getFilters(symbols?: string[]) {
129
+ getFilters(symbols: string[] = []) {
130
130
  symbols = upperCaseSymbols(symbols)
131
131
 
132
132
  return [
@@ -181,7 +181,7 @@ class FTXLiquidationsMapper implements Mapper<'ftx', Liquidation> {
181
181
  return message.channel === 'trades'
182
182
  }
183
183
 
184
- getFilters(symbols?: string[]) {
184
+ getFilters(symbols: string[] = []) {
185
185
  symbols = upperCaseSymbols(symbols)
186
186
 
187
187
  return [
@@ -225,7 +225,7 @@ class FTXBookTickerMapper implements Mapper<'ftx' | 'ftx-us', BookTicker> {
225
225
  return message.channel === 'ticker'
226
226
  }
227
227
 
228
- getFilters(symbols?: string[]) {
228
+ getFilters(symbols: string[] = []) {
229
229
  symbols = upperCaseSymbols(symbols)
230
230
 
231
231
  return [
@@ -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