tardis-machine 18.4.0 → 18.4.1
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/dist/ws/subscriptionsmappers.d.ts.map +1 -1
- package/dist/ws/subscriptionsmappers.js +6 -0
- package/dist/ws/subscriptionsmappers.js.map +1 -1
- package/node_modules/tardis-dev/dist/consts.d.ts +2 -1
- package/node_modules/tardis-dev/dist/consts.d.ts.map +1 -1
- package/node_modules/tardis-dev/dist/consts.js +2 -0
- package/node_modules/tardis-dev/dist/consts.js.map +1 -1
- package/node_modules/tardis-dev/dist/handy.d.ts +1 -0
- package/node_modules/tardis-dev/dist/handy.d.ts.map +1 -1
- package/node_modules/tardis-dev/dist/handy.js +19 -10
- package/node_modules/tardis-dev/dist/handy.js.map +1 -1
- package/node_modules/tardis-dev/dist/mappers/ascendex.d.ts +4 -4
- package/node_modules/tardis-dev/dist/mappers/aster.d.ts +8 -8
- package/node_modules/tardis-dev/dist/mappers/binance.d.ts +18 -18
- package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/bitfinex.d.ts +8 -8
- package/node_modules/tardis-dev/dist/mappers/bitflyer.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/bitget.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/bithumb.d.ts +2 -2
- package/node_modules/tardis-dev/dist/mappers/bitmex.d.ts +2 -2
- package/node_modules/tardis-dev/dist/mappers/bitnomial.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/bitstamp.d.ts +2 -2
- package/node_modules/tardis-dev/dist/mappers/bitvavo.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/blockchaincom.d.ts +2 -2
- package/node_modules/tardis-dev/dist/mappers/bullish.d.ts +5 -5
- package/node_modules/tardis-dev/dist/mappers/bybit.d.ts +10 -10
- package/node_modules/tardis-dev/dist/mappers/bybitspot.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/coinbase.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/coinbasederivatives.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/coinbasederivatives.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinbasederivatives.js +144 -0
- package/node_modules/tardis-dev/dist/mappers/coinbasederivatives.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.d.ts +2 -2
- package/node_modules/tardis-dev/dist/mappers/coinflex.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/cryptocom.d.ts +5 -5
- package/node_modules/tardis-dev/dist/mappers/cryptofacilities.d.ts +2 -2
- package/node_modules/tardis-dev/dist/mappers/delta.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/deribit.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/dydx.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/dydxv4.d.ts +4 -4
- package/node_modules/tardis-dev/dist/mappers/dydxv4.js +19 -2
- package/node_modules/tardis-dev/dist/mappers/dydxv4.js.map +1 -1
- package/node_modules/tardis-dev/dist/mappers/ftx.d.ts +8 -8
- package/node_modules/tardis-dev/dist/mappers/gateio.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/gateiofutures.d.ts +4 -4
- package/node_modules/tardis-dev/dist/mappers/gemini.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/huobi.d.ts +26 -26
- package/node_modules/tardis-dev/dist/mappers/hyperliquid.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/index.d.ts +198 -186
- package/node_modules/tardis-dev/dist/mappers/index.d.ts.map +1 -1
- package/node_modules/tardis-dev/dist/mappers/index.js +2 -1
- package/node_modules/tardis-dev/dist/mappers/index.js.map +1 -1
- package/node_modules/tardis-dev/dist/mappers/kucoin.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/kucoinfutures.d.ts +4 -4
- package/node_modules/tardis-dev/dist/mappers/lighter.d.ts +10 -10
- package/node_modules/tardis-dev/dist/mappers/mexc.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/mexcfutures.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/okex.d.ts +15 -15
- package/node_modules/tardis-dev/dist/mappers/phemex.d.ts +1 -1
- package/node_modules/tardis-dev/dist/mappers/polymarket.d.ts +3 -3
- package/node_modules/tardis-dev/dist/mappers/serum.d.ts +9 -9
- package/node_modules/tardis-dev/dist/mappers/upbit.d.ts +2 -2
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbasederivatives.d.ts +32 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbasederivatives.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbasederivatives.js +83 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbasederivatives.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/index.d.ts.map +1 -1
- package/node_modules/tardis-dev/dist/realtimefeeds/index.js +2 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/index.js.map +1 -1
- package/node_modules/tardis-dev/package.json +1 -1
- package/node_modules/tardis-dev/src/consts.ts +2 -0
- package/node_modules/tardis-dev/src/handy.ts +20 -11
- package/node_modules/tardis-dev/src/mappers/coinbasederivatives.ts +230 -0
- package/node_modules/tardis-dev/src/mappers/dydxv4.ts +20 -2
- package/node_modules/tardis-dev/src/mappers/index.ts +2 -0
- package/node_modules/tardis-dev/src/realtimefeeds/coinbasederivatives.ts +103 -0
- package/node_modules/tardis-dev/src/realtimefeeds/index.ts +2 -0
- package/package.json +2 -2
- package/src/ws/subscriptionsmappers.ts +7 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { BookChange, BookTicker, Trade } from '../types.ts';
|
|
2
2
|
export declare const serumMappers: {
|
|
3
3
|
serum: {
|
|
4
|
-
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
5
|
-
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
6
|
-
bookTickers: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookTicker>;
|
|
4
|
+
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
5
|
+
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
6
|
+
bookTickers: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookTicker>;
|
|
7
7
|
};
|
|
8
8
|
'star-atlas': {
|
|
9
|
-
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
10
|
-
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
11
|
-
bookTickers: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookTicker>;
|
|
9
|
+
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
10
|
+
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
11
|
+
bookTickers: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookTicker>;
|
|
12
12
|
};
|
|
13
13
|
mango: {
|
|
14
|
-
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
15
|
-
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
16
|
-
bookTickers: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookTicker>;
|
|
14
|
+
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
15
|
+
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
16
|
+
bookTickers: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookTicker>;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=serum.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BookChange, Trade } from '../types.ts';
|
|
2
2
|
export declare const upbitMappers: {
|
|
3
3
|
upbit: {
|
|
4
|
-
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
5
|
-
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
4
|
+
trades: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", Trade>;
|
|
5
|
+
bookChanges: import("./registry.ts").MapperCreator<"aster" | "aster-futures" | "bithumb" | "bitvavo" | "bitmex" | "deribit" | "binance-futures" | "binance-delivery" | "binance-european-options" | "binance" | "ftx" | "okex-futures" | "okex-options" | "okex-swap" | "okex" | "okex-spreads" | "huobi-dm" | "huobi-dm-swap" | "huobi-dm-linear-swap" | "huobi" | "bitfinex-derivatives" | "bitfinex" | "coinbase" | "coinbase-derivatives" | "coinbase-international" | "cryptofacilities" | "kraken" | "bitstamp" | "gemini" | "poloniex" | "bybit" | "bybit-spot" | "bybit-options" | "bybit-spread" | "phemex" | "delta" | "ftx-us" | "binance-us" | "gate-io-futures" | "mexc-futures" | "gate-io" | "okcoin" | "bitflyer" | "hitbtc" | "coinflex" | "binance-jersey" | "binance-dex" | "upbit" | "ascendex" | "dydx" | "dydx-v4" | "serum" | "mango" | "huobi-dm-options" | "star-atlas" | "crypto-com" | "kucoin" | "kucoin-futures" | "bitnomial" | "woo-x" | "blockchain-com" | "bitget" | "bitget-futures" | "hyperliquid" | "lighter" | "lighter-rh" | "bullish" | "mexc" | "polymarket", BookChange>;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=upbit.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
import { Filter } from '../types.ts';
|
|
3
|
+
import { MultiConnectionRealTimeFeedBase, PoolingClientBase, RealTimeFeedBase } from './realtimefeed.ts';
|
|
4
|
+
export declare class CoinbaseDerivativesRealTimeFeed extends MultiConnectionRealTimeFeedBase {
|
|
5
|
+
protected _getRealTimeFeeds(exchange: string, filters: Filter<string>[], timeoutIntervalMS?: number, onError?: (error: Error) => void): Generator<CoinbaseDerivativesSingleConnectionRealTimeFeed | CoinbaseDerivativesProductsClient, void, unknown>;
|
|
6
|
+
}
|
|
7
|
+
declare class CoinbaseDerivativesSingleConnectionRealTimeFeed extends RealTimeFeedBase {
|
|
8
|
+
protected wssURL: string;
|
|
9
|
+
private sequence?;
|
|
10
|
+
protected mapToSubscribeMessages(filters: Filter<string>[]): ({
|
|
11
|
+
type: string;
|
|
12
|
+
channel: string;
|
|
13
|
+
product_ids: string[] | undefined;
|
|
14
|
+
} | {
|
|
15
|
+
type: string;
|
|
16
|
+
channel: string;
|
|
17
|
+
})[];
|
|
18
|
+
protected onConnected(): Promise<void>;
|
|
19
|
+
protected messageIsError(message: {
|
|
20
|
+
type?: string;
|
|
21
|
+
}): boolean;
|
|
22
|
+
protected onMessage(message: {
|
|
23
|
+
sequence_num?: number;
|
|
24
|
+
}): void;
|
|
25
|
+
}
|
|
26
|
+
declare class CoinbaseDerivativesProductsClient extends PoolingClientBase {
|
|
27
|
+
private readonly symbols;
|
|
28
|
+
constructor(exchange: string, symbols: Set<string> | undefined, onError?: (error: Error) => void);
|
|
29
|
+
protected poolDataToStream(output: Writable): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=coinbasederivatives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coinbasederivatives.d.ts","sourceRoot":"","sources":["../../src/realtimefeeds/coinbasederivatives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAExG,qBAAa,+BAAgC,SAAQ,+BAA+B;IAClF,SAAS,CAAE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;CA8BvI;AAED,cAAM,+CAAgD,SAAQ,gBAAgB;IAC5E,SAAS,CAAC,MAAM,SAAyC;IACzD,OAAO,CAAC,QAAQ,CAAC,CAAQ;IAEzB,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE;;;;;;;;cAgB1C,WAAW;IAI3B,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAInD,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;CAOvD;AAED,cAAM,iCAAkC,SAAQ,iBAAiB;IAG7D,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADxB,QAAQ,EAAE,MAAM,EACC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,EACjD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;cAKlB,gBAAgB,CAAC,MAAM,EAAE,QAAQ;CAgBlD"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { batch, getJSON, optimizeFilters } from "../handy.js";
|
|
2
|
+
import { MultiConnectionRealTimeFeedBase, PoolingClientBase, RealTimeFeedBase } from "./realtimefeed.js";
|
|
3
|
+
export class CoinbaseDerivativesRealTimeFeed extends MultiConnectionRealTimeFeedBase {
|
|
4
|
+
*_getRealTimeFeeds(exchange, filters, timeoutIntervalMS, onError) {
|
|
5
|
+
const wsFilters = optimizeFilters(filters.filter((f) => f.channel !== 'products'));
|
|
6
|
+
for (const filter of wsFilters) {
|
|
7
|
+
if (!['heartbeats', 'subscriptions'].includes(filter.channel) && !filter.symbols?.length) {
|
|
8
|
+
throw new Error('Coinbase derivatives WebSocket subscriptions require explicit symbols');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const symbols = [...new Set(wsFilters.flatMap((f) => f.symbols ?? []))];
|
|
12
|
+
const groups = symbols.length > 0 ? batch(symbols, 25) : wsFilters.length > 0 ? [[]] : [];
|
|
13
|
+
for (const group of groups) {
|
|
14
|
+
const groupedFilters = wsFilters
|
|
15
|
+
.map((f) => ({
|
|
16
|
+
...f,
|
|
17
|
+
symbols: f.symbols?.filter((s) => group.includes(s))
|
|
18
|
+
}))
|
|
19
|
+
.filter((f) => f.symbols?.length || ['heartbeats', 'subscriptions'].includes(f.channel));
|
|
20
|
+
yield new CoinbaseDerivativesSingleConnectionRealTimeFeed(exchange, groupedFilters, timeoutIntervalMS, onError);
|
|
21
|
+
}
|
|
22
|
+
const productFilters = filters.filter((f) => f.channel === 'products');
|
|
23
|
+
if (productFilters.length > 0) {
|
|
24
|
+
const allProducts = productFilters.some((f) => !f.symbols?.length);
|
|
25
|
+
yield new CoinbaseDerivativesProductsClient(exchange, allProducts ? undefined : new Set(productFilters.flatMap((f) => f.symbols)), onError);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
class CoinbaseDerivativesSingleConnectionRealTimeFeed extends RealTimeFeedBase {
|
|
30
|
+
wssURL = 'wss://advanced-trade-ws.coinbase.com';
|
|
31
|
+
sequence;
|
|
32
|
+
mapToSubscribeMessages(filters) {
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
type: 'subscribe',
|
|
36
|
+
channel: 'heartbeats'
|
|
37
|
+
},
|
|
38
|
+
...filters
|
|
39
|
+
.filter((f) => !['heartbeats', 'subscriptions'].includes(f.channel))
|
|
40
|
+
.map((f) => ({
|
|
41
|
+
type: 'subscribe',
|
|
42
|
+
channel: f.channel === 'l2_data' ? 'level2' : f.channel,
|
|
43
|
+
product_ids: f.symbols
|
|
44
|
+
}))
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
async onConnected() {
|
|
48
|
+
this.sequence = undefined;
|
|
49
|
+
}
|
|
50
|
+
messageIsError(message) {
|
|
51
|
+
return message.type === 'error';
|
|
52
|
+
}
|
|
53
|
+
onMessage(message) {
|
|
54
|
+
if (message.sequence_num === undefined)
|
|
55
|
+
return;
|
|
56
|
+
if (this.sequence !== undefined && message.sequence_num !== this.sequence + 1) {
|
|
57
|
+
throw new Error(`Coinbase derivatives sequence gap: ${this.sequence} -> ${message.sequence_num}`);
|
|
58
|
+
}
|
|
59
|
+
this.sequence = message.sequence_num;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
class CoinbaseDerivativesProductsClient extends PoolingClientBase {
|
|
63
|
+
symbols;
|
|
64
|
+
constructor(exchange, symbols, onError) {
|
|
65
|
+
super(exchange, 5, onError);
|
|
66
|
+
this.symbols = symbols;
|
|
67
|
+
}
|
|
68
|
+
async poolDataToStream(output) {
|
|
69
|
+
for (let offset = 0; !output.destroyed; offset += 100) {
|
|
70
|
+
const { data } = await getJSON(`https://api.coinbase.com/api/v3/brokerage/market/products?product_type=FUTURE&limit=100&offset=${offset}`);
|
|
71
|
+
for (const product of data.products) {
|
|
72
|
+
if (output.destroyed)
|
|
73
|
+
return;
|
|
74
|
+
if (this.symbols === undefined || this.symbols.has(product.product_id)) {
|
|
75
|
+
output.write({ channel: 'products', generated: true, events: [product] });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!data.pagination.has_next)
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=coinbasederivatives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coinbasederivatives.js","sourceRoot":"","sources":["../../src/realtimefeeds/coinbasederivatives.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7D,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAExG,MAAM,OAAO,+BAAgC,SAAQ,+BAA+B;IACxE,CAAC,iBAAiB,CAAC,QAAgB,EAAE,OAAyB,EAAE,iBAA0B,EAAE,OAAgC;QACpI,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAA;QAClF,KAAK,MAAM,MAAM,IAAI,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAA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":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/realtimefeeds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/realtimefeeds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAgC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AA6BhD,cAAc,mBAAmB,CAAA;AAyEjC,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAMvE;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EACzB,iBAAiB,EAAE,MAAM,GAAG,SAAS,EACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,oDAKjC"}
|
|
@@ -8,6 +8,7 @@ import { BitstampRealTimeFeed } from "./bitstamp.js";
|
|
|
8
8
|
import { BitvavoRealTimeFeed } from "./bitvavo.js";
|
|
9
9
|
import { BybitOptionsRealTimeDataFeed, BybitRealTimeDataFeed, BybitSpotRealTimeDataFeed, BybitSpreadRealTimeDataFeed } from "./bybit.js";
|
|
10
10
|
import { CoinbaseRealTimeFeed } from "./coinbase.js";
|
|
11
|
+
import { CoinbaseDerivativesRealTimeFeed } from "./coinbasederivatives.js";
|
|
11
12
|
import { CryptofacilitiesRealTimeFeed } from "./cryptofacilities.js";
|
|
12
13
|
import { DeribitRealTimeDataFeed } from "./deribit.js";
|
|
13
14
|
import { FtxRealTimeFeed, FtxUSRealTimeFeed } from "./ftx.js";
|
|
@@ -60,6 +61,7 @@ const realTimeFeedsMap = {
|
|
|
60
61
|
bitstamp: BitstampRealTimeFeed,
|
|
61
62
|
bitvavo: BitvavoRealTimeFeed,
|
|
62
63
|
coinbase: CoinbaseRealTimeFeed,
|
|
64
|
+
'coinbase-derivatives': CoinbaseDerivativesRealTimeFeed,
|
|
63
65
|
cryptofacilities: CryptofacilitiesRealTimeFeed,
|
|
64
66
|
deribit: DeribitRealTimeDataFeed,
|
|
65
67
|
ftx: FtxRealTimeFeed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/realtimefeeds/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACxE,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AACxI,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,uBAAu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AAQ,CAAC,EAAE,CAAC;QAC/B,OAAO,gBAAgB,CAAC,QAAQ,CAAE,CAAA;IACpC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qDAAqD,QAAQ,EAAE,CAAC,CAAA;AAClF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,QAAkB,EAClB,OAAyB,EACzB,iBAAqC,EACrC,OAAgC;IAEhC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IAE5D,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAA;AAC/E,CAAC"}
|
|
@@ -22,6 +22,7 @@ export const EXCHANGES = [
|
|
|
22
22
|
'bitfinex-derivatives',
|
|
23
23
|
'bitfinex',
|
|
24
24
|
'coinbase',
|
|
25
|
+
'coinbase-derivatives',
|
|
25
26
|
'coinbase-international',
|
|
26
27
|
'cryptofacilities',
|
|
27
28
|
'kraken',
|
|
@@ -614,6 +615,7 @@ export const EXCHANGE_CHANNELS_INFO = {
|
|
|
614
615
|
bithumb: BITHUMB_CHANNELS,
|
|
615
616
|
bitmex: BITMEX_CHANNELS,
|
|
616
617
|
coinbase: COINBASE_CHANNELS,
|
|
618
|
+
'coinbase-derivatives': ['l2_data', 'market_trades', 'ticker', 'heartbeats', 'subscriptions', 'products'],
|
|
617
619
|
'coinbase-international': COINBASE_INTERNATIONAL_CHANNELS,
|
|
618
620
|
deribit: DERIBIT_CHANNELS,
|
|
619
621
|
cryptofacilities: CRYPTOFACILITIES_CHANNELS,
|
|
@@ -206,20 +206,29 @@ export function* batchObjects<T>(payload: T[], batchSize: number) {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
export function parseμs(dateString: string): number {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const hundreds = dateString.charCodeAt(23) - 48
|
|
213
|
-
const tens = dateString.charCodeAt(24) - 48
|
|
214
|
-
const ones = dateString.charCodeAt(25) - 48
|
|
215
|
-
if (hundreds >= 0 && hundreds <= 9 && tens >= 0 && tens <= 9 && ones >= 0 && ones <= 9) {
|
|
216
|
-
return hundreds * 100 + tens * 10 + ones
|
|
217
|
-
}
|
|
209
|
+
if (dateString[19] !== '.') {
|
|
210
|
+
return 0
|
|
211
|
+
}
|
|
218
212
|
|
|
219
|
-
|
|
213
|
+
// ISO fractions may omit trailing zeros. Keep digits 4–6, padding shorter fractions and truncating finer precision.
|
|
214
|
+
let microseconds = 0
|
|
215
|
+
for (let index = 20, weight = 100; index < 26; index++) {
|
|
216
|
+
const digit = dateString.charCodeAt(index) - 48
|
|
217
|
+
if (!(digit >= 0 && digit <= 9)) {
|
|
218
|
+
break
|
|
219
|
+
}
|
|
220
|
+
if (index >= 23) {
|
|
221
|
+
microseconds += digit * weight
|
|
222
|
+
weight /= 10
|
|
223
|
+
}
|
|
220
224
|
}
|
|
225
|
+
return microseconds
|
|
226
|
+
}
|
|
221
227
|
|
|
222
|
-
|
|
228
|
+
export function parseISODateWithMicroseconds(value: string) {
|
|
229
|
+
const date = new Date(value)
|
|
230
|
+
date.μs = parseμs(value)
|
|
231
|
+
return date
|
|
223
232
|
}
|
|
224
233
|
|
|
225
234
|
export function optimizeFilters(filters: Filter<any>[]) {
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { asNumberOrUndefined, parseISODateWithMicroseconds, upperCaseSymbols } from '../handy.ts'
|
|
2
|
+
import { BookChange, BookTicker, DerivativeTicker, Trade } from '../types.ts'
|
|
3
|
+
import { Mapper, PendingTickerInfoHelper } from './mapper.ts'
|
|
4
|
+
import { exchangeMappers } from './registry.ts'
|
|
5
|
+
|
|
6
|
+
export const coinbaseDerivativesMappers = exchangeMappers({
|
|
7
|
+
'coinbase-derivatives': {
|
|
8
|
+
trades: () => new CoinbaseDerivativesTradesMapper(),
|
|
9
|
+
bookChanges: () => new CoinbaseDerivativesBookChangeMapper(),
|
|
10
|
+
bookTickers: () => new CoinbaseDerivativesBookTickerMapper(),
|
|
11
|
+
derivativeTickers: () => new CoinbaseDerivativesTickerMapper()
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
class CoinbaseDerivativesTradesMapper implements Mapper<'coinbase-derivatives', Trade> {
|
|
16
|
+
// Besides the subscribe snapshot, Coinbase resends recent-trade snapshots mid-connection, each followed by an update with the preceding older trades.
|
|
17
|
+
private readonly _snapshotTradeIds = new Map<string, number>()
|
|
18
|
+
|
|
19
|
+
canHandle(message: CoinbaseDerivativesTrade) {
|
|
20
|
+
return message.channel === 'market_trades'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getFilters(symbols?: string[]) {
|
|
24
|
+
return [{ channel: 'market_trades', symbols: upperCaseSymbols(symbols) } as const]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
*map(message: CoinbaseDerivativesTrade, localTimestamp: Date): IterableIterator<Trade> {
|
|
28
|
+
for (const event of message.events) {
|
|
29
|
+
if (event.type === 'snapshot') {
|
|
30
|
+
for (const trade of event.trades) {
|
|
31
|
+
const tradeId = Number(trade.trade_id)
|
|
32
|
+
this._snapshotTradeIds.set(trade.product_id, Math.max(tradeId, this._snapshotTradeIds.get(trade.product_id) ?? tradeId))
|
|
33
|
+
}
|
|
34
|
+
continue
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
for (const trade of event.trades) {
|
|
38
|
+
if (Number(trade.trade_id) <= (this._snapshotTradeIds.get(trade.product_id) ?? 0)) {
|
|
39
|
+
continue
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
yield {
|
|
43
|
+
type: 'trade',
|
|
44
|
+
exchange: 'coinbase-derivatives',
|
|
45
|
+
symbol: trade.product_id,
|
|
46
|
+
id: trade.trade_id,
|
|
47
|
+
price: Number(trade.price),
|
|
48
|
+
amount: Number(trade.size),
|
|
49
|
+
side: trade.side === 'BUY' ? 'sell' : 'buy',
|
|
50
|
+
timestamp: parseISODateWithMicroseconds(trade.time),
|
|
51
|
+
localTimestamp
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
class CoinbaseDerivativesBookChangeMapper implements Mapper<'coinbase-derivatives', BookChange> {
|
|
59
|
+
canHandle(message: CoinbaseDerivativesBook) {
|
|
60
|
+
return message.channel === 'l2_data'
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
getFilters(symbols?: string[]) {
|
|
64
|
+
return [{ channel: 'l2_data', symbols: upperCaseSymbols(symbols) } as const]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
*map(message: CoinbaseDerivativesBook, localTimestamp: Date): IterableIterator<BookChange> {
|
|
68
|
+
for (const event of message.events) {
|
|
69
|
+
yield {
|
|
70
|
+
type: 'book_change',
|
|
71
|
+
exchange: 'coinbase-derivatives',
|
|
72
|
+
symbol: event.product_id,
|
|
73
|
+
isSnapshot: event.type === 'snapshot',
|
|
74
|
+
bids: event.updates.filter((u) => u.side === 'bid').map(this.mapBookLevel),
|
|
75
|
+
asks: event.updates.filter((u) => u.side === 'offer').map(this.mapBookLevel),
|
|
76
|
+
timestamp: parseISODateWithMicroseconds(
|
|
77
|
+
event.updates.length > 0 ? event.updates[event.updates.length - 1].event_time : message.timestamp
|
|
78
|
+
),
|
|
79
|
+
localTimestamp
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private mapBookLevel(update: CoinbaseDerivativesBook['events'][number]['updates'][number]) {
|
|
85
|
+
return {
|
|
86
|
+
price: Number(update.price_level),
|
|
87
|
+
amount: Number(update.new_quantity)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
class CoinbaseDerivativesBookTickerMapper implements Mapper<'coinbase-derivatives', BookTicker> {
|
|
93
|
+
canHandle(message: CoinbaseDerivativesTicker) {
|
|
94
|
+
return message.channel === 'ticker'
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
getFilters(symbols?: string[]) {
|
|
98
|
+
return [{ channel: 'ticker', symbols: upperCaseSymbols(symbols) } as const]
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
*map(message: CoinbaseDerivativesTicker, localTimestamp: Date): IterableIterator<BookTicker> {
|
|
102
|
+
for (const event of message.events)
|
|
103
|
+
for (const ticker of event.tickers) {
|
|
104
|
+
const bidPrice = asNumberOrUndefined(ticker.best_bid)
|
|
105
|
+
const askPrice = asNumberOrUndefined(ticker.best_ask)
|
|
106
|
+
|
|
107
|
+
if (bidPrice === undefined && askPrice === undefined) {
|
|
108
|
+
continue
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
yield {
|
|
112
|
+
type: 'book_ticker',
|
|
113
|
+
exchange: 'coinbase-derivatives',
|
|
114
|
+
symbol: ticker.product_id,
|
|
115
|
+
bidPrice,
|
|
116
|
+
bidAmount: asNumberOrUndefined(ticker.best_bid_quantity),
|
|
117
|
+
askPrice,
|
|
118
|
+
askAmount: asNumberOrUndefined(ticker.best_ask_quantity),
|
|
119
|
+
timestamp: parseISODateWithMicroseconds(message.timestamp),
|
|
120
|
+
localTimestamp
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
class CoinbaseDerivativesTickerMapper implements Mapper<'coinbase-derivatives', DerivativeTicker> {
|
|
127
|
+
private readonly pending = new PendingTickerInfoHelper()
|
|
128
|
+
|
|
129
|
+
canHandle(message: CoinbaseDerivativesProducts | CoinbaseDerivativesTicker) {
|
|
130
|
+
return message.channel === 'products' || message.channel === 'ticker'
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
getFilters(symbols?: string[]) {
|
|
134
|
+
return [
|
|
135
|
+
{ channel: 'products', symbols: upperCaseSymbols(symbols) } as const,
|
|
136
|
+
{ channel: 'ticker', symbols: upperCaseSymbols(symbols) } as const
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
*map(message: CoinbaseDerivativesProducts | CoinbaseDerivativesTicker, localTimestamp: Date) {
|
|
141
|
+
if (message.channel === 'ticker') {
|
|
142
|
+
for (const event of message.events)
|
|
143
|
+
for (const ticker of event.tickers) {
|
|
144
|
+
const info = this.pending.getPendingTickerInfo(ticker.product_id, 'coinbase-derivatives')
|
|
145
|
+
info.updateLastPrice(asNumberOrUndefined(ticker.price))
|
|
146
|
+
info.updateTimestamp(parseISODateWithMicroseconds(message.timestamp))
|
|
147
|
+
if (info.hasChanged()) {
|
|
148
|
+
yield info.getSnapshot(localTimestamp)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
for (const product of message.events) {
|
|
155
|
+
const info = this.pending.getPendingTickerInfo(product.product_id, 'coinbase-derivatives')
|
|
156
|
+
|
|
157
|
+
const details = product.future_product_details
|
|
158
|
+
info.updateOpenInterest(asNumberOrUndefined(details.open_interest))
|
|
159
|
+
info.updateFundingRate(asNumberOrUndefined(details.funding_rate))
|
|
160
|
+
info.updateIndexPrice(asNumberOrUndefined(details.index_price))
|
|
161
|
+
// funding_time identifies the published rate, not the next funding event. No mark price is supplied.
|
|
162
|
+
info.updateTimestamp(localTimestamp)
|
|
163
|
+
|
|
164
|
+
if (info.hasChanged()) {
|
|
165
|
+
yield info.getSnapshot(localTimestamp)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
type CoinbaseDerivativesMessage<Channel extends string, Event> = {
|
|
172
|
+
channel: Channel
|
|
173
|
+
events: Event[]
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
type CoinbaseDerivativesTrade = CoinbaseDerivativesMessage<
|
|
177
|
+
'market_trades',
|
|
178
|
+
{
|
|
179
|
+
type: CoinbaseDerivativesMessageType
|
|
180
|
+
trades: {
|
|
181
|
+
product_id: string
|
|
182
|
+
trade_id: string
|
|
183
|
+
price: string
|
|
184
|
+
size: string
|
|
185
|
+
side: 'BUY' | 'SELL'
|
|
186
|
+
time: string
|
|
187
|
+
}[]
|
|
188
|
+
}
|
|
189
|
+
>
|
|
190
|
+
type CoinbaseDerivativesBook = CoinbaseDerivativesMessage<
|
|
191
|
+
'l2_data',
|
|
192
|
+
{
|
|
193
|
+
type: CoinbaseDerivativesMessageType
|
|
194
|
+
product_id: string
|
|
195
|
+
updates: {
|
|
196
|
+
side: 'bid' | 'offer'
|
|
197
|
+
price_level: string
|
|
198
|
+
new_quantity: string
|
|
199
|
+
event_time: string
|
|
200
|
+
}[]
|
|
201
|
+
}
|
|
202
|
+
> & { timestamp: string }
|
|
203
|
+
|
|
204
|
+
type CoinbaseDerivativesTicker = CoinbaseDerivativesMessage<
|
|
205
|
+
'ticker',
|
|
206
|
+
{
|
|
207
|
+
tickers: {
|
|
208
|
+
product_id: string
|
|
209
|
+
price: string
|
|
210
|
+
best_bid?: string
|
|
211
|
+
best_ask?: string
|
|
212
|
+
best_bid_quantity?: string
|
|
213
|
+
best_ask_quantity?: string
|
|
214
|
+
}[]
|
|
215
|
+
}
|
|
216
|
+
> & { timestamp: string }
|
|
217
|
+
|
|
218
|
+
type CoinbaseDerivativesProducts = CoinbaseDerivativesMessage<
|
|
219
|
+
'products',
|
|
220
|
+
{
|
|
221
|
+
product_id: string
|
|
222
|
+
future_product_details: {
|
|
223
|
+
open_interest: string
|
|
224
|
+
funding_rate: string
|
|
225
|
+
index_price: string
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
> & { generated: true }
|
|
229
|
+
|
|
230
|
+
type CoinbaseDerivativesMessageType = 'snapshot' | 'update'
|