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,913 @@
1
+ import { asNonZeroNumberOrUndefined, upperCaseSymbols } from "../handy.js";
2
+ import { getOkexOptionsFamilyOrIndex, getOkexOptionsUnderlyingIndex } from "../okexsymbols.js";
3
+ import { PendingTickerInfoHelper } from "./mapper.js";
4
+ import { OkexSpreadsBookChangeMapper, OkexSpreadsBookTickerMapper, OkexSpreadsTradesMapper } from "./okexspreads.js";
5
+ import { exchangeMappers, mapper } from "./registry.js";
6
+ const OKEX_V5_API_SWITCH_DATE = new Date('2021-12-23T00:00:00.000Z');
7
+ const OKEX_V5_TBT_BOOK_TICKER_RELEASE_DATE = new Date('2022-05-06T00:00:00.000Z');
8
+ const OKX_PUBLIC_BOOKS_CHANNEL_START_DATE = new Date('2023-02-25T00:00:00.000Z');
9
+ const OKX_PUBLIC_BOOKS_CHANNEL_END_DATE = new Date('2023-03-09T00:00:00.000Z');
10
+ const OKEX_USDC_INDEX_SWITCH_DATE = new Date('2023-04-10T08:40:00.000Z');
11
+ const OKEX_PUBLIC_BOOKS_SWITCH_DATE = new Date('2026-05-21T00:00:00.000Z');
12
+ const OKEX_SPOT_DEPTH_L2_TBT_SWITCH_DATE = new Date('2020-04-10T00:00:00.000Z');
13
+ const OKEX_FUTURES_DEPTH_L2_TBT_SWITCH_DATE = new Date('2019-12-05T00:00:00.000Z');
14
+ const OKEX_SWAP_DEPTH_L2_TBT_SWITCH_DATE = new Date('2020-02-08T00:00:00.000Z');
15
+ const OKCOIN_DEPTH_L2_TBT_SWITCH_DATE = new Date('2020-02-13T00:00:00.000Z');
16
+ const OKCOIN_V5_API_SWITCH_DATE = new Date('2023-04-27T00:00:00.000Z');
17
+ const OKX_TRADES_ALL_CHANNEL_SWITCH_DATE = new Date('2023-10-19T00:00:00.000Z');
18
+ const useOKXTradesAllChannel = () => process.env.OKX_USE_TRADES_CHANNEL === undefined;
19
+ export const okexMappers = exchangeMappers({
20
+ okex: {
21
+ trades: okexTradesMapper('okex', { market: 'spot' }),
22
+ bookChanges: okexBookChangesMapper('okex', { market: 'spot', depthL2TbtSwitchDate: OKEX_SPOT_DEPTH_L2_TBT_SWITCH_DATE }),
23
+ bookTickers: okexBookTickersMapper('okex', { market: 'spot' })
24
+ },
25
+ 'okex-futures': {
26
+ trades: okexTradesMapper('okex-futures', { market: 'futures' }),
27
+ bookChanges: okexBookChangesMapper('okex-futures', {
28
+ market: 'futures',
29
+ depthL2TbtSwitchDate: OKEX_FUTURES_DEPTH_L2_TBT_SWITCH_DATE
30
+ }),
31
+ derivativeTickers: mapper([
32
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexDerivativeTickerMapper('okex-futures') },
33
+ {
34
+ until: OKEX_USDC_INDEX_SWITCH_DATE,
35
+ use: () => new OkexV5DerivativeTickerMapper('okex-futures', { useLegacyUSDCIndex: true })
36
+ },
37
+ { use: () => new OkexV5DerivativeTickerMapper('okex-futures', { useLegacyUSDCIndex: false }) }
38
+ ]),
39
+ liquidations: mapper([
40
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexLiquidationsMapper('okex-futures', { market: 'futures' }) },
41
+ { use: () => new OkexV5LiquidationsMapper('okex-futures') }
42
+ ]),
43
+ bookTickers: okexBookTickersMapper('okex-futures', { market: 'futures' })
44
+ },
45
+ 'okex-swap': {
46
+ trades: okexTradesMapper('okex-swap', { market: 'swap' }),
47
+ bookChanges: okexBookChangesMapper('okex-swap', { market: 'swap', depthL2TbtSwitchDate: OKEX_SWAP_DEPTH_L2_TBT_SWITCH_DATE }),
48
+ derivativeTickers: mapper([
49
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexDerivativeTickerMapper('okex-swap') },
50
+ {
51
+ until: OKEX_USDC_INDEX_SWITCH_DATE,
52
+ use: () => new OkexV5DerivativeTickerMapper('okex-swap', { useLegacyUSDCIndex: true })
53
+ },
54
+ { use: () => new OkexV5DerivativeTickerMapper('okex-swap', { useLegacyUSDCIndex: false }) }
55
+ ]),
56
+ liquidations: mapper([
57
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexLiquidationsMapper('okex-swap', { market: 'swap' }) },
58
+ { use: () => new OkexV5LiquidationsMapper('okex-swap') }
59
+ ]),
60
+ bookTickers: okexBookTickersMapper('okex-swap', { market: 'swap' })
61
+ },
62
+ 'okex-options': {
63
+ trades: okexTradesMapper('okex-options', { market: 'option' }),
64
+ bookChanges: okexBookChangesMapper('okex-options', { market: 'option', depthL2TbtSwitchDate: OKEX_SWAP_DEPTH_L2_TBT_SWITCH_DATE }),
65
+ optionsSummary: mapper([
66
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexOptionSummaryMapper() },
67
+ { use: () => new OkexV5OptionSummaryMapper() }
68
+ ]),
69
+ bookTickers: okexBookTickersMapper('okex-options', { market: 'option' })
70
+ },
71
+ okcoin: {
72
+ trades: mapper([
73
+ { until: OKCOIN_V5_API_SWITCH_DATE, use: () => new OkexTradesMapper('okcoin', { market: 'spot' }) },
74
+ { use: () => new OkexV5TradesMapper('okcoin', { useTradesAllChannel: false }) }
75
+ ]),
76
+ bookChanges: mapper([
77
+ {
78
+ until: OKCOIN_DEPTH_L2_TBT_SWITCH_DATE,
79
+ use: () => new OkexBookChangeMapper('okcoin', { market: 'spot', useTickByTickChannel: false })
80
+ },
81
+ {
82
+ until: OKCOIN_V5_API_SWITCH_DATE,
83
+ use: () => new OkexBookChangeMapper('okcoin', { market: 'spot', useTickByTickChannel: true })
84
+ },
85
+ { use: () => new OkexV5BookChangeMapper('okcoin', { allowPublicBooksChannel: true }) }
86
+ ]),
87
+ bookTickers: mapper([
88
+ { until: OKCOIN_V5_API_SWITCH_DATE, use: () => new OkexBookTickerMapper('okcoin', { market: 'spot' }) },
89
+ { use: () => new OkexV5BookTickerMapper('okcoin', { useTbtTickerChannel: true }) }
90
+ ])
91
+ },
92
+ 'okex-spreads': {
93
+ trades: () => new OkexSpreadsTradesMapper(),
94
+ bookChanges: () => new OkexSpreadsBookChangeMapper(),
95
+ bookTickers: () => new OkexSpreadsBookTickerMapper()
96
+ }
97
+ });
98
+ function okexTradesMapper(exchange, { market }) {
99
+ return mapper([
100
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexTradesMapper(exchange, { market }) },
101
+ { until: OKX_TRADES_ALL_CHANNEL_SWITCH_DATE, use: () => new OkexV5TradesMapper(exchange, { useTradesAllChannel: false }) },
102
+ { use: () => new OkexV5TradesMapper(exchange, { useTradesAllChannel: useOKXTradesAllChannel() }) }
103
+ ]);
104
+ }
105
+ function okexBookChangesMapper(exchange, { market, depthL2TbtSwitchDate }) {
106
+ return mapper([
107
+ { until: depthL2TbtSwitchDate, use: () => new OkexBookChangeMapper(exchange, { market, useTickByTickChannel: false }) },
108
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexBookChangeMapper(exchange, { market, useTickByTickChannel: true }) },
109
+ { until: OKX_PUBLIC_BOOKS_CHANNEL_START_DATE, use: () => new OkexV5BookChangeMapper(exchange, { allowPublicBooksChannel: false }) },
110
+ { until: OKX_PUBLIC_BOOKS_CHANNEL_END_DATE, use: () => new OkexV5BookChangeMapper(exchange, { allowPublicBooksChannel: true }) },
111
+ { until: OKEX_PUBLIC_BOOKS_SWITCH_DATE, use: () => new OkexV5BookChangeMapper(exchange, { allowPublicBooksChannel: false }) },
112
+ { use: () => new OkexV5BookChangeMapper(exchange, { allowPublicBooksChannel: true }) }
113
+ ]);
114
+ }
115
+ function okexBookTickersMapper(exchange, { market }) {
116
+ return mapper([
117
+ { until: OKEX_V5_API_SWITCH_DATE, use: () => new OkexBookTickerMapper(exchange, { market }) },
118
+ { until: OKEX_V5_TBT_BOOK_TICKER_RELEASE_DATE, use: () => new OkexV5BookTickerMapper(exchange, { useTbtTickerChannel: false }) },
119
+ { use: () => new OkexV5BookTickerMapper(exchange, { useTbtTickerChannel: true }) }
120
+ ]);
121
+ }
122
+ // V5 Okex API mappers
123
+ // https://www.okex.com/docs-v5/en/#websocket-api-public-channel-trades-channel
124
+ class OkexV5TradesMapper {
125
+ _exchange;
126
+ _useTradesAll;
127
+ constructor(_exchange, { useTradesAllChannel }) {
128
+ this._exchange = _exchange;
129
+ this._useTradesAll = useTradesAllChannel;
130
+ }
131
+ canHandle(message) {
132
+ if (message.event !== undefined || message.arg === undefined) {
133
+ return false;
134
+ }
135
+ return message.arg.channel === 'trades' || message.arg.channel === 'trades-all';
136
+ }
137
+ getFilters(symbols) {
138
+ symbols = upperCaseSymbols(symbols);
139
+ if (this._useTradesAll) {
140
+ return [
141
+ {
142
+ channel: `trades-all`,
143
+ symbols
144
+ }
145
+ ];
146
+ }
147
+ return [
148
+ {
149
+ channel: `trades`,
150
+ symbols
151
+ }
152
+ ];
153
+ }
154
+ *map(okexTradesMessage, localTimestamp) {
155
+ for (const okexTrade of okexTradesMessage.data) {
156
+ yield {
157
+ type: 'trade',
158
+ symbol: okexTrade.instId,
159
+ exchange: this._exchange,
160
+ id: okexTrade.tradeId,
161
+ price: Number(okexTrade.px),
162
+ amount: Number(okexTrade.sz),
163
+ side: okexTrade.side === 'buy' ? 'buy' : 'sell',
164
+ timestamp: new Date(Number(okexTrade.ts)),
165
+ localTimestamp: localTimestamp
166
+ };
167
+ }
168
+ }
169
+ }
170
+ const mapV5BookLevel = (level) => {
171
+ const price = Number(level[0]);
172
+ const amount = Number(level[1]);
173
+ return { price, amount };
174
+ };
175
+ class OkexV5BookChangeMapper {
176
+ _exchange;
177
+ _channelName;
178
+ constructor(_exchange, { allowPublicBooksChannel }) {
179
+ this._exchange = _exchange;
180
+ this._channelName = this._getBooksChannelName(allowPublicBooksChannel);
181
+ }
182
+ canHandle(message) {
183
+ if (message.event !== undefined || message.arg === undefined) {
184
+ return false;
185
+ }
186
+ return message.arg.channel === this._channelName;
187
+ }
188
+ _hasCredentials = process.env.OKX_API_KEY !== undefined;
189
+ _hasVip5Access = process.env.OKX_API_VIP_5 !== undefined;
190
+ _hasColoAccess = process.env.OKX_API_COLO !== undefined;
191
+ _getBooksChannelName(allowPublicBooksChannel) {
192
+ if (allowPublicBooksChannel === false) {
193
+ // historical data always uses books-l2-tbt
194
+ return 'books-l2-tbt';
195
+ }
196
+ if (this._hasCredentials && this._hasVip5Access) {
197
+ return 'books-l2-tbt';
198
+ }
199
+ if (this._hasColoAccess) {
200
+ return 'books-l2-tbt';
201
+ }
202
+ if (this._hasCredentials) {
203
+ return 'books50-l2-tbt';
204
+ }
205
+ return 'books';
206
+ }
207
+ getFilters(symbols) {
208
+ symbols = upperCaseSymbols(symbols);
209
+ return [
210
+ {
211
+ channel: this._channelName,
212
+ symbols
213
+ }
214
+ ];
215
+ }
216
+ *map(okexDepthDataMessage, localTimestamp) {
217
+ for (const message of okexDepthDataMessage.data) {
218
+ if (okexDepthDataMessage.action === 'update' && message.bids.length === 0 && message.asks.length === 0) {
219
+ continue;
220
+ }
221
+ const timestamp = new Date(Number(message.ts));
222
+ if (timestamp.valueOf() === 0) {
223
+ continue;
224
+ }
225
+ yield {
226
+ type: 'book_change',
227
+ symbol: okexDepthDataMessage.arg.instId,
228
+ exchange: this._exchange,
229
+ isSnapshot: okexDepthDataMessage.action === 'snapshot',
230
+ bids: message.bids.map(mapV5BookLevel),
231
+ asks: message.asks.map(mapV5BookLevel),
232
+ timestamp,
233
+ localTimestamp: localTimestamp
234
+ };
235
+ }
236
+ }
237
+ }
238
+ class OkexV5BookTickerMapper {
239
+ _exchange;
240
+ _useTbtTickerChannel;
241
+ constructor(_exchange, { useTbtTickerChannel }) {
242
+ this._exchange = _exchange;
243
+ this._useTbtTickerChannel = useTbtTickerChannel;
244
+ }
245
+ canHandle(message) {
246
+ if (message.event !== undefined || message.arg === undefined) {
247
+ return false;
248
+ }
249
+ if (this._useTbtTickerChannel) {
250
+ return message.arg.channel === 'bbo-tbt';
251
+ }
252
+ return message.arg.channel === 'tickers';
253
+ }
254
+ getFilters(symbols) {
255
+ symbols = upperCaseSymbols(symbols);
256
+ if (this._useTbtTickerChannel) {
257
+ return [
258
+ {
259
+ channel: `bbo-tbt`,
260
+ symbols
261
+ }
262
+ ];
263
+ }
264
+ return [
265
+ {
266
+ channel: `tickers`,
267
+ symbols
268
+ }
269
+ ];
270
+ }
271
+ map(message, localTimestamp) {
272
+ if (message.arg.channel === 'bbo-tbt') {
273
+ return this._mapFromTbtTicker(message, localTimestamp);
274
+ }
275
+ else {
276
+ return this._mapFromTicker(message, localTimestamp);
277
+ }
278
+ }
279
+ *_mapFromTbtTicker(message, localTimestamp) {
280
+ if (!message.data) {
281
+ return;
282
+ }
283
+ for (const tbtTicker of message.data) {
284
+ const bestAsk = tbtTicker.asks !== undefined && tbtTicker.asks[0] ? mapBookLevel(tbtTicker.asks[0]) : undefined;
285
+ const bestBid = tbtTicker.bids !== undefined && tbtTicker.bids[0] ? mapBookLevel(tbtTicker.bids[0]) : undefined;
286
+ const ticker = {
287
+ type: 'book_ticker',
288
+ symbol: message.arg.instId,
289
+ exchange: this._exchange,
290
+ askAmount: bestAsk?.amount,
291
+ askPrice: bestAsk?.price,
292
+ bidPrice: bestBid?.price,
293
+ bidAmount: bestBid?.amount,
294
+ timestamp: new Date(Number(tbtTicker.ts)),
295
+ localTimestamp: localTimestamp
296
+ };
297
+ yield ticker;
298
+ }
299
+ }
300
+ *_mapFromTicker(message, localTimestamp) {
301
+ for (const okexTicker of message.data) {
302
+ const ticker = {
303
+ type: 'book_ticker',
304
+ symbol: okexTicker.instId,
305
+ exchange: this._exchange,
306
+ askAmount: asNonZeroNumberOrUndefined(okexTicker.askSz),
307
+ askPrice: asNonZeroNumberOrUndefined(okexTicker.askPx),
308
+ bidPrice: asNonZeroNumberOrUndefined(okexTicker.bidPx),
309
+ bidAmount: asNonZeroNumberOrUndefined(okexTicker.bidSz),
310
+ timestamp: new Date(Number(okexTicker.ts)),
311
+ localTimestamp: localTimestamp
312
+ };
313
+ yield ticker;
314
+ }
315
+ }
316
+ }
317
+ class OkexV5DerivativeTickerMapper {
318
+ _exchange;
319
+ _options;
320
+ pendingTickerInfoHelper = new PendingTickerInfoHelper();
321
+ _indexPrices = new Map();
322
+ _futuresChannels = ['tickers', 'open-interest', 'mark-price', 'index-tickers', 'funding-rate'];
323
+ _swapChannels = ['tickers', 'open-interest', 'mark-price', 'index-tickers', 'funding-rate'];
324
+ constructor(_exchange, _options) {
325
+ this._exchange = _exchange;
326
+ this._options = _options;
327
+ }
328
+ canHandle(message) {
329
+ const channels = this._exchange === 'okex-futures' ? this._futuresChannels : this._swapChannels;
330
+ if (message.event !== undefined || message.arg === undefined) {
331
+ return false;
332
+ }
333
+ return channels.includes(message.arg.channel);
334
+ }
335
+ getFilters(symbols) {
336
+ symbols = upperCaseSymbols(symbols);
337
+ const channels = this._exchange === 'okex-futures' ? this._futuresChannels : this._swapChannels;
338
+ return channels.map((channel) => {
339
+ if (channel === 'index-tickers') {
340
+ const indexes = symbols !== undefined ? symbols.map((symbol) => this._getIndexSymbol(symbol)) : undefined;
341
+ return {
342
+ channel,
343
+ symbols: indexes
344
+ };
345
+ }
346
+ return {
347
+ channel,
348
+ symbols
349
+ };
350
+ });
351
+ }
352
+ *map(message, localTimestamp) {
353
+ if (message.arg.channel === 'index-tickers') {
354
+ for (const dataMessage of message.data) {
355
+ const indexTickerMessage = dataMessage;
356
+ const lastIndexPrice = Number(indexTickerMessage.idxPx);
357
+ if (lastIndexPrice > 0) {
358
+ this._indexPrices.set(indexTickerMessage.instId, lastIndexPrice);
359
+ }
360
+ }
361
+ return;
362
+ }
363
+ for (const dataMessage of message.data) {
364
+ const pendingTickerInfo = this.pendingTickerInfoHelper.getPendingTickerInfo(dataMessage.instId, this._exchange);
365
+ const indexSymbol = this._getIndexSymbol(dataMessage.instId);
366
+ const indexPrice = this._indexPrices.get(indexSymbol);
367
+ if (indexPrice !== undefined) {
368
+ pendingTickerInfo.updateIndexPrice(indexPrice);
369
+ }
370
+ if (message.arg.channel === 'mark-price') {
371
+ const markPriceMessage = dataMessage;
372
+ const markPrice = Number(markPriceMessage.markPx);
373
+ if (markPrice > 0) {
374
+ pendingTickerInfo.updateMarkPrice(markPrice);
375
+ pendingTickerInfo.updateTimestamp(new Date(Number(markPriceMessage.ts)));
376
+ }
377
+ }
378
+ if (message.arg.channel === 'open-interest') {
379
+ const openInterestMessage = dataMessage;
380
+ const openInterest = Number(openInterestMessage.oi);
381
+ if (openInterest > 0) {
382
+ pendingTickerInfo.updateOpenInterest(openInterest);
383
+ pendingTickerInfo.updateTimestamp(new Date(Number(openInterestMessage.ts)));
384
+ }
385
+ }
386
+ if (message.arg.channel === 'funding-rate') {
387
+ const fundingRateMessage = dataMessage;
388
+ if (fundingRateMessage.fundingRate !== undefined) {
389
+ pendingTickerInfo.updateFundingRate(Number(fundingRateMessage.fundingRate));
390
+ }
391
+ if (fundingRateMessage.fundingTime !== undefined) {
392
+ pendingTickerInfo.updateFundingTimestamp(new Date(Number(fundingRateMessage.fundingTime)));
393
+ }
394
+ if (fundingRateMessage.nextFundingRate !== undefined && fundingRateMessage.nextFundingRate !== '') {
395
+ pendingTickerInfo.updatePredictedFundingRate(Number(fundingRateMessage.nextFundingRate));
396
+ }
397
+ if (fundingRateMessage.ts !== undefined) {
398
+ pendingTickerInfo.updateTimestamp(new Date(Number(fundingRateMessage.ts)));
399
+ }
400
+ }
401
+ if (message.arg.channel === 'tickers') {
402
+ const tickerMessage = dataMessage;
403
+ const lastPrice = Number(tickerMessage.last);
404
+ if (lastPrice > 0) {
405
+ pendingTickerInfo.updateLastPrice(lastPrice);
406
+ pendingTickerInfo.updateTimestamp(new Date(Number(tickerMessage.ts)));
407
+ }
408
+ }
409
+ if (pendingTickerInfo.hasChanged()) {
410
+ yield pendingTickerInfo.getSnapshot(localTimestamp);
411
+ }
412
+ }
413
+ }
414
+ _getIndexSymbol(instrumentId) {
415
+ const symbolParts = instrumentId.split('-');
416
+ const quoteCurrency = symbolParts[1].split('_')[0];
417
+ const indexQuoteCurrency = quoteCurrency === 'USDC' && this._options.useLegacyUSDCIndex ? 'USD' : quoteCurrency;
418
+ return `${symbolParts[0]}-${indexQuoteCurrency}`;
419
+ }
420
+ }
421
+ class OkexV5LiquidationsMapper {
422
+ _exchange;
423
+ _isFirstMessage = true;
424
+ constructor(_exchange) {
425
+ this._exchange = _exchange;
426
+ }
427
+ canHandle(message) {
428
+ if (message.event !== undefined || message.arg === undefined) {
429
+ return false;
430
+ }
431
+ return message.arg.channel === 'liquidations' || message.arg.channel === 'liquidation-orders';
432
+ }
433
+ getFilters(symbols) {
434
+ symbols = upperCaseSymbols(symbols);
435
+ return [
436
+ {
437
+ channel: 'liquidations',
438
+ symbols
439
+ },
440
+ {
441
+ channel: 'liquidation-orders',
442
+ symbols
443
+ }
444
+ ];
445
+ }
446
+ *map(okexLiquidationMessage, localTimestamp) {
447
+ if (okexLiquidationMessage.arg.channel === 'liquidation-orders') {
448
+ if (this._isFirstMessage) {
449
+ this._isFirstMessage = false;
450
+ return;
451
+ }
452
+ for (const okexLiquidation of okexLiquidationMessage.data) {
453
+ for (const detail of okexLiquidation.details) {
454
+ const liquidation = {
455
+ type: 'liquidation',
456
+ symbol: okexLiquidation.instId,
457
+ exchange: this._exchange,
458
+ id: undefined,
459
+ price: Number(detail.bkPx),
460
+ amount: Number(detail.sz),
461
+ side: detail.side === 'buy' ? 'buy' : 'sell',
462
+ timestamp: new Date(Number(detail.ts)),
463
+ localTimestamp: localTimestamp
464
+ };
465
+ yield liquidation;
466
+ }
467
+ }
468
+ }
469
+ else {
470
+ for (const okexLiquidation of okexLiquidationMessage.data) {
471
+ const liquidation = {
472
+ type: 'liquidation',
473
+ symbol: okexLiquidationMessage.arg.instId,
474
+ exchange: this._exchange,
475
+ id: undefined,
476
+ price: Number(okexLiquidation.bkPx),
477
+ amount: Number(okexLiquidation.sz),
478
+ side: okexLiquidation.side === 'buy' ? 'buy' : 'sell',
479
+ timestamp: new Date(Number(okexLiquidation.ts)),
480
+ localTimestamp: localTimestamp
481
+ };
482
+ yield liquidation;
483
+ }
484
+ }
485
+ }
486
+ }
487
+ class OkexV5OptionSummaryMapper {
488
+ _indexPrices = new Map();
489
+ _openInterests = new Map();
490
+ _markPrices = new Map();
491
+ _tickers = new Map();
492
+ expiration_regex = /(\d{2})(\d{2})(\d{2})/;
493
+ canHandle(message) {
494
+ if (message.event !== undefined || message.arg === undefined) {
495
+ return false;
496
+ }
497
+ return (message.arg.channel === 'opt-summary' ||
498
+ message.arg.channel === 'index-tickers' ||
499
+ message.arg.channel === 'tickers' ||
500
+ message.arg.channel === 'open-interest' ||
501
+ message.arg.channel === 'mark-price');
502
+ }
503
+ getFilters(symbols) {
504
+ symbols = upperCaseSymbols(symbols);
505
+ const indexes = symbols !== undefined ? [...new Set(symbols.map((s) => getOkexOptionsUnderlyingIndex(s)))] : undefined;
506
+ const optionSummaryInstrumentFamilies = symbols !== undefined ? [...new Set(symbols.map((s) => getOkexOptionsFamilyOrIndex(s)))] : undefined;
507
+ return [
508
+ {
509
+ channel: `opt-summary`,
510
+ symbols: optionSummaryInstrumentFamilies
511
+ },
512
+ {
513
+ channel: `index-tickers`,
514
+ symbols: indexes
515
+ },
516
+ {
517
+ channel: `tickers`,
518
+ symbols: symbols
519
+ },
520
+ {
521
+ channel: `open-interest`,
522
+ symbols: symbols
523
+ },
524
+ {
525
+ channel: `mark-price`,
526
+ symbols: symbols
527
+ }
528
+ ];
529
+ }
530
+ *map(message, localTimestamp) {
531
+ if (message.arg.channel === 'index-tickers') {
532
+ for (const dataMessage of message.data) {
533
+ const indexTickerMessage = dataMessage;
534
+ const lastIndexPrice = asNonZeroNumberOrUndefined(indexTickerMessage.idxPx);
535
+ if (lastIndexPrice !== undefined) {
536
+ this._indexPrices.set(indexTickerMessage.instId, lastIndexPrice);
537
+ }
538
+ }
539
+ return;
540
+ }
541
+ if (message.arg.channel === 'open-interest') {
542
+ for (const dataMessage of message.data) {
543
+ const openInterestMessage = dataMessage;
544
+ const openInterestValue = asNonZeroNumberOrUndefined(openInterestMessage.oi);
545
+ if (openInterestValue !== undefined) {
546
+ this._openInterests.set(openInterestMessage.instId, openInterestValue);
547
+ }
548
+ }
549
+ return;
550
+ }
551
+ if (message.arg.channel === 'mark-price') {
552
+ for (const dataMessage of message.data) {
553
+ const markPriceMessage = dataMessage;
554
+ const markPrice = asNonZeroNumberOrUndefined(markPriceMessage.markPx);
555
+ if (markPrice !== undefined) {
556
+ this._markPrices.set(markPriceMessage.instId, markPrice);
557
+ }
558
+ }
559
+ return;
560
+ }
561
+ if (message.arg.channel === 'tickers') {
562
+ for (const dataMessage of message.data) {
563
+ const tickerMessage = dataMessage;
564
+ this._tickers.set(tickerMessage.instId, tickerMessage);
565
+ }
566
+ return;
567
+ }
568
+ if (message.arg.channel === 'opt-summary') {
569
+ for (const dataMessage of message.data) {
570
+ const summary = dataMessage;
571
+ const symbolParts = summary.instId.split('-');
572
+ const isPut = symbolParts[4] === 'P';
573
+ const strikePrice = Number(symbolParts[3]);
574
+ var dateArray = this.expiration_regex.exec(symbolParts[2]);
575
+ const expirationDate = new Date(Date.UTC(+('20' + dateArray[1]), +dateArray[2] - 1, +dateArray[3], 8, 0, 0, 0));
576
+ const lastUnderlyingPrice = this._indexPrices.get(summary.uly);
577
+ const lastOpenInterest = this._openInterests.get(summary.instId);
578
+ const lastMarkPrice = this._markPrices.get(summary.instId);
579
+ const lastTickerInfo = this._tickers.get(summary.instId);
580
+ const optionSummary = {
581
+ type: 'option_summary',
582
+ symbol: summary.instId,
583
+ exchange: 'okex-options',
584
+ optionType: isPut ? 'put' : 'call',
585
+ strikePrice,
586
+ expirationDate,
587
+ bestBidPrice: asNonZeroNumberOrUndefined(lastTickerInfo?.bidPx),
588
+ bestBidAmount: asNonZeroNumberOrUndefined(lastTickerInfo?.bidSz),
589
+ bestBidIV: asNonZeroNumberOrUndefined(summary.bidVol),
590
+ bestAskPrice: asNonZeroNumberOrUndefined(lastTickerInfo?.askPx),
591
+ bestAskAmount: asNonZeroNumberOrUndefined(lastTickerInfo?.askSz),
592
+ bestAskIV: asNonZeroNumberOrUndefined(summary.askVol),
593
+ lastPrice: asNonZeroNumberOrUndefined(lastTickerInfo?.last),
594
+ openInterest: lastOpenInterest,
595
+ markPrice: lastMarkPrice,
596
+ markIV: asNonZeroNumberOrUndefined(summary.markVol),
597
+ delta: asNonZeroNumberOrUndefined(summary.delta),
598
+ gamma: asNonZeroNumberOrUndefined(summary.gamma),
599
+ vega: asNonZeroNumberOrUndefined(summary.vega),
600
+ theta: asNonZeroNumberOrUndefined(summary.theta),
601
+ rho: undefined,
602
+ underlyingPrice: lastUnderlyingPrice,
603
+ underlyingIndex: summary.uly,
604
+ timestamp: new Date(Number(summary.ts)),
605
+ localTimestamp: localTimestamp
606
+ };
607
+ yield optionSummary;
608
+ }
609
+ }
610
+ }
611
+ }
612
+ //---
613
+ //V3 Okex API mappers
614
+ // https://www.okex.com/docs/en/#ws_swap-README
615
+ class OkexTradesMapper {
616
+ _exchange;
617
+ _market;
618
+ constructor(_exchange, { market }) {
619
+ this._exchange = _exchange;
620
+ this._market = market;
621
+ }
622
+ canHandle(message) {
623
+ return message.table === `${this._market}/trade`;
624
+ }
625
+ getFilters(symbols) {
626
+ symbols = upperCaseSymbols(symbols);
627
+ return [
628
+ {
629
+ channel: `${this._market}/trade`,
630
+ symbols
631
+ }
632
+ ];
633
+ }
634
+ *map(okexTradesMessage, localTimestamp) {
635
+ for (const okexTrade of okexTradesMessage.data) {
636
+ const symbol = okexTrade.instrument_id;
637
+ yield {
638
+ type: 'trade',
639
+ symbol,
640
+ exchange: this._exchange,
641
+ id: typeof okexTrade.trade_id === 'string' ? okexTrade.trade_id : undefined,
642
+ price: Number(okexTrade.price),
643
+ amount: okexTrade.qty !== undefined ? Number(okexTrade.qty) : Number(okexTrade.size),
644
+ side: okexTrade.side,
645
+ timestamp: new Date(okexTrade.timestamp),
646
+ localTimestamp: localTimestamp
647
+ };
648
+ }
649
+ }
650
+ }
651
+ const mapBookLevel = (level) => {
652
+ const price = Number(level[0]);
653
+ const amount = Number(level[1]);
654
+ return { price, amount };
655
+ };
656
+ class OkexBookChangeMapper {
657
+ _exchange;
658
+ _canUseTickByTickChannel;
659
+ _market;
660
+ constructor(_exchange, { market, useTickByTickChannel }) {
661
+ this._exchange = _exchange;
662
+ this._market = market;
663
+ this._canUseTickByTickChannel = useTickByTickChannel;
664
+ }
665
+ canHandle(message) {
666
+ const channelSuffix = this._canUseTickByTickChannel ? 'depth_l2_tbt' : 'depth';
667
+ return message.table === `${this._market}/${channelSuffix}`;
668
+ }
669
+ getFilters(symbols) {
670
+ symbols = upperCaseSymbols(symbols);
671
+ if (this._canUseTickByTickChannel) {
672
+ return [
673
+ {
674
+ channel: `${this._market}/depth_l2_tbt`,
675
+ symbols
676
+ }
677
+ ];
678
+ }
679
+ // subscribe to both book channels and in canHandle decide which one to use
680
+ // as one can subscribe to date range period that overlaps both when only depth channel has been available
681
+ // and when both were available (both depth and depth_l2_tbt)
682
+ return [
683
+ {
684
+ channel: `${this._market}/depth_l2_tbt`,
685
+ symbols
686
+ },
687
+ {
688
+ channel: `${this._market}/depth`,
689
+ symbols
690
+ }
691
+ ];
692
+ }
693
+ *map(okexDepthDataMessage, localTimestamp) {
694
+ for (const message of okexDepthDataMessage.data) {
695
+ if (message.bids.length === 0 && message.asks.length === 0 && okexDepthDataMessage.action !== 'partial') {
696
+ continue;
697
+ }
698
+ const timestamp = new Date(message.timestamp);
699
+ if (timestamp.valueOf() === 0) {
700
+ continue;
701
+ }
702
+ yield {
703
+ type: 'book_change',
704
+ symbol: message.instrument_id,
705
+ exchange: this._exchange,
706
+ isSnapshot: okexDepthDataMessage.action === 'partial',
707
+ bids: message.bids.map(mapBookLevel),
708
+ asks: message.asks.map(mapBookLevel),
709
+ timestamp,
710
+ localTimestamp: localTimestamp
711
+ };
712
+ }
713
+ }
714
+ }
715
+ class OkexDerivativeTickerMapper {
716
+ _exchange;
717
+ pendingTickerInfoHelper = new PendingTickerInfoHelper();
718
+ _futuresChannels = ['futures/ticker', 'futures/mark_price'];
719
+ _swapChannels = ['swap/ticker', 'swap/mark_price', 'swap/funding_rate'];
720
+ constructor(_exchange) {
721
+ this._exchange = _exchange;
722
+ }
723
+ canHandle(message) {
724
+ const channels = this._exchange === 'okex-futures' ? this._futuresChannels : this._swapChannels;
725
+ return channels.includes(message.table);
726
+ }
727
+ getFilters(symbols) {
728
+ symbols = upperCaseSymbols(symbols);
729
+ const channels = this._exchange === 'okex-futures' ? this._futuresChannels : this._swapChannels;
730
+ return channels.map((channel) => {
731
+ return {
732
+ channel,
733
+ symbols
734
+ };
735
+ });
736
+ }
737
+ *map(message, localTimestamp) {
738
+ for (const okexMessage of message.data) {
739
+ const pendingTickerInfo = this.pendingTickerInfoHelper.getPendingTickerInfo(okexMessage.instrument_id, this._exchange);
740
+ if ('funding_rate' in okexMessage) {
741
+ pendingTickerInfo.updateFundingRate(Number(okexMessage.funding_rate));
742
+ pendingTickerInfo.updateFundingTimestamp(new Date(okexMessage.funding_time));
743
+ if (okexMessage.estimated_rate !== undefined) {
744
+ pendingTickerInfo.updatePredictedFundingRate(Number(okexMessage.estimated_rate));
745
+ }
746
+ }
747
+ if ('mark_price' in okexMessage) {
748
+ pendingTickerInfo.updateMarkPrice(Number(okexMessage.mark_price));
749
+ }
750
+ if ('open_interest' in okexMessage) {
751
+ const openInterest = Number(okexMessage.open_interest);
752
+ if (openInterest > 0) {
753
+ pendingTickerInfo.updateOpenInterest(Number(okexMessage.open_interest));
754
+ }
755
+ }
756
+ if ('last' in okexMessage) {
757
+ pendingTickerInfo.updateLastPrice(Number(okexMessage.last));
758
+ }
759
+ if (okexMessage.timestamp !== undefined) {
760
+ pendingTickerInfo.updateTimestamp(new Date(okexMessage.timestamp));
761
+ }
762
+ if (pendingTickerInfo.hasChanged()) {
763
+ yield pendingTickerInfo.getSnapshot(localTimestamp);
764
+ }
765
+ }
766
+ }
767
+ }
768
+ class OkexOptionSummaryMapper {
769
+ _indexPrices = new Map();
770
+ expiration_regex = /(\d{2})(\d{2})(\d{2})/;
771
+ canHandle(message) {
772
+ return message.table === 'index/ticker' || message.table === 'option/summary';
773
+ }
774
+ getFilters(symbols) {
775
+ symbols = upperCaseSymbols(symbols);
776
+ const indexes = symbols !== undefined
777
+ ? symbols.map((s) => {
778
+ const symbolParts = s.split('-');
779
+ return `${symbolParts[0]}-${symbolParts[1]}`;
780
+ })
781
+ : undefined;
782
+ return [
783
+ {
784
+ channel: `option/summary`,
785
+ symbols
786
+ },
787
+ {
788
+ channel: `index/ticker`,
789
+ symbols: indexes
790
+ }
791
+ ];
792
+ }
793
+ *map(message, localTimestamp) {
794
+ if (message.table === 'index/ticker') {
795
+ for (const index of message.data) {
796
+ const lastIndexPrice = Number(index.last);
797
+ if (lastIndexPrice > 0) {
798
+ this._indexPrices.set(index.instrument_id, lastIndexPrice);
799
+ }
800
+ }
801
+ return;
802
+ }
803
+ for (const summary of message.data) {
804
+ const symbolParts = summary.instrument_id.split('-');
805
+ const isPut = symbolParts[4] === 'P';
806
+ const strikePrice = Number(symbolParts[3]);
807
+ var dateArray = this.expiration_regex.exec(symbolParts[2]);
808
+ const expirationDate = new Date(Date.UTC(+('20' + dateArray[1]), +dateArray[2] - 1, +dateArray[3], 8, 0, 0, 0));
809
+ const lastUnderlyingPrice = this._indexPrices.get(summary.underlying);
810
+ const optionSummary = {
811
+ type: 'option_summary',
812
+ symbol: summary.instrument_id,
813
+ exchange: 'okex-options',
814
+ optionType: isPut ? 'put' : 'call',
815
+ strikePrice,
816
+ expirationDate,
817
+ bestBidPrice: asNonZeroNumberOrUndefined(summary.best_bid),
818
+ bestBidAmount: asNonZeroNumberOrUndefined(summary.best_bid_size),
819
+ bestBidIV: asNonZeroNumberOrUndefined(summary.bid_vol),
820
+ bestAskPrice: asNonZeroNumberOrUndefined(summary.best_ask),
821
+ bestAskAmount: asNonZeroNumberOrUndefined(summary.best_ask_size),
822
+ bestAskIV: asNonZeroNumberOrUndefined(summary.ask_vol),
823
+ lastPrice: asNonZeroNumberOrUndefined(summary.last),
824
+ openInterest: asNonZeroNumberOrUndefined(summary.open_interest),
825
+ markPrice: asNonZeroNumberOrUndefined(summary.mark_price),
826
+ markIV: asNonZeroNumberOrUndefined(summary.mark_vol),
827
+ delta: asNonZeroNumberOrUndefined(summary.delta),
828
+ gamma: asNonZeroNumberOrUndefined(summary.gamma),
829
+ vega: asNonZeroNumberOrUndefined(summary.vega),
830
+ theta: asNonZeroNumberOrUndefined(summary.theta),
831
+ rho: undefined,
832
+ underlyingPrice: lastUnderlyingPrice,
833
+ underlyingIndex: summary.underlying,
834
+ timestamp: new Date(summary.timestamp),
835
+ localTimestamp: localTimestamp
836
+ };
837
+ yield optionSummary;
838
+ }
839
+ }
840
+ }
841
+ class OkexLiquidationsMapper {
842
+ _exchange;
843
+ _market;
844
+ constructor(_exchange, { market }) {
845
+ this._exchange = _exchange;
846
+ this._market = market;
847
+ }
848
+ canHandle(message) {
849
+ return message.table === `${this._market}/liquidation`;
850
+ }
851
+ getFilters(symbols) {
852
+ symbols = upperCaseSymbols(symbols);
853
+ return [
854
+ {
855
+ channel: `${this._market}/liquidation`,
856
+ symbols
857
+ }
858
+ ];
859
+ }
860
+ *map(okexLiquidationDataMessage, localTimestamp) {
861
+ for (const okexLiquidation of okexLiquidationDataMessage.data) {
862
+ const liquidation = {
863
+ type: 'liquidation',
864
+ symbol: okexLiquidation.instrument_id,
865
+ exchange: this._exchange,
866
+ id: undefined,
867
+ price: Number(okexLiquidation.price),
868
+ amount: Number(okexLiquidation.size),
869
+ side: okexLiquidation.type === '3' ? 'sell' : 'buy',
870
+ timestamp: new Date(okexLiquidation.created_at),
871
+ localTimestamp: localTimestamp
872
+ };
873
+ yield liquidation;
874
+ }
875
+ }
876
+ }
877
+ class OkexBookTickerMapper {
878
+ _exchange;
879
+ _market;
880
+ constructor(_exchange, { market }) {
881
+ this._exchange = _exchange;
882
+ this._market = market;
883
+ }
884
+ canHandle(message) {
885
+ return message.table === `${this._market}/ticker`;
886
+ }
887
+ getFilters(symbols) {
888
+ symbols = upperCaseSymbols(symbols);
889
+ return [
890
+ {
891
+ channel: `${this._market}/ticker`,
892
+ symbols
893
+ }
894
+ ];
895
+ }
896
+ *map(message, localTimestamp) {
897
+ for (const okexTicker of message.data) {
898
+ const ticker = {
899
+ type: 'book_ticker',
900
+ symbol: okexTicker.instrument_id,
901
+ exchange: this._exchange,
902
+ askAmount: asNonZeroNumberOrUndefined(okexTicker.best_ask_size),
903
+ askPrice: asNonZeroNumberOrUndefined(okexTicker.best_ask),
904
+ bidPrice: asNonZeroNumberOrUndefined(okexTicker.best_bid),
905
+ bidAmount: asNonZeroNumberOrUndefined(okexTicker.best_bid_size),
906
+ timestamp: new Date(okexTicker.timestamp),
907
+ localTimestamp: localTimestamp
908
+ };
909
+ yield ticker;
910
+ }
911
+ }
912
+ }
913
+ //# sourceMappingURL=okex.js.map