@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,144 @@
1
+ /**
2
+ * `option_surface`: the volatility surface of the chart's options chain, one tuple per expiry on every bar (UW-PARITY S9,
3
+ * `contracts/sources.md`), on every chain the surface job samples (OPTIONS-PORT P1: the crypto venues, CME, OPRA).
4
+ *
5
+ * - Tuple, width 9: `[expiry_ms, dte_days, forward, atm_iv, iv_p25, iv_c25, iv_p10, iv_c10, present]`; bits 1 to 7 of
6
+ * `present` for dte_days through iv_c10 (each bit its column, 0 with the bit clear when the sample leaves it out),
7
+ * bit 8 when the forward came from put-call parity, bit 14 a partial bar.
8
+ * - Backend: OPTION_SURFACE (type 251, kiyotaka-go !62), venue-agnostic, by the chain's exchange and underlying (a
9
+ * crypto venue's root coin, a CME futures contract, an OPRA ticker), one surface per BOOK (a chain's series: Deribit's
10
+ * BTC and BTC_USDC, OKX's BTC-USD and BTC-USD_UM), sampled by the option-surface job into two tiers: 5m kept 30 days
11
+ * and 1d (the session's last sample, or a CME settlement, stamped at its UTC date) kept for good. pb-common 12.68.0
12
+ * names the type; under a pin that does not, every input refuses by name before any fetch
13
+ * (`protocol-pending:OPTION_SURFACE`, the one protocol gate every lane reading a type by name shares:
14
+ * wrun-protocol-pending.util).
15
+ * - Per bar, a snapshot under the tier rule (rule 9): each host bar reads the finest tier that fits it and still
16
+ * retains it (a 09:30-anchored stock bar of 5m or more reads 5m buckets within 30 days, a daily bar past them the 1d
17
+ * row), its newest SEALED bucket, and a bar its tier answered nothing for reads the next coarser tier (D12: a CME
18
+ * daily bar whose 5m tier holds no session reads its settlement DAY row); a bar no fitting tier retains (an intraday
19
+ * bar older than 30 days, a bar finer than 5m) is partial (bit 14, the marker tuple when it holds none).
20
+ * - A CHAIN lane (`chain`): the chain is the one chain resolver's (opra-option-lanes.util `decideWrunLaneChain`), per
21
+ * input, and its plane is per instance: OPRA's rules on a US stock or OPRA contract chart (unchanged), CME's on a CME
22
+ * futures chart (a continuous chart reads its lead contract, and a live session rebuilds once the lead rolls:
23
+ * `acquisitionMoved`), none on a crypto chain.
24
+ * - Knobs: `venue` (the options chain's words, decided by the venue decision `options_chain` reads, so `auto` reads
25
+ * the chain `options_chain`'s `auto` reads on the same chart: the chart's own options market, else the coin's
26
+ * Deribit chain, else the first venue that lists it), `book` (`auto` or one series name: ONE series per input,
27
+ * decided when the run plans and named in the acquisition, `auto` the chain's default book over the series its
28
+ * directory lists, opra-option-lanes.util `resolveWrunLaneChainAutoBook`; an answer never picks it) and `max_cells`
29
+ * (a block over it refuses the run); a market pin and the other options classes' knobs refuse by name.
30
+ *
31
+ * LIGHT at module load: pb-common and the chain resolver are imported inside `identity`.
32
+ */
33
+ import { decideWrunLaneChain, refuseWrunLaneStrayKnob, resolveWrunLaneChainChart, wrunLaneChainLeadMoved, wrunLaneChainPlaneOf, wrunLaneChartKey, } from '../opra-option-lanes.util.js';
34
+ import { refuseWrunPollInput } from '../wrun-poll-lane.types.js';
35
+ import { assertWrunProtocolType } from '../../wrun-protocol-pending.util.js';
36
+ const MINUTE_MS = 60_000;
37
+ const DAY_MS = 86_400_000;
38
+ /** f64s per tuple (the source contract's width, the `present` mask included). */
39
+ export const WRUN_OPTION_SURFACE_WIDTH = 9;
40
+ /** The point type the lane reads, by name (sent as its id once the protocol package names it). */
41
+ export const WRUN_OPTION_SURFACE_TYPE = 'OPTION_SURFACE';
42
+ /** The two job tiers: 5m kept 30 days, 1d kept for good. */
43
+ export const WRUN_OPTION_SURFACE_TIERS = Object.freeze([
44
+ { key: '5m', ms: 5 * MINUTE_MS, retentionMs: 30 * DAY_MS },
45
+ { key: '1d', ms: DAY_MS },
46
+ ]);
47
+ /** The payload field an instance names its chain's exchange in (its plane follows it). */
48
+ export const WRUN_OPTION_SURFACE_EXCHANGE_FIELD = 'surfaceExchange';
49
+ /** The knobs of the other options classes, each refused here by name. */
50
+ const STRAY_KNOBS = [
51
+ [
52
+ 'expiries',
53
+ "'options_chain', 'option_strikes', 'option_prints', 'option_contract_flow' and 'option_contract_state'",
54
+ ],
55
+ ['strike_window_pct', "'option_contract_flow' and 'option_contract_state'"],
56
+ ['history', "'tape' and 'option_prints' celled"],
57
+ ['min_size', "'tape' celled"],
58
+ ['min_premium', "'option_prints' celled"],
59
+ ['overflow', "'option_prints' celled"],
60
+ ['min_volume', "'option_contract_flow' celled"],
61
+ ];
62
+ /** What `identity` resolved for a chart, read back by `facets` (synchronous). Keyed by the chart market; the newest
63
+ * entries kept. */
64
+ const SURFACE_CHARTS_KEPT = 16;
65
+ const surfaceCharts = new Map();
66
+ function rememberSurfaceChart(key, chart) {
67
+ surfaceCharts.delete(key);
68
+ surfaceCharts.set(key, chart);
69
+ while (surfaceCharts.size > SURFACE_CHARTS_KEPT)
70
+ surfaceCharts.delete(surfaceCharts.keys().next().value);
71
+ }
72
+ /** Test seam: forget every resolved chart. */
73
+ export function __resetWrunSurfaceChartsForTests() {
74
+ surfaceCharts.clear();
75
+ }
76
+ /**
77
+ * An input's acquisition, the chain it reads as the ask's fields (the acquisition key: the class, the plane its
78
+ * exchange names, the exchange, the underlying, the book and, per ask, the tier): `surfaceExchange` and
79
+ * `surfaceUnderlying` always (an OPRA chain's exactly as before), the ONE book the run decided named the way the data
80
+ * plane names it (the job's synthetic symbol `<underlying>|<YYYYMMDD>[|AM][|<series>]` writes no series tail for the
81
+ * underlying's own series): no `surfaceBook` for the underlying's own series (Deribit's BTC on BTC, every CME and
82
+ * OPRA chain's one book), `surfaceBook` for any other (Deribit's BTC_USDC, OKX's BTC-USD), and `surfaceContinuous` for
83
+ * a CME chain read off a continuous alias (`wrunOptionSurfaceAcquisitionMoved` reads it).
84
+ */
85
+ export function wrunOptionSurfaceExtras(chain) {
86
+ const book = chain.book.toUpperCase();
87
+ return {
88
+ [WRUN_OPTION_SURFACE_EXCHANGE_FIELD]: chain.exchange,
89
+ surfaceUnderlying: chain.underlying,
90
+ ...(book !== chain.underlying.toUpperCase() ? { surfaceBook: book } : {}),
91
+ ...(chain.continuous !== undefined ? { surfaceContinuous: chain.continuous } : {}),
92
+ };
93
+ }
94
+ /**
95
+ * Whether an acquisition no longer names the chain the lane would plan now (D12): a CME chain read off a continuous
96
+ * alias whose lead contract rolled since the run planned it (`wrunLaneChainLeadMoved`, every chain lane's one rule:
97
+ * the lead resolver's last answer names another contract than `surfaceUnderlying`). A live session holding it
98
+ * rebuilds (the full run plans the lead contract and its own series, and drops every buffered row), so no ask, cache
99
+ * or buffer joins the old contract's surfaces to the new one's. A lead not resolved yet moves nothing.
100
+ */
101
+ export function wrunOptionSurfaceAcquisitionMoved(acquisition) {
102
+ return wrunLaneChainLeadMoved(acquisition[WRUN_OPTION_SURFACE_EXCHANGE_FIELD], acquisition.surfaceContinuous, acquisition.surfaceUnderlying);
103
+ }
104
+ /**
105
+ * Whether an acquisition's bar its tier answered nothing for reads the next coarser tier (D12): a CME chain's, whose
106
+ * 1d tier holds the settlement DAY rows while its 5m tier fills only inside a session where rows exist, so a daily
107
+ * bar reads its settlement instead of nothing. An OPRA or crypto chain keeps the tier rule as it is.
108
+ */
109
+ export function wrunOptionSurfaceReadsSettlements(acquisition) {
110
+ const exchange = acquisition[WRUN_OPTION_SURFACE_EXCHANGE_FIELD];
111
+ return wrunLaneChainPlaneOf(typeof exchange === 'string' ? exchange : '') === 'cme';
112
+ }
113
+ export const rowLane = {
114
+ sourceClass: 'option_surface',
115
+ laneKey: 'option_surface',
116
+ kType: 'option_surface',
117
+ label: 'Volatility surface',
118
+ feedWords: 'wrun.refusal.feed.optionSurface',
119
+ width: WRUN_OPTION_SURFACE_WIDTH,
120
+ chain: { exchangeField: WRUN_OPTION_SURFACE_EXCHANGE_FIELD },
121
+ landing: { kind: 'snapshot', tiers: WRUN_OPTION_SURFACE_TIERS, coarserWhenEmpty: wrunOptionSurfaceReadsSettlements },
122
+ acquisitionMoved: wrunOptionSurfaceAcquisitionMoved,
123
+ identity: async (ctx) => {
124
+ await assertWrunProtocolType(ctx, WRUN_OPTION_SURFACE_TYPE, 'option_surface');
125
+ rememberSurfaceChart(wrunLaneChartKey(ctx), await resolveWrunLaneChainChart(ctx));
126
+ },
127
+ facets: async (source, ctx) => {
128
+ for (const [knob, owners] of STRAY_KNOBS) {
129
+ if (source[knob] !== undefined)
130
+ refuseWrunLaneStrayKnob(ctx, knob, owners);
131
+ }
132
+ if (source.symbol !== undefined || source.exchange !== undefined) {
133
+ refuseWrunPollInput(ctx, "pins option_surface cells to a fixed market (wrun_option_market_pinned); it reads the chart's own underlying, so drop the symbol and exchange pin", { cls: 'run-failed', variant: 'generic' });
134
+ }
135
+ const chart = surfaceCharts.get(wrunLaneChartKey(ctx));
136
+ if (chart === undefined) {
137
+ return refuseWrunPollInput(ctx, 'could not resolve the chart market for its options chain: Run again', {
138
+ cls: 'run-failed',
139
+ variant: 'generic',
140
+ });
141
+ }
142
+ return wrunOptionSurfaceExtras(await decideWrunLaneChain(chart, { venue: source.venue, book: source.book }, ctx));
143
+ },
144
+ };
@@ -0,0 +1,309 @@
1
+ /**
2
+ * A POLL SCALAR LANE of the browser (chart) lane, as one descriptor.
3
+ *
4
+ * A poll lane serves one kit source class whose series has no live channel: scalar inputs
5
+ * (`input("name", <class>.<field>, { knobs })`) read off ONE kScript K control (or off the lane's
6
+ * own `fetch`, for a series no K control serves: a relay feed), fetched with the full run and
7
+ * re-asked by the live tick's poll reconcile. Everything such a class needs from the host is
8
+ * derived from its descriptor, so adding one is two files and no shared edit:
9
+ *
10
+ * 1. `src/utility/wrun/sources/lanes/<source_class>.ts`, exporting `lane` (one descriptor) or
11
+ * `lanes` (several: a class whose fields ride different K controls exports one lane per
12
+ * field group). The FILE is named after the source class its lanes serve; the registry
13
+ * (`registry.ts`) discovers it by glob and refuses a file whose lanes declare another
14
+ * class, and the template extractor (plain Node) lists the folder by file name.
15
+ * 2. `tests/utility/wrun/sources/<source_class>.spec.ts`.
16
+ *
17
+ * What the host derives from the registry (nothing lists a lane by name):
18
+ * - the served-class set (`wrun-browser-sources.ts`) and the template picker's verdicts;
19
+ * - the full run (`wrun-overlay-run.util.ts`): the plan before any fetch, one fetch per lane
20
+ * INSTANCE beside the other lanes, the labeled "data is unavailable" refusal on an empty
21
+ * answer, the live context's buffers;
22
+ * - the row builder (`wrun-source-rows.util.ts`): each input's column and join, the `missing`
23
+ * policy, the tail build equal to the full build;
24
+ * - the live tick (`wrun-live-tick.util.ts`): the lane in every poll reconcile at its own
25
+ * interval (through its own `fetch` when it has one; a routine poll at its `pollIntervalMs`
26
+ * pace when it names one), fetched rows winning, a revised closed bar reseeding;
27
+ * - a lane naming `live`: its channel per session (`wrun-series-stream.util.ts`).
28
+ *
29
+ * Rules a lane file keeps:
30
+ * - LIGHT at module load. The registry is on the import graph of the row builder and of the
31
+ * served-class set, so a lane file imports types and small pure helpers only; anything heavy
32
+ * (the metadata service, a store, the i18n plugin) is imported lazily inside `plan`.
33
+ * - `plan` is the ONLY place a lane refuses: by name (`refuseWrunPollInput`), before any fetch.
34
+ * - It never serves a class the row builder serves itself (the registry refuses that), and it
35
+ * is scalar: a celled input of its class refuses by name.
36
+ *
37
+ * What the kit owns and the lane does not re-check: a market pin (`symbol` / `exchange`), an
38
+ * interval pin and a view on these classes refuse in the pinned-wire planner before the lane is
39
+ * planned; `forming` views and bindings are refused by the kit.
40
+ */
41
+ import type { WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
42
+ import type { WrunDailyLanding } from '../wrun-daily-lane.util.js';
43
+ import { type WrunRefusalSeed } from '../wrun-refusal.util.js';
44
+ import type { WrunBackendTier, WrunTierLanding } from '../wrun-tier-grid.util.js';
45
+ import type { WrunRowLaneChain } from './wrun-row-lane.types.js';
46
+ /** An input's declaration as a lane reads it: the typed fields, and any knob the sheet carries
47
+ * that the interface does not name yet (`asset`, `publisher`, `series`, ...), as `unknown`. */
48
+ export type WrunPollLaneSource = WrunInputSource & Readonly<Record<string, unknown>>;
49
+ /** The chart a lane is planned against, and the input being planned. */
50
+ export interface WrunPollLaneContext {
51
+ /** The input's declared name (every refusal names it). */
52
+ inputName: string;
53
+ /** The input's source class (the lane's own; carried so a refusal can name it). */
54
+ sourceClass: string;
55
+ /** The chart market's coin, exchange and symbol as the chart holds them ('' when absent). */
56
+ coin: string;
57
+ exchange: string;
58
+ symbol: string;
59
+ /** The chart market's category as the chart holds it (pb-common `Category`: an option contract chart's `OPTION`),
60
+ * handed to a lane that resolves the chart's options chain (the chart's options controls read it, and so does a
61
+ * `chain` lane's plan); absent when unknown. */
62
+ category?: number;
63
+ /** The chart's bar interval in ms. */
64
+ intervalMs: number;
65
+ /** The chart is index-mode (a stock, forex, commodity or DEX chart): only a `global` lane is
66
+ * planned there, and the chart's coin is not a crypto asset a lane may default to. */
67
+ indexMode: boolean;
68
+ /** The chart's venue is a crypto venue (a DEX pool is one AND index-mode), as the predicate the
69
+ * run pass injects answers it; undefined when no predicate was injected. A refusal's copy
70
+ * follows it: "it comes from crypto markets" only on `false`, the neutral market words
71
+ * otherwise. */
72
+ cryptoVenue?: boolean;
73
+ /** The run is an OpenMarket package's (`isOfficialWrunOverlay`, read at the run's wall door), handed to an
74
+ * `opra` lane's plan and a `chain` lane's (and every row lane's): the chain decision's `auto` reads the OPRA chain
75
+ * only for a run the plane is open to. Absent reads false (fail closed). */
76
+ official?: boolean;
77
+ /** The `opra-user-scripts` flag opened the OPRA plane to the run (`isOpraUserScriptRun`), handed like
78
+ * `official`. Absent reads false. With `official`, the one OPRA decision (`mayReadOpra`): an `opra` lane is
79
+ * refused before its `plan` runs for a run it says no to, so a lane reads these only for its own choices. */
80
+ opraUserScripts?: boolean;
81
+ /** The chart's options ride the OPRA plane (the run's `isOpraPlaneExchange`, the planner's one verdict), handed to a
82
+ * `chain` lane: its chain there is OPRA's chain of the chart's own underlying. Absent reads false. */
83
+ opraPlane?: boolean;
84
+ /**
85
+ * The run's plan as an identity: one object per `planWrunPollLanes` call, the same for every input it plans. A lane
86
+ * keys a resolution every input of the run shares by it (a `WeakMap`: a `chain` lane's chart, its chain and its
87
+ * book), so two inputs of one run never read two answers and the chart is resolved once. Absent outside a run's
88
+ * plan (a spec calling `plan` alone): nothing is shared.
89
+ */
90
+ runScope?: object;
91
+ }
92
+ /**
93
+ * How a lane's rows land on the chart grid:
94
+ * - `'bar'`: rows are stamped at the chart's bar opens; an input exact-joins its bar under the
95
+ * `missing` policy (the join every scalar lane uses).
96
+ * - `{ kind: 'daily', landing }`: rows are one per UTC day whatever the chart's interval (the
97
+ * lane asks `1d` unless `interval` says otherwise), landed by the daily-lane rules
98
+ * (wrun-daily-lane.util): `sum` for flows, `last` for levels. `lookbackDays` opens the full
99
+ * run's fetch that many days before the chart window, so a `last` series reported weekly or
100
+ * monthly still has the observation standing at the window's head. Every live reconcile
101
+ * re-asks the same number of days before its own window, so it is also the publication-lag
102
+ * horizon: a row published that long after its stamp date still reaches a live session.
103
+ */
104
+ export type WrunPollLaneJoin = 'bar' | {
105
+ kind: 'daily';
106
+ landing: WrunDailyLanding;
107
+ lookbackDays?: number;
108
+ };
109
+ /**
110
+ * How a per-bar NATIVE-ROWS lane (`nativeRows`) lands its rows on the host chart's bars (UW-PARITY source
111
+ * contract v2, rule 9): its asks return the control's own stamps (a tier's buckets), which the host lands on
112
+ * the chart's bar grid (`liveBucketStartMs` over the chart's bar-grid venue: a regular-session stock chart's
113
+ * 09:30-anchored bars, the UTC floor elsewhere), summed for a `flow`, the newest sealed row for a `snapshot`
114
+ * (wrun-tier-grid.util). `tiers` (the backend tiers the series is stored at, each with its retention) puts
115
+ * the asks under the tier rule: each bar is read from the finest tier that fits it and still retains it, one
116
+ * ask per run of bars on a tier, the tier's key in the ask's payload (`tier`); a bar no tier retains reads
117
+ * no row (the input's `missing` policy). Absent: one ask, the rows as the control answers them.
118
+ */
119
+ export interface WrunPollLaneBarGrid {
120
+ landing: WrunTierLanding;
121
+ tiers?: readonly WrunBackendTier[];
122
+ }
123
+ /** What `plan` returns: the payload fields beyond the current-market placeholders (`symbol:
124
+ * 'currentSymbol'`, `exchange: 'currentExchange'`), or nothing when the placeholders are the
125
+ * whole ask. `coin: 'currentCoin'` is a placeholder the chart's fetch resolves too. */
126
+ export type WrunPollLaneExtras = Readonly<Record<string, unknown>>;
127
+ /** One ask of a lane's own `fetch`: the full run's, or a live reconcile's. */
128
+ export interface WrunPollLaneFetchAsk {
129
+ /** The instance's payload extras, as `plan` answered them (a reconcile hands the run's recorded
130
+ * acquisition, the current-market placeholders beside them). */
131
+ extras: Readonly<Record<string, unknown>>;
132
+ /** The first chart-bar open the ask covers, ms. */
133
+ fromTs: number;
134
+ /** The last chart-bar open the ask covers, ms, inclusive (a reconcile's: the forming bar's end). */
135
+ toTs: number;
136
+ /** The grid's bar interval, ms (the run interval on a run at another interval). */
137
+ intervalMs: number;
138
+ /** Told, once the answer is in, whether it is the whole window: true when the source said nothing more follows,
139
+ * false when the answer ended early (the source named more without a way to it). A lane that cannot tell never
140
+ * calls it; a caller that needs the verdict (a wrun prefix page) reads its absence as not whole. */
141
+ onComplete?: (complete: boolean) => void;
142
+ }
143
+ /** A lane's live channel (`WrunPollLane.live`; contract in `wrun-series-stream.util.ts`): its ask,
144
+ * its sink (rows on the grid's bar opens, reopens, spans it cannot vouch for, re-plans) and its
145
+ * open handle. */
146
+ export interface WrunPollLaneLiveAsk {
147
+ extras: Readonly<Record<string, unknown>>;
148
+ intervalMs: number;
149
+ newestTs: number | null;
150
+ }
151
+ export interface WrunPollLaneLiveSink {
152
+ rows(rows: readonly ArrayLike<number>[]): void;
153
+ reopened(): void;
154
+ stale(fromTs: number): void;
155
+ replan(): void;
156
+ }
157
+ export interface WrunPollLaneLiveSubscription {
158
+ unsubscribe(): void;
159
+ isUp(): boolean;
160
+ }
161
+ export interface WrunPollLane {
162
+ /** The kit source class this lane serves. Its file is named `<sourceClass>.ts`. */
163
+ sourceClass: string;
164
+ /** Unique in the registry (lower snake case): the stem of the lane's fetch key and of its
165
+ * row buffer's key. */
166
+ laneKey: string;
167
+ /** The kScript source type the chart's fetch rides (`deribit_volatility_index` asks the
168
+ * `K_DERIBIT_VOLATILITY_INDEX` control). A lane with its own `fetch` rides no K control: its
169
+ * `kType` only names the lane where a K type would be printed (the degrade chips, the "data is
170
+ * unavailable" sentence). */
171
+ kType: string;
172
+ /** The fields this lane serves, each with its lane row column (column 0 is the ts). A field
173
+ * of the class no lane names refuses by name, listing the served ones. */
174
+ fields: Readonly<Record<string, number>>;
175
+ /**
176
+ * Validate one input against the chart BEFORE any fetch and answer the payload fields its
177
+ * ask carries, or refuse by name (`refuseWrunPollInput`). May be async (a metadata lookup).
178
+ * Inputs whose answers are equal share ONE fetch and one buffer; inputs whose answers differ
179
+ * (two venues, two assets) fetch separately.
180
+ */
181
+ plan(source: WrunPollLaneSource, ctx: WrunPollLaneContext): WrunPollLaneExtras | void | Promise<WrunPollLaneExtras | void>;
182
+ join: WrunPollLaneJoin;
183
+ /** A fixed fetch interval (an `Intervals.map_unit` key such as `'1d'`) when the lane does
184
+ * not ask the chart's own; a daily join asks `'1d'` without naming it. The K control must
185
+ * honor `settings.interval` (as `k-etf-flow.control.ts` does). */
186
+ interval?: string;
187
+ /** The series' name in the "data is unavailable" refusal (`<label> data is unavailable for
188
+ * '<indicator>' ...`), a noun phrase with a leading capital. */
189
+ label: string;
190
+ /**
191
+ * The lane's series names its own subject (a publisher's series, a token's supply, a venue's
192
+ * asset) and reads nothing of the chart's market, so it is served on EVERY chart, index-mode
193
+ * ones included (a stock, a forex pair, a commodity, a DEX pool), where a lane reading the
194
+ * chart's market refuses by name. Its asks ride the chart fetch's native-rows path (the asked
195
+ * window stands, the control's own rows return), and it must be a DAILY join: the landing is
196
+ * by UTC day whatever grid the chart's bars sit on (the registry refuses a `bar` join here).
197
+ */
198
+ global?: true;
199
+ /**
200
+ * The lane reads the chart's own market from ANOTHER plane's rows (a stock chart's US options), so its asks
201
+ * ride the chart fetch's native-rows path (the asked window stands, the control's own stamps return) and it
202
+ * is admitted on an index-mode chart too, where a lane reading the chart's market is refused. Per bar such a
203
+ * lane lands itself on the host bar grid (`barGrid`, required); with a daily join it keeps the daily landing
204
+ * (by UTC day, any grid; a stock's daily options statistics), no `barGrid`. The registry refuses it on a
205
+ * `global` lane (that one rides native rows already) and with its own `fetch`.
206
+ */
207
+ nativeRows?: true;
208
+ /** The host-grid landing of a per-bar `nativeRows` lane (required there, refused on any other lane). */
209
+ barGrid?: WrunPollLaneBarGrid;
210
+ /**
211
+ * The lane reads US options data (the OPRA plane): an input of it is refused by name before its `plan`
212
+ * runs for a run that may not read OPRA (`opra-official-only:<class>`, wrun-opra-lane.util), its asks name
213
+ * the plane and their routed tier, the run stamps the overlay's OPRA provenance before the first ask, and
214
+ * the legend names a delayed tier.
215
+ */
216
+ opra?: true;
217
+ /**
218
+ * A CHAIN lane (OPTIONS-PORT P5, the row lanes' mark, `WrunRowLaneChain`): it reads the chart's options chain on
219
+ * whichever plane that chain lists on, decided per INSTANCE by the one chain resolver (opra-option-lanes.util
220
+ * `resolveWrunLaneChainChart` then `decideWrunLaneChain`, in its `plan`), never per descriptor. Its `plan` answers
221
+ * the chain's exchange in the payload field `exchangeField`, and the instance's plane follows that exchange
222
+ * (`wrunLaneChainPlaneOf`):
223
+ * - `opra`: the OPRA wall (before the chain is resolved on a chart whose options ride the plane), the plane and its
224
+ * routed tier in the ask, the overlay's OPRA provenance and the legend's delayed-tier note, as an `opra` lane's;
225
+ * - `cme`: the CME display wall (OpenMarket's own packages only) and the routed tier in the ask (`servedTier`);
226
+ * - `plain` (a crypto options venue): nothing beside the lane's own fields.
227
+ * It is admitted on every chart (a chart with no chain refuses by name in its `plan`) and rides the native-rows path
228
+ * on every plane (`nativeRows`: its rows are its chain's, never the chart market's). The registry refuses it beside
229
+ * `opra`, `global`, an own `fetch` or a `live` channel.
230
+ */
231
+ chain?: WrunRowLaneChain;
232
+ /**
233
+ * Whether an instance's acquisition (the full run's record of its payload) no longer names the read the lane would
234
+ * plan now (a CME chain read off a continuous alias whose lead contract rolled). A live session holding such an
235
+ * instance rebuilds (the row lanes' rule, `WrunRowLaneDescriptor.acquisitionMoved`), so no ask, cache or buffer joins
236
+ * two reads. Synchronous, read on every drain. Absent: an acquisition never moves.
237
+ */
238
+ acquisitionMoved?: (acquisition: Readonly<Record<string, unknown>>) => boolean;
239
+ /**
240
+ * The record each refusal BY NAME its K control's worker twin may answer (wrun-lane-refusal.leaf: a backend switch
241
+ * that keeps the read off, a series the data plane samples for a configured list only), by its code. The run
242
+ * degrades such an answer terminally under the lane's label and shows this seed (`feed` is the lane key unless the
243
+ * seed names one; the severity follows the run's hold); a code without a seed reads the lane's no-answer record.
244
+ */
245
+ refusedAnswers?: Readonly<Record<string, WrunRefusalSeed>>;
246
+ /**
247
+ * The lane's OWN fetch, for a series no K control serves (a relay feed): one ask over chart-bar
248
+ * opens, answered as lane rows `[ts_ms, ...columns]`, ascending. When present the full run asks
249
+ * it in place of the chart's fetch, everything else of a poll lane unchanged (the plan before
250
+ * it, the instance grouping, the acquisition record, a settings save's held buffer, the
251
+ * deadline, the empty-answer and valueless-field rules); `interval` and the native-rows path do
252
+ * not apply, the lane reads its interval off the ask. It refuses nothing: a declaration is
253
+ * judged in `plan`, before any fetch, and a rejection degrades the lane like a failed K fetch.
254
+ * The live tick's poll reconcile asks it the same way over its window, the run's recorded
255
+ * payload as the extras (wrun-live-tick.util `fetchWrunPollLaneReconcile`).
256
+ */
257
+ fetch?: (ask: WrunPollLaneFetchAsk) => Promise<ArrayLike<number>[]>;
258
+ /**
259
+ * The lane's own poll period for one instance (its planned extras), ms: a ROUTINE live poll
260
+ * re-asks the instance only once its last answer is this old, or while its coverage is behind
261
+ * (a failed or missing answer keeps asking); a session start, a main jump and a wake re-ask it
262
+ * whatever the pace. For a series with a publication cadence of its own (a relay feed), which
263
+ * the chart's poll cycle would otherwise ask several times a minute. Absent: every routine poll
264
+ * re-asks it.
265
+ */
266
+ pollIntervalMs?: (extras: Readonly<Record<string, unknown>>) => number;
267
+ /** The lane's own live channel (a relay feed's stream), opened per instance at every session
268
+ * install: its rows fold without a fetch, a routine poll waits while it is up. `subscribe`
269
+ * answers at once and imports its transport inside (`wrun-series-stream.util.ts`). */
270
+ live?: {
271
+ subscribe(ask: WrunPollLaneLiveAsk, sink: WrunPollLaneLiveSink): WrunPollLaneLiveSubscription;
272
+ };
273
+ }
274
+ /** What a lane file may export: one lane, several, or both. */
275
+ export interface WrunPollLaneModule {
276
+ lane?: WrunPollLane;
277
+ lanes?: readonly WrunPollLane[];
278
+ }
279
+ /** The id of one lane INSTANCE (a lane under one set of payload extras): its row buffer's key,
280
+ * its fetch-key suffix and its live lane name. The prefix keeps it apart from the row
281
+ * builder's own lanes wherever lanes are keyed together. */
282
+ export type WrunPollLaneId = `poll:${string}`;
283
+ export declare const WRUN_POLL_LANE_ID_PREFIX = "poll:";
284
+ export declare function isWrunPollLaneId(value: unknown): value is WrunPollLaneId;
285
+ /** One planned lane instance of a run: plain data (the live context keeps it for the poll
286
+ * reconcile and the reseed); the descriptor is looked up by `laneKey`. */
287
+ export interface WrunPollLaneInstance {
288
+ key: WrunPollLaneId;
289
+ sourceClass: string;
290
+ laneKey: string;
291
+ /** The payload fields `plan` answered (empty when it answered none). */
292
+ extras: Record<string, unknown>;
293
+ /** The inputs reading this instance, by index, ascending. */
294
+ inputIndexes: number[];
295
+ }
296
+ /** Refuse an input by name: `Input '<name>' (<class>) <reason>`. The one spelling every lane's
297
+ * pre-fetch refusal uses, so the legend card reads the same across sources. The text is the
298
+ * technical half (Copy details); `seed` is the refusal record's seed the surfaces word it by
299
+ * (`attachWrunRefusal`, the nearest raiser wins): a coin gate names the lane key, its coin list
300
+ * and the chart's coin, an interval gate the bound, an unserved feed its lane key. An unseeded
301
+ * refusal reads as a failed run. */
302
+ export declare function refuseWrunPollInput(ctx: Pick<WrunPollLaneContext, 'inputName' | 'sourceClass'>, reason: string, seed?: WrunRefusalSeed): never;
303
+ /** The seed of a coin gate: the lane's feed (its lane key) exists for `coins` only, and the chart's
304
+ * coin is another. A chart that names no coin has no such feed at all (the market words), so a
305
+ * sentence never ends on an empty coin. */
306
+ export declare function wrunPollCoinGateSeed(feed: string, coins: readonly string[], chartCoin: string): WrunRefusalSeed;
307
+ /** The seed of a gate the author fixes in the code (a knob word, a fund the coin does not list): a
308
+ * failed run, its text in the details. */
309
+ export declare const WRUN_POLL_AUTHOR_GATE_SEED: WrunRefusalSeed;
@@ -0,0 +1,26 @@
1
+ import { attachWrunRefusal } from '../wrun-refusal.util.js';
2
+ export const WRUN_POLL_LANE_ID_PREFIX = 'poll:';
3
+ export function isWrunPollLaneId(value) {
4
+ return typeof value === 'string' && value.startsWith(WRUN_POLL_LANE_ID_PREFIX);
5
+ }
6
+ /** Refuse an input by name: `Input '<name>' (<class>) <reason>`. The one spelling every lane's
7
+ * pre-fetch refusal uses, so the legend card reads the same across sources. The text is the
8
+ * technical half (Copy details); `seed` is the refusal record's seed the surfaces word it by
9
+ * (`attachWrunRefusal`, the nearest raiser wins): a coin gate names the lane key, its coin list
10
+ * and the chart's coin, an interval gate the bound, an unserved feed its lane key. An unseeded
11
+ * refusal reads as a failed run. */
12
+ export function refuseWrunPollInput(ctx, reason, seed) {
13
+ const error = new Error(`Input '${ctx.inputName}' (${ctx.sourceClass}) ${reason}`);
14
+ throw seed === undefined ? error : attachWrunRefusal(error, seed);
15
+ }
16
+ /** The seed of a coin gate: the lane's feed (its lane key) exists for `coins` only, and the chart's
17
+ * coin is another. A chart that names no coin has no such feed at all (the market words), so a
18
+ * sentence never ends on an empty coin. */
19
+ export function wrunPollCoinGateSeed(feed, coins, chartCoin) {
20
+ if (chartCoin === '')
21
+ return { cls: 'feed-missing', variant: 'market-paused', params: { feed } };
22
+ return { cls: 'coin-outside-feed', params: { feed, coins: coins.join(', '), coin: chartCoin } };
23
+ }
24
+ /** The seed of a gate the author fixes in the code (a knob word, a fund the coin does not list): a
25
+ * failed run, its text in the details. */
26
+ export const WRUN_POLL_AUTHOR_GATE_SEED = Object.freeze({ cls: 'run-failed', variant: 'generic' });