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
package/package.json
CHANGED
package/src/handy.ts
CHANGED
|
@@ -171,7 +171,7 @@ export async function* normalizeMessages(
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
export function getFilters<T extends Exchange>(mappers: Mapper<T, any>[], symbols
|
|
174
|
+
export function getFilters<T extends Exchange>(mappers: Mapper<T, any>[], symbols: string[] = []) {
|
|
175
175
|
const filters = mappers.flatMap((mapper) => mapper.getFilters(symbols))
|
|
176
176
|
|
|
177
177
|
const deduplicatedFilters = filters.reduce(
|
|
@@ -1104,15 +1104,8 @@ export function asNonZeroNumberOrUndefined(val: string | number | undefined | nu
|
|
|
1104
1104
|
return Number.isFinite(asNumber) && asNumber !== 0 ? asNumber : undefined
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
|
-
export function
|
|
1108
|
-
return
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
export function upperCaseSymbols(symbols?: string[]) {
|
|
1112
|
-
if (symbols !== undefined) {
|
|
1113
|
-
return symbols.map((s) => s.toUpperCase())
|
|
1114
|
-
}
|
|
1115
|
-
return
|
|
1107
|
+
export function upperCaseSymbols(symbols: string[]) {
|
|
1108
|
+
return symbols.map((s) => s.toUpperCase())
|
|
1116
1109
|
}
|
|
1117
1110
|
|
|
1118
1111
|
export function createNormalizedSymbolFilter(symbols: string[] | undefined, filters: Filter<any>[]) {
|
|
@@ -1137,11 +1130,8 @@ export function createNormalizedSymbolFilter(symbols: string[] | undefined, filt
|
|
|
1137
1130
|
return (symbol: string) => allowedSymbols.has(symbol)
|
|
1138
1131
|
}
|
|
1139
1132
|
|
|
1140
|
-
export function lowerCaseSymbols(symbols
|
|
1141
|
-
|
|
1142
|
-
return symbols.map((s) => s.toLowerCase())
|
|
1143
|
-
}
|
|
1144
|
-
return
|
|
1133
|
+
export function lowerCaseSymbols(symbols: string[]) {
|
|
1134
|
+
return symbols.map((s) => s.toLowerCase())
|
|
1145
1135
|
}
|
|
1146
1136
|
|
|
1147
1137
|
export const fromMicroSecondsToDate = (micros: number) => {
|
package/src/mappers/ascendex.ts
CHANGED
|
@@ -17,7 +17,7 @@ class AscendexTradesMapper implements Mapper<'ascendex', Trade> {
|
|
|
17
17
|
return message.m === 'trades'
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
getFilters(symbols
|
|
20
|
+
getFilters(symbols: string[] = []) {
|
|
21
21
|
symbols = upperCaseSymbols(symbols)
|
|
22
22
|
return [
|
|
23
23
|
{
|
|
@@ -49,7 +49,7 @@ class AscendexBookChangeMapper implements Mapper<'ascendex', BookChange> {
|
|
|
49
49
|
return message.m === 'depth-realtime' || message.m === 'depth-snapshot-realtime'
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
getFilters(symbols
|
|
52
|
+
getFilters(symbols: string[] = []) {
|
|
53
53
|
symbols = upperCaseSymbols(symbols)
|
|
54
54
|
return [
|
|
55
55
|
{
|
|
@@ -94,7 +94,7 @@ class AscendexDerivativeTickerMapper implements Mapper<'ascendex', DerivativeTic
|
|
|
94
94
|
return message.m === 'futures-pricing-data' || message.m === 'trades'
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
getFilters(symbols
|
|
97
|
+
getFilters(symbols: string[] = []) {
|
|
98
98
|
symbols = upperCaseSymbols(symbols)
|
|
99
99
|
return [
|
|
100
100
|
{
|
|
@@ -137,7 +137,7 @@ class AscendexBookTickerMapper implements Mapper<'ascendex', BookTicker> {
|
|
|
137
137
|
return message.m === 'bbo'
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
getFilters(symbols
|
|
140
|
+
getFilters(symbols: string[] = []) {
|
|
141
141
|
symbols = upperCaseSymbols(symbols)
|
|
142
142
|
return [
|
|
143
143
|
{
|
package/src/mappers/aster.ts
CHANGED
|
@@ -40,7 +40,7 @@ class AsterTradesMapper implements Mapper<'aster' | 'aster-futures', Trade> {
|
|
|
40
40
|
return message.stream?.endsWith('@trade') === true
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
getFilters(symbols
|
|
43
|
+
getFilters(symbols: string[] = []) {
|
|
44
44
|
return [{ channel: 'trade', symbols: lowerCaseSymbols(symbols) } as const]
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -83,7 +83,7 @@ class AsterBookChangeMapper implements Mapper<'aster' | 'aster-futures', BookCha
|
|
|
83
83
|
return message.stream?.includes('@depth') === true
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
getFilters(symbols
|
|
86
|
+
getFilters(symbols: string[] = []) {
|
|
87
87
|
return [
|
|
88
88
|
{ channel: 'depth', symbols: lowerCaseSymbols(symbols) } as const,
|
|
89
89
|
{ channel: 'depthSnapshot', symbols: lowerCaseSymbols(symbols) } as const
|
|
@@ -160,12 +160,6 @@ class AsterBookChangeMapper implements Mapper<'aster' | 'aster-futures', BookCha
|
|
|
160
160
|
} else {
|
|
161
161
|
throw new Error(this.getSnapshotOverlapError(depthUpdateData, lastUpdateId))
|
|
162
162
|
}
|
|
163
|
-
} else if (depthUpdateData.pu !== lastUpdateId) {
|
|
164
|
-
throw new Error(
|
|
165
|
-
`Book depth update has a sequence gap, update ${JSON.stringify(
|
|
166
|
-
depthUpdateData
|
|
167
|
-
)}, lastUpdateId: ${lastUpdateId}, exchange ${this.exchange}`
|
|
168
|
-
)
|
|
169
163
|
}
|
|
170
164
|
|
|
171
165
|
depthContext.lastUpdateId = depthUpdateData.u
|
|
@@ -223,7 +217,7 @@ class AsterBookTickerMapper implements Mapper<'aster' | 'aster-futures', BookTic
|
|
|
223
217
|
return message.stream?.endsWith('@bookTicker') === true
|
|
224
218
|
}
|
|
225
219
|
|
|
226
|
-
getFilters(symbols
|
|
220
|
+
getFilters(symbols: string[] = []) {
|
|
227
221
|
return [{ channel: 'bookTicker', symbols: lowerCaseSymbols(symbols) } as const]
|
|
228
222
|
}
|
|
229
223
|
|
|
@@ -272,7 +266,7 @@ class AsterFuturesDerivativeTickerMapper implements Mapper<'aster-futures', Deri
|
|
|
272
266
|
)
|
|
273
267
|
}
|
|
274
268
|
|
|
275
|
-
getFilters(symbols
|
|
269
|
+
getFilters(symbols: string[] = []) {
|
|
276
270
|
const normalizedSymbols = lowerCaseSymbols(symbols)
|
|
277
271
|
|
|
278
272
|
return [
|
|
@@ -324,7 +318,7 @@ class AsterFuturesLiquidationsMapper implements Mapper<'aster-futures', Liquidat
|
|
|
324
318
|
return message.stream?.endsWith('@forceOrder') === true
|
|
325
319
|
}
|
|
326
320
|
|
|
327
|
-
getFilters(symbols
|
|
321
|
+
getFilters(symbols: string[] = []) {
|
|
328
322
|
return [{ channel: 'forceOrder', symbols: lowerCaseSymbols(symbols) } as const]
|
|
329
323
|
}
|
|
330
324
|
|
package/src/mappers/backpack.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { asNumberOrUndefined, CircularBuffer, fromMicroSecondsToDate
|
|
1
|
+
import { asNumberOrUndefined, CircularBuffer, fromMicroSecondsToDate } from '../handy.ts'
|
|
2
2
|
import { BookChange, BookTicker, DerivativeTicker, Liquidation, Trade } from '../types.ts'
|
|
3
3
|
import { Mapper, PendingTickerInfoHelper } from './mapper.ts'
|
|
4
4
|
import { exchangeMappers, isRealTime } from './registry.ts'
|
|
@@ -6,7 +6,7 @@ import { exchangeMappers, isRealTime } from './registry.ts'
|
|
|
6
6
|
export const backpackMappers = exchangeMappers({
|
|
7
7
|
backpack: {
|
|
8
8
|
trades: () => new BackpackTradesMapper(),
|
|
9
|
-
bookChanges: (localTimestamp) => new BackpackBookChangeMapper(isRealTime(localTimestamp)),
|
|
9
|
+
bookChanges: (localTimestamp) => new BackpackBookChangeMapper({ validateSnapshotOverlap: isRealTime(localTimestamp) }),
|
|
10
10
|
bookTickers: () => new BackpackBookTickerMapper(),
|
|
11
11
|
derivativeTickers: () => new BackpackDerivativeTickerMapper(),
|
|
12
12
|
liquidations: () => new BackpackLiquidationsMapper()
|
|
@@ -18,7 +18,7 @@ class BackpackTradesMapper implements Mapper<'backpack', Trade> {
|
|
|
18
18
|
return message.stream?.startsWith('trade.') === true
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
getFilters(symbols
|
|
21
|
+
getFilters(symbols: string[] = []) {
|
|
22
22
|
return [{ channel: 'trade', symbols } as const]
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -40,13 +40,13 @@ class BackpackTradesMapper implements Mapper<'backpack', Trade> {
|
|
|
40
40
|
class BackpackBookChangeMapper implements Mapper<'backpack', BookChange> {
|
|
41
41
|
private readonly bookStates = new Map<string, BackpackBookState>()
|
|
42
42
|
|
|
43
|
-
constructor(private readonly
|
|
43
|
+
constructor(private readonly options: { validateSnapshotOverlap: boolean }) {}
|
|
44
44
|
|
|
45
45
|
canHandle(message: BackpackMessage<unknown>) {
|
|
46
46
|
return message.stream?.startsWith('depth.') === true || message.stream?.startsWith('depthSnapshot.') === true
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
getFilters(symbols
|
|
49
|
+
getFilters(symbols: string[] = []) {
|
|
50
50
|
return [{ channel: 'depth', symbols } as const, { channel: 'depthSnapshot', symbols } as const]
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -107,8 +107,13 @@ class BackpackBookChangeMapper implements Mapper<'backpack', BookChange> {
|
|
|
107
107
|
return false
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
if (
|
|
111
|
-
|
|
110
|
+
if (!bookState.validatedFirstUpdate) {
|
|
111
|
+
if (this.options.validateSnapshotOverlap && data.U > bookState.sequence! + 1) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`Backpack book snapshot has no overlap with first update for ${data.s}: expected ${bookState.sequence! + 1}, received ${data.U}-${data.u}`
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
bookState.validatedFirstUpdate = true
|
|
112
117
|
}
|
|
113
118
|
bookState.sequence = data.u
|
|
114
119
|
return true
|
|
@@ -149,7 +154,7 @@ class BackpackBookTickerMapper implements Mapper<'backpack', BookTicker> {
|
|
|
149
154
|
canHandle(message: BackpackMessage<unknown>) {
|
|
150
155
|
return message.stream?.startsWith('bookTicker.') === true
|
|
151
156
|
}
|
|
152
|
-
getFilters(symbols
|
|
157
|
+
getFilters(symbols: string[] = []) {
|
|
153
158
|
return [{ channel: 'bookTicker', symbols } as const]
|
|
154
159
|
}
|
|
155
160
|
*map({ data }: BackpackBookTickerMessage, localTimestamp: Date) {
|
|
@@ -171,16 +176,10 @@ class BackpackDerivativeTickerMapper implements Mapper<'backpack', DerivativeTic
|
|
|
171
176
|
private readonly pending = new PendingTickerInfoHelper()
|
|
172
177
|
|
|
173
178
|
canHandle(message: BackpackMessage<unknown>) {
|
|
174
|
-
return /^(markPrice|openInterest|ticker)
|
|
179
|
+
return /^(markPrice|openInterest|ticker)\./.test(message.stream)
|
|
175
180
|
}
|
|
176
181
|
|
|
177
|
-
getFilters(symbols
|
|
178
|
-
if (!isNullOrEmptyArray(symbols)) {
|
|
179
|
-
symbols = symbols!.filter((symbol) => symbol.endsWith('_PERP'))
|
|
180
|
-
if (symbols.length === 0) {
|
|
181
|
-
return []
|
|
182
|
-
}
|
|
183
|
-
}
|
|
182
|
+
getFilters(symbols: string[] = []) {
|
|
184
183
|
return [
|
|
185
184
|
{ channel: 'markPrice', symbols } as const,
|
|
186
185
|
{ channel: 'openInterest', symbols } as const,
|
|
@@ -224,13 +223,7 @@ class BackpackLiquidationsMapper implements Mapper<'backpack', Liquidation> {
|
|
|
224
223
|
return message.stream?.startsWith('liquidation.') === true
|
|
225
224
|
}
|
|
226
225
|
|
|
227
|
-
getFilters(symbols
|
|
228
|
-
if (!isNullOrEmptyArray(symbols)) {
|
|
229
|
-
symbols = symbols!.filter((symbol) => symbol.endsWith('_PERP'))
|
|
230
|
-
if (symbols.length === 0) {
|
|
231
|
-
return []
|
|
232
|
-
}
|
|
233
|
-
}
|
|
226
|
+
getFilters(symbols: string[] = []) {
|
|
234
227
|
return [{ channel: 'liquidation', symbols } as const]
|
|
235
228
|
}
|
|
236
229
|
|
|
@@ -251,6 +244,7 @@ class BackpackLiquidationsMapper implements Mapper<'backpack', Liquidation> {
|
|
|
251
244
|
|
|
252
245
|
type BackpackBookState = {
|
|
253
246
|
sequence?: number
|
|
247
|
+
validatedFirstUpdate?: boolean
|
|
254
248
|
discardedThrough?: number
|
|
255
249
|
buffered: CircularBuffer<BackpackDepthMessage['data']>
|
|
256
250
|
}
|
package/src/mappers/binance.ts
CHANGED
|
@@ -65,7 +65,7 @@ class BinanceTradesMapper implements Mapper<'binance' | 'binance-jersey' | 'bina
|
|
|
65
65
|
return message.stream.endsWith('@trade')
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
getFilters(symbols
|
|
68
|
+
getFilters(symbols: string[] = []) {
|
|
69
69
|
symbols = lowerCaseSymbols(symbols)
|
|
70
70
|
|
|
71
71
|
return [
|
|
@@ -125,7 +125,7 @@ class BinanceBookChangeMapper implements Mapper<
|
|
|
125
125
|
return message.stream.includes('@depth')
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
getFilters(symbols
|
|
128
|
+
getFilters(symbols: string[] = []) {
|
|
129
129
|
symbols = lowerCaseSymbols(symbols)
|
|
130
130
|
|
|
131
131
|
return [
|
|
@@ -334,7 +334,7 @@ class BinanceFuturesDerivativeTickerMapper implements Mapper<'binance-futures' |
|
|
|
334
334
|
)
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
getFilters(symbols
|
|
337
|
+
getFilters(symbols: string[] = []): FilterForExchange['binance-futures' | 'binance-delivery'][] {
|
|
338
338
|
symbols = lowerCaseSymbols(symbols)
|
|
339
339
|
|
|
340
340
|
const filters = [
|
|
@@ -356,7 +356,7 @@ class BinanceFuturesDerivativeTickerMapper implements Mapper<'binance-futures' |
|
|
|
356
356
|
// index channel requires index symbol
|
|
357
357
|
filters.push({
|
|
358
358
|
channel: 'indexPrice' as any,
|
|
359
|
-
symbols: symbols
|
|
359
|
+
symbols: symbols.map((s) => s.split('_')[0])
|
|
360
360
|
})
|
|
361
361
|
}
|
|
362
362
|
|
|
@@ -422,7 +422,7 @@ class BinanceLiquidationsMapper implements Mapper<'binance-futures' | 'binance-d
|
|
|
422
422
|
return message.stream.endsWith('@forceOrder')
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
getFilters(symbols
|
|
425
|
+
getFilters(symbols: string[] = []) {
|
|
426
426
|
symbols = lowerCaseSymbols(symbols)
|
|
427
427
|
|
|
428
428
|
return [
|
|
@@ -467,7 +467,7 @@ class BinanceBookTickerMapper implements Mapper<'binance-futures' | 'binance-del
|
|
|
467
467
|
return message.stream.endsWith('@bookTicker')
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
-
getFilters(symbols
|
|
470
|
+
getFilters(symbols: string[] = []) {
|
|
471
471
|
symbols = lowerCaseSymbols(symbols)
|
|
472
472
|
|
|
473
473
|
return [
|
|
@@ -18,7 +18,7 @@ const binanceDexTradesMapper: Mapper<'binance-dex', Trade> = {
|
|
|
18
18
|
return message.stream === 'trades'
|
|
19
19
|
},
|
|
20
20
|
|
|
21
|
-
getFilters(symbols
|
|
21
|
+
getFilters(symbols: string[] = []) {
|
|
22
22
|
symbols = upperCaseSymbols(symbols)
|
|
23
23
|
|
|
24
24
|
return [
|
|
@@ -57,7 +57,7 @@ const binanceDexBookChangeMapper: Mapper<'binance-dex', BookChange> = {
|
|
|
57
57
|
return message.stream === 'marketDiff' || message.stream === 'depthSnapshot'
|
|
58
58
|
},
|
|
59
59
|
|
|
60
|
-
getFilters(symbols
|
|
60
|
+
getFilters(symbols: string[] = []) {
|
|
61
61
|
symbols = upperCaseSymbols(symbols)
|
|
62
62
|
return [
|
|
63
63
|
{
|
|
@@ -108,7 +108,7 @@ const binanceDexBookTickerMapper: Mapper<'binance-dex', BookTicker> = {
|
|
|
108
108
|
return message.stream === 'ticker'
|
|
109
109
|
},
|
|
110
110
|
|
|
111
|
-
getFilters(symbols
|
|
111
|
+
getFilters(symbols: string[] = []) {
|
|
112
112
|
symbols = upperCaseSymbols(symbols)
|
|
113
113
|
return [
|
|
114
114
|
{
|
|
@@ -34,15 +34,10 @@ class BinanceEuropeanOptionsTradesMapper implements Mapper<'binance-european-opt
|
|
|
34
34
|
return message.stream.endsWith('@trade')
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
getFilters(symbols
|
|
37
|
+
getFilters(symbols: string[] = []) {
|
|
38
38
|
symbols = upperCaseSymbols(symbols)
|
|
39
39
|
|
|
40
|
-
return [
|
|
41
|
-
{
|
|
42
|
-
channel: 'trade',
|
|
43
|
-
symbols
|
|
44
|
-
} as const
|
|
45
|
-
]
|
|
40
|
+
return [{ channel: 'trade', symbols } as const]
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
*map(binanceTradeResponse: BinanceResponse<BinanceOptionsTradeData>, localTimestamp: Date) {
|
|
@@ -71,7 +66,7 @@ class BinanceEuropeanOptionsTradesMapperV2 implements Mapper<'binance-european-o
|
|
|
71
66
|
return message.stream.endsWith('@optionTrade')
|
|
72
67
|
}
|
|
73
68
|
|
|
74
|
-
getFilters(symbols
|
|
69
|
+
getFilters(symbols: string[] = []) {
|
|
75
70
|
symbols = lowerCaseSymbols(symbols)
|
|
76
71
|
|
|
77
72
|
return [
|
|
@@ -108,7 +103,7 @@ class BinanceEuropeanOptionsBookChangeMapper implements Mapper<'binance-european
|
|
|
108
103
|
return message.stream.includes('@depth100')
|
|
109
104
|
}
|
|
110
105
|
|
|
111
|
-
getFilters(symbols
|
|
106
|
+
getFilters(symbols: string[] = []) {
|
|
112
107
|
symbols = upperCaseSymbols(symbols)
|
|
113
108
|
|
|
114
109
|
return [
|
|
@@ -150,7 +145,7 @@ class BinanceEuropeanOptionsBookChangeMapperV2 implements Mapper<'binance-europe
|
|
|
150
145
|
return message.stream.includes('@depth20')
|
|
151
146
|
}
|
|
152
147
|
|
|
153
|
-
getFilters(symbols
|
|
148
|
+
getFilters(symbols: string[] = []) {
|
|
154
149
|
symbols = lowerCaseSymbols(symbols)
|
|
155
150
|
|
|
156
151
|
return [
|
|
@@ -192,7 +187,7 @@ class BinanceEuropeanOptionsBookTickerMapper implements Mapper<'binance-european
|
|
|
192
187
|
return message.stream.endsWith('@bookTicker')
|
|
193
188
|
}
|
|
194
189
|
|
|
195
|
-
getFilters(symbols
|
|
190
|
+
getFilters(symbols: string[] = []) {
|
|
196
191
|
symbols = lowerCaseSymbols(symbols)
|
|
197
192
|
|
|
198
193
|
return [
|
|
@@ -237,25 +232,9 @@ class BinanceEuropeanOptionSummaryMapper implements Mapper<'binance-european-opt
|
|
|
237
232
|
return message.stream.endsWith('@ticker') || message.stream.endsWith('@index') || message.stream.includes('@openInterest')
|
|
238
233
|
}
|
|
239
234
|
|
|
240
|
-
getFilters(symbols
|
|
235
|
+
getFilters(symbols: string[] = []) {
|
|
241
236
|
symbols = upperCaseSymbols(symbols)
|
|
242
237
|
|
|
243
|
-
const indexes =
|
|
244
|
-
symbols !== undefined
|
|
245
|
-
? symbols.map((s) => {
|
|
246
|
-
const symbolParts = s.split('-')
|
|
247
|
-
return `${symbolParts[0]}USDT`
|
|
248
|
-
})
|
|
249
|
-
: undefined
|
|
250
|
-
|
|
251
|
-
const underlyings =
|
|
252
|
-
symbols !== undefined
|
|
253
|
-
? symbols.map((s) => {
|
|
254
|
-
const symbolParts = s.split('-')
|
|
255
|
-
return `${symbolParts[0]}`
|
|
256
|
-
})
|
|
257
|
-
: undefined
|
|
258
|
-
|
|
259
238
|
return [
|
|
260
239
|
{
|
|
261
240
|
channel: 'ticker',
|
|
@@ -263,11 +242,11 @@ class BinanceEuropeanOptionSummaryMapper implements Mapper<'binance-european-opt
|
|
|
263
242
|
} as const,
|
|
264
243
|
{
|
|
265
244
|
channel: 'index',
|
|
266
|
-
symbols:
|
|
245
|
+
symbols: symbols.map((symbol) => `${symbol.split('-')[0]}USDT`)
|
|
267
246
|
} as const,
|
|
268
247
|
{
|
|
269
248
|
channel: 'openInterest',
|
|
270
|
-
symbols:
|
|
249
|
+
symbols: symbols.map((symbol) => `${symbol.split('-')[0]}`)
|
|
271
250
|
} as const
|
|
272
251
|
]
|
|
273
252
|
}
|
|
@@ -367,16 +346,9 @@ class BinanceEuropeanOptionSummaryMapperV2 implements Mapper<'binance-european-o
|
|
|
367
346
|
)
|
|
368
347
|
}
|
|
369
348
|
|
|
370
|
-
getFilters(symbols
|
|
349
|
+
getFilters(symbols: string[] = []) {
|
|
371
350
|
symbols = lowerCaseSymbols(symbols)
|
|
372
|
-
|
|
373
|
-
const underlyings =
|
|
374
|
-
symbols !== undefined
|
|
375
|
-
? symbols.map((s) => {
|
|
376
|
-
const symbolParts = s.split('-')
|
|
377
|
-
return `${symbolParts[0]}usdt`
|
|
378
|
-
})
|
|
379
|
-
: undefined
|
|
351
|
+
const underlyings = symbols.map((symbol) => `${symbol.split('-')[0]}usdt`)
|
|
380
352
|
|
|
381
353
|
return [
|
|
382
354
|
{
|
package/src/mappers/bitfinex.ts
CHANGED
|
@@ -49,7 +49,7 @@ class BitfinexTradesMapper implements Mapper<'bitfinex' | 'bitfinex-derivatives'
|
|
|
49
49
|
return false
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
getFilters(symbols
|
|
52
|
+
getFilters(symbols: string[] = []) {
|
|
53
53
|
symbols = upperCaseSymbols(symbols)
|
|
54
54
|
|
|
55
55
|
return [
|
|
@@ -125,7 +125,7 @@ class BitfinexBookChangeMapper implements Mapper<'bitfinex' | 'bitfinex-derivati
|
|
|
125
125
|
return false
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
getFilters(symbols
|
|
128
|
+
getFilters(symbols: string[] = []) {
|
|
129
129
|
symbols = upperCaseSymbols(symbols)
|
|
130
130
|
|
|
131
131
|
return [
|
|
@@ -207,7 +207,7 @@ class BitfinexDerivativeTickerMapper implements Mapper<'bitfinex-derivatives', D
|
|
|
207
207
|
return false
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
getFilters(symbols
|
|
210
|
+
getFilters(symbols: string[] = []) {
|
|
211
211
|
symbols = upperCaseSymbols(symbols)
|
|
212
212
|
|
|
213
213
|
return [
|
|
@@ -292,11 +292,7 @@ class BitfinexLiquidationsMapper implements Mapper<'bitfinex-derivatives', Liqui
|
|
|
292
292
|
|
|
293
293
|
getFilters() {
|
|
294
294
|
// liquidations channel is global, not per symbol
|
|
295
|
-
return [
|
|
296
|
-
{
|
|
297
|
-
channel: 'liquidations'
|
|
298
|
-
} as const
|
|
299
|
-
]
|
|
295
|
+
return [{ channel: 'liquidations' as const, symbols: [] }]
|
|
300
296
|
}
|
|
301
297
|
|
|
302
298
|
*map(message: BitfinexLiquidation, localTimestamp: Date) {
|
|
@@ -369,7 +365,7 @@ class BitfinexBookTickerMapper implements Mapper<'bitfinex' | 'bitfinex-derivati
|
|
|
369
365
|
return false
|
|
370
366
|
}
|
|
371
367
|
|
|
372
|
-
getFilters(symbols
|
|
368
|
+
getFilters(symbols: string[] = []) {
|
|
373
369
|
symbols = upperCaseSymbols(symbols)
|
|
374
370
|
|
|
375
371
|
return [
|
package/src/mappers/bitflyer.ts
CHANGED
|
@@ -16,7 +16,7 @@ const bitflyerTradesMapper: Mapper<'bitflyer', Trade> = {
|
|
|
16
16
|
return message.params?.channel.startsWith('lightning_executions') === true
|
|
17
17
|
},
|
|
18
18
|
|
|
19
|
-
getFilters(symbols
|
|
19
|
+
getFilters(symbols: string[] = []) {
|
|
20
20
|
symbols = upperCaseSymbols(symbols)
|
|
21
21
|
|
|
22
22
|
return [
|
|
@@ -62,7 +62,7 @@ class BitflyerBookChangeMapper implements Mapper<'bitflyer', BookChange> {
|
|
|
62
62
|
return message.params?.channel.startsWith('lightning_board') === true
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
getFilters(symbols
|
|
65
|
+
getFilters(symbols: string[] = []) {
|
|
66
66
|
symbols = upperCaseSymbols(symbols)
|
|
67
67
|
|
|
68
68
|
return [
|
|
@@ -109,7 +109,7 @@ const bitflyerBookTickerMapper: Mapper<'bitflyer', BookTicker> = {
|
|
|
109
109
|
return message.params?.channel.startsWith('lightning_ticker') === true
|
|
110
110
|
},
|
|
111
111
|
|
|
112
|
-
getFilters(symbols
|
|
112
|
+
getFilters(symbols: string[] = []) {
|
|
113
113
|
symbols = upperCaseSymbols(symbols)
|
|
114
114
|
|
|
115
115
|
return [
|
package/src/mappers/bitget.ts
CHANGED
|
@@ -48,7 +48,7 @@ class BitgetTradesMapper implements Mapper<'bitget' | 'bitget-futures', Trade> {
|
|
|
48
48
|
return message.arg?.channel === 'trade' && message.action === 'update'
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
getFilters(symbols
|
|
51
|
+
getFilters(symbols: string[] = []) {
|
|
52
52
|
symbols = upperCaseSymbols(symbols)
|
|
53
53
|
|
|
54
54
|
return [
|
|
@@ -89,7 +89,7 @@ class BitgetBookChangeMapper implements Mapper<'bitget' | 'bitget-futures', Book
|
|
|
89
89
|
return message.arg?.channel === 'books15' && message.action === 'snapshot'
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
getFilters(symbols
|
|
92
|
+
getFilters(symbols: string[] = []) {
|
|
93
93
|
symbols = upperCaseSymbols(symbols)
|
|
94
94
|
|
|
95
95
|
return [
|
|
@@ -123,7 +123,7 @@ class BitgetBookTickerMapper implements Mapper<'bitget' | 'bitget-futures', Book
|
|
|
123
123
|
return message.arg?.channel === 'books1' && message.action === 'snapshot'
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
getFilters(symbols
|
|
126
|
+
getFilters(symbols: string[] = []) {
|
|
127
127
|
symbols = upperCaseSymbols(symbols)
|
|
128
128
|
|
|
129
129
|
return [
|
|
@@ -162,7 +162,7 @@ class BitgetDerivativeTickerMapper implements Mapper<'bitget-futures', Derivativ
|
|
|
162
162
|
return message.arg?.channel === 'ticker' && message.action === 'snapshot'
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
getFilters(symbols
|
|
165
|
+
getFilters(symbols: string[] = []) {
|
|
166
166
|
return [
|
|
167
167
|
{
|
|
168
168
|
channel: 'ticker',
|
|
@@ -201,7 +201,7 @@ class BitgetV3TradesMapper implements Mapper<'bitget' | 'bitget-futures', Trade>
|
|
|
201
201
|
return message.arg?.topic === 'publicTrade' && message.action === 'update'
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
getFilters(symbols
|
|
204
|
+
getFilters(symbols: string[] = []) {
|
|
205
205
|
symbols = upperCaseSymbols(symbols)
|
|
206
206
|
|
|
207
207
|
return [
|
|
@@ -236,7 +236,7 @@ class BitgetV3BookChangeMapper implements Mapper<'bitget' | 'bitget-futures', Bo
|
|
|
236
236
|
return message.arg?.topic === 'books' && (message.action === 'snapshot' || message.action === 'update')
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
getFilters(symbols
|
|
239
|
+
getFilters(symbols: string[] = []) {
|
|
240
240
|
symbols = upperCaseSymbols(symbols)
|
|
241
241
|
|
|
242
242
|
return [
|
|
@@ -270,7 +270,7 @@ class BitgetV3BookTickerMapper implements Mapper<'bitget' | 'bitget-futures', Bo
|
|
|
270
270
|
return message.arg?.topic === 'books1' && message.action === 'snapshot'
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
getFilters(symbols
|
|
273
|
+
getFilters(symbols: string[] = []) {
|
|
274
274
|
symbols = upperCaseSymbols(symbols)
|
|
275
275
|
|
|
276
276
|
return [
|
|
@@ -305,7 +305,7 @@ class BitgetV3DerivativeTickerMapper implements Mapper<'bitget-futures', Derivat
|
|
|
305
305
|
return message.arg?.topic === 'ticker' && (message.action === 'snapshot' || message.action === 'update')
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
getFilters(symbols
|
|
308
|
+
getFilters(symbols: string[] = []) {
|
|
309
309
|
symbols = upperCaseSymbols(symbols)
|
|
310
310
|
|
|
311
311
|
return [
|
|
@@ -344,12 +344,7 @@ class BitgetV3LiquidationsMapper implements Mapper<'bitget-futures', Liquidation
|
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
getFilters() {
|
|
347
|
-
return [
|
|
348
|
-
{
|
|
349
|
-
channel: 'liquidation',
|
|
350
|
-
symbols: undefined
|
|
351
|
-
} as const
|
|
352
|
-
]
|
|
347
|
+
return [{ channel: 'liquidation' as const, symbols: [] }]
|
|
353
348
|
}
|
|
354
349
|
|
|
355
350
|
*map(message: BitgetV3LiquidationMessage, localTimestamp: Date): IterableIterator<Liquidation> {
|
package/src/mappers/bithumb.ts
CHANGED
|
@@ -15,7 +15,7 @@ class BithumbTradesMapper implements Mapper<'bithumb', Trade> {
|
|
|
15
15
|
return message.type === 'trade' && message.stream_type === 'REALTIME'
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
getFilters(symbols
|
|
18
|
+
getFilters(symbols: string[] = []) {
|
|
19
19
|
return [{ channel: 'trade', symbols: upperCaseSymbols(symbols) } as const]
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -39,7 +39,7 @@ class BithumbBookChangeMapper implements Mapper<'bithumb', BookChange> {
|
|
|
39
39
|
return message.type === 'orderbook'
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
getFilters(symbols
|
|
42
|
+
getFilters(symbols: string[] = []) {
|
|
43
43
|
return [{ channel: 'orderbook', symbols: upperCaseSymbols(symbols) } as const]
|
|
44
44
|
}
|
|
45
45
|
|
package/src/mappers/bitmex.ts
CHANGED
|
@@ -20,7 +20,7 @@ const bitmexTradesMapper: Mapper<'bitmex', Trade> = {
|
|
|
20
20
|
return message.table === 'trade' && message.action === 'insert'
|
|
21
21
|
},
|
|
22
22
|
|
|
23
|
-
getFilters(symbols
|
|
23
|
+
getFilters(symbols: string[] = []) {
|
|
24
24
|
symbols = upperCaseSymbols(symbols)
|
|
25
25
|
|
|
26
26
|
return [
|
|
@@ -57,7 +57,7 @@ class BitmexBookChangeMapper implements Mapper<'bitmex', BookChange> {
|
|
|
57
57
|
return message.table === 'orderBookL2'
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
getFilters(symbols
|
|
60
|
+
getFilters(symbols: string[] = []) {
|
|
61
61
|
symbols = upperCaseSymbols(symbols)
|
|
62
62
|
|
|
63
63
|
return [
|
|
@@ -176,7 +176,7 @@ class BitmexDerivativeTickerMapper implements Mapper<'bitmex', DerivativeTicker>
|
|
|
176
176
|
return message.table === 'instrument'
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
getFilters(symbols
|
|
179
|
+
getFilters(symbols: string[] = []) {
|
|
180
180
|
symbols = upperCaseSymbols(symbols)
|
|
181
181
|
|
|
182
182
|
return [
|
|
@@ -226,7 +226,7 @@ const bitmexLiquidationsMapper: Mapper<'bitmex', Liquidation> = {
|
|
|
226
226
|
return message.table === 'liquidation' && message.action === 'insert'
|
|
227
227
|
},
|
|
228
228
|
|
|
229
|
-
getFilters(symbols
|
|
229
|
+
getFilters(symbols: string[] = []) {
|
|
230
230
|
symbols = upperCaseSymbols(symbols)
|
|
231
231
|
|
|
232
232
|
return [
|
|
@@ -261,7 +261,7 @@ const bitmexBookTickerMapper: Mapper<'bitmex', BookTicker> = {
|
|
|
261
261
|
return message.table === 'quote' && message.action === 'insert'
|
|
262
262
|
},
|
|
263
263
|
|
|
264
|
-
getFilters(symbols
|
|
264
|
+
getFilters(symbols: string[] = []) {
|
|
265
265
|
symbols = upperCaseSymbols(symbols)
|
|
266
266
|
|
|
267
267
|
return [
|