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.
Files changed (792) hide show
  1. package/bin/tardis-machine.js +68 -57
  2. package/dist/tardismachine.d.ts.map +1 -1
  3. package/dist/tardismachine.js +13 -6
  4. package/dist/tardismachine.js.map +1 -1
  5. package/node_modules/debug/LICENSE +20 -0
  6. package/node_modules/debug/README.md +481 -0
  7. package/node_modules/debug/package.json +64 -0
  8. package/node_modules/debug/src/browser.js +272 -0
  9. package/node_modules/debug/src/common.js +292 -0
  10. package/node_modules/debug/src/index.js +10 -0
  11. package/node_modules/debug/src/node.js +263 -0
  12. package/node_modules/follow-redirects/LICENSE +18 -0
  13. package/node_modules/follow-redirects/README.md +157 -0
  14. package/node_modules/follow-redirects/debug.js +15 -0
  15. package/node_modules/follow-redirects/http.js +1 -0
  16. package/node_modules/follow-redirects/https.js +1 -0
  17. package/node_modules/follow-redirects/index.js +709 -0
  18. package/node_modules/follow-redirects/package.json +58 -0
  19. package/node_modules/long/LICENSE +202 -0
  20. package/node_modules/long/README.md +286 -0
  21. package/node_modules/long/index.d.ts +2 -0
  22. package/node_modules/long/index.js +1581 -0
  23. package/node_modules/long/package.json +58 -0
  24. package/node_modules/long/types.d.ts +474 -0
  25. package/node_modules/long/umd/index.d.ts +3 -0
  26. package/node_modules/long/umd/index.js +1622 -0
  27. package/node_modules/long/umd/package.json +3 -0
  28. package/node_modules/long/umd/types.d.ts +474 -0
  29. package/node_modules/ms/index.js +162 -0
  30. package/node_modules/ms/license.md +21 -0
  31. package/node_modules/ms/package.json +38 -0
  32. package/node_modules/ms/readme.md +59 -0
  33. package/node_modules/protobufjs/LICENSE +39 -0
  34. package/node_modules/protobufjs/README.md +440 -0
  35. package/node_modules/protobufjs/dist/light/protobuf.js +9276 -0
  36. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -0
  37. package/node_modules/protobufjs/dist/light/protobuf.min.js +8 -0
  38. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -0
  39. package/node_modules/protobufjs/dist/minimal/protobuf.js +3556 -0
  40. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -0
  41. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +8 -0
  42. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -0
  43. package/node_modules/protobufjs/dist/protobuf.js +11233 -0
  44. package/node_modules/protobufjs/dist/protobuf.js.map +1 -0
  45. package/node_modules/protobufjs/dist/protobuf.min.js +8 -0
  46. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -0
  47. package/node_modules/protobufjs/ext/README.md +70 -0
  48. package/node_modules/protobufjs/ext/debug/README.md +4 -0
  49. package/node_modules/protobufjs/ext/debug/index.js +71 -0
  50. package/node_modules/protobufjs/ext/descriptor/README.md +5 -0
  51. package/node_modules/protobufjs/ext/descriptor/index.d.ts +2 -0
  52. package/node_modules/protobufjs/ext/descriptor/index.js +2 -0
  53. package/node_modules/protobufjs/ext/descriptor.d.ts +87 -0
  54. package/node_modules/protobufjs/ext/descriptor.generated.d.ts +417 -0
  55. package/node_modules/protobufjs/ext/descriptor.js +1356 -0
  56. package/node_modules/protobufjs/ext/protojson.LICENSE +201 -0
  57. package/node_modules/protobufjs/ext/protojson.d.ts +20 -0
  58. package/node_modules/protobufjs/ext/protojson.generated.d.ts +49 -0
  59. package/node_modules/protobufjs/ext/protojson.js +951 -0
  60. package/node_modules/protobufjs/ext/textformat.d.ts +19 -0
  61. package/node_modules/protobufjs/ext/textformat.generated.d.ts +33 -0
  62. package/node_modules/protobufjs/ext/textformat.js +1276 -0
  63. package/node_modules/protobufjs/google/LICENSE +27 -0
  64. package/node_modules/protobufjs/google/README.md +1 -0
  65. package/node_modules/protobufjs/google/api/annotations.json +85 -0
  66. package/node_modules/protobufjs/google/api/annotations.proto +11 -0
  67. package/node_modules/protobufjs/google/api/http.json +87 -0
  68. package/node_modules/protobufjs/google/api/http.proto +31 -0
  69. package/node_modules/protobufjs/google/protobuf/api.json +124 -0
  70. package/node_modules/protobufjs/google/protobuf/api.proto +34 -0
  71. package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +126 -0
  72. package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +47 -0
  73. package/node_modules/protobufjs/google/protobuf/descriptor.json +1465 -0
  74. package/node_modules/protobufjs/google/protobuf/descriptor.proto +527 -0
  75. package/node_modules/protobufjs/google/protobuf/source_context.json +21 -0
  76. package/node_modules/protobufjs/google/protobuf/source_context.proto +7 -0
  77. package/node_modules/protobufjs/google/protobuf/type.json +209 -0
  78. package/node_modules/protobufjs/google/protobuf/type.proto +89 -0
  79. package/node_modules/protobufjs/index.d.ts +3203 -0
  80. package/node_modules/protobufjs/index.js +4 -0
  81. package/node_modules/protobufjs/light.d.ts +2 -0
  82. package/node_modules/protobufjs/light.js +4 -0
  83. package/node_modules/protobufjs/minimal.d.ts +2 -0
  84. package/node_modules/protobufjs/minimal.js +4 -0
  85. package/node_modules/protobufjs/package.json +93 -0
  86. package/node_modules/protobufjs/src/common.js +405 -0
  87. package/node_modules/protobufjs/src/converter.js +352 -0
  88. package/node_modules/protobufjs/src/decoder.js +279 -0
  89. package/node_modules/protobufjs/src/encoder.js +123 -0
  90. package/node_modules/protobufjs/src/enum.js +239 -0
  91. package/node_modules/protobufjs/src/field.js +505 -0
  92. package/node_modules/protobufjs/src/index-light.js +104 -0
  93. package/node_modules/protobufjs/src/index-minimal.js +35 -0
  94. package/node_modules/protobufjs/src/index.js +12 -0
  95. package/node_modules/protobufjs/src/mapfield.js +144 -0
  96. package/node_modules/protobufjs/src/message.js +137 -0
  97. package/node_modules/protobufjs/src/method.js +183 -0
  98. package/node_modules/protobufjs/src/namespace.js +574 -0
  99. package/node_modules/protobufjs/src/object.js +392 -0
  100. package/node_modules/protobufjs/src/oneof.js +233 -0
  101. package/node_modules/protobufjs/src/parse.js +1111 -0
  102. package/node_modules/protobufjs/src/reader.js +788 -0
  103. package/node_modules/protobufjs/src/reader_buffer.js +77 -0
  104. package/node_modules/protobufjs/src/root.js +424 -0
  105. package/node_modules/protobufjs/src/roots.js +18 -0
  106. package/node_modules/protobufjs/src/rpc/service.js +155 -0
  107. package/node_modules/protobufjs/src/rpc.js +36 -0
  108. package/node_modules/protobufjs/src/service.js +206 -0
  109. package/node_modules/protobufjs/src/tokenize.js +421 -0
  110. package/node_modules/protobufjs/src/type.js +676 -0
  111. package/node_modules/protobufjs/src/types.js +196 -0
  112. package/node_modules/protobufjs/src/typescript.js +25 -0
  113. package/node_modules/protobufjs/src/util/aspromise.d.ts +13 -0
  114. package/node_modules/protobufjs/src/util/aspromise.js +52 -0
  115. package/node_modules/protobufjs/src/util/base64.d.ts +32 -0
  116. package/node_modules/protobufjs/src/util/base64.js +146 -0
  117. package/node_modules/protobufjs/src/util/codegen.d.ts +31 -0
  118. package/node_modules/protobufjs/src/util/codegen.js +118 -0
  119. package/node_modules/protobufjs/src/util/eventemitter.d.ts +45 -0
  120. package/node_modules/protobufjs/src/util/eventemitter.js +86 -0
  121. package/node_modules/protobufjs/src/util/fetch.d.ts +56 -0
  122. package/node_modules/protobufjs/src/util/fetch.js +112 -0
  123. package/node_modules/protobufjs/src/util/float.d.ts +83 -0
  124. package/node_modules/protobufjs/src/util/float.js +335 -0
  125. package/node_modules/protobufjs/src/util/fs.js +11 -0
  126. package/node_modules/protobufjs/src/util/longbits.js +204 -0
  127. package/node_modules/protobufjs/src/util/minimal.js +511 -0
  128. package/node_modules/protobufjs/src/util/path.d.ts +22 -0
  129. package/node_modules/protobufjs/src/util/path.js +100 -0
  130. package/node_modules/protobufjs/src/util/patterns.js +7 -0
  131. package/node_modules/protobufjs/src/util/pool.d.ts +32 -0
  132. package/node_modules/protobufjs/src/util/pool.js +48 -0
  133. package/node_modules/protobufjs/src/util/utf8.d.ts +24 -0
  134. package/node_modules/protobufjs/src/util/utf8.js +190 -0
  135. package/node_modules/protobufjs/src/util.js +264 -0
  136. package/node_modules/protobufjs/src/verifier.js +185 -0
  137. package/node_modules/protobufjs/src/wrappers.js +106 -0
  138. package/node_modules/protobufjs/src/writer.js +700 -0
  139. package/node_modules/protobufjs/src/writer_buffer.js +100 -0
  140. package/node_modules/protobufjs/tsconfig.json +6 -0
  141. package/node_modules/tardis-dev/LICENSE +373 -0
  142. package/node_modules/tardis-dev/README.md +275 -0
  143. package/node_modules/tardis-dev/dist/apikeyaccessinfo.d.ts +11 -0
  144. package/node_modules/tardis-dev/dist/apikeyaccessinfo.d.ts.map +1 -0
  145. package/node_modules/tardis-dev/dist/apikeyaccessinfo.js +13 -0
  146. package/node_modules/tardis-dev/dist/apikeyaccessinfo.js.map +1 -0
  147. package/node_modules/tardis-dev/dist/binarysplit.d.ts +8 -0
  148. package/node_modules/tardis-dev/dist/binarysplit.d.ts.map +1 -0
  149. package/node_modules/tardis-dev/dist/binarysplit.js +41 -0
  150. package/node_modules/tardis-dev/dist/binarysplit.js.map +1 -0
  151. package/node_modules/tardis-dev/dist/boundedqueue.d.ts +19 -0
  152. package/node_modules/tardis-dev/dist/boundedqueue.d.ts.map +1 -0
  153. package/node_modules/tardis-dev/dist/boundedqueue.js +96 -0
  154. package/node_modules/tardis-dev/dist/boundedqueue.js.map +1 -0
  155. package/node_modules/tardis-dev/dist/clearcache.d.ts +4 -0
  156. package/node_modules/tardis-dev/dist/clearcache.d.ts.map +1 -0
  157. package/node_modules/tardis-dev/dist/clearcache.js +48 -0
  158. package/node_modules/tardis-dev/dist/clearcache.js.map +1 -0
  159. package/node_modules/tardis-dev/dist/combine.d.ts +14 -0
  160. package/node_modules/tardis-dev/dist/combine.d.ts.map +1 -0
  161. package/node_modules/tardis-dev/dist/combine.js +97 -0
  162. package/node_modules/tardis-dev/dist/combine.js.map +1 -0
  163. package/node_modules/tardis-dev/dist/computable/booksnapshot.d.ts +14 -0
  164. package/node_modules/tardis-dev/dist/computable/booksnapshot.d.ts.map +1 -0
  165. package/node_modules/tardis-dev/dist/computable/booksnapshot.js +248 -0
  166. package/node_modules/tardis-dev/dist/computable/booksnapshot.js.map +1 -0
  167. package/node_modules/tardis-dev/dist/computable/computable.d.ts +8 -0
  168. package/node_modules/tardis-dev/dist/computable/computable.d.ts.map +1 -0
  169. package/node_modules/tardis-dev/dist/computable/computable.js +72 -0
  170. package/node_modules/tardis-dev/dist/computable/computable.js.map +1 -0
  171. package/node_modules/tardis-dev/dist/computable/context.d.ts +4 -0
  172. package/node_modules/tardis-dev/dist/computable/context.d.ts.map +1 -0
  173. package/node_modules/tardis-dev/dist/computable/context.js +9 -0
  174. package/node_modules/tardis-dev/dist/computable/context.js.map +1 -0
  175. package/node_modules/tardis-dev/dist/computable/index.d.ts +4 -0
  176. package/node_modules/tardis-dev/dist/computable/index.d.ts.map +1 -0
  177. package/node_modules/tardis-dev/dist/computable/index.js +4 -0
  178. package/node_modules/tardis-dev/dist/computable/index.js.map +1 -0
  179. package/node_modules/tardis-dev/dist/computable/tradebar.d.ts +11 -0
  180. package/node_modules/tardis-dev/dist/computable/tradebar.d.ts.map +1 -0
  181. package/node_modules/tardis-dev/dist/computable/tradebar.js +132 -0
  182. package/node_modules/tardis-dev/dist/computable/tradebar.js.map +1 -0
  183. package/node_modules/tardis-dev/dist/consts.d.ts +66 -0
  184. package/node_modules/tardis-dev/dist/consts.d.ts.map +1 -0
  185. package/node_modules/tardis-dev/dist/consts.js +573 -0
  186. package/node_modules/tardis-dev/dist/consts.js.map +1 -0
  187. package/node_modules/tardis-dev/dist/debug.d.ts +3 -0
  188. package/node_modules/tardis-dev/dist/debug.d.ts.map +1 -0
  189. package/node_modules/tardis-dev/dist/debug.js +3 -0
  190. package/node_modules/tardis-dev/dist/debug.js.map +1 -0
  191. package/node_modules/tardis-dev/dist/downloaddatasets.d.ts +25 -0
  192. package/node_modules/tardis-dev/dist/downloaddatasets.d.ts.map +1 -0
  193. package/node_modules/tardis-dev/dist/downloaddatasets.js +118 -0
  194. package/node_modules/tardis-dev/dist/downloaddatasets.js.map +1 -0
  195. package/node_modules/tardis-dev/dist/exchangedetails.d.ts +91 -0
  196. package/node_modules/tardis-dev/dist/exchangedetails.d.ts.map +1 -0
  197. package/node_modules/tardis-dev/dist/exchangedetails.js +8 -0
  198. package/node_modules/tardis-dev/dist/exchangedetails.js.map +1 -0
  199. package/node_modules/tardis-dev/dist/filter.d.ts +8 -0
  200. package/node_modules/tardis-dev/dist/filter.d.ts.map +1 -0
  201. package/node_modules/tardis-dev/dist/filter.js +51 -0
  202. package/node_modules/tardis-dev/dist/filter.js.map +1 -0
  203. package/node_modules/tardis-dev/dist/foreachconcurrent.d.ts +2 -0
  204. package/node_modules/tardis-dev/dist/foreachconcurrent.d.ts.map +1 -0
  205. package/node_modules/tardis-dev/dist/foreachconcurrent.js +28 -0
  206. package/node_modules/tardis-dev/dist/foreachconcurrent.js.map +1 -0
  207. package/node_modules/tardis-dev/dist/handy.d.ts +102 -0
  208. package/node_modules/tardis-dev/dist/handy.d.ts.map +1 -0
  209. package/node_modules/tardis-dev/dist/handy.js +706 -0
  210. package/node_modules/tardis-dev/dist/handy.js.map +1 -0
  211. package/node_modules/tardis-dev/dist/index.d.ts +17 -0
  212. package/node_modules/tardis-dev/dist/index.d.ts.map +1 -0
  213. package/node_modules/tardis-dev/dist/index.js +17 -0
  214. package/node_modules/tardis-dev/dist/index.js.map +1 -0
  215. package/node_modules/tardis-dev/dist/instrumentinfo.d.ts +105 -0
  216. package/node_modules/tardis-dev/dist/instrumentinfo.d.ts.map +1 -0
  217. package/node_modules/tardis-dev/dist/instrumentinfo.js +59 -0
  218. package/node_modules/tardis-dev/dist/instrumentinfo.js.map +1 -0
  219. package/node_modules/tardis-dev/dist/mappers/ascendex.d.ts +10 -0
  220. package/node_modules/tardis-dev/dist/mappers/ascendex.d.ts.map +1 -0
  221. package/node_modules/tardis-dev/dist/mappers/ascendex.js +146 -0
  222. package/node_modules/tardis-dev/dist/mappers/ascendex.js.map +1 -0
  223. package/node_modules/tardis-dev/dist/mappers/binance.d.ts +32 -0
  224. package/node_modules/tardis-dev/dist/mappers/binance.d.ts.map +1 -0
  225. package/node_modules/tardis-dev/dist/mappers/binance.js +420 -0
  226. package/node_modules/tardis-dev/dist/mappers/binance.js.map +1 -0
  227. package/node_modules/tardis-dev/dist/mappers/binancedex.d.ts +9 -0
  228. package/node_modules/tardis-dev/dist/mappers/binancedex.d.ts.map +1 -0
  229. package/node_modules/tardis-dev/dist/mappers/binancedex.js +120 -0
  230. package/node_modules/tardis-dev/dist/mappers/binancedex.js.map +1 -0
  231. package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.d.ts +10 -0
  232. package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.d.ts.map +1 -0
  233. package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.js +389 -0
  234. package/node_modules/tardis-dev/dist/mappers/binanceeuropeanoptions.js.map +1 -0
  235. package/node_modules/tardis-dev/dist/mappers/bitfinex.d.ts +16 -0
  236. package/node_modules/tardis-dev/dist/mappers/bitfinex.d.ts.map +1 -0
  237. package/node_modules/tardis-dev/dist/mappers/bitfinex.js +352 -0
  238. package/node_modules/tardis-dev/dist/mappers/bitfinex.js.map +1 -0
  239. package/node_modules/tardis-dev/dist/mappers/bitflyer.d.ts +9 -0
  240. package/node_modules/tardis-dev/dist/mappers/bitflyer.d.ts.map +1 -0
  241. package/node_modules/tardis-dev/dist/mappers/bitflyer.js +121 -0
  242. package/node_modules/tardis-dev/dist/mappers/bitflyer.js.map +1 -0
  243. package/node_modules/tardis-dev/dist/mappers/bitget.d.ts +16 -0
  244. package/node_modules/tardis-dev/dist/mappers/bitget.d.ts.map +1 -0
  245. package/node_modules/tardis-dev/dist/mappers/bitget.js +335 -0
  246. package/node_modules/tardis-dev/dist/mappers/bitget.js.map +1 -0
  247. package/node_modules/tardis-dev/dist/mappers/bitmex.d.ts +11 -0
  248. package/node_modules/tardis-dev/dist/mappers/bitmex.d.ts.map +1 -0
  249. package/node_modules/tardis-dev/dist/mappers/bitmex.js +248 -0
  250. package/node_modules/tardis-dev/dist/mappers/bitmex.js.map +1 -0
  251. package/node_modules/tardis-dev/dist/mappers/bitnomial.d.ts +8 -0
  252. package/node_modules/tardis-dev/dist/mappers/bitnomial.d.ts.map +1 -0
  253. package/node_modules/tardis-dev/dist/mappers/bitnomial.js +91 -0
  254. package/node_modules/tardis-dev/dist/mappers/bitnomial.js.map +1 -0
  255. package/node_modules/tardis-dev/dist/mappers/bitstamp.d.ts +8 -0
  256. package/node_modules/tardis-dev/dist/mappers/bitstamp.d.ts.map +1 -0
  257. package/node_modules/tardis-dev/dist/mappers/bitstamp.js +151 -0
  258. package/node_modules/tardis-dev/dist/mappers/bitstamp.js.map +1 -0
  259. package/node_modules/tardis-dev/dist/mappers/blockchaincom.d.ts +8 -0
  260. package/node_modules/tardis-dev/dist/mappers/blockchaincom.d.ts.map +1 -0
  261. package/node_modules/tardis-dev/dist/mappers/blockchaincom.js +65 -0
  262. package/node_modules/tardis-dev/dist/mappers/blockchaincom.js.map +1 -0
  263. package/node_modules/tardis-dev/dist/mappers/bullish.d.ts +11 -0
  264. package/node_modules/tardis-dev/dist/mappers/bullish.d.ts.map +1 -0
  265. package/node_modules/tardis-dev/dist/mappers/bullish.js +234 -0
  266. package/node_modules/tardis-dev/dist/mappers/bullish.js.map +1 -0
  267. package/node_modules/tardis-dev/dist/mappers/bybit.d.ts +66 -0
  268. package/node_modules/tardis-dev/dist/mappers/bybit.d.ts.map +1 -0
  269. package/node_modules/tardis-dev/dist/mappers/bybit.js +601 -0
  270. package/node_modules/tardis-dev/dist/mappers/bybit.js.map +1 -0
  271. package/node_modules/tardis-dev/dist/mappers/bybitspot.d.ts +96 -0
  272. package/node_modules/tardis-dev/dist/mappers/bybitspot.d.ts.map +1 -0
  273. package/node_modules/tardis-dev/dist/mappers/bybitspot.js +99 -0
  274. package/node_modules/tardis-dev/dist/mappers/bybitspot.js.map +1 -0
  275. package/node_modules/tardis-dev/dist/mappers/coinbase.d.ts +9 -0
  276. package/node_modules/tardis-dev/dist/mappers/coinbase.d.ts.map +1 -0
  277. package/node_modules/tardis-dev/dist/mappers/coinbase.js +176 -0
  278. package/node_modules/tardis-dev/dist/mappers/coinbase.js.map +1 -0
  279. package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.d.ts +10 -0
  280. package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.d.ts.map +1 -0
  281. package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.js +210 -0
  282. package/node_modules/tardis-dev/dist/mappers/coinbaseinternational.js.map +1 -0
  283. package/node_modules/tardis-dev/dist/mappers/coinflex.d.ts +9 -0
  284. package/node_modules/tardis-dev/dist/mappers/coinflex.d.ts.map +1 -0
  285. package/node_modules/tardis-dev/dist/mappers/coinflex.js +111 -0
  286. package/node_modules/tardis-dev/dist/mappers/coinflex.js.map +1 -0
  287. package/node_modules/tardis-dev/dist/mappers/cryptocom.d.ts +25 -0
  288. package/node_modules/tardis-dev/dist/mappers/cryptocom.d.ts.map +1 -0
  289. package/node_modules/tardis-dev/dist/mappers/cryptocom.js +219 -0
  290. package/node_modules/tardis-dev/dist/mappers/cryptocom.js.map +1 -0
  291. package/node_modules/tardis-dev/dist/mappers/cryptofacilities.d.ts +11 -0
  292. package/node_modules/tardis-dev/dist/mappers/cryptofacilities.d.ts.map +1 -0
  293. package/node_modules/tardis-dev/dist/mappers/cryptofacilities.js +199 -0
  294. package/node_modules/tardis-dev/dist/mappers/cryptofacilities.js.map +1 -0
  295. package/node_modules/tardis-dev/dist/mappers/delta.d.ts +10 -0
  296. package/node_modules/tardis-dev/dist/mappers/delta.d.ts.map +1 -0
  297. package/node_modules/tardis-dev/dist/mappers/delta.js +205 -0
  298. package/node_modules/tardis-dev/dist/mappers/delta.js.map +1 -0
  299. package/node_modules/tardis-dev/dist/mappers/deribit.d.ts +12 -0
  300. package/node_modules/tardis-dev/dist/mappers/deribit.d.ts.map +1 -0
  301. package/node_modules/tardis-dev/dist/mappers/deribit.js +278 -0
  302. package/node_modules/tardis-dev/dist/mappers/deribit.js.map +1 -0
  303. package/node_modules/tardis-dev/dist/mappers/dydx.d.ts +9 -0
  304. package/node_modules/tardis-dev/dist/mappers/dydx.d.ts.map +1 -0
  305. package/node_modules/tardis-dev/dist/mappers/dydx.js +188 -0
  306. package/node_modules/tardis-dev/dist/mappers/dydx.js.map +1 -0
  307. package/node_modules/tardis-dev/dist/mappers/dydxv4.d.ts +10 -0
  308. package/node_modules/tardis-dev/dist/mappers/dydxv4.d.ts.map +1 -0
  309. package/node_modules/tardis-dev/dist/mappers/dydxv4.js +189 -0
  310. package/node_modules/tardis-dev/dist/mappers/dydxv4.js.map +1 -0
  311. package/node_modules/tardis-dev/dist/mappers/ftx.d.ts +16 -0
  312. package/node_modules/tardis-dev/dist/mappers/ftx.d.ts.map +1 -0
  313. package/node_modules/tardis-dev/dist/mappers/ftx.js +222 -0
  314. package/node_modules/tardis-dev/dist/mappers/ftx.js.map +1 -0
  315. package/node_modules/tardis-dev/dist/mappers/gateio.d.ts +9 -0
  316. package/node_modules/tardis-dev/dist/mappers/gateio.d.ts.map +1 -0
  317. package/node_modules/tardis-dev/dist/mappers/gateio.js +370 -0
  318. package/node_modules/tardis-dev/dist/mappers/gateio.js.map +1 -0
  319. package/node_modules/tardis-dev/dist/mappers/gateiofutures.d.ts +10 -0
  320. package/node_modules/tardis-dev/dist/mappers/gateiofutures.d.ts.map +1 -0
  321. package/node_modules/tardis-dev/dist/mappers/gateiofutures.js +183 -0
  322. package/node_modules/tardis-dev/dist/mappers/gateiofutures.js.map +1 -0
  323. package/node_modules/tardis-dev/dist/mappers/gemini.d.ts +9 -0
  324. package/node_modules/tardis-dev/dist/mappers/gemini.d.ts.map +1 -0
  325. package/node_modules/tardis-dev/dist/mappers/gemini.js +145 -0
  326. package/node_modules/tardis-dev/dist/mappers/gemini.js.map +1 -0
  327. package/node_modules/tardis-dev/dist/mappers/hitbtc.d.ts +8 -0
  328. package/node_modules/tardis-dev/dist/mappers/hitbtc.d.ts.map +1 -0
  329. package/node_modules/tardis-dev/dist/mappers/hitbtc.js +76 -0
  330. package/node_modules/tardis-dev/dist/mappers/hitbtc.js.map +1 -0
  331. package/node_modules/tardis-dev/dist/mappers/huobi.d.ts +125 -0
  332. package/node_modules/tardis-dev/dist/mappers/huobi.d.ts.map +1 -0
  333. package/node_modules/tardis-dev/dist/mappers/huobi.js +529 -0
  334. package/node_modules/tardis-dev/dist/mappers/huobi.js.map +1 -0
  335. package/node_modules/tardis-dev/dist/mappers/hyperliquid.d.ts +10 -0
  336. package/node_modules/tardis-dev/dist/mappers/hyperliquid.d.ts.map +1 -0
  337. package/node_modules/tardis-dev/dist/mappers/hyperliquid.js +161 -0
  338. package/node_modules/tardis-dev/dist/mappers/hyperliquid.js.map +1 -0
  339. package/node_modules/tardis-dev/dist/mappers/index.d.ts +788 -0
  340. package/node_modules/tardis-dev/dist/mappers/index.d.ts.map +1 -0
  341. package/node_modules/tardis-dev/dist/mappers/index.js +66 -0
  342. package/node_modules/tardis-dev/dist/mappers/index.js.map +1 -0
  343. package/node_modules/tardis-dev/dist/mappers/kraken.d.ts +9 -0
  344. package/node_modules/tardis-dev/dist/mappers/kraken.d.ts.map +1 -0
  345. package/node_modules/tardis-dev/dist/mappers/kraken.js +238 -0
  346. package/node_modules/tardis-dev/dist/mappers/kraken.js.map +1 -0
  347. package/node_modules/tardis-dev/dist/mappers/kucoin.d.ts +9 -0
  348. package/node_modules/tardis-dev/dist/mappers/kucoin.d.ts.map +1 -0
  349. package/node_modules/tardis-dev/dist/mappers/kucoin.js +237 -0
  350. package/node_modules/tardis-dev/dist/mappers/kucoin.js.map +1 -0
  351. package/node_modules/tardis-dev/dist/mappers/kucoinfutures.d.ts +10 -0
  352. package/node_modules/tardis-dev/dist/mappers/kucoinfutures.d.ts.map +1 -0
  353. package/node_modules/tardis-dev/dist/mappers/kucoinfutures.js +302 -0
  354. package/node_modules/tardis-dev/dist/mappers/kucoinfutures.js.map +1 -0
  355. package/node_modules/tardis-dev/dist/mappers/lighter.d.ts +11 -0
  356. package/node_modules/tardis-dev/dist/mappers/lighter.d.ts.map +1 -0
  357. package/node_modules/tardis-dev/dist/mappers/lighter.js +186 -0
  358. package/node_modules/tardis-dev/dist/mappers/lighter.js.map +1 -0
  359. package/node_modules/tardis-dev/dist/mappers/mapper.d.ts +32 -0
  360. package/node_modules/tardis-dev/dist/mappers/mapper.d.ts.map +1 -0
  361. package/node_modules/tardis-dev/dist/mappers/mapper.js +120 -0
  362. package/node_modules/tardis-dev/dist/mappers/mapper.js.map +1 -0
  363. package/node_modules/tardis-dev/dist/mappers/mexc.d.ts +122 -0
  364. package/node_modules/tardis-dev/dist/mappers/mexc.d.ts.map +1 -0
  365. package/node_modules/tardis-dev/dist/mappers/mexc.js +205 -0
  366. package/node_modules/tardis-dev/dist/mappers/mexc.js.map +1 -0
  367. package/node_modules/tardis-dev/dist/mappers/mexcfutures.d.ts +137 -0
  368. package/node_modules/tardis-dev/dist/mappers/mexcfutures.d.ts.map +1 -0
  369. package/node_modules/tardis-dev/dist/mappers/mexcfutures.js +225 -0
  370. package/node_modules/tardis-dev/dist/mappers/mexcfutures.js.map +1 -0
  371. package/node_modules/tardis-dev/dist/mappers/okex.d.ts +39 -0
  372. package/node_modules/tardis-dev/dist/mappers/okex.d.ts.map +1 -0
  373. package/node_modules/tardis-dev/dist/mappers/okex.js +913 -0
  374. package/node_modules/tardis-dev/dist/mappers/okex.js.map +1 -0
  375. package/node_modules/tardis-dev/dist/mappers/okexspreads.d.ts +69 -0
  376. package/node_modules/tardis-dev/dist/mappers/okexspreads.d.ts.map +1 -0
  377. package/node_modules/tardis-dev/dist/mappers/okexspreads.js +116 -0
  378. package/node_modules/tardis-dev/dist/mappers/okexspreads.js.map +1 -0
  379. package/node_modules/tardis-dev/dist/mappers/phemex.d.ts +9 -0
  380. package/node_modules/tardis-dev/dist/mappers/phemex.d.ts.map +1 -0
  381. package/node_modules/tardis-dev/dist/mappers/phemex.js +406 -0
  382. package/node_modules/tardis-dev/dist/mappers/phemex.js.map +1 -0
  383. package/node_modules/tardis-dev/dist/mappers/poloniex.d.ts +8 -0
  384. package/node_modules/tardis-dev/dist/mappers/poloniex.d.ts.map +1 -0
  385. package/node_modules/tardis-dev/dist/mappers/poloniex.js +207 -0
  386. package/node_modules/tardis-dev/dist/mappers/poloniex.js.map +1 -0
  387. package/node_modules/tardis-dev/dist/mappers/polymarket.d.ts +59 -0
  388. package/node_modules/tardis-dev/dist/mappers/polymarket.d.ts.map +1 -0
  389. package/node_modules/tardis-dev/dist/mappers/polymarket.js +121 -0
  390. package/node_modules/tardis-dev/dist/mappers/polymarket.js.map +1 -0
  391. package/node_modules/tardis-dev/dist/mappers/registry.d.ts +41 -0
  392. package/node_modules/tardis-dev/dist/mappers/registry.d.ts.map +1 -0
  393. package/node_modules/tardis-dev/dist/mappers/registry.js +111 -0
  394. package/node_modules/tardis-dev/dist/mappers/registry.js.map +1 -0
  395. package/node_modules/tardis-dev/dist/mappers/serum.d.ts +19 -0
  396. package/node_modules/tardis-dev/dist/mappers/serum.d.ts.map +1 -0
  397. package/node_modules/tardis-dev/dist/mappers/serum.js +127 -0
  398. package/node_modules/tardis-dev/dist/mappers/serum.js.map +1 -0
  399. package/node_modules/tardis-dev/dist/mappers/upbit.d.ts +8 -0
  400. package/node_modules/tardis-dev/dist/mappers/upbit.d.ts.map +1 -0
  401. package/node_modules/tardis-dev/dist/mappers/upbit.js +78 -0
  402. package/node_modules/tardis-dev/dist/mappers/upbit.js.map +1 -0
  403. package/node_modules/tardis-dev/dist/mappers/woox.d.ts +10 -0
  404. package/node_modules/tardis-dev/dist/mappers/woox.d.ts.map +1 -0
  405. package/node_modules/tardis-dev/dist/mappers/woox.js +488 -0
  406. package/node_modules/tardis-dev/dist/mappers/woox.js.map +1 -0
  407. package/node_modules/tardis-dev/dist/okexsymbols.d.ts +3 -0
  408. package/node_modules/tardis-dev/dist/okexsymbols.d.ts.map +1 -0
  409. package/node_modules/tardis-dev/dist/okexsymbols.js +10 -0
  410. package/node_modules/tardis-dev/dist/okexsymbols.js.map +1 -0
  411. package/node_modules/tardis-dev/dist/options.d.ts +13 -0
  412. package/node_modules/tardis-dev/dist/options.d.ts.map +1 -0
  413. package/node_modules/tardis-dev/dist/options.js +21 -0
  414. package/node_modules/tardis-dev/dist/options.js.map +1 -0
  415. package/node_modules/tardis-dev/dist/orderbook.d.ts +23 -0
  416. package/node_modules/tardis-dev/dist/orderbook.d.ts.map +1 -0
  417. package/node_modules/tardis-dev/dist/orderbook.js +133 -0
  418. package/node_modules/tardis-dev/dist/orderbook.js.map +1 -0
  419. package/node_modules/tardis-dev/dist/priceleveltree.d.ts +27 -0
  420. package/node_modules/tardis-dev/dist/priceleveltree.d.ts.map +1 -0
  421. package/node_modules/tardis-dev/dist/priceleveltree.js +165 -0
  422. package/node_modules/tardis-dev/dist/priceleveltree.js.map +1 -0
  423. package/node_modules/tardis-dev/dist/realtimefeeds/binance.d.ts +99 -0
  424. package/node_modules/tardis-dev/dist/realtimefeeds/binance.d.ts.map +1 -0
  425. package/node_modules/tardis-dev/dist/realtimefeeds/binance.js +370 -0
  426. package/node_modules/tardis-dev/dist/realtimefeeds/binance.js.map +1 -0
  427. package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.d.ts +14 -0
  428. package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.d.ts.map +1 -0
  429. package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.js +53 -0
  430. package/node_modules/tardis-dev/dist/realtimefeeds/binancedex.js.map +1 -0
  431. package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.d.ts +14 -0
  432. package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.d.ts.map +1 -0
  433. package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.js +95 -0
  434. package/node_modules/tardis-dev/dist/realtimefeeds/binanceeuropeanoptions.js.map +1 -0
  435. package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.d.ts +36 -0
  436. package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.d.ts.map +1 -0
  437. package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.js +73 -0
  438. package/node_modules/tardis-dev/dist/realtimefeeds/bitfinex.js.map +1 -0
  439. package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.d.ts +9 -0
  440. package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.d.ts.map +1 -0
  441. package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.js +36 -0
  442. package/node_modules/tardis-dev/dist/realtimefeeds/bitflyer.js.map +1 -0
  443. package/node_modules/tardis-dev/dist/realtimefeeds/bitget.d.ts +19 -0
  444. package/node_modules/tardis-dev/dist/realtimefeeds/bitget.d.ts.map +1 -0
  445. package/node_modules/tardis-dev/dist/realtimefeeds/bitget.js +61 -0
  446. package/node_modules/tardis-dev/dist/realtimefeeds/bitget.js.map +1 -0
  447. package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.d.ts +11 -0
  448. package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.d.ts.map +1 -0
  449. package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.js +37 -0
  450. package/node_modules/tardis-dev/dist/realtimefeeds/bitmex.js.map +1 -0
  451. package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.d.ts +11 -0
  452. package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.d.ts.map +1 -0
  453. package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.js +52 -0
  454. package/node_modules/tardis-dev/dist/realtimefeeds/bitnomial.js.map +1 -0
  455. package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.d.ts +10 -0
  456. package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.d.ts.map +1 -0
  457. package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.js +57 -0
  458. package/node_modules/tardis-dev/dist/realtimefeeds/bitstamp.js.map +1 -0
  459. package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.d.ts +11 -0
  460. package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.d.ts.map +1 -0
  461. package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.js +37 -0
  462. package/node_modules/tardis-dev/dist/realtimefeeds/blockchaincom.js.map +1 -0
  463. package/node_modules/tardis-dev/dist/realtimefeeds/bullish.d.ts +18 -0
  464. package/node_modules/tardis-dev/dist/realtimefeeds/bullish.d.ts.map +1 -0
  465. package/node_modules/tardis-dev/dist/realtimefeeds/bullish.js +113 -0
  466. package/node_modules/tardis-dev/dist/realtimefeeds/bullish.js.map +1 -0
  467. package/node_modules/tardis-dev/dist/realtimefeeds/bybit.d.ts +28 -0
  468. package/node_modules/tardis-dev/dist/realtimefeeds/bybit.d.ts.map +1 -0
  469. package/node_modules/tardis-dev/dist/realtimefeeds/bybit.js +95 -0
  470. package/node_modules/tardis-dev/dist/realtimefeeds/bybit.js.map +1 -0
  471. package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.d.ts +16 -0
  472. package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.d.ts.map +1 -0
  473. package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.js +98 -0
  474. package/node_modules/tardis-dev/dist/realtimefeeds/coinbase.js.map +1 -0
  475. package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.d.ts +10 -0
  476. package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.d.ts.map +1 -0
  477. package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.js +47 -0
  478. package/node_modules/tardis-dev/dist/realtimefeeds/coinbaseinternational.js.map +1 -0
  479. package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.d.ts +8 -0
  480. package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.d.ts.map +1 -0
  481. package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.js +23 -0
  482. package/node_modules/tardis-dev/dist/realtimefeeds/coinflex.js.map +1 -0
  483. package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.d.ts +10 -0
  484. package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.d.ts.map +1 -0
  485. package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.js +43 -0
  486. package/node_modules/tardis-dev/dist/realtimefeeds/cryptocom.js.map +1 -0
  487. package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.d.ts +9 -0
  488. package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.d.ts.map +1 -0
  489. package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.js +25 -0
  490. package/node_modules/tardis-dev/dist/realtimefeeds/cryptofacilities.js.map +1 -0
  491. package/node_modules/tardis-dev/dist/realtimefeeds/delta.d.ts +18 -0
  492. package/node_modules/tardis-dev/dist/realtimefeeds/delta.d.ts.map +1 -0
  493. package/node_modules/tardis-dev/dist/realtimefeeds/delta.js +29 -0
  494. package/node_modules/tardis-dev/dist/realtimefeeds/delta.js.map +1 -0
  495. package/node_modules/tardis-dev/dist/realtimefeeds/deribit.d.ts +13 -0
  496. package/node_modules/tardis-dev/dist/realtimefeeds/deribit.d.ts.map +1 -0
  497. package/node_modules/tardis-dev/dist/realtimefeeds/deribit.js +81 -0
  498. package/node_modules/tardis-dev/dist/realtimefeeds/deribit.js.map +1 -0
  499. package/node_modules/tardis-dev/dist/realtimefeeds/dydx.d.ts +8 -0
  500. package/node_modules/tardis-dev/dist/realtimefeeds/dydx.d.ts.map +1 -0
  501. package/node_modules/tardis-dev/dist/realtimefeeds/dydx.js +34 -0
  502. package/node_modules/tardis-dev/dist/realtimefeeds/dydx.js.map +1 -0
  503. package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.d.ts +8 -0
  504. package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.d.ts.map +1 -0
  505. package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.js +33 -0
  506. package/node_modules/tardis-dev/dist/realtimefeeds/dydx_v4.js.map +1 -0
  507. package/node_modules/tardis-dev/dist/realtimefeeds/ftx.d.ts +33 -0
  508. package/node_modules/tardis-dev/dist/realtimefeeds/ftx.d.ts.map +1 -0
  509. package/node_modules/tardis-dev/dist/realtimefeeds/ftx.js +107 -0
  510. package/node_modules/tardis-dev/dist/realtimefeeds/ftx.js.map +1 -0
  511. package/node_modules/tardis-dev/dist/realtimefeeds/gateio.d.ts +9 -0
  512. package/node_modules/tardis-dev/dist/realtimefeeds/gateio.d.ts.map +1 -0
  513. package/node_modules/tardis-dev/dist/realtimefeeds/gateio.js +41 -0
  514. package/node_modules/tardis-dev/dist/realtimefeeds/gateio.js.map +1 -0
  515. package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.d.ts +17 -0
  516. package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.d.ts.map +1 -0
  517. package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.js +68 -0
  518. package/node_modules/tardis-dev/dist/realtimefeeds/gateiofutures.js.map +1 -0
  519. package/node_modules/tardis-dev/dist/realtimefeeds/gemini.d.ts +9 -0
  520. package/node_modules/tardis-dev/dist/realtimefeeds/gemini.d.ts.map +1 -0
  521. package/node_modules/tardis-dev/dist/realtimefeeds/gemini.js +32 -0
  522. package/node_modules/tardis-dev/dist/realtimefeeds/gemini.js.map +1 -0
  523. package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.d.ts +12 -0
  524. package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.d.ts.map +1 -0
  525. package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.js +55 -0
  526. package/node_modules/tardis-dev/dist/realtimefeeds/hitbtc.js.map +1 -0
  527. package/node_modules/tardis-dev/dist/realtimefeeds/huobi.d.ts +108 -0
  528. package/node_modules/tardis-dev/dist/realtimefeeds/huobi.d.ts.map +1 -0
  529. package/node_modules/tardis-dev/dist/realtimefeeds/huobi.js +339 -0
  530. package/node_modules/tardis-dev/dist/realtimefeeds/huobi.js.map +1 -0
  531. package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.d.ts +10 -0
  532. package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.d.ts.map +1 -0
  533. package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.js +34 -0
  534. package/node_modules/tardis-dev/dist/realtimefeeds/hyperliquid.js.map +1 -0
  535. package/node_modules/tardis-dev/dist/realtimefeeds/index.d.ts +6 -0
  536. package/node_modules/tardis-dev/dist/realtimefeeds/index.d.ts.map +1 -0
  537. package/node_modules/tardis-dev/dist/realtimefeeds/index.js +119 -0
  538. package/node_modules/tardis-dev/dist/realtimefeeds/index.js.map +1 -0
  539. package/node_modules/tardis-dev/dist/realtimefeeds/kraken.d.ts +10 -0
  540. package/node_modules/tardis-dev/dist/realtimefeeds/kraken.d.ts.map +1 -0
  541. package/node_modules/tardis-dev/dist/realtimefeeds/kraken.js +41 -0
  542. package/node_modules/tardis-dev/dist/realtimefeeds/kraken.js.map +1 -0
  543. package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.d.ts +13 -0
  544. package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.d.ts.map +1 -0
  545. package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.js +66 -0
  546. package/node_modules/tardis-dev/dist/realtimefeeds/kucoin.js.map +1 -0
  547. package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.d.ts +25 -0
  548. package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.d.ts.map +1 -0
  549. package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.js +110 -0
  550. package/node_modules/tardis-dev/dist/realtimefeeds/kucoinfutures.js.map +1 -0
  551. package/node_modules/tardis-dev/dist/realtimefeeds/lighter.d.ts +8 -0
  552. package/node_modules/tardis-dev/dist/realtimefeeds/lighter.d.ts.map +1 -0
  553. package/node_modules/tardis-dev/dist/realtimefeeds/lighter.js +25 -0
  554. package/node_modules/tardis-dev/dist/realtimefeeds/lighter.js.map +1 -0
  555. package/node_modules/tardis-dev/dist/realtimefeeds/mango.d.ts +5 -0
  556. package/node_modules/tardis-dev/dist/realtimefeeds/mango.d.ts.map +1 -0
  557. package/node_modules/tardis-dev/dist/realtimefeeds/mango.js +5 -0
  558. package/node_modules/tardis-dev/dist/realtimefeeds/mango.js.map +1 -0
  559. package/node_modules/tardis-dev/dist/realtimefeeds/mexc.d.ts +35 -0
  560. package/node_modules/tardis-dev/dist/realtimefeeds/mexc.d.ts.map +1 -0
  561. package/node_modules/tardis-dev/dist/realtimefeeds/mexc.js +261 -0
  562. package/node_modules/tardis-dev/dist/realtimefeeds/mexc.js.map +1 -0
  563. package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.d.ts +25 -0
  564. package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.d.ts.map +1 -0
  565. package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.js +203 -0
  566. package/node_modules/tardis-dev/dist/realtimefeeds/mexcfutures.js.map +1 -0
  567. package/node_modules/tardis-dev/dist/realtimefeeds/okex.d.ts +31 -0
  568. package/node_modules/tardis-dev/dist/realtimefeeds/okex.d.ts.map +1 -0
  569. package/node_modules/tardis-dev/dist/realtimefeeds/okex.js +147 -0
  570. package/node_modules/tardis-dev/dist/realtimefeeds/okex.js.map +1 -0
  571. package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.d.ts +11 -0
  572. package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.d.ts.map +1 -0
  573. package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.js +53 -0
  574. package/node_modules/tardis-dev/dist/realtimefeeds/okexspreads.js.map +1 -0
  575. package/node_modules/tardis-dev/dist/realtimefeeds/phemex.d.ts +14 -0
  576. package/node_modules/tardis-dev/dist/realtimefeeds/phemex.d.ts.map +1 -0
  577. package/node_modules/tardis-dev/dist/realtimefeeds/phemex.js +46 -0
  578. package/node_modules/tardis-dev/dist/realtimefeeds/phemex.js.map +1 -0
  579. package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.d.ts +14 -0
  580. package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.d.ts.map +1 -0
  581. package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.js +28 -0
  582. package/node_modules/tardis-dev/dist/realtimefeeds/poloniex.js.map +1 -0
  583. package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.d.ts +26 -0
  584. package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.d.ts.map +1 -0
  585. package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.js +92 -0
  586. package/node_modules/tardis-dev/dist/realtimefeeds/polymarket.js.map +1 -0
  587. package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.d.ts +75 -0
  588. package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.d.ts.map +1 -0
  589. package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.js +423 -0
  590. package/node_modules/tardis-dev/dist/realtimefeeds/realtimefeed.js.map +1 -0
  591. package/node_modules/tardis-dev/dist/realtimefeeds/serum.d.ts +14 -0
  592. package/node_modules/tardis-dev/dist/realtimefeeds/serum.d.ts.map +1 -0
  593. package/node_modules/tardis-dev/dist/realtimefeeds/serum.js +58 -0
  594. package/node_modules/tardis-dev/dist/realtimefeeds/serum.js.map +1 -0
  595. package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.d.ts +5 -0
  596. package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.d.ts.map +1 -0
  597. package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.js +5 -0
  598. package/node_modules/tardis-dev/dist/realtimefeeds/staratlas.js.map +1 -0
  599. package/node_modules/tardis-dev/dist/realtimefeeds/upbit.d.ts +8 -0
  600. package/node_modules/tardis-dev/dist/realtimefeeds/upbit.d.ts.map +1 -0
  601. package/node_modules/tardis-dev/dist/realtimefeeds/upbit.js +29 -0
  602. package/node_modules/tardis-dev/dist/realtimefeeds/upbit.js.map +1 -0
  603. package/node_modules/tardis-dev/dist/realtimefeeds/woox.d.ts +12 -0
  604. package/node_modules/tardis-dev/dist/realtimefeeds/woox.d.ts.map +1 -0
  605. package/node_modules/tardis-dev/dist/realtimefeeds/woox.js +77 -0
  606. package/node_modules/tardis-dev/dist/realtimefeeds/woox.js.map +1 -0
  607. package/node_modules/tardis-dev/dist/realtimeiterator.d.ts +10 -0
  608. package/node_modules/tardis-dev/dist/realtimeiterator.d.ts.map +1 -0
  609. package/node_modules/tardis-dev/dist/realtimeiterator.js +106 -0
  610. package/node_modules/tardis-dev/dist/realtimeiterator.js.map +1 -0
  611. package/node_modules/tardis-dev/dist/replay.d.ts +42 -0
  612. package/node_modules/tardis-dev/dist/replay.d.ts.map +1 -0
  613. package/node_modules/tardis-dev/dist/replay.js +417 -0
  614. package/node_modules/tardis-dev/dist/replay.js.map +1 -0
  615. package/node_modules/tardis-dev/dist/stream.d.ts +28 -0
  616. package/node_modules/tardis-dev/dist/stream.d.ts.map +1 -0
  617. package/node_modules/tardis-dev/dist/stream.js +112 -0
  618. package/node_modules/tardis-dev/dist/stream.js.map +1 -0
  619. package/node_modules/tardis-dev/dist/types.d.ts +154 -0
  620. package/node_modules/tardis-dev/dist/types.d.ts.map +1 -0
  621. package/node_modules/tardis-dev/dist/types.js +2 -0
  622. package/node_modules/tardis-dev/dist/types.js.map +1 -0
  623. package/node_modules/tardis-dev/dist/worker.d.ts +24 -0
  624. package/node_modules/tardis-dev/dist/worker.d.ts.map +1 -0
  625. package/node_modules/tardis-dev/dist/worker.js +143 -0
  626. package/node_modules/tardis-dev/dist/worker.js.map +1 -0
  627. package/node_modules/tardis-dev/example.js +171 -0
  628. package/node_modules/tardis-dev/package.json +85 -0
  629. package/node_modules/tardis-dev/src/apikeyaccessinfo.ts +25 -0
  630. package/node_modules/tardis-dev/src/binarysplit.ts +50 -0
  631. package/node_modules/tardis-dev/src/boundedqueue.ts +118 -0
  632. package/node_modules/tardis-dev/src/clearcache.ts +62 -0
  633. package/node_modules/tardis-dev/src/combine.ts +134 -0
  634. package/node_modules/tardis-dev/src/computable/booksnapshot.ts +327 -0
  635. package/node_modules/tardis-dev/src/computable/computable.ts +104 -0
  636. package/node_modules/tardis-dev/src/computable/context.ts +12 -0
  637. package/node_modules/tardis-dev/src/computable/index.ts +3 -0
  638. package/node_modules/tardis-dev/src/computable/tradebar.ts +173 -0
  639. package/node_modules/tardis-dev/src/consts.ts +623 -0
  640. package/node_modules/tardis-dev/src/debug.ts +3 -0
  641. package/node_modules/tardis-dev/src/downloaddatasets.ts +193 -0
  642. package/node_modules/tardis-dev/src/exchangedetails.ts +120 -0
  643. package/node_modules/tardis-dev/src/filter.ts +69 -0
  644. package/node_modules/tardis-dev/src/foreachconcurrent.ts +29 -0
  645. package/node_modules/tardis-dev/src/handy.ts +880 -0
  646. package/node_modules/tardis-dev/src/index.ts +16 -0
  647. package/node_modules/tardis-dev/src/instrumentinfo.ts +197 -0
  648. package/node_modules/tardis-dev/src/mappers/ascendex.ts +210 -0
  649. package/node_modules/tardis-dev/src/mappers/binance.ts +598 -0
  650. package/node_modules/tardis-dev/src/mappers/binancedex.ts +180 -0
  651. package/node_modules/tardis-dev/src/mappers/binanceeuropeanoptions.ts +624 -0
  652. package/node_modules/tardis-dev/src/mappers/bitfinex.ts +472 -0
  653. package/node_modules/tardis-dev/src/mappers/bitflyer.ts +199 -0
  654. package/node_modules/tardis-dev/src/mappers/bitget.ts +490 -0
  655. package/node_modules/tardis-dev/src/mappers/bitmex.ts +359 -0
  656. package/node_modules/tardis-dev/src/mappers/bitnomial.ts +134 -0
  657. package/node_modules/tardis-dev/src/mappers/bitstamp.ts +219 -0
  658. package/node_modules/tardis-dev/src/mappers/blockchaincom.ts +106 -0
  659. package/node_modules/tardis-dev/src/mappers/bullish.ts +392 -0
  660. package/node_modules/tardis-dev/src/mappers/bybit.ts +947 -0
  661. package/node_modules/tardis-dev/src/mappers/bybitspot.ts +129 -0
  662. package/node_modules/tardis-dev/src/mappers/coinbase.ts +259 -0
  663. package/node_modules/tardis-dev/src/mappers/coinbaseinternational.ts +338 -0
  664. package/node_modules/tardis-dev/src/mappers/coinflex.ts +175 -0
  665. package/node_modules/tardis-dev/src/mappers/cryptocom.ts +504 -0
  666. package/node_modules/tardis-dev/src/mappers/cryptofacilities.ts +319 -0
  667. package/node_modules/tardis-dev/src/mappers/delta.ts +315 -0
  668. package/node_modules/tardis-dev/src/mappers/deribit.ts +406 -0
  669. package/node_modules/tardis-dev/src/mappers/dydx.ts +330 -0
  670. package/node_modules/tardis-dev/src/mappers/dydxv4.ts +349 -0
  671. package/node_modules/tardis-dev/src/mappers/ftx.ts +307 -0
  672. package/node_modules/tardis-dev/src/mappers/gateio.ts +543 -0
  673. package/node_modules/tardis-dev/src/mappers/gateiofutures.ts +290 -0
  674. package/node_modules/tardis-dev/src/mappers/gemini.ts +225 -0
  675. package/node_modules/tardis-dev/src/mappers/hitbtc.ts +124 -0
  676. package/node_modules/tardis-dev/src/mappers/huobi.ts +815 -0
  677. package/node_modules/tardis-dev/src/mappers/hyperliquid.ts +248 -0
  678. package/node_modules/tardis-dev/src/mappers/index.ts +140 -0
  679. package/node_modules/tardis-dev/src/mappers/kraken.ts +382 -0
  680. package/node_modules/tardis-dev/src/mappers/kucoin.ts +353 -0
  681. package/node_modules/tardis-dev/src/mappers/kucoinfutures.ts +508 -0
  682. package/node_modules/tardis-dev/src/mappers/lighter.ts +363 -0
  683. package/node_modules/tardis-dev/src/mappers/mapper.ts +163 -0
  684. package/node_modules/tardis-dev/src/mappers/mexc.ts +324 -0
  685. package/node_modules/tardis-dev/src/mappers/mexcfutures.ts +352 -0
  686. package/node_modules/tardis-dev/src/mappers/okex.ts +1362 -0
  687. package/node_modules/tardis-dev/src/mappers/okexspreads.ts +172 -0
  688. package/node_modules/tardis-dev/src/mappers/phemex.ts +562 -0
  689. package/node_modules/tardis-dev/src/mappers/poloniex.ts +304 -0
  690. package/node_modules/tardis-dev/src/mappers/polymarket.ts +204 -0
  691. package/node_modules/tardis-dev/src/mappers/registry.ts +203 -0
  692. package/node_modules/tardis-dev/src/mappers/serum.ts +196 -0
  693. package/node_modules/tardis-dev/src/mappers/upbit.ts +117 -0
  694. package/node_modules/tardis-dev/src/mappers/woox.ts +700 -0
  695. package/node_modules/tardis-dev/src/okexsymbols.ts +10 -0
  696. package/node_modules/tardis-dev/src/options.ts +36 -0
  697. package/node_modules/tardis-dev/src/orderbook.ts +169 -0
  698. package/node_modules/tardis-dev/src/priceleveltree.ts +188 -0
  699. package/node_modules/tardis-dev/src/realtimefeeds/binance.ts +577 -0
  700. package/node_modules/tardis-dev/src/realtimefeeds/binancedex.ts +64 -0
  701. package/node_modules/tardis-dev/src/realtimefeeds/binanceeuropeanoptions.ts +132 -0
  702. package/node_modules/tardis-dev/src/realtimefeeds/bitfinex.ts +83 -0
  703. package/node_modules/tardis-dev/src/realtimefeeds/bitflyer.ts +41 -0
  704. package/node_modules/tardis-dev/src/realtimefeeds/bitget.ts +76 -0
  705. package/node_modules/tardis-dev/src/realtimefeeds/bitmex.ts +42 -0
  706. package/node_modules/tardis-dev/src/realtimefeeds/bitnomial.ts +60 -0
  707. package/node_modules/tardis-dev/src/realtimefeeds/bitstamp.ts +70 -0
  708. package/node_modules/tardis-dev/src/realtimefeeds/blockchaincom.ts +44 -0
  709. package/node_modules/tardis-dev/src/realtimefeeds/bullish.ts +140 -0
  710. package/node_modules/tardis-dev/src/realtimefeeds/bybit.ts +123 -0
  711. package/node_modules/tardis-dev/src/realtimefeeds/coinbase.ts +112 -0
  712. package/node_modules/tardis-dev/src/realtimefeeds/coinbaseinternational.ts +60 -0
  713. package/node_modules/tardis-dev/src/realtimefeeds/coinflex.ts +29 -0
  714. package/node_modules/tardis-dev/src/realtimefeeds/cryptocom.ts +49 -0
  715. package/node_modules/tardis-dev/src/realtimefeeds/cryptofacilities.ts +30 -0
  716. package/node_modules/tardis-dev/src/realtimefeeds/delta.ts +35 -0
  717. package/node_modules/tardis-dev/src/realtimefeeds/deribit.ts +95 -0
  718. package/node_modules/tardis-dev/src/realtimefeeds/dydx.ts +40 -0
  719. package/node_modules/tardis-dev/src/realtimefeeds/dydx_v4.ts +39 -0
  720. package/node_modules/tardis-dev/src/realtimefeeds/ftx.ts +137 -0
  721. package/node_modules/tardis-dev/src/realtimefeeds/gateio.ts +46 -0
  722. package/node_modules/tardis-dev/src/realtimefeeds/gateiofutures.ts +91 -0
  723. package/node_modules/tardis-dev/src/realtimefeeds/gemini.ts +38 -0
  724. package/node_modules/tardis-dev/src/realtimefeeds/hitbtc.ts +65 -0
  725. package/node_modules/tardis-dev/src/realtimefeeds/huobi.ts +435 -0
  726. package/node_modules/tardis-dev/src/realtimefeeds/hyperliquid.ts +41 -0
  727. package/node_modules/tardis-dev/src/realtimefeeds/index.ts +145 -0
  728. package/node_modules/tardis-dev/src/realtimefeeds/kraken.ts +48 -0
  729. package/node_modules/tardis-dev/src/realtimefeeds/kucoin.ts +80 -0
  730. package/node_modules/tardis-dev/src/realtimefeeds/kucoinfutures.ts +139 -0
  731. package/node_modules/tardis-dev/src/realtimefeeds/lighter.ts +31 -0
  732. package/node_modules/tardis-dev/src/realtimefeeds/mango.ts +5 -0
  733. package/node_modules/tardis-dev/src/realtimefeeds/mexc.ts +327 -0
  734. package/node_modules/tardis-dev/src/realtimefeeds/mexcfutures.ts +269 -0
  735. package/node_modules/tardis-dev/src/realtimefeeds/okex.ts +189 -0
  736. package/node_modules/tardis-dev/src/realtimefeeds/okexspreads.ts +64 -0
  737. package/node_modules/tardis-dev/src/realtimefeeds/phemex.ts +52 -0
  738. package/node_modules/tardis-dev/src/realtimefeeds/poloniex.ts +34 -0
  739. package/node_modules/tardis-dev/src/realtimefeeds/polymarket.ts +112 -0
  740. package/node_modules/tardis-dev/src/realtimefeeds/realtimefeed.ts +561 -0
  741. package/node_modules/tardis-dev/src/realtimefeeds/serum.ts +67 -0
  742. package/node_modules/tardis-dev/src/realtimefeeds/staratlas.ts +5 -0
  743. package/node_modules/tardis-dev/src/realtimefeeds/upbit.ts +35 -0
  744. package/node_modules/tardis-dev/src/realtimefeeds/woox.ts +110 -0
  745. package/node_modules/tardis-dev/src/realtimeiterator.ts +124 -0
  746. package/node_modules/tardis-dev/src/replay.ts +616 -0
  747. package/node_modules/tardis-dev/src/stream.ts +186 -0
  748. package/node_modules/tardis-dev/src/types.ts +178 -0
  749. package/node_modules/tardis-dev/src/worker.ts +221 -0
  750. package/node_modules/uWebSockets.js/ESM_wrapper.mjs +53 -0
  751. package/node_modules/uWebSockets.js/LICENSE +201 -0
  752. package/node_modules/uWebSockets.js/README.md +6 -0
  753. package/node_modules/uWebSockets.js/index.d.ts +468 -0
  754. package/node_modules/uWebSockets.js/package.json +12 -0
  755. package/node_modules/uWebSockets.js/source_commit +1 -0
  756. package/node_modules/uWebSockets.js/uws.js +76 -0
  757. package/node_modules/uWebSockets.js/uws_darwin_arm64_127.node +0 -0
  758. package/node_modules/uWebSockets.js/uws_darwin_arm64_137.node +0 -0
  759. package/node_modules/uWebSockets.js/uws_darwin_arm64_147.node +0 -0
  760. package/node_modules/uWebSockets.js/uws_darwin_x64_127.node +0 -0
  761. package/node_modules/uWebSockets.js/uws_darwin_x64_137.node +0 -0
  762. package/node_modules/uWebSockets.js/uws_darwin_x64_147.node +0 -0
  763. package/node_modules/uWebSockets.js/uws_linux_arm64_127.node +0 -0
  764. package/node_modules/uWebSockets.js/uws_linux_arm64_137.node +0 -0
  765. package/node_modules/uWebSockets.js/uws_linux_arm64_147.node +0 -0
  766. package/node_modules/uWebSockets.js/uws_linux_x64_127.node +0 -0
  767. package/node_modules/uWebSockets.js/uws_linux_x64_137.node +0 -0
  768. package/node_modules/uWebSockets.js/uws_linux_x64_147.node +0 -0
  769. package/node_modules/uWebSockets.js/uws_win32_x64_127.node +0 -0
  770. package/node_modules/uWebSockets.js/uws_win32_x64_137.node +0 -0
  771. package/node_modules/uWebSockets.js/uws_win32_x64_147.node +0 -0
  772. package/node_modules/ws/LICENSE +20 -0
  773. package/node_modules/ws/README.md +548 -0
  774. package/node_modules/ws/browser.js +8 -0
  775. package/node_modules/ws/index.js +22 -0
  776. package/node_modules/ws/lib/buffer-util.js +131 -0
  777. package/node_modules/ws/lib/constants.js +19 -0
  778. package/node_modules/ws/lib/event-target.js +292 -0
  779. package/node_modules/ws/lib/extension.js +203 -0
  780. package/node_modules/ws/lib/limiter.js +55 -0
  781. package/node_modules/ws/lib/permessage-deflate.js +528 -0
  782. package/node_modules/ws/lib/receiver.js +743 -0
  783. package/node_modules/ws/lib/sender.js +607 -0
  784. package/node_modules/ws/lib/stream.js +161 -0
  785. package/node_modules/ws/lib/subprotocol.js +62 -0
  786. package/node_modules/ws/lib/validation.js +152 -0
  787. package/node_modules/ws/lib/websocket-server.js +562 -0
  788. package/node_modules/ws/lib/websocket.js +1407 -0
  789. package/node_modules/ws/package.json +74 -0
  790. package/node_modules/ws/wrapper.mjs +21 -0
  791. package/package.json +8 -20
  792. package/src/tardismachine.ts +15 -7
@@ -0,0 +1,423 @@
1
+ import dbg from 'debug';
2
+ import WebSocket, { createWebSocketStream } from 'ws';
3
+ import { PassThrough } from 'stream';
4
+ import { setTimeout as sleep } from 'node:timers/promises';
5
+ import { getProxyAgent, ONE_SEC_IN_MS, optimizeFilters } from "../handy.js";
6
+ import { createManagedRealTimeIterator, mergeRealTime } from "../realtimeiterator.js";
7
+ let connectionCounter = 1;
8
+ const ABORTED = Symbol('aborted');
9
+ export class RealTimeFeedBase {
10
+ _exchange;
11
+ _timeoutIntervalMS;
12
+ _onError;
13
+ [Symbol.asyncIterator]() {
14
+ return createManagedRealTimeIterator(this._stream(), () => this._close());
15
+ }
16
+ debug;
17
+ throttleSubscribeMS = 0;
18
+ manualSnapshotsBuffer = [];
19
+ _filters;
20
+ _wsClientOptions;
21
+ _closed = false;
22
+ _closeController = new AbortController();
23
+ _connection;
24
+ originHeader = undefined;
25
+ extraHeaders = undefined;
26
+ constructor(_exchange, filters, _timeoutIntervalMS, _onError) {
27
+ this._exchange = _exchange;
28
+ this._timeoutIntervalMS = _timeoutIntervalMS;
29
+ this._onError = _onError;
30
+ this._filters = optimizeFilters(filters);
31
+ this.debug = dbg(`tardis-dev:realtime:${_exchange}`);
32
+ this._wsClientOptions = {
33
+ headers: {
34
+ 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36'
35
+ },
36
+ perMessageDeflate: false,
37
+ handshakeTimeout: 10 * ONE_SEC_IN_MS,
38
+ skipUTF8Validation: true
39
+ };
40
+ }
41
+ async getWebSocketUrl() {
42
+ const wssUrlOverride = process.env[`WSS_URL_${this._exchange.toUpperCase().replace(/-/g, '_')}`];
43
+ const finalWssUrl = wssUrlOverride !== undefined ? wssUrlOverride : this.wssURL;
44
+ return finalWssUrl;
45
+ }
46
+ _close() {
47
+ if (this._closed) {
48
+ return;
49
+ }
50
+ this._closed = true;
51
+ this._closeController.abort();
52
+ this._closeConnection(this._connection);
53
+ }
54
+ async *_stream() {
55
+ let retries = 0;
56
+ while (this._closed === false) {
57
+ const connectionId = connectionCounter++;
58
+ let connection;
59
+ let staleConnectionTimerId;
60
+ let pingTimerId;
61
+ let connectionError;
62
+ try {
63
+ this.manualSnapshotsBuffer.length = 0;
64
+ const subscribeMessages = this.mapToSubscribeMessages(this._filters);
65
+ const finalWssUrl = await resolveOrAbort(this.getWebSocketUrl(), this._closeController.signal);
66
+ if (finalWssUrl === ABORTED || this._closed) {
67
+ return;
68
+ }
69
+ this.debug('(connection id: %d) estabilishing connection to %s', connectionId, finalWssUrl);
70
+ this.debug('(connection id: %d) provided filters: %o mapped to subscribe messages: %j', connectionId, this._filters, subscribeMessages);
71
+ if (this.originHeader !== undefined) {
72
+ ;
73
+ this._wsClientOptions.headers['origin'] = this.originHeader;
74
+ }
75
+ if (this.extraHeaders !== undefined) {
76
+ Object.assign(this._wsClientOptions.headers, this.extraHeaders);
77
+ }
78
+ this._wsClientOptions.agent = getProxyAgent(finalWssUrl);
79
+ const ws = new WebSocket(finalWssUrl, this._wsClientOptions);
80
+ const currentConnection = {
81
+ id: connectionId,
82
+ ws,
83
+ controller: new AbortController(),
84
+ receivedMessagesCount: 0
85
+ };
86
+ connection = currentConnection;
87
+ this._connection = currentConnection;
88
+ ws.onopen = () => this._onConnectionOpen(currentConnection, subscribeMessages);
89
+ ws.onclose = (event) => this._onConnectionClosed(currentConnection, event);
90
+ staleConnectionTimerId = this._monitorConnectionIfStale(currentConnection);
91
+ pingTimerId = this._sendPeriodicPing(currentConnection);
92
+ const realtimeMessagesStream = createWebSocketStream(ws, {
93
+ readableObjectMode: true, // othwerwise we may end up with multiple messages returned by stream in single iteration
94
+ readableHighWaterMark: 8096 // since we're in object mode, let's increase hwm a little from default of 16 messages buffered
95
+ });
96
+ for await (let message of realtimeMessagesStream) {
97
+ if (this._isConnectionActive(currentConnection) === false) {
98
+ return;
99
+ }
100
+ if (this.decompress !== undefined) {
101
+ message = this.decompress(message);
102
+ }
103
+ // hack to handle huobi long numeric id for trades
104
+ if (this._exchange.startsWith('huobi-') && message.includes('.trade.detail')) {
105
+ message = message.toString().replace(/"id":([0-9]+),/g, '"id":"$1",');
106
+ }
107
+ const messageDeserialized = this.parseMessage(message);
108
+ if (this.messageIsError(messageDeserialized)) {
109
+ if (this.isIgnoredError(messageDeserialized)) {
110
+ if (this._onError !== undefined) {
111
+ this.debug(`Received ignored error message: ${message.toString()}`);
112
+ }
113
+ }
114
+ else {
115
+ throw new Error(`Received error message: ${message.toString()}`);
116
+ }
117
+ }
118
+ // exclude heaartbeat messages from received messages counter
119
+ // connection could still be stale even if only heartbeats are provided without any data
120
+ if (this.messageIsHeartbeat(messageDeserialized) === false) {
121
+ currentConnection.receivedMessagesCount++;
122
+ }
123
+ this.onMessage(messageDeserialized);
124
+ yield messageDeserialized;
125
+ if (retries > 0) {
126
+ // reset retries counter as we've received correct message from the connection
127
+ retries = 0;
128
+ }
129
+ if (this.manualSnapshotsBuffer.length > 0) {
130
+ for (let snapshot of this.manualSnapshotsBuffer) {
131
+ yield snapshot;
132
+ }
133
+ this.manualSnapshotsBuffer.length = 0;
134
+ }
135
+ }
136
+ if (this._closed) {
137
+ return;
138
+ }
139
+ }
140
+ catch (error) {
141
+ if (this._closed) {
142
+ return;
143
+ }
144
+ connectionError = error instanceof Error ? error : new Error(String(error));
145
+ }
146
+ finally {
147
+ if (staleConnectionTimerId !== undefined) {
148
+ clearInterval(staleConnectionTimerId);
149
+ }
150
+ if (pingTimerId !== undefined) {
151
+ clearInterval(pingTimerId);
152
+ }
153
+ this._closeConnection(connection);
154
+ }
155
+ if (this._closed) {
156
+ return;
157
+ }
158
+ let retryDelay;
159
+ if (connectionError !== undefined) {
160
+ this._onError?.(connectionError);
161
+ retries++;
162
+ const MAX_DELAY = 32 * 1000;
163
+ const isRateLimited = connectionError.message.includes('429');
164
+ retryDelay = isRateLimited ? (MAX_DELAY / 2) * retries : Math.min(Math.pow(2, retries - 1) * 1000, MAX_DELAY);
165
+ this.debug('(connection id: %d) %s real-time feed connection error, retries count: %d, next retry delay: %dms, rate limited: %s error message: %o', connectionId, this._exchange, retries, retryDelay, isRateLimited, connectionError);
166
+ }
167
+ yield { __disconnect__: true };
168
+ if (retryDelay !== undefined) {
169
+ await this._wait(retryDelay, this._closeController.signal);
170
+ }
171
+ }
172
+ }
173
+ send(msg) {
174
+ const ws = this._connection?.ws;
175
+ if (ws === undefined || ws.readyState !== WebSocket.OPEN) {
176
+ return;
177
+ }
178
+ ws.send(JSON.stringify(msg));
179
+ }
180
+ sendRaw(msg) {
181
+ const ws = this._connection?.ws;
182
+ if (ws === undefined || ws.readyState !== WebSocket.OPEN) {
183
+ return;
184
+ }
185
+ ws.send(msg);
186
+ }
187
+ parseMessage(message) {
188
+ return JSON.parse(message);
189
+ }
190
+ sendCustomPing = undefined;
191
+ isIgnoredError(_message) {
192
+ return false;
193
+ }
194
+ messageIsHeartbeat(_msg) {
195
+ return false;
196
+ }
197
+ async provideManualSnapshots(_filters, _shouldCancel) { }
198
+ onMessage(_msg) { }
199
+ async onConnected() { }
200
+ decompress;
201
+ _monitorConnectionIfStale(connection) {
202
+ if (this._timeoutIntervalMS === undefined || this._timeoutIntervalMS === 0) {
203
+ return;
204
+ }
205
+ // set up timer that checks against open, but stale connections that do not return any data
206
+ return setInterval(() => {
207
+ if (this._isConnectionActive(connection) === false) {
208
+ return;
209
+ }
210
+ if (connection.receivedMessagesCount === 0) {
211
+ this.debug('(connection id: %d) did not received any messages within %d ms timeout, terminating connection...', connection.id, this._timeoutIntervalMS);
212
+ connection.ws.terminate();
213
+ }
214
+ connection.receivedMessagesCount = 0;
215
+ }, this._timeoutIntervalMS);
216
+ }
217
+ _sendPeriodicPing(connection) {
218
+ return setInterval(() => {
219
+ if (this._isConnectionOpen(connection) === false) {
220
+ return;
221
+ }
222
+ if (this.sendCustomPing !== undefined) {
223
+ this.sendCustomPing();
224
+ }
225
+ else {
226
+ connection.ws.ping();
227
+ }
228
+ }, 5 * ONE_SEC_IN_MS);
229
+ }
230
+ async _onConnectionEstablished(connection, subscribeMessages) {
231
+ const shouldCancel = () => this._isConnectionOpen(connection) === false;
232
+ try {
233
+ const symbolsCount = this._filters.reduce((prev, curr) => {
234
+ if (curr.symbols !== undefined) {
235
+ for (const symbol of curr.symbols) {
236
+ prev.add(symbol);
237
+ }
238
+ }
239
+ return prev;
240
+ }, new Set()).size;
241
+ await this.onConnected();
242
+ if (shouldCancel()) {
243
+ return;
244
+ }
245
+ for (const message of subscribeMessages) {
246
+ if (shouldCancel()) {
247
+ return;
248
+ }
249
+ this._send(connection, message);
250
+ if (this.throttleSubscribeMS > 0) {
251
+ await this._wait(this.throttleSubscribeMS, connection.controller.signal);
252
+ }
253
+ }
254
+ this.debug('(connection id: %d) established connection', connection.id);
255
+ //wait before fetching snapshots until we're sure we've got proper connection estabilished (received some messages)
256
+ while (shouldCancel() === false && connection.receivedMessagesCount < symbolsCount * 2) {
257
+ await this._wait(100, connection.controller.signal);
258
+ }
259
+ if (shouldCancel()) {
260
+ return;
261
+ }
262
+ // wait a second just in case before starting fetching the snapshots
263
+ await this._wait(1 * ONE_SEC_IN_MS, connection.controller.signal);
264
+ if (shouldCancel()) {
265
+ return;
266
+ }
267
+ await this.provideManualSnapshots(this._filters, shouldCancel);
268
+ }
269
+ catch (e) {
270
+ this.debug('(connection id: %d) providing manual snapshots error: %o', connection.id, e);
271
+ if (this._isConnectionOpen(connection)) {
272
+ connection.ws.emit('error', e);
273
+ }
274
+ }
275
+ }
276
+ _onConnectionClosed(connection, event) {
277
+ this.debug('(connection id: %d) connection closed %s', connection.id, event.reason);
278
+ }
279
+ _onConnectionOpen(connection, subscribeMessages) {
280
+ if (this._isConnectionActive(connection) === false) {
281
+ return;
282
+ }
283
+ void this._onConnectionEstablished(connection, subscribeMessages);
284
+ }
285
+ _send(connection, message) {
286
+ if (this._isConnectionOpen(connection)) {
287
+ connection.ws.send(JSON.stringify(message));
288
+ }
289
+ }
290
+ _isConnectionActive(connection) {
291
+ return this._closed === false && this._connection === connection && connection.controller.signal.aborted === false;
292
+ }
293
+ _isConnectionOpen(connection) {
294
+ return this._isConnectionActive(connection) && connection.ws.readyState === WebSocket.OPEN;
295
+ }
296
+ _closeConnection(connection) {
297
+ if (connection === undefined) {
298
+ return;
299
+ }
300
+ connection.controller.abort();
301
+ if (connection.ws.readyState !== WebSocket.CLOSED) {
302
+ connection.ws.terminate();
303
+ }
304
+ if (this._connection === connection) {
305
+ this._connection = undefined;
306
+ this.manualSnapshotsBuffer.length = 0;
307
+ }
308
+ }
309
+ async _wait(delayMS, signal) {
310
+ try {
311
+ await sleep(delayMS, undefined, { signal });
312
+ }
313
+ catch (error) {
314
+ if (signal.aborted === false) {
315
+ throw error;
316
+ }
317
+ }
318
+ }
319
+ }
320
+ function resolveOrAbort(promise, signal) {
321
+ if (signal.aborted) {
322
+ return Promise.resolve(ABORTED);
323
+ }
324
+ return new Promise((resolve, reject) => {
325
+ let settled = false;
326
+ const onAbort = () => settle(() => resolve(ABORTED));
327
+ const settle = (callback) => {
328
+ if (settled) {
329
+ return;
330
+ }
331
+ settled = true;
332
+ signal.removeEventListener('abort', onAbort);
333
+ callback();
334
+ };
335
+ signal.addEventListener('abort', onAbort, { once: true });
336
+ void promise.then((value) => settle(() => resolve(value)), (error) => settle(() => reject(error)));
337
+ });
338
+ }
339
+ export class MultiConnectionRealTimeFeedBase {
340
+ _exchange;
341
+ _filters;
342
+ _timeoutIntervalMS;
343
+ _onError;
344
+ constructor(_exchange, _filters, _timeoutIntervalMS, _onError) {
345
+ this._exchange = _exchange;
346
+ this._filters = _filters;
347
+ this._timeoutIntervalMS = _timeoutIntervalMS;
348
+ this._onError = _onError;
349
+ }
350
+ [Symbol.asyncIterator]() {
351
+ const realTimeFeeds = Array.from(this._getRealTimeFeeds(this._exchange, this._filters, this._timeoutIntervalMS, this._onError));
352
+ return mergeRealTime(realTimeFeeds);
353
+ }
354
+ }
355
+ export class PoolingClientBase {
356
+ _poolingIntervalSeconds;
357
+ onError;
358
+ debug;
359
+ _tid = undefined;
360
+ _outputStream;
361
+ constructor(exchange, _poolingIntervalSeconds, onError) {
362
+ this._poolingIntervalSeconds = _poolingIntervalSeconds;
363
+ this.onError = onError;
364
+ this.debug = dbg(`tardis-dev:pooling-client:${exchange}`);
365
+ }
366
+ [Symbol.asyncIterator]() {
367
+ return createManagedRealTimeIterator(this._stream(), () => this._close());
368
+ }
369
+ getPoolingDelayMS() {
370
+ return this._poolingIntervalSeconds * ONE_SEC_IN_MS;
371
+ }
372
+ _close() {
373
+ if (this._tid !== undefined) {
374
+ clearTimeout(this._tid);
375
+ this._tid = undefined;
376
+ }
377
+ this._outputStream?.destroy();
378
+ }
379
+ async _startPooling(outputStream) {
380
+ const pool = async () => {
381
+ try {
382
+ await this.poolDataToStream(outputStream);
383
+ }
384
+ catch (e) {
385
+ const error = e instanceof Error ? e : new Error(String(e));
386
+ this.debug('pooling error %o', error);
387
+ if (this.onError !== undefined) {
388
+ this.onError(error);
389
+ }
390
+ }
391
+ };
392
+ const poolAndSchedule = () => {
393
+ pool().then(() => {
394
+ if (!outputStream.destroyed) {
395
+ this._tid = setTimeout(poolAndSchedule, this.getPoolingDelayMS());
396
+ }
397
+ });
398
+ };
399
+ poolAndSchedule();
400
+ }
401
+ async *_stream() {
402
+ const stream = new PassThrough({
403
+ objectMode: true,
404
+ highWaterMark: 1024
405
+ });
406
+ this._outputStream = stream;
407
+ this._startPooling(stream);
408
+ this.debug('pooling started');
409
+ try {
410
+ for await (const message of stream) {
411
+ yield message;
412
+ }
413
+ }
414
+ finally {
415
+ this._close();
416
+ if (this._outputStream === stream) {
417
+ this._outputStream = undefined;
418
+ }
419
+ this.debug('pooling finished');
420
+ }
421
+ }
422
+ }
423
+ //# sourceMappingURL=realtimefeed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtimefeed.js","sourceRoot":"","sources":["../../src/realtimefeeds/realtimefeed.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAA;AACvB,OAAO,SAAS,EAAE,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAA;AAErD,OAAO,EAAE,WAAW,EAAY,MAAM,QAAQ,CAAA;AAC9C,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAgC,MAAM,wBAAwB,CAAA;AAYnH,IAAI,iBAAiB,GAAG,CAAC,CAAA;AAWzB,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AAEjC,MAAM,OAAgB,gBAAgB;IAkBf;IAEF;IACA;IApBnB,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAC3E,CAAC;IAEkB,KAAK,CAAc;IAEnB,mBAAmB,GAA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eed extends RealTimeFeedBase {
4
+ protected wssURL: string;
5
+ protected channelMappings: {
6
+ trades: string[];
7
+ level1: string[];
8
+ level2: string[];
9
+ level3: string[];
10
+ };
11
+ protected mapToSubscribeMessages(filters: Filter<string>[]): any[];
12
+ protected messageIsError(message: any): boolean;
13
+ }
14
+ //# sourceMappingURL=serum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serum.d.ts","sourceRoot":"","sources":["../../src/realtimefeeds/serum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,SAAS,CAAC,MAAM,SAAmC;IAEnD,SAAS,CAAC,eAAe;;;;;MAKxB;IAED,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE;IAkDlE,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;CAGhD"}
@@ -0,0 +1,58 @@
1
+ import { RealTimeFeedBase } from "./realtimefeed.js";
2
+ export class SerumRealTimeFeed extends RealTimeFeedBase {
3
+ wssURL = 'wss://api.serum-vial.dev/v1/ws';
4
+ channelMappings = {
5
+ trades: ['recent_trades', 'trade'],
6
+ level1: ['quote'],
7
+ level2: ['l2snapshot', 'l2update'],
8
+ level3: ['l3snapshot', 'open', 'fill', 'change', 'done']
9
+ };
10
+ mapToSubscribeMessages(filters) {
11
+ const subs = filters
12
+ .map((filter) => {
13
+ if (!filter.symbols || filter.symbols.length === 0) {
14
+ throw new Error('SerumRealTimeFeed requires explicitly specified symbols when subscribing to live feed');
15
+ }
16
+ const subscribeToL3Channel = filters.filter((f) => this.channelMappings.level3.includes(f.channel)).length > 0;
17
+ const subscribeToL2Channel = this.channelMappings.level2.includes(filter.channel);
18
+ const subscribeToL1Channel = this.channelMappings.level1.includes(filter.channel);
19
+ let channel;
20
+ if (subscribeToL3Channel) {
21
+ channel = 'level3';
22
+ }
23
+ else if (subscribeToL2Channel) {
24
+ channel = 'level2';
25
+ }
26
+ else if (subscribeToL1Channel) {
27
+ channel = 'level3';
28
+ }
29
+ else {
30
+ channel = 'trades';
31
+ }
32
+ return {
33
+ op: 'subscribe',
34
+ channel,
35
+ markets: filter.symbols
36
+ };
37
+ })
38
+ .reduce((prev, current) => {
39
+ const matchingExisting = prev.find((c) => c.channel === current.channel);
40
+ if (matchingExisting !== undefined) {
41
+ for (const market of current.markets) {
42
+ if (matchingExisting.markets.includes(market) === false) {
43
+ matchingExisting.markets.push(market);
44
+ }
45
+ }
46
+ }
47
+ else {
48
+ prev.push(current);
49
+ }
50
+ return prev;
51
+ }, []);
52
+ return subs;
53
+ }
54
+ messageIsError(message) {
55
+ return message.type === 'error';
56
+ }
57
+ }
58
+ //# sourceMappingURL=serum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serum.js","sourceRoot":"","sources":["../../src/realtimefeeds/serum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IAC3C,MAAM,GAAG,gCAAgC,CAAA;IAEzC,eAAe,GAAG;QAC1B,MAAM,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC;QAClC,MAAM,EAAE,CAAC,OAAO,CAAC;QACjB,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;QAClC,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC;KACzD,CAAA;IAES,sBAAsB,CAAC,OAAyB;QACxD,MAAM,IAAI,GAAG,OAAO;aACjB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CA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AO,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC;wBACxD,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;oBACvC,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACpB,CAAC;YAED,OAAO,IAAI,CAAA;QACb,CAAC,EACD,EAA8C,CAC/C,CAAA;QAEH,OAAO,IAAI,CAAA;IACb,CAAC;IAES,cAAc,CAAC,OAAY;QACnC,OAAO,OAAO,CAAC,IAAI,KAAK,OAAO,CAAA;IACjC,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import { SerumRealTimeFeed } from './serum.ts';
2
+ export declare class StarAtlasRealTimeFeed extends SerumRealTimeFeed {
3
+ protected wssURL: string;
4
+ }
5
+ //# sourceMappingURL=staratlas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staratlas.d.ts","sourceRoot":"","sources":["../../src/realtimefeeds/staratlas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,qBAAa,qBAAsB,SAAQ,iBAAiB;IAC1D,SAAS,CAAC,MAAM,SAA2C;CAC5D"}
@@ -0,0 +1,5 @@
1
+ import { SerumRealTimeFeed } from "./serum.js";
2
+ export class StarAtlasRealTimeFeed extends SerumRealTimeFeed {
3
+ wssURL = 'wss://serum-vial.staratlas.cloud/v1/ws';
4
+ }
5
+ //# sourceMappingURL=staratlas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staratlas.js","sourceRoot":"","sources":["../../src/realtimefeeds/staratlas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,OAAO,qBAAsB,SAAQ,iBAAiB;IAChD,MAAM,GAAG,wCAAwC,CAAA;CAC5D"}
@@ -0,0 +1,8 @@
1
+ import { Filter } from '../types.ts';
2
+ import { RealTimeFeedBase } from './realtimefeed.ts';
3
+ export declare class UpbitRealTimeFeed extends RealTimeFeedBase {
4
+ protected readonly wssURL = "wss://api.upbit.com/websocket/v1";
5
+ protected mapToSubscribeMessages(filters: Filter<string>[]): any[];
6
+ protected messageIsError(message: any): boolean;
7
+ }
8
+ //# sourceMappingURL=upbit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upbit.d.ts","sourceRoot":"","sources":["../../src/realtimefeeds/upbit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,SAAS,CAAC,QAAQ,CAAC,MAAM,sCAAqC;IAE9D,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE;IAyBlE,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;CAGhD"}
@@ -0,0 +1,29 @@
1
+ import { RealTimeFeedBase } from "./realtimefeed.js";
2
+ export class UpbitRealTimeFeed extends RealTimeFeedBase {
3
+ wssURL = 'wss://api.upbit.com/websocket/v1';
4
+ mapToSubscribeMessages(filters) {
5
+ const subs = filters.map((filter) => {
6
+ if (!filter.symbols || filter.symbols.length === 0) {
7
+ throw new Error('UpbitRealTimeFeed requires explicitly specified symbols when subscribing to live feed');
8
+ }
9
+ return {
10
+ type: filter.channel,
11
+ codes: filter.symbols,
12
+ isOnlyRealtime: true
13
+ };
14
+ });
15
+ const payload = [
16
+ [
17
+ {
18
+ ticket: new Date().valueOf().toString()
19
+ },
20
+ ...subs
21
+ ]
22
+ ];
23
+ return payload;
24
+ }
25
+ messageIsError(message) {
26
+ return message.type === 'error';
27
+ }
28
+ }
29
+ //# sourceMappingURL=upbit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upbit.js","sourceRoot":"","sources":["../../src/realtimefeeds/upbit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IAClC,MAAM,GAAG,kCAAkC,CAAA;IAEpD,sBAAsB,CAAC,OAAyB;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnD,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAA;YAC1G,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,OAAO;gBACpB,KAAK,EAAE,MAAM,CAAC,OAAO;gBACrB,cAAc,EAAE,IAAI;aACrB,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,OAAO,GAAG;YACd;gBACE;oBACE,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;iBACxC;gBACD,GAAG,IAAI;aACR;SACF,CAAA;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;IAES,cAAc,CAAC,OAAY;QACnC,OAAO,OAAO,CAAC,IAAI,KAAK,OAAO,CAAA;IACjC,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Filter } from '../types.ts';
2
+ import { RealTimeFeedBase } from './realtimefeed.ts';
3
+ export declare class WooxRealTimeFeed extends RealTimeFeedBase {
4
+ protected wssURL: string;
5
+ protected readonly httpURL = "https://api.woox.io";
6
+ protected mapToSubscribeMessages(filters: Filter<string>[]): any[];
7
+ protected provideManualSnapshots(filters: Filter<string>[], shouldCancel: () => boolean): Promise<void>;
8
+ protected messageIsError(message: any): boolean;
9
+ protected messageIsHeartbeat(message: any): boolean;
10
+ protected onMessage(msg: any): void;
11
+ }
12
+ //# sourceMappingURL=woox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"woox.d.ts","sourceRoot":"","sources":["../../src/realtimefeeds/woox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAIpD,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,SAAS,CAAC,MAAM,SAAgC;IAChD,SAAS,CAAC,QAAQ,CAAC,OAAO,yBAAwB;IAElD,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE;cAwBlD,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO;IAiC7F,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAI/C,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAInD,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG;CAY7B"}