@orangecharts/wrun-chart-host 0.3.0 → 0.5.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.
- package/README.md +23 -6
- package/dist/constants/exchange-names.leaf.d.ts +8 -0
- package/dist/constants/exchange-names.leaf.js +101 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
- package/dist/constants/opra-compliance.constants.d.ts +19 -0
- package/dist/constants/opra-compliance.constants.js +19 -0
- package/dist/constants/replay-ladder.leaf.d.ts +30 -0
- package/dist/constants/replay-ladder.leaf.js +99 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
- package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
- package/dist/constants/scriptEditor/execution.constants.js +14 -0
- package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
- package/dist/constants/wrun-prefix-safe.constants.js +26 -0
- package/dist/host-env.d.ts +321 -24
- package/dist/host-env.js +15 -0
- package/dist/host-ports.types.d.ts +857 -35
- package/dist/index.d.ts +149 -2
- package/dist/index.js +149 -2
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
- package/dist/interfaces/market-event.interface.d.ts +231 -0
- package/dist/interfaces/market-event.interface.js +15 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
- package/dist/interfaces/opra-realtime.interface.js +34 -59
- package/dist/interfaces/replay.interface.d.ts +285 -0
- package/dist/interfaces/replay.interface.js +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
- package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
- package/dist/market-data/billing.interface.d.ts +219 -0
- package/dist/market-data/billing.interface.js +58 -0
- package/dist/market-data/venue-governed.util.d.ts +2 -0
- package/dist/market-data/venue-governed.util.js +10 -0
- package/dist/market-data/venue.d.ts +122 -0
- package/dist/market-data/venue.js +1 -0
- package/dist/market-data/venues/index.d.ts +97 -0
- package/dist/market-data/venues/index.js +33 -0
- package/dist/market-data/venues/opra.contract.copy.json +35 -0
- package/dist/market-data/venues/opra.d.ts +70 -0
- package/dist/market-data/venues/opra.js +74 -0
- package/dist/replay/replayIndicatorRows.d.ts +31 -0
- package/dist/replay/replayIndicatorRows.js +117 -0
- package/dist/replay/replayLadder.d.ts +85 -0
- package/dist/replay/replayLadder.js +388 -0
- package/dist/utility/auth/server-clock.util.d.ts +81 -0
- package/dist/utility/auth/server-clock.util.js +238 -0
- package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
- package/dist/utility/chart/builtin-identity.util.js +51 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
- package/dist/utility/chart/cache-alignment.util.js +926 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
- package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
- package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
- package/dist/utility/chart/chart-time-domain.util.js +23 -0
- package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
- package/dist/utility/chart/color-customization.leaf.js +16 -0
- package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
- package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
- package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
- package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
- package/dist/utility/chart/gesture-timing.leaf.js +29 -0
- package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
- package/dist/utility/chart/governed-contract-coin.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
- package/dist/utility/chart/host-bar-placement.util.js +447 -0
- package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
- package/dist/utility/chart/index-host-tier.util.js +118 -0
- package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
- package/dist/utility/chart/index-mode-admission.util.js +67 -0
- package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
- package/dist/utility/chart/indicator-error-message.util.js +44 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
- package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
- package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
- package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
- package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
- package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
- package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
- package/dist/utility/chart/kscript-source-retention.util.js +218 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
- package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
- package/dist/utility/chart/live-cadence.util.d.ts +38 -0
- package/dist/utility/chart/live-cadence.util.js +37 -0
- package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
- package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
- package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
- package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
- package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
- package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
- package/dist/utility/chart/mixed-mode.util.js +139 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
- package/dist/utility/chart/price-precision.util.d.ts +40 -0
- package/dist/utility/chart/price-precision.util.js +70 -0
- package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
- package/dist/utility/chart/profile-block-size.util.js +141 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
- package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
- package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
- package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
- package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
- package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
- package/dist/utility/chart/titan-constants.pin.js +18 -5
- package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
- package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
- package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
- package/dist/utility/chart/wrun-run-result.util.js +20 -14
- package/dist/utility/common/data-processing.util.d.ts +138 -0
- package/dist/utility/common/data-processing.util.js +346 -0
- package/dist/utility/common/visible-timeout.util.d.ts +13 -4
- package/dist/utility/common/visible-timeout.util.js +23 -8
- package/dist/utility/exchange-format.leaf.d.ts +1 -0
- package/dist/utility/exchange-format.leaf.js +47 -0
- package/dist/utility/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -0
- package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
- package/dist/utility/market-events/earnings-scope.util.js +92 -0
- package/dist/utility/market-events/market-events.util.d.ts +147 -0
- package/dist/utility/market-events/market-events.util.js +392 -0
- package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
- package/dist/utility/market-events/zoned-clock.util.js +11 -0
- package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
- package/dist/utility/options/option-venue-disclosure.util.js +56 -0
- package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
- package/dist/utility/scriptEditor/package-semver.util.js +120 -0
- package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
- package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
- package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
- package/dist/utility/v2/governed-tier.leaf.js +113 -0
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
- package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
- package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
- package/dist/utility/wrun/sources/lanes/series.js +2 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
- package/dist/utility/wrun/sources/registry.js +31 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +75 -20
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
- package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
- package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
- package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
- package/dist/utility/wrun/wrun-deadline.util.js +2 -1
- package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
- package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
- package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
- package/dist/utility/wrun/wrun-host.service.js +655 -0
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
- package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
- package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +392 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2346 -0
- package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
- package/dist/utility/wrun/wrun-param-map.util.js +40 -47
- package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-param-values.util.js +5 -5
- package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
- package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
- package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
- package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
- package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
- package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
- package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
- package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
- package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
- package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
- package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
- package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
- package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
- package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
- package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
- package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
- package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
- package/dist/utility/wrun/wrun-text-params.util.js +19 -30
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
- package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
- package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
- package/dist/utility/wrun-alert-params.leaf.js +24 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
- package/dist/utils/replay/replay-buffer-math.js +684 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
- package/dist/workers/wrun/wrun-abi-host.js +1201 -0
- package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
- package/dist/workers/wrun/wrun-engine-handler.js +211 -0
- package/package.json +3 -3
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { OPRA_VENUE } from '../market-data/venues/opra.js';
|
|
2
|
+
import { MarketDataBillingError, isMarketDataAgreementCurrent, isMarketDataAttestationCurrent, isMarketDataAttestationLive, isMarketDataNonProfessional, isMarketDataProfessionalDeclaration, marketDataAttestationRenewBy, } from '../market-data/billing.interface.js';
|
|
3
|
+
/** Every OPRA-governed exchange code (one consolidated venue by design): the OPRA card's product groups. */
|
|
4
|
+
export const OPRA_GOVERNED_EXCHANGES = OPRA_VENUE.productGroups;
|
|
3
5
|
/** OPRA defines delayed data as at least 15 minutes old; the gate's delayed window matches. */
|
|
4
|
-
export const OPRA_DELAY_MINUTES =
|
|
6
|
+
export const OPRA_DELAY_MINUTES = OPRA_VENUE.delayMinutes;
|
|
5
7
|
// ---------------------------------------------------------------------------
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
8
|
+
// The frozen billing contract of `/opra/*`, the OPRA twin of `/cme/*` (orange's OPRA routes implement it; the service
|
|
9
|
+
// speaks it in one place, src/services/opra-realtime.service.ts, through the venue-generic market-data service).
|
|
10
|
+
// Differences from CME are deliberate: one product, no depth, non-professional only, EXPLICIT agreement acceptance
|
|
11
|
+
// (never inferred from a grant or a subscription), and pay first: the declaration and the agreement bind real-time
|
|
12
|
+
// ACCESS, not the payment, so checkout needs neither and the server serves real-time only once the account is both
|
|
13
|
+
// paid and qualified (delayed otherwise).
|
|
11
14
|
// ---------------------------------------------------------------------------
|
|
12
15
|
/** The one OPRA plan: real-time top of book, billed monthly. */
|
|
13
|
-
export const OPRA_REALTIME_MONTHLY_USD =
|
|
14
|
-
export const OPRA_ATTESTATION_FORM_VERSION = 'opra-v1';
|
|
16
|
+
export const OPRA_REALTIME_MONTHLY_USD = OPRA_VENUE.products[0].priceUsd;
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `isOpraNonProfessional` reads from the same answers.
|
|
18
|
+
* v2 asks questions 3 to 5 as one group ("Do any of these apply to you?") and adds the subscriber's country and
|
|
19
|
+
* address. A record of any other version reads as no declaration: the subscriber declares again.
|
|
19
20
|
*/
|
|
21
|
+
export const OPRA_ATTESTATION_FORM_VERSION = OPRA_VENUE.questionnaire.formVersion;
|
|
20
22
|
/** The server's bound on each identity field (`legalName`, `employer`, `occupation`), trimmed. */
|
|
21
|
-
export const OPRA_IDENTITY_FIELD_MAX_LENGTH =
|
|
23
|
+
export const OPRA_IDENTITY_FIELD_MAX_LENGTH = OPRA_VENUE.questionnaire.identityLimits.legalName;
|
|
24
|
+
/** The server's bound on the one-line `address`, trimmed. */
|
|
25
|
+
export const OPRA_ADDRESS_FIELD_MAX_LENGTH = OPRA_VENUE.questionnaire.identityLimits.address;
|
|
22
26
|
/**
|
|
23
27
|
* The OPRA subscriber agreement version this build presents and posts. Bump on ANY change to the
|
|
24
28
|
* agreement text the dialog shows or links: a new version is a new acceptance, and the store reads a
|
|
25
29
|
* record of any other version as not accepted. RELEASE BLOCKER (named, do not bury): the agreement
|
|
26
30
|
* text, this version id and the link below need the compliance sign-off before the flag is lit.
|
|
27
31
|
*/
|
|
28
|
-
export const OPRA_SUBSCRIBER_AGREEMENT_VERSION =
|
|
32
|
+
export const OPRA_SUBSCRIBER_AGREEMENT_VERSION = OPRA_VENUE.agreement.version;
|
|
29
33
|
/** Where the agreement step links for OPRA's own subscriber terms (see the release blocker above). */
|
|
30
|
-
export const OPRA_SUBSCRIBER_AGREEMENT_URL =
|
|
34
|
+
export const OPRA_SUBSCRIBER_AGREEMENT_URL = OPRA_VENUE.agreement.url;
|
|
31
35
|
/**
|
|
32
36
|
* OPRA's non-professional qualification, one stable machine id per question: these ids key the
|
|
33
37
|
* submitted `answers` record and are never swapped for translated question text. `qualifying` is the
|
|
34
38
|
* answer a non-professional gives. Every answer must match it; anything else is a professional
|
|
35
|
-
* declaration, which
|
|
36
|
-
* and then ends in "not available".
|
|
37
|
-
*
|
|
39
|
+
* declaration, which is not sold: it is submitted (the server records it and withdraws eligibility)
|
|
40
|
+
* and then ends in "not available". The form asks the three whose qualifying answer is No as one group
|
|
41
|
+
* question; the record still carries all five. Bump OPRA_ATTESTATION_FORM_VERSION on any change to this
|
|
42
|
+
* set, its order or its wording.
|
|
38
43
|
*/
|
|
39
|
-
export const OPRA_QUALIFICATION_QUESTIONS =
|
|
40
|
-
{ id: 'natural_person', qualifying: true },
|
|
41
|
-
{ id: 'personal_use_only', qualifying: true },
|
|
42
|
-
{ id: 'securities_registered', qualifying: false },
|
|
43
|
-
{ id: 'investment_adviser', qualifying: false },
|
|
44
|
-
{ id: 'exempt_institution_role', qualifying: false },
|
|
45
|
-
];
|
|
44
|
+
export const OPRA_QUALIFICATION_QUESTIONS = OPRA_VENUE.questionnaire.questions;
|
|
46
45
|
/** Every question answered with its qualifying answer. A missing answer never qualifies. */
|
|
47
46
|
export function isOpraNonProfessional(answers) {
|
|
48
|
-
return
|
|
47
|
+
return isMarketDataNonProfessional(OPRA_VENUE, answers);
|
|
49
48
|
}
|
|
50
49
|
/** How long before a declaration's expiry the management page asks the subscriber to renew it. */
|
|
51
|
-
export const OPRA_ATTESTATION_RENEW_WINDOW_DAYS =
|
|
52
|
-
const DAY_MS = 86_400_000;
|
|
50
|
+
export const OPRA_ATTESTATION_RENEW_WINDOW_DAYS = OPRA_VENUE.questionnaire.renewalWindowDays;
|
|
53
51
|
/**
|
|
54
52
|
* A declaration on the current form (a new question set means a new declaration) whose validity has not
|
|
55
53
|
* ended at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's
|
|
@@ -57,49 +55,26 @@ const DAY_MS = 86_400_000;
|
|
|
57
55
|
* `expiresAt` does not parse reads expired (ask again rather than trust it).
|
|
58
56
|
*/
|
|
59
57
|
export function isOpraAttestationLive(attestation, now) {
|
|
60
|
-
|
|
61
|
-
return false;
|
|
62
|
-
if (attestation.expiresAt === undefined)
|
|
63
|
-
return true;
|
|
64
|
-
const ends = Date.parse(attestation.expiresAt);
|
|
65
|
-
return Number.isFinite(ends) && now < ends;
|
|
58
|
+
return isMarketDataAttestationLive(OPRA_VENUE, attestation, now);
|
|
66
59
|
}
|
|
67
60
|
/** A non-professional declaration on the current form, still valid at `now`: the account may buy real-time. */
|
|
68
61
|
export function isOpraAttestationCurrent(attestation, now) {
|
|
69
|
-
return
|
|
62
|
+
return isMarketDataAttestationCurrent(OPRA_VENUE, attestation, now);
|
|
70
63
|
}
|
|
71
64
|
/** A professional declaration on the current form, still valid at `now`: real-time is not sold to the account. */
|
|
72
65
|
export function isOpraProfessionalDeclaration(attestation, now) {
|
|
73
|
-
return
|
|
66
|
+
return isMarketDataProfessionalDeclaration(OPRA_VENUE, attestation, now);
|
|
74
67
|
}
|
|
75
68
|
/**
|
|
76
69
|
* The expiry (ISO, as served) a still-current non-professional declaration must be renewed by, once `now` is
|
|
77
70
|
* inside the renewal window before it; null otherwise (no expiry named, further off, or already lapsed).
|
|
78
71
|
*/
|
|
79
72
|
export function opraAttestationRenewBy(attestation, now) {
|
|
80
|
-
|
|
81
|
-
return null;
|
|
82
|
-
return Date.parse(attestation.expiresAt) - now <= OPRA_ATTESTATION_RENEW_WINDOW_DAYS * DAY_MS
|
|
83
|
-
? attestation.expiresAt
|
|
84
|
-
: null;
|
|
73
|
+
return marketDataAttestationRenewBy(OPRA_VENUE, attestation, now);
|
|
85
74
|
}
|
|
86
75
|
/** An acceptance counts only for the version this build presents, never for an older text. */
|
|
87
76
|
export function isOpraAgreementCurrent(agreement) {
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
export class OpraBillingError extends Error {
|
|
91
|
-
kind;
|
|
92
|
-
status;
|
|
93
|
-
/** Raw backend message: diagnostic content only, never primary UI copy. */
|
|
94
|
-
diagnosticMessage;
|
|
95
|
-
/** Stripe's hosted invoice on an 'invoice_owed' refusal; null otherwise. */
|
|
96
|
-
invoiceUrl;
|
|
97
|
-
constructor(kind, options) {
|
|
98
|
-
super(`opra billing error: ${kind}`);
|
|
99
|
-
this.name = 'OpraBillingError';
|
|
100
|
-
this.kind = kind;
|
|
101
|
-
this.status = options?.status ?? null;
|
|
102
|
-
this.diagnosticMessage = options?.diagnosticMessage ?? null;
|
|
103
|
-
this.invoiceUrl = options?.invoiceUrl ?? null;
|
|
104
|
-
}
|
|
77
|
+
return isMarketDataAgreementCurrent(OPRA_VENUE, agreement);
|
|
105
78
|
}
|
|
79
|
+
/** The venue-generic billing error (market-data/billing.interface.ts): one class for every venue's calls. */
|
|
80
|
+
export const OpraBillingError = MarketDataBillingError;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
export type RailTf = '1m' | '5m' | '15m' | '1h' | '1d';
|
|
2
|
+
export type ReplayStepTf = '1m' | '5m' | '10m' | '15m' | '30m' | '1h' | '2h' | '3h' | '4h' | '1d';
|
|
3
|
+
type ReplayTimestampMode = 'uniform' | 'irregular';
|
|
4
|
+
export interface ReplayRailDomain {
|
|
5
|
+
nowSec: number;
|
|
6
|
+
fromSec: number;
|
|
7
|
+
toSec?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ReplayLane {
|
|
10
|
+
kind: 'tick' | 'bars';
|
|
11
|
+
tf: 'tick' | RailTf;
|
|
12
|
+
bucketMs: number;
|
|
13
|
+
hasBook: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ReplayDisplayLane {
|
|
16
|
+
mode: 'tick' | 'coarse';
|
|
17
|
+
tf: 'tick' | RailTf;
|
|
18
|
+
tfMs: number;
|
|
19
|
+
hasBook: boolean;
|
|
20
|
+
bookTf?: RailTf;
|
|
21
|
+
}
|
|
22
|
+
export type ReplayResolution = {
|
|
23
|
+
kind: 'tick';
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'bar';
|
|
26
|
+
tf: ReplayStepTf;
|
|
27
|
+
};
|
|
28
|
+
export type ReplayResolutionPick = 'auto' | ReplayResolution;
|
|
29
|
+
export interface ReplayBuffer {
|
|
30
|
+
anchorMs: number;
|
|
31
|
+
generation?: number;
|
|
32
|
+
tf: ReplayResolution;
|
|
33
|
+
timestampMode?: ReplayTimestampMode;
|
|
34
|
+
chartIntervalMs?: number;
|
|
35
|
+
availableResolutions?: ReplayResolution[];
|
|
36
|
+
abortController: AbortController;
|
|
37
|
+
/** Total visible X span used by replay follow range syncs. */
|
|
38
|
+
viewBehindMs: number;
|
|
39
|
+
/**
|
|
40
|
+
* Span implied by the last follow range replay itself applied, in both
|
|
41
|
+
* denominations (key span x chart interval when the range carried keys, and
|
|
42
|
+
* the raw ts span). The user-zoom detector's echo baseline: a viewport span
|
|
43
|
+
* matching it is replay's own write coming back, not a user zoom, and must
|
|
44
|
+
* not be re-adopted into viewBehindMs. On a sparse grid (thin market:
|
|
45
|
+
* interval buckets with no bar) the applied window holds fewer keys than
|
|
46
|
+
* span / interval, so re-adopting the echo every sync ratcheted the follow
|
|
47
|
+
* zoom down (300 -> 2 bars).
|
|
48
|
+
*/
|
|
49
|
+
followAppliedSpan?: {
|
|
50
|
+
tsSpanMs: number;
|
|
51
|
+
keySpanMs?: number;
|
|
52
|
+
};
|
|
53
|
+
loadedBars: number;
|
|
54
|
+
loading: boolean;
|
|
55
|
+
heatmapLoading: boolean;
|
|
56
|
+
heatmapFollowLoading?: boolean;
|
|
57
|
+
heatmapFollowCooldown?: number;
|
|
58
|
+
heatmapGapFillLoading?: boolean;
|
|
59
|
+
heatmapGapFillCooldown?: number;
|
|
60
|
+
heatmapGapFillRangeKey?: string;
|
|
61
|
+
heatmapOverlayLoadCount?: number;
|
|
62
|
+
/** Forward book coverage claimed on wire evidence (both lanes); the follow loops heal from here. */
|
|
63
|
+
heatmapCoverageEndMs?: number;
|
|
64
|
+
subRows?: number[][];
|
|
65
|
+
subCoverageEndMs?: number;
|
|
66
|
+
subOriginMs?: number;
|
|
67
|
+
subRequestInterval?: string;
|
|
68
|
+
subStepMs?: number;
|
|
69
|
+
subFollowLoading?: boolean;
|
|
70
|
+
subFollowCooldown?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Set by the anchor load: the replay step's own rail answered servedEmpty on
|
|
73
|
+
* the wire over the whole anchor window while the chart's own rows sit inside
|
|
74
|
+
* it, so the step's retained history ends before this depth. Committed as is,
|
|
75
|
+
* the window would end on the start bar (no step, silent Play); the session
|
|
76
|
+
* restarts on whole chart bars instead.
|
|
77
|
+
*/
|
|
78
|
+
stepRailEmptyAtAnchor?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Sub-row window a wire-complete reply answered servedEmpty while coverage
|
|
81
|
+
* already reached it: the active chart bucket is TRADELESS, not unfetched,
|
|
82
|
+
* so the covered-window refetch must not re-ask it once per cooldown lapse.
|
|
83
|
+
* Mirrors the forward frontier's proof discipline: TTL-bounded via atMs
|
|
84
|
+
* (read through provenReplaySubServedEmptyFloor) and falsified the moment
|
|
85
|
+
* later sub rows land inside the span, so delayed ingestion is never
|
|
86
|
+
* blocked for the buffer's lifetime.
|
|
87
|
+
*/
|
|
88
|
+
subServedEmptyFloor?: {
|
|
89
|
+
startMs: number;
|
|
90
|
+
endMs: number;
|
|
91
|
+
atMs: number;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Forward frontier PROVEN empty on the wire by the proven-empty forward
|
|
95
|
+
* walk (session-bound venues, and uniform period-fetch venues since the
|
|
96
|
+
* sparse-grid round): every candle window between the last
|
|
97
|
+
* loaded row and this timestamp completed a round trip whose completion
|
|
98
|
+
* carried the worker's authoritative servedEmpty verdict, so the span is a
|
|
99
|
+
* calendar hole (weekend/holiday/maintenance halt), not unfetched data.
|
|
100
|
+
* The clock latches its terminal finished state once this reaches the
|
|
101
|
+
* forward limit and probes again only after the limit advances past it.
|
|
102
|
+
* NOT permanent knowledge: consumers read it through
|
|
103
|
+
* `provenForwardScannedToMs` (TTL-bounded via forwardScannedAtMs, so
|
|
104
|
+
* delayed gateway ingestion near the live edge is re-asked), and any batch
|
|
105
|
+
* rows later landing inside the span falsify and clear it.
|
|
106
|
+
*/
|
|
107
|
+
forwardScannedToMs?: number;
|
|
108
|
+
/** When the frontier above was last raised; the TTL clock for its proof. */
|
|
109
|
+
forwardScannedAtMs?: number;
|
|
110
|
+
fullRows: number[][];
|
|
111
|
+
heatmapColumns: Float64Array[];
|
|
112
|
+
/**
|
|
113
|
+
* Last pan-back gap-fill outcome, keyed to stable evidence (column count and
|
|
114
|
+
* deepest captured column) rather than window bounds: the window's floor
|
|
115
|
+
* widens with every candle prepend, and an exact-bounds key would never
|
|
116
|
+
* latch while the book edge stays put.
|
|
117
|
+
*/
|
|
118
|
+
panBackGapFill?: {
|
|
119
|
+
maxMs: number;
|
|
120
|
+
queriedMinMs: number;
|
|
121
|
+
columnCount: number;
|
|
122
|
+
deepestColumnMs: number;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export interface ReplayFollowRange {
|
|
126
|
+
startTs: number;
|
|
127
|
+
endTs: number;
|
|
128
|
+
startKey?: number;
|
|
129
|
+
endKey?: number;
|
|
130
|
+
}
|
|
131
|
+
export type ReplayClockState = 'paused' | 'playing' | 'loading';
|
|
132
|
+
interface ReplayClockIndicators {
|
|
133
|
+
extendForwardTo?(endMs: number): void;
|
|
134
|
+
markNextReplayTickAsReseed?(): void;
|
|
135
|
+
revealTo(playheadMs: number): void;
|
|
136
|
+
seekTo(playheadMs: number, options?: {
|
|
137
|
+
incremental?: boolean;
|
|
138
|
+
relocateFoldedFootprintFine?: boolean;
|
|
139
|
+
}): void;
|
|
140
|
+
}
|
|
141
|
+
export interface ReplayClockSnapshot {
|
|
142
|
+
playheadMs: number;
|
|
143
|
+
state: ReplayClockState;
|
|
144
|
+
speed: number;
|
|
145
|
+
endMs: number;
|
|
146
|
+
finished: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface ReplayClockOptions {
|
|
149
|
+
chartIndex: number;
|
|
150
|
+
intervalMs: number;
|
|
151
|
+
tfMs: number;
|
|
152
|
+
stepMs?: number;
|
|
153
|
+
playheadMs: number;
|
|
154
|
+
speed?: number;
|
|
155
|
+
indicators: ReplayClockIndicators;
|
|
156
|
+
getForwardLimitMs: () => number;
|
|
157
|
+
shouldFollow?: () => boolean;
|
|
158
|
+
onUpdate?: (snapshot: ReplayClockSnapshot) => void;
|
|
159
|
+
/**
|
|
160
|
+
* Group boundary barrier: while true, ticks reschedule without advancing
|
|
161
|
+
* (state stays 'playing', so the transport never flip-flops). Used by the
|
|
162
|
+
* multichart master to hold for a member's forward load.
|
|
163
|
+
*/
|
|
164
|
+
shouldHold?: () => boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Mixed-timeline group: walk continuous wall time even on an irregular
|
|
167
|
+
* (session-gap) buffer, so uniform co-members keep playing through this
|
|
168
|
+
* chart's closed hours and this pane simply reveals nothing until its
|
|
169
|
+
* market reopens. Solo irregular replay keeps native bar-stepping.
|
|
170
|
+
*/
|
|
171
|
+
forceUniformTimeline?: () => boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Frame scheduler of the damped follow camera. The app leaves it unset
|
|
174
|
+
* (window.requestAnimationFrame); specs inject a fake rAF to drive the
|
|
175
|
+
* camera frame by frame between ticks.
|
|
176
|
+
*/
|
|
177
|
+
motion?: {
|
|
178
|
+
raf?: ((callback: FrameRequestCallback) => number) | null;
|
|
179
|
+
caf?: ((handle: number) => void) | null;
|
|
180
|
+
now?: () => number;
|
|
181
|
+
reducedMotion?: boolean;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface ReplayIndicatorsResult {
|
|
185
|
+
replayed: string[];
|
|
186
|
+
hidden: string[];
|
|
187
|
+
/**
|
|
188
|
+
* Workspace overlays that were skipped only because they had not mounted in
|
|
189
|
+
* the chart yet when prepare enumerated (fresh-boot replay entries race
|
|
190
|
+
* indicator mounting). The start flow re-dispatches these through
|
|
191
|
+
* loadOverlayDuringReplay, which waits for the mount and lanes them; without
|
|
192
|
+
* that they silently stay live production overlays for the whole session.
|
|
193
|
+
*/
|
|
194
|
+
deferredMountIds: string[];
|
|
195
|
+
}
|
|
196
|
+
export type ReplayZoomWindowMs = number | null;
|
|
197
|
+
export interface ReplayWindowBounds {
|
|
198
|
+
startMs: number;
|
|
199
|
+
endMs: number;
|
|
200
|
+
spanMs: number;
|
|
201
|
+
}
|
|
202
|
+
type ReplayRailCoverageRanges = Array<[number, number]>;
|
|
203
|
+
export interface RailsCoverage {
|
|
204
|
+
bars: Partial<Record<RailTf, ReplayRailCoverageRanges>>;
|
|
205
|
+
columns: Partial<Record<RailTf, ReplayRailCoverageRanges>>;
|
|
206
|
+
oldestBars: Partial<Record<RailTf, number>>;
|
|
207
|
+
done: boolean;
|
|
208
|
+
}
|
|
209
|
+
export type ReplayLaneEvent = {
|
|
210
|
+
mode: 'tick';
|
|
211
|
+
tf: 'tick';
|
|
212
|
+
tfMs: number;
|
|
213
|
+
tfLabel: string;
|
|
214
|
+
hasBook: boolean;
|
|
215
|
+
tickSource: 'live' | 'rails';
|
|
216
|
+
} | {
|
|
217
|
+
mode: 'coarse';
|
|
218
|
+
tf: ReplayStepTf;
|
|
219
|
+
tfMs: number;
|
|
220
|
+
tfLabel: string;
|
|
221
|
+
hasBook: boolean;
|
|
222
|
+
};
|
|
223
|
+
/** The wall that binds a replay reach decision (replayLadder.clampReplayReach). */
|
|
224
|
+
export type ReplayReachLimitedBy = 'retention' | 'plan' | 'gateway';
|
|
225
|
+
export interface ReplayUiState {
|
|
226
|
+
active: boolean;
|
|
227
|
+
loading: boolean;
|
|
228
|
+
state: string;
|
|
229
|
+
playheadMs: number;
|
|
230
|
+
lastRevealedOpen: number | null;
|
|
231
|
+
lastRevealedClose: number | null;
|
|
232
|
+
lastRevealedCloseMs: number | null;
|
|
233
|
+
speed: number;
|
|
234
|
+
finished: boolean;
|
|
235
|
+
follow: boolean;
|
|
236
|
+
buffered: Array<[number, number]>;
|
|
237
|
+
fidelity: {
|
|
238
|
+
level: 'approx' | 'exact';
|
|
239
|
+
};
|
|
240
|
+
status: string;
|
|
241
|
+
indicators: {
|
|
242
|
+
replayed: string[];
|
|
243
|
+
hidden: string[];
|
|
244
|
+
} | null;
|
|
245
|
+
pickArmed: boolean;
|
|
246
|
+
jumpPickTimeMs: number | null;
|
|
247
|
+
catchupPct: number | null;
|
|
248
|
+
resolutionAnchorMs: number | null;
|
|
249
|
+
resolutionAvailable: ReplayResolution[];
|
|
250
|
+
replayTimestampMode: ReplayTimestampMode;
|
|
251
|
+
replayV3Timestamps: number[];
|
|
252
|
+
domainStartMs: number;
|
|
253
|
+
domainEndMs: number;
|
|
254
|
+
reachWallMs: number | null;
|
|
255
|
+
reachLimited: boolean;
|
|
256
|
+
/** What binds `reachWallMs`; null when no reach decision stands. */
|
|
257
|
+
reachLimitedBy: ReplayReachLimitedBy | null;
|
|
258
|
+
reachClampNotice: number;
|
|
259
|
+
reachClampSource: 'anchor' | 'scrub' | null;
|
|
260
|
+
bookLayersAllowed: boolean;
|
|
261
|
+
/** Why book layers are off: plan gate vs the concurrent-session memory cap. */
|
|
262
|
+
bookLayersDeniedReason?: 'plan' | 'concurrency';
|
|
263
|
+
/** Multichart replay: arm the next anchor pick to enter a synced group. */
|
|
264
|
+
groupArmed: boolean;
|
|
265
|
+
/** Entry two-choice (this chart / all charts) is showing; anchor pick waits. */
|
|
266
|
+
groupChoicePending: boolean;
|
|
267
|
+
groupRole: 'master' | 'follower' | null;
|
|
268
|
+
groupMasterIndex: number | null;
|
|
269
|
+
bookLayersRequested: boolean;
|
|
270
|
+
zoomWindowMs: ReplayZoomWindowMs;
|
|
271
|
+
lane: ReplayLaneEvent;
|
|
272
|
+
railsCoverage: RailsCoverage;
|
|
273
|
+
replayV3Window: {
|
|
274
|
+
startMs: number;
|
|
275
|
+
endMs: number;
|
|
276
|
+
} | null;
|
|
277
|
+
replayVersion: 'v3' | null;
|
|
278
|
+
rebuilding: boolean;
|
|
279
|
+
/** Playback effects (user-toggleable via the transport FX menu). */
|
|
280
|
+
/** Bumped when a blocked gesture should pulse the Follow control. */
|
|
281
|
+
followHintPulse: number;
|
|
282
|
+
/** Increments each time a user gesture auto-releases Follow (drives the transient "Follow off" chip). */
|
|
283
|
+
followReleasePulse: number;
|
|
284
|
+
}
|
|
285
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergeLiveOhlcvDataPoint(lastData: any[], data: any, normalizedTime: number): any[];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const LIVE_OHLC_EXTREME_RATIO = 0.05;
|
|
2
|
+
const LIVE_OHLC_RANGE_MULTIPLIER = 3;
|
|
3
|
+
function finiteNumber(value) {
|
|
4
|
+
if (typeof value === 'string' && value.trim() === '')
|
|
5
|
+
return undefined;
|
|
6
|
+
const n = Number(value);
|
|
7
|
+
return Number.isFinite(n) ? n : undefined;
|
|
8
|
+
}
|
|
9
|
+
function positiveFiniteNumber(value) {
|
|
10
|
+
const n = finiteNumber(value);
|
|
11
|
+
return n !== undefined && n > 0 ? n : 0;
|
|
12
|
+
}
|
|
13
|
+
function referencePrice(rows, targetIndex, close) {
|
|
14
|
+
const target = targetIndex >= 0 ? rows[targetIndex] : undefined;
|
|
15
|
+
const previous = targetIndex >= 0 ? rows[targetIndex - 1] : rows[rows.length - 1];
|
|
16
|
+
return finiteNumber(target?.[4]) ?? finiteNumber(previous?.[4]) ?? close;
|
|
17
|
+
}
|
|
18
|
+
function liveOhlcTolerance(basePrice, bodyRange, existingRange) {
|
|
19
|
+
const priceBand = Math.abs(basePrice) * LIVE_OHLC_EXTREME_RATIO;
|
|
20
|
+
return Math.max(priceBand, Math.abs(bodyRange) * LIVE_OHLC_RANGE_MULTIPLIER, Math.abs(existingRange) * LIVE_OHLC_RANGE_MULTIPLIER);
|
|
21
|
+
}
|
|
22
|
+
function shouldUseLiveExtreme(value, boundary, tolerance, side) {
|
|
23
|
+
if (value === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (side === 'high')
|
|
26
|
+
return value <= boundary + tolerance;
|
|
27
|
+
return value >= boundary - tolerance;
|
|
28
|
+
}
|
|
29
|
+
function maybeLogSanitizedLiveOhlc(reason, raw, sanitized) {
|
|
30
|
+
if (typeof window === 'undefined' || !window.__KS_DIAG)
|
|
31
|
+
return;
|
|
32
|
+
console.warn('[K_OHLCV] sanitized live OHLCV point', { reason, raw, sanitized });
|
|
33
|
+
}
|
|
34
|
+
export function mergeLiveOhlcvDataPoint(lastData, data, normalizedTime) {
|
|
35
|
+
const close = finiteNumber(data?.close);
|
|
36
|
+
if (!data || close === undefined || !Number.isFinite(normalizedTime)) {
|
|
37
|
+
return lastData;
|
|
38
|
+
}
|
|
39
|
+
const targetIndex = lastData.findIndex((point) => Array.isArray(point) && point[0] === normalizedTime);
|
|
40
|
+
const existingPoint = targetIndex >= 0 ? lastData[targetIndex] : undefined;
|
|
41
|
+
const refPrice = referencePrice(lastData, targetIndex, close);
|
|
42
|
+
const rawOpen = finiteNumber(data.open);
|
|
43
|
+
const rawHigh = finiteNumber(data.high);
|
|
44
|
+
const rawLow = finiteNumber(data.low);
|
|
45
|
+
const newVolume = positiveFiniteNumber(data.volume);
|
|
46
|
+
const refTolerance = liveOhlcTolerance(refPrice, Math.abs(close - refPrice), 0);
|
|
47
|
+
const newOpen = rawOpen !== undefined &&
|
|
48
|
+
rawOpen >= Math.min(close, refPrice) - refTolerance &&
|
|
49
|
+
rawOpen <= Math.max(close, refPrice) + refTolerance
|
|
50
|
+
? rawOpen
|
|
51
|
+
: close;
|
|
52
|
+
const existingHigh = finiteNumber(existingPoint?.[2]);
|
|
53
|
+
const existingLow = finiteNumber(existingPoint?.[3]);
|
|
54
|
+
const baseHigh = Math.max(existingHigh ?? -Infinity, newOpen, close);
|
|
55
|
+
const baseLow = Math.min(existingLow ?? Infinity, newOpen, close);
|
|
56
|
+
const existingRange = existingHigh !== undefined && existingLow !== undefined ? Math.max(0, existingHigh - existingLow) : 0;
|
|
57
|
+
const tolerance = liveOhlcTolerance(close, Math.abs(close - newOpen), existingRange);
|
|
58
|
+
const newHigh = rawHigh !== undefined && shouldUseLiveExtreme(rawHigh, baseHigh, tolerance, 'high')
|
|
59
|
+
? Math.max(rawHigh, baseHigh)
|
|
60
|
+
: baseHigh;
|
|
61
|
+
const newLow = rawLow !== undefined && shouldUseLiveExtreme(rawLow, baseLow, tolerance, 'low')
|
|
62
|
+
? Math.min(rawLow, baseLow)
|
|
63
|
+
: baseLow;
|
|
64
|
+
if (rawOpen !== newOpen || rawHigh !== newHigh || rawLow !== newLow) {
|
|
65
|
+
maybeLogSanitizedLiveOhlc('implausible live OHLC field', data, [
|
|
66
|
+
normalizedTime,
|
|
67
|
+
newOpen,
|
|
68
|
+
newHigh,
|
|
69
|
+
newLow,
|
|
70
|
+
close,
|
|
71
|
+
newVolume,
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
// Pure like the buy-sell-volume / liquidations merges: never write into the
|
|
75
|
+
// caller's container. Live folds seed from the engine proxy's CACHED rows by
|
|
76
|
+
// reference; an in-place write leaks folded increments into the cache, and a
|
|
77
|
+
// re-fold of the same batch (multi-variant fallback re-apply) then counts
|
|
78
|
+
// them twice — the forming bar's volume overshot the candle until the next
|
|
79
|
+
// authoritative run.
|
|
80
|
+
if (targetIndex === -1) {
|
|
81
|
+
return [...lastData, [normalizedTime, newOpen, newHigh, newLow, close, newVolume]];
|
|
82
|
+
}
|
|
83
|
+
const next = [...lastData];
|
|
84
|
+
next[targetIndex] = [
|
|
85
|
+
normalizedTime,
|
|
86
|
+
existingPoint[1],
|
|
87
|
+
Math.max(existingHigh ?? newHigh, newHigh),
|
|
88
|
+
Math.min(existingLow ?? newLow, newLow),
|
|
89
|
+
close,
|
|
90
|
+
positiveFiniteNumber(existingPoint[5]) + newVolume,
|
|
91
|
+
];
|
|
92
|
+
return next;
|
|
93
|
+
}
|
|
@@ -69,6 +69,10 @@ export interface LiveTradesMergeOptions {
|
|
|
69
69
|
/** Called when the fold trimmed the live bar to the cap (the oldest prints dropped), so the
|
|
70
70
|
* caller can warn once (the kScript lane) or refuse the bar by name (the wrun lane). */
|
|
71
71
|
onCapped?: (cap: number) => void;
|
|
72
|
+
/** The bar the print folds into, when the caller names one (a dispatcher's host bar: an index-mode chart's own
|
|
73
|
+
* bar holding the print, `kScriptLiveHintedBucketMs`) in place of the bar the print keys on the lane's own grid
|
|
74
|
+
* (`tradesBarStartMs`); the cell's offset is measured from its open. Absent: the lane's own bar. */
|
|
75
|
+
barTs?: number;
|
|
72
76
|
}
|
|
73
77
|
/** One raw TRADE print as the fold reads it. */
|
|
74
78
|
export interface LiveTradePrint {
|
|
@@ -181,5 +185,5 @@ export declare function tradesLargeHistoryAnswers(market: TradesLargeMarket): bo
|
|
|
181
185
|
export declare function tradesBelowLargeFloor(print: LiveTradePrint, market?: TradesLargeMarket): boolean;
|
|
182
186
|
/** Fold one raw TRADE point onto the tape rows: the NEW rows array (the touched row a new array,
|
|
183
187
|
* every other row shared by reference), or null when the point is rejected (the caller keeps
|
|
184
|
-
* its rows). */
|
|
188
|
+
* its rows). The print lands in the bar `options.barTs` names, else in its own bar on the lane's grid. */
|
|
185
189
|
export declare function mergeLiveTradesDataPoint(lastDataPoint: ReadonlyArray<ArrayLike<unknown>>, newPoint: unknown, intervalMs: number, options?: LiveTradesMergeOptions): LiveTradesRow[] | null;
|
|
@@ -325,7 +325,7 @@ export function tradesBelowLargeFloor(print, market) {
|
|
|
325
325
|
}
|
|
326
326
|
/** Fold one raw TRADE point onto the tape rows: the NEW rows array (the touched row a new array,
|
|
327
327
|
* every other row shared by reference), or null when the point is rejected (the caller keeps
|
|
328
|
-
* its rows). */
|
|
328
|
+
* its rows). The print lands in the bar `options.barTs` names, else in its own bar on the lane's grid. */
|
|
329
329
|
export function mergeLiveTradesDataPoint(lastDataPoint, newPoint, intervalMs, options = {}) {
|
|
330
330
|
if (!Number.isFinite(intervalMs) || intervalMs <= 0)
|
|
331
331
|
return null;
|
|
@@ -337,7 +337,7 @@ export function mergeLiveTradesDataPoint(lastDataPoint, newPoint, intervalMs, op
|
|
|
337
337
|
return null;
|
|
338
338
|
if (options.largeFloor !== undefined && tradesBelowLargeFloor(print, options.largeFloor))
|
|
339
339
|
return null;
|
|
340
|
-
const barTs = tradesBarStartMs(print.tsMs, intervalMs, print.exchange);
|
|
340
|
+
const barTs = options.barTs ?? tradesBarStartMs(print.tsMs, intervalMs, print.exchange);
|
|
341
341
|
const rows = lastDataPoint;
|
|
342
342
|
const last = rows.length > 0 ? rows[rows.length - 1] : undefined;
|
|
343
343
|
// A delayed closed-bar print must not append an out-of-order row.
|