tardis-machine 17.0.0 → 18.0.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/bin/tardis-machine.js +68 -57
- package/dist/tardismachine.d.ts.map +1 -1
- package/dist/tardismachine.js +13 -6
- package/dist/tardismachine.js.map +1 -1
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/follow-redirects/LICENSE +18 -0
- package/node_modules/follow-redirects/README.md +157 -0
- package/node_modules/follow-redirects/debug.js +15 -0
- package/node_modules/follow-redirects/http.js +1 -0
- package/node_modules/follow-redirects/https.js +1 -0
- package/node_modules/follow-redirects/index.js +709 -0
- package/node_modules/follow-redirects/package.json +58 -0
- package/node_modules/long/LICENSE +202 -0
- package/node_modules/long/README.md +286 -0
- package/node_modules/long/index.d.ts +2 -0
- package/node_modules/long/index.js +1581 -0
- package/node_modules/long/package.json +58 -0
- package/node_modules/long/types.d.ts +474 -0
- package/node_modules/long/umd/index.d.ts +3 -0
- package/node_modules/long/umd/index.js +1622 -0
- package/node_modules/long/umd/package.json +3 -0
- package/node_modules/long/umd/types.d.ts +474 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/protobufjs/LICENSE +39 -0
- package/node_modules/protobufjs/README.md +440 -0
- package/node_modules/protobufjs/dist/light/protobuf.js +9276 -0
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -0
- package/node_modules/protobufjs/dist/light/protobuf.min.js +8 -0
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -0
- package/node_modules/protobufjs/dist/minimal/protobuf.js +3556 -0
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -0
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +8 -0
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -0
- package/node_modules/protobufjs/dist/protobuf.js +11233 -0
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -0
- package/node_modules/protobufjs/dist/protobuf.min.js +8 -0
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -0
- package/node_modules/protobufjs/ext/README.md +70 -0
- package/node_modules/protobufjs/ext/debug/README.md +4 -0
- package/node_modules/protobufjs/ext/debug/index.js +71 -0
- package/node_modules/protobufjs/ext/descriptor/README.md +5 -0
- package/node_modules/protobufjs/ext/descriptor/index.d.ts +2 -0
- package/node_modules/protobufjs/ext/descriptor/index.js +2 -0
- package/node_modules/protobufjs/ext/descriptor.d.ts +87 -0
- package/node_modules/protobufjs/ext/descriptor.generated.d.ts +417 -0
- package/node_modules/protobufjs/ext/descriptor.js +1356 -0
- package/node_modules/protobufjs/ext/protojson.LICENSE +201 -0
- package/node_modules/protobufjs/ext/protojson.d.ts +20 -0
- package/node_modules/protobufjs/ext/protojson.generated.d.ts +49 -0
- package/node_modules/protobufjs/ext/protojson.js +951 -0
- package/node_modules/protobufjs/ext/textformat.d.ts +19 -0
- package/node_modules/protobufjs/ext/textformat.generated.d.ts +33 -0
- package/node_modules/protobufjs/ext/textformat.js +1276 -0
- package/node_modules/protobufjs/google/LICENSE +27 -0
- package/node_modules/protobufjs/google/README.md +1 -0
- package/node_modules/protobufjs/google/api/annotations.json +85 -0
- package/node_modules/protobufjs/google/api/annotations.proto +11 -0
- package/node_modules/protobufjs/google/api/http.json +87 -0
- package/node_modules/protobufjs/google/api/http.proto +31 -0
- package/node_modules/protobufjs/google/protobuf/api.json +124 -0
- package/node_modules/protobufjs/google/protobuf/api.proto +34 -0
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +126 -0
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +47 -0
- package/node_modules/protobufjs/google/protobuf/descriptor.json +1465 -0
- package/node_modules/protobufjs/google/protobuf/descriptor.proto +527 -0
- package/node_modules/protobufjs/google/protobuf/source_context.json +21 -0
- package/node_modules/protobufjs/google/protobuf/source_context.proto +7 -0
- package/node_modules/protobufjs/google/protobuf/type.json +209 -0
- package/node_modules/protobufjs/google/protobuf/type.proto +89 -0
- package/node_modules/protobufjs/index.d.ts +3203 -0
- package/node_modules/protobufjs/index.js +4 -0
- package/node_modules/protobufjs/light.d.ts +2 -0
- package/node_modules/protobufjs/light.js +4 -0
- package/node_modules/protobufjs/minimal.d.ts +2 -0
- package/node_modules/protobufjs/minimal.js +4 -0
- package/node_modules/protobufjs/package.json +93 -0
- package/node_modules/protobufjs/src/common.js +405 -0
- package/node_modules/protobufjs/src/converter.js +352 -0
- package/node_modules/protobufjs/src/decoder.js +279 -0
- package/node_modules/protobufjs/src/encoder.js +123 -0
- package/node_modules/protobufjs/src/enum.js +239 -0
- package/node_modules/protobufjs/src/field.js +505 -0
- package/node_modules/protobufjs/src/index-light.js +104 -0
- package/node_modules/protobufjs/src/index-minimal.js +35 -0
- package/node_modules/protobufjs/src/index.js +12 -0
- package/node_modules/protobufjs/src/mapfield.js +144 -0
- package/node_modules/protobufjs/src/message.js +137 -0
- package/node_modules/protobufjs/src/method.js +183 -0
- package/node_modules/protobufjs/src/namespace.js +574 -0
- package/node_modules/protobufjs/src/object.js +392 -0
- package/node_modules/protobufjs/src/oneof.js +233 -0
- package/node_modules/protobufjs/src/parse.js +1111 -0
- package/node_modules/protobufjs/src/reader.js +788 -0
- package/node_modules/protobufjs/src/reader_buffer.js +77 -0
- package/node_modules/protobufjs/src/root.js +424 -0
- package/node_modules/protobufjs/src/roots.js +18 -0
- package/node_modules/protobufjs/src/rpc/service.js +155 -0
- package/node_modules/protobufjs/src/rpc.js +36 -0
- package/node_modules/protobufjs/src/service.js +206 -0
- package/node_modules/protobufjs/src/tokenize.js +421 -0
- package/node_modules/protobufjs/src/type.js +676 -0
- package/node_modules/protobufjs/src/types.js +196 -0
- package/node_modules/protobufjs/src/typescript.js +25 -0
- package/node_modules/protobufjs/src/util/aspromise.d.ts +13 -0
- package/node_modules/protobufjs/src/util/aspromise.js +52 -0
- package/node_modules/protobufjs/src/util/base64.d.ts +32 -0
- package/node_modules/protobufjs/src/util/base64.js +146 -0
- package/node_modules/protobufjs/src/util/codegen.d.ts +31 -0
- package/node_modules/protobufjs/src/util/codegen.js +118 -0
- package/node_modules/protobufjs/src/util/eventemitter.d.ts +45 -0
- package/node_modules/protobufjs/src/util/eventemitter.js +86 -0
- package/node_modules/protobufjs/src/util/fetch.d.ts +56 -0
- package/node_modules/protobufjs/src/util/fetch.js +112 -0
- package/node_modules/protobufjs/src/util/float.d.ts +83 -0
- package/node_modules/protobufjs/src/util/float.js +335 -0
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/longbits.js +204 -0
- package/node_modules/protobufjs/src/util/minimal.js +511 -0
- package/node_modules/protobufjs/src/util/path.d.ts +22 -0
- package/node_modules/protobufjs/src/util/path.js +100 -0
- package/node_modules/protobufjs/src/util/patterns.js +7 -0
- package/node_modules/protobufjs/src/util/pool.d.ts +32 -0
- package/node_modules/protobufjs/src/util/pool.js +48 -0
- package/node_modules/protobufjs/src/util/utf8.d.ts +24 -0
- package/node_modules/protobufjs/src/util/utf8.js +190 -0
- package/node_modules/protobufjs/src/util.js +264 -0
- package/node_modules/protobufjs/src/verifier.js +185 -0
- package/node_modules/protobufjs/src/wrappers.js +106 -0
- package/node_modules/protobufjs/src/writer.js +700 -0
- package/node_modules/protobufjs/src/writer_buffer.js +100 -0
- package/node_modules/protobufjs/tsconfig.json +6 -0
- package/node_modules/tardis-dev/LICENSE +373 -0
- package/node_modules/tardis-dev/README.md +275 -0
- package/node_modules/tardis-dev/dist/apikeyaccessinfo.d.ts +11 -0
- package/node_modules/tardis-dev/dist/apikeyaccessinfo.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/apikeyaccessinfo.js +13 -0
- package/node_modules/tardis-dev/dist/apikeyaccessinfo.js.map +1 -0
- package/node_modules/tardis-dev/dist/binarysplit.d.ts +8 -0
- package/node_modules/tardis-dev/dist/binarysplit.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/binarysplit.js +41 -0
- package/node_modules/tardis-dev/dist/binarysplit.js.map +1 -0
- package/node_modules/tardis-dev/dist/boundedqueue.d.ts +19 -0
- package/node_modules/tardis-dev/dist/boundedqueue.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/boundedqueue.js +96 -0
- package/node_modules/tardis-dev/dist/boundedqueue.js.map +1 -0
- package/node_modules/tardis-dev/dist/clearcache.d.ts +4 -0
- package/node_modules/tardis-dev/dist/clearcache.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/clearcache.js +48 -0
- package/node_modules/tardis-dev/dist/clearcache.js.map +1 -0
- package/node_modules/tardis-dev/dist/combine.d.ts +14 -0
- package/node_modules/tardis-dev/dist/combine.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/combine.js +97 -0
- package/node_modules/tardis-dev/dist/combine.js.map +1 -0
- package/node_modules/tardis-dev/dist/computable/booksnapshot.d.ts +14 -0
- package/node_modules/tardis-dev/dist/computable/booksnapshot.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/computable/booksnapshot.js +248 -0
- package/node_modules/tardis-dev/dist/computable/booksnapshot.js.map +1 -0
- package/node_modules/tardis-dev/dist/computable/computable.d.ts +8 -0
- package/node_modules/tardis-dev/dist/computable/computable.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/computable/computable.js +72 -0
- package/node_modules/tardis-dev/dist/computable/computable.js.map +1 -0
- package/node_modules/tardis-dev/dist/computable/context.d.ts +4 -0
- package/node_modules/tardis-dev/dist/computable/context.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/computable/context.js +9 -0
- package/node_modules/tardis-dev/dist/computable/context.js.map +1 -0
- package/node_modules/tardis-dev/dist/computable/index.d.ts +4 -0
- package/node_modules/tardis-dev/dist/computable/index.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/computable/index.js +4 -0
- package/node_modules/tardis-dev/dist/computable/index.js.map +1 -0
- package/node_modules/tardis-dev/dist/computable/tradebar.d.ts +11 -0
- package/node_modules/tardis-dev/dist/computable/tradebar.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/computable/tradebar.js +132 -0
- package/node_modules/tardis-dev/dist/computable/tradebar.js.map +1 -0
- package/node_modules/tardis-dev/dist/consts.d.ts +66 -0
- package/node_modules/tardis-dev/dist/consts.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/consts.js +573 -0
- package/node_modules/tardis-dev/dist/consts.js.map +1 -0
- package/node_modules/tardis-dev/dist/debug.d.ts +3 -0
- package/node_modules/tardis-dev/dist/debug.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/debug.js +3 -0
- package/node_modules/tardis-dev/dist/debug.js.map +1 -0
- package/node_modules/tardis-dev/dist/downloaddatasets.d.ts +25 -0
- package/node_modules/tardis-dev/dist/downloaddatasets.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/downloaddatasets.js +118 -0
- package/node_modules/tardis-dev/dist/downloaddatasets.js.map +1 -0
- package/node_modules/tardis-dev/dist/exchangedetails.d.ts +91 -0
- package/node_modules/tardis-dev/dist/exchangedetails.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/exchangedetails.js +8 -0
- package/node_modules/tardis-dev/dist/exchangedetails.js.map +1 -0
- package/node_modules/tardis-dev/dist/filter.d.ts +8 -0
- package/node_modules/tardis-dev/dist/filter.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/filter.js +51 -0
- package/node_modules/tardis-dev/dist/filter.js.map +1 -0
- package/node_modules/tardis-dev/dist/foreachconcurrent.d.ts +2 -0
- package/node_modules/tardis-dev/dist/foreachconcurrent.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/foreachconcurrent.js +28 -0
- package/node_modules/tardis-dev/dist/foreachconcurrent.js.map +1 -0
- package/node_modules/tardis-dev/dist/handy.d.ts +102 -0
- package/node_modules/tardis-dev/dist/handy.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/handy.js +706 -0
- package/node_modules/tardis-dev/dist/handy.js.map +1 -0
- package/node_modules/tardis-dev/dist/index.d.ts +17 -0
- package/node_modules/tardis-dev/dist/index.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/index.js +17 -0
- package/node_modules/tardis-dev/dist/index.js.map +1 -0
- package/node_modules/tardis-dev/dist/instrumentinfo.d.ts +105 -0
- package/node_modules/tardis-dev/dist/instrumentinfo.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/instrumentinfo.js +59 -0
- package/node_modules/tardis-dev/dist/instrumentinfo.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/ascendex.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/ascendex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/ascendex.js +146 -0
- package/node_modules/tardis-dev/dist/mappers/ascendex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/binance.d.ts +32 -0
- package/node_modules/tardis-dev/dist/mappers/binance.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/binance.js +420 -0
- package/node_modules/tardis-dev/dist/mappers/binance.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/binancedex.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/binancedex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/binancedex.js +120 -0
- package/node_modules/tardis-dev/dist/mappers/binancedex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.js +389 -0
- package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitfinex.d.ts +16 -0
- package/node_modules/tardis-dev/dist/mappers/bitfinex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitfinex.js +352 -0
- package/node_modules/tardis-dev/dist/mappers/bitfinex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitflyer.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/bitflyer.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitflyer.js +121 -0
- package/node_modules/tardis-dev/dist/mappers/bitflyer.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitget.d.ts +16 -0
- package/node_modules/tardis-dev/dist/mappers/bitget.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitget.js +335 -0
- package/node_modules/tardis-dev/dist/mappers/bitget.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitmex.d.ts +11 -0
- package/node_modules/tardis-dev/dist/mappers/bitmex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitmex.js +248 -0
- package/node_modules/tardis-dev/dist/mappers/bitmex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitnomial.d.ts +8 -0
- package/node_modules/tardis-dev/dist/mappers/bitnomial.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitnomial.js +91 -0
- package/node_modules/tardis-dev/dist/mappers/bitnomial.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitstamp.d.ts +8 -0
- package/node_modules/tardis-dev/dist/mappers/bitstamp.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bitstamp.js +151 -0
- package/node_modules/tardis-dev/dist/mappers/bitstamp.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/blockchaincom.d.ts +8 -0
- package/node_modules/tardis-dev/dist/mappers/blockchaincom.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/blockchaincom.js +65 -0
- package/node_modules/tardis-dev/dist/mappers/blockchaincom.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bullish.d.ts +11 -0
- package/node_modules/tardis-dev/dist/mappers/bullish.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bullish.js +234 -0
- package/node_modules/tardis-dev/dist/mappers/bullish.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bybit.d.ts +66 -0
- package/node_modules/tardis-dev/dist/mappers/bybit.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bybit.js +601 -0
- package/node_modules/tardis-dev/dist/mappers/bybit.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bybitspot.d.ts +96 -0
- package/node_modules/tardis-dev/dist/mappers/bybitspot.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/bybitspot.js +99 -0
- package/node_modules/tardis-dev/dist/mappers/bybitspot.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinbase.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/coinbase.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinbase.js +176 -0
- package/node_modules/tardis-dev/dist/mappers/coinbase.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.js +210 -0
- package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinflex.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/coinflex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/coinflex.js +111 -0
- package/node_modules/tardis-dev/dist/mappers/coinflex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/cryptocom.d.ts +25 -0
- package/node_modules/tardis-dev/dist/mappers/cryptocom.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/cryptocom.js +219 -0
- package/node_modules/tardis-dev/dist/mappers/cryptocom.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/cryptofacilities.d.ts +11 -0
- package/node_modules/tardis-dev/dist/mappers/cryptofacilities.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/cryptofacilities.js +199 -0
- package/node_modules/tardis-dev/dist/mappers/cryptofacilities.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/delta.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/delta.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/delta.js +205 -0
- package/node_modules/tardis-dev/dist/mappers/delta.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/deribit.d.ts +12 -0
- package/node_modules/tardis-dev/dist/mappers/deribit.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/deribit.js +278 -0
- package/node_modules/tardis-dev/dist/mappers/deribit.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/dydx.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/dydx.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/dydx.js +188 -0
- package/node_modules/tardis-dev/dist/mappers/dydx.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/dydxv4.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/dydxv4.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/dydxv4.js +189 -0
- package/node_modules/tardis-dev/dist/mappers/dydxv4.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/ftx.d.ts +16 -0
- package/node_modules/tardis-dev/dist/mappers/ftx.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/ftx.js +222 -0
- package/node_modules/tardis-dev/dist/mappers/ftx.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/gateio.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/gateio.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/gateio.js +370 -0
- package/node_modules/tardis-dev/dist/mappers/gateio.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/gateiofutures.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/gateiofutures.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/gateiofutures.js +183 -0
- package/node_modules/tardis-dev/dist/mappers/gateiofutures.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/gemini.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/gemini.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/gemini.js +145 -0
- package/node_modules/tardis-dev/dist/mappers/gemini.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/hitbtc.d.ts +8 -0
- package/node_modules/tardis-dev/dist/mappers/hitbtc.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/hitbtc.js +76 -0
- package/node_modules/tardis-dev/dist/mappers/hitbtc.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/huobi.d.ts +125 -0
- package/node_modules/tardis-dev/dist/mappers/huobi.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/huobi.js +529 -0
- package/node_modules/tardis-dev/dist/mappers/huobi.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/hyperliquid.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/hyperliquid.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/hyperliquid.js +161 -0
- package/node_modules/tardis-dev/dist/mappers/hyperliquid.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/index.d.ts +788 -0
- package/node_modules/tardis-dev/dist/mappers/index.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/index.js +66 -0
- package/node_modules/tardis-dev/dist/mappers/index.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/kraken.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/kraken.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/kraken.js +238 -0
- package/node_modules/tardis-dev/dist/mappers/kraken.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/kucoin.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/kucoin.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/kucoin.js +237 -0
- package/node_modules/tardis-dev/dist/mappers/kucoin.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/kucoinfutures.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/kucoinfutures.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/kucoinfutures.js +302 -0
- package/node_modules/tardis-dev/dist/mappers/kucoinfutures.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/lighter.d.ts +11 -0
- package/node_modules/tardis-dev/dist/mappers/lighter.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/lighter.js +186 -0
- package/node_modules/tardis-dev/dist/mappers/lighter.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/mapper.d.ts +32 -0
- package/node_modules/tardis-dev/dist/mappers/mapper.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/mapper.js +120 -0
- package/node_modules/tardis-dev/dist/mappers/mapper.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/mexc.d.ts +122 -0
- package/node_modules/tardis-dev/dist/mappers/mexc.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/mexc.js +205 -0
- package/node_modules/tardis-dev/dist/mappers/mexc.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/mexcfutures.d.ts +137 -0
- package/node_modules/tardis-dev/dist/mappers/mexcfutures.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/mexcfutures.js +225 -0
- package/node_modules/tardis-dev/dist/mappers/mexcfutures.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/okex.d.ts +39 -0
- package/node_modules/tardis-dev/dist/mappers/okex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/okex.js +913 -0
- package/node_modules/tardis-dev/dist/mappers/okex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/okexspreads.d.ts +69 -0
- package/node_modules/tardis-dev/dist/mappers/okexspreads.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/okexspreads.js +116 -0
- package/node_modules/tardis-dev/dist/mappers/okexspreads.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/phemex.d.ts +9 -0
- package/node_modules/tardis-dev/dist/mappers/phemex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/phemex.js +406 -0
- package/node_modules/tardis-dev/dist/mappers/phemex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/poloniex.d.ts +8 -0
- package/node_modules/tardis-dev/dist/mappers/poloniex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/poloniex.js +207 -0
- package/node_modules/tardis-dev/dist/mappers/poloniex.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/polymarket.d.ts +59 -0
- package/node_modules/tardis-dev/dist/mappers/polymarket.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/polymarket.js +121 -0
- package/node_modules/tardis-dev/dist/mappers/polymarket.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/registry.d.ts +41 -0
- package/node_modules/tardis-dev/dist/mappers/registry.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/registry.js +111 -0
- package/node_modules/tardis-dev/dist/mappers/registry.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/serum.d.ts +19 -0
- package/node_modules/tardis-dev/dist/mappers/serum.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/serum.js +127 -0
- package/node_modules/tardis-dev/dist/mappers/serum.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/upbit.d.ts +8 -0
- package/node_modules/tardis-dev/dist/mappers/upbit.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/upbit.js +78 -0
- package/node_modules/tardis-dev/dist/mappers/upbit.js.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/woox.d.ts +10 -0
- package/node_modules/tardis-dev/dist/mappers/woox.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/mappers/woox.js +488 -0
- package/node_modules/tardis-dev/dist/mappers/woox.js.map +1 -0
- package/node_modules/tardis-dev/dist/okexsymbols.d.ts +3 -0
- package/node_modules/tardis-dev/dist/okexsymbols.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/okexsymbols.js +10 -0
- package/node_modules/tardis-dev/dist/okexsymbols.js.map +1 -0
- package/node_modules/tardis-dev/dist/options.d.ts +13 -0
- package/node_modules/tardis-dev/dist/options.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/options.js +21 -0
- package/node_modules/tardis-dev/dist/options.js.map +1 -0
- package/node_modules/tardis-dev/dist/orderbook.d.ts +23 -0
- package/node_modules/tardis-dev/dist/orderbook.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/orderbook.js +133 -0
- package/node_modules/tardis-dev/dist/orderbook.js.map +1 -0
- package/node_modules/tardis-dev/dist/priceleveltree.d.ts +27 -0
- package/node_modules/tardis-dev/dist/priceleveltree.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/priceleveltree.js +165 -0
- package/node_modules/tardis-dev/dist/priceleveltree.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binance.d.ts +99 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binance.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binance.js +370 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binance.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.d.ts +14 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.js +53 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.d.ts +14 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.js +95 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.d.ts +36 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.js +73 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.d.ts +9 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.js +36 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitget.d.ts +19 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitget.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitget.js +61 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitget.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.d.ts +11 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.js +37 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.d.ts +11 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.js +52 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.d.ts +10 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.js +57 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.d.ts +11 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.js +37 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bullish.d.ts +18 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bullish.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bullish.js +113 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bullish.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bybit.d.ts +28 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bybit.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bybit.js +95 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/bybit.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.d.ts +16 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.js +98 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.d.ts +10 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.js +47 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.d.ts +8 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.js +23 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.d.ts +10 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.js +43 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.d.ts +9 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.js +25 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/delta.d.ts +18 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/delta.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/delta.js +29 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/delta.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/deribit.d.ts +13 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/deribit.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/deribit.js +81 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/deribit.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx.d.ts +8 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx.js +34 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.d.ts +8 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.js +33 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/ftx.d.ts +33 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/ftx.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/ftx.js +107 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/ftx.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateio.d.ts +9 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateio.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateio.js +41 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateio.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.d.ts +17 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.js +68 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gemini.d.ts +9 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gemini.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gemini.js +32 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/gemini.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.d.ts +12 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.js +55 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/huobi.d.ts +108 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/huobi.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/huobi.js +339 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/huobi.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.d.ts +10 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.js +34 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/index.d.ts +6 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/index.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/index.js +119 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/index.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kraken.d.ts +10 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kraken.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kraken.js +41 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kraken.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.d.ts +13 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.js +66 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.d.ts +25 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.js +110 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/lighter.d.ts +8 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/lighter.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/lighter.js +25 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/lighter.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mango.d.ts +5 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mango.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mango.js +5 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mango.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexc.d.ts +35 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexc.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexc.js +261 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexc.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.d.ts +25 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.js +203 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okex.d.ts +31 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okex.js +147 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okex.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.d.ts +11 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.js +53 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/phemex.d.ts +14 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/phemex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/phemex.js +46 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/phemex.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.d.ts +14 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.js +28 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.d.ts +26 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.js +92 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.d.ts +75 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.js +423 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/serum.d.ts +14 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/serum.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/serum.js +58 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/serum.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.d.ts +5 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.js +5 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/upbit.d.ts +8 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/upbit.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/upbit.js +29 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/upbit.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/woox.d.ts +12 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/woox.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/woox.js +77 -0
- package/node_modules/tardis-dev/dist/realtimefeeds/woox.js.map +1 -0
- package/node_modules/tardis-dev/dist/realtimeiterator.d.ts +10 -0
- package/node_modules/tardis-dev/dist/realtimeiterator.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/realtimeiterator.js +106 -0
- package/node_modules/tardis-dev/dist/realtimeiterator.js.map +1 -0
- package/node_modules/tardis-dev/dist/replay.d.ts +42 -0
- package/node_modules/tardis-dev/dist/replay.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/replay.js +417 -0
- package/node_modules/tardis-dev/dist/replay.js.map +1 -0
- package/node_modules/tardis-dev/dist/stream.d.ts +28 -0
- package/node_modules/tardis-dev/dist/stream.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/stream.js +112 -0
- package/node_modules/tardis-dev/dist/stream.js.map +1 -0
- package/node_modules/tardis-dev/dist/types.d.ts +154 -0
- package/node_modules/tardis-dev/dist/types.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/types.js +2 -0
- package/node_modules/tardis-dev/dist/types.js.map +1 -0
- package/node_modules/tardis-dev/dist/worker.d.ts +24 -0
- package/node_modules/tardis-dev/dist/worker.d.ts.map +1 -0
- package/node_modules/tardis-dev/dist/worker.js +143 -0
- package/node_modules/tardis-dev/dist/worker.js.map +1 -0
- package/node_modules/tardis-dev/example.js +171 -0
- package/node_modules/tardis-dev/package.json +85 -0
- package/node_modules/tardis-dev/src/apikeyaccessinfo.ts +25 -0
- package/node_modules/tardis-dev/src/binarysplit.ts +50 -0
- package/node_modules/tardis-dev/src/boundedqueue.ts +118 -0
- package/node_modules/tardis-dev/src/clearcache.ts +62 -0
- package/node_modules/tardis-dev/src/combine.ts +134 -0
- package/node_modules/tardis-dev/src/computable/booksnapshot.ts +327 -0
- package/node_modules/tardis-dev/src/computable/computable.ts +104 -0
- package/node_modules/tardis-dev/src/computable/context.ts +12 -0
- package/node_modules/tardis-dev/src/computable/index.ts +3 -0
- package/node_modules/tardis-dev/src/computable/tradebar.ts +173 -0
- package/node_modules/tardis-dev/src/consts.ts +623 -0
- package/node_modules/tardis-dev/src/debug.ts +3 -0
- package/node_modules/tardis-dev/src/downloaddatasets.ts +193 -0
- package/node_modules/tardis-dev/src/exchangedetails.ts +120 -0
- package/node_modules/tardis-dev/src/filter.ts +69 -0
- package/node_modules/tardis-dev/src/foreachconcurrent.ts +29 -0
- package/node_modules/tardis-dev/src/handy.ts +880 -0
- package/node_modules/tardis-dev/src/index.ts +16 -0
- package/node_modules/tardis-dev/src/instrumentinfo.ts +197 -0
- package/node_modules/tardis-dev/src/mappers/ascendex.ts +210 -0
- package/node_modules/tardis-dev/src/mappers/binance.ts +598 -0
- package/node_modules/tardis-dev/src/mappers/binancedex.ts +180 -0
- package/node_modules/tardis-dev/src/mappers/binanceeuropeanoptions.ts +624 -0
- package/node_modules/tardis-dev/src/mappers/bitfinex.ts +472 -0
- package/node_modules/tardis-dev/src/mappers/bitflyer.ts +199 -0
- package/node_modules/tardis-dev/src/mappers/bitget.ts +490 -0
- package/node_modules/tardis-dev/src/mappers/bitmex.ts +359 -0
- package/node_modules/tardis-dev/src/mappers/bitnomial.ts +134 -0
- package/node_modules/tardis-dev/src/mappers/bitstamp.ts +219 -0
- package/node_modules/tardis-dev/src/mappers/blockchaincom.ts +106 -0
- package/node_modules/tardis-dev/src/mappers/bullish.ts +392 -0
- package/node_modules/tardis-dev/src/mappers/bybit.ts +947 -0
- package/node_modules/tardis-dev/src/mappers/bybitspot.ts +129 -0
- package/node_modules/tardis-dev/src/mappers/coinbase.ts +259 -0
- package/node_modules/tardis-dev/src/mappers/coinbaseinternational.ts +338 -0
- package/node_modules/tardis-dev/src/mappers/coinflex.ts +175 -0
- package/node_modules/tardis-dev/src/mappers/cryptocom.ts +504 -0
- package/node_modules/tardis-dev/src/mappers/cryptofacilities.ts +319 -0
- package/node_modules/tardis-dev/src/mappers/delta.ts +315 -0
- package/node_modules/tardis-dev/src/mappers/deribit.ts +406 -0
- package/node_modules/tardis-dev/src/mappers/dydx.ts +330 -0
- package/node_modules/tardis-dev/src/mappers/dydxv4.ts +349 -0
- package/node_modules/tardis-dev/src/mappers/ftx.ts +307 -0
- package/node_modules/tardis-dev/src/mappers/gateio.ts +543 -0
- package/node_modules/tardis-dev/src/mappers/gateiofutures.ts +290 -0
- package/node_modules/tardis-dev/src/mappers/gemini.ts +225 -0
- package/node_modules/tardis-dev/src/mappers/hitbtc.ts +124 -0
- package/node_modules/tardis-dev/src/mappers/huobi.ts +815 -0
- package/node_modules/tardis-dev/src/mappers/hyperliquid.ts +248 -0
- package/node_modules/tardis-dev/src/mappers/index.ts +140 -0
- package/node_modules/tardis-dev/src/mappers/kraken.ts +382 -0
- package/node_modules/tardis-dev/src/mappers/kucoin.ts +353 -0
- package/node_modules/tardis-dev/src/mappers/kucoinfutures.ts +508 -0
- package/node_modules/tardis-dev/src/mappers/lighter.ts +363 -0
- package/node_modules/tardis-dev/src/mappers/mapper.ts +163 -0
- package/node_modules/tardis-dev/src/mappers/mexc.ts +324 -0
- package/node_modules/tardis-dev/src/mappers/mexcfutures.ts +352 -0
- package/node_modules/tardis-dev/src/mappers/okex.ts +1362 -0
- package/node_modules/tardis-dev/src/mappers/okexspreads.ts +172 -0
- package/node_modules/tardis-dev/src/mappers/phemex.ts +562 -0
- package/node_modules/tardis-dev/src/mappers/poloniex.ts +304 -0
- package/node_modules/tardis-dev/src/mappers/polymarket.ts +204 -0
- package/node_modules/tardis-dev/src/mappers/registry.ts +203 -0
- package/node_modules/tardis-dev/src/mappers/serum.ts +196 -0
- package/node_modules/tardis-dev/src/mappers/upbit.ts +117 -0
- package/node_modules/tardis-dev/src/mappers/woox.ts +700 -0
- package/node_modules/tardis-dev/src/okexsymbols.ts +10 -0
- package/node_modules/tardis-dev/src/options.ts +36 -0
- package/node_modules/tardis-dev/src/orderbook.ts +169 -0
- package/node_modules/tardis-dev/src/priceleveltree.ts +188 -0
- package/node_modules/tardis-dev/src/realtimefeeds/binance.ts +577 -0
- package/node_modules/tardis-dev/src/realtimefeeds/binancedex.ts +64 -0
- package/node_modules/tardis-dev/src/realtimefeeds/binanceeuropeanoptions.ts +132 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bitfinex.ts +83 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bitflyer.ts +41 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bitget.ts +76 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bitmex.ts +42 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bitnomial.ts +60 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bitstamp.ts +70 -0
- package/node_modules/tardis-dev/src/realtimefeeds/blockchaincom.ts +44 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bullish.ts +140 -0
- package/node_modules/tardis-dev/src/realtimefeeds/bybit.ts +123 -0
- package/node_modules/tardis-dev/src/realtimefeeds/coinbase.ts +112 -0
- package/node_modules/tardis-dev/src/realtimefeeds/coinbaseinternational.ts +60 -0
- package/node_modules/tardis-dev/src/realtimefeeds/coinflex.ts +29 -0
- package/node_modules/tardis-dev/src/realtimefeeds/cryptocom.ts +49 -0
- package/node_modules/tardis-dev/src/realtimefeeds/cryptofacilities.ts +30 -0
- package/node_modules/tardis-dev/src/realtimefeeds/delta.ts +35 -0
- package/node_modules/tardis-dev/src/realtimefeeds/deribit.ts +95 -0
- package/node_modules/tardis-dev/src/realtimefeeds/dydx.ts +40 -0
- package/node_modules/tardis-dev/src/realtimefeeds/dydx_v4.ts +39 -0
- package/node_modules/tardis-dev/src/realtimefeeds/ftx.ts +137 -0
- package/node_modules/tardis-dev/src/realtimefeeds/gateio.ts +46 -0
- package/node_modules/tardis-dev/src/realtimefeeds/gateiofutures.ts +91 -0
- package/node_modules/tardis-dev/src/realtimefeeds/gemini.ts +38 -0
- package/node_modules/tardis-dev/src/realtimefeeds/hitbtc.ts +65 -0
- package/node_modules/tardis-dev/src/realtimefeeds/huobi.ts +435 -0
- package/node_modules/tardis-dev/src/realtimefeeds/hyperliquid.ts +41 -0
- package/node_modules/tardis-dev/src/realtimefeeds/index.ts +145 -0
- package/node_modules/tardis-dev/src/realtimefeeds/kraken.ts +48 -0
- package/node_modules/tardis-dev/src/realtimefeeds/kucoin.ts +80 -0
- package/node_modules/tardis-dev/src/realtimefeeds/kucoinfutures.ts +139 -0
- package/node_modules/tardis-dev/src/realtimefeeds/lighter.ts +31 -0
- package/node_modules/tardis-dev/src/realtimefeeds/mango.ts +5 -0
- package/node_modules/tardis-dev/src/realtimefeeds/mexc.ts +327 -0
- package/node_modules/tardis-dev/src/realtimefeeds/mexcfutures.ts +269 -0
- package/node_modules/tardis-dev/src/realtimefeeds/okex.ts +189 -0
- package/node_modules/tardis-dev/src/realtimefeeds/okexspreads.ts +64 -0
- package/node_modules/tardis-dev/src/realtimefeeds/phemex.ts +52 -0
- package/node_modules/tardis-dev/src/realtimefeeds/poloniex.ts +34 -0
- package/node_modules/tardis-dev/src/realtimefeeds/polymarket.ts +112 -0
- package/node_modules/tardis-dev/src/realtimefeeds/realtimefeed.ts +561 -0
- package/node_modules/tardis-dev/src/realtimefeeds/serum.ts +67 -0
- package/node_modules/tardis-dev/src/realtimefeeds/staratlas.ts +5 -0
- package/node_modules/tardis-dev/src/realtimefeeds/upbit.ts +35 -0
- package/node_modules/tardis-dev/src/realtimefeeds/woox.ts +110 -0
- package/node_modules/tardis-dev/src/realtimeiterator.ts +124 -0
- package/node_modules/tardis-dev/src/replay.ts +616 -0
- package/node_modules/tardis-dev/src/stream.ts +186 -0
- package/node_modules/tardis-dev/src/types.ts +178 -0
- package/node_modules/tardis-dev/src/worker.ts +221 -0
- package/node_modules/uWebSockets.js/ESM_wrapper.mjs +53 -0
- package/node_modules/uWebSockets.js/LICENSE +201 -0
- package/node_modules/uWebSockets.js/README.md +6 -0
- package/node_modules/uWebSockets.js/index.d.ts +468 -0
- package/node_modules/uWebSockets.js/package.json +12 -0
- package/node_modules/uWebSockets.js/source_commit +1 -0
- package/node_modules/uWebSockets.js/uws.js +76 -0
- package/node_modules/uWebSockets.js/uws_darwin_arm64_127.node +0 -0
- package/node_modules/uWebSockets.js/uws_darwin_arm64_137.node +0 -0
- package/node_modules/uWebSockets.js/uws_darwin_arm64_147.node +0 -0
- package/node_modules/uWebSockets.js/uws_darwin_x64_127.node +0 -0
- package/node_modules/uWebSockets.js/uws_darwin_x64_137.node +0 -0
- package/node_modules/uWebSockets.js/uws_darwin_x64_147.node +0 -0
- package/node_modules/uWebSockets.js/uws_linux_arm64_127.node +0 -0
- package/node_modules/uWebSockets.js/uws_linux_arm64_137.node +0 -0
- package/node_modules/uWebSockets.js/uws_linux_arm64_147.node +0 -0
- package/node_modules/uWebSockets.js/uws_linux_x64_127.node +0 -0
- package/node_modules/uWebSockets.js/uws_linux_x64_137.node +0 -0
- package/node_modules/uWebSockets.js/uws_linux_x64_147.node +0 -0
- package/node_modules/uWebSockets.js/uws_win32_x64_127.node +0 -0
- package/node_modules/uWebSockets.js/uws_win32_x64_137.node +0 -0
- package/node_modules/uWebSockets.js/uws_win32_x64_147.node +0 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/package.json +8 -20
- package/src/tardismachine.ts +15 -7
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
import crypto, { createHash } from 'crypto';
|
|
2
|
+
import { createWriteStream, mkdirSync, rmSync } from 'node:fs';
|
|
3
|
+
import { rename } from 'node:fs/promises';
|
|
4
|
+
import { Agent as HttpAgent } from 'node:http';
|
|
5
|
+
import { Agent as HttpsAgent } from 'node:https';
|
|
6
|
+
import followRedirects from 'follow-redirects';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import { debug } from "./debug.js";
|
|
9
|
+
const { http: followRedirectsHttp, https: followRedirectsHttps } = followRedirects;
|
|
10
|
+
export function parseAsUTCDate(val) {
|
|
11
|
+
// Treat date-only and minute-level strings as UTC instead of local time.
|
|
12
|
+
if (val.endsWith('Z') === false) {
|
|
13
|
+
val += 'Z';
|
|
14
|
+
}
|
|
15
|
+
const date = new Date(val);
|
|
16
|
+
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes()));
|
|
17
|
+
}
|
|
18
|
+
export function wait(delayMS) {
|
|
19
|
+
return new Promise((resolve) => {
|
|
20
|
+
setTimeout(resolve, delayMS);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function getRandomString() {
|
|
24
|
+
return crypto.randomBytes(24).toString('hex');
|
|
25
|
+
}
|
|
26
|
+
export function formatDateToPath(date) {
|
|
27
|
+
const year = date.getUTCFullYear();
|
|
28
|
+
const month = doubleDigit(date.getUTCMonth() + 1);
|
|
29
|
+
const day = doubleDigit(date.getUTCDate());
|
|
30
|
+
const hour = doubleDigit(date.getUTCHours());
|
|
31
|
+
const minute = doubleDigit(date.getUTCMinutes());
|
|
32
|
+
return `${year}/${month}/${day}/${hour}/${minute}`;
|
|
33
|
+
}
|
|
34
|
+
export function doubleDigit(input) {
|
|
35
|
+
return input < 10 ? '0' + input : '' + input;
|
|
36
|
+
}
|
|
37
|
+
export function sha256(obj) {
|
|
38
|
+
return createHash('sha256').update(JSON.stringify(obj)).digest('hex');
|
|
39
|
+
}
|
|
40
|
+
export function addMinutes(date, minutes) {
|
|
41
|
+
return new Date(date.getTime() + minutes * 60000);
|
|
42
|
+
}
|
|
43
|
+
export function addDays(date, days) {
|
|
44
|
+
return new Date(date.getTime() + days * 60000 * 1440);
|
|
45
|
+
}
|
|
46
|
+
export function* sequence(end, seed = 0) {
|
|
47
|
+
let current = seed;
|
|
48
|
+
while (current < end) {
|
|
49
|
+
yield current;
|
|
50
|
+
current += 1;
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
export const ONE_SEC_IN_MS = 1000;
|
|
55
|
+
export class HttpError extends Error {
|
|
56
|
+
status;
|
|
57
|
+
responseText;
|
|
58
|
+
url;
|
|
59
|
+
constructor(status, responseText, url) {
|
|
60
|
+
super(`HttpError: status code: ${status}, response text: ${responseText}`);
|
|
61
|
+
this.status = status;
|
|
62
|
+
this.responseText = responseText;
|
|
63
|
+
this.url = url;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
class HttpClientError extends Error {
|
|
67
|
+
response;
|
|
68
|
+
method;
|
|
69
|
+
url;
|
|
70
|
+
constructor(response, method, url) {
|
|
71
|
+
super(`HTTP ${method} ${url} failed with status ${response.statusCode}`);
|
|
72
|
+
this.response = response;
|
|
73
|
+
this.method = method;
|
|
74
|
+
this.url = url;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export function* take(iterable, length) {
|
|
78
|
+
if (length === 0) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
for (const item of iterable) {
|
|
82
|
+
yield item;
|
|
83
|
+
length--;
|
|
84
|
+
if (length === 0) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export async function* normalizeMessages(exchange, symbols, messages, mappers, createMappers, withDisconnectMessages, filter, currentTimestamp) {
|
|
90
|
+
let previousLocalTimestamp = currentTimestamp;
|
|
91
|
+
let mappersForExchange = mappers;
|
|
92
|
+
if (mappersForExchange.length === 0) {
|
|
93
|
+
throw new Error(`Can't normalize data without any normalizers provided`);
|
|
94
|
+
}
|
|
95
|
+
for await (const messageWithTimestamp of messages) {
|
|
96
|
+
if (messageWithTimestamp === undefined) {
|
|
97
|
+
// we received undefined meaning Websocket disconnection
|
|
98
|
+
// lets create new mappers with clean state for 'new connection'
|
|
99
|
+
mappersForExchange = undefined;
|
|
100
|
+
// if flag withDisconnectMessages is set, yield disconnect message
|
|
101
|
+
if (withDisconnectMessages === true && previousLocalTimestamp !== undefined) {
|
|
102
|
+
const disconnect = {
|
|
103
|
+
type: 'disconnect',
|
|
104
|
+
exchange,
|
|
105
|
+
localTimestamp: previousLocalTimestamp,
|
|
106
|
+
symbols
|
|
107
|
+
};
|
|
108
|
+
yield disconnect;
|
|
109
|
+
}
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (mappersForExchange === undefined) {
|
|
113
|
+
mappersForExchange = createMappers(messageWithTimestamp.localTimestamp);
|
|
114
|
+
}
|
|
115
|
+
previousLocalTimestamp = messageWithTimestamp.localTimestamp;
|
|
116
|
+
for (const mapper of mappersForExchange) {
|
|
117
|
+
if (mapper.canHandle(messageWithTimestamp.message)) {
|
|
118
|
+
const mappedMessages = mapper.map(messageWithTimestamp.message, messageWithTimestamp.localTimestamp);
|
|
119
|
+
if (!mappedMessages) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
for (const message of mappedMessages) {
|
|
123
|
+
if (filter === undefined) {
|
|
124
|
+
yield message;
|
|
125
|
+
}
|
|
126
|
+
else if (filter(message.symbol)) {
|
|
127
|
+
yield message;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export function getFilters(mappers, symbols) {
|
|
135
|
+
const filters = mappers.flatMap((mapper) => mapper.getFilters(symbols));
|
|
136
|
+
const deduplicatedFilters = filters.reduce((prev, current) => {
|
|
137
|
+
const matchingExisting = prev.find((c) => c.channel === current.channel);
|
|
138
|
+
if (matchingExisting !== undefined) {
|
|
139
|
+
if (matchingExisting.symbols !== undefined && current.symbols) {
|
|
140
|
+
for (let symbol of current.symbols) {
|
|
141
|
+
if (matchingExisting.symbols.includes(symbol) === false) {
|
|
142
|
+
matchingExisting.symbols.push(symbol);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else if (current.symbols) {
|
|
147
|
+
matchingExisting.symbols = [...current.symbols];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
prev.push(current);
|
|
152
|
+
}
|
|
153
|
+
return prev;
|
|
154
|
+
}, []);
|
|
155
|
+
return deduplicatedFilters;
|
|
156
|
+
}
|
|
157
|
+
export function* batch(symbols, batchSize) {
|
|
158
|
+
for (let i = 0; i < symbols.length; i += batchSize) {
|
|
159
|
+
yield symbols.slice(i, i + batchSize);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export function* batchObjects(payload, batchSize) {
|
|
163
|
+
for (let i = 0; i < payload.length; i += batchSize) {
|
|
164
|
+
yield payload.slice(i, i + batchSize);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export function parseμs(dateString) {
|
|
168
|
+
// check if we have ISO 8601 format date string, e.g: 2019-06-01T00:03:03.1238784Z or 2020-07-22T00:09:16.836773Z
|
|
169
|
+
// or 2020-03-01T00:00:24.893456+00:00
|
|
170
|
+
if (dateString.length === 27 || dateString.length === 28 || dateString.length === 32 || dateString.length === 30) {
|
|
171
|
+
const hundreds = dateString.charCodeAt(23) - 48;
|
|
172
|
+
const tens = dateString.charCodeAt(24) - 48;
|
|
173
|
+
const ones = dateString.charCodeAt(25) - 48;
|
|
174
|
+
if (hundreds >= 0 && hundreds <= 9 && tens >= 0 && tens <= 9 && ones >= 0 && ones <= 9) {
|
|
175
|
+
return hundreds * 100 + tens * 10 + ones;
|
|
176
|
+
}
|
|
177
|
+
return Number(dateString.slice(23, 26));
|
|
178
|
+
}
|
|
179
|
+
return 0;
|
|
180
|
+
}
|
|
181
|
+
export function optimizeFilters(filters) {
|
|
182
|
+
// deduplicate filters (if the channel was provided multiple times)
|
|
183
|
+
const optimizedFilters = filters.reduce((prev, current) => {
|
|
184
|
+
const matchingExisting = prev.find((c) => c.channel === current.channel);
|
|
185
|
+
if (matchingExisting) {
|
|
186
|
+
// both previous and current have symbols let's merge them
|
|
187
|
+
if (matchingExisting.symbols && current.symbols) {
|
|
188
|
+
matchingExisting.symbols.push(...current.symbols);
|
|
189
|
+
}
|
|
190
|
+
else if (current.symbols) {
|
|
191
|
+
matchingExisting.symbols = [...current.symbols];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
prev.push(current);
|
|
196
|
+
}
|
|
197
|
+
return prev;
|
|
198
|
+
}, []);
|
|
199
|
+
// sort filters in place to improve local disk cache ratio (no matter filters order if the same filters are provided will hit the cache)
|
|
200
|
+
optimizedFilters.sort((f1, f2) => {
|
|
201
|
+
if (f1.channel < f2.channel) {
|
|
202
|
+
return -1;
|
|
203
|
+
}
|
|
204
|
+
if (f1.channel > f2.channel) {
|
|
205
|
+
return 1;
|
|
206
|
+
}
|
|
207
|
+
return 0;
|
|
208
|
+
});
|
|
209
|
+
// sort and deduplicate filters symbols
|
|
210
|
+
optimizedFilters.forEach((filter) => {
|
|
211
|
+
if (filter.symbols) {
|
|
212
|
+
filter.symbols = [...new Set(filter.symbols)].sort();
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
return optimizedFilters;
|
|
216
|
+
}
|
|
217
|
+
const httpsAgent = new HttpsAgent({
|
|
218
|
+
keepAlive: true,
|
|
219
|
+
keepAliveMsecs: 10 * ONE_SEC_IN_MS,
|
|
220
|
+
maxSockets: 120
|
|
221
|
+
});
|
|
222
|
+
const proxyEnv = process.env.HTTP_PROXY === undefined
|
|
223
|
+
? undefined
|
|
224
|
+
: {
|
|
225
|
+
HTTP_PROXY: process.env.HTTP_PROXY,
|
|
226
|
+
HTTPS_PROXY: process.env.HTTP_PROXY
|
|
227
|
+
};
|
|
228
|
+
const httpProxyAgent = proxyEnv === undefined ? undefined : new HttpAgent({ proxyEnv });
|
|
229
|
+
const httpsProxyAgent = proxyEnv === undefined ? undefined : new HttpsAgent({ proxyEnv });
|
|
230
|
+
export function getProxyAgent(url) {
|
|
231
|
+
const protocol = new URL(url).protocol;
|
|
232
|
+
return protocol === 'http:' || protocol === 'ws:' ? httpProxyAgent : httpsProxyAgent;
|
|
233
|
+
}
|
|
234
|
+
const DEFAULT_FETCH_RETRY_LIMIT = 2;
|
|
235
|
+
function getRetrySettings(method, retry) {
|
|
236
|
+
const retryOptions = typeof retry === 'object' ? retry : undefined;
|
|
237
|
+
const retryEnabled = method === 'GET' || retry !== undefined;
|
|
238
|
+
const limit = typeof retry === 'number' ? retry : (retryOptions?.limit ?? (retryEnabled ? DEFAULT_FETCH_RETRY_LIMIT : 0));
|
|
239
|
+
return {
|
|
240
|
+
limit,
|
|
241
|
+
maxRetryAfter: retryOptions?.maxRetryAfter,
|
|
242
|
+
statusCodes: retryOptions?.statusCodes ? new Set(retryOptions.statusCodes) : undefined
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function parseResponseHeaders(headers) {
|
|
246
|
+
return Object.fromEntries(headers.entries());
|
|
247
|
+
}
|
|
248
|
+
function parseNodeResponseHeaders(headers) {
|
|
249
|
+
return Object.fromEntries(Object.entries(headers).flatMap(([key, value]) => {
|
|
250
|
+
if (value === undefined) {
|
|
251
|
+
return [];
|
|
252
|
+
}
|
|
253
|
+
return [[key.toLowerCase(), Array.isArray(value) ? value.join(', ') : value]];
|
|
254
|
+
}));
|
|
255
|
+
}
|
|
256
|
+
function createHttpResponse(statusCode, headers, body) {
|
|
257
|
+
return {
|
|
258
|
+
statusCode,
|
|
259
|
+
headers,
|
|
260
|
+
body
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function prepareRequest(method, options) {
|
|
264
|
+
if (options.body === undefined) {
|
|
265
|
+
return {
|
|
266
|
+
headers: options.headers,
|
|
267
|
+
body: undefined
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const headers = { ...options.headers };
|
|
271
|
+
const body = typeof options.body === 'string' ? options.body : JSON.stringify(options.body);
|
|
272
|
+
if (method !== 'GET' && headers['Content-Type'] === undefined && headers['content-type'] === undefined) {
|
|
273
|
+
headers['Content-Type'] = 'application/json';
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
headers,
|
|
277
|
+
body
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function getRetryAfterDelayMS(headers, maxRetryAfter) {
|
|
281
|
+
const retryAfterHeader = headers['retry-after'];
|
|
282
|
+
if (retryAfterHeader === undefined) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const parsedSeconds = Number.parseFloat(retryAfterHeader);
|
|
286
|
+
let delayMS;
|
|
287
|
+
if (Number.isFinite(parsedSeconds)) {
|
|
288
|
+
delayMS = parsedSeconds * ONE_SEC_IN_MS;
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
const parsedDate = Date.parse(retryAfterHeader);
|
|
292
|
+
if (Number.isFinite(parsedDate)) {
|
|
293
|
+
delayMS = parsedDate - Date.now();
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (delayMS === undefined || delayMS < 0) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
if (maxRetryAfter !== undefined && delayMS > maxRetryAfter) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
return delayMS;
|
|
303
|
+
}
|
|
304
|
+
function getRetryDelayMS(attempt, headers, maxRetryAfter) {
|
|
305
|
+
const retryAfterDelayMS = getRetryAfterDelayMS(headers, maxRetryAfter);
|
|
306
|
+
if (retryAfterDelayMS !== undefined) {
|
|
307
|
+
return retryAfterDelayMS;
|
|
308
|
+
}
|
|
309
|
+
return Math.min(250 * 2 ** (attempt - 1), 5000);
|
|
310
|
+
}
|
|
311
|
+
function isRetryableStatus(statusCode, retrySettings) {
|
|
312
|
+
if (retrySettings.statusCodes !== undefined) {
|
|
313
|
+
return retrySettings.statusCodes.has(statusCode);
|
|
314
|
+
}
|
|
315
|
+
return statusCode === 408 || statusCode === 429 || statusCode >= 500;
|
|
316
|
+
}
|
|
317
|
+
function shouldRetryHttpStatus(attempt, response, retrySettings) {
|
|
318
|
+
return attempt <= retrySettings.limit && isRetryableStatus(response.statusCode, retrySettings);
|
|
319
|
+
}
|
|
320
|
+
function shouldRetryHttpError(attempt, retrySettings) {
|
|
321
|
+
return attempt <= retrySettings.limit;
|
|
322
|
+
}
|
|
323
|
+
async function requestViaFetch(method, url, options) {
|
|
324
|
+
const controller = new AbortController();
|
|
325
|
+
const timeoutMS = options.timeout;
|
|
326
|
+
const timeoutId = timeoutMS !== undefined ? setTimeout(() => controller.abort(), timeoutMS) : undefined;
|
|
327
|
+
const preparedRequest = prepareRequest(method, options);
|
|
328
|
+
try {
|
|
329
|
+
const response = await fetch(url, {
|
|
330
|
+
method,
|
|
331
|
+
headers: preparedRequest.headers,
|
|
332
|
+
body: preparedRequest.body,
|
|
333
|
+
signal: controller.signal
|
|
334
|
+
});
|
|
335
|
+
const body = await response.text();
|
|
336
|
+
return createHttpResponse(response.status, parseResponseHeaders(response.headers), body);
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
if (controller.signal.aborted) {
|
|
340
|
+
throw new Error('Request timed out');
|
|
341
|
+
}
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
finally {
|
|
345
|
+
if (timeoutId !== undefined) {
|
|
346
|
+
clearTimeout(timeoutId);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
async function requestViaProxy(method, url, options) {
|
|
351
|
+
const requestClient = new URL(url).protocol === 'http:' ? followRedirectsHttp : followRedirectsHttps;
|
|
352
|
+
const preparedRequest = prepareRequest(method, options);
|
|
353
|
+
return await new Promise((resolve, reject) => {
|
|
354
|
+
const request = requestClient
|
|
355
|
+
.request(url, {
|
|
356
|
+
method,
|
|
357
|
+
agent: getProxyAgent(url),
|
|
358
|
+
headers: preparedRequest.headers,
|
|
359
|
+
timeout: options.timeout
|
|
360
|
+
}, (response) => {
|
|
361
|
+
response.setEncoding('utf8');
|
|
362
|
+
let body = '';
|
|
363
|
+
response.on('error', reject);
|
|
364
|
+
response.on('data', (chunk) => (body += chunk));
|
|
365
|
+
response.on('end', () => {
|
|
366
|
+
resolve(createHttpResponse(response.statusCode ?? 0, parseNodeResponseHeaders(response.headers), body));
|
|
367
|
+
});
|
|
368
|
+
})
|
|
369
|
+
.on('error', reject)
|
|
370
|
+
.on('timeout', () => {
|
|
371
|
+
reject(new Error('Request timed out'));
|
|
372
|
+
request.destroy();
|
|
373
|
+
});
|
|
374
|
+
if (preparedRequest.body !== undefined) {
|
|
375
|
+
request.write(preparedRequest.body);
|
|
376
|
+
}
|
|
377
|
+
request.end();
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
async function request(method, url, options = {}) {
|
|
381
|
+
const retrySettings = getRetrySettings(method, options.retry);
|
|
382
|
+
for (let attempt = 1;; attempt += 1) {
|
|
383
|
+
try {
|
|
384
|
+
const response = getProxyAgent(url) === undefined ? await requestViaFetch(method, url, options) : await requestViaProxy(method, url, options);
|
|
385
|
+
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
386
|
+
return response;
|
|
387
|
+
}
|
|
388
|
+
if (shouldRetryHttpStatus(attempt, response, retrySettings)) {
|
|
389
|
+
await wait(getRetryDelayMS(attempt, response.headers, retrySettings.maxRetryAfter));
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
throw new HttpClientError(response, method, url);
|
|
393
|
+
}
|
|
394
|
+
catch (error) {
|
|
395
|
+
if (error instanceof HttpClientError) {
|
|
396
|
+
throw error;
|
|
397
|
+
}
|
|
398
|
+
if (shouldRetryHttpError(attempt, retrySettings)) {
|
|
399
|
+
await wait(Math.min(250 * 2 ** (attempt - 1), 5000));
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
throw error;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
async function requestJSON(method, url, options) {
|
|
407
|
+
const response = await request(method, url, options);
|
|
408
|
+
return {
|
|
409
|
+
data: JSON.parse(response.body),
|
|
410
|
+
headers: response.headers,
|
|
411
|
+
statusCode: response.statusCode
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
export function getJSON(url, options) {
|
|
415
|
+
return requestJSON('GET', url, options);
|
|
416
|
+
}
|
|
417
|
+
export function postJSON(url, options) {
|
|
418
|
+
return requestJSON('POST', url, options);
|
|
419
|
+
}
|
|
420
|
+
export async function download({ apiKey, downloadPath, url, userAgent, appendContentEncodingExtension = false, acceptEncoding = 'gzip' }) {
|
|
421
|
+
const httpRequestOptions = {
|
|
422
|
+
timeout: 90 * ONE_SEC_IN_MS,
|
|
423
|
+
headers: {
|
|
424
|
+
'Accept-Encoding': acceptEncoding,
|
|
425
|
+
'User-Agent': userAgent,
|
|
426
|
+
Authorization: apiKey ? `Bearer ${apiKey}` : ''
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
const MAX_ATTEMPTS = 30;
|
|
430
|
+
let attempts = 0;
|
|
431
|
+
while (true) {
|
|
432
|
+
// simple retry logic when fetching from the network...
|
|
433
|
+
attempts++;
|
|
434
|
+
try {
|
|
435
|
+
const addRetryAttempt = attempts - 1 > 0 && url.endsWith('gz');
|
|
436
|
+
if (addRetryAttempt) {
|
|
437
|
+
return await _downloadFile(httpRequestOptions, `${url}?retryAttempt=${attempts - 1}`, downloadPath, appendContentEncodingExtension);
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
return await _downloadFile(httpRequestOptions, url, downloadPath, appendContentEncodingExtension);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
const unsupportedDataFeedEncoding = error instanceof Error && error.message.startsWith('Unsupported data feed content encoding');
|
|
445
|
+
const nonRetryableHttpError = error instanceof HttpError &&
|
|
446
|
+
((error.status === 400 && error.message.includes('ISO 8601 format') === false) ||
|
|
447
|
+
error.status === 401 ||
|
|
448
|
+
error.status === 403 ||
|
|
449
|
+
error.status === 404);
|
|
450
|
+
const tooManyRequests = error instanceof HttpError && error.status === 429;
|
|
451
|
+
const internalServiceError = error instanceof HttpError && error.status === 500;
|
|
452
|
+
// do not retry when we've got bad or unauthorized request or enough attempts
|
|
453
|
+
if (unsupportedDataFeedEncoding || nonRetryableHttpError || attempts === MAX_ATTEMPTS) {
|
|
454
|
+
throw error;
|
|
455
|
+
}
|
|
456
|
+
const randomIngridient = Math.random() * 500;
|
|
457
|
+
const attemptsDelayMS = Math.min(Math.pow(2, attempts) * ONE_SEC_IN_MS, 120 * ONE_SEC_IN_MS);
|
|
458
|
+
let nextAttemptDelayMS = randomIngridient + attemptsDelayMS;
|
|
459
|
+
if (tooManyRequests) {
|
|
460
|
+
// when too many requests received wait one minute
|
|
461
|
+
nextAttemptDelayMS += 60 * ONE_SEC_IN_MS;
|
|
462
|
+
}
|
|
463
|
+
if (internalServiceError) {
|
|
464
|
+
nextAttemptDelayMS = nextAttemptDelayMS * 2;
|
|
465
|
+
}
|
|
466
|
+
debug('download file error: %o, next attempt delay: %d, url %s, path: %s', error, nextAttemptDelayMS, url, downloadPath);
|
|
467
|
+
await wait(nextAttemptDelayMS);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const tmpFileCleanups = new Map();
|
|
472
|
+
export function cleanTempFiles() {
|
|
473
|
+
tmpFileCleanups.forEach((cleanup) => cleanup());
|
|
474
|
+
}
|
|
475
|
+
async function _downloadFile(requestOptions, url, downloadPath, appendContentEncodingExtension) {
|
|
476
|
+
// first ensure that directory where we want to download file exists
|
|
477
|
+
mkdirSync(path.dirname(downloadPath), { recursive: true });
|
|
478
|
+
// create write file stream that we'll write data into - first as unconfirmed temp file
|
|
479
|
+
const tmpFilePath = `${downloadPath}${crypto.randomBytes(8).toString('hex')}.unconfirmed`;
|
|
480
|
+
const fileWriteStream = createWriteStream(tmpFilePath);
|
|
481
|
+
const cleanup = () => {
|
|
482
|
+
try {
|
|
483
|
+
fileWriteStream.destroy();
|
|
484
|
+
rmSync(tmpFilePath, { force: true });
|
|
485
|
+
}
|
|
486
|
+
catch { }
|
|
487
|
+
};
|
|
488
|
+
tmpFileCleanups.set(tmpFilePath, cleanup);
|
|
489
|
+
let finalDownloadPath = downloadPath;
|
|
490
|
+
try {
|
|
491
|
+
// based on https://github.com/nodejs/node/issues/28172 - only reliable way to consume response stream and avoiding all the 'gotchas'
|
|
492
|
+
let responseHeaders = {};
|
|
493
|
+
await new Promise((resolve, reject) => {
|
|
494
|
+
const protocol = new URL(url).protocol;
|
|
495
|
+
const requestClient = protocol === 'http:' ? followRedirectsHttp : followRedirectsHttps;
|
|
496
|
+
const agent = getProxyAgent(url) ?? (protocol === 'https:' ? httpsAgent : undefined);
|
|
497
|
+
const req = requestClient
|
|
498
|
+
.get(url, { ...requestOptions, agent }, (res) => {
|
|
499
|
+
const { statusCode } = res;
|
|
500
|
+
if (statusCode !== 200) {
|
|
501
|
+
// read the error response text and throw it as an HttpError
|
|
502
|
+
res.setEncoding('utf8');
|
|
503
|
+
let body = '';
|
|
504
|
+
res.on('error', reject);
|
|
505
|
+
res.on('data', (chunk) => (body += chunk));
|
|
506
|
+
res.on('end', () => {
|
|
507
|
+
reject(new HttpError(statusCode, body, url));
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
responseHeaders = parseNodeResponseHeaders(res.headers);
|
|
512
|
+
if (appendContentEncodingExtension) {
|
|
513
|
+
const contentEncoding = asSingleHeaderValue(res.headers['content-encoding']);
|
|
514
|
+
if (contentEncoding === 'zstd') {
|
|
515
|
+
finalDownloadPath = `${downloadPath}.zst`;
|
|
516
|
+
}
|
|
517
|
+
else if (contentEncoding === undefined || contentEncoding === 'gzip') {
|
|
518
|
+
finalDownloadPath = `${downloadPath}.gz`;
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
reject(new Error(`Unsupported data feed content encoding: ${contentEncoding}`));
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
// consume the response stream by writing it to the file
|
|
526
|
+
res
|
|
527
|
+
.on('error', reject)
|
|
528
|
+
.on('aborted', () => reject(new Error('Request aborted')))
|
|
529
|
+
.pipe(fileWriteStream)
|
|
530
|
+
.on('error', reject)
|
|
531
|
+
.on('finish', () => {
|
|
532
|
+
if (res.complete) {
|
|
533
|
+
resolve();
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
reject(new Error('The connection was terminated while the message was still being sent'));
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
})
|
|
541
|
+
.on('error', reject)
|
|
542
|
+
.on('timeout', () => {
|
|
543
|
+
debug('download file request timeout, %s', url);
|
|
544
|
+
reject(new Error('Request timed out'));
|
|
545
|
+
req.destroy();
|
|
546
|
+
});
|
|
547
|
+
});
|
|
548
|
+
// finally when saving from the network to file has succeded, rename tmp file to normal name
|
|
549
|
+
// then we're sure that responses is 100% saved and also even if different process was doing the same we're good
|
|
550
|
+
await rename(tmpFilePath, finalDownloadPath);
|
|
551
|
+
return {
|
|
552
|
+
downloadPath: finalDownloadPath,
|
|
553
|
+
headers: responseHeaders
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
finally {
|
|
557
|
+
tmpFileCleanups.delete(tmpFilePath);
|
|
558
|
+
cleanup();
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
function asSingleHeaderValue(headerValue) {
|
|
562
|
+
if (Array.isArray(headerValue)) {
|
|
563
|
+
return headerValue[0];
|
|
564
|
+
}
|
|
565
|
+
return headerValue;
|
|
566
|
+
}
|
|
567
|
+
export class CircularBuffer {
|
|
568
|
+
_bufferSize;
|
|
569
|
+
_buffer = [];
|
|
570
|
+
_index = 0;
|
|
571
|
+
constructor(_bufferSize) {
|
|
572
|
+
this._bufferSize = _bufferSize;
|
|
573
|
+
}
|
|
574
|
+
append(value) {
|
|
575
|
+
const isFull = this._buffer.length === this._bufferSize;
|
|
576
|
+
let poppedValue;
|
|
577
|
+
if (isFull) {
|
|
578
|
+
poppedValue = this._buffer[this._index];
|
|
579
|
+
}
|
|
580
|
+
this._buffer[this._index] = value;
|
|
581
|
+
this._index = (this._index + 1) % this._bufferSize;
|
|
582
|
+
return poppedValue;
|
|
583
|
+
}
|
|
584
|
+
*items() {
|
|
585
|
+
for (let i = 0; i < this._buffer.length; i++) {
|
|
586
|
+
const index = (this._index + i) % this._buffer.length;
|
|
587
|
+
yield this._buffer[index];
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
get count() {
|
|
591
|
+
return this._buffer.length;
|
|
592
|
+
}
|
|
593
|
+
clear() {
|
|
594
|
+
this._buffer = [];
|
|
595
|
+
this._index = 0;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
export class CappedSet {
|
|
599
|
+
_maxSize;
|
|
600
|
+
_set = new Set();
|
|
601
|
+
constructor(_maxSize) {
|
|
602
|
+
this._maxSize = _maxSize;
|
|
603
|
+
}
|
|
604
|
+
has(value) {
|
|
605
|
+
return this._set.has(value);
|
|
606
|
+
}
|
|
607
|
+
add(value) {
|
|
608
|
+
if (this._set.size >= this._maxSize) {
|
|
609
|
+
this._set.delete(this._set.keys().next().value);
|
|
610
|
+
}
|
|
611
|
+
this._set.add(value);
|
|
612
|
+
}
|
|
613
|
+
remove(value) {
|
|
614
|
+
this._set.delete(value);
|
|
615
|
+
}
|
|
616
|
+
size() {
|
|
617
|
+
return this._set.size;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function hasFraction(n) {
|
|
621
|
+
return Math.abs(Math.round(n) - n) > 1e-10;
|
|
622
|
+
}
|
|
623
|
+
// https://stackoverflow.com/a/44815797
|
|
624
|
+
export function decimalPlaces(n) {
|
|
625
|
+
let count = 0;
|
|
626
|
+
// multiply by increasing powers of 10 until the fractional part is ~ 0
|
|
627
|
+
while (hasFraction(n * 10 ** count) && isFinite(10 ** count))
|
|
628
|
+
count++;
|
|
629
|
+
return count;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Parses optional numeric fields where:
|
|
633
|
+
* * `0` **is valid and preserved**
|
|
634
|
+
* * `undefined`, `null`, `NaN`, `Infinity`, and `-Infinity` are treated as not valid and mapped to `undefined`
|
|
635
|
+
*
|
|
636
|
+
* Use for nullable/optional numeric fields such as open interest, funding rates, and greeks.
|
|
637
|
+
*/
|
|
638
|
+
export function asNumberOrUndefined(val) {
|
|
639
|
+
if (val === undefined || val === null || val === '') {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
if (typeof val === 'number') {
|
|
643
|
+
return Number.isFinite(val) ? val : undefined;
|
|
644
|
+
}
|
|
645
|
+
const asNumber = Number(val);
|
|
646
|
+
return Number.isFinite(asNumber) ? asNumber : undefined;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Parses optional numeric fields where:
|
|
650
|
+
* * `0`, `undefined`, `null`, `NaN`, `Infinity`, and `-Infinity` are treated as not valid and mapped to `undefined`.
|
|
651
|
+
*
|
|
652
|
+
* Use for empty quote/top-of-book values that exchanges encode as zero.
|
|
653
|
+
*/
|
|
654
|
+
export function asNonZeroNumberOrUndefined(val) {
|
|
655
|
+
if (val === undefined || val === null || val === '' || val === 0) {
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
if (typeof val === 'number') {
|
|
659
|
+
return Number.isFinite(val) ? val : undefined;
|
|
660
|
+
}
|
|
661
|
+
const asNumber = Number(val);
|
|
662
|
+
return Number.isFinite(asNumber) && asNumber !== 0 ? asNumber : undefined;
|
|
663
|
+
}
|
|
664
|
+
export function upperCaseSymbols(symbols) {
|
|
665
|
+
if (symbols !== undefined) {
|
|
666
|
+
return symbols.map((s) => s.toUpperCase());
|
|
667
|
+
}
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
export function createNormalizedSymbolFilter(symbols, filters) {
|
|
671
|
+
if (symbols === undefined || symbols.length === 0) {
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
const allowedSymbols = new Set();
|
|
675
|
+
for (const symbol of symbols) {
|
|
676
|
+
allowedSymbols.add(symbol);
|
|
677
|
+
allowedSymbols.add(symbol.toUpperCase());
|
|
678
|
+
}
|
|
679
|
+
for (const filter of filters) {
|
|
680
|
+
if (filter.symbols !== undefined) {
|
|
681
|
+
for (const symbol of filter.symbols) {
|
|
682
|
+
allowedSymbols.add(symbol);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return (symbol) => allowedSymbols.has(symbol);
|
|
687
|
+
}
|
|
688
|
+
export function lowerCaseSymbols(symbols) {
|
|
689
|
+
if (symbols !== undefined) {
|
|
690
|
+
return symbols.map((s) => s.toLowerCase());
|
|
691
|
+
}
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
export const fromMicroSecondsToDate = (micros) => {
|
|
695
|
+
const isMicroseconds = micros > 1e15; // Check if the number is likely in microseconds
|
|
696
|
+
if (!isMicroseconds) {
|
|
697
|
+
return new Date(micros);
|
|
698
|
+
}
|
|
699
|
+
const timestamp = new Date(micros / 1000);
|
|
700
|
+
timestamp.μs = micros % 1000;
|
|
701
|
+
return timestamp;
|
|
702
|
+
};
|
|
703
|
+
export function onlyUnique(value, index, array) {
|
|
704
|
+
return array.indexOf(value) === index;
|
|
705
|
+
}
|
|
706
|
+
//# sourceMappingURL=handy.js.map
|