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.
- package/README.md +2 -0
- package/dist/handy.d.ts +2 -3
- package/dist/handy.d.ts.map +1 -1
- package/dist/handy.js +3 -12
- package/dist/handy.js.map +1 -1
- package/dist/mappers/ascendex.js +4 -4
- package/dist/mappers/ascendex.js.map +1 -1
- package/dist/mappers/aster.js +5 -8
- package/dist/mappers/aster.js.map +1 -1
- package/dist/mappers/backpack.d.ts.map +1 -1
- package/dist/mappers/backpack.js +16 -25
- package/dist/mappers/backpack.js.map +1 -1
- package/dist/mappers/binance.js +6 -6
- package/dist/mappers/binance.js.map +1 -1
- package/dist/mappers/binancedex.js +3 -3
- package/dist/mappers/binancedex.js.map +1 -1
- package/dist/mappers/binanceeuropeanoptions.js +11 -33
- package/dist/mappers/binanceeuropeanoptions.js.map +1 -1
- package/dist/mappers/bitfinex.js +5 -9
- package/dist/mappers/bitfinex.js.map +1 -1
- package/dist/mappers/bitflyer.js +3 -3
- package/dist/mappers/bitflyer.js.map +1 -1
- package/dist/mappers/bitget.js +9 -14
- package/dist/mappers/bitget.js.map +1 -1
- package/dist/mappers/bithumb.js +2 -2
- package/dist/mappers/bithumb.js.map +1 -1
- package/dist/mappers/bitmex.js +5 -5
- package/dist/mappers/bitmex.js.map +1 -1
- package/dist/mappers/bitnomial.js +2 -2
- package/dist/mappers/bitnomial.js.map +1 -1
- package/dist/mappers/bitstamp.js +3 -3
- package/dist/mappers/bitstamp.js.map +1 -1
- package/dist/mappers/bitvavo.js +12 -11
- package/dist/mappers/bitvavo.js.map +1 -1
- package/dist/mappers/blockchaincom.js +2 -2
- package/dist/mappers/blockchaincom.js.map +1 -1
- package/dist/mappers/bullish.js +7 -7
- package/dist/mappers/bullish.js.map +1 -1
- package/dist/mappers/bybit.js +11 -11
- package/dist/mappers/bybit.js.map +1 -1
- package/dist/mappers/bybitspot.d.ts +3 -3
- package/dist/mappers/bybitspot.d.ts.map +1 -1
- package/dist/mappers/bybitspot.js +3 -3
- package/dist/mappers/bybitspot.js.map +1 -1
- package/dist/mappers/coinbase.js +3 -3
- package/dist/mappers/coinbase.js.map +1 -1
- package/dist/mappers/coinbasederivatives.js +4 -4
- package/dist/mappers/coinbasederivatives.js.map +1 -1
- package/dist/mappers/coinbaseinternational.js +8 -8
- package/dist/mappers/coinbaseinternational.js.map +1 -1
- package/dist/mappers/coinflex.js +3 -3
- package/dist/mappers/coinflex.js.map +1 -1
- package/dist/mappers/cryptocom.js +5 -8
- package/dist/mappers/cryptocom.js.map +1 -1
- package/dist/mappers/cryptofacilities.js +6 -6
- package/dist/mappers/cryptofacilities.js.map +1 -1
- package/dist/mappers/delta.js +4 -4
- package/dist/mappers/delta.js.map +1 -1
- package/dist/mappers/delta_india.js +8 -14
- package/dist/mappers/delta_india.js.map +1 -1
- package/dist/mappers/deribit.js +21 -24
- package/dist/mappers/deribit.js.map +1 -1
- package/dist/mappers/dydx.js +3 -3
- package/dist/mappers/dydx.js.map +1 -1
- package/dist/mappers/dydxv4.js +4 -4
- package/dist/mappers/dydxv4.js.map +1 -1
- package/dist/mappers/ftx.js +5 -5
- package/dist/mappers/ftx.js.map +1 -1
- package/dist/mappers/gateio.js +6 -6
- package/dist/mappers/gateio.js.map +1 -1
- package/dist/mappers/gateiofutures.js +6 -6
- package/dist/mappers/gateiofutures.js.map +1 -1
- package/dist/mappers/gemini.js +5 -5
- package/dist/mappers/gemini.js.map +1 -1
- package/dist/mappers/hitbtc.js +2 -2
- package/dist/mappers/hitbtc.js.map +1 -1
- package/dist/mappers/huobi.js +20 -27
- package/dist/mappers/huobi.js.map +1 -1
- package/dist/mappers/hyperliquid.js +5 -8
- package/dist/mappers/hyperliquid.js.map +1 -1
- package/dist/mappers/kraken.js +6 -6
- package/dist/mappers/kraken.js.map +1 -1
- package/dist/mappers/kucoin.js +3 -3
- package/dist/mappers/kucoin.js.map +1 -1
- package/dist/mappers/kucoinfutures.js +4 -4
- package/dist/mappers/kucoinfutures.js.map +1 -1
- package/dist/mappers/lighter.js +5 -5
- package/dist/mappers/lighter.js.map +1 -1
- package/dist/mappers/mapper.d.ts +3 -3
- package/dist/mappers/mexc.d.ts +4 -4
- package/dist/mappers/mexc.d.ts.map +1 -1
- package/dist/mappers/mexc.js +3 -3
- package/dist/mappers/mexc.js.map +1 -1
- package/dist/mappers/mexcfutures.d.ts +5 -5
- package/dist/mappers/mexcfutures.d.ts.map +1 -1
- package/dist/mappers/mexcfutures.js +3 -3
- package/dist/mappers/mexcfutures.js.map +1 -1
- package/dist/mappers/okex.js +19 -21
- package/dist/mappers/okex.js.map +1 -1
- package/dist/mappers/okexspreads.d.ts +3 -3
- package/dist/mappers/okexspreads.d.ts.map +1 -1
- package/dist/mappers/okexspreads.js +3 -3
- package/dist/mappers/okexspreads.js.map +1 -1
- package/dist/mappers/phemex.js +18 -12
- package/dist/mappers/phemex.js.map +1 -1
- package/dist/mappers/poloniex.js +4 -4
- package/dist/mappers/poloniex.js.map +1 -1
- package/dist/mappers/polymarket.js +3 -3
- package/dist/mappers/polymarket.js.map +1 -1
- package/dist/mappers/serum.js +3 -3
- package/dist/mappers/serum.js.map +1 -1
- package/dist/mappers/upbit.js +2 -2
- package/dist/mappers/upbit.js.map +1 -1
- package/dist/mappers/whitebit.js +8 -12
- package/dist/mappers/whitebit.js.map +1 -1
- package/dist/mappers/woox.js +10 -12
- package/dist/mappers/woox.js.map +1 -1
- package/dist/realtimefeeds/aster.d.ts +3 -2
- package/dist/realtimefeeds/aster.d.ts.map +1 -1
- package/dist/realtimefeeds/aster.js +12 -2
- package/dist/realtimefeeds/aster.js.map +1 -1
- package/dist/realtimefeeds/backpack.d.ts +3 -2
- package/dist/realtimefeeds/backpack.d.ts.map +1 -1
- package/dist/realtimefeeds/backpack.js +9 -2
- package/dist/realtimefeeds/backpack.js.map +1 -1
- package/dist/realtimefeeds/binance.d.ts +7 -5
- package/dist/realtimefeeds/binance.d.ts.map +1 -1
- package/dist/realtimefeeds/binance.js +42 -9
- package/dist/realtimefeeds/binance.js.map +1 -1
- package/dist/realtimefeeds/binanceeuropeanoptions.d.ts +2 -2
- package/dist/realtimefeeds/binanceeuropeanoptions.d.ts.map +1 -1
- package/dist/realtimefeeds/binanceeuropeanoptions.js +5 -5
- package/dist/realtimefeeds/binanceeuropeanoptions.js.map +1 -1
- package/dist/realtimefeeds/bitget.d.ts +2 -1
- package/dist/realtimefeeds/bitget.d.ts.map +1 -1
- package/dist/realtimefeeds/bitget.js +10 -0
- package/dist/realtimefeeds/bitget.js.map +1 -1
- package/dist/realtimefeeds/bitstamp.d.ts +1 -1
- package/dist/realtimefeeds/bitstamp.d.ts.map +1 -1
- package/dist/realtimefeeds/bitstamp.js +2 -2
- package/dist/realtimefeeds/bitstamp.js.map +1 -1
- package/dist/realtimefeeds/bitvavo.d.ts +2 -1
- package/dist/realtimefeeds/bitvavo.d.ts.map +1 -1
- package/dist/realtimefeeds/bitvavo.js +10 -0
- package/dist/realtimefeeds/bitvavo.js.map +1 -1
- package/dist/realtimefeeds/bullish.d.ts +2 -2
- package/dist/realtimefeeds/bullish.d.ts.map +1 -1
- package/dist/realtimefeeds/bullish.js +4 -4
- package/dist/realtimefeeds/bullish.js.map +1 -1
- package/dist/realtimefeeds/bybit.d.ts +3 -2
- package/dist/realtimefeeds/bybit.d.ts.map +1 -1
- package/dist/realtimefeeds/bybit.js +18 -3
- package/dist/realtimefeeds/bybit.js.map +1 -1
- package/dist/realtimefeeds/coinbase.d.ts +4 -1
- package/dist/realtimefeeds/coinbase.d.ts.map +1 -1
- package/dist/realtimefeeds/coinbase.js +22 -0
- package/dist/realtimefeeds/coinbase.js.map +1 -1
- package/dist/realtimefeeds/coinbasederivatives.d.ts +3 -7
- package/dist/realtimefeeds/coinbasederivatives.d.ts.map +1 -1
- package/dist/realtimefeeds/coinbasederivatives.js +10 -12
- package/dist/realtimefeeds/coinbasederivatives.js.map +1 -1
- package/dist/realtimefeeds/cryptofacilities.d.ts +2 -1
- package/dist/realtimefeeds/cryptofacilities.d.ts.map +1 -1
- package/dist/realtimefeeds/cryptofacilities.js +6 -0
- package/dist/realtimefeeds/cryptofacilities.js.map +1 -1
- package/dist/realtimefeeds/delta.d.ts +2 -1
- package/dist/realtimefeeds/delta.d.ts.map +1 -1
- package/dist/realtimefeeds/delta.js +9 -0
- package/dist/realtimefeeds/delta.js.map +1 -1
- package/dist/realtimefeeds/delta_india.d.ts +4 -3
- package/dist/realtimefeeds/delta_india.d.ts.map +1 -1
- package/dist/realtimefeeds/delta_india.js +22 -17
- package/dist/realtimefeeds/delta_india.js.map +1 -1
- package/dist/realtimefeeds/deribit.d.ts +2 -1
- package/dist/realtimefeeds/deribit.d.ts.map +1 -1
- package/dist/realtimefeeds/deribit.js +11 -0
- package/dist/realtimefeeds/deribit.js.map +1 -1
- package/dist/realtimefeeds/ftx.d.ts +2 -2
- package/dist/realtimefeeds/ftx.d.ts.map +1 -1
- package/dist/realtimefeeds/ftx.js +9 -8
- package/dist/realtimefeeds/ftx.js.map +1 -1
- package/dist/realtimefeeds/gateio.d.ts +2 -1
- package/dist/realtimefeeds/gateio.d.ts.map +1 -1
- package/dist/realtimefeeds/gateio.js +10 -0
- package/dist/realtimefeeds/gateio.js.map +1 -1
- package/dist/realtimefeeds/gateiofutures.d.ts +5 -4
- package/dist/realtimefeeds/gateiofutures.d.ts.map +1 -1
- package/dist/realtimefeeds/gateiofutures.js +24 -14
- package/dist/realtimefeeds/gateiofutures.js.map +1 -1
- package/dist/realtimefeeds/gemini.d.ts +4 -1
- package/dist/realtimefeeds/gemini.d.ts.map +1 -1
- package/dist/realtimefeeds/gemini.js +25 -0
- package/dist/realtimefeeds/gemini.js.map +1 -1
- package/dist/realtimefeeds/hitbtc.d.ts +2 -1
- package/dist/realtimefeeds/hitbtc.d.ts.map +1 -1
- package/dist/realtimefeeds/hitbtc.js +10 -0
- package/dist/realtimefeeds/hitbtc.js.map +1 -1
- package/dist/realtimefeeds/huobi.d.ts +8 -7
- package/dist/realtimefeeds/huobi.d.ts.map +1 -1
- package/dist/realtimefeeds/huobi.js +49 -21
- package/dist/realtimefeeds/huobi.js.map +1 -1
- package/dist/realtimefeeds/index.d.ts +1 -1
- package/dist/realtimefeeds/index.d.ts.map +1 -1
- package/dist/realtimefeeds/index.js +2 -2
- package/dist/realtimefeeds/index.js.map +1 -1
- package/dist/realtimefeeds/kucoin.d.ts +2 -1
- package/dist/realtimefeeds/kucoin.d.ts.map +1 -1
- package/dist/realtimefeeds/kucoin.js +10 -0
- package/dist/realtimefeeds/kucoin.js.map +1 -1
- package/dist/realtimefeeds/kucoinfutures.d.ts +4 -3
- package/dist/realtimefeeds/kucoinfutures.d.ts.map +1 -1
- package/dist/realtimefeeds/kucoinfutures.js +15 -4
- package/dist/realtimefeeds/kucoinfutures.js.map +1 -1
- package/dist/realtimefeeds/lighter.d.ts +2 -1
- package/dist/realtimefeeds/lighter.d.ts.map +1 -1
- package/dist/realtimefeeds/lighter.js +10 -0
- package/dist/realtimefeeds/lighter.js.map +1 -1
- package/dist/realtimefeeds/mexc.d.ts +2 -1
- package/dist/realtimefeeds/mexc.d.ts.map +1 -1
- package/dist/realtimefeeds/mexc.js +10 -0
- package/dist/realtimefeeds/mexc.js.map +1 -1
- package/dist/realtimefeeds/mexcfutures.d.ts +2 -1
- package/dist/realtimefeeds/mexcfutures.d.ts.map +1 -1
- package/dist/realtimefeeds/mexcfutures.js +11 -0
- package/dist/realtimefeeds/mexcfutures.js.map +1 -1
- package/dist/realtimefeeds/okex.d.ts +7 -5
- package/dist/realtimefeeds/okex.d.ts.map +1 -1
- package/dist/realtimefeeds/okex.js +32 -11
- package/dist/realtimefeeds/okex.js.map +1 -1
- package/dist/realtimefeeds/phemex.d.ts.map +1 -1
- package/dist/realtimefeeds/phemex.js +1 -0
- package/dist/realtimefeeds/phemex.js.map +1 -1
- package/dist/realtimefeeds/poloniex.d.ts +2 -1
- package/dist/realtimefeeds/poloniex.d.ts.map +1 -1
- package/dist/realtimefeeds/poloniex.js +11 -0
- package/dist/realtimefeeds/poloniex.js.map +1 -1
- package/dist/realtimefeeds/polymarket.d.ts +1 -1
- package/dist/realtimefeeds/polymarket.d.ts.map +1 -1
- package/dist/realtimefeeds/polymarket.js +3 -3
- package/dist/realtimefeeds/polymarket.js.map +1 -1
- package/dist/realtimefeeds/realtimefeed.d.ts +20 -4
- package/dist/realtimefeeds/realtimefeed.d.ts.map +1 -1
- package/dist/realtimefeeds/realtimefeed.js +41 -3
- package/dist/realtimefeeds/realtimefeed.js.map +1 -1
- package/dist/realtimefeeds/whitebit.d.ts +4 -11
- package/dist/realtimefeeds/whitebit.d.ts.map +1 -1
- package/dist/realtimefeeds/whitebit.js +23 -19
- package/dist/realtimefeeds/whitebit.js.map +1 -1
- package/dist/realtimefeeds/woox.d.ts +2 -1
- package/dist/realtimefeeds/woox.d.ts.map +1 -1
- package/dist/realtimefeeds/woox.js +11 -0
- package/dist/realtimefeeds/woox.js.map +1 -1
- package/dist/stream.d.ts +4 -2
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +10 -9
- package/dist/stream.js.map +1 -1
- package/package.json +1 -1
- package/src/handy.ts +5 -15
- package/src/mappers/ascendex.ts +4 -4
- package/src/mappers/aster.ts +5 -11
- package/src/mappers/backpack.ts +17 -23
- package/src/mappers/binance.ts +6 -6
- package/src/mappers/binancedex.ts +3 -3
- package/src/mappers/binanceeuropeanoptions.ts +11 -39
- package/src/mappers/bitfinex.ts +5 -9
- package/src/mappers/bitflyer.ts +3 -3
- package/src/mappers/bitget.ts +9 -14
- package/src/mappers/bithumb.ts +2 -2
- package/src/mappers/bitmex.ts +5 -5
- package/src/mappers/bitnomial.ts +2 -2
- package/src/mappers/bitstamp.ts +3 -3
- package/src/mappers/bitvavo.ts +21 -19
- package/src/mappers/blockchaincom.ts +2 -2
- package/src/mappers/bullish.ts +7 -7
- package/src/mappers/bybit.ts +11 -11
- package/src/mappers/bybitspot.ts +3 -3
- package/src/mappers/coinbase.ts +3 -3
- package/src/mappers/coinbasederivatives.ts +4 -4
- package/src/mappers/coinbaseinternational.ts +9 -9
- package/src/mappers/coinflex.ts +3 -3
- package/src/mappers/cryptocom.ts +5 -8
- package/src/mappers/cryptofacilities.ts +6 -6
- package/src/mappers/delta.ts +4 -4
- package/src/mappers/delta_india.ts +8 -14
- package/src/mappers/deribit.ts +21 -25
- package/src/mappers/dydx.ts +3 -3
- package/src/mappers/dydxv4.ts +4 -4
- package/src/mappers/ftx.ts +5 -5
- package/src/mappers/gateio.ts +6 -6
- package/src/mappers/gateiofutures.ts +6 -6
- package/src/mappers/gemini.ts +5 -5
- package/src/mappers/hitbtc.ts +2 -2
- package/src/mappers/huobi.ts +21 -29
- package/src/mappers/hyperliquid.ts +6 -9
- package/src/mappers/kraken.ts +6 -6
- package/src/mappers/kucoin.ts +3 -3
- package/src/mappers/kucoinfutures.ts +4 -4
- package/src/mappers/lighter.ts +5 -5
- package/src/mappers/mapper.ts +3 -3
- package/src/mappers/mexc.ts +3 -3
- package/src/mappers/mexcfutures.ts +3 -3
- package/src/mappers/okex.ts +19 -25
- package/src/mappers/okexspreads.ts +3 -3
- package/src/mappers/phemex.ts +18 -12
- package/src/mappers/poloniex.ts +4 -4
- package/src/mappers/polymarket.ts +3 -3
- package/src/mappers/serum.ts +3 -3
- package/src/mappers/upbit.ts +2 -2
- package/src/mappers/whitebit.ts +8 -14
- package/src/mappers/woox.ts +10 -13
- package/src/realtimefeeds/aster.ts +21 -3
- package/src/realtimefeeds/backpack.ts +17 -3
- package/src/realtimefeeds/binance.ts +68 -11
- package/src/realtimefeeds/binanceeuropeanoptions.ts +14 -5
- package/src/realtimefeeds/bitget.ts +13 -1
- package/src/realtimefeeds/bitstamp.ts +8 -2
- package/src/realtimefeeds/bitvavo.ts +13 -1
- package/src/realtimefeeds/bullish.ts +11 -4
- package/src/realtimefeeds/bybit.ts +27 -4
- package/src/realtimefeeds/coinbase.ts +34 -1
- package/src/realtimefeeds/coinbasederivatives.ts +18 -13
- package/src/realtimefeeds/cryptofacilities.ts +9 -1
- package/src/realtimefeeds/delta.ts +13 -1
- package/src/realtimefeeds/delta_india.ts +31 -17
- package/src/realtimefeeds/deribit.ts +13 -1
- package/src/realtimefeeds/ftx.ts +17 -8
- package/src/realtimefeeds/gateio.ts +13 -1
- package/src/realtimefeeds/gateiofutures.ts +37 -17
- package/src/realtimefeeds/gemini.ts +28 -1
- package/src/realtimefeeds/hitbtc.ts +13 -1
- package/src/realtimefeeds/huobi.ts +92 -22
- package/src/realtimefeeds/index.ts +3 -2
- package/src/realtimefeeds/kucoin.ts +12 -1
- package/src/realtimefeeds/kucoinfutures.ts +24 -5
- package/src/realtimefeeds/lighter.ts +12 -1
- package/src/realtimefeeds/mexc.ts +12 -1
- package/src/realtimefeeds/mexcfutures.ts +13 -1
- package/src/realtimefeeds/okex.ts +76 -11
- package/src/realtimefeeds/phemex.ts +1 -0
- package/src/realtimefeeds/poloniex.ts +13 -1
- package/src/realtimefeeds/polymarket.ts +4 -3
- package/src/realtimefeeds/realtimefeed.ts +53 -5
- package/src/realtimefeeds/whitebit.ts +30 -18
- package/src/realtimefeeds/woox.ts +13 -1
- package/src/stream.ts +37 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { asNonZeroNumberOrUndefined, asNumberOrUndefined, fromMicroSecondsToDate,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
115
|
-
|
|
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
|
|
166
|
+
getFilters(symbols: string[] = []) {
|
|
173
167
|
return [{ channel: 'ticker', symbols: upperCaseSymbols(symbols) } as const]
|
|
174
168
|
}
|
|
175
169
|
|
package/src/mappers/deribit.ts
CHANGED
|
@@ -16,24 +16,20 @@ export const deribitMappers = exchangeMappers({
|
|
|
16
16
|
}
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
function deribitCasing(symbols
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
105
|
+
// Preserve legacy zero-ID snapshots; explicit changes may omit the link on duplicates.
|
|
110
106
|
const isSnapshot =
|
|
111
|
-
|
|
112
|
-
deribitBookChange.prev_change_id ===
|
|
113
|
-
deribitBookChange.prev_change_id ===
|
|
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
|
|
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
|
|
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
|
|
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
|
|
312
|
+
getFilters(symbols: string[] = []) {
|
|
317
313
|
symbols = deribitCasing(symbols)
|
|
318
314
|
|
|
319
315
|
return [
|
package/src/mappers/dydx.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
167
|
+
getFilters(symbols: string[] = []) {
|
|
168
168
|
symbols = upperCaseSymbols(symbols)
|
|
169
169
|
|
|
170
170
|
return [
|
package/src/mappers/dydxv4.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
212
|
+
getFilters(symbols: string[] = []) {
|
|
213
213
|
symbols = upperCaseSymbols(symbols)
|
|
214
214
|
|
|
215
215
|
return [
|
package/src/mappers/ftx.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
228
|
+
getFilters(symbols: string[] = []) {
|
|
229
229
|
symbols = upperCaseSymbols(symbols)
|
|
230
230
|
|
|
231
231
|
return [
|
package/src/mappers/gateio.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
237
|
+
getFilters(symbols: string[] = []) {
|
|
238
238
|
symbols = upperCaseSymbols(symbols)
|
|
239
239
|
|
|
240
240
|
return [
|
package/src/mappers/gemini.ts
CHANGED
|
@@ -21,7 +21,7 @@ const geminiTradesMapper: Mapper<'gemini', Trade> = {
|
|
|
21
21
|
return message.type === 'trade'
|
|
22
22
|
},
|
|
23
23
|
|
|
24
|
-
getFilters(symbols
|
|
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
|
|
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
|
|
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
|
|
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
|
|
173
|
+
getFilters(symbols: string[] = []) {
|
|
174
174
|
return [{ channel: 'bookTicker', symbols: upperCaseSymbols(symbols) } as const]
|
|
175
175
|
}
|
|
176
176
|
|
package/src/mappers/hitbtc.ts
CHANGED
|
@@ -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
|
|
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
|
|
63
|
+
getFilters(symbols: string[] = []) {
|
|
64
64
|
symbols = upperCaseSymbols(symbols)
|
|
65
65
|
|
|
66
66
|
return [
|
package/src/mappers/huobi.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
467
|
-
const indexes =
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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
|
|
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
|
|
37
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
170
|
+
getFilters(symbols: string[] = []) {
|
|
174
171
|
symbols = getSymbols(symbols)
|
|
175
172
|
|
|
176
173
|
return [
|
package/src/mappers/kraken.ts
CHANGED
|
@@ -30,7 +30,7 @@ const krakenTradesMapper: Mapper<'kraken', Trade> = {
|
|
|
30
30
|
return channel === 'trade'
|
|
31
31
|
},
|
|
32
32
|
|
|
33
|
-
getFilters(symbols
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
303
|
+
getFilters(symbols: string[] = []) {
|
|
304
304
|
return [{ channel: 'ticker', symbols } as const]
|
|
305
305
|
}
|
|
306
306
|
|