@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,111 @@
1
+ // Expiry semantics for CME-governed futures contract codes (BTCN6, 6EU6,
2
+ // ESZ26). Pure string/date logic applied ONLY to venues the transform already
3
+ // classified as governed contracts, so plain crypto/equity symbols can never
4
+ // be misread as month codes.
5
+ import { isContinuousSymbol } from '../chart/continuous-contracts.util.js';
6
+ import { getDateLocale } from '../intl-locale.util.js';
7
+ /** CME delivery month codes, in month order (F=Jan ... Z=Dec). */
8
+ const MONTH_CODES = 'FGHJKMNQUVXZ';
9
+ // Root (1+ chars, lazily matched) + month code + 1- or 2-digit year.
10
+ const CONTRACT_RE = /^(.+?)([FGHJKMNQUVXZ])(\d{1,2})$/;
11
+ /**
12
+ * Decodes a governed contract code into its delivery month/year, or null when
13
+ * the code does not carry one. Single-digit years are resolved to the nearest
14
+ * matching year in a [now - 2y, now + 7y] window: listings only ever cover
15
+ * nearby expiries, and the window tolerates recently expired contracts
16
+ * without ever wrapping a live listing into the past decade.
17
+ */
18
+ export function parseCmeContractExpiry(rawSymbol, now = new Date()) {
19
+ if (!rawSymbol)
20
+ return null;
21
+ const match = CONTRACT_RE.exec(rawSymbol.trim().toUpperCase());
22
+ if (!match)
23
+ return null;
24
+ const [, root, monthCode, yearDigits] = match;
25
+ const monthIndex = MONTH_CODES.indexOf(monthCode);
26
+ if (monthIndex < 0)
27
+ return null;
28
+ let year;
29
+ if (yearDigits.length === 2) {
30
+ year = 2000 + Number(yearDigits);
31
+ }
32
+ else {
33
+ const digit = Number(yearDigits);
34
+ const windowStart = now.getUTCFullYear() - 2;
35
+ year = windowStart + ((((digit - windowStart) % 10) + 10) % 10);
36
+ }
37
+ return { root, monthIndex, year };
38
+ }
39
+ /**
40
+ * Conservative expiry instant: the END of the delivery month (UTC). Real CME
41
+ * expiry days vary by product (e.g. last Friday for BTC futures); month-end
42
+ * errs toward keeping a just-expired contract visible for a few extra days
43
+ * rather than ever hiding a still-live one.
44
+ */
45
+ export function contractExpiryEndMs(expiry) {
46
+ return Date.UTC(expiry.year, expiry.monthIndex + 1, 1) - 1;
47
+ }
48
+ export function isContractExpired(rawSymbol, now = new Date()) {
49
+ const expiry = parseCmeContractExpiry(rawSymbol, now);
50
+ if (!expiry)
51
+ return false;
52
+ return contractExpiryEndMs(expiry) < now.getTime();
53
+ }
54
+ /** Localized delivery label, e.g. "Jul 2026" / "2026年7月". '' when undecodable. */
55
+ export function formatContractExpiry(rawSymbol, locale, now = new Date()) {
56
+ const expiry = parseCmeContractExpiry(rawSymbol, now);
57
+ if (!expiry)
58
+ return '';
59
+ try {
60
+ return new Intl.DateTimeFormat(getDateLocale(locale), { month: 'short', year: 'numeric', timeZone: 'UTC' }).format(new Date(Date.UTC(expiry.year, expiry.monthIndex, 15)));
61
+ }
62
+ catch {
63
+ return '';
64
+ }
65
+ }
66
+ /**
67
+ * Search-list semantics for an asset's venues, applied only to governed
68
+ * contracts (isGovernedContract must be precomputed by the caller for each
69
+ * venue): expired contracts are dropped, live ones carry their expiry, are
70
+ * sorted soonest-first within the governed subsequence (non-governed venues
71
+ * keep the backend's ordering and positions), and the nearest expiry is
72
+ * tagged as the front month. Continuous rows (ES1!) never expire, pin FIRST
73
+ * in the governed run (before the front month), and never take the
74
+ * front-month tag: they are the "just chart it" entry point above the
75
+ * concrete expiries.
76
+ */
77
+ export function annotateGovernedContracts(venues, isGoverned, now = new Date()) {
78
+ const nowMs = now.getTime();
79
+ const kept = [];
80
+ const continuous = [];
81
+ const governed = [];
82
+ for (const venue of venues) {
83
+ if (!isGoverned(venue)) {
84
+ kept.push(venue);
85
+ continue;
86
+ }
87
+ if (isContinuousSymbol(venue.rawSymbol)) {
88
+ continuous.push({ ...venue, isContinuous: true, isFrontMonth: false, contractExpiryTs: undefined });
89
+ continue;
90
+ }
91
+ const expiry = parseCmeContractExpiry(venue.rawSymbol, now);
92
+ const expiryMs = expiry ? contractExpiryEndMs(expiry) : null;
93
+ if (expiryMs !== null && expiryMs < nowMs)
94
+ continue; // expired: out of the list
95
+ governed.push({ venue, expiryMs });
96
+ }
97
+ if (continuous.length === 0 && governed.length === 0)
98
+ return kept;
99
+ // Soonest expiry first; undecodable codes sink to the end of the governed run.
100
+ governed.sort((a, b) => (a.expiryMs ?? Number.MAX_SAFE_INTEGER) - (b.expiryMs ?? Number.MAX_SAFE_INTEGER));
101
+ const frontMs = governed[0]?.expiryMs ?? null;
102
+ const annotated = governed.map(({ venue, expiryMs }) => ({
103
+ ...venue,
104
+ contractExpiryTs: expiryMs ?? undefined,
105
+ isFrontMonth: expiryMs !== null && expiryMs === frontMs,
106
+ }));
107
+ // Reinsert the governed run at the position of its first original occurrence.
108
+ const firstGovernedIndex = venues.findIndex((v) => isGoverned(v));
109
+ const insertAt = kept.length === venues.length ? kept.length : Math.min(firstGovernedIndex, kept.length);
110
+ return [...kept.slice(0, insertAt), ...continuous, ...annotated, ...kept.slice(insertAt)];
111
+ }
@@ -0,0 +1,58 @@
1
+ import type { GateProvider } from '../../workers/constants/socket-slots.js';
2
+ import { isOpraGoverned } from './opra-governed.util.js';
3
+ export interface GatePlane {
4
+ provider: GateProvider;
5
+ /** UPPERCASE exchange codes the plane governs. */
6
+ exchanges: readonly string[];
7
+ /** The delayed tier's nominal delay, used until the tier frame reports `delay_seconds`. */
8
+ delayedDefaultSeconds: number;
9
+ /** What a logged-out reader request gets: the CME Surface A snapshot, or nothing (OPRA has no snapshot). */
10
+ guestReaderTransport: 'surfaceA' | 'none';
11
+ /** The plane relays order-book types (OPRA is top of book only; its feed publishes none). */
12
+ servesBooks: boolean;
13
+ /** The gate mounts /v3 reader tiers beside /v2 (OPRA: not mounted). */
14
+ hasV3Tiers: boolean;
15
+ /**
16
+ * A request naming this plane's exchanges beside ungoverned ones: `'ungoverned'` keeps the
17
+ * historical CME behaviour (the cross-exchange category query rides the public reader, which
18
+ * simply holds no CME rows); `'refuse'` never lets the request leave for the public socket
19
+ * (OPRA rows live on the CME cluster only, so a fallback would answer silently empty).
20
+ */
21
+ mixedWithPublic: 'ungoverned' | 'refuse';
22
+ }
23
+ export declare const GATE_PLANES: Readonly<Record<GateProvider, GatePlane>>;
24
+ export { isOpraGoverned };
25
+ /** The gate plane one exchange code belongs to, or null when no gate governs it. */
26
+ export declare function gateProviderForExchange(exchange: string | undefined | null): GateProvider | null;
27
+ /** One exchange member of a request payload as an UPPERCASE code: a name, or a pb-common enum number. */
28
+ export declare function exchangeCodeOf(member: unknown): string | null;
29
+ /**
30
+ * How a request's exchange field routes. `public`: no gate governs any member. `gate`: every
31
+ * member is on the same plane. `refused`: the request cannot ride one socket safely, either
32
+ * because it spans two gates (`mixed-planes`), or because it mixes a plane that refuses the
33
+ * public fallback with ungoverned venues (`mixed-public-governed`), or because a member is not
34
+ * an exchange at all (`invalid-exchange`). A CME plus ungoverned mix stays `public` (the plane's
35
+ * `mixedWithPublic` says so), which is the behaviour every CME call site was built on.
36
+ */
37
+ export type GateRequestPlane = {
38
+ kind: 'public';
39
+ } | {
40
+ kind: 'gate';
41
+ plane: GatePlane;
42
+ } | {
43
+ kind: 'refused';
44
+ reason: 'mixed-planes' | 'mixed-public-governed' | 'invalid-exchange';
45
+ };
46
+ export declare function classifyGateRequestPlane(exchange: unknown): GateRequestPlane;
47
+ /**
48
+ * The plane a request's exchange resolves to, or null when it does not ride a gate (public, or
49
+ * refused: callers that must tell the two apart ask `classifyGateRequestPlane`). A string or a
50
+ * non-empty same-plane array resolves (the `.every` rule of the old `isGovernedExchange`).
51
+ */
52
+ export declare function governedPlaneOf(exchange: unknown): GatePlane | null;
53
+ /** True when a gate plane governs the exchange (string or same-plane array). */
54
+ export declare function isGovernedPlaneExchange(exchange: unknown): boolean;
55
+ /** Nominal delayed-tier seconds for an exchange: the plane's default, or CME's when ungoverned (legacy callers). */
56
+ export declare function delayedDefaultSecondsFor(exchange: unknown): number;
57
+ /** Display twin of `delayedDefaultSecondsFor`, in whole minutes. */
58
+ export declare function delayedDefaultMinutesFor(exchange: unknown): number;
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The entitlement-gate planes: which gate serves an exchange, and the per-plane
3
+ * facts routing needs (delayed default, guest treatment, books). CME and OPRA
4
+ * speak the same gate protocol on different hosts, licences and kick channels.
5
+ *
6
+ * Worker-safe and store-free (imports the interfaces, the slot table and the
7
+ * CME predicate only), so the worker send path and the main-thread services
8
+ * share one answer. `isCmeGoverned` stays the CME-only predicate for billing,
9
+ * badges and copy; plane-neutral routing asks `governedPlaneOf` instead.
10
+ */
11
+ import { Exchange } from '@orangecharts/orange-v2-pb-common';
12
+ import { CME_GOVERNED_EXCHANGES } from '../../interfaces/cme-realtime.interface.js';
13
+ import { OPRA_DELAY_MINUTES, OPRA_GOVERNED_EXCHANGES } from '../../interfaces/opra-realtime.interface.js';
14
+ import { CME_DELAY_MINUTES, isCmeGoverned, normalizeExchangeCode } from '../chart/cme-realtime.util.js';
15
+ import { isOpraGoverned } from './opra-governed.util.js';
16
+ export const GATE_PLANES = {
17
+ cme: {
18
+ provider: 'cme',
19
+ exchanges: CME_GOVERNED_EXCHANGES,
20
+ delayedDefaultSeconds: CME_DELAY_MINUTES * 60,
21
+ guestReaderTransport: 'surfaceA',
22
+ servesBooks: true,
23
+ hasV3Tiers: true,
24
+ mixedWithPublic: 'ungoverned',
25
+ },
26
+ opra: {
27
+ provider: 'opra',
28
+ exchanges: OPRA_GOVERNED_EXCHANGES,
29
+ delayedDefaultSeconds: OPRA_DELAY_MINUTES * 60,
30
+ guestReaderTransport: 'none',
31
+ servesBooks: false,
32
+ hasV3Tiers: false,
33
+ mixedWithPublic: 'refuse',
34
+ },
35
+ };
36
+ // The OPRA check is the pure leaf's (opra-governed.util); its importers keep this path.
37
+ export { isOpraGoverned };
38
+ /** The gate plane one exchange code belongs to, or null when no gate governs it. */
39
+ export function gateProviderForExchange(exchange) {
40
+ if (isCmeGoverned(exchange))
41
+ return 'cme';
42
+ if (isOpraGoverned(exchange))
43
+ return 'opra';
44
+ return null;
45
+ }
46
+ /** One exchange member of a request payload as an UPPERCASE code: a name, or a pb-common enum number. */
47
+ export function exchangeCodeOf(member) {
48
+ if (typeof member === 'number')
49
+ return Exchange[member] ?? null;
50
+ return normalizeExchangeCode(member);
51
+ }
52
+ export function classifyGateRequestPlane(exchange) {
53
+ const members = Array.isArray(exchange) ? exchange : [exchange];
54
+ if (members.length === 0 || (members.length === 1 && (members[0] === undefined || members[0] === null))) {
55
+ return { kind: 'public' };
56
+ }
57
+ let provider = null;
58
+ let ungoverned = 0;
59
+ for (const member of members) {
60
+ const code = exchangeCodeOf(member);
61
+ if (code === null)
62
+ return { kind: 'refused', reason: 'invalid-exchange' };
63
+ const memberProvider = gateProviderForExchange(code);
64
+ if (memberProvider === null) {
65
+ ungoverned += 1;
66
+ continue;
67
+ }
68
+ if (provider !== null && provider !== memberProvider)
69
+ return { kind: 'refused', reason: 'mixed-planes' };
70
+ provider = memberProvider;
71
+ }
72
+ if (provider === null)
73
+ return { kind: 'public' };
74
+ const plane = GATE_PLANES[provider];
75
+ if (ungoverned === 0)
76
+ return { kind: 'gate', plane };
77
+ return plane.mixedWithPublic === 'refuse' ? { kind: 'refused', reason: 'mixed-public-governed' } : { kind: 'public' };
78
+ }
79
+ /**
80
+ * The plane a request's exchange resolves to, or null when it does not ride a gate (public, or
81
+ * refused: callers that must tell the two apart ask `classifyGateRequestPlane`). A string or a
82
+ * non-empty same-plane array resolves (the `.every` rule of the old `isGovernedExchange`).
83
+ */
84
+ export function governedPlaneOf(exchange) {
85
+ const verdict = classifyGateRequestPlane(exchange);
86
+ return verdict.kind === 'gate' ? verdict.plane : null;
87
+ }
88
+ /** True when a gate plane governs the exchange (string or same-plane array). */
89
+ export function isGovernedPlaneExchange(exchange) {
90
+ return governedPlaneOf(exchange) !== null;
91
+ }
92
+ /** Nominal delayed-tier seconds for an exchange: the plane's default, or CME's when ungoverned (legacy callers). */
93
+ export function delayedDefaultSecondsFor(exchange) {
94
+ return governedPlaneOf(exchange)?.delayedDefaultSeconds ?? GATE_PLANES.cme.delayedDefaultSeconds;
95
+ }
96
+ /** Display twin of `delayedDefaultSecondsFor`, in whole minutes. */
97
+ export function delayedDefaultMinutesFor(exchange) {
98
+ return Math.round(delayedDefaultSecondsFor(exchange) / 60);
99
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The gate's close verdict as a fact other code may read: whether each gate plane's single session is held by
3
+ * ANOTHER screen right now. The plane's owner (cme-gate-connections `CmeGateConnections`) is the one point that
4
+ * knows: a contested kick latches its quarantine (`quarantine`), and only the user's take-back (`resumeAfterKick`,
5
+ * the handoff's Resume here) releases it. The owner publishes both edges here, so a reader (a wrun options lane that
6
+ * must say why it stopped) needs neither the owner nor its transports on its import graph.
7
+ *
8
+ * A leaf on purpose: no store, no service, no Vue. While a plane is held elsewhere its readers dial nothing, so a
9
+ * lane read sent then would only wait out its budget: the reader asks this first and stops by name instead.
10
+ */
11
+ import type { GateProvider } from '../../workers/constants/socket-slots.js';
12
+ type Listener = (plane: GateProvider, heldElsewhere: boolean) => void;
13
+ /** The owner's edge: `true` once a contested kick latched the plane, `false` once this tab took the session back.
14
+ * Listeners hear a change only, each in turn; one that throws never stops the next. */
15
+ export declare function publishGateSessionLatch(plane: GateProvider, held: boolean): void;
16
+ /** Whether another screen holds the plane's session now (the owner's latch). */
17
+ export declare function gateSessionHeldElsewhere(plane: GateProvider): boolean;
18
+ /** Hear every edge of every plane's latch; returns the unsubscribe. */
19
+ export declare function onGateSessionLatchChange(listener: Listener): () => void;
20
+ /** Test hook: every plane released, no listener. */
21
+ export declare function __resetGateSessionLatchForTests(): void;
22
+ export {};
@@ -0,0 +1,34 @@
1
+ const heldElsewhere = { cme: false, opra: false };
2
+ const listeners = new Set();
3
+ /** The owner's edge: `true` once a contested kick latched the plane, `false` once this tab took the session back.
4
+ * Listeners hear a change only, each in turn; one that throws never stops the next. */
5
+ export function publishGateSessionLatch(plane, held) {
6
+ if (heldElsewhere[plane] === held)
7
+ return;
8
+ heldElsewhere[plane] = held;
9
+ for (const listener of [...listeners]) {
10
+ try {
11
+ listener(plane, held);
12
+ }
13
+ catch (error) {
14
+ console.warn('[gate-session-latch] listener failed:', error);
15
+ }
16
+ }
17
+ }
18
+ /** Whether another screen holds the plane's session now (the owner's latch). */
19
+ export function gateSessionHeldElsewhere(plane) {
20
+ return heldElsewhere[plane];
21
+ }
22
+ /** Hear every edge of every plane's latch; returns the unsubscribe. */
23
+ export function onGateSessionLatchChange(listener) {
24
+ listeners.add(listener);
25
+ return () => {
26
+ listeners.delete(listener);
27
+ };
28
+ }
29
+ /** Test hook: every plane released, no listener. */
30
+ export function __resetGateSessionLatchForTests() {
31
+ heldElsewhere.cme = false;
32
+ heldElsewhere.opra = false;
33
+ listeners.clear();
34
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The pure half of the TradingView list util (tradingview-list.util.ts, which re-exports every name): the prefix
3
+ * tables (our native escape, the perpetual suffix, the US stock, forex, CME and crypto venues, TVC's spot metals, the
4
+ * venue back to its TradingView prefix, the CME continuous roots, the ticker aliases) and the symbol parsers
5
+ * (`cmeContinuousKeyOf`, `splitCryptoSymbol`, `cryptoCandidate`, `fxPair`). No imports: the wrun pin spelling step
6
+ * (wrun-pin-spelling.util) reads them, and it moves into the wrun chart-host package, which the util's catalog and
7
+ * legacy-venue reads may not reach.
8
+ */
9
+ /** Our native escape: `OPENMARKET:<full key>`, for markets TradingView has no name for. */
10
+ export declare const NATIVE_PREFIX = "OPENMARKET";
11
+ /** TradingView's perpetual suffix (`BTCUSDT.P`); also read by the wrun pin spelling step (wrun-pin-spelling.util). */
12
+ export declare const PERP_SUFFIX_RE: RegExp;
13
+ /** US listing venues TradingView names; every one is the `POLYGON` vendor on our side (`legacy-exchange.util`). */
14
+ export declare const US_STOCK_PREFIXES: ReadonlySet<string>;
15
+ /** The OTC forex feeds TradingView names; all of them are `FX_OTC|AAA/BBB` here. */
16
+ export declare const FX_PREFIXES: ReadonlySet<string>;
17
+ /** CME Group venues as TradingView names them, to our venue ids (the root table below decides the real venue). */
18
+ export declare const CME_PREFIXES: Readonly<Record<string, string>>;
19
+ /** TradingView's own spot metal quotes (`TVC:GOLD`) are the spot pair our OTC feed carries. */
20
+ export declare const TVC_SPOT_METALS: Readonly<Record<string, string>>;
21
+ export interface CryptoVenueMap {
22
+ /** Our spot venue id, or null when the venue trades perpetuals only. */
23
+ spot: string | null;
24
+ /** Our perpetual venue ids in priority order (a `.P` entry is looked up on each). */
25
+ perp: readonly string[];
26
+ }
27
+ /**
28
+ * TradingView crypto prefix to our venue ids. Facts: `BYBIT` = perpetuals, `BYBIT_SPOT` = spot; `OKEX` = spot,
29
+ * `OKEX_SWAP` = perpetuals; `BINANCE_FUTURES` = USDT-margined perps, `BINANCE_DELIVERY` = coin-margined;
30
+ * `HYPERLIQUID_FUTURES` = perps, `HYPERLIQUID` = spot. Venues without an `Exchange` member (MEXC) or hidden by
31
+ * policy (GEMINI, HTX's HUOBI) are listed for completeness and dropped at validation, never requested.
32
+ */
33
+ export declare const CRYPTO_VENUES: Readonly<Record<string, CryptoVenueMap>>;
34
+ /** Our venue id back to the TradingView prefix and whether its symbols carry `.P` (null: the row's category decides). */
35
+ export declare const VENUE_TO_TRADINGVIEW: Readonly<Record<string, {
36
+ prefix: string;
37
+ perp: boolean | null;
38
+ }>>;
39
+ /**
40
+ * CME continuous roots we carry, each on its venue and under the TradingView prefix it lives on. The roots are
41
+ * the continuous families the gateway rolls (`CONTINUOUS_FAMILIES`, pinned to the gateway fixture); the spec
42
+ * checks every root here is one of them. Matched WITHOUT a catalog read: the pane resolves the lead itself.
43
+ */
44
+ export declare const CME_CONTINUOUS_ROOTS: Readonly<Record<string, {
45
+ venue: string;
46
+ tvPrefix: string;
47
+ }>>;
48
+ /** `ES1!` -> the continuous key on its venue (`CME|ES1!`), null for anything else (a dated contract, an unknown root). */
49
+ export declare function cmeContinuousKeyOf(symbol: string): string | null;
50
+ /**
51
+ * `BTCUSDT` -> `{ base: 'BTC', quote: 'USDT' }`; a separated form (`BTC-USDT`, `BTC_USDT`, `BTC/USDT`) splits on the
52
+ * separator with a contract tail (`-SWAP`, `-PERP`) dropped; Bybit's `BTCPERP` quotes USDC. The longest quote wins
53
+ * unless it leaves a base of one or two letters while a shorter quote leaves a longer one (`XBTUSD` is XBT/USD,
54
+ * `DOTUSD` DOT/USD, never XB/TUSD; `BTCTUSD` stays BTC/TUSD, `OPUSDT` OP/USDT). Null when no quote is recognised
55
+ * (the symbol is then asked for as written).
56
+ */
57
+ export declare function splitCryptoSymbol(symbol: string): {
58
+ base: string;
59
+ quote: string;
60
+ } | null;
61
+ /** One identity to ask the catalog for: a raw symbol where the venue's raw form is known, else the normalized pair. */
62
+ export interface MarketCandidate {
63
+ exchange: string;
64
+ rawSymbol?: string;
65
+ normalizedSymbol?: string;
66
+ /** A stand-in for what the entry names (the closest market we carry), never the entry itself. */
67
+ closest?: ClosestKind;
68
+ }
69
+ /** What a closest market stands in with, for the words the transfer shows beside it. */
70
+ export type ClosestKind = 'indexFuture' | 'etf' | 'future' | 'rate' | 'venue';
71
+ /** The catalog identity of one crypto symbol on one of our venues. */
72
+ export declare function cryptoCandidate(exchange: string, symbol: string): MarketCandidate;
73
+ /** `EURUSD` / `EUR/USD` -> `['EUR', 'USD']`, in the written order; null for anything else. */
74
+ export declare function fxPair(symbol: string): [string, string] | null;
75
+ /** Tickers some venues spell their own way. */
76
+ export declare const BASE_ALIASES: Readonly<Record<string, string>>;
@@ -0,0 +1,221 @@
1
+ /**
2
+ * The pure half of the TradingView list util (tradingview-list.util.ts, which re-exports every name): the prefix
3
+ * tables (our native escape, the perpetual suffix, the US stock, forex, CME and crypto venues, TVC's spot metals, the
4
+ * venue back to its TradingView prefix, the CME continuous roots, the ticker aliases) and the symbol parsers
5
+ * (`cmeContinuousKeyOf`, `splitCryptoSymbol`, `cryptoCandidate`, `fxPair`). No imports: the wrun pin spelling step
6
+ * (wrun-pin-spelling.util) reads them, and it moves into the wrun chart-host package, which the util's catalog and
7
+ * legacy-venue reads may not reach.
8
+ */
9
+ /** Our native escape: `OPENMARKET:<full key>`, for markets TradingView has no name for. */
10
+ export const NATIVE_PREFIX = 'OPENMARKET';
11
+ /** TradingView's perpetual suffix (`BTCUSDT.P`); also read by the wrun pin spelling step (wrun-pin-spelling.util). */
12
+ export const PERP_SUFFIX_RE = /\.P$/i;
13
+ /** US listing venues TradingView names; every one is the `POLYGON` vendor on our side (`legacy-exchange.util`). */
14
+ export const US_STOCK_PREFIXES = new Set([
15
+ 'NASDAQ',
16
+ 'NYSE',
17
+ 'AMEX',
18
+ 'ARCA',
19
+ 'BATS',
20
+ 'OTC',
21
+ 'CBOE',
22
+ ]);
23
+ /** The OTC forex feeds TradingView names; all of them are `FX_OTC|AAA/BBB` here. */
24
+ export const FX_PREFIXES = new Set(['FX', 'FX_IDC', 'OANDA', 'FOREXCOM', 'SAXO']);
25
+ /** CME Group venues as TradingView names them, to our venue ids (the root table below decides the real venue). */
26
+ export const CME_PREFIXES = {
27
+ CME: 'CME',
28
+ CME_MINI: 'CME',
29
+ CBOT: 'CBOT',
30
+ CBOT_MINI: 'CBOT',
31
+ COMEX: 'COMEX',
32
+ COMEX_MINI: 'COMEX',
33
+ NYMEX: 'NYMEX',
34
+ NYMEX_MINI: 'NYMEX',
35
+ };
36
+ /** TradingView's own spot metal quotes (`TVC:GOLD`) are the spot pair our OTC feed carries. */
37
+ export const TVC_SPOT_METALS = {
38
+ GOLD: 'XAU/USD',
39
+ SILVER: 'XAG/USD',
40
+ PLATINUM: 'XPT/USD',
41
+ PALLADIUM: 'XPD/USD',
42
+ };
43
+ /**
44
+ * TradingView crypto prefix to our venue ids. Facts: `BYBIT` = perpetuals, `BYBIT_SPOT` = spot; `OKEX` = spot,
45
+ * `OKEX_SWAP` = perpetuals; `BINANCE_FUTURES` = USDT-margined perps, `BINANCE_DELIVERY` = coin-margined;
46
+ * `HYPERLIQUID_FUTURES` = perps, `HYPERLIQUID` = spot. Venues without an `Exchange` member (MEXC) or hidden by
47
+ * policy (GEMINI, HTX's HUOBI) are listed for completeness and dropped at validation, never requested.
48
+ */
49
+ export const CRYPTO_VENUES = {
50
+ BINANCE: { spot: 'BINANCE', perp: ['BINANCE_FUTURES', 'BINANCE_DELIVERY'] },
51
+ BYBIT: { spot: 'BYBIT_SPOT', perp: ['BYBIT'] },
52
+ OKX: { spot: 'OKEX', perp: ['OKEX_SWAP'] },
53
+ OKEX: { spot: 'OKEX', perp: ['OKEX_SWAP'] },
54
+ COINBASE: { spot: 'COINBASE', perp: ['COINBASE_INTERNATIONAL'] },
55
+ KRAKEN: { spot: 'KRAKEN', perp: ['CRYPTOFACILITIES'] },
56
+ BITGET: { spot: 'BITGET', perp: ['BITGET'] },
57
+ GATEIO: { spot: 'GATE_IO', perp: ['GATE_IO_FUTURES'] },
58
+ HYPERLIQUID: { spot: 'HYPERLIQUID', perp: ['HYPERLIQUID_FUTURES'] },
59
+ DERIBIT: { spot: null, perp: ['DERIBIT'] },
60
+ BITFINEX: { spot: 'BITFINEX', perp: ['BITFINEX_DERIVATIVES'] },
61
+ BITSTAMP: { spot: 'BITSTAMP', perp: [] },
62
+ KUCOIN: { spot: 'KUCOIN', perp: [] },
63
+ MEXC: { spot: 'MEXC', perp: ['MEXC'] },
64
+ HTX: { spot: 'HUOBI', perp: ['HUOBI_DM_LINEAR_SWAP'] },
65
+ GEMINI: { spot: 'GEMINI', perp: [] },
66
+ UPBIT: { spot: 'UPBIT', perp: [] },
67
+ BITMEX: { spot: null, perp: ['BITMEX'] },
68
+ };
69
+ /** Our venue id back to the TradingView prefix and whether its symbols carry `.P` (null: the row's category decides). */
70
+ export const VENUE_TO_TRADINGVIEW = {
71
+ BINANCE: { prefix: 'BINANCE', perp: false },
72
+ BINANCE_FUTURES: { prefix: 'BINANCE', perp: true },
73
+ BINANCE_DELIVERY: { prefix: 'BINANCE', perp: true },
74
+ BYBIT_SPOT: { prefix: 'BYBIT', perp: false },
75
+ BYBIT: { prefix: 'BYBIT', perp: true },
76
+ OKEX: { prefix: 'OKX', perp: false },
77
+ OKEX_SWAP: { prefix: 'OKX', perp: true },
78
+ COINBASE: { prefix: 'COINBASE', perp: false },
79
+ COINBASE_INTERNATIONAL: { prefix: 'COINBASE', perp: true },
80
+ KRAKEN: { prefix: 'KRAKEN', perp: false },
81
+ CRYPTOFACILITIES: { prefix: 'KRAKEN', perp: true },
82
+ BITGET: { prefix: 'BITGET', perp: null },
83
+ GATE_IO: { prefix: 'GATEIO', perp: false },
84
+ GATE_IO_FUTURES: { prefix: 'GATEIO', perp: true },
85
+ HYPERLIQUID: { prefix: 'HYPERLIQUID', perp: false },
86
+ HYPERLIQUID_FUTURES: { prefix: 'HYPERLIQUID', perp: true },
87
+ DERIBIT: { prefix: 'DERIBIT', perp: true },
88
+ BITFINEX: { prefix: 'BITFINEX', perp: false },
89
+ BITFINEX_DERIVATIVES: { prefix: 'BITFINEX', perp: true },
90
+ BITSTAMP: { prefix: 'BITSTAMP', perp: false },
91
+ KUCOIN: { prefix: 'KUCOIN', perp: false },
92
+ HUOBI: { prefix: 'HTX', perp: false },
93
+ HUOBI_DM_LINEAR_SWAP: { prefix: 'HTX', perp: true },
94
+ GEMINI: { prefix: 'GEMINI', perp: false },
95
+ UPBIT: { prefix: 'UPBIT', perp: false },
96
+ BITMEX: { prefix: 'BITMEX', perp: true },
97
+ };
98
+ /**
99
+ * CME continuous roots we carry, each on its venue and under the TradingView prefix it lives on. The roots are
100
+ * the continuous families the gateway rolls (`CONTINUOUS_FAMILIES`, pinned to the gateway fixture); the spec
101
+ * checks every root here is one of them. Matched WITHOUT a catalog read: the pane resolves the lead itself.
102
+ */
103
+ export const CME_CONTINUOUS_ROOTS = {
104
+ ES: { venue: 'CME', tvPrefix: 'CME_MINI' },
105
+ NQ: { venue: 'CME', tvPrefix: 'CME_MINI' },
106
+ RTY: { venue: 'CME', tvPrefix: 'CME_MINI' },
107
+ MES: { venue: 'CME', tvPrefix: 'CME_MINI' },
108
+ MNQ: { venue: 'CME', tvPrefix: 'CME_MINI' },
109
+ M2K: { venue: 'CME', tvPrefix: 'CME_MINI' },
110
+ YM: { venue: 'CBOT', tvPrefix: 'CBOT_MINI' },
111
+ MYM: { venue: 'CBOT', tvPrefix: 'CBOT_MINI' },
112
+ '6E': { venue: 'CME', tvPrefix: 'CME' },
113
+ '6B': { venue: 'CME', tvPrefix: 'CME' },
114
+ '6J': { venue: 'CME', tvPrefix: 'CME' },
115
+ '6C': { venue: 'CME', tvPrefix: 'CME' },
116
+ ZT: { venue: 'CBOT', tvPrefix: 'CBOT' },
117
+ ZF: { venue: 'CBOT', tvPrefix: 'CBOT' },
118
+ ZN: { venue: 'CBOT', tvPrefix: 'CBOT' },
119
+ TN: { venue: 'CBOT', tvPrefix: 'CBOT' },
120
+ ZB: { venue: 'CBOT', tvPrefix: 'CBOT' },
121
+ UB: { venue: 'CBOT', tvPrefix: 'CBOT' },
122
+ CL: { venue: 'NYMEX', tvPrefix: 'NYMEX' },
123
+ MCL: { venue: 'NYMEX', tvPrefix: 'NYMEX' },
124
+ NG: { venue: 'NYMEX', tvPrefix: 'NYMEX' },
125
+ RB: { venue: 'NYMEX', tvPrefix: 'NYMEX' },
126
+ HO: { venue: 'NYMEX', tvPrefix: 'NYMEX' },
127
+ BZ: { venue: 'NYMEX', tvPrefix: 'NYMEX' },
128
+ GC: { venue: 'COMEX', tvPrefix: 'COMEX' },
129
+ MGC: { venue: 'COMEX', tvPrefix: 'COMEX' },
130
+ SI: { venue: 'COMEX', tvPrefix: 'COMEX' },
131
+ SIL: { venue: 'COMEX', tvPrefix: 'COMEX' },
132
+ HG: { venue: 'COMEX', tvPrefix: 'COMEX' },
133
+ MHG: { venue: 'COMEX', tvPrefix: 'COMEX' },
134
+ ZC: { venue: 'CBOT', tvPrefix: 'CBOT' },
135
+ ZW: { venue: 'CBOT', tvPrefix: 'CBOT' },
136
+ KE: { venue: 'CBOT', tvPrefix: 'CBOT' },
137
+ ZS: { venue: 'CBOT', tvPrefix: 'CBOT' },
138
+ ZL: { venue: 'CBOT', tvPrefix: 'CBOT' },
139
+ BTC: { venue: 'CME', tvPrefix: 'CME' },
140
+ MBT: { venue: 'CME', tvPrefix: 'CME' },
141
+ ETH: { venue: 'CME', tvPrefix: 'CME' },
142
+ MET: { venue: 'CME', tvPrefix: 'CME' },
143
+ };
144
+ /** `ES1!` -> the continuous key on its venue (`CME|ES1!`), null for anything else (a dated contract, an unknown root). */
145
+ export function cmeContinuousKeyOf(symbol) {
146
+ const upper = symbol.trim().toUpperCase();
147
+ if (!upper.endsWith('1!'))
148
+ return null;
149
+ const root = CME_CONTINUOUS_ROOTS[upper.slice(0, -2)];
150
+ return root ? `${root.venue}|${upper}` : null;
151
+ }
152
+ // Quote assets a TradingView crypto symbol can end in, longest first so `USDT` wins over `USD`.
153
+ const CRYPTO_QUOTES = [
154
+ 'FDUSD',
155
+ 'PYUSD',
156
+ 'USDT',
157
+ 'USDC',
158
+ 'TUSD',
159
+ 'BUSD',
160
+ 'USDE',
161
+ 'USDD',
162
+ 'USD1',
163
+ 'PERP',
164
+ 'DAI',
165
+ 'EUR',
166
+ 'GBP',
167
+ 'JPY',
168
+ 'AUD',
169
+ 'TRY',
170
+ 'BRL',
171
+ 'KRW',
172
+ 'BTC',
173
+ 'ETH',
174
+ 'BNB',
175
+ 'SOL',
176
+ 'USD',
177
+ ];
178
+ const CRYPTO_SEPARATOR_RE = /[-_/]/;
179
+ const CONTRACT_TAILS = new Set(['SWAP', 'PERP', 'PERPETUAL']);
180
+ /**
181
+ * `BTCUSDT` -> `{ base: 'BTC', quote: 'USDT' }`; a separated form (`BTC-USDT`, `BTC_USDT`, `BTC/USDT`) splits on the
182
+ * separator with a contract tail (`-SWAP`, `-PERP`) dropped; Bybit's `BTCPERP` quotes USDC. The longest quote wins
183
+ * unless it leaves a base of one or two letters while a shorter quote leaves a longer one (`XBTUSD` is XBT/USD,
184
+ * `DOTUSD` DOT/USD, never XB/TUSD; `BTCTUSD` stays BTC/TUSD, `OPUSDT` OP/USDT). Null when no quote is recognised
185
+ * (the symbol is then asked for as written).
186
+ */
187
+ export function splitCryptoSymbol(symbol) {
188
+ const upper = symbol.trim().toUpperCase();
189
+ if (CRYPTO_SEPARATOR_RE.test(upper)) {
190
+ const parts = upper.split(CRYPTO_SEPARATOR_RE).filter((part) => part && !CONTRACT_TAILS.has(part));
191
+ if (parts.length >= 2)
192
+ return { base: parts[0], quote: parts[1] === 'PERP' ? 'USDC' : parts[1] };
193
+ return null;
194
+ }
195
+ const splits = CRYPTO_QUOTES.filter((quote) => upper.length > quote.length && upper.endsWith(quote)).map((quote) => ({
196
+ base: upper.slice(0, -quote.length),
197
+ quote: quote === 'PERP' ? 'USDC' : quote,
198
+ }));
199
+ return splits.find((split) => split.base.length >= 3) ?? splits[0] ?? null;
200
+ }
201
+ /** The catalog identity of one crypto symbol on one of our venues. */
202
+ export function cryptoCandidate(exchange, symbol) {
203
+ const pair = splitCryptoSymbol(symbol);
204
+ // Hyperliquid perps are keyed by the coin alone (`HYPERLIQUID_FUTURES|BTC`).
205
+ if (exchange === 'HYPERLIQUID_FUTURES')
206
+ return { exchange, rawSymbol: pair?.base ?? symbol.toUpperCase() };
207
+ if (pair)
208
+ return { exchange, normalizedSymbol: `${pair.base}-${pair.quote}` };
209
+ return { exchange, rawSymbol: symbol.toUpperCase() };
210
+ }
211
+ /** `EURUSD` / `EUR/USD` -> `['EUR', 'USD']`, in the written order; null for anything else. */
212
+ export function fxPair(symbol) {
213
+ const upper = symbol.toUpperCase();
214
+ if (CRYPTO_SEPARATOR_RE.test(upper)) {
215
+ const [base, quote] = upper.split(CRYPTO_SEPARATOR_RE);
216
+ return base && quote ? [base, quote] : null;
217
+ }
218
+ return upper.length === 6 ? [upper.slice(0, 3), upper.slice(3)] : null;
219
+ }
220
+ /** Tickers some venues spell their own way. */
221
+ export const BASE_ALIASES = { XBT: 'BTC', XDG: 'DOGE' };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The registry check of a host-grid landing (UW-PARITY rule 9), shared by the poll-lane registry (`barGrid` on a
3
+ * `nativeRows` lane) and the row-lane registry (a flow or snapshot row lane's `landing`): a flow or a snapshot, and
4
+ * its backend tiers, each a key of its own, a positive whole width in ms, a positive retention or none and a positive
5
+ * served lag or none.
6
+ *
7
+ * A LEAF on purpose (type imports only): both registries read it at module load, and the row-lane registry stays off
8
+ * the poll-lane registry's import graph (a module reading row lanes never loads the poll lanes' files).
9
+ */
10
+ import type { WrunBackendTier, WrunTierLanding } from '../wrun-tier-grid.util.js';
11
+ /** Refuse a malformed host-grid landing by name (a programming error, never a user's). */
12
+ export declare function assertWrunHostGridLanding(who: string, grid: {
13
+ landing: WrunTierLanding;
14
+ tiers?: readonly WrunBackendTier[];
15
+ }): void;