@orangecharts/wrun-chart-host 0.11.1 → 0.15.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 (319) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +4 -4
  3. package/dist/constants/feature-flags.constants.js +38 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +69 -3
  13. package/dist/host-env.js +21 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.js +19 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +52 -12
  18. package/dist/indicators/controls/tpo-session.util.js +113 -16
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +141 -20
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +5 -5
  35. package/dist/market-data/venues/opra.js +3 -3
  36. package/dist/market-data/venues/stocks.contract.copy.json +6 -5
  37. package/dist/market-data/venues/stocks.d.ts +5 -5
  38. package/dist/market-data/venues/stocks.js +21 -18
  39. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  40. package/dist/settings-templates/frvp-fields.js +15 -4
  41. package/dist/settings-templates/index.js +12 -5
  42. package/dist/settings-templates/indicator-fields.js +43 -2
  43. package/dist/settings-templates/tool-rules.d.ts +17 -8
  44. package/dist/settings-templates/tool-rules.js +15 -8
  45. package/dist/settings-templates/tool-tables.generated.js +4 -2
  46. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  47. package/dist/utility/auth/server-clock.util.js +3 -1
  48. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  49. package/dist/utility/chart/cache-alignment.util.d.ts +38 -7
  50. package/dist/utility/chart/cache-alignment.util.js +50 -13
  51. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  52. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  53. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  54. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  55. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  56. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  57. package/dist/utility/chart/display-offset.leaf.js +41 -0
  58. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  59. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  60. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  61. package/dist/utility/chart/feed-interval.util.js +13 -22
  62. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  63. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  64. package/dist/utility/chart/footprint-band.util.d.ts +21 -5
  65. package/dist/utility/chart/footprint-band.util.js +53 -14
  66. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  67. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  68. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  69. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  70. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  71. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  72. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  73. package/dist/utility/chart/interval-registry.util.js +1 -1
  74. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  75. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  76. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  77. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  78. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  79. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  80. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  81. package/dist/utility/chart/live-bucket.util.js +103 -57
  82. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  83. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  84. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  85. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  86. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  87. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  88. package/dist/utility/chart/market-session.util.d.ts +136 -0
  89. package/dist/utility/chart/market-session.util.js +341 -0
  90. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  91. package/dist/utility/chart/om-panel.util.js +42 -7
  92. package/dist/utility/chart/om-target.util.d.ts +14 -1
  93. package/dist/utility/chart/om-target.util.js +22 -5
  94. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  95. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  96. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  97. package/dist/utility/chart/profile-row-height.util.js +74 -37
  98. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  99. package/dist/utility/chart/rth-session.util.js +94 -46
  100. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  101. package/dist/utility/chart/session-lattice.util.js +488 -0
  102. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  103. package/dist/utility/chart/trading-day.util.js +84 -7
  104. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  105. package/dist/utility/chart/us-equities-session.util.js +44 -15
  106. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  107. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  108. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  109. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  110. package/dist/utility/chart/wrun-run-result.util.d.ts +38 -13
  111. package/dist/utility/chart/wrun-run-result.util.js +97 -27
  112. package/dist/utility/common/time.util.js +5 -4
  113. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  114. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  115. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  116. package/dist/utility/market-events/market-events.util.js +30 -17
  117. package/dist/utility/number-format.util.d.ts +14 -21
  118. package/dist/utility/number-format.util.js +38 -24
  119. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  120. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  121. package/dist/utility/options/option-venue.util.d.ts +1 -1
  122. package/dist/utility/options/option-venue.util.js +1 -1
  123. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  124. package/dist/utility/pool-symbol.leaf.js +50 -5
  125. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  126. package/dist/utility/stocks/stock-display.util.js +37 -0
  127. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  128. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  129. package/dist/utility/v2/gate-plane.util.js +11 -1
  130. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  131. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  132. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  133. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  134. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  135. package/dist/utility/v2/stocks-governed.util.js +14 -0
  136. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  137. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  138. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  139. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  140. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  141. package/dist/utility/wrun/derived-roots.util.js +97 -56
  142. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  144. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  145. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  146. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  147. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  148. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  149. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  150. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  152. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  153. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  155. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  156. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  158. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  159. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  161. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  162. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  163. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  164. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  165. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  167. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +46 -23
  168. package/dist/utility/wrun/wrun-batched-marks.util.js +260 -62
  169. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  170. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  171. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  172. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  173. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  175. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  176. package/dist/utility/wrun/wrun-canvases.util.d.ts +24 -7
  177. package/dist/utility/wrun/wrun-canvases.util.js +99 -30
  178. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  179. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  180. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  181. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  182. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  183. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  184. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  185. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  186. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  187. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  188. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  189. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  190. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  191. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  192. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  193. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  194. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  195. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  196. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  197. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  198. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  199. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  200. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  201. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  202. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  203. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  204. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  205. package/dist/utility/wrun/wrun-host.service.js +137 -27
  206. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  207. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  208. package/dist/utility/wrun/wrun-hover.util.d.ts +8 -2
  209. package/dist/utility/wrun/wrun-hover.util.js +24 -13
  210. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  211. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  212. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  213. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  214. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  215. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  216. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  217. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  218. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  219. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  220. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  221. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  222. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  223. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  224. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  225. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  226. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  227. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  228. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  229. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  230. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  231. package/dist/utility/wrun/wrun-live-tick.util.js +655 -97
  232. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  233. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  234. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  235. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  236. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  237. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  238. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  239. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  240. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  241. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  242. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  243. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  244. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  245. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  246. package/dist/utility/wrun/wrun-output-words.util.d.ts +14 -0
  247. package/dist/utility/wrun/wrun-output-words.util.js +51 -0
  248. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +116 -11
  249. package/dist/utility/wrun/wrun-overlay-drivers.util.js +208 -43
  250. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  251. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  252. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  253. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  254. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  255. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +6 -1
  256. package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
  257. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +247 -26
  258. package/dist/utility/wrun/wrun-overlay-run.util.js +2234 -408
  259. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  260. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +11 -2
  261. package/dist/utility/wrun/wrun-panel-mount.util.js +122 -19
  262. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  263. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  264. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  265. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  266. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  267. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  268. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  269. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  270. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  271. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  272. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  273. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  274. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  275. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  276. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  277. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  278. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  279. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  280. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  281. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  282. package/dist/utility/wrun/wrun-run-health.util.d.ts +95 -5
  283. package/dist/utility/wrun/wrun-run-health.util.js +209 -3
  284. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  285. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  286. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  287. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  288. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  289. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +38 -11
  290. package/dist/utility/wrun/wrun-script-inputs.util.js +194 -56
  291. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  292. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  293. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  294. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  295. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  296. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  297. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  298. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  299. package/dist/utility/wrun/wrun-style-names.util.d.ts +23 -0
  300. package/dist/utility/wrun/wrun-style-names.util.js +74 -0
  301. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  302. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  303. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  304. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  305. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  306. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  307. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  308. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  309. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  310. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  311. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  312. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  313. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  314. package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
  315. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  316. package/dist/utils/replay/replay-buffer-math.js +60 -30
  317. package/dist/workers/constants/socket-slots.d.ts +11 -7
  318. package/dist/workers/constants/socket-slots.js +6 -5
  319. package/package.json +5 -5
@@ -1,4 +1,5 @@
1
1
  import type { EarningsSlot, MarketAssetClass, MarketEvent, MarketEventImpact, MarketEventSeriesLink } from '../../interfaces/market-event.interface.js';
2
+ import { type DisplayOffset } from '../chart/display-offset.leaf.js';
2
3
  import { type VenueMarketKind } from '../chart/marketKind.util.js';
3
4
  /** Chart-side market kind → the server's relevance bucket. */
4
5
  export declare function assetClassForMarketKind(kind: VenueMarketKind): MarketAssetClass;
@@ -94,8 +95,11 @@ export declare function surpriseGlyph(event: MarketEvent): string;
94
95
  /** Escape vendor text before it rides an HTML-capable tooltip. */
95
96
  export declare function escapeHtml(text: string): string;
96
97
  export declare function isSourceFresh(lastSyncAt: number | null | undefined, now: number): boolean;
97
- /** Day bucket in a fixed UTC-offset zone (the chart's time zone), for list headers. */
98
- export declare function dayKey(at: number, offsetMs: number): string;
98
+ /**
99
+ * Day bucket in the chart's time zone, for list headers: the instant's own wall date, `offset` read at the instant
100
+ * (a fixed shift, or the shift at each instant for a zone that moves its clock).
101
+ */
102
+ export declare function dayKey(at: number, offset: DisplayOffset): string;
99
103
  /**
100
104
  * The calendar day a row belongs to in the zone. A date-only row (every
101
105
  * dividend, a report with no announced time) carries a 09:30 Eastern
@@ -104,7 +108,7 @@ export declare function dayKey(at: number, offsetMs: number): string;
104
108
  */
105
109
  export declare function rowDayKey(event: Pick<MarketEvent, 'at'> & {
106
110
  timing?: MarketEvent['timing'];
107
- }, offsetMs: number): string;
111
+ }, offset: DisplayOffset): string;
108
112
  /** Where a day sits relative to today; the panels localize it ("Today", "Tomorrow", else the date). */
109
113
  export type DayGroupKey = 'today' | 'tomorrow' | 'date';
110
114
  export interface DayGroup<T extends Pick<MarketEvent, 'at'> = MarketEvent> {
@@ -117,13 +121,16 @@ export interface DayGroup<T extends Pick<MarketEvent, 'at'> = MarketEvent> {
117
121
  events: T[];
118
122
  }
119
123
  /**
120
- * Rows by calendar day in a fixed UTC-offset zone (the chart's time zone), in
121
- * order of first appearance (pass rows sorted by time). Raw keys only: the
122
- * panels word them.
124
+ * Rows by calendar day in the chart's time zone, in order of first
125
+ * appearance (pass rows sorted by time). Each row reads its own day at its
126
+ * own instant's offset (a zone moves its clock: one offset read now puts a
127
+ * row across a clock change an hour off its day), and tomorrow is the
128
+ * calendar's next date, never now plus 24 hours (a zone day around a change
129
+ * is 23 or 25 hours long). Raw keys only: the panels word them.
123
130
  */
124
131
  export declare function dayGroups<T extends Pick<MarketEvent, 'at'> & {
125
132
  timing?: MarketEvent['timing'];
126
- } = MarketEvent>(events: readonly T[], nowMs: number, offsetMs: number): DayGroup<T>[];
133
+ } = MarketEvent>(events: readonly T[], nowMs: number, offset: DisplayOffset): DayGroup<T>[];
127
134
  /** Whether an exact print is close enough that surfaces should poll fast; earnings and dividends never count. */
128
135
  export declare function isNearRelease(events: MarketEvent[], now: number, beforeMs: number, afterMs: number): boolean;
129
136
  export interface ChartReach {
@@ -1,3 +1,4 @@
1
+ import { displayWallMs, displayWallToUtcMs } from '../chart/display-offset.leaf.js';
1
2
  import { checkIsPolygon, getMarketKind } from '../chart/marketKind.util.js';
2
3
  import { EARNINGS_TICKER_PATTERN } from './earnings-scope.util.js';
3
4
  import { easternTime } from './zoned-clock.util.js';
@@ -299,10 +300,17 @@ const MARKET_EVENTS_STALE_AFTER_MS = 2 * 60 * 60 * 1000;
299
300
  export function isSourceFresh(lastSyncAt, now) {
300
301
  return typeof lastSyncAt === 'number' && now - lastSyncAt <= MARKET_EVENTS_STALE_AFTER_MS;
301
302
  }
302
- /** Day bucket in a fixed UTC-offset zone (the chart's time zone), for list headers. */
303
- export function dayKey(at, offsetMs) {
304
- const shifted = new Date(at + offsetMs);
305
- return `${shifted.getUTCFullYear()}-${String(shifted.getUTCMonth() + 1).padStart(2, '0')}-${String(shifted.getUTCDate()).padStart(2, '0')}`;
303
+ /** `YYYY-MM-DD` of a UTC-shaped wall clock epoch. */
304
+ const wallDateKey = (wallMs) => {
305
+ const wall = new Date(wallMs);
306
+ return `${wall.getUTCFullYear()}-${String(wall.getUTCMonth() + 1).padStart(2, '0')}-${String(wall.getUTCDate()).padStart(2, '0')}`;
307
+ };
308
+ /**
309
+ * Day bucket in the chart's time zone, for list headers: the instant's own wall date, `offset` read at the instant
310
+ * (a fixed shift, or the shift at each instant for a zone that moves its clock).
311
+ */
312
+ export function dayKey(at, offset) {
313
+ return wallDateKey(displayWallMs(offset, at));
306
314
  }
307
315
  const DAY_MS = 24 * 60 * 60 * 1000;
308
316
  const easternDate = new Intl.DateTimeFormat('en-CA', {
@@ -317,29 +325,34 @@ const easternDate = new Intl.DateTimeFormat('en-CA', {
317
325
  * placeholder instant that only orders the day: it keeps its US date in every
318
326
  * zone, instead of sliding to the next day east of UTC+10.
319
327
  */
320
- export function rowDayKey(event, offsetMs) {
321
- return event.timing === 'date_only' ? easternDate.format(new Date(event.at)) : dayKey(event.at, offsetMs);
328
+ export function rowDayKey(event, offset) {
329
+ return event.timing === 'date_only' ? easternDate.format(new Date(event.at)) : dayKey(event.at, offset);
322
330
  }
323
- /** The instant a `YYYY-MM-DD` day starts in the zone, epoch ms. */
324
- const zoneDayStartOf = (dateKey, offsetMs) => {
331
+ /** A `YYYY-MM-DD` as its UTC midnight (the day's wall midnight as a UTC-shaped epoch). */
332
+ const dateKeyWallMs = (dateKey) => {
325
333
  const [year, month, day] = dateKey.split('-').map(Number);
326
- return Date.UTC(year, month - 1, day) - offsetMs;
334
+ return Date.UTC(year, month - 1, day);
327
335
  };
336
+ /** The instant a `YYYY-MM-DD` day starts in the zone, epoch ms: its wall midnight on that midnight's own offset. */
337
+ const zoneDayStartOf = (dateKey, offset) => displayWallToUtcMs(offset, dateKeyWallMs(dateKey));
328
338
  /**
329
- * Rows by calendar day in a fixed UTC-offset zone (the chart's time zone), in
330
- * order of first appearance (pass rows sorted by time). Raw keys only: the
331
- * panels word them.
339
+ * Rows by calendar day in the chart's time zone, in order of first
340
+ * appearance (pass rows sorted by time). Each row reads its own day at its
341
+ * own instant's offset (a zone moves its clock: one offset read now puts a
342
+ * row across a clock change an hour off its day), and tomorrow is the
343
+ * calendar's next date, never now plus 24 hours (a zone day around a change
344
+ * is 23 or 25 hours long). Raw keys only: the panels word them.
332
345
  */
333
- export function dayGroups(events, nowMs, offsetMs) {
334
- const todayKey = dayKey(nowMs, offsetMs);
335
- const tomorrowKey = dayKey(nowMs + DAY_MS, offsetMs);
346
+ export function dayGroups(events, nowMs, offset) {
347
+ const todayKey = dayKey(nowMs, offset);
348
+ const tomorrowKey = wallDateKey(dateKeyWallMs(todayKey) + DAY_MS);
336
349
  const groups = new Map();
337
350
  for (const event of events) {
338
- const dateKey = rowDayKey(event, offsetMs);
351
+ const dateKey = rowDayKey(event, offset);
339
352
  let group = groups.get(dateKey);
340
353
  if (!group) {
341
354
  const key = dateKey === todayKey ? 'today' : dateKey === tomorrowKey ? 'tomorrow' : 'date';
342
- const dayStartMs = zoneDayStartOf(dateKey, offsetMs);
355
+ const dayStartMs = zoneDayStartOf(dateKey, offset);
343
356
  group = { key, dateKey, dayStartMs, events: [] };
344
357
  groups.set(dateKey, group);
345
358
  }
@@ -56,20 +56,15 @@ export declare function changeNumberFormat(value: number, precision: number): st
56
56
  */
57
57
  export declare function formatAdaptiveVolume(value: number): string;
58
58
  export declare function safeDivide(a: number, b: number): number;
59
- /**
60
- * The ticker's digits for a trade price, so one symbol reads the same number on
61
- * every ticker surface. The decimals come from the price's own magnitude,
62
- * because the FE holds no per-symbol tick size and the chart's axis precision
63
- * moves with every zoom. `reference` is the price a difference belongs to: a
64
- * 24h change prints at its price's resolution.
65
- *
66
- * Venue-blind: every value reads as a trade price. A surface that prints a
67
- * market's figure asks the web's market-aware text
68
- * (`src/utility/chart/market-price-text.util.ts`), which falls back to this for
69
- * a plain price; through this ladder a crypto index market cap printed all
70
- * thirteen digits.
71
- */
72
- export declare function formatPriceByMagnitude(value: number, reference?: number): string;
59
+ /** A market's price convention while its tick is unknown, named by market-price-text.util (no venue imports here). */
60
+ export type PriceConvention = 'usEquity' | 'ladder';
61
+ /** The one price-decimals rule: a known tick decides, else a US stock prints 2 from $1 and 4 below, else null. */
62
+ export declare function conventionPriceDecimals(magnitude: number, convention: PriceConvention, tick: number | null | undefined): number | null;
63
+ /** The ticker's digits: the market's decimals, else the magnitude ladder; surfaces ask market-price-text.util. */
64
+ export declare function formatPriceByMagnitude(value: number, convention: PriceConvention, opts?: {
65
+ reference?: number;
66
+ tick?: number | null;
67
+ }): string;
73
68
  export declare function titlePriceDirection(curr: unknown, prev: unknown, lastGlyph?: string): string;
74
69
  /**
75
70
  * The tab title's price: the ticker bar's text (formatPriceByMagnitude) with
@@ -78,14 +73,12 @@ export declare function titlePriceDirection(curr: unknown, prev: unknown, lastGl
78
73
  * (0.9992810927390368), and an axis stretched by one stray value cut the same
79
74
  * ratio to "1.00". Negative values (spread formulas) keep the magnitude rule.
80
75
  */
81
- export declare function formatTitlePrice(price: number): string;
82
- /**
83
- * The tab title's price and its direction glyph, kept per chart and per market. `formatPrice` prints the price
84
- * (default `formatTitlePrice`, venue-blind): the web passes its market-aware text
85
- * (`src/utility/chart/market-price-text.util.ts`), so a crypto index reads in its own unit (`$1.08T ▲`).
86
- */
76
+ export declare function formatTitlePrice(price: number, convention: PriceConvention, opts?: {
77
+ tick?: number | null;
78
+ }): string;
79
+ /** The tab title's price and glyph per chart and market; `formatPrice` prints the market's text (no blind default). */
87
80
  export declare function formatChartTitlePrice(price: number, tc: TitleChart, context: {
88
81
  symbolKey: string;
89
82
  previousPrice?: number;
90
- }, formatPrice?: (price: number) => string): string;
83
+ }, formatPrice: (price: number) => string): string;
91
84
  export {};
@@ -163,26 +163,42 @@ export function safeDivide(a, b) {
163
163
  */
164
164
  const TICKER_MIN_SIGNIFICANT_DIGITS = 3;
165
165
  const MAX_TICKER_DECIMALS = 20;
166
- /**
167
- * The ticker's digits for a trade price, so one symbol reads the same number on
168
- * every ticker surface. The decimals come from the price's own magnitude,
169
- * because the FE holds no per-symbol tick size and the chart's axis precision
170
- * moves with every zoom. `reference` is the price a difference belongs to: a
171
- * 24h change prints at its price's resolution.
172
- *
173
- * Venue-blind: every value reads as a trade price. A surface that prints a
174
- * market's figure asks the web's market-aware text
175
- * (`src/utility/chart/market-price-text.util.ts`), which falls back to this for
176
- * a plain price; through this ladder a crypto index market cap printed all
177
- * thirteen digits.
178
- */
179
- export function formatPriceByMagnitude(value, reference = value) {
166
+ // SEC Rule 612: US stocks and ETFs quote in cents from $1 and in hundredths of a cent below it.
167
+ const US_EQUITY_DECIMALS_FROM_ONE_DOLLAR = 2;
168
+ const US_EQUITY_DECIMALS_BELOW_ONE_DOLLAR = 4;
169
+ /** A tick reads to at most this many decimals, the price axis's bound (pricePrecisionFromStep). */
170
+ const MAX_TICK_DECIMALS = 10;
171
+ const tickKnown = (tick) => typeof tick === 'number' && Number.isFinite(tick) && tick > 0;
172
+ /** A tick's decimals as the price axis prints a known tick (pricePrecisionFromStep, step mode), so the two agree. */
173
+ function tickDecimals(tick) {
174
+ for (let d = 0; d <= MAX_TICK_DECIMALS; d++) {
175
+ if (Math.abs(tick - Number(tick.toFixed(d))) <= tick * 1e-9)
176
+ return d;
177
+ }
178
+ return MAX_TICK_DECIMALS;
179
+ }
180
+ /** The one price-decimals rule: a known tick decides, else a US stock prints 2 from $1 and 4 below, else null. */
181
+ export function conventionPriceDecimals(magnitude, convention, tick) {
182
+ if (tickKnown(tick))
183
+ return tickDecimals(tick);
184
+ if (convention !== 'usEquity')
185
+ return null;
186
+ return Math.abs(magnitude) >= 1 ? US_EQUITY_DECIMALS_FROM_ONE_DOLLAR : US_EQUITY_DECIMALS_BELOW_ONE_DOLLAR;
187
+ }
188
+ /** The magnitude ladder: 1 to 5 decimals by size, and under 1 enough for three significant digits of `magnitude`. */
189
+ function tickerLadderDecimals(value, magnitude) {
180
190
  const ladder = value >= 10000 ? 1 : value >= 1000 ? 2 : value >= 100 ? 3 : value >= 10 ? 4 : 5;
181
- const magnitude = Math.abs(reference);
182
191
  const floor = magnitude > 0 && magnitude < 1
183
192
  ? Math.min(TICKER_MIN_SIGNIFICANT_DIGITS - 1 - Math.floor(Math.log10(magnitude)), MAX_TICKER_DECIMALS)
184
193
  : 0;
185
- const decimals = Math.max(ladder, floor);
194
+ return Math.max(ladder, floor);
195
+ }
196
+ /** The ticker's digits: the market's decimals, else the magnitude ladder; surfaces ask market-price-text.util. */
197
+ export function formatPriceByMagnitude(value, convention,
198
+ // `reference`: the price a difference belongs to, whose decimals it prints at.
199
+ opts = {}) {
200
+ const magnitude = Math.abs(opts.reference ?? value);
201
+ const decimals = conventionPriceDecimals(magnitude, convention, opts.tick) ?? tickerLadderDecimals(value, magnitude);
186
202
  return value >= 10000
187
203
  ? value.toLocaleString('en-US', { minimumFractionDigits: decimals, maximumFractionDigits: decimals })
188
204
  : value.toFixed(decimals);
@@ -204,22 +220,20 @@ export function titlePriceDirection(curr, prev, lastGlyph = '') {
204
220
  * (0.9992810927390368), and an axis stretched by one stray value cut the same
205
221
  * ratio to "1.00". Negative values (spread formulas) keep the magnitude rule.
206
222
  */
207
- export function formatTitlePrice(price) {
223
+ export function formatTitlePrice(price, convention, opts = {}) {
208
224
  if (!Number.isFinite(price))
209
225
  return '';
210
- const [whole, fraction] = formatPriceByMagnitude(Math.abs(price)).replace(/,/g, '').split('.');
226
+ const [whole, fraction] = formatPriceByMagnitude(Math.abs(price), convention, { tick: opts.tick })
227
+ .replace(/,/g, '')
228
+ .split('.');
211
229
  const grouped = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
212
230
  const text = fraction === undefined ? grouped : `${grouped}.${fraction}`;
213
231
  return price < 0 ? `-${text}` : text;
214
232
  }
215
233
  // Keyed by the chart instance so a destroyed chart takes its entry with it (no retainer).
216
234
  const titlePricesByChart = new WeakMap();
217
- /**
218
- * The tab title's price and its direction glyph, kept per chart and per market. `formatPrice` prints the price
219
- * (default `formatTitlePrice`, venue-blind): the web passes its market-aware text
220
- * (`src/utility/chart/market-price-text.util.ts`), so a crypto index reads in its own unit (`$1.08T ▲`).
221
- */
222
- export function formatChartTitlePrice(price, tc, context, formatPrice = formatTitlePrice) {
235
+ /** The tab title's price and glyph per chart and market; `formatPrice` prints the market's text (no blind default). */
236
+ export function formatChartTitlePrice(price, tc, context, formatPrice) {
223
237
  const stored = titlePricesByChart.get(tc);
224
238
  const previous = stored?.symbolKey === context.symbolKey ? stored : undefined;
225
239
  const glyph = titlePriceDirection(price, previous ? previous.price : context.previousPrice, previous?.glyph);
@@ -15,7 +15,8 @@ export declare function optionVenueDelayMinutes(venue: OptionVenue, access?: Cme
15
15
  * nobody confirmed reads delayed, so a surface never claims real-time it cannot show. A delayed OPRA
16
16
  * venue reads OPRA's delay notice verbatim (`OPRA_DELAY_NOTICE`, Exhibit A section 14: the exact phrase
17
17
  * on every screen of delayed OPRA data, never translated, whatever minutes the gate reports); real-time
18
- * names the source by its full name. Any other gate plane keeps the translated source-and-minutes line.
18
+ * reads the filed Exhibit A display screen's "Real-time · OPRA". Any other gate plane keeps the translated
19
+ * source-and-minutes line.
19
20
  */
20
21
  export declare function optionVenueDisclosure(venue: OptionVenue, tier: OptionVenueServedTier | undefined, minutes: number, t: Translate): string;
21
22
  /** The index roots a venue lists by name only (trades and open interest, no underlying or greeks). */
@@ -32,12 +33,45 @@ export interface OpraRoutedAccess {
32
33
  */
33
34
  export declare function isOpraDelayed(exchange: string | undefined | null, served: OpraRoutedAccess): boolean;
34
35
  /**
35
- * The short delay mark beside one governed price on a delayed tier (`mins` behind): OPRA's delay notice verbatim on an
36
- * OPRA market (Exhibit A section 14: the exact phrase where its delayed price shows, never on a hover alone), the
37
- * minutes ("10m") on any other plane. A list of rows keeps the minutes per row and shows the notice once for the list
38
- * (`useCmeGovernance().opraDelayNotice`).
36
+ * The short delay mark beside one governed price on a delayed tier (`mins` behind), worded per venue: OPRA's delay
37
+ * notice verbatim on an OPRA market (Exhibit A section 14: the exact phrase where its delayed price shows, never on a
38
+ * hover alone), the stocks tape's CTA statement verbatim on a tape market ("Delayed 15 minutes", never the minutes
39
+ * chip), the minutes ("10m") on CME. A list of rows keeps the minutes per CME row and shows OPRA's notice once for the
40
+ * list (`useCmeGovernance().delayNotice`).
39
41
  */
40
42
  export declare function governedDelayLabel(exchange: string | undefined | null, mins: number, t: Translate): string;
41
- /** The same mark as a sentence (a hover title, a line): OPRA's notice verbatim, the plane's minutes sentence elsewhere. */
43
+ /**
44
+ * The same mark as a sentence (a hover title, a line, a footnote): OPRA's notice and the stocks statement verbatim,
45
+ * CME's translated minutes sentence.
46
+ */
42
47
  export declare function governedDelaySentence(exchange: string | undefined | null, mins: number, t: Translate): string;
48
+ /** The served-tier read a delay statement needs: the cme-realtime store, or a stand-in in specs. */
49
+ export interface GovernedRoutedAccess extends OpraRoutedAccess {
50
+ /** Minutes the exchange's delayed tier runs behind (the tier frame's, else the plane default). */
51
+ delayMinutes(exchange: string | undefined | null): number;
52
+ }
53
+ /**
54
+ * Whether `exchange` is a gate-governed venue (CME, OPRA, the US stocks tape) whose data rides the delayed tier here:
55
+ * not ROUTED real-time, the delay badge's rule (a tier nobody confirmed reads delayed, so no surface claims real time it
56
+ * cannot show). The one venue-neutral test behind every delay label; `isOpraDelayed` is its OPRA-only case.
57
+ */
58
+ export declare function isGovernedDelayed(exchange: string | undefined | null, served: OpraRoutedAccess): boolean;
59
+ /** The venue's delay statement while `exchange` rides its delayed tier (`governedDelaySentence`), else null. */
60
+ export declare function governedDelayStatement(exchange: string | undefined | null, served: GovernedRoutedAccess, t: Translate): string | null;
61
+ /**
62
+ * The delay statements a surface holding markets of its own (an unsynced Time and sales, an order book, a picture of
63
+ * a chart) must show itself: one per delayed governed plane among `own` that no chart on the screen labels already.
64
+ * The licences ask for one label on the screen while the delayed data shows, never one per panel: a chart streaming
65
+ * the same plane on its delayed tier carries the plane's tag (`chartStreams`: each shown chart's stream venue, the
66
+ * tape a Trades stock chart rides, never its POLYGON identity), so the surface stays bare beside it. With no chart on
67
+ * the screen (a phone's full-screen panel) pass none, and every delayed plane reads its statement. Deduped, in the
68
+ * order the planes first appear in `own`.
69
+ */
70
+ export declare function uncoveredDelayStatements(own: readonly (string | undefined | null)[], chartStreams: readonly (string | undefined | null)[], served: GovernedRoutedAccess, t: Translate): string[];
71
+ /**
72
+ * Whether a list row may paint a market's price figures (last price, change, sparkline) with no delay mark of its own:
73
+ * never on a gate-governed plane. A search reply names no tier, so a governed figure there is a delayed price nobody
74
+ * labels or a real-time quote beside a delayed chart; the stocks feed row and a CME futures row alike draw none.
75
+ */
76
+ export declare function rowFiguresAllowed(exchange: string | undefined | null): boolean;
43
77
  export {};
@@ -1,6 +1,7 @@
1
1
  import { OPRA_DELAY_NOTICE } from '../../constants/opra-compliance.constants.js';
2
+ import { STOCKS_DELAY_STATEMENT } from '../../constants/stocks-compliance.constants.js';
2
3
  import { getExchangeFullName } from '../chart/cme-realtime.util.js';
3
- import { delayedDefaultMinutesFor, isOpraGoverned } from '../v2/gate-plane.util.js';
4
+ import { delayedDefaultMinutesFor, gateProviderForExchange, isOpraGoverned, isStocksTapeGoverned, } from '../v2/gate-plane.util.js';
4
5
  /**
5
6
  * Minutes a delayed surface of the venue runs behind: what the gate's tier frame reported for the
6
7
  * venue's exchange when it did, else the venue's nominal delay (OPRA: 15), else its plane's.
@@ -18,11 +19,13 @@ export function optionVenueDelayMinutes(venue, access) {
18
19
  * nobody confirmed reads delayed, so a surface never claims real-time it cannot show. A delayed OPRA
19
20
  * venue reads OPRA's delay notice verbatim (`OPRA_DELAY_NOTICE`, Exhibit A section 14: the exact phrase
20
21
  * on every screen of delayed OPRA data, never translated, whatever minutes the gate reports); real-time
21
- * names the source by its full name. Any other gate plane keeps the translated source-and-minutes line.
22
+ * reads the filed Exhibit A display screen's "Real-time · OPRA". Any other gate plane keeps the translated
23
+ * source-and-minutes line.
22
24
  */
23
25
  export function optionVenueDisclosure(venue, tier, minutes, t) {
24
- if (tier !== 'realtime' && venue.plane === 'opra')
25
- return OPRA_DELAY_NOTICE;
26
+ if (venue.plane === 'opra') {
27
+ return tier === 'realtime' ? t('symbolSelection.optionChain.servedRealtimeOpra') : OPRA_DELAY_NOTICE;
28
+ }
26
29
  const source = getExchangeFullName(venue.exchanges[0], t);
27
30
  return tier === 'realtime'
28
31
  ? t('symbolSelection.optionChain.servedRealtime', { source })
@@ -42,15 +45,72 @@ export function isOpraDelayed(exchange, served) {
42
45
  return isOpraGoverned(exchange) && !served.isRealtimeRouted(exchange);
43
46
  }
44
47
  /**
45
- * The short delay mark beside one governed price on a delayed tier (`mins` behind): OPRA's delay notice verbatim on an
46
- * OPRA market (Exhibit A section 14: the exact phrase where its delayed price shows, never on a hover alone), the
47
- * minutes ("10m") on any other plane. A list of rows keeps the minutes per row and shows the notice once for the list
48
- * (`useCmeGovernance().opraDelayNotice`).
48
+ * The short delay mark beside one governed price on a delayed tier (`mins` behind), worded per venue: OPRA's delay
49
+ * notice verbatim on an OPRA market (Exhibit A section 14: the exact phrase where its delayed price shows, never on a
50
+ * hover alone), the stocks tape's CTA statement verbatim on a tape market ("Delayed 15 minutes", never the minutes
51
+ * chip), the minutes ("10m") on CME. A list of rows keeps the minutes per CME row and shows OPRA's notice once for the
52
+ * list (`useCmeGovernance().delayNotice`).
49
53
  */
50
54
  export function governedDelayLabel(exchange, mins, t) {
51
- return isOpraGoverned(exchange) ? OPRA_DELAY_NOTICE : t('watchlist.table.delayShort', { mins });
55
+ if (isOpraGoverned(exchange))
56
+ return OPRA_DELAY_NOTICE;
57
+ if (isStocksTapeGoverned(exchange))
58
+ return STOCKS_DELAY_STATEMENT;
59
+ return t('watchlist.table.delayShort', { mins });
52
60
  }
53
- /** The same mark as a sentence (a hover title, a line): OPRA's notice verbatim, the plane's minutes sentence elsewhere. */
61
+ /**
62
+ * The same mark as a sentence (a hover title, a line, a footnote): OPRA's notice and the stocks statement verbatim,
63
+ * CME's translated minutes sentence.
64
+ */
54
65
  export function governedDelaySentence(exchange, mins, t) {
55
- return isOpraGoverned(exchange) ? OPRA_DELAY_NOTICE : t('cmeRealtimeData.badge.delay', { mins });
66
+ if (isOpraGoverned(exchange))
67
+ return OPRA_DELAY_NOTICE;
68
+ if (isStocksTapeGoverned(exchange))
69
+ return STOCKS_DELAY_STATEMENT;
70
+ return t('cmeRealtimeData.badge.delay', { mins });
71
+ }
72
+ /**
73
+ * Whether `exchange` is a gate-governed venue (CME, OPRA, the US stocks tape) whose data rides the delayed tier here:
74
+ * not ROUTED real-time, the delay badge's rule (a tier nobody confirmed reads delayed, so no surface claims real time it
75
+ * cannot show). The one venue-neutral test behind every delay label; `isOpraDelayed` is its OPRA-only case.
76
+ */
77
+ export function isGovernedDelayed(exchange, served) {
78
+ return gateProviderForExchange(exchange) !== null && !served.isRealtimeRouted(exchange);
79
+ }
80
+ /** The venue's delay statement while `exchange` rides its delayed tier (`governedDelaySentence`), else null. */
81
+ export function governedDelayStatement(exchange, served, t) {
82
+ return isGovernedDelayed(exchange, served) ? governedDelaySentence(exchange, served.delayMinutes(exchange), t) : null;
83
+ }
84
+ /**
85
+ * The delay statements a surface holding markets of its own (an unsynced Time and sales, an order book, a picture of
86
+ * a chart) must show itself: one per delayed governed plane among `own` that no chart on the screen labels already.
87
+ * The licences ask for one label on the screen while the delayed data shows, never one per panel: a chart streaming
88
+ * the same plane on its delayed tier carries the plane's tag (`chartStreams`: each shown chart's stream venue, the
89
+ * tape a Trades stock chart rides, never its POLYGON identity), so the surface stays bare beside it. With no chart on
90
+ * the screen (a phone's full-screen panel) pass none, and every delayed plane reads its statement. Deduped, in the
91
+ * order the planes first appear in `own`.
92
+ */
93
+ export function uncoveredDelayStatements(own, chartStreams, served, t) {
94
+ const labelled = new Set(chartStreams.filter((venue) => isGovernedDelayed(venue, served)).map((venue) => gateProviderForExchange(venue)));
95
+ const planes = new Set();
96
+ const out = [];
97
+ for (const exchange of own) {
98
+ const plane = gateProviderForExchange(exchange);
99
+ if (plane === null || labelled.has(plane) || planes.has(plane))
100
+ continue;
101
+ const statement = governedDelayStatement(exchange, served, t);
102
+ if (statement === null)
103
+ continue;
104
+ planes.add(plane);
105
+ out.push(statement);
106
+ }
107
+ return out;
108
+ }
109
+ /**
110
+ * Whether a list row may paint a market's price figures (last price, change, sparkline) with no delay mark of its own:
111
+ * never on a gate-governed plane. A search reply names no tier, so a governed figure there is a delayed price nobody
112
+ * labels or a real-time quote beside a delayed chart; the stocks feed row and a CME futures row alike draw none.
113
+ */
114
+ export function rowFiguresAllowed(exchange) {
115
+ return gateProviderForExchange(exchange) === null;
56
116
  }
@@ -1,4 +1,4 @@
1
- import { Category, Exchange } from '@orangecharts/orange-v2-pb-common';
1
+ import { Category, Exchange } from '../v2/v2-enums.leaf.js';
2
2
  import { type OptionVenue } from '../../constants/option-venues.constants.js';
3
3
  import type { GateProvider } from '../../workers/constants/socket-slots.js';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Category, Exchange } from '@orangecharts/orange-v2-pb-common';
1
+ import { Category, Exchange } from '../v2/v2-enums.leaf.js';
2
2
  import { OPTION_VENUES } from '../../constants/option-venues.constants.js';
3
3
  /**
4
4
  * Whether a gate plane's chain stamps true expiry instants (OptionVenue.expiryInstants: OPRA and CME both,
@@ -15,6 +15,13 @@ export declare function poolSymbolPair(raw: string): {
15
15
  } | undefined;
16
16
  /** A whole string that is a Solana address: a memecoin mint pasted into search, a launchpad key. */
17
17
  export declare function isSolanaBase58Address(text: string): boolean;
18
+ /**
19
+ * The one Solana address in text a user pasted into search, or null: the bare address, or one in quotes or brackets,
20
+ * after a label, with trailing punctuation, or closing a link. Base58 is case-sensitive, so every search box reads a
21
+ * pasted address through this before anything canonicalizes its words (`poolAwareUppercase`). Null for text holding
22
+ * a venue delimiter: a market token (`SOLANA_LAUNCHPAD|<mint>`, a pool token) or a formula is not a paste.
23
+ */
24
+ export declare function pastedSolanaAddress(text: string): string | null;
18
25
  export declare function poolAwareTokens(text: string, tokenizeLegacy: (text: string) => string[]): string[];
19
26
  /** Canonicalize venue spelling, never the raw pool symbol, including incomplete typed input. */
20
27
  export declare function poolAwareUppercase(text: string): string;
@@ -22,6 +22,46 @@ const SOLANA_ADDRESS = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
22
22
  export function isSolanaBase58Address(text) {
23
23
  return SOLANA_ADDRESS.test(text);
24
24
  }
25
+ // What a pasted address arrives in: quotes or brackets, the full stop of the sentence it was copied from, a label
26
+ // ending in a colon ("CA:", "Mint:", "Contract address:", the fullwidth colon too), or a link to the token whose last
27
+ // path segment it is (pump.fun/coin/<mint>, solscan.io/token/<mint>).
28
+ const ADDRESS_OPENERS = /^["'`“‘(<[{\s]+/;
29
+ const ADDRESS_CLOSERS = /["'`”’)>\]}.,;:!?\s]+$/;
30
+ const ADDRESS_LABEL = /^[$A-Za-z][$A-Za-z0-9 ]{0,24}[::]\s*/;
31
+ const ADDRESS_LINK = /^https?:\/\/[^\s/]+\/(\S+)$/i;
32
+ const unwrapAddress = (text) => text.replace(ADDRESS_OPENERS, '').replace(ADDRESS_CLOSERS, '');
33
+ /**
34
+ * The one Solana address in text a user pasted into search, or null: the bare address, or one in quotes or brackets,
35
+ * after a label, with trailing punctuation, or closing a link. Base58 is case-sensitive, so every search box reads a
36
+ * pasted address through this before anything canonicalizes its words (`poolAwareUppercase`). Null for text holding
37
+ * a venue delimiter: a market token (`SOLANA_LAUNCHPAD|<mint>`, a pool token) or a formula is not a paste.
38
+ */
39
+ export function pastedSolanaAddress(text) {
40
+ let rest = text.trim();
41
+ if (isSolanaBase58Address(rest))
42
+ return rest;
43
+ if (rest.includes('|'))
44
+ return null;
45
+ const link = ADDRESS_LINK.exec(rest);
46
+ if (link)
47
+ rest = link[1].split(/[?#]/)[0].split('/').filter(Boolean).pop() ?? '';
48
+ rest = unwrapAddress(unwrapAddress(rest).replace(ADDRESS_LABEL, ''));
49
+ return isSolanaBase58Address(rest) ? rest : null;
50
+ }
51
+ // An address standing among other words (not inside a longer one): a base58 run of address length. The boundary
52
+ // before it is a group, not a lookbehind, so older Safari still parses the module.
53
+ const ADDRESS_RUN = /(^|[^A-Za-z0-9])([1-9A-HJ-NP-Za-km-z]{32,44})(?![A-Za-z0-9])/g;
54
+ /** Uppercase, except the address runs (`ADDRESS_RUN`), which keep their case. */
55
+ function upperKeepingAddresses(text) {
56
+ let result = '';
57
+ let start = 0;
58
+ for (const match of text.matchAll(ADDRESS_RUN)) {
59
+ const runStart = match.index + match[1].length;
60
+ result += text.slice(start, runStart).toUpperCase() + match[2];
61
+ start = runStart + match[2].length;
62
+ }
63
+ return result + text.slice(start).toUpperCase();
64
+ }
25
65
  // Only explicitly routed pool markets are atoms in a formula. Other venues keep
26
66
  // their existing tokenizer, including slash as division and legacy aliases.
27
67
  const POOL_TOKEN = /\b(?:BNB_ONCHAIN|SOLANA_ONCHAIN)\|[A-Za-z0-9._]+\/[A-Za-z0-9._-]+:[A-Za-z0-9]+/gi;
@@ -38,11 +78,16 @@ export function poolAwareTokens(text, tokenizeLegacy) {
38
78
  /** Canonicalize venue spelling, never the raw pool symbol, including incomplete typed input. */
39
79
  export function poolAwareUppercase(text) {
40
80
  // A pasted address is a case-sensitive identity (a memecoin's mint, a launchpad key): it is
41
- // looked up as typed, never canonicalized.
42
- if (isSolanaBase58Address(text.trim()))
43
- return text;
81
+ // looked up as typed, never canonicalized, and what it was pasted in (`pastedSolanaAddress`) drops away. A whole
82
+ // address keeps the spacing typed around it: that is the person's text, not a wrapping.
83
+ const address = pastedSolanaAddress(text);
84
+ if (address)
85
+ return isSolanaBase58Address(text.trim()) ? text : address;
44
86
  if (poolSymbolPair(text))
45
87
  return text;
88
+ // Outside market tokens an address among other words keeps its case as well, so deleting the words around it
89
+ // leaves the address, not its capitals. A venue token's id is the venue's to spell (a prediction id's hex run).
90
+ const upper = text.includes('|') ? (part) => part.toUpperCase() : upperKeepingAddresses;
46
91
  return poolAwareTokens(text, (part) => {
47
92
  // While typing, keep the tail after a known venue intact before the pair/ID is complete. A
48
93
  // launchpad market is keyed by a bare base58 or checksummed address, which ends at the next
@@ -52,11 +97,11 @@ export function poolAwareUppercase(text) {
52
97
  let start = 0;
53
98
  for (const match of part.matchAll(pattern)) {
54
99
  const venue = match[1] ?? match[2];
55
- result += part.slice(start, match.index).toUpperCase();
100
+ result += upper(part.slice(start, match.index));
56
101
  result += venue.toUpperCase() + match[0].slice(venue.length);
57
102
  start = match.index + match[0].length;
58
103
  }
59
- return [result + part.slice(start).toUpperCase()];
104
+ return [result + upper(part.slice(start))];
60
105
  })
61
106
  .map((part) => {
62
107
  const boundary = part.indexOf('|');
@@ -0,0 +1,15 @@
1
+ /** What a display path knows of a market: its exchange code, and its asset class where a catalog row names one. */
2
+ export interface StockDisplayMarket {
3
+ exchange?: string | null;
4
+ assetClass?: string | null;
5
+ }
6
+ /** A US stock listing: a US equities venue (tradfi: the free lane, a listing venue, a SIP tape), never an index. */
7
+ export declare function isUsStockListing(market: StockDisplayMarket | null | undefined): boolean;
8
+ /** The ticker a US stock listing shows (`POLYGON|SOXL/USD` reads SOXL); null for every other market. */
9
+ export declare function stockDisplayTicker(exchange: string | null | undefined, symbol: string | null | undefined, assetClass?: string | null): string | null;
10
+ /** The symbol a market shows where no resolved split is at hand: a US stock's ticker, else the stored symbol. */
11
+ export declare function marketDisplaySymbol(exchange: string | null | undefined, symbol: string | null | undefined): string;
12
+ /** The quote a market's name shows after its base: none on a US stock listing, the given quote on any other market. */
13
+ export declare function marketDisplayQuote(market: StockDisplayMarket | null | undefined, quote: string): string;
14
+ /** Display tokens with each US stock token whole: its slash is the vendor's, never division (entry keeps its own). */
15
+ export declare function stockAwareTokens(text: string, tokenizeRest: (text: string) => string[]): string[];
@@ -0,0 +1,37 @@
1
+ // A US stock's stored pair (POLYGON|SOXL/USD) carries the vendor's /USD, no quote: every display names the bare ticker.
2
+ import { checkIsTradFi } from '../chart/marketKind.util.js';
3
+ /** A US stock listing: a US equities venue (tradfi: the free lane, a listing venue, a SIP tape), never an index. */
4
+ export function isUsStockListing(market) {
5
+ return !!market && checkIsTradFi(market.exchange) && market.assetClass !== 'ASSET_CLASS_INDEX';
6
+ }
7
+ // The pair's /USD or its normalized -USD (SOXL-USD); display only: identity, URLs, search and requests keep the pair.
8
+ const VENDOR_QUOTE = /[/-]USD$/i;
9
+ /** The ticker a US stock listing shows (`POLYGON|SOXL/USD` reads SOXL); null for every other market. */
10
+ export function stockDisplayTicker(exchange, symbol, assetClass) {
11
+ if (typeof symbol !== 'string' || !isUsStockListing({ exchange, assetClass }))
12
+ return null;
13
+ return symbol.trim().replace(VENDOR_QUOTE, '') || null;
14
+ }
15
+ /** The symbol a market shows where no resolved split is at hand: a US stock's ticker, else the stored symbol. */
16
+ export function marketDisplaySymbol(exchange, symbol) {
17
+ return stockDisplayTicker(exchange, symbol) ?? symbol ?? '';
18
+ }
19
+ /** The quote a market's name shows after its base: none on a US stock listing, the given quote on any other market. */
20
+ export function marketDisplayQuote(market, quote) {
21
+ return isUsStockListing(market) ? '' : quote;
22
+ }
23
+ // The ticker class carries dots (BRK.B) but no hyphen: a hyphen between tokens is the formula's minus.
24
+ const STOCK_PAIR_TOKEN = /\b([A-Z][A-Z0-9_]*)\|([A-Z0-9.]+\/USD)\b/gi;
25
+ /** Display tokens with each US stock token whole: its slash is the vendor's, never division (entry keeps its own). */
26
+ export function stockAwareTokens(text, tokenizeRest) {
27
+ const tokens = [];
28
+ let start = 0;
29
+ for (const match of text.matchAll(STOCK_PAIR_TOKEN)) {
30
+ if (!isUsStockListing({ exchange: match[1] }))
31
+ continue;
32
+ tokens.push(...tokenizeRest(text.slice(start, match.index)), match[0]);
33
+ start = match.index + match[0].length;
34
+ }
35
+ tokens.push(...tokenizeRest(text.slice(start)));
36
+ return tokens;
37
+ }