@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,143 @@
1
+ /** The tenors the chart serves on both classes, in the kit's own order (`KNOWN_TENORS`): the
2
+ * five the gateway holds a series for. */
3
+ export const WRUN_OPTION_SUMMARY_TENORS = Object.freeze([
4
+ 'ONE_W',
5
+ 'ONE_M',
6
+ 'TWO_M',
7
+ 'THREE_M',
8
+ 'SIX_M',
9
+ ]);
10
+ /** The coins the chart serves both classes for (the gateway's option-summary census): every other
11
+ * coin's chart is refused before the fetch by the capability table. */
12
+ export const WRUN_OPTION_SUMMARY_COINS = Object.freeze(['BTC', 'ETH']);
13
+ /** Kit tenors (`KNOWN_TENORS`) the gateway holds no series for: refused by their own name,
14
+ * before any fetch. */
15
+ const WRUN_OPTION_SUMMARY_UNSERVED_TENORS = Object.freeze(['ONE_D', 'THREE_D', 'ONE_Y']);
16
+ /** The deltas the skew is quoted at (the kit's WRUN_SKEW_DELTAS, in its order; the main thread
17
+ * never loads the kit bundle, so wrun-source-words.kit-mirror.spec.ts pins the copy). */
18
+ export const WRUN_SKEW_DELTAS = Object.freeze([5, 15, 25, 35]);
19
+ /** The standard quoted skew: what a skew input without a `delta` knob reads. */
20
+ export const WRUN_SKEW_DEFAULT_DELTA = 25;
21
+ /** The K lane each class rides: the source type, the fetch-key stem and the label of the
22
+ * "data is unavailable" refusal. */
23
+ export const WRUN_OPTION_SUMMARY_LANES = Object.freeze({
24
+ implied_volatility: { type: 'deribit_implied_volatility', key: 'iv', label: 'Implied volatility' },
25
+ skew: { type: 'skew', key: 'skew', label: 'Skew' },
26
+ });
27
+ /** The delta a skew input is quoted at: its `delta` knob, the standard 25 when absent. A value
28
+ * outside the served deltas refuses by name (the kit refuses it at the sheet too; a registry
29
+ * sheet is re-checked here, before any fetch). */
30
+ function wrunSkewDeltaOf(metadata, source, inputName) {
31
+ const delta = source.delta;
32
+ if (delta === undefined)
33
+ return WRUN_SKEW_DEFAULT_DELTA;
34
+ if (typeof delta !== 'number' || !WRUN_SKEW_DELTAS.includes(delta)) {
35
+ throw new Error(`WRUN ${metadata.id}: skew delta '${String(delta)}' is not served by the chart: declare ` +
36
+ `${WRUN_SKEW_DELTAS.join(', ')} (absent reads ${WRUN_SKEW_DEFAULT_DELTA}) (input '${inputName}')`);
37
+ }
38
+ return delta;
39
+ }
40
+ /**
41
+ * The column plan of one option-summary class: the distinct tenors (per delta) the sheet
42
+ * declares, each with its lane column and the inputs reading it, and the K asks that fetch
43
+ * them. Refused by name, before any fetch: a celled input, a field other than the class's own,
44
+ * a missing or unknown tenor, ONE_D, THREE_D and ONE_Y (kit words the gateway holds no series
45
+ * for), and a skew delta outside the served four.
46
+ */
47
+ export function planWrunOptionSummaryLane(metadata, sourceClass) {
48
+ const plan = { columns: [], asks: [] };
49
+ const inputs = [...metadata.inputs].sort((a, b) => a.index - b.index);
50
+ for (const input of inputs) {
51
+ const source = metadata.inputSources[input.name];
52
+ if (source?.source !== sourceClass)
53
+ continue;
54
+ if (input.cellType === 'array') {
55
+ throw new Error(`WRUN ${metadata.id}: celled source class '${sourceClass}' is not served by the ` +
56
+ `browser lane yet (input '${input.name}')`);
57
+ }
58
+ if (source.field !== sourceClass) {
59
+ throw new Error(`WRUN ${metadata.id}: unknown ${sourceClass} field '${source.field}' (input '${input.name}')`);
60
+ }
61
+ const tenor = source.tenor;
62
+ if (tenor !== undefined && WRUN_OPTION_SUMMARY_UNSERVED_TENORS.includes(tenor)) {
63
+ throw new Error(`WRUN ${metadata.id}: ${sourceClass} tenor '${tenor}' is not served by the chart: the option ` +
64
+ `summary has no ${tenor} series (served: ${WRUN_OPTION_SUMMARY_TENORS.join(', ')}) (input '${input.name}')`);
65
+ }
66
+ if (tenor === undefined || !WRUN_OPTION_SUMMARY_TENORS.includes(tenor)) {
67
+ throw new Error(`WRUN ${metadata.id}: ${sourceClass} needs a tenor ` +
68
+ `(${WRUN_OPTION_SUMMARY_TENORS.join(', ')}), got '${tenor}' (input '${input.name}')`);
69
+ }
70
+ const delta = sourceClass === 'skew' ? wrunSkewDeltaOf(metadata, source, input.name) : undefined;
71
+ let column = plan.columns.find((candidate) => candidate.tenor === tenor && candidate.delta === delta);
72
+ if (column === undefined) {
73
+ column = {
74
+ tenor,
75
+ ...(delta !== undefined ? { delta } : {}),
76
+ column: plan.columns.length + 1,
77
+ inputIndexes: [],
78
+ };
79
+ plan.columns.push(column);
80
+ let ask = plan.asks.find((candidate) => candidate.delta === delta);
81
+ if (ask === undefined) {
82
+ ask = { ...(delta !== undefined ? { delta } : {}), tenors: [] };
83
+ plan.asks.push(ask);
84
+ }
85
+ ask.tenors.push(tenor);
86
+ }
87
+ column.inputIndexes.push(input.index);
88
+ }
89
+ return plan;
90
+ }
91
+ /** The fetch-key suffix of one ask: the class stem, the delta appended once it is not the
92
+ * standard one (the 25-delta ask keeps the lane's own key). */
93
+ export function wrunOptionSummaryAskKey(sourceClass, ask) {
94
+ const { key } = WRUN_OPTION_SUMMARY_LANES[sourceClass];
95
+ return ask.delta === undefined || ask.delta === WRUN_SKEW_DEFAULT_DELTA ? key : `${key}-${ask.delta}`;
96
+ }
97
+ /** The payload fields of one ask beyond the current-market placeholders: the chart's coin, the
98
+ * delta (skew) and the tenors the answer's columns are, in order. */
99
+ export function wrunOptionSummaryAskExtras(ask) {
100
+ return {
101
+ coin: 'currentCoin',
102
+ ...(ask.delta !== undefined ? { delta: ask.delta } : {}),
103
+ tenors: [...ask.tenors],
104
+ };
105
+ }
106
+ /**
107
+ * The lane rows `[ts, ...columns]` from the per-ask K answers `[ts, ...the ask's tenors]`
108
+ * (`rowsByAsk[i]` answers `plan.asks[i]`), ascending by ts. One ask is its own answer, returned
109
+ * as it came (every `implied_volatility` plan, a `skew` plan on one delta). Several asks join
110
+ * on the timestamp: a column reads its delta's answer at its tenor, NaN where that delta has no
111
+ * row at the stamp.
112
+ */
113
+ export function zipWrunOptionSummaryRows(plan, rowsByAsk) {
114
+ if (plan.asks.length <= 1)
115
+ return (rowsByAsk[0] ?? []);
116
+ const cells = plan.columns.map((column) => {
117
+ const askAt = plan.asks.findIndex((ask) => ask.delta === column.delta);
118
+ return { askAt, cell: plan.asks[askAt].tenors.indexOf(column.tenor) + 1 };
119
+ });
120
+ const answers = plan.asks.map((_ask, at) => {
121
+ const byTs = new Map();
122
+ for (const row of rowsByAsk[at] ?? []) {
123
+ const ts = Number(row[0]);
124
+ if (Number.isFinite(ts))
125
+ byTs.set(ts, row);
126
+ }
127
+ return byTs;
128
+ });
129
+ const stamps = new Set();
130
+ for (const byTs of answers)
131
+ for (const ts of byTs.keys())
132
+ stamps.add(ts);
133
+ return [...stamps]
134
+ .sort((a, b) => a - b)
135
+ .map((ts) => {
136
+ const row = [ts];
137
+ for (const { askAt, cell } of cells) {
138
+ const value = answers[askAt].get(ts)?.[cell];
139
+ row.push(value === null || value === undefined ? Number.NaN : Number(value));
140
+ }
141
+ return row;
142
+ });
143
+ }
@@ -0,0 +1,308 @@
1
+ import type { OptionInstrumentSnapshot } from '../../interfaces/option-instrument.interface.js';
2
+ import type { OptionSource } from '../options/option-venue.util.js';
3
+ import type { OpraOptionPlaneStop } from '../../host-ports.types.js';
4
+ import type { WrunOptionsStopReason } from './wrun-refusal.util.js';
5
+ import type { GateProvider } from '../../workers/constants/socket-slots.js';
6
+ import type { OptionsChainScope } from '../../interfaces/options-chain-scope.interface.js';
7
+ /** f64s per contract tuple (the shared host's `WRUN_HOST_CELL_TUPLE_WIDTHS.options_chain`, the width
8
+ * the packer packs; wrun-source-words.kit-mirror.spec.ts pins it). */
9
+ export declare const WRUN_OPTIONS_CHAIN_TUPLE_WIDTH = 10;
10
+ /** The `venue` knob's words (the kit's WRUN_OPTIONS_CHAIN_VENUES, in its
11
+ * order): "auto" reads the chart's own market when it is an options venue
12
+ * (a CME futures chart reads the CME chain of its root, a flagged crypto
13
+ * options venue its own chain, a US stock or ETF chart or an OPRA option
14
+ * contract chart the OPRA chain of its ticker for an OpenMarket package
15
+ * only), else the coin's Deribit chain; every other
16
+ * word pins one venue's chain and refuses by name on a chart that has no
17
+ * chain there ("deribit" and "cme" as before; the five crypto words behind
18
+ * the crypto-options gate, see `WRUN_OPTIONS_CHAIN_CRYPTO_VENUE_IDS`). */
19
+ export declare const WRUN_OPTIONS_CHAIN_VENUES: readonly ["auto", "deribit", "cme", "binance", "okx", "bybit", "bullish", "derive"];
20
+ export type WrunOptionsChainVenue = (typeof WRUN_OPTIONS_CHAIN_VENUES)[number];
21
+ /** The crypto venue words' rows in the chart's venue table (`OPTION_VENUES`
22
+ * ids): each reads the coin's chain on that plain venue, resolved on the
23
+ * main thread through the metadata listing (`WrunOptionsChainCryptoVenues`
24
+ * below) and gated by the crypto-options gate; `deribit` stays ungated. */
25
+ export declare const WRUN_OPTIONS_CHAIN_CRYPTO_VENUE_IDS: Readonly<{
26
+ binance: "binance-options";
27
+ okx: "okx-options";
28
+ bybit: "bybit";
29
+ bullish: "bullish";
30
+ derive: "derive";
31
+ }>;
32
+ export type WrunOptionsChainCryptoVenueWord = keyof typeof WRUN_OPTIONS_CHAIN_CRYPTO_VENUE_IDS;
33
+ export declare function isWrunOptionsChainCryptoVenueWord(word: string): word is WrunOptionsChainCryptoVenueWord;
34
+ /** The chain snapshot's freshness window (`FRESH_SNAPSHOT_MS` in
35
+ * options-chain-state.worker.util.ts, mirrored here so the main thread
36
+ * never imports the worker module): the K_OPTIONS_CHAIN request stamps the
37
+ * bucket into its identity, so the source caches (single-flight, row cache,
38
+ * replay cache) rotate with the chain instead of serving one snapshot for a
39
+ * whole bar. */
40
+ export declare const WRUN_OPTIONS_CHAIN_SNAPSHOT_MS = 30000;
41
+ export type WrunOptionsChainExpiries = {
42
+ kind: 'all';
43
+ } | {
44
+ kind: 'nearest';
45
+ count: number;
46
+ };
47
+ /** The `expiries` knob parsed (the kit's wrunOptionsChainExpiries): "all"
48
+ * (or absent) is the whole live chain, "nearest:N" its N nearest live
49
+ * expiries; undefined for any other word (the kit refuses it at the sheet,
50
+ * the row builder again by name). */
51
+ export declare function wrunOptionsChainExpiries(value: string | undefined): WrunOptionsChainExpiries | undefined;
52
+ /** The reader tier a governed chain read rides: real-time for a viewer the gate serves real-time on the chain's
53
+ * exchange, delayed otherwise (and while nobody confirmed one). */
54
+ export type WrunOptionsChainServedTier = 'realtime' | 'delayed';
55
+ /** A governed chain: its gate plane (CME, or OPRA for a US stock, ETF or OPRA option contract
56
+ * chart), the exchange the chain lists on, its root, the scope the read asks (the lane's own,
57
+ * `wrunOptionsChainLaneScope`; absent: the whole ladder, as every governed read asked before the
58
+ * scope existed) and the tier it is read on (`servedTier`, governed-route.util
59
+ * `governedOptionSummaryTier` on the main thread's served-access mirror when the lane resolves the
60
+ * read; absent: delayed, the tier every read is safe on). */
61
+ export interface WrunGovernedOptionsChainIdentity {
62
+ venue: GateProvider;
63
+ exchange: string;
64
+ underlying: string;
65
+ scope?: OptionsChainScope;
66
+ servedTier?: WrunOptionsChainServedTier;
67
+ }
68
+ /** The chain the lane reads, in the shapes `ensureFreshChain` takes (a
69
+ * Deribit coin, a governed exchange + root on its gate plane, a flagged crypto venue's
70
+ * source). */
71
+ export type WrunOptionsChainIdentity = {
72
+ venue: 'deribit';
73
+ coin: string;
74
+ } | WrunGovernedOptionsChainIdentity | {
75
+ venue: 'crypto';
76
+ source: OptionSource;
77
+ };
78
+ /** The identity as the flat payload fields the lane's acquisition record
79
+ * and the K_OPTIONS_CHAIN request carry. Prefixed (`chain*`) so the
80
+ * chart's placeholder rewrite (`exchange`, `symbol`, `coin`) never touches
81
+ * them. A governed identity adds the tier it is read on (`chainServedTier`:
82
+ * the request's identity and the worker's ceiling, so a source cache never
83
+ * serves one tier's chain to the other; the legend names a delayed OPRA read,
84
+ * wrun-draft-legend-note.util `wrunChainServedTierNote`) and, with a scope,
85
+ * the scope's wire spelling (`chainExpiries`, `chainNeighborStrikes`). */
86
+ export declare function wrunOptionsChainLaneExtras(identity: WrunOptionsChainIdentity): Record<string, unknown>;
87
+ /** The identity a payload carries (the control's settings, the worker's
88
+ * request), or undefined when it carries none. A governed identity reads its
89
+ * scope and its tier back too; a scope the payload names but spells wrong
90
+ * reads no identity at all (the request is declined, never widened to the
91
+ * whole ladder), and a tier word it does not know is left out (read delayed). */
92
+ export declare function wrunOptionsChainIdentityOf(payload: Readonly<Record<string, unknown>> | undefined): WrunOptionsChainIdentity | undefined;
93
+ /** One key per identity (two inputs must resolve to the same chain). A
94
+ * governed key is scope-free: two inputs read the same chain whatever the
95
+ * lane asks of it (`opra:OPRA:SPY`). */
96
+ export declare function wrunOptionsChainIdentityKey(identity: WrunOptionsChainIdentity): string;
97
+ /**
98
+ * A scope's wire spelling: `chainExpiries` "all" | "nearest:N" | "horizon:<ms>" and
99
+ * `chainNeighborStrikes` (the strikes each side of every expiry's at-the-money strike, 0 = every
100
+ * strike). The chain store's own grammar (`formatOptionsChainExpiryScope` and
101
+ * `parseOptionsChainScope` in options-chain-state.worker.util), copied here so the main thread never
102
+ * loads the worker module; tests/utility/wrun/wrun-options-chain.util.spec.ts pins the copy against
103
+ * the store's.
104
+ */
105
+ export declare function wrunOptionsChainScopeFields(scope: OptionsChainScope): {
106
+ chainExpiries: string;
107
+ chainNeighborStrikes: number;
108
+ };
109
+ /** The scope a payload's two fields spell (`wrunOptionsChainScopeFields` read back): both absent is
110
+ * undefined (no scope asked), one absent takes its whole-ladder default (`all`, 0 strikes), any
111
+ * other value undefined. */
112
+ export declare function wrunOptionsChainScopeOf(expiries: unknown, neighborStrikes: unknown): OptionsChainScope | undefined;
113
+ /** The strike window each side of every expiry's at-the-money strike a governed lane serves: never
114
+ * narrower than 8 (the floor it trades for more expiries), never wider than 80. */
115
+ export declare const WRUN_OPTIONS_CHAIN_MIN_NEIGHBOR_STRIKES = 8;
116
+ export declare const WRUN_OPTIONS_CHAIN_MAX_NEIGHBOR_STRIKES = 80;
117
+ /**
118
+ * The scope a governed lane asks (CME, OPRA), bounded by the package's declared appetite alone,
119
+ * never by a count of expiries: the smallest `max_cells` over its chain inputs (it counts contracts,
120
+ * one tuple each, the pack layer's unit; one fetch feeds every input) is the budget. The lane serves
121
+ * as many of the expiries the inputs read as the budget fits at the floor window of
122
+ * WRUN_OPTIONS_CHAIN_MIN_NEIGHBOR_STRIKES (8) each side, preferring more expiries over a wider window;
123
+ * once every one of them fits, the window widens as far as the budget allows, up to
124
+ * WRUN_OPTIONS_CHAIN_MAX_NEIGHBOR_STRIKES (80): K = floor((budget / 2E - 1) / 2) for E expiries. The
125
+ * expiries the inputs read: every live one (`all`, or a word outside the grammar, which the row
126
+ * builder refuses by name), else the largest `nearest:N`, kept exact when N fits. `liveExpiries` is how
127
+ * many the chain lists now (its expiry directory); unknown, or a listing that names none (a directory
128
+ * that told nothing, never a chain of one), `all` asks the most expiries the budget fits at the floor
129
+ * window. SPY lists about 36: Gamma Map (4000, `all`) reads all 36 at K = 27 (3,960
130
+ * contracts), a `nearest:1` package declaring 800 reads 1 at K = 80, an `all` package declaring 100
131
+ * reads 2 at K = 12. No declared `max_cells` leaves the budget open (every expiry the inputs read, at 80).
132
+ */
133
+ export declare function wrunOptionsChainLaneScope(inputs: ReadonlyArray<{
134
+ expiries: WrunOptionsChainExpiries | undefined;
135
+ maxCells: number | undefined;
136
+ }>, liveExpiries?: number): OptionsChainScope;
137
+ /** Where the chart's options controls read their chain (the shape
138
+ * `resolveOptionsChartSource` returns for the chart's metadata). A governed
139
+ * chain names its gate plane (CME, or OPRA on a US stock or ETF chart and on
140
+ * an OPRA option contract chart): `cme` is the one plane with a venue word of
141
+ * its own, and `auto` reads OPRA for an OpenMarket package only. */
142
+ export type WrunOptionsChartSource = {
143
+ venue: GateProvider;
144
+ exchange: string;
145
+ underlying: string;
146
+ } | {
147
+ venue: 'crypto';
148
+ source: OptionSource;
149
+ } | {
150
+ venue: 'deribit';
151
+ coin: string;
152
+ };
153
+ /**
154
+ * Why a decision refused, for the refusal record (worker-safe words, no i18n; the run lane picks
155
+ * the record's seed by it):
156
+ * - `bad-venue-word`: a `venue` word the kit does not know;
157
+ * - `flag-off`: a crypto venue word while the crypto-options gate is off (a guest);
158
+ * - `venue-not-listed`: a pinned venue (a crypto word, `deribit`) that lists no options for the coin;
159
+ * - `cme-venue`: venue `cme` on a chart that is provably no CME futures chart (its resolved source
160
+ * is a crypto, a Deribit or an OPRA one);
161
+ * - `cme-directory`: the chart's CME chain directory call itself threw (the caller says so);
162
+ * - `cme-unresolved`: a CME chart whose resolved source carries no identity (the root lists no
163
+ * options, or the directory found no match), or venue `cme` where the chart is not known;
164
+ * - `opra-official-only`: `auto` on a chart whose chain lists on OPRA (a US stock or ETF chart, an
165
+ * OPRA option contract chart) for a package that is not one of OpenMarket's own: US options data
166
+ * is open to official packages only (product decision 2026-10-14), unless the `opra-user-scripts`
167
+ * flag opened it to the run (`opraUserScripts`, Kyle 2026-10-17);
168
+ * - `opra-directory`: the chart's US option chain directory call itself threw (the caller says so), for a
169
+ * run the OPRA plane is open to (any other meets `opra-official-only` first);
170
+ * - `no-chain`: `auto` on a market that is no options venue, with a coin Deribit does not list, or a
171
+ * chart whose OPRA chain resolved empty (an index root on a stock chart);
172
+ * - `one-venue`: two inputs that resolve to two chains (`wrunOptionsChainOneVenueRefusal`);
173
+ * - `options-stopped`: `auto` on a chart whose options list on OPRA but ride no plane for a reason the caller
174
+ * knows (`opraStop`, opra-options-gate.util `opraOptionPlaneStop`: the `opra` flag dark, an index chart the
175
+ * router sends no OPRA read for), or a word reading a chain on a plane another screen holds the session of
176
+ * (`heldElsewhere`: no directory read was sent), for a run the plane is open to; the refusal carries the reason
177
+ * (`stop`) and, for `session-elsewhere`, the plane (`plane`).
178
+ */
179
+ export type WrunOptionsChainRefusalReason = 'bad-venue-word' | 'flag-off' | 'venue-not-listed' | 'cme-venue' | 'cme-directory' | 'cme-unresolved' | 'opra-official-only' | 'opra-directory' | 'no-chain' | 'one-venue' | 'options-stopped';
180
+ /** A refused decision: the stable code and the technical words (the error's message, Copy details),
181
+ * the reason, and the facts the record's sentence names: `venueName` (the pinned venue's name, for
182
+ * `flag-off` and `venue-not-listed`) and `coin` (the coin the decision asked about; absent when the
183
+ * market names none). */
184
+ export interface WrunOptionsChainRefusal {
185
+ ok: false;
186
+ code: string;
187
+ message: string;
188
+ reason: WrunOptionsChainRefusalReason;
189
+ venueName?: string;
190
+ coin?: string;
191
+ /** Why the chart's options read no chain (`options-stopped` only): the record says this reason. */
192
+ stop?: WrunOptionsStopReason;
193
+ /** The plane whose session another screen holds (`stop: 'session-elsewhere'` only): the way out takes it back. */
194
+ plane?: GateProvider;
195
+ }
196
+ export type WrunOptionsChainDecision = {
197
+ ok: true;
198
+ identity: WrunOptionsChainIdentity;
199
+ } | WrunOptionsChainRefusal;
200
+ /**
201
+ * What the main thread resolved for the crypto venue words before the
202
+ * decision (`resolveWrunOptionsChainCryptoVenues`, wrun-options-chain-venues.util:
203
+ * the crypto-options gate and the metadata listing of the chart's coin,
204
+ * which this worker-safe module never reads itself): the flag, the coin the
205
+ * venues were asked for (the chart source's coin on an option chart, else the
206
+ * chart coin normalized) and, per word, the chain source that venue reads for
207
+ * the coin, undefined when the venue does not list it.
208
+ */
209
+ export interface WrunOptionsChainCryptoVenues {
210
+ enabled: boolean;
211
+ coin: string;
212
+ sourceOf: (word: WrunOptionsChainCryptoVenueWord) => OptionSource | undefined;
213
+ }
214
+ /** The crypto venues of a chart without the flag, the listing or the words:
215
+ * every crypto word refuses by name. */
216
+ export declare const WRUN_OPTIONS_CHAIN_NO_CRYPTO_VENUES: WrunOptionsChainCryptoVenues;
217
+ export declare const WRUN_OPTIONS_CHAIN_VENUE_CODE = "wrun_options_chain_venue";
218
+ export declare const WRUN_OPTIONS_CHAIN_UNAVAILABLE_CODE = "wrun_options_chain_unavailable";
219
+ export declare const WRUN_OPTIONS_CHAIN_VENUE_UNAVAILABLE_CODE = "wrun_options_chain_venue_unavailable";
220
+ export declare const WRUN_OPTIONS_CHAIN_ONE_VENUE_CODE = "wrun_options_chain_one_venue";
221
+ export declare const WRUN_OPTIONS_CHAIN_EXPIRIES_CODE = "wrun_options_chain_expiries";
222
+ /**
223
+ * The `venue` knob against the chart, decided in ONE place for the run lane,
224
+ * the works-on list and the K_ control: `chartSource` is what the chart's own
225
+ * options controls resolve for the market (`resolveOptionsChartSource`),
226
+ * `chartCoin` the chart's coin for a pinned Deribit family off a market that
227
+ * is not Deribit-backed, `deribitListed` the Deribit coin set, `cryptoVenues`
228
+ * what the main thread resolved for the five crypto venue words (the flag and
229
+ * the coin's listing per venue), `official` whether the package is one of
230
+ * OpenMarket's own (`isOfficialWrunOverlay`; a caller without the overlay's
231
+ * provenance passes false: fail closed). A governed identity comes back
232
+ * without a scope: the run lane sizes it once the identity names the chain
233
+ * (`wrunOptionsChainLaneScope` over the chain's live expiry count).
234
+ * `directoryFailed` is the caller's evidence that
235
+ * a plane's chain directory call itself threw on a chart governed by it
236
+ * (`chartSource` is then unknown): a word that reads that chain (`cme` and
237
+ * `auto` on a CME chart, `auto` on a US stock chart) refuses `cme-directory`
238
+ * or `opra-directory` instead of guessing another chain (a run the OPRA plane
239
+ * is closed to meets the OPRA wall first). Refuses by name
240
+ * before any fetch, the odds lane's way: the message names the input, the
241
+ * market and the way out, and the reason says why
242
+ * (`WrunOptionsChainRefusalReason`). A crypto word resolves to
243
+ * `{ venue: 'crypto', source }` exactly as `auto` does on a flagged crypto
244
+ * options chart, so the lane, the worker and the identity key read one shape.
245
+ * `auto` reads an OPRA chain (a US stock or ETF chart, an OPRA option
246
+ * contract chart) for an official package, or for any run the
247
+ * `opra-user-scripts` flag opened the plane to (`opraUserScripts`: the
248
+ * caller's kscript-venue-policy `isOpraUserScriptRun` over the overlay's
249
+ * settings), and refuses `opra-official-only` otherwise; no venue word pins OPRA.
250
+ */
251
+ export declare function decideWrunOptionsChainIdentity(args: {
252
+ venue: string | undefined;
253
+ chartSource: WrunOptionsChartSource | undefined;
254
+ chartCoin: string | undefined;
255
+ deribitListed: (coin: string) => boolean;
256
+ cryptoVenues: WrunOptionsChainCryptoVenues;
257
+ marketLabel: string;
258
+ inputName: string;
259
+ official: boolean;
260
+ /** The `opra-user-scripts` flag opened the OPRA plane to this run, a package the viewer wrote or added: it
261
+ * reads the US chain as an official package does. Absent: closed (a caller without provenance fails closed). */
262
+ opraUserScripts?: boolean;
263
+ directoryFailed?: GateProvider;
264
+ /** The chart's options list on OPRA but ride no plane for this reason (opra-options-gate.util
265
+ * `opraOptionPlaneStop`): `auto` refuses with it (`options-stopped`) instead of reading another chain. */
266
+ opraStop?: OpraOptionPlaneStop;
267
+ /** Another screen holds the session of the plane the chart's chain lists on (gate-session-latch.util), so no
268
+ * directory read was sent: a word reading that chain refuses `options-stopped` / `session-elsewhere` on it. */
269
+ heldElsewhere?: GateProvider;
270
+ }): WrunOptionsChainDecision;
271
+ /** Two inputs that resolved to two chains: one package reads one chain (the run lane's words,
272
+ * reason `one-venue`). */
273
+ export declare function wrunOptionsChainOneVenueRefusal(firstInputName: string, inputName: string): WrunOptionsChainRefusal;
274
+ /** One contract's tuple, the frozen column order. */
275
+ export type WrunOptionsChainTuple = [
276
+ strike: number,
277
+ expiryMs: number,
278
+ side: 1 | -1,
279
+ oi: number,
280
+ gamma: number,
281
+ delta: number,
282
+ markIv: number,
283
+ underlying: number,
284
+ multiplier: number,
285
+ vega: number
286
+ ];
287
+ /** The worker's block: every instrument of the shared chain snapshot as a
288
+ * tuple, ordered by expiry, then strike, calls before puts, then symbol
289
+ * (deterministic whatever order the map holds), zero-OI contracts kept
290
+ * (the raw chain; a package decides what a zero means). */
291
+ export declare function wrunOptionsChainTuples(instruments: Iterable<OptionInstrumentSnapshot>): WrunOptionsChainTuple[];
292
+ /** A lane row `[ts, [tuple], ...]` (the K_OPTIONS_CHAIN worker's shape,
293
+ * nested like the volume-profile lane's) read back as tuples; a malformed
294
+ * tuple (not an array of nine finite numbers) is skipped whole, the VP
295
+ * lane's malformed-bucket rule. */
296
+ export declare function wrunOptionsChainRowTuples(row: ReadonlyArray<unknown>): number[][];
297
+ /** The newest lane row's chain (the row with the greatest finite ts), or
298
+ * undefined when no row carries one: the hosts serve the latest chain, so
299
+ * the live primary row reads it whatever bar the poll stamped it on. */
300
+ export declare function latestWrunOptionsChainTuples(rows: ReadonlyArray<ReadonlyArray<unknown>> | undefined): {
301
+ ts: number;
302
+ tuples: number[][];
303
+ } | undefined;
304
+ /** The block one input receives: the tuples under its `expiries` selector
305
+ * ("nearest:N" keeps the N earliest distinct expiries of the chain, which
306
+ * the snapshot already pruned of expired contracts), flattened in tuple
307
+ * order. */
308
+ export declare function wrunOptionsChainCells(tuples: ReadonlyArray<ArrayLike<number>>, expiries: WrunOptionsChainExpiries): number[];