tardis-dev 13.1.1 → 13.1.5

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 (142) hide show
  1. package/dist/combine.js +34 -26
  2. package/dist/combine.js.map +1 -1
  3. package/dist/computable/computable.d.ts.map +1 -1
  4. package/dist/computable/computable.js +23 -18
  5. package/dist/computable/computable.js.map +1 -1
  6. package/dist/handy.d.ts +2 -0
  7. package/dist/handy.d.ts.map +1 -1
  8. package/dist/handy.js +15 -1
  9. package/dist/handy.js.map +1 -1
  10. package/dist/mappers/ascendex.d.ts +1 -1
  11. package/dist/mappers/ascendex.d.ts.map +1 -1
  12. package/dist/mappers/ascendex.js +5 -0
  13. package/dist/mappers/ascendex.js.map +1 -1
  14. package/dist/mappers/binance.d.ts +1 -1
  15. package/dist/mappers/binance.d.ts.map +1 -1
  16. package/dist/mappers/binance.js +5 -11
  17. package/dist/mappers/binance.js.map +1 -1
  18. package/dist/mappers/binancedex.d.ts +1 -1
  19. package/dist/mappers/binancedex.d.ts.map +1 -1
  20. package/dist/mappers/binancedex.js +4 -0
  21. package/dist/mappers/binancedex.js.map +1 -1
  22. package/dist/mappers/binanceoptions.d.ts.map +1 -1
  23. package/dist/mappers/binanceoptions.js +3 -0
  24. package/dist/mappers/binanceoptions.js.map +1 -1
  25. package/dist/mappers/bitfinex.d.ts +1 -1
  26. package/dist/mappers/bitfinex.d.ts.map +1 -1
  27. package/dist/mappers/bitfinex.js +5 -0
  28. package/dist/mappers/bitfinex.js.map +1 -1
  29. package/dist/mappers/bitflyer.d.ts +1 -1
  30. package/dist/mappers/bitflyer.d.ts.map +1 -1
  31. package/dist/mappers/bitflyer.js +3 -0
  32. package/dist/mappers/bitflyer.js.map +1 -1
  33. package/dist/mappers/bitmex.d.ts +1 -1
  34. package/dist/mappers/bitmex.d.ts.map +1 -1
  35. package/dist/mappers/bitmex.js +5 -0
  36. package/dist/mappers/bitmex.js.map +1 -1
  37. package/dist/mappers/bitstamp.d.ts.map +1 -1
  38. package/dist/mappers/bitstamp.js +3 -8
  39. package/dist/mappers/bitstamp.js.map +1 -1
  40. package/dist/mappers/bybit.d.ts.map +1 -1
  41. package/dist/mappers/bybit.js +8 -1
  42. package/dist/mappers/bybit.js.map +1 -1
  43. package/dist/mappers/coinbase.d.ts.map +1 -1
  44. package/dist/mappers/coinbase.js +3 -0
  45. package/dist/mappers/coinbase.js.map +1 -1
  46. package/dist/mappers/coinflex.d.ts +1 -1
  47. package/dist/mappers/coinflex.d.ts.map +1 -1
  48. package/dist/mappers/coinflex.js +4 -0
  49. package/dist/mappers/coinflex.js.map +1 -1
  50. package/dist/mappers/cryptofacilities.d.ts +1 -1
  51. package/dist/mappers/cryptofacilities.d.ts.map +1 -1
  52. package/dist/mappers/cryptofacilities.js +6 -0
  53. package/dist/mappers/cryptofacilities.js.map +1 -1
  54. package/dist/mappers/delta.d.ts +1 -1
  55. package/dist/mappers/delta.d.ts.map +1 -1
  56. package/dist/mappers/delta.js +4 -0
  57. package/dist/mappers/delta.js.map +1 -1
  58. package/dist/mappers/deribit.d.ts +1 -1
  59. package/dist/mappers/deribit.d.ts.map +1 -1
  60. package/dist/mappers/deribit.js +6 -0
  61. package/dist/mappers/deribit.js.map +1 -1
  62. package/dist/mappers/dydx.d.ts +1 -1
  63. package/dist/mappers/dydx.d.ts.map +1 -1
  64. package/dist/mappers/dydx.js +4 -0
  65. package/dist/mappers/dydx.js.map +1 -1
  66. package/dist/mappers/ftx.d.ts +1 -1
  67. package/dist/mappers/ftx.d.ts.map +1 -1
  68. package/dist/mappers/ftx.js +5 -0
  69. package/dist/mappers/ftx.js.map +1 -1
  70. package/dist/mappers/gateio.d.ts.map +1 -1
  71. package/dist/mappers/gateio.js +3 -0
  72. package/dist/mappers/gateio.js.map +1 -1
  73. package/dist/mappers/gateiofutures.d.ts +1 -1
  74. package/dist/mappers/gateiofutures.d.ts.map +1 -1
  75. package/dist/mappers/gateiofutures.js +4 -0
  76. package/dist/mappers/gateiofutures.js.map +1 -1
  77. package/dist/mappers/gemini.d.ts.map +1 -1
  78. package/dist/mappers/gemini.js +3 -0
  79. package/dist/mappers/gemini.js.map +1 -1
  80. package/dist/mappers/hitbtc.d.ts.map +1 -1
  81. package/dist/mappers/hitbtc.js +3 -0
  82. package/dist/mappers/hitbtc.js.map +1 -1
  83. package/dist/mappers/huobi.d.ts +2 -2
  84. package/dist/mappers/huobi.d.ts.map +1 -1
  85. package/dist/mappers/huobi.js +4 -2
  86. package/dist/mappers/huobi.js.map +1 -1
  87. package/dist/mappers/kraken.d.ts.map +1 -1
  88. package/dist/mappers/kraken.js +3 -0
  89. package/dist/mappers/kraken.js.map +1 -1
  90. package/dist/mappers/okex.d.ts +10 -8
  91. package/dist/mappers/okex.d.ts.map +1 -1
  92. package/dist/mappers/okex.js +18 -3
  93. package/dist/mappers/okex.js.map +1 -1
  94. package/dist/mappers/poloniex.d.ts.map +1 -1
  95. package/dist/mappers/poloniex.js +3 -0
  96. package/dist/mappers/poloniex.js.map +1 -1
  97. package/dist/mappers/serum.d.ts +1 -1
  98. package/dist/mappers/serum.d.ts.map +1 -1
  99. package/dist/mappers/serum.js +9 -0
  100. package/dist/mappers/serum.js.map +1 -1
  101. package/dist/mappers/upbit.d.ts +1 -1
  102. package/dist/mappers/upbit.d.ts.map +1 -1
  103. package/dist/mappers/upbit.js +3 -0
  104. package/dist/mappers/upbit.js.map +1 -1
  105. package/dist/realtimefeeds/deribit.d.ts +1 -0
  106. package/dist/realtimefeeds/deribit.d.ts.map +1 -1
  107. package/dist/realtimefeeds/deribit.js +23 -3
  108. package/dist/realtimefeeds/deribit.js.map +1 -1
  109. package/dist/realtimefeeds/realtimefeed.js +1 -1
  110. package/dist/realtimefeeds/realtimefeed.js.map +1 -1
  111. package/package.json +1 -1
  112. package/src/combine.ts +33 -27
  113. package/src/computable/computable.ts +21 -17
  114. package/src/handy.ts +14 -0
  115. package/src/mappers/ascendex.ts +6 -1
  116. package/src/mappers/binance.ts +2 -9
  117. package/src/mappers/binancedex.ts +6 -1
  118. package/src/mappers/binanceoptions.ts +7 -1
  119. package/src/mappers/bitfinex.ts +10 -1
  120. package/src/mappers/bitflyer.ts +8 -2
  121. package/src/mappers/bitmex.ts +12 -2
  122. package/src/mappers/bitstamp.ts +1 -7
  123. package/src/mappers/bybit.ts +12 -1
  124. package/src/mappers/coinbase.ts +7 -1
  125. package/src/mappers/coinflex.ts +8 -1
  126. package/src/mappers/cryptofacilities.ts +12 -1
  127. package/src/mappers/delta.ts +8 -1
  128. package/src/mappers/deribit.ts +14 -2
  129. package/src/mappers/dydx.ts +8 -1
  130. package/src/mappers/ftx.ts +12 -2
  131. package/src/mappers/gateio.ts +5 -0
  132. package/src/mappers/gateiofutures.ts +8 -1
  133. package/src/mappers/gemini.ts +5 -0
  134. package/src/mappers/hitbtc.ts +5 -0
  135. package/src/mappers/huobi.ts +7 -3
  136. package/src/mappers/kraken.ts +7 -1
  137. package/src/mappers/okex.ts +35 -6
  138. package/src/mappers/poloniex.ts +5 -0
  139. package/src/mappers/serum.ts +14 -2
  140. package/src/mappers/upbit.ts +6 -1
  141. package/src/realtimefeeds/deribit.ts +26 -4
  142. package/src/realtimefeeds/realtimefeed.ts +2 -2
@@ -1,5 +1,5 @@
1
- import { parseμs } from '../handy'
2
- import { BookChange, Trade, BookTicker } from '../types'
1
+ import { parseμs, upperCaseSymbols } from '../handy'
2
+ import { BookChange, BookTicker, Trade } from '../types'
3
3
  import { Mapper } from './mapper'
4
4
 
5
5
  export const bitflyerTradesMapper: Mapper<'bitflyer', Trade> = {
@@ -8,6 +8,8 @@ export const bitflyerTradesMapper: Mapper<'bitflyer', Trade> = {
8
8
  },
9
9
 
10
10
  getFilters(symbols?: string[]) {
11
+ symbols = upperCaseSymbols(symbols)
12
+
11
13
  return [
12
14
  {
13
15
  channel: 'lightning_executions',
@@ -52,6 +54,8 @@ export class BitflyerBookChangeMapper implements Mapper<'bitflyer', BookChange>
52
54
  }
53
55
 
54
56
  getFilters(symbols?: string[]) {
57
+ symbols = upperCaseSymbols(symbols)
58
+
55
59
  return [
56
60
  {
57
61
  channel: 'lightning_board_snapshot',
@@ -97,6 +101,8 @@ export const bitflyerBookTickerMapper: Mapper<'bitflyer', BookTicker> = {
97
101
  },
98
102
 
99
103
  getFilters(symbols?: string[]) {
104
+ symbols = upperCaseSymbols(symbols)
105
+
100
106
  return [
101
107
  {
102
108
  channel: 'lightning_ticker',
@@ -1,5 +1,5 @@
1
- import { asNumberIfValid } from '../handy'
2
- import { BookChange, BookPriceLevel, DerivativeTicker, FilterForExchange, Liquidation, Trade, BookTicker } from '../types'
1
+ import { asNumberIfValid, upperCaseSymbols } from '../handy'
2
+ import { BookChange, BookPriceLevel, BookTicker, DerivativeTicker, FilterForExchange, Liquidation, Trade } from '../types'
3
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
4
4
 
5
5
  // https://www.bitmex.com/app/wsAPI
@@ -10,6 +10,8 @@ export const bitmexTradesMapper: Mapper<'bitmex', Trade> = {
10
10
  },
11
11
 
12
12
  getFilters(symbols?: string[]) {
13
+ symbols = upperCaseSymbols(symbols)
14
+
13
15
  return [
14
16
  {
15
17
  channel: 'trade',
@@ -45,6 +47,8 @@ export class BitmexBookChangeMapper implements Mapper<'bitmex', BookChange> {
45
47
  }
46
48
 
47
49
  getFilters(symbols?: string[]) {
50
+ symbols = upperCaseSymbols(symbols)
51
+
48
52
  return [
49
53
  {
50
54
  channel: 'orderBookL2',
@@ -150,6 +154,8 @@ export class BitmexDerivativeTickerMapper implements Mapper<'bitmex', Derivative
150
154
  }
151
155
 
152
156
  getFilters(symbols?: string[]) {
157
+ symbols = upperCaseSymbols(symbols)
158
+
153
159
  return [
154
160
  {
155
161
  channel: 'instrument',
@@ -198,6 +204,8 @@ export const bitmexLiquidationsMapper: Mapper<'bitmex', Liquidation> = {
198
204
  },
199
205
 
200
206
  getFilters(symbols?: string[]) {
207
+ symbols = upperCaseSymbols(symbols)
208
+
201
209
  return [
202
210
  {
203
211
  channel: 'liquidation',
@@ -231,6 +239,8 @@ export const bitmexBookTickerMapper: Mapper<'bitmex', BookTicker> = {
231
239
  },
232
240
 
233
241
  getFilters(symbols?: string[]) {
242
+ symbols = upperCaseSymbols(symbols)
243
+
234
244
  return [
235
245
  {
236
246
  channel: 'quote',
@@ -1,3 +1,4 @@
1
+ import { lowerCaseSymbols } from '../handy'
1
2
  import { BookChange, Trade } from '../types'
2
3
  import { Mapper } from './mapper'
3
4
 
@@ -168,13 +169,6 @@ export class BitstampBookChangeMapper implements Mapper<'bitstamp', BookChange>
168
169
  }
169
170
  }
170
171
 
171
- function lowerCaseSymbols(symbols?: string[]) {
172
- if (symbols !== undefined) {
173
- return symbols.map((s) => s.toLowerCase())
174
- }
175
- return
176
- }
177
-
178
172
  type BitstampTrade = {
179
173
  event: 'trade'
180
174
  channel: string
@@ -1,3 +1,4 @@
1
+ import { upperCaseSymbols } from '../handy'
1
2
  import { BookChange, DerivativeTicker, Exchange, Liquidation, Trade } from '../types'
2
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
3
4
 
@@ -14,6 +15,8 @@ export class BybitTradesMapper implements Mapper<'bybit', Trade> {
14
15
  }
15
16
 
16
17
  getFilters(symbols?: string[]) {
18
+ symbols = upperCaseSymbols(symbols)
19
+
17
20
  return [
18
21
  {
19
22
  channel: 'trade',
@@ -57,6 +60,8 @@ export class BybitBookChangeMapper implements Mapper<'bybit', BookChange> {
57
60
  }
58
61
 
59
62
  getFilters(symbols?: string[]) {
63
+ symbols = upperCaseSymbols(symbols)
64
+
60
65
  if (this._canUseBook200Channel) {
61
66
  return [
62
67
  {
@@ -117,6 +122,8 @@ export class BybitDerivativeTickerMapper implements Mapper<'bybit', DerivativeTi
117
122
  }
118
123
 
119
124
  getFilters(symbols?: string[]) {
125
+ symbols = upperCaseSymbols(symbols)
126
+
120
127
  return [
121
128
  {
122
129
  channel: 'instrument_info',
@@ -137,7 +144,9 @@ export class BybitDerivativeTickerMapper implements Mapper<'bybit', DerivativeTi
137
144
  instrumentInfo.predicted_funding_rate_e6 !== undefined ? instrumentInfo.predicted_funding_rate_e6 / 1000000 : undefined
138
145
  )
139
146
  pendingTickerInfo.updateFundingTimestamp(
140
- instrumentInfo.next_funding_time !== undefined ? new Date(instrumentInfo.next_funding_time) : undefined
147
+ instrumentInfo.next_funding_time !== undefined && new Date(instrumentInfo.next_funding_time).valueOf() > 0
148
+ ? new Date(instrumentInfo.next_funding_time)
149
+ : undefined
141
150
  )
142
151
 
143
152
  if (instrumentInfo.index_price !== undefined) {
@@ -190,6 +199,8 @@ export class BybitLiquidationsMapper implements Mapper<'bybit', Liquidation> {
190
199
  }
191
200
 
192
201
  getFilters(symbols?: string[]) {
202
+ symbols = upperCaseSymbols(symbols)
203
+
193
204
  return [
194
205
  {
195
206
  channel: 'liquidation',
@@ -1,6 +1,6 @@
1
+ import { parseμs, upperCaseSymbols } from '../handy'
1
2
  import { BookChange, BookPriceLevel, BookTicker, Trade } from '../types'
2
3
  import { Mapper } from './mapper'
3
- import { parseμs } from '../handy'
4
4
 
5
5
  // https://docs.pro.coinbase.com/#websocket-feed
6
6
 
@@ -10,6 +10,8 @@ export const coinbaseTradesMapper: Mapper<'coinbase', Trade> = {
10
10
  },
11
11
 
12
12
  getFilters(symbols?: string[]) {
13
+ symbols = upperCaseSymbols(symbols)
14
+
13
15
  return [
14
16
  {
15
17
  channel: 'match',
@@ -69,6 +71,8 @@ export class CoinbaseBookChangMapper implements Mapper<'coinbase', BookChange> {
69
71
  }
70
72
 
71
73
  getFilters(symbols?: string[]) {
74
+ symbols = upperCaseSymbols(symbols)
75
+
72
76
  return [
73
77
  {
74
78
  channel: 'snapshot',
@@ -128,6 +132,8 @@ export const coinbaseBookTickerMapper: Mapper<'coinbase', BookTicker> = {
128
132
  },
129
133
 
130
134
  getFilters(symbols?: string[]) {
135
+ symbols = upperCaseSymbols(symbols)
136
+
131
137
  return [
132
138
  {
133
139
  channel: 'ticker',
@@ -1,4 +1,5 @@
1
- import { BookChange, Trade, DerivativeTicker } from '../types'
1
+ import { upperCaseSymbols } from '../handy'
2
+ import { BookChange, DerivativeTicker, Trade } from '../types'
2
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
3
4
 
4
5
  // https://docs.coinflex.com/v2/#websocket-api-subscriptions-public
@@ -9,6 +10,8 @@ export const coinflexTradesMapper: Mapper<'coinflex', Trade> = {
9
10
  },
10
11
 
11
12
  getFilters(symbols?: string[]) {
13
+ symbols = upperCaseSymbols(symbols)
14
+
12
15
  return [
13
16
  {
14
17
  channel: 'trade',
@@ -47,6 +50,8 @@ export const coinflexBookChangeMapper: Mapper<'coinflex', BookChange> = {
47
50
  },
48
51
 
49
52
  getFilters(symbols?: string[]) {
53
+ symbols = upperCaseSymbols(symbols)
54
+
50
55
  return [
51
56
  {
52
57
  channel: 'futures/depth',
@@ -79,6 +84,8 @@ export class CoinflexDerivativeTickerMapper implements Mapper<'coinflex', Deriva
79
84
  }
80
85
 
81
86
  getFilters(symbols?: string[]) {
87
+ symbols = upperCaseSymbols(symbols)
88
+
82
89
  return [
83
90
  {
84
91
  channel: 'ticker',
@@ -1,4 +1,5 @@
1
- import { BookChange, DerivativeTicker, Liquidation, BookTicker, Trade } from '../types'
1
+ import { upperCaseSymbols } from '../handy'
2
+ import { BookChange, BookTicker, DerivativeTicker, Liquidation, Trade } from '../types'
2
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
3
4
 
4
5
  // https://www.cryptofacilities.com/resources/hc/en-us/categories/115000132213-API
@@ -9,6 +10,8 @@ export const cryptofacilitiesTradesMapper: Mapper<'cryptofacilities', Trade> = {
9
10
  },
10
11
 
11
12
  getFilters(symbols?: string[]) {
13
+ symbols = upperCaseSymbols(symbols)
14
+
12
15
  return [
13
16
  {
14
17
  channel: 'trade',
@@ -42,6 +45,8 @@ export const cryptofacilitiesBookChangeMapper: Mapper<'cryptofacilities', BookCh
42
45
  },
43
46
 
44
47
  getFilters(symbols?: string[]) {
48
+ symbols = upperCaseSymbols(symbols)
49
+
45
50
  return [
46
51
  {
47
52
  channel: 'book',
@@ -96,6 +101,8 @@ export class CryptofacilitiesDerivativeTickerMapper implements Mapper<'cryptofac
96
101
  }
97
102
 
98
103
  getFilters(symbols?: string[]) {
104
+ symbols = upperCaseSymbols(symbols)
105
+
99
106
  return [
100
107
  {
101
108
  channel: 'ticker',
@@ -130,6 +137,8 @@ export const cryptofacilitiesLiquidationsMapper: Mapper<'cryptofacilities', Liqu
130
137
  },
131
138
 
132
139
  getFilters(symbols?: string[]) {
140
+ symbols = upperCaseSymbols(symbols)
141
+
133
142
  return [
134
143
  {
135
144
  channel: 'trade',
@@ -159,6 +168,8 @@ export const cryptofacilitiesBookTickerMapper: Mapper<'cryptofacilities', BookTi
159
168
  },
160
169
 
161
170
  getFilters(symbols?: string[]) {
171
+ symbols = upperCaseSymbols(symbols)
172
+
162
173
  return [
163
174
  {
164
175
  channel: 'ticker',
@@ -1,5 +1,6 @@
1
+ import { upperCaseSymbols } from '../handy'
2
+ import { BookChange, DerivativeTicker, Trade } from '../types'
1
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
2
- import { Trade, BookChange, DerivativeTicker } from '../types'
3
4
 
4
5
  const fromMicroSecondsToDate = (micros: number) => {
5
6
  const timestamp = new Date(micros / 1000)
@@ -16,6 +17,8 @@ export class DeltaTradesMapper implements Mapper<'delta', Trade> {
16
17
  }
17
18
 
18
19
  getFilters(symbols?: string[]) {
20
+ symbols = upperCaseSymbols(symbols)
21
+
19
22
  return [
20
23
  {
21
24
  channel: this._useV2Channels ? 'all_trades' : 'recent_trade',
@@ -52,6 +55,8 @@ export const deltaBookChangeMapper: Mapper<'delta', BookChange> = {
52
55
  },
53
56
 
54
57
  getFilters(symbols?: string[]) {
58
+ symbols = upperCaseSymbols(symbols)
59
+
55
60
  return [
56
61
  {
57
62
  channel: 'l2_orderbook',
@@ -88,6 +93,8 @@ export class DeltaDerivativeTickerMapper implements Mapper<'delta', DerivativeTi
88
93
  }
89
94
 
90
95
  getFilters(symbols?: string[]) {
96
+ symbols = upperCaseSymbols(symbols)
97
+
91
98
  return [
92
99
  {
93
100
  channel: this._useV2Channels ? 'all_trades' : 'recent_trade',
@@ -1,5 +1,5 @@
1
- import { asNumberIfValid } from '../handy'
2
- import { BookChange, DerivativeTicker, Trade, OptionSummary, Liquidation, BookTicker } from '../types'
1
+ import { asNumberIfValid, upperCaseSymbols } from '../handy'
2
+ import { BookChange, BookTicker, DerivativeTicker, Liquidation, OptionSummary, Trade } from '../types'
3
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
4
4
 
5
5
  // https://docs.deribit.com/v2/#subscriptions
@@ -15,6 +15,8 @@ export const deribitTradesMapper: Mapper<'deribit', Trade> = {
15
15
  },
16
16
 
17
17
  getFilters(symbols?: string[]) {
18
+ symbols = upperCaseSymbols(symbols)
19
+
18
20
  return [
19
21
  {
20
22
  channel: 'trades',
@@ -58,6 +60,8 @@ export const deribitBookChangeMapper: Mapper<'deribit', BookChange> = {
58
60
  },
59
61
 
60
62
  getFilters(symbols?: string[]) {
63
+ symbols = upperCaseSymbols(symbols)
64
+
61
65
  return [
62
66
  {
63
67
  channel: 'book',
@@ -98,6 +102,8 @@ export class DeribitDerivativeTickerMapper implements Mapper<'deribit', Derivati
98
102
  }
99
103
 
100
104
  getFilters(symbols?: string[]) {
105
+ symbols = upperCaseSymbols(symbols)
106
+
101
107
  return [
102
108
  {
103
109
  channel: 'ticker',
@@ -125,6 +131,8 @@ export class DeribitDerivativeTickerMapper implements Mapper<'deribit', Derivati
125
131
 
126
132
  export class DeribitOptionSummaryMapper implements Mapper<'deribit', OptionSummary> {
127
133
  getFilters(symbols?: string[]) {
134
+ symbols = upperCaseSymbols(symbols)
135
+
128
136
  return [
129
137
  {
130
138
  channel: 'ticker',
@@ -205,6 +213,8 @@ export const deribitLiquidationsMapper: Mapper<'deribit', Liquidation> = {
205
213
  },
206
214
 
207
215
  getFilters(symbols?: string[]) {
216
+ symbols = upperCaseSymbols(symbols)
217
+
208
218
  return [
209
219
  {
210
220
  channel: 'trades',
@@ -251,6 +261,8 @@ export const deribitBookTickerMapper: Mapper<'deribit', BookTicker> = {
251
261
  },
252
262
 
253
263
  getFilters(symbols?: string[]) {
264
+ symbols = upperCaseSymbols(symbols)
265
+
254
266
  return [
255
267
  {
256
268
  channel: 'ticker',
@@ -1,5 +1,6 @@
1
+ import { upperCaseSymbols } from '../handy'
2
+ import { BookChange, BookPriceLevel, DerivativeTicker, Trade } from '../types'
1
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
2
- import { Trade, BookChange, DerivativeTicker, BookPriceLevel } from '../types'
3
4
 
4
5
  export class DydxTradesMapper implements Mapper<'dydx', Trade> {
5
6
  canHandle(message: DyDxTrade) {
@@ -7,6 +8,8 @@ export class DydxTradesMapper implements Mapper<'dydx', Trade> {
7
8
  }
8
9
 
9
10
  getFilters(symbols?: string[]) {
11
+ symbols = upperCaseSymbols(symbols)
12
+
10
13
  return [
11
14
  {
12
15
  channel: 'v3_trades',
@@ -40,6 +43,8 @@ export class DydxBookChangeMapper implements Mapper<'dydx', BookChange> {
40
43
  }
41
44
 
42
45
  getFilters(symbols?: string[]) {
46
+ symbols = upperCaseSymbols(symbols)
47
+
43
48
  return [
44
49
  {
45
50
  channel: 'v3_orderbook',
@@ -140,6 +145,8 @@ export class DydxDerivativeTickerMapper implements Mapper<'dydx', DerivativeTick
140
145
  }
141
146
 
142
147
  getFilters(symbols?: string[]) {
148
+ symbols = upperCaseSymbols(symbols)
149
+
143
150
  return [
144
151
  {
145
152
  channel: 'v3_markets',
@@ -1,5 +1,5 @@
1
- import { asNumberIfValid, parseμs } from '../handy'
2
- import { BookChange, Trade, DerivativeTicker, Exchange, Liquidation, BookTicker } from '../types'
1
+ import { asNumberIfValid, parseμs, upperCaseSymbols } from '../handy'
2
+ import { BookChange, BookTicker, DerivativeTicker, Exchange, Liquidation, Trade } from '../types'
3
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
4
4
 
5
5
  // https://docs.ftx.com/#websocket-api
@@ -16,6 +16,8 @@ export class FTXTradesMapper implements Mapper<'ftx' | 'ftx-us', Trade> {
16
16
  }
17
17
 
18
18
  getFilters(symbols?: string[]) {
19
+ symbols = upperCaseSymbols(symbols)
20
+
19
21
  return [
20
22
  {
21
23
  channel: 'trades',
@@ -63,6 +65,8 @@ export class FTXBookChangeMapper implements Mapper<'ftx' | 'ftx-us', BookChange>
63
65
  }
64
66
 
65
67
  getFilters(symbols?: string[]) {
68
+ symbols = upperCaseSymbols(symbols)
69
+
66
70
  return [
67
71
  {
68
72
  channel: 'orderbook',
@@ -107,6 +111,8 @@ export class FTXDerivativeTickerMapper implements Mapper<'ftx', DerivativeTicker
107
111
  }
108
112
 
109
113
  getFilters(symbols?: string[]) {
114
+ symbols = upperCaseSymbols(symbols)
115
+
110
116
  return [
111
117
  {
112
118
  channel: 'instrument',
@@ -146,6 +152,8 @@ export class FTXLiquidationsMapper implements Mapper<'ftx', Liquidation> {
146
152
  }
147
153
 
148
154
  getFilters(symbols?: string[]) {
155
+ symbols = upperCaseSymbols(symbols)
156
+
149
157
  return [
150
158
  {
151
159
  channel: 'trades',
@@ -188,6 +196,8 @@ export class FTXBookTickerMapper implements Mapper<'ftx' | 'ftx-us', BookTicker>
188
196
  }
189
197
 
190
198
  getFilters(symbols?: string[]) {
199
+ symbols = upperCaseSymbols(symbols)
200
+
191
201
  return [
192
202
  {
193
203
  channel: 'ticker',
@@ -1,3 +1,4 @@
1
+ import { upperCaseSymbols } from '../handy'
1
2
  import { BookChange, Exchange, Trade } from '../types'
2
3
  import { Mapper } from './mapper'
3
4
 
@@ -13,6 +14,8 @@ export class GateIOTradesMapper implements Mapper<'gate-io', Trade> {
13
14
  }
14
15
 
15
16
  getFilters(symbols?: string[]) {
17
+ symbols = upperCaseSymbols(symbols)
18
+
16
19
  return [
17
20
  {
18
21
  channel: 'trades',
@@ -64,6 +67,8 @@ export class GateIOBookChangeMapper implements Mapper<'gate-io', BookChange> {
64
67
  }
65
68
 
66
69
  getFilters(symbols?: string[]) {
70
+ symbols = upperCaseSymbols(symbols)
71
+
67
72
  return [
68
73
  {
69
74
  channel: 'depth',
@@ -1,4 +1,5 @@
1
- import { BookChange, Exchange, Trade, DerivativeTicker } from '../types'
1
+ import { upperCaseSymbols } from '../handy'
2
+ import { BookChange, DerivativeTicker, Exchange, Trade } from '../types'
2
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
3
4
 
4
5
  // https://www.gate.io/docs/futures/ws/index.html
@@ -11,6 +12,8 @@ export class GateIOFuturesTradesMapper implements Mapper<'gate-io-futures', Trad
11
12
  }
12
13
 
13
14
  getFilters(symbols?: string[]) {
15
+ symbols = upperCaseSymbols(symbols)
16
+
14
17
  return [
15
18
  {
16
19
  channel: 'trades',
@@ -52,6 +55,8 @@ export class GateIOFuturesBookChangeMapper implements Mapper<'gate-io-futures',
52
55
  }
53
56
 
54
57
  getFilters(symbols?: string[]) {
58
+ symbols = upperCaseSymbols(symbols)
59
+
55
60
  return [
56
61
  {
57
62
  channel: 'order_book',
@@ -97,6 +102,8 @@ export class GateIOFuturesDerivativeTickerMapper implements Mapper<'gate-io-futu
97
102
  }
98
103
 
99
104
  getFilters(symbols?: string[]) {
105
+ symbols = upperCaseSymbols(symbols)
106
+
100
107
  return [
101
108
  {
102
109
  channel: 'tickers',
@@ -1,3 +1,4 @@
1
+ import { upperCaseSymbols } from '../handy'
1
2
  import { BookChange, Trade } from '../types'
2
3
  import { Mapper } from './mapper'
3
4
 
@@ -9,6 +10,8 @@ export const geminiTradesMapper: Mapper<'gemini', Trade> = {
9
10
  },
10
11
 
11
12
  getFilters(symbols?: string[]) {
13
+ symbols = upperCaseSymbols(symbols)
14
+
12
15
  return [
13
16
  {
14
17
  channel: 'trade',
@@ -45,6 +48,8 @@ export const geminiBookChangeMapper: Mapper<'gemini', BookChange> = {
45
48
  },
46
49
 
47
50
  getFilters(symbols?: string[]) {
51
+ symbols = upperCaseSymbols(symbols)
52
+
48
53
  return [
49
54
  {
50
55
  channel: 'l2_updates',
@@ -1,3 +1,4 @@
1
+ import { upperCaseSymbols } from '../handy'
1
2
  import { BookChange, Trade } from '../types'
2
3
  import { Mapper } from './mapper'
3
4
 
@@ -9,6 +10,8 @@ export const hitBtcTradesMapper: Mapper<'hitbtc', Trade> = {
9
10
  },
10
11
 
11
12
  getFilters(symbols?: string[]) {
13
+ symbols = upperCaseSymbols(symbols)
14
+
12
15
  return [
13
16
  {
14
17
  channel: 'updateTrades',
@@ -50,6 +53,8 @@ export const hitBtcBookChangeMapper: Mapper<'hitbtc', BookChange> = {
50
53
  },
51
54
 
52
55
  getFilters(symbols?: string[]) {
56
+ symbols = upperCaseSymbols(symbols)
57
+
53
58
  return [
54
59
  {
55
60
  channel: 'snapshotOrderbook',
@@ -1,6 +1,6 @@
1
- import { BookChange, DerivativeTicker, Exchange, FilterForExchange, Liquidation, OptionSummary, Trade, BookTicker } from '../types'
1
+ import { asNumberIfValid, CircularBuffer, upperCaseSymbols } from '../handy'
2
+ import { BookChange, BookTicker, DerivativeTicker, Exchange, FilterForExchange, Liquidation, OptionSummary, Trade } from '../types'
2
3
  import { Mapper, PendingTickerInfoHelper } from './mapper'
3
- import { asNumberIfValid, CircularBuffer } from '../handy'
4
4
 
5
5
  // https://huobiapi.github.io/docs/spot/v1/en/#websocket-market-data
6
6
  // https://github.com/huobiapi/API_Docs_en/wiki/WS_api_reference_en
@@ -228,7 +228,7 @@ function normalizeSymbols(symbols?: string[]) {
228
228
  return symbols.map((s) => {
229
229
  // huobi-dm and huobi-dm-swap expect symbols to be upper cased
230
230
  if (s.includes('_') || s.includes('-')) {
231
- return s
231
+ return s.toUpperCase()
232
232
  }
233
233
  // huobi global expects lower cased symbols
234
234
  return s.toLowerCase()
@@ -255,6 +255,8 @@ export class HuobiDerivativeTickerMapper implements Mapper<'huobi-dm' | 'huobi-d
255
255
  }
256
256
 
257
257
  getFilters(symbols?: string[]) {
258
+ symbols = upperCaseSymbols(symbols)
259
+
258
260
  const filters: FilterForExchange['huobi-dm-swap'][] = [
259
261
  {
260
262
  channel: 'basis',
@@ -335,6 +337,8 @@ export class HuobiLiquidationsMapper implements Mapper<'huobi-dm' | 'huobi-dm-sw
335
337
  }
336
338
 
337
339
  getFilters(symbols?: string[]) {
340
+ symbols = upperCaseSymbols(symbols)
341
+
338
342
  if (this._exchange === 'huobi-dm') {
339
343
  // huobi-dm for liquidations requires prividing different symbols which are indexes names for example 'BTC' or 'ETH'
340
344
  // not futures names like 'BTC_NW'
@@ -1,4 +1,4 @@
1
- import { asNumberIfValid } from '../handy'
1
+ import { asNumberIfValid, upperCaseSymbols } from '../handy'
2
2
  import { BookChange, BookTicker, Trade } from '../types'
3
3
  import { Mapper } from './mapper'
4
4
 
@@ -15,6 +15,8 @@ export const krakenTradesMapper: Mapper<'kraken', Trade> = {
15
15
  },
16
16
 
17
17
  getFilters(symbols?: string[]) {
18
+ symbols = upperCaseSymbols(symbols)
19
+
18
20
  return [
19
21
  {
20
22
  channel: 'trade',
@@ -73,6 +75,8 @@ export const krakenBookChangeMapper: Mapper<'kraken', BookChange> = {
73
75
  },
74
76
 
75
77
  getFilters(symbols?: string[]) {
78
+ symbols = upperCaseSymbols(symbols)
79
+
76
80
  return [
77
81
  {
78
82
  channel: 'book',
@@ -129,6 +133,8 @@ export const krakenBookTickerMapper: Mapper<'kraken', BookTicker> = {
129
133
  },
130
134
 
131
135
  getFilters(symbols?: string[]) {
136
+ symbols = upperCaseSymbols(symbols)
137
+
132
138
  return [
133
139
  {
134
140
  channel: 'spread',