@orangecharts/wrun-chart-host 0.2.0 → 0.4.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 (342) hide show
  1. package/README.md +22 -8
  2. package/dist/constants/common.constants.d.ts +15 -0
  3. package/dist/constants/common.constants.js +23 -0
  4. package/dist/constants/data-source.constants.d.ts +1 -0
  5. package/dist/constants/data-source.constants.js +1 -0
  6. package/dist/constants/economic.constants.d.ts +39 -0
  7. package/dist/constants/economic.constants.js +77 -0
  8. package/dist/constants/etf-covered-coins.constants.d.ts +1 -0
  9. package/dist/constants/etf-covered-coins.constants.js +9 -0
  10. package/dist/constants/feature-flags.constants.d.ts +60 -0
  11. package/dist/constants/feature-flags.constants.js +308 -0
  12. package/dist/constants/feature-limits.constants.d.ts +134 -0
  13. package/dist/constants/feature-limits.constants.js +155 -0
  14. package/dist/constants/marketCapabilities.constants.d.ts +87 -0
  15. package/dist/constants/marketCapabilities.constants.js +213 -0
  16. package/dist/constants/option-venues.constants.d.ts +100 -0
  17. package/dist/constants/option-venues.constants.js +167 -0
  18. package/dist/constants/overlay-data.constants.d.ts +53 -0
  19. package/dist/constants/overlay-data.constants.js +80 -0
  20. package/dist/constants/pane-grid.constants.d.ts +15 -0
  21. package/dist/constants/pane-grid.constants.js +17 -0
  22. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
  23. package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
  24. package/dist/constants/venue-presets.constants.d.ts +10 -0
  25. package/dist/constants/venue-presets.constants.js +22 -0
  26. package/dist/enums/chart.enum.d.ts +68 -0
  27. package/dist/enums/chart.enum.js +70 -0
  28. package/dist/helpers/data.helpers.d.ts +2 -0
  29. package/dist/helpers/data.helpers.js +14 -0
  30. package/dist/host-env.d.ts +163 -5
  31. package/dist/host-ports.types.d.ts +431 -0
  32. package/dist/host-ports.types.js +1 -0
  33. package/dist/index.d.ts +138 -0
  34. package/dist/index.js +138 -0
  35. package/dist/indicators/controls/technical-script/technical-script-input-rendering.d.ts +86 -0
  36. package/dist/indicators/controls/technical-script/technical-script-input-rendering.js +179 -0
  37. package/dist/interfaces/asset-venue.interface.d.ts +91 -0
  38. package/dist/interfaces/asset-venue.interface.js +1 -0
  39. package/dist/interfaces/cancel-reason.interface.d.ts +24 -0
  40. package/dist/interfaces/cancel-reason.interface.js +2 -0
  41. package/dist/interfaces/catalog-display.interface.d.ts +3 -0
  42. package/dist/interfaces/catalog-display.interface.js +1 -0
  43. package/dist/interfaces/cme-realtime.interface.d.ts +251 -0
  44. package/dist/interfaces/cme-realtime.interface.js +46 -0
  45. package/dist/interfaces/feed.interface.d.ts +80 -0
  46. package/dist/interfaces/feed.interface.js +7 -0
  47. package/dist/interfaces/market-kind.interface.d.ts +8 -0
  48. package/dist/interfaces/market-kind.interface.js +1 -0
  49. package/dist/interfaces/opra-realtime.interface.d.ts +224 -0
  50. package/dist/interfaces/opra-realtime.interface.js +105 -0
  51. package/dist/interfaces/option-instrument.interface.d.ts +32 -0
  52. package/dist/interfaces/option-instrument.interface.js +1 -0
  53. package/dist/interfaces/options-chain-scope.interface.d.ts +29 -0
  54. package/dist/interfaces/options-chain-scope.interface.js +7 -0
  55. package/dist/interfaces/prediction-market.interface.d.ts +88 -0
  56. package/dist/interfaces/prediction-market.interface.js +8 -0
  57. package/dist/interfaces/wrun-runtime.interface.d.ts +5 -0
  58. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +185 -0
  59. package/dist/kscript-data/controls/live-trades-merge.util.js +357 -0
  60. package/dist/settings-templates/frvp-fields.d.ts +27 -0
  61. package/dist/settings-templates/frvp-fields.js +108 -0
  62. package/dist/settings-templates/index.d.ts +119 -0
  63. package/dist/settings-templates/index.js +442 -0
  64. package/dist/settings-templates/indicator-fields.d.ts +56 -0
  65. package/dist/settings-templates/indicator-fields.js +793 -0
  66. package/dist/settings-templates/tool-rules.d.ts +59 -0
  67. package/dist/settings-templates/tool-rules.js +49 -0
  68. package/dist/settings-templates/tool-tables.generated.d.ts +2 -0
  69. package/dist/settings-templates/tool-tables.generated.js +1668 -0
  70. package/dist/utility/blk-market.util.d.ts +5 -0
  71. package/dist/utility/blk-market.util.js +12 -0
  72. package/dist/utility/chart/chart-load-phase.util.d.ts +32 -0
  73. package/dist/utility/chart/chart-load-phase.util.js +78 -0
  74. package/dist/utility/chart/cme-cache-context.util.d.ts +108 -0
  75. package/dist/utility/chart/cme-cache-context.util.js +166 -0
  76. package/dist/utility/chart/cme-session-bucket.util.d.ts +82 -0
  77. package/dist/utility/chart/cme-session-bucket.util.js +343 -0
  78. package/dist/utility/chart/cme-trade-calendar.util.d.ts +26 -0
  79. package/dist/utility/chart/cme-trade-calendar.util.js +147 -0
  80. package/dist/utility/chart/continuous-contracts.util.d.ts +138 -0
  81. package/dist/utility/chart/continuous-contracts.util.js +374 -0
  82. package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
  83. package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
  84. package/dist/utility/chart/feed-interval.util.d.ts +119 -0
  85. package/dist/utility/chart/feed-interval.util.js +321 -0
  86. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +110 -0
  87. package/dist/utility/chart/fetch-dedupe-policy.util.js +407 -0
  88. package/dist/utility/chart/footprint-band.util.d.ts +76 -0
  89. package/dist/utility/chart/footprint-band.util.js +205 -0
  90. package/dist/utility/chart/footprint-cell-identity.util.d.ts +82 -0
  91. package/dist/utility/chart/footprint-cell-identity.util.js +346 -0
  92. package/dist/utility/chart/formula-calendar.util.d.ts +27 -0
  93. package/dist/utility/chart/formula-calendar.util.js +59 -0
  94. package/dist/utility/chart/history-wall.util.d.ts +67 -0
  95. package/dist/utility/chart/history-wall.util.js +87 -0
  96. package/dist/utility/chart/index-mode.util.d.ts +66 -0
  97. package/dist/utility/chart/index-mode.util.js +360 -0
  98. package/dist/utility/chart/indicator-coverage-planner.util.d.ts +217 -0
  99. package/dist/utility/chart/indicator-coverage-planner.util.js +443 -0
  100. package/dist/utility/chart/indicator-coverage-state.util.d.ts +33 -0
  101. package/dist/utility/chart/indicator-coverage-state.util.js +110 -0
  102. package/dist/utility/chart/indicator-gap-detector.util.d.ts +127 -0
  103. package/dist/utility/chart/indicator-gap-detector.util.js +260 -0
  104. package/dist/utility/chart/indicator-gap-repair.util.d.ts +88 -0
  105. package/dist/utility/chart/indicator-gap-repair.util.js +177 -0
  106. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +26 -0
  107. package/dist/utility/chart/indicator-inflight-registry.util.js +254 -0
  108. package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
  109. package/dist/utility/chart/indicator-run-interval.util.js +268 -0
  110. package/dist/utility/chart/interval-registry.util.d.ts +23 -0
  111. package/dist/utility/chart/interval-registry.util.js +83 -0
  112. package/dist/utility/chart/kscript-main-grid-stages.util.d.ts +21 -0
  113. package/dist/utility/chart/kscript-main-grid-stages.util.js +332 -0
  114. package/dist/utility/chart/legacy-exchange.leaf.d.ts +11 -0
  115. package/dist/utility/chart/legacy-exchange.leaf.js +43 -0
  116. package/dist/utility/chart/live-bucket.util.d.ts +66 -0
  117. package/dist/utility/chart/live-bucket.util.js +165 -0
  118. package/dist/utility/chart/market-session-schedule.util.d.ts +91 -0
  119. package/dist/utility/chart/market-session-schedule.util.js +337 -0
  120. package/dist/utility/chart/marketKind.util.d.ts +181 -0
  121. package/dist/utility/chart/marketKind.util.js +371 -0
  122. package/dist/utility/chart/opra-read-access.leaf.d.ts +26 -0
  123. package/dist/utility/chart/opra-read-access.leaf.js +25 -0
  124. package/dist/utility/chart/prediction-identity.util.d.ts +159 -0
  125. package/dist/utility/chart/prediction-identity.util.js +236 -0
  126. package/dist/utility/chart/rth-session.util.d.ts +352 -0
  127. package/dist/utility/chart/rth-session.util.js +926 -0
  128. package/dist/utility/chart/titan-constants.pin.d.ts +43 -0
  129. package/dist/utility/chart/titan-constants.pin.js +50 -0
  130. package/dist/utility/chart/us-equities-session.util.d.ts +127 -0
  131. package/dist/utility/chart/us-equities-session.util.js +251 -0
  132. package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
  133. package/dist/utility/chart/window-geometry.leaf.js +391 -0
  134. package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
  135. package/dist/utility/chart/window-owner.leaf.js +24 -0
  136. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +100 -0
  137. package/dist/utility/chart/wrun-bar-session-facts.util.js +354 -0
  138. package/dist/utility/chart/wrun-wire-ref.util.d.ts +23 -0
  139. package/dist/utility/chart/wrun-wire-ref.util.js +16 -0
  140. package/dist/utility/common/safe-math-eval.d.ts +18 -0
  141. package/dist/utility/common/safe-math-eval.js +160 -0
  142. package/dist/utility/common/time.util.d.ts +134 -0
  143. package/dist/utility/common/time.util.js +428 -0
  144. package/dist/utility/common/transformations.util.d.ts +126 -0
  145. package/dist/utility/common/transformations.util.js +711 -0
  146. package/dist/utility/common/visible-timeout.util.d.ts +17 -0
  147. package/dist/utility/common/visible-timeout.util.js +75 -0
  148. package/dist/utility/exchange-normalization.util.d.ts +8 -0
  149. package/dist/utility/exchange-normalization.util.js +32 -0
  150. package/dist/utility/html-escape.leaf.d.ts +11 -0
  151. package/dist/utility/html-escape.leaf.js +20 -0
  152. package/dist/utility/intl-locale.util.d.ts +2 -0
  153. package/dist/utility/intl-locale.util.js +28 -0
  154. package/dist/utility/number-format.util.d.ts +14 -1
  155. package/dist/utility/number-format.util.js +50 -19
  156. package/dist/utility/options/option-symbol.util.d.ts +28 -0
  157. package/dist/utility/options/option-symbol.util.js +176 -0
  158. package/dist/utility/options/option-trade-units.util.d.ts +190 -0
  159. package/dist/utility/options/option-trade-units.util.js +283 -0
  160. package/dist/utility/options/option-venue.util.d.ts +75 -0
  161. package/dist/utility/options/option-venue.util.js +85 -0
  162. package/dist/utility/pool-symbol.leaf.d.ts +34 -0
  163. package/dist/utility/pool-symbol.leaf.js +95 -0
  164. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +109 -0
  165. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +302 -0
  166. package/dist/utility/symbol-selection/contract-expiry.util.d.ts +39 -0
  167. package/dist/utility/symbol-selection/contract-expiry.util.js +111 -0
  168. package/dist/utility/v2/gate-plane.util.d.ts +58 -0
  169. package/dist/utility/v2/gate-plane.util.js +99 -0
  170. package/dist/utility/v2/gate-session-latch.util.d.ts +22 -0
  171. package/dist/utility/v2/gate-session-latch.util.js +34 -0
  172. package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +76 -0
  173. package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +221 -0
  174. package/dist/utility/wrun/sources/host-grid-landing.d.ts +15 -0
  175. package/dist/utility/wrun/sources/host-grid-landing.js +26 -0
  176. package/dist/utility/wrun/sources/lanes/bitfinex_funding.d.ts +27 -0
  177. package/dist/utility/wrun/sources/lanes/bitfinex_funding.js +85 -0
  178. package/dist/utility/wrun/sources/lanes/economic.d.ts +27 -0
  179. package/dist/utility/wrun/sources/lanes/economic.js +79 -0
  180. package/dist/utility/wrun/sources/lanes/etf_holdings.d.ts +35 -0
  181. package/dist/utility/wrun/sources/lanes/etf_holdings.js +165 -0
  182. package/dist/utility/wrun/sources/lanes/etf_premium.d.ts +19 -0
  183. package/dist/utility/wrun/sources/lanes/etf_premium.js +114 -0
  184. package/dist/utility/wrun/sources/lanes/ethena_positions.d.ts +30 -0
  185. package/dist/utility/wrun/sources/lanes/ethena_positions.js +51 -0
  186. package/dist/utility/wrun/sources/lanes/index.d.ts +2 -0
  187. package/dist/utility/wrun/sources/lanes/index.js +32 -0
  188. package/dist/utility/wrun/sources/lanes/long_short_ratio.d.ts +17 -0
  189. package/dist/utility/wrun/sources/lanes/long_short_ratio.js +47 -0
  190. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +58 -0
  191. package/dist/utility/wrun/sources/lanes/option_daily.js +111 -0
  192. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +27 -0
  193. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +21 -0
  194. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +50 -0
  195. package/dist/utility/wrun/sources/lanes/options_flow.js +155 -0
  196. package/dist/utility/wrun/sources/lanes/options_oi.d.ts +29 -0
  197. package/dist/utility/wrun/sources/lanes/options_oi.js +59 -0
  198. package/dist/utility/wrun/sources/lanes/options_volume.d.ts +38 -0
  199. package/dist/utility/wrun/sources/lanes/options_volume.js +63 -0
  200. package/dist/utility/wrun/sources/lanes/series.d.ts +67 -0
  201. package/dist/utility/wrun/sources/lanes/series.js +321 -0
  202. package/dist/utility/wrun/sources/lanes/token_supply.d.ts +30 -0
  203. package/dist/utility/wrun/sources/lanes/token_supply.js +145 -0
  204. package/dist/utility/wrun/sources/lanes/treasury_balance.d.ts +25 -0
  205. package/dist/utility/wrun/sources/lanes/treasury_balance.js +47 -0
  206. package/dist/utility/wrun/sources/lanes/volatility_index.d.ts +21 -0
  207. package/dist/utility/wrun/sources/lanes/volatility_index.js +11 -0
  208. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +215 -0
  209. package/dist/utility/wrun/sources/opra-option-lanes.util.js +477 -0
  210. package/dist/utility/wrun/sources/registry.d.ts +21 -0
  211. package/dist/utility/wrun/sources/registry.js +237 -0
  212. package/dist/utility/wrun/sources/row-lane-registry.d.ts +28 -0
  213. package/dist/utility/wrun/sources/row-lane-registry.js +230 -0
  214. package/dist/utility/wrun/sources/row-lanes/index.d.ts +2 -0
  215. package/dist/utility/wrun/sources/row-lanes/index.js +12 -0
  216. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +2 -0
  217. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +38 -0
  218. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +55 -0
  219. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +126 -0
  220. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +4 -0
  221. package/dist/utility/wrun/sources/row-lanes/option_prints.js +191 -0
  222. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +62 -0
  223. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +147 -0
  224. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +70 -0
  225. package/dist/utility/wrun/sources/row-lanes/option_surface.js +144 -0
  226. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +309 -0
  227. package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
  228. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +350 -0
  229. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +576 -0
  230. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +275 -0
  231. package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
  232. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +207 -0
  233. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +450 -0
  234. package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +28 -0
  235. package/dist/utility/wrun/wrun-browser-sources.leaf.js +66 -0
  236. package/dist/utility/wrun/wrun-cloud-record.util.d.ts +65 -0
  237. package/dist/utility/wrun/wrun-cloud-record.util.js +121 -0
  238. package/dist/utility/wrun/wrun-daily-lane.util.d.ts +95 -0
  239. package/dist/utility/wrun/wrun-daily-lane.util.js +297 -0
  240. package/dist/utility/wrun/wrun-deadline.util.d.ts +52 -0
  241. package/dist/utility/wrun/wrun-deadline.util.js +82 -0
  242. package/dist/utility/wrun/wrun-etf-flow-lane.util.d.ts +94 -0
  243. package/dist/utility/wrun/wrun-etf-flow-lane.util.js +224 -0
  244. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +82 -0
  245. package/dist/utility/wrun/wrun-etf-funds.util.js +242 -0
  246. package/dist/utility/wrun/wrun-frames.d.ts +20 -1
  247. package/dist/utility/wrun/wrun-frames.js +103 -49
  248. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
  249. package/dist/utility/wrun/wrun-hosted-wire-caps.js +27 -0
  250. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +22 -0
  251. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +32 -0
  252. package/dist/utility/wrun/wrun-lane-warmup.util.d.ts +18 -0
  253. package/dist/utility/wrun/wrun-lane-warmup.util.js +112 -0
  254. package/dist/utility/wrun/wrun-leg-close.util.d.ts +57 -0
  255. package/dist/utility/wrun/wrun-leg-close.util.js +187 -0
  256. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +144 -0
  257. package/dist/utility/wrun/wrun-leg-fetch.util.js +212 -0
  258. package/dist/utility/wrun/wrun-leg-stream-classes.d.ts +73 -0
  259. package/dist/utility/wrun/wrun-leg-stream-classes.js +86 -0
  260. package/dist/utility/wrun/wrun-levels-child.util.d.ts +101 -6
  261. package/dist/utility/wrun/wrun-levels-child.util.js +335 -157
  262. package/dist/utility/wrun/wrun-memory-clamp.util.d.ts +33 -0
  263. package/dist/utility/wrun/wrun-memory-clamp.util.js +146 -0
  264. package/dist/utility/wrun/wrun-odds-template-market.util.d.ts +51 -0
  265. package/dist/utility/wrun/wrun-odds-template-market.util.js +251 -0
  266. package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +65 -0
  267. package/dist/utility/wrun/wrun-opra-flow.leaf.js +94 -0
  268. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +47 -0
  269. package/dist/utility/wrun/wrun-opra-lane.util.js +58 -0
  270. package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +49 -0
  271. package/dist/utility/wrun/wrun-opra-stats.leaf.js +115 -0
  272. package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +12 -0
  273. package/dist/utility/wrun/wrun-opra-underlying.util.js +1 -0
  274. package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +142 -0
  275. package/dist/utility/wrun/wrun-option-contract-flow.util.js +451 -0
  276. package/dist/utility/wrun/wrun-option-knobs.util.d.ts +43 -0
  277. package/dist/utility/wrun/wrun-option-knobs.util.js +81 -0
  278. package/dist/utility/wrun/wrun-option-prints.util.d.ts +144 -0
  279. package/dist/utility/wrun/wrun-option-prints.util.js +356 -0
  280. package/dist/utility/wrun/wrun-option-summary-lane.util.d.ts +102 -0
  281. package/dist/utility/wrun/wrun-option-summary-lane.util.js +143 -0
  282. package/dist/utility/wrun/wrun-options-chain.util.d.ts +308 -0
  283. package/dist/utility/wrun/wrun-options-chain.util.js +502 -0
  284. package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +9 -4
  285. package/dist/utility/wrun/wrun-overlay-identity.util.js +16 -6
  286. package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
  287. package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
  288. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +377 -0
  289. package/dist/utility/wrun/wrun-panel-mount.util.js +2251 -0
  290. package/dist/utility/wrun/wrun-param-map.util.d.ts +298 -0
  291. package/dist/utility/wrun/wrun-param-map.util.js +581 -0
  292. package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
  293. package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
  294. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +149 -0
  295. package/dist/utility/wrun/wrun-pin-spelling.util.js +523 -0
  296. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +116 -0
  297. package/dist/utility/wrun/wrun-pin-venues.util.js +320 -0
  298. package/dist/utility/wrun/wrun-pinned-interval.util.d.ts +20 -0
  299. package/dist/utility/wrun/wrun-pinned-interval.util.js +47 -0
  300. package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
  301. package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
  302. package/dist/utility/wrun/wrun-present-bits.util.d.ts +37 -0
  303. package/dist/utility/wrun/wrun-present-bits.util.js +73 -0
  304. package/dist/utility/wrun/wrun-protocol-pending.util.d.ts +33 -0
  305. package/dist/utility/wrun/wrun-protocol-pending.util.js +57 -0
  306. package/dist/utility/wrun/wrun-refusal.util.d.ts +41 -1
  307. package/dist/utility/wrun/wrun-refusal.util.js +69 -2
  308. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +1 -14
  309. package/dist/utility/wrun/wrun-registry-errors.util.js +0 -16
  310. package/dist/utility/wrun/wrun-row-source.d.ts +158 -0
  311. package/dist/utility/wrun/wrun-row-source.js +75 -0
  312. package/dist/utility/wrun/wrun-run-health.util.d.ts +155 -0
  313. package/dist/utility/wrun/wrun-run-health.util.js +273 -0
  314. package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
  315. package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
  316. package/dist/utility/wrun/wrun-socket-row-source.d.ts +439 -0
  317. package/dist/utility/wrun/wrun-socket-row-source.js +1689 -0
  318. package/dist/utility/wrun/wrun-socket-session-losses.util.d.ts +18 -0
  319. package/dist/utility/wrun/wrun-socket-session-losses.util.js +25 -0
  320. package/dist/utility/wrun/wrun-source-rows.util.d.ts +911 -0
  321. package/dist/utility/wrun/wrun-source-rows.util.js +2597 -0
  322. package/dist/utility/wrun/wrun-tape-source.util.d.ts +82 -0
  323. package/dist/utility/wrun/wrun-tape-source.util.js +151 -0
  324. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +137 -0
  325. package/dist/utility/wrun/wrun-tier-grid.util.js +279 -0
  326. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +52 -0
  327. package/dist/utility/wrun/wrun-trades-lane.util.js +58 -0
  328. package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +41 -0
  329. package/dist/utility/wrun/wrun-volume-profile-lane.util.js +66 -0
  330. package/dist/utility/wrun-display-name.util.d.ts +33 -0
  331. package/dist/utility/wrun-display-name.util.js +64 -0
  332. package/dist/workers/constants/kscript-transport-codes.d.ts +15 -0
  333. package/dist/workers/constants/kscript-transport-codes.js +15 -0
  334. package/dist/workers/constants/socket-slots.d.ts +574 -0
  335. package/dist/workers/constants/socket-slots.js +539 -0
  336. package/dist/workers/utils/number.worker.util.d.ts +5 -0
  337. package/dist/workers/utils/number.worker.util.js +10 -0
  338. package/dist/workers/utils/time.worker.util.d.ts +12 -0
  339. package/dist/workers/utils/time.worker.util.js +24 -0
  340. package/dist/workers/utils/volume-profile.worker.util.d.ts +200 -0
  341. package/dist/workers/utils/volume-profile.worker.util.js +631 -0
  342. package/package.json +10 -4
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Plan-Tier Feature Limits
3
+ *
4
+ * Single source of truth for per-tier feature limits. To add a new gated
5
+ * feature: add one row. To change a number: edit one value. Types enforce
6
+ * that every row has a value for every tier.
7
+ */
8
+ export declare const TIERS: readonly ["free", "plus"];
9
+ export type Tier = (typeof TIERS)[number];
10
+ export declare const GATEWAY_TIER_MAX_BARS: Record<Tier, {
11
+ default: number;
12
+ intervals: Partial<Record<string, number>>;
13
+ }>;
14
+ /** The tier's gateway reach in bars at the interval actually sent (a GATEWAY_TIER_MAX_BARS read). Pure. */
15
+ export declare function gatewayTierMaxBars(tier: Tier, requestInterval: string): number;
16
+ type CountLimit = number;
17
+ type BinaryLimit = boolean;
18
+ export declare const FEATURE_LIMITS: {
19
+ readonly workspaces: {
20
+ readonly free: 10;
21
+ readonly plus: 50;
22
+ };
23
+ readonly indicatorsPerChart: {
24
+ readonly free: 3;
25
+ readonly plus: 10;
26
+ };
27
+ readonly privateKScripts: {
28
+ readonly free: 100;
29
+ readonly plus: 500;
30
+ };
31
+ readonly multicharts: {
32
+ readonly free: 1;
33
+ readonly plus: 16;
34
+ };
35
+ readonly priceAlerts: {
36
+ readonly free: 200;
37
+ readonly plus: 500;
38
+ };
39
+ readonly indicatorAlerts: {
40
+ readonly free: 5;
41
+ readonly plus: 50;
42
+ };
43
+ readonly widgetsPerLayout: {
44
+ readonly free: 3;
45
+ readonly plus: 10;
46
+ };
47
+ readonly publishedLayouts: {
48
+ readonly free: 10;
49
+ readonly plus: 50;
50
+ };
51
+ readonly replayReachBars: {
52
+ readonly free: number;
53
+ readonly plus: number;
54
+ };
55
+ readonly heatmap4K: {
56
+ readonly free: true;
57
+ readonly plus: true;
58
+ };
59
+ readonly fullOrderbookDepth: {
60
+ readonly free: false;
61
+ readonly plus: true;
62
+ };
63
+ readonly oneSecondInterval: {
64
+ readonly free: false;
65
+ readonly plus: true;
66
+ };
67
+ readonly marketReplay: {
68
+ readonly free: true;
69
+ readonly plus: true;
70
+ };
71
+ readonly replayBookLayers: {
72
+ readonly free: true;
73
+ readonly plus: true;
74
+ };
75
+ readonly topCallersMyList: {
76
+ readonly free: false;
77
+ readonly plus: true;
78
+ };
79
+ readonly hyperliquidAddress: {
80
+ readonly free: false;
81
+ readonly plus: true;
82
+ };
83
+ readonly paneMerge: {
84
+ readonly free: false;
85
+ readonly plus: true;
86
+ };
87
+ readonly cmeL3OrderFlow: {
88
+ readonly free: false;
89
+ readonly plus: true;
90
+ };
91
+ };
92
+ type FeatureKey = keyof typeof FEATURE_LIMITS;
93
+ export declare const DOMAIN_FEATURE_KEYS: readonly ["replayReachBars"];
94
+ export type DomainFeatureKey = (typeof DOMAIN_FEATURE_KEYS)[number];
95
+ export type CountFeatureKey = {
96
+ [K in Exclude<FeatureKey, DomainFeatureKey>]: (typeof FEATURE_LIMITS)[K][Tier] extends CountLimit ? K : never;
97
+ }[Exclude<FeatureKey, DomainFeatureKey>];
98
+ export type BinaryFeatureKey = {
99
+ [K in FeatureKey]: (typeof FEATURE_LIMITS)[K][Tier] extends BinaryLimit ? K : never;
100
+ }[FeatureKey];
101
+ /**
102
+ * What the data-indicator budget spans: one chart (`indicatorsPerChart` per
103
+ * chart, today and Plus) or the whole layout (free tier v2: ONE shared budget
104
+ * of `indicatorsPerChart.free` slots across every chart of the layout).
105
+ */
106
+ export type IndicatorBudgetScope = 'chart' | 'layout';
107
+ /**
108
+ * Free rows that change under free tier v2 (`isFreeTierV2On()`; Plus rows never change).
109
+ * 16 = MAX_PANE_GRID_PANES, the largest grid (4x4). The free data budget keeps
110
+ * its number (`indicatorsPerChart.free`); the scope says what it spans.
111
+ */
112
+ export declare const FREE_TIER_V2_FREE_LIMITS: {
113
+ readonly multicharts: number;
114
+ };
115
+ /**
116
+ * THE count-limit read: FEATURE_LIMITS[key][tier] with the free-tier v2
117
+ * overlay applied to the free tier while the flag is on. Pure.
118
+ */
119
+ export declare function resolveCountLimit(key: CountFeatureKey, tier: Tier, freeTierV2: boolean): number;
120
+ /** THE scope decider: 'layout' iff free tier v2 is on and the GATING tier (role bypass = plus) is free. Pure. */
121
+ export declare function indicatorBudgetScopeFor(gatingTier: Tier, freeTierV2: boolean): IndicatorBudgetScope;
122
+ /**
123
+ * English display labels for gated features, kept beside FEATURE_LIMITS so a
124
+ * new feature key forces a label in the same change (Record types enforce it).
125
+ * The localized label lives at `featureGate.features.<plural-with-spaces-removed>`
126
+ * (count) or `featureGate.features.<key>` (binary); these are the locale-key
127
+ * source and the fallback when a locale lacks the key.
128
+ */
129
+ export declare const COUNT_FEATURE_LABELS: Record<CountFeatureKey, {
130
+ singular: string;
131
+ plural: string;
132
+ }>;
133
+ export declare const BINARY_FEATURE_LABELS: Record<BinaryFeatureKey, string>;
134
+ export {};
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Plan-Tier Feature Limits
3
+ *
4
+ * Single source of truth for per-tier feature limits. To add a new gated
5
+ * feature: add one row. To change a number: edit one value. Types enforce
6
+ * that every row has a value for every tier.
7
+ */
8
+ import { MAX_PANE_GRID_PANES } from './pane-grid.constants.js';
9
+ export const TIERS = ['free', 'plus'];
10
+ /**
11
+ * Mirror of the TSDB gateway's per-tier reach wall
12
+ * (tsdb-gateway `charts/tsdb-gateway-read/values.ore.yaml`,
13
+ * `read.kiyo_plus_tier.max_bar_limit`). The gateway rejects, or trims to the
14
+ * allowed window, any aggregated request whose span lies earlier than
15
+ * `now - maxBars × requestedInterval` for the user's tier. Replay derives
16
+ * per-resolution reach from this mirror so the UI never offers a depth the
17
+ * backend will refuse. Update this together with any ore config change.
18
+ * Keys are frontend interval labels of the request actually sent.
19
+ */
20
+ // '1s' 48h and '30m' deployed 2026-07-15 (ore commit 11e4397, "adjust kiyoplus
21
+ // paid users 1s bar limit for FE replay feature"); wire-verified same day.
22
+ // The custom labels (2m 3m 10m 45m 2h 6h 8h 12h 3d) have no row of their own:
23
+ // the gateway walls each at the default, 15,000 bars of the requested custom
24
+ // interval, never of the finer tier it rolls up from (kiyo_plus_validation.go,
25
+ // read 2026-10-03). '5s' 34,560 is two days like 1s (tsdb-gateway !2189); 15s
26
+ // and 30s ride the default (62.5 and 125 hours); the calendar intervals carry
27
+ // no fixed length there and are never walled.
28
+ const PLUS_GATEWAY_MAX_BARS = {
29
+ default: 15_000,
30
+ intervals: { '1h': 25_000, '30m': 50_000, '1s': 172_800, '5s': 34_560 },
31
+ };
32
+ // Free shares the Plus reach since tsdb-gateway cee00f2 ("read: give the free
33
+ // tier Plus bar limits", 2026-09-29): history depth is no longer a plan feature.
34
+ export const GATEWAY_TIER_MAX_BARS = {
35
+ free: PLUS_GATEWAY_MAX_BARS,
36
+ plus: PLUS_GATEWAY_MAX_BARS,
37
+ };
38
+ /** The tier's gateway reach in bars at the interval actually sent (a GATEWAY_TIER_MAX_BARS read). Pure. */
39
+ export function gatewayTierMaxBars(tier, requestInterval) {
40
+ const row = GATEWAY_TIER_MAX_BARS[tier];
41
+ return row.intervals[requestInterval] ?? row.default;
42
+ }
43
+ export const FEATURE_LIMITS = {
44
+ // Count-based (soft-block at creation)
45
+ workspaces: { free: 10, plus: 50 },
46
+ indicatorsPerChart: { free: 3, plus: 10 },
47
+ // Mirrors the orange-v2-backend gateway quota (src/utility/feature-gate.ts
48
+ // FEATURE_LIMITS.privateKScripts); change both together or the UI gate and
49
+ // the server 403 disagree.
50
+ privateKScripts: { free: 100, plus: 500 },
51
+ multicharts: { free: 1, plus: 16 },
52
+ // TWO independent alert quotas, one per kind (alert-kind.util.ts is the
53
+ // rule): price alerts are the native raw-level series alerts (price, open
54
+ // interest, funding, liquidations and the other native templates, no user
55
+ // script to run); indicator alerts are user kScript, built-in indicator
56
+ // scripts and hosted Indicators. Mirrors orange-v2-backend
57
+ // src/utility/feature-gate.ts FEATURE_LIMITS.priceAlerts / .indicatorAlerts
58
+ // and tharamine-user-service's agent-lane tier table
59
+ // (src/controllers/api-v2/kscript-alert.controller.ts): change all three
60
+ // together or the UI gate and the server 403 disagree.
61
+ priceAlerts: { free: 200, plus: 500 },
62
+ indicatorAlerts: { free: 5, plus: 50 },
63
+ widgetsPerLayout: { free: 3, plus: 10 },
64
+ publishedLayouts: { free: 10, plus: 50 },
65
+ // Domain clamps (limit access without counting created resources)
66
+ replayReachBars: { free: Infinity, plus: Infinity },
67
+ // Binary (hide / disable)
68
+ // 4K heatmaps are open to free since 2026-10-01 at the free row count
69
+ // (getOptimalMaxDepth), so free 4K loads no more rows than free HD. Depth
70
+ // is what stays Plus (fullOrderbookDepth). orange mirrors this row for the
71
+ // workspace create gate.
72
+ heatmap4K: { free: true, plus: true },
73
+ fullOrderbookDepth: { free: false, plus: true },
74
+ // Seconds rungs (1s 5s 15s 30s), tape mode and the replay tick lane are open
75
+ // to free since 2026-10-08 everywhere but CME: the crypto plane serves free
76
+ // tokens the per-second book (tsdb-gateway 16a17f1), the CME plane still
77
+ // refuses it. So this row gates CME markets only (isTierGatedSecondsInterval);
78
+ // orange mirrors it for workspace create.
79
+ oneSecondInterval: { free: false, plus: true },
80
+ // Market replay is open to free since 2026-09-29 (entry, reach and book
81
+ // layers, gated in useChartReplay.enter and the replay plan gate). The tick
82
+ // lane rides oneSecondInterval, so it is Plus on CME only.
83
+ marketReplay: { free: true, plus: true },
84
+ replayBookLayers: { free: true, plus: true },
85
+ topCallersMyList: { free: false, plus: true },
86
+ hyperliquidAddress: { free: false, plus: true },
87
+ // Pane merge (shared off-chart panes + stacked member axes) is Plus-only.
88
+ // The engine-side acceptance gate (settings.paneMergeEnabled) enforces
89
+ // restores; this row gates the merge CLICK and the scale menu.
90
+ paneMerge: { free: false, plus: true },
91
+ // CME L3 order flow (Orders column, strong levels, detector events, MBO
92
+ // Blocks, chart level badges) is Plus-only. The surfaces gate on
93
+ // isL3Entitled(), which is hasFeature('cmeL3OrderFlow') → THIS row, behind
94
+ // a `blacklisted` role deny. The login/refresh body carries no entitlement any more; the
95
+ // rule itself lives in OPA's roles.rego, which the data plane evaluates
96
+ // from the signed claims. This row also names the feature for the shared
97
+ // upgrade dialog the L3 plus-gate dialog's CTA hands off to.
98
+ cmeL3OrderFlow: { free: false, plus: true },
99
+ };
100
+ export const DOMAIN_FEATURE_KEYS = ['replayReachBars'];
101
+ /**
102
+ * Free rows that change under free tier v2 (`isFreeTierV2On()`; Plus rows never change).
103
+ * 16 = MAX_PANE_GRID_PANES, the largest grid (4x4). The free data budget keeps
104
+ * its number (`indicatorsPerChart.free`); the scope says what it spans.
105
+ */
106
+ export const FREE_TIER_V2_FREE_LIMITS = {
107
+ multicharts: MAX_PANE_GRID_PANES,
108
+ };
109
+ /**
110
+ * THE count-limit read: FEATURE_LIMITS[key][tier] with the free-tier v2
111
+ * overlay applied to the free tier while the flag is on. Pure.
112
+ */
113
+ export function resolveCountLimit(key, tier, freeTierV2) {
114
+ if (freeTierV2 && tier === 'free') {
115
+ const overlay = FREE_TIER_V2_FREE_LIMITS[key];
116
+ if (overlay !== undefined)
117
+ return overlay;
118
+ }
119
+ return FEATURE_LIMITS[key][tier];
120
+ }
121
+ /** THE scope decider: 'layout' iff free tier v2 is on and the GATING tier (role bypass = plus) is free. Pure. */
122
+ export function indicatorBudgetScopeFor(gatingTier, freeTierV2) {
123
+ return freeTierV2 && gatingTier === 'free' ? 'layout' : 'chart';
124
+ }
125
+ /**
126
+ * English display labels for gated features, kept beside FEATURE_LIMITS so a
127
+ * new feature key forces a label in the same change (Record types enforce it).
128
+ * The localized label lives at `featureGate.features.<plural-with-spaces-removed>`
129
+ * (count) or `featureGate.features.<key>` (binary); these are the locale-key
130
+ * source and the fallback when a locale lacks the key.
131
+ */
132
+ export const COUNT_FEATURE_LABELS = {
133
+ workspaces: { singular: 'workspace', plural: 'workspaces' },
134
+ indicatorsPerChart: { singular: 'indicator', plural: 'indicators' },
135
+ // One pool for every saved private draft, kScript and TypeScript Indicator alike
136
+ // (localized under featureGate.features.privatescript / privatescripts).
137
+ privateKScripts: { singular: 'private script', plural: 'private scripts' },
138
+ multicharts: { singular: 'multichart', plural: 'multicharts' },
139
+ // Localized under featureGate.features.pricealerts / indicatoralerts.
140
+ priceAlerts: { singular: 'price alert', plural: 'price alerts' },
141
+ indicatorAlerts: { singular: 'indicator alert', plural: 'indicator alerts' },
142
+ widgetsPerLayout: { singular: 'widget', plural: 'widgets' },
143
+ publishedLayouts: { singular: 'published layout', plural: 'published layouts' },
144
+ };
145
+ export const BINARY_FEATURE_LABELS = {
146
+ heatmap4K: '4K Heatmap',
147
+ fullOrderbookDepth: 'Full Orderbook Depth',
148
+ oneSecondInterval: '1-Second Interval',
149
+ marketReplay: 'Market Replay',
150
+ replayBookLayers: 'Book Replay',
151
+ topCallersMyList: 'Top Callers (My List)',
152
+ hyperliquidAddress: 'Hyperliquid Address Overlay',
153
+ paneMerge: 'Pane Merge',
154
+ cmeL3OrderFlow: 'CME L3 Order Flow',
155
+ };
@@ -0,0 +1,87 @@
1
+ import type { VenueMarketKind } from '../utility/chart/marketKind.util.js';
2
+ /**
3
+ * Per-`MarketKind` capability declarations. Replaces ad-hoc `checkIs*`
4
+ * predicates and the indicator exception lists in `tradfi.constants.ts`
5
+ * and `indicator.constants.ts`.
6
+ *
7
+ * Read via `getCapabilities(exchange)` from `marketKind.util.ts` — never
8
+ * import `MARKET_CAPABILITIES` directly at call sites.
9
+ */
10
+ export interface IMarketCapabilities {
11
+ /** `'uniform'` = bars at exact intervalMs spacing (crypto). `'irregular'` =
12
+ * bars at session/economic boundaries (tradfi 9:30, fred releases). */
13
+ barTimestamps: 'uniform' | 'irregular';
14
+ /** `'period'` = backend takes `(from_ts, period_seconds)`. `'count'` =
15
+ * backend takes `(from_ts, limit, sortDirection)` for "last N bars". */
16
+ fetchMode: 'period' | 'count';
17
+ /** Tradfi has volume bars but no stats panel. */
18
+ supportsVolumeStats: boolean;
19
+ supportsTradesFeed: boolean;
20
+ supportsMarketStats: boolean;
21
+ supportsFRVP: boolean;
22
+ /** The terminal Orderbook tab (Book/Delta/DOM). Not an execution flag — CME
23
+ * sells full-depth book data with trading disabled. */
24
+ supportsOrderbook: boolean;
25
+ /** Determines how alert symbols are formatted. Polymarket uses the market's
26
+ * conditionId; tradfi/forex/etc. use coin-style; dex uses pool slug. */
27
+ alertSymbolMode: 'coin' | 'slug' | 'conditionId';
28
+ /** Finest interval the venue serves, in ms. Absent = the interval ladder's
29
+ * own floor applies (economic series observe at most once a day). */
30
+ minIntervalMs?: number;
31
+ /** Calendar intervals (1M / 3M / 6M / 1Y) are selectable on this venue (on a
32
+ * formula, on every leg's venue). The gateway buckets them on UTC calendar
33
+ * boundaries for every type with a daily or monthly tier (tsdb-gateway
34
+ * !2190), CME futures on trade-date months (29dda19); economic series bucket
35
+ * them in their own builders, which serve no 6M. Absent = false: HIP-4, DEX
36
+ * pools and on-chain pools. */
37
+ allowsCalendarIntervals?: boolean;
38
+ }
39
+ /**
40
+ * The ONE futures capability policy for the CME-governed exchanges (CME,
41
+ * CBOT, NYMEX, COMEX, plus the GLOBEX alias). Registered as the `'futures'`
42
+ * kind below, which `getMarketKind` resolves for every governed venue. It
43
+ * replaces the accidental split where CBOT/NYMEX/COMEX fell through commodity
44
+ * behavior while CME fell through crypto behavior.
45
+ *
46
+ * Shape rationale: session markets (irregular, session-gapped bars; the
47
+ * TitanCharts `'commodity'` kind carries the matching engine gap policy, see
48
+ * `toTitanMarketKind`) served by the EXISTING V2 TSDB/live-feed pipeline
49
+ * (period fetch, TRADE data), with every trades/volume/order-flow/book
50
+ * surface available and no execution.
51
+ */
52
+ export declare const CME_FUTURES_CAPABILITIES: IMarketCapabilities;
53
+ /**
54
+ * On-chain pools served by blk (`isBlkExchange`: every SOLANA_ONCHAIN market). They classify as the
55
+ * crypto kind (uniform bars, period fetch, a trade tape and market stats), but blk serves no order book
56
+ * and no volume profile, so the book surfaces (the Orderbook tab, its block-size prefetch) and the
57
+ * Fixed Range Volume Profile tool stand down. `getCapabilities` returns this for those exchanges.
58
+ */
59
+ /**
60
+ * US equity and index options over the OPRA entitlement gate (the `'options'`
61
+ * kind). Session markets served by the same reader/live-feed pipeline as CME
62
+ * (period fetch, TRADE data sided by the feed) with trades, volume, market
63
+ * stats and the volume-profile surfaces, but no order book: OPRA is top of
64
+ * book only and the feed publishes no book types. Alerts are refused on the
65
+ * plane by policy, so the alert symbol mode is moot.
66
+ */
67
+ export declare const OPRA_OPTIONS_CAPABILITIES: IMarketCapabilities;
68
+ export declare const ONCHAIN_POOL_CAPABILITIES: IMarketCapabilities;
69
+ export declare const MARKET_CAPABILITIES: Record<VenueMarketKind, IMarketCapabilities>;
70
+ /** Every market kind (the FE `'futures'` kind included). Derived from
71
+ * `MARKET_CAPABILITIES` so adding a new kind to the registry automatically
72
+ * extends this set. */
73
+ export declare const ALL_MARKET_KINDS: readonly VenueMarketKind[];
74
+ /** Crypto + crypto-like (hip3) + permissive polymarket — the default for
75
+ * indicators without a `marketKinds` declaration today (legacy fallback
76
+ * semantics). */
77
+ export declare const CRYPTO_AND_CRYPTO_LIKE_KINDS: readonly VenueMarketKind[];
78
+ /** Crypto + permissive polymarket — for aggregated/heavy-data indicators
79
+ * that explicitly DON'T support hip3 (per `HIP3_BLOCKED_INDICATORS`). */
80
+ export declare const CRYPTO_ONLY_KINDS: readonly VenueMarketKind[];
81
+ /** Crypto + crypto-like + tradfi (volume-aware indicators with US equity data). */
82
+ export declare const CRYPTO_LIKE_AND_TRADFI_KINDS: readonly VenueMarketKind[];
83
+ /** Markets whose native candle volume can drive VWAP. */
84
+ export declare const VWAP_MARKET_KINDS: readonly VenueMarketKind[];
85
+ /** All kinds except dex/economic (PM_SIGNAL — works on instruments with USD pricing
86
+ * but not on DEX pairs or economic series). */
87
+ export declare const PM_SIGNAL_KINDS: readonly VenueMarketKind[];
@@ -0,0 +1,213 @@
1
+ import { ECONOMIC_MIN_INTERVAL_MS } from './economic.constants.js';
2
+ /**
3
+ * The ONE futures capability policy for the CME-governed exchanges (CME,
4
+ * CBOT, NYMEX, COMEX, plus the GLOBEX alias). Registered as the `'futures'`
5
+ * kind below, which `getMarketKind` resolves for every governed venue. It
6
+ * replaces the accidental split where CBOT/NYMEX/COMEX fell through commodity
7
+ * behavior while CME fell through crypto behavior.
8
+ *
9
+ * Shape rationale: session markets (irregular, session-gapped bars; the
10
+ * TitanCharts `'commodity'` kind carries the matching engine gap policy, see
11
+ * `toTitanMarketKind`) served by the EXISTING V2 TSDB/live-feed pipeline
12
+ * (period fetch, TRADE data), with every trades/volume/order-flow/book
13
+ * surface available and no execution.
14
+ */
15
+ export const CME_FUTURES_CAPABILITIES = {
16
+ barTimestamps: 'irregular',
17
+ fetchMode: 'period',
18
+ supportsVolumeStats: true,
19
+ supportsTradesFeed: true,
20
+ supportsMarketStats: true,
21
+ supportsFRVP: true,
22
+ supportsOrderbook: true,
23
+ alertSymbolMode: 'coin',
24
+ // A CME month groups whole trade dates (sessions open 17:00 Chicago the
25
+ // evening before), not UTC calendar days: the gateway builds those months
26
+ // (tsdb-gateway 29dda19, intervals part 4) and live candles key the same
27
+ // ones (cmeSessionBucketMs).
28
+ allowsCalendarIntervals: true,
29
+ };
30
+ /**
31
+ * On-chain pools served by blk (`isBlkExchange`: every SOLANA_ONCHAIN market). They classify as the
32
+ * crypto kind (uniform bars, period fetch, a trade tape and market stats), but blk serves no order book
33
+ * and no volume profile, so the book surfaces (the Orderbook tab, its block-size prefetch) and the
34
+ * Fixed Range Volume Profile tool stand down. `getCapabilities` returns this for those exchanges.
35
+ */
36
+ /**
37
+ * US equity and index options over the OPRA entitlement gate (the `'options'`
38
+ * kind). Session markets served by the same reader/live-feed pipeline as CME
39
+ * (period fetch, TRADE data sided by the feed) with trades, volume, market
40
+ * stats and the volume-profile surfaces, but no order book: OPRA is top of
41
+ * book only and the feed publishes no book types. Alerts are refused on the
42
+ * plane by policy, so the alert symbol mode is moot.
43
+ */
44
+ export const OPRA_OPTIONS_CAPABILITIES = {
45
+ barTimestamps: 'irregular',
46
+ fetchMode: 'period',
47
+ supportsVolumeStats: true,
48
+ supportsTradesFeed: true,
49
+ supportsMarketStats: true,
50
+ supportsFRVP: true,
51
+ supportsOrderbook: false,
52
+ alertSymbolMode: 'coin',
53
+ allowsCalendarIntervals: false,
54
+ };
55
+ export const ONCHAIN_POOL_CAPABILITIES = {
56
+ barTimestamps: 'uniform',
57
+ fetchMode: 'period',
58
+ supportsVolumeStats: true,
59
+ supportsTradesFeed: true,
60
+ supportsMarketStats: true,
61
+ supportsFRVP: false,
62
+ supportsOrderbook: false,
63
+ alertSymbolMode: 'slug',
64
+ };
65
+ export const MARKET_CAPABILITIES = {
66
+ crypto: {
67
+ barTimestamps: 'uniform',
68
+ fetchMode: 'period',
69
+ supportsVolumeStats: true,
70
+ supportsTradesFeed: true,
71
+ supportsMarketStats: true,
72
+ supportsFRVP: true,
73
+ supportsOrderbook: true,
74
+ alertSymbolMode: 'slug',
75
+ allowsCalendarIntervals: true,
76
+ },
77
+ hip3: {
78
+ barTimestamps: 'uniform',
79
+ fetchMode: 'period',
80
+ supportsVolumeStats: true,
81
+ supportsTradesFeed: true,
82
+ supportsMarketStats: true,
83
+ supportsFRVP: true,
84
+ supportsOrderbook: true,
85
+ alertSymbolMode: 'slug',
86
+ allowsCalendarIntervals: true,
87
+ },
88
+ hip4: {
89
+ barTimestamps: 'uniform',
90
+ fetchMode: 'period',
91
+ supportsVolumeStats: false,
92
+ supportsTradesFeed: false,
93
+ // The ticker bar's 24h volume cell. HIP4 earns it because the gateway serves
94
+ // its outcome series a volume lane that quote-normalizes to USDC — the unit
95
+ // HyperLiquid itself publishes.
96
+ supportsMarketStats: true,
97
+ supportsFRVP: false,
98
+ supportsOrderbook: true,
99
+ alertSymbolMode: 'conditionId',
100
+ },
101
+ tradfi: {
102
+ barTimestamps: 'irregular',
103
+ fetchMode: 'count',
104
+ supportsVolumeStats: false,
105
+ supportsTradesFeed: false,
106
+ supportsMarketStats: false,
107
+ supportsFRVP: false,
108
+ supportsOrderbook: false,
109
+ alertSymbolMode: 'coin',
110
+ allowsCalendarIntervals: true,
111
+ },
112
+ forex: {
113
+ barTimestamps: 'irregular',
114
+ fetchMode: 'count',
115
+ supportsVolumeStats: false,
116
+ supportsTradesFeed: false,
117
+ supportsMarketStats: false,
118
+ supportsFRVP: false,
119
+ supportsOrderbook: false,
120
+ alertSymbolMode: 'coin',
121
+ allowsCalendarIntervals: true,
122
+ },
123
+ commodity: {
124
+ barTimestamps: 'irregular',
125
+ fetchMode: 'count',
126
+ supportsVolumeStats: false,
127
+ supportsTradesFeed: false,
128
+ supportsMarketStats: false,
129
+ supportsFRVP: false,
130
+ supportsOrderbook: false,
131
+ alertSymbolMode: 'coin',
132
+ allowsCalendarIntervals: true,
133
+ },
134
+ dex: {
135
+ barTimestamps: 'irregular',
136
+ fetchMode: 'count',
137
+ supportsVolumeStats: false,
138
+ supportsTradesFeed: false,
139
+ supportsMarketStats: false,
140
+ supportsFRVP: false,
141
+ supportsOrderbook: false,
142
+ alertSymbolMode: 'coin',
143
+ },
144
+ polymarket: {
145
+ barTimestamps: 'uniform',
146
+ fetchMode: 'period',
147
+ // Volume / trades / market stats render in polymarket's own outcome-
148
+ // aware mode (the widgets branch internally on `checkIsPolymarket`).
149
+ // The capability flag here controls whether the widget mounts at all.
150
+ supportsVolumeStats: true,
151
+ supportsTradesFeed: true,
152
+ supportsMarketStats: true,
153
+ // A single outcome serves real volume profiles (POLYMARKET_ALLOWED_INDICATORS);
154
+ // the all-outcomes event view stays blocked by the mode gate.
155
+ supportsFRVP: true,
156
+ supportsOrderbook: true,
157
+ alertSymbolMode: 'conditionId',
158
+ allowsCalendarIntervals: true,
159
+ },
160
+ economic: {
161
+ // Economic releases land at irregular wall-clock times but at uniform
162
+ // logical cadence (daily/monthly/quarterly). Pre-migration the codebase
163
+ // treated FRED bars as uniform (excluded from `checkIsIndexMode`),
164
+ // so the viewport-coord paths use timestamp-based positioning.
165
+ barTimestamps: 'uniform',
166
+ fetchMode: 'period',
167
+ supportsVolumeStats: false,
168
+ supportsTradesFeed: false,
169
+ // Single-value series (no OHLC). The market stats widget renders OHLC;
170
+ // legacy showed it anyway (empty/broken).
171
+ supportsMarketStats: false,
172
+ supportsFRVP: false,
173
+ supportsOrderbook: false,
174
+ alertSymbolMode: 'slug',
175
+ minIntervalMs: ECONOMIC_MIN_INTERVAL_MS,
176
+ allowsCalendarIntervals: true,
177
+ },
178
+ // Governed CME venues. Same object as the named export so capability reads
179
+ // keep record identity with CME_FUTURES_CAPABILITIES.
180
+ futures: CME_FUTURES_CAPABILITIES,
181
+ options: OPRA_OPTIONS_CAPABILITIES,
182
+ };
183
+ // =============================================================================
184
+ // MarketKind shorthand sets — for `IIndicatorControl.marketKinds` declarations.
185
+ // Names describe SEMANTICS, not enumeration; pick the one whose meaning matches
186
+ // the indicator's intent rather than constructing an array literal at the call
187
+ // site.
188
+ // =============================================================================
189
+ /** Every market kind (the FE `'futures'` kind included). Derived from
190
+ * `MARKET_CAPABILITIES` so adding a new kind to the registry automatically
191
+ * extends this set. */
192
+ export const ALL_MARKET_KINDS = Object.keys(MARKET_CAPABILITIES);
193
+ /** Crypto + crypto-like (hip3) + permissive polymarket — the default for
194
+ * indicators without a `marketKinds` declaration today (legacy fallback
195
+ * semantics). */
196
+ export const CRYPTO_AND_CRYPTO_LIKE_KINDS = ['crypto', 'hip3', 'polymarket'];
197
+ /** Crypto + permissive polymarket — for aggregated/heavy-data indicators
198
+ * that explicitly DON'T support hip3 (per `HIP3_BLOCKED_INDICATORS`). */
199
+ export const CRYPTO_ONLY_KINDS = ['crypto', 'polymarket'];
200
+ /** Crypto + crypto-like + tradfi (volume-aware indicators with US equity data). */
201
+ export const CRYPTO_LIKE_AND_TRADFI_KINDS = ['crypto', 'hip3', 'tradfi', 'polymarket'];
202
+ /** Markets whose native candle volume can drive VWAP. */
203
+ export const VWAP_MARKET_KINDS = [...CRYPTO_LIKE_AND_TRADFI_KINDS, 'hip4'];
204
+ /** All kinds except dex/economic (PM_SIGNAL — works on instruments with USD pricing
205
+ * but not on DEX pairs or economic series). */
206
+ export const PM_SIGNAL_KINDS = [
207
+ 'crypto',
208
+ 'hip3',
209
+ 'tradfi',
210
+ 'forex',
211
+ 'commodity',
212
+ 'polymarket',
213
+ ];