@orangecharts/wrun-chart-host 0.1.0 → 0.3.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 +39 -6
- package/dist/constants/common.constants.d.ts +15 -0
- package/dist/constants/common.constants.js +23 -0
- package/dist/constants/data-source.constants.d.ts +1 -0
- package/dist/constants/data-source.constants.js +1 -0
- package/dist/constants/economic.constants.d.ts +39 -0
- package/dist/constants/economic.constants.js +77 -0
- package/dist/constants/etf-covered-coins.constants.d.ts +1 -0
- package/dist/constants/etf-covered-coins.constants.js +9 -0
- package/dist/constants/feature-flags.constants.d.ts +60 -0
- package/dist/constants/feature-flags.constants.js +308 -0
- package/dist/constants/feature-limits.constants.d.ts +134 -0
- package/dist/constants/feature-limits.constants.js +155 -0
- package/dist/constants/marketCapabilities.constants.d.ts +87 -0
- package/dist/constants/marketCapabilities.constants.js +213 -0
- package/dist/constants/option-venues.constants.d.ts +100 -0
- package/dist/constants/option-venues.constants.js +167 -0
- package/dist/constants/overlay-data.constants.d.ts +53 -0
- package/dist/constants/overlay-data.constants.js +80 -0
- package/dist/constants/pane-grid.constants.d.ts +15 -0
- package/dist/constants/pane-grid.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +10 -0
- package/dist/constants/venue-presets.constants.js +22 -0
- package/dist/enums/chart.enum.d.ts +68 -0
- package/dist/enums/chart.enum.js +70 -0
- package/dist/helpers/data.helpers.d.ts +2 -0
- package/dist/helpers/data.helpers.js +14 -0
- package/dist/host-env.d.ts +161 -5
- package/dist/host-ports.types.d.ts +446 -0
- package/dist/host-ports.types.js +1 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.js +131 -0
- package/dist/indicators/controls/technical-script/technical-script-input-rendering.d.ts +86 -0
- package/dist/indicators/controls/technical-script/technical-script-input-rendering.js +179 -0
- package/dist/interfaces/asset-venue.interface.d.ts +91 -0
- package/dist/interfaces/asset-venue.interface.js +1 -0
- package/dist/interfaces/cancel-reason.interface.d.ts +24 -0
- package/dist/interfaces/cancel-reason.interface.js +2 -0
- package/dist/interfaces/catalog-display.interface.d.ts +3 -0
- package/dist/interfaces/catalog-display.interface.js +1 -0
- package/dist/interfaces/cme-realtime.interface.d.ts +251 -0
- package/dist/interfaces/cme-realtime.interface.js +46 -0
- package/dist/interfaces/feed.interface.d.ts +80 -0
- package/dist/interfaces/feed.interface.js +7 -0
- package/dist/interfaces/market-kind.interface.d.ts +8 -0
- package/dist/interfaces/market-kind.interface.js +1 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +224 -0
- package/dist/interfaces/opra-realtime.interface.js +105 -0
- package/dist/interfaces/option-instrument.interface.d.ts +32 -0
- package/dist/interfaces/option-instrument.interface.js +1 -0
- package/dist/interfaces/options-chain-scope.interface.d.ts +29 -0
- package/dist/interfaces/options-chain-scope.interface.js +7 -0
- package/dist/interfaces/prediction-market.interface.d.ts +88 -0
- package/dist/interfaces/prediction-market.interface.js +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +5 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +185 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +357 -0
- package/dist/settings-templates/frvp-fields.d.ts +27 -0
- package/dist/settings-templates/frvp-fields.js +108 -0
- package/dist/settings-templates/index.d.ts +119 -0
- package/dist/settings-templates/index.js +442 -0
- package/dist/settings-templates/indicator-fields.d.ts +56 -0
- package/dist/settings-templates/indicator-fields.js +793 -0
- package/dist/settings-templates/tool-rules.d.ts +59 -0
- package/dist/settings-templates/tool-rules.js +49 -0
- package/dist/settings-templates/tool-tables.generated.d.ts +2 -0
- package/dist/settings-templates/tool-tables.generated.js +1668 -0
- package/dist/utility/blk-market.util.d.ts +5 -0
- package/dist/utility/blk-market.util.js +12 -0
- package/dist/utility/chart/chart-load-phase.util.d.ts +32 -0
- package/dist/utility/chart/chart-load-phase.util.js +78 -0
- package/dist/utility/chart/cme-cache-context.util.d.ts +108 -0
- package/dist/utility/chart/cme-cache-context.util.js +166 -0
- package/dist/utility/chart/cme-session-bucket.util.d.ts +82 -0
- package/dist/utility/chart/cme-session-bucket.util.js +343 -0
- package/dist/utility/chart/cme-trade-calendar.util.d.ts +26 -0
- package/dist/utility/chart/cme-trade-calendar.util.js +147 -0
- package/dist/utility/chart/continuous-contracts.util.d.ts +138 -0
- package/dist/utility/chart/continuous-contracts.util.js +374 -0
- package/dist/utility/chart/feed-interval.util.d.ts +119 -0
- package/dist/utility/chart/feed-interval.util.js +321 -0
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +110 -0
- package/dist/utility/chart/fetch-dedupe-policy.util.js +407 -0
- package/dist/utility/chart/footprint-band.util.d.ts +76 -0
- package/dist/utility/chart/footprint-band.util.js +205 -0
- package/dist/utility/chart/footprint-cell-identity.util.d.ts +82 -0
- package/dist/utility/chart/footprint-cell-identity.util.js +346 -0
- package/dist/utility/chart/formula-calendar.util.d.ts +27 -0
- package/dist/utility/chart/formula-calendar.util.js +59 -0
- package/dist/utility/chart/history-wall.util.d.ts +67 -0
- package/dist/utility/chart/history-wall.util.js +87 -0
- package/dist/utility/chart/index-mode.util.d.ts +66 -0
- package/dist/utility/chart/index-mode.util.js +360 -0
- package/dist/utility/chart/indicator-coverage-planner.util.d.ts +217 -0
- package/dist/utility/chart/indicator-coverage-planner.util.js +443 -0
- package/dist/utility/chart/indicator-coverage-state.util.d.ts +33 -0
- package/dist/utility/chart/indicator-coverage-state.util.js +110 -0
- package/dist/utility/chart/indicator-gap-detector.util.d.ts +127 -0
- package/dist/utility/chart/indicator-gap-detector.util.js +260 -0
- package/dist/utility/chart/indicator-gap-repair.util.d.ts +88 -0
- package/dist/utility/chart/indicator-gap-repair.util.js +177 -0
- package/dist/utility/chart/indicator-inflight-registry.util.d.ts +26 -0
- package/dist/utility/chart/indicator-inflight-registry.util.js +254 -0
- package/dist/utility/chart/interval-registry.util.d.ts +23 -0
- package/dist/utility/chart/interval-registry.util.js +83 -0
- package/dist/utility/chart/kscript-main-grid-stages.util.d.ts +21 -0
- package/dist/utility/chart/kscript-main-grid-stages.util.js +332 -0
- package/dist/utility/chart/legacy-exchange.leaf.d.ts +11 -0
- package/dist/utility/chart/legacy-exchange.leaf.js +43 -0
- package/dist/utility/chart/live-bucket.util.d.ts +66 -0
- package/dist/utility/chart/live-bucket.util.js +165 -0
- package/dist/utility/chart/market-session-schedule.util.d.ts +91 -0
- package/dist/utility/chart/market-session-schedule.util.js +337 -0
- package/dist/utility/chart/marketKind.util.d.ts +181 -0
- package/dist/utility/chart/marketKind.util.js +371 -0
- package/dist/utility/chart/om-panel.util.js +6 -0
- package/dist/utility/chart/om-widget.util.d.ts +4 -0
- package/dist/utility/chart/opra-read-access.leaf.d.ts +26 -0
- package/dist/utility/chart/opra-read-access.leaf.js +25 -0
- package/dist/utility/chart/prediction-identity.util.d.ts +159 -0
- package/dist/utility/chart/prediction-identity.util.js +236 -0
- package/dist/utility/chart/rth-session.util.d.ts +352 -0
- package/dist/utility/chart/rth-session.util.js +926 -0
- package/dist/utility/chart/titan-constants.pin.d.ts +43 -0
- package/dist/utility/chart/titan-constants.pin.js +50 -0
- package/dist/utility/chart/us-equities-session.util.d.ts +127 -0
- package/dist/utility/chart/us-equities-session.util.js +251 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +100 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.js +354 -0
- package/dist/utility/chart/wrun-run-result.util.js +10 -0
- package/dist/utility/chart/wrun-wire-ref.util.d.ts +23 -0
- package/dist/utility/chart/wrun-wire-ref.util.js +16 -0
- package/dist/utility/common/safe-math-eval.d.ts +18 -0
- package/dist/utility/common/safe-math-eval.js +160 -0
- package/dist/utility/common/time.util.d.ts +134 -0
- package/dist/utility/common/time.util.js +428 -0
- package/dist/utility/common/transformations.util.d.ts +126 -0
- package/dist/utility/common/transformations.util.js +711 -0
- package/dist/utility/common/visible-timeout.util.d.ts +17 -0
- package/dist/utility/common/visible-timeout.util.js +75 -0
- package/dist/utility/exchange-normalization.util.d.ts +8 -0
- package/dist/utility/exchange-normalization.util.js +32 -0
- package/dist/utility/intl-locale.util.d.ts +2 -0
- package/dist/utility/intl-locale.util.js +28 -0
- package/dist/utility/number-format.util.d.ts +14 -1
- package/dist/utility/number-format.util.js +50 -19
- package/dist/utility/options/option-symbol.util.d.ts +28 -0
- package/dist/utility/options/option-symbol.util.js +176 -0
- package/dist/utility/options/option-trade-units.util.d.ts +190 -0
- package/dist/utility/options/option-trade-units.util.js +283 -0
- package/dist/utility/options/option-venue.util.d.ts +75 -0
- package/dist/utility/options/option-venue.util.js +85 -0
- package/dist/utility/pool-symbol.leaf.d.ts +34 -0
- package/dist/utility/pool-symbol.leaf.js +95 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +109 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +302 -0
- package/dist/utility/symbol-selection/contract-expiry.util.d.ts +39 -0
- package/dist/utility/symbol-selection/contract-expiry.util.js +111 -0
- package/dist/utility/v2/gate-plane.util.d.ts +58 -0
- package/dist/utility/v2/gate-plane.util.js +99 -0
- package/dist/utility/v2/gate-session-latch.util.d.ts +22 -0
- package/dist/utility/v2/gate-session-latch.util.js +34 -0
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +76 -0
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +221 -0
- package/dist/utility/wrun/sources/host-grid-landing.d.ts +15 -0
- package/dist/utility/wrun/sources/host-grid-landing.js +26 -0
- package/dist/utility/wrun/sources/lanes/bitfinex_funding.d.ts +27 -0
- package/dist/utility/wrun/sources/lanes/bitfinex_funding.js +85 -0
- package/dist/utility/wrun/sources/lanes/economic.d.ts +27 -0
- package/dist/utility/wrun/sources/lanes/economic.js +79 -0
- package/dist/utility/wrun/sources/lanes/etf_holdings.d.ts +35 -0
- package/dist/utility/wrun/sources/lanes/etf_holdings.js +165 -0
- package/dist/utility/wrun/sources/lanes/etf_premium.d.ts +19 -0
- package/dist/utility/wrun/sources/lanes/etf_premium.js +114 -0
- package/dist/utility/wrun/sources/lanes/ethena_positions.d.ts +30 -0
- package/dist/utility/wrun/sources/lanes/ethena_positions.js +51 -0
- package/dist/utility/wrun/sources/lanes/index.d.ts +2 -0
- package/dist/utility/wrun/sources/lanes/index.js +32 -0
- package/dist/utility/wrun/sources/lanes/long_short_ratio.d.ts +17 -0
- package/dist/utility/wrun/sources/lanes/long_short_ratio.js +47 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +30 -0
- package/dist/utility/wrun/sources/lanes/option_daily.js +53 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +23 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +20 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +50 -0
- package/dist/utility/wrun/sources/lanes/options_flow.js +155 -0
- package/dist/utility/wrun/sources/lanes/options_oi.d.ts +29 -0
- package/dist/utility/wrun/sources/lanes/options_oi.js +59 -0
- package/dist/utility/wrun/sources/lanes/options_volume.d.ts +38 -0
- package/dist/utility/wrun/sources/lanes/options_volume.js +63 -0
- package/dist/utility/wrun/sources/lanes/series.d.ts +67 -0
- package/dist/utility/wrun/sources/lanes/series.js +321 -0
- package/dist/utility/wrun/sources/lanes/token_supply.d.ts +30 -0
- package/dist/utility/wrun/sources/lanes/token_supply.js +145 -0
- package/dist/utility/wrun/sources/lanes/treasury_balance.d.ts +25 -0
- package/dist/utility/wrun/sources/lanes/treasury_balance.js +47 -0
- package/dist/utility/wrun/sources/lanes/volatility_index.d.ts +21 -0
- package/dist/utility/wrun/sources/lanes/volatility_index.js +11 -0
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +196 -0
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +446 -0
- package/dist/utility/wrun/sources/registry.d.ts +21 -0
- package/dist/utility/wrun/sources/registry.js +207 -0
- package/dist/utility/wrun/sources/row-lane-registry.d.ts +28 -0
- package/dist/utility/wrun/sources/row-lane-registry.js +230 -0
- package/dist/utility/wrun/sources/row-lanes/index.d.ts +2 -0
- package/dist/utility/wrun/sources/row-lanes/index.js +12 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +2 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +38 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +6 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +70 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +4 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +191 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +13 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +137 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +38 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +150 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +275 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +224 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +394 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +283 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +205 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +469 -0
- package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +28 -0
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +66 -0
- package/dist/utility/wrun/wrun-cloud-record.util.d.ts +65 -0
- package/dist/utility/wrun/wrun-cloud-record.util.js +121 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +1 -1
- package/dist/utility/wrun/wrun-daily-lane.util.d.ts +95 -0
- package/dist/utility/wrun/wrun-daily-lane.util.js +297 -0
- package/dist/utility/wrun/wrun-deadline.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-deadline.util.js +82 -0
- package/dist/utility/wrun/wrun-etf-flow-lane.util.d.ts +94 -0
- package/dist/utility/wrun/wrun-etf-flow-lane.util.js +224 -0
- package/dist/utility/wrun/wrun-etf-funds.util.d.ts +82 -0
- package/dist/utility/wrun/wrun-etf-funds.util.js +242 -0
- package/dist/utility/wrun/wrun-failure-cause.d.ts +39 -0
- package/dist/utility/wrun/wrun-failure-cause.js +94 -0
- package/dist/utility/wrun/wrun-frames.d.ts +28 -3
- package/dist/utility/wrun/wrun-frames.js +132 -52
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +167 -4
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +47 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +5 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.js +4 -2
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +22 -0
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +32 -0
- package/dist/utility/wrun/wrun-lane-warmup.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-lane-warmup.util.js +112 -0
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +57 -0
- package/dist/utility/wrun/wrun-leg-close.util.js +187 -0
- package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +144 -0
- package/dist/utility/wrun/wrun-leg-fetch.util.js +212 -0
- package/dist/utility/wrun/wrun-leg-stream-classes.d.ts +73 -0
- package/dist/utility/wrun/wrun-leg-stream-classes.js +86 -0
- package/dist/utility/wrun/wrun-levels-child.util.d.ts +101 -6
- package/dist/utility/wrun/wrun-levels-child.util.js +335 -157
- package/dist/utility/wrun/wrun-memory-clamp.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-memory-clamp.util.js +146 -0
- package/dist/utility/wrun/wrun-odds-template-market.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-odds-template-market.util.js +251 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +65 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +94 -0
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +47 -0
- package/dist/utility/wrun/wrun-opra-lane.util.js +58 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +30 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +96 -0
- package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-opra-underlying.util.js +1 -0
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +142 -0
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +451 -0
- package/dist/utility/wrun/wrun-option-knobs.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-option-knobs.util.js +81 -0
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +144 -0
- package/dist/utility/wrun/wrun-option-prints.util.js +356 -0
- package/dist/utility/wrun/wrun-option-summary-lane.util.d.ts +102 -0
- package/dist/utility/wrun/wrun-option-summary-lane.util.js +143 -0
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +308 -0
- package/dist/utility/wrun/wrun-options-chain.util.js +502 -0
- package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +9 -4
- package/dist/utility/wrun/wrun-overlay-identity.util.js +16 -6
- package/dist/utility/wrun/wrun-pack.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-pack.util.js +13 -3
- package/dist/utility/wrun/wrun-param-map.util.d.ts +298 -0
- package/dist/utility/wrun/wrun-param-map.util.js +581 -0
- package/dist/utility/wrun/wrun-param-values.util.d.ts +8 -0
- package/dist/utility/wrun/wrun-param-values.util.js +8 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +149 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +523 -0
- package/dist/utility/wrun/wrun-pin-venues.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-pin-venues.util.js +320 -0
- package/dist/utility/wrun/wrun-pinned-interval.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-pinned-interval.util.js +47 -0
- package/dist/utility/wrun/wrun-present-bits.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-present-bits.util.js +73 -0
- package/dist/utility/wrun/wrun-protocol-pending.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-protocol-pending.util.js +57 -0
- package/dist/utility/wrun/wrun-refusal.util.d.ts +95 -7
- package/dist/utility/wrun/wrun-refusal.util.js +314 -18
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +1 -14
- package/dist/utility/wrun/wrun-registry-errors.util.js +0 -16
- package/dist/utility/wrun/wrun-render-select.util.js +1 -0
- package/dist/utility/wrun/wrun-row-market.util.d.ts +29 -0
- package/dist/utility/wrun/wrun-row-market.util.js +92 -0
- package/dist/utility/wrun/wrun-row-source.d.ts +158 -0
- package/dist/utility/wrun/wrun-row-source.js +75 -0
- package/dist/utility/wrun/wrun-run-health.util.d.ts +155 -0
- package/dist/utility/wrun/wrun-run-health.util.js +273 -0
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +439 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +1689 -0
- package/dist/utility/wrun/wrun-socket-session-losses.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-socket-session-losses.util.js +25 -0
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +911 -0
- package/dist/utility/wrun/wrun-source-rows.util.js +2597 -0
- package/dist/utility/wrun/wrun-symbol-code.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-symbol-code.util.js +56 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +82 -0
- package/dist/utility/wrun/wrun-tape-source.util.js +151 -0
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +137 -0
- package/dist/utility/wrun/wrun-tier-grid.util.js +279 -0
- package/dist/utility/wrun/wrun-trades-lane.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-trades-lane.util.js +58 -0
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +66 -0
- package/dist/utility/wrun-display-name.util.d.ts +33 -0
- package/dist/utility/wrun-display-name.util.js +64 -0
- package/dist/workers/constants/kscript-transport-codes.d.ts +15 -0
- package/dist/workers/constants/kscript-transport-codes.js +15 -0
- package/dist/workers/constants/socket-slots.d.ts +574 -0
- package/dist/workers/constants/socket-slots.js +539 -0
- package/dist/workers/utils/number.worker.util.d.ts +5 -0
- package/dist/workers/utils/number.worker.util.js +10 -0
- package/dist/workers/utils/time.worker.util.d.ts +12 -0
- package/dist/workers/utils/time.worker.util.js +24 -0
- package/dist/workers/utils/volume-profile.worker.util.d.ts +200 -0
- package/dist/workers/utils/volume-profile.worker.util.js +631 -0
- package/package.json +10 -4
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot spec registry: every WebSocket slot's behaviour declared once as data,
|
|
3
|
+
* so the worker's routing/auth/keepalive/parking decisions are field lookups
|
|
4
|
+
* instead of string-matching scattered across the transport code. Adding a slot
|
|
5
|
+
* is one row here plus its route (see governed-route.util); the union and every
|
|
6
|
+
* per-slot registry derive from this table.
|
|
7
|
+
*
|
|
8
|
+
* Worker-safe by construction: pure data, ZERO imports — importable from the
|
|
9
|
+
* worker, the main-thread services, and specs alike without pulling DOM or the
|
|
10
|
+
* environment module into worker code.
|
|
11
|
+
*
|
|
12
|
+
* `provider` is a provider id (not a cme/crypto boolean): a future governed
|
|
13
|
+
* market (Bursa-class) adds its own rows under a new provider id rather than
|
|
14
|
+
* new branches. CME-specific wire details (tier frame, gate token) stay behind
|
|
15
|
+
* cme- named modules; this table is provider-neutral.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The gate's read deadline: it kicks any connection that has sent nothing for
|
|
19
|
+
* roughly this long (wire-measured 2026-07-27: 1006 at ~61s on every lane).
|
|
20
|
+
* The keepalive interval is set well inside it, and the wake path treats a
|
|
21
|
+
* sleep longer than this as proof the socket is already gone.
|
|
22
|
+
*/
|
|
23
|
+
export const CME_GATE_READ_DEADLINE_MS = 60_000;
|
|
24
|
+
export const SOCKET_SLOTS = {
|
|
25
|
+
liveFeed: {
|
|
26
|
+
family: 'livefeed',
|
|
27
|
+
provider: 'core',
|
|
28
|
+
tier: null,
|
|
29
|
+
auth: 'frame',
|
|
30
|
+
sendsTierFrame: false,
|
|
31
|
+
subscribeParams: 'brotliV2',
|
|
32
|
+
workerKeepalive: null,
|
|
33
|
+
mainThreadKeepalive: 'liveFeedService',
|
|
34
|
+
parkingSlot: 'pendingCloseLiveFeed',
|
|
35
|
+
urlKey: null,
|
|
36
|
+
pathPrefix: '',
|
|
37
|
+
connectable: true,
|
|
38
|
+
wire: 'v2',
|
|
39
|
+
},
|
|
40
|
+
liveFeedOrderbook: {
|
|
41
|
+
family: 'livefeed',
|
|
42
|
+
provider: 'core',
|
|
43
|
+
tier: null,
|
|
44
|
+
auth: 'frame',
|
|
45
|
+
sendsTierFrame: false,
|
|
46
|
+
subscribeParams: 'brotliV2',
|
|
47
|
+
workerKeepalive: null,
|
|
48
|
+
mainThreadKeepalive: 'liveFeedService',
|
|
49
|
+
parkingSlot: 'pendingCloseLiveFeedOrderbook',
|
|
50
|
+
urlKey: null,
|
|
51
|
+
pathPrefix: '',
|
|
52
|
+
connectable: true,
|
|
53
|
+
wire: 'v2',
|
|
54
|
+
},
|
|
55
|
+
liveFeedInCluster: {
|
|
56
|
+
family: 'livefeed',
|
|
57
|
+
provider: 'core',
|
|
58
|
+
tier: null,
|
|
59
|
+
auth: 'frame',
|
|
60
|
+
sendsTierFrame: false,
|
|
61
|
+
subscribeParams: 'brotliV2',
|
|
62
|
+
workerKeepalive: null,
|
|
63
|
+
mainThreadKeepalive: 'liveFeedService',
|
|
64
|
+
parkingSlot: 'pendingCloseLiveFeedInCluster',
|
|
65
|
+
urlKey: null,
|
|
66
|
+
pathPrefix: '',
|
|
67
|
+
connectable: true,
|
|
68
|
+
wire: 'v2',
|
|
69
|
+
},
|
|
70
|
+
v2: {
|
|
71
|
+
family: 'reader',
|
|
72
|
+
provider: 'core',
|
|
73
|
+
tier: null,
|
|
74
|
+
auth: 'none',
|
|
75
|
+
sendsTierFrame: false,
|
|
76
|
+
subscribeParams: null,
|
|
77
|
+
workerKeepalive: 'readerIdlePing',
|
|
78
|
+
mainThreadKeepalive: 'v2PingPong',
|
|
79
|
+
parkingSlot: null,
|
|
80
|
+
urlKey: null,
|
|
81
|
+
pathPrefix: '',
|
|
82
|
+
connectable: true,
|
|
83
|
+
wire: 'v2',
|
|
84
|
+
},
|
|
85
|
+
v2Orderbook: {
|
|
86
|
+
family: 'reader',
|
|
87
|
+
provider: 'core',
|
|
88
|
+
tier: null,
|
|
89
|
+
auth: 'none',
|
|
90
|
+
sendsTierFrame: false,
|
|
91
|
+
subscribeParams: null,
|
|
92
|
+
workerKeepalive: 'readerIdlePing',
|
|
93
|
+
mainThreadKeepalive: 'v2PingPong',
|
|
94
|
+
parkingSlot: null,
|
|
95
|
+
urlKey: null,
|
|
96
|
+
pathPrefix: '',
|
|
97
|
+
connectable: true,
|
|
98
|
+
wire: 'v2',
|
|
99
|
+
},
|
|
100
|
+
// The primary /v3 reader for the routes the routing table (gateway-routes.ts)
|
|
101
|
+
// sends to v3. The worker's Ping keeps it alive; V2Service owns its dial.
|
|
102
|
+
v3: {
|
|
103
|
+
family: 'reader',
|
|
104
|
+
provider: 'v3',
|
|
105
|
+
tier: null,
|
|
106
|
+
auth: 'none',
|
|
107
|
+
sendsTierFrame: false,
|
|
108
|
+
subscribeParams: null,
|
|
109
|
+
workerKeepalive: 'gatePing',
|
|
110
|
+
mainThreadKeepalive: null,
|
|
111
|
+
parkingSlot: null,
|
|
112
|
+
urlKey: null,
|
|
113
|
+
pathPrefix: '',
|
|
114
|
+
connectable: true,
|
|
115
|
+
wire: 'v3',
|
|
116
|
+
},
|
|
117
|
+
// The /v3 heavy lane: routed reads whose response class is heavy (gateway-routes
|
|
118
|
+
// v3LaneFor), so book frames never queue candles. V2Service dials it when the worker asks (NEED_LANE).
|
|
119
|
+
v3Orderbook: {
|
|
120
|
+
family: 'reader',
|
|
121
|
+
provider: 'v3',
|
|
122
|
+
tier: null,
|
|
123
|
+
auth: 'none',
|
|
124
|
+
sendsTierFrame: false,
|
|
125
|
+
subscribeParams: null,
|
|
126
|
+
workerKeepalive: 'gatePing',
|
|
127
|
+
mainThreadKeepalive: null,
|
|
128
|
+
parkingSlot: null,
|
|
129
|
+
urlKey: null,
|
|
130
|
+
pathPrefix: '',
|
|
131
|
+
connectable: true,
|
|
132
|
+
wire: 'v3',
|
|
133
|
+
},
|
|
134
|
+
// Dev-only /v3 shadow reader: dialed on request, never at boot. The worker's
|
|
135
|
+
// Ping keeps it alive because no main-thread loop owns it.
|
|
136
|
+
v3Shadow: {
|
|
137
|
+
family: 'reader',
|
|
138
|
+
provider: 'v3',
|
|
139
|
+
tier: null,
|
|
140
|
+
auth: 'none',
|
|
141
|
+
sendsTierFrame: false,
|
|
142
|
+
subscribeParams: null,
|
|
143
|
+
workerKeepalive: 'gatePing',
|
|
144
|
+
mainThreadKeepalive: null,
|
|
145
|
+
parkingSlot: null,
|
|
146
|
+
urlKey: null,
|
|
147
|
+
pathPrefix: '',
|
|
148
|
+
connectable: true,
|
|
149
|
+
wire: 'v3',
|
|
150
|
+
},
|
|
151
|
+
blkV2: {
|
|
152
|
+
family: 'reader',
|
|
153
|
+
provider: 'blk',
|
|
154
|
+
tier: null,
|
|
155
|
+
auth: 'none',
|
|
156
|
+
sendsTierFrame: false,
|
|
157
|
+
subscribeParams: null,
|
|
158
|
+
workerKeepalive: null,
|
|
159
|
+
mainThreadKeepalive: 'v2PingPong',
|
|
160
|
+
parkingSlot: null,
|
|
161
|
+
urlKey: 'BLK_V2_WEB_SOCKET',
|
|
162
|
+
pathPrefix: '',
|
|
163
|
+
connectable: true,
|
|
164
|
+
wire: 'v2',
|
|
165
|
+
},
|
|
166
|
+
// The blk host's /v3 reader beside `blkV2`, on its base URL with `/v2/` swapped for `/v3/`. Dialed on a routed
|
|
167
|
+
// read's first need, never at boot; the kill switch closes it.
|
|
168
|
+
blkV3: {
|
|
169
|
+
family: 'reader',
|
|
170
|
+
provider: 'blk',
|
|
171
|
+
tier: null,
|
|
172
|
+
auth: 'none',
|
|
173
|
+
sendsTierFrame: false,
|
|
174
|
+
subscribeParams: null,
|
|
175
|
+
workerKeepalive: 'gatePing',
|
|
176
|
+
mainThreadKeepalive: null,
|
|
177
|
+
parkingSlot: null,
|
|
178
|
+
urlKey: 'BLK_V2_WEB_SOCKET',
|
|
179
|
+
pathPrefix: '',
|
|
180
|
+
connectable: true,
|
|
181
|
+
wire: 'v3',
|
|
182
|
+
},
|
|
183
|
+
blkLiveFeed: {
|
|
184
|
+
family: 'livefeed',
|
|
185
|
+
provider: 'blk',
|
|
186
|
+
tier: null,
|
|
187
|
+
auth: 'frame',
|
|
188
|
+
sendsTierFrame: false,
|
|
189
|
+
subscribeParams: 'brotliV2',
|
|
190
|
+
workerKeepalive: 'gatePing',
|
|
191
|
+
mainThreadKeepalive: null,
|
|
192
|
+
parkingSlot: null,
|
|
193
|
+
urlKey: 'BLK_LIVE_FEED_URL',
|
|
194
|
+
pathPrefix: '',
|
|
195
|
+
connectable: true,
|
|
196
|
+
wire: 'v2',
|
|
197
|
+
},
|
|
198
|
+
cmeV2Realtime: {
|
|
199
|
+
family: 'reader',
|
|
200
|
+
provider: 'cme',
|
|
201
|
+
tier: 'realtime',
|
|
202
|
+
auth: 'frame',
|
|
203
|
+
sendsTierFrame: true,
|
|
204
|
+
subscribeParams: null,
|
|
205
|
+
workerKeepalive: 'gatePing',
|
|
206
|
+
mainThreadKeepalive: null,
|
|
207
|
+
parkingSlot: null,
|
|
208
|
+
urlKey: 'CME_V2_WEB_SOCKET',
|
|
209
|
+
pathPrefix: '/live/',
|
|
210
|
+
connectable: true,
|
|
211
|
+
wire: 'v2',
|
|
212
|
+
},
|
|
213
|
+
cmeV2Delayed: {
|
|
214
|
+
family: 'reader',
|
|
215
|
+
provider: 'cme',
|
|
216
|
+
tier: 'delayed',
|
|
217
|
+
auth: 'frame',
|
|
218
|
+
sendsTierFrame: true,
|
|
219
|
+
subscribeParams: null,
|
|
220
|
+
workerKeepalive: 'gatePing',
|
|
221
|
+
mainThreadKeepalive: null,
|
|
222
|
+
parkingSlot: null,
|
|
223
|
+
urlKey: 'CME_V2_WEB_SOCKET',
|
|
224
|
+
pathPrefix: '/delayed/',
|
|
225
|
+
connectable: true,
|
|
226
|
+
wire: 'v2',
|
|
227
|
+
},
|
|
228
|
+
// The gate's /v3 reader tiers beside the /v2 pair, on the same base URL with `/v2/` swapped for `/v3/`. Dialed on a
|
|
229
|
+
// routed read's first need, never at boot; the kill switch closes them.
|
|
230
|
+
cmeV3Realtime: {
|
|
231
|
+
family: 'reader',
|
|
232
|
+
provider: 'cme',
|
|
233
|
+
tier: 'realtime',
|
|
234
|
+
auth: 'frame',
|
|
235
|
+
sendsTierFrame: true,
|
|
236
|
+
subscribeParams: null,
|
|
237
|
+
workerKeepalive: 'gatePing',
|
|
238
|
+
mainThreadKeepalive: null,
|
|
239
|
+
parkingSlot: null,
|
|
240
|
+
urlKey: 'CME_V2_WEB_SOCKET',
|
|
241
|
+
pathPrefix: '/live/',
|
|
242
|
+
connectable: true,
|
|
243
|
+
wire: 'v3',
|
|
244
|
+
},
|
|
245
|
+
cmeV3Delayed: {
|
|
246
|
+
family: 'reader',
|
|
247
|
+
provider: 'cme',
|
|
248
|
+
tier: 'delayed',
|
|
249
|
+
auth: 'frame',
|
|
250
|
+
sendsTierFrame: true,
|
|
251
|
+
subscribeParams: null,
|
|
252
|
+
workerKeepalive: 'gatePing',
|
|
253
|
+
mainThreadKeepalive: null,
|
|
254
|
+
parkingSlot: null,
|
|
255
|
+
urlKey: 'CME_V2_WEB_SOCKET',
|
|
256
|
+
pathPrefix: '/delayed/',
|
|
257
|
+
connectable: true,
|
|
258
|
+
wire: 'v3',
|
|
259
|
+
},
|
|
260
|
+
cmeLiveFeedRealtime: {
|
|
261
|
+
family: 'livefeed',
|
|
262
|
+
provider: 'cme',
|
|
263
|
+
tier: 'realtime',
|
|
264
|
+
auth: 'frame',
|
|
265
|
+
sendsTierFrame: true,
|
|
266
|
+
subscribeParams: 'brotliV2',
|
|
267
|
+
workerKeepalive: 'gatePing',
|
|
268
|
+
mainThreadKeepalive: null,
|
|
269
|
+
parkingSlot: null,
|
|
270
|
+
urlKey: 'CME_LIVE_FEED_URL',
|
|
271
|
+
pathPrefix: '/live/',
|
|
272
|
+
connectable: true,
|
|
273
|
+
wire: 'v2',
|
|
274
|
+
},
|
|
275
|
+
cmeLiveFeedDelayed: {
|
|
276
|
+
family: 'livefeed',
|
|
277
|
+
provider: 'cme',
|
|
278
|
+
tier: 'delayed',
|
|
279
|
+
auth: 'frame',
|
|
280
|
+
sendsTierFrame: true,
|
|
281
|
+
subscribeParams: 'brotliV2',
|
|
282
|
+
workerKeepalive: 'gatePing',
|
|
283
|
+
mainThreadKeepalive: null,
|
|
284
|
+
parkingSlot: null,
|
|
285
|
+
urlKey: 'CME_LIVE_FEED_URL',
|
|
286
|
+
pathPrefix: '/delayed/',
|
|
287
|
+
connectable: true,
|
|
288
|
+
wire: 'v2',
|
|
289
|
+
},
|
|
290
|
+
// The OPRA entitlement gate (US equity and index options): the same path-based tiers, tier
|
|
291
|
+
// frame, device-scoped auth and kick model as the CME gate, on its own base URLs and its own
|
|
292
|
+
// kick channel. No /v3 twins (the v3 lane is dev-only) and no book types (OPRA is top of book).
|
|
293
|
+
opraV2Realtime: {
|
|
294
|
+
family: 'reader',
|
|
295
|
+
provider: 'opra',
|
|
296
|
+
tier: 'realtime',
|
|
297
|
+
auth: 'frame',
|
|
298
|
+
sendsTierFrame: true,
|
|
299
|
+
subscribeParams: null,
|
|
300
|
+
workerKeepalive: 'gatePing',
|
|
301
|
+
mainThreadKeepalive: null,
|
|
302
|
+
parkingSlot: null,
|
|
303
|
+
urlKey: 'OPRA_V2_WEB_SOCKET',
|
|
304
|
+
pathPrefix: '/live/',
|
|
305
|
+
connectable: true,
|
|
306
|
+
wire: 'v2',
|
|
307
|
+
},
|
|
308
|
+
opraV2Delayed: {
|
|
309
|
+
family: 'reader',
|
|
310
|
+
provider: 'opra',
|
|
311
|
+
tier: 'delayed',
|
|
312
|
+
auth: 'frame',
|
|
313
|
+
sendsTierFrame: true,
|
|
314
|
+
subscribeParams: null,
|
|
315
|
+
workerKeepalive: 'gatePing',
|
|
316
|
+
mainThreadKeepalive: null,
|
|
317
|
+
parkingSlot: null,
|
|
318
|
+
urlKey: 'OPRA_V2_WEB_SOCKET',
|
|
319
|
+
pathPrefix: '/delayed/',
|
|
320
|
+
connectable: true,
|
|
321
|
+
wire: 'v2',
|
|
322
|
+
},
|
|
323
|
+
opraLiveFeedRealtime: {
|
|
324
|
+
family: 'livefeed',
|
|
325
|
+
provider: 'opra',
|
|
326
|
+
tier: 'realtime',
|
|
327
|
+
auth: 'frame',
|
|
328
|
+
sendsTierFrame: true,
|
|
329
|
+
subscribeParams: 'brotliV2',
|
|
330
|
+
workerKeepalive: 'gatePing',
|
|
331
|
+
mainThreadKeepalive: null,
|
|
332
|
+
parkingSlot: null,
|
|
333
|
+
urlKey: 'OPRA_LIVE_FEED_URL',
|
|
334
|
+
pathPrefix: '/live/',
|
|
335
|
+
connectable: true,
|
|
336
|
+
wire: 'v2',
|
|
337
|
+
},
|
|
338
|
+
opraLiveFeedDelayed: {
|
|
339
|
+
family: 'livefeed',
|
|
340
|
+
provider: 'opra',
|
|
341
|
+
tier: 'delayed',
|
|
342
|
+
auth: 'frame',
|
|
343
|
+
sendsTierFrame: true,
|
|
344
|
+
subscribeParams: 'brotliV2',
|
|
345
|
+
workerKeepalive: 'gatePing',
|
|
346
|
+
mainThreadKeepalive: null,
|
|
347
|
+
parkingSlot: null,
|
|
348
|
+
urlKey: 'OPRA_LIVE_FEED_URL',
|
|
349
|
+
pathPrefix: '/delayed/',
|
|
350
|
+
connectable: true,
|
|
351
|
+
wire: 'v2',
|
|
352
|
+
},
|
|
353
|
+
kscriptAlert: {
|
|
354
|
+
family: 'alert',
|
|
355
|
+
provider: 'core',
|
|
356
|
+
tier: null,
|
|
357
|
+
auth: 'frame',
|
|
358
|
+
sendsTierFrame: false,
|
|
359
|
+
subscribeParams: null,
|
|
360
|
+
workerKeepalive: 'alertPing',
|
|
361
|
+
mainThreadKeepalive: 'alertService',
|
|
362
|
+
parkingSlot: null,
|
|
363
|
+
urlKey: null,
|
|
364
|
+
pathPrefix: '',
|
|
365
|
+
connectable: true,
|
|
366
|
+
wire: 'v2',
|
|
367
|
+
},
|
|
368
|
+
pendingCloseLiveFeed: {
|
|
369
|
+
family: 'parking',
|
|
370
|
+
provider: 'core',
|
|
371
|
+
tier: null,
|
|
372
|
+
auth: 'none',
|
|
373
|
+
sendsTierFrame: false,
|
|
374
|
+
subscribeParams: null,
|
|
375
|
+
workerKeepalive: null,
|
|
376
|
+
mainThreadKeepalive: null,
|
|
377
|
+
parkingSlot: null,
|
|
378
|
+
urlKey: null,
|
|
379
|
+
pathPrefix: '',
|
|
380
|
+
connectable: false,
|
|
381
|
+
wire: 'v2',
|
|
382
|
+
},
|
|
383
|
+
pendingCloseLiveFeedOrderbook: {
|
|
384
|
+
family: 'parking',
|
|
385
|
+
provider: 'core',
|
|
386
|
+
tier: null,
|
|
387
|
+
auth: 'none',
|
|
388
|
+
sendsTierFrame: false,
|
|
389
|
+
subscribeParams: null,
|
|
390
|
+
workerKeepalive: null,
|
|
391
|
+
mainThreadKeepalive: null,
|
|
392
|
+
parkingSlot: null,
|
|
393
|
+
urlKey: null,
|
|
394
|
+
pathPrefix: '',
|
|
395
|
+
connectable: false,
|
|
396
|
+
wire: 'v2',
|
|
397
|
+
},
|
|
398
|
+
pendingCloseLiveFeedInCluster: {
|
|
399
|
+
family: 'parking',
|
|
400
|
+
provider: 'core',
|
|
401
|
+
tier: null,
|
|
402
|
+
auth: 'none',
|
|
403
|
+
sendsTierFrame: false,
|
|
404
|
+
subscribeParams: null,
|
|
405
|
+
workerKeepalive: null,
|
|
406
|
+
mainThreadKeepalive: null,
|
|
407
|
+
parkingSlot: null,
|
|
408
|
+
urlKey: null,
|
|
409
|
+
pathPrefix: '',
|
|
410
|
+
connectable: false,
|
|
411
|
+
wire: 'v2',
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
function slotIdsOfFamilyAndProvider(family, provider) {
|
|
415
|
+
return Object.keys(SOCKET_SLOTS).filter((id) => SOCKET_SLOTS[id].family === family && SOCKET_SLOTS[id].provider === provider);
|
|
416
|
+
}
|
|
417
|
+
export const CME_READER_SLOT_IDS = slotIdsOfFamilyAndProvider('reader', 'cme');
|
|
418
|
+
export const CME_LIVEFEED_SLOT_IDS = slotIdsOfFamilyAndProvider('livefeed', 'cme');
|
|
419
|
+
const CORE_READER_SLOT_IDS = slotIdsOfFamilyAndProvider('reader', 'core');
|
|
420
|
+
const CORE_LIVEFEED_SLOT_IDS = slotIdsOfFamilyAndProvider('livefeed', 'core');
|
|
421
|
+
/**
|
|
422
|
+
* The gate slot serving each (family, tier). `satisfies` makes the compiler
|
|
423
|
+
* reject a missing pairing, so a new `SlotTier` member cannot ship unrouted;
|
|
424
|
+
* the table-shape spec checks the entries against each row's own tier/family.
|
|
425
|
+
*/
|
|
426
|
+
const CME_SLOT_BY_FAMILY_TIER = {
|
|
427
|
+
reader: { realtime: 'cmeV2Realtime', delayed: 'cmeV2Delayed' },
|
|
428
|
+
livefeed: { realtime: 'cmeLiveFeedRealtime', delayed: 'cmeLiveFeedDelayed' },
|
|
429
|
+
};
|
|
430
|
+
export function cmeSlotForTier(family, tier) {
|
|
431
|
+
return CME_SLOT_BY_FAMILY_TIER[family][tier];
|
|
432
|
+
}
|
|
433
|
+
/** The /v3 twin of a CME reader tier: a routed read rides the same tier its v2 read would. */
|
|
434
|
+
export function cmeV3ReaderFor(slot) {
|
|
435
|
+
return SOCKET_SLOTS[slot].tier === 'realtime' ? 'cmeV3Realtime' : 'cmeV3Delayed';
|
|
436
|
+
}
|
|
437
|
+
export function isCmeV3ReaderSlot(wsType) {
|
|
438
|
+
return wsType === 'cmeV3Realtime' || wsType === 'cmeV3Delayed';
|
|
439
|
+
}
|
|
440
|
+
/** A reader speaking /v3: its frames decode with the v3 codec and route by request id. */
|
|
441
|
+
export function isV3WireSlot(wsType) {
|
|
442
|
+
return wsType in SOCKET_SLOTS && SOCKET_SLOTS[wsType].wire === 'v3';
|
|
443
|
+
}
|
|
444
|
+
const CME_READER_SLOT_SET = new Set(CME_READER_SLOT_IDS);
|
|
445
|
+
const CME_LIVEFEED_SLOT_SET = new Set(CME_LIVEFEED_SLOT_IDS);
|
|
446
|
+
const CORE_READER_SLOT_SET = new Set(CORE_READER_SLOT_IDS);
|
|
447
|
+
const CORE_LIVEFEED_SLOT_SET = new Set(CORE_LIVEFEED_SLOT_IDS);
|
|
448
|
+
const V3_READER_SLOT_SET = new Set(slotIdsOfFamilyAndProvider('reader', 'v3'));
|
|
449
|
+
/** The ungated core reader; `v2` names the slot, and a routed read on it may still ask /v3. */
|
|
450
|
+
export function isPlainReaderSlot(wsType) {
|
|
451
|
+
return wsType === 'v2';
|
|
452
|
+
}
|
|
453
|
+
/** The blk host's v2 reader; a routed read on it may still ask /v3 on `blkV3`. */
|
|
454
|
+
export function isBlkReaderSlot(wsType) {
|
|
455
|
+
return wsType === 'blkV2';
|
|
456
|
+
}
|
|
457
|
+
export function isCmeReaderSlot(wsType) {
|
|
458
|
+
return CME_READER_SLOT_SET.has(wsType);
|
|
459
|
+
}
|
|
460
|
+
export function isCmeLivefeedSlot(wsType) {
|
|
461
|
+
return CME_LIVEFEED_SLOT_SET.has(wsType);
|
|
462
|
+
}
|
|
463
|
+
export const OPRA_READER_SLOT_IDS = slotIdsOfFamilyAndProvider('reader', 'opra');
|
|
464
|
+
export const OPRA_LIVEFEED_SLOT_IDS = slotIdsOfFamilyAndProvider('livefeed', 'opra');
|
|
465
|
+
export const GATE_READER_SLOT_IDS_BY_PROVIDER = {
|
|
466
|
+
cme: CME_READER_SLOT_IDS,
|
|
467
|
+
opra: OPRA_READER_SLOT_IDS,
|
|
468
|
+
};
|
|
469
|
+
export const GATE_LIVEFEED_SLOT_IDS_BY_PROVIDER = {
|
|
470
|
+
cme: CME_LIVEFEED_SLOT_IDS,
|
|
471
|
+
opra: OPRA_LIVEFEED_SLOT_IDS,
|
|
472
|
+
};
|
|
473
|
+
/** Every gate plane's reader tiers, for the plane-neutral sweeps (sleep heal, idle release). */
|
|
474
|
+
export const GATE_READER_SLOT_IDS = [...CME_READER_SLOT_IDS, ...OPRA_READER_SLOT_IDS];
|
|
475
|
+
/** Every gate plane's live-feed tiers, for the plane-neutral sweeps. */
|
|
476
|
+
export const GATE_LIVEFEED_SLOT_IDS = [
|
|
477
|
+
...CME_LIVEFEED_SLOT_IDS,
|
|
478
|
+
...OPRA_LIVEFEED_SLOT_IDS,
|
|
479
|
+
];
|
|
480
|
+
/**
|
|
481
|
+
* The gate slot serving each (provider, family, tier). `satisfies` makes the
|
|
482
|
+
* compiler reject a plane missing a tier pairing, so a new provider cannot
|
|
483
|
+
* ship unrouted; the table-shape spec checks the entries against each row.
|
|
484
|
+
*/
|
|
485
|
+
const GATE_SLOT_BY_PROVIDER_FAMILY_TIER = {
|
|
486
|
+
cme: CME_SLOT_BY_FAMILY_TIER,
|
|
487
|
+
opra: {
|
|
488
|
+
reader: { realtime: 'opraV2Realtime', delayed: 'opraV2Delayed' },
|
|
489
|
+
livefeed: { realtime: 'opraLiveFeedRealtime', delayed: 'opraLiveFeedDelayed' },
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
export function gateSlotForTier(provider, family, tier) {
|
|
493
|
+
return GATE_SLOT_BY_PROVIDER_FAMILY_TIER[provider][family][tier];
|
|
494
|
+
}
|
|
495
|
+
/** The gate plane a slot belongs to, or null for the core, v3 and blk slots. */
|
|
496
|
+
export function gateProviderOf(wsType) {
|
|
497
|
+
if (!(wsType in SOCKET_SLOTS))
|
|
498
|
+
return null;
|
|
499
|
+
const provider = SOCKET_SLOTS[wsType].provider;
|
|
500
|
+
return provider === 'cme' || provider === 'opra' ? provider : null;
|
|
501
|
+
}
|
|
502
|
+
export function isGateReaderSlot(wsType) {
|
|
503
|
+
return gateProviderOf(wsType) !== null && SOCKET_SLOTS[wsType].family === 'reader';
|
|
504
|
+
}
|
|
505
|
+
export function isGateLivefeedSlot(wsType) {
|
|
506
|
+
return gateProviderOf(wsType) !== null && SOCKET_SLOTS[wsType].family === 'livefeed';
|
|
507
|
+
}
|
|
508
|
+
/** A gate slot on its delayed path tier (plane-neutral spelling of the `=== 'cmeV2Delayed'` tests). */
|
|
509
|
+
export function isDelayedTierSlot(wsType) {
|
|
510
|
+
return wsType in SOCKET_SLOTS && SOCKET_SLOTS[wsType].tier === 'delayed';
|
|
511
|
+
}
|
|
512
|
+
export function isCoreReaderSlot(wsType) {
|
|
513
|
+
return CORE_READER_SLOT_SET.has(wsType);
|
|
514
|
+
}
|
|
515
|
+
export function isCoreLivefeedSlot(wsType) {
|
|
516
|
+
return CORE_LIVEFEED_SLOT_SET.has(wsType);
|
|
517
|
+
}
|
|
518
|
+
export function isV3ReaderSlot(wsType) {
|
|
519
|
+
return V3_READER_SLOT_SET.has(wsType);
|
|
520
|
+
}
|
|
521
|
+
export const READER_SLOT_IDS = Object.keys(SOCKET_SLOTS).filter((id) => SOCKET_SLOTS[id].family === 'reader');
|
|
522
|
+
export const LIVEFEED_SLOT_IDS = Object.keys(SOCKET_SLOTS).filter((id) => SOCKET_SLOTS[id].family === 'livefeed');
|
|
523
|
+
/** Reader-family slot (was `isV2Connection`): frame auth is skipped, open-waiters/state listeners apply. */
|
|
524
|
+
export function isReaderSlot(id) {
|
|
525
|
+
return SOCKET_SLOTS[id].family === 'reader';
|
|
526
|
+
}
|
|
527
|
+
/** Live-feed-family slot (core or CME gate): transport-health tracked, brotli subscribe envelope. */
|
|
528
|
+
export function isLivefeedSlot(id) {
|
|
529
|
+
return SOCKET_SLOTS[id].family === 'livefeed';
|
|
530
|
+
}
|
|
531
|
+
const NEVER_AT_BOOT = ['v3Shadow', 'v3Orderbook', 'blkV3'];
|
|
532
|
+
/**
|
|
533
|
+
* Slots the worker bootstrap may open before worker-impl loads: a bare
|
|
534
|
+
* `new WebSocket(url)` is their COMPLETE handshake, so the connect overlaps the
|
|
535
|
+
* heavy import. Frame-authenticated slots can't — the bootstrap sends no frame.
|
|
536
|
+
* `v3Shadow`, `v3Orderbook` and `blkV3` are never boot sockets. The bootstrap
|
|
537
|
+
* reads its own copy (worker-bootstrap.ts, pinned to this list by its spec).
|
|
538
|
+
*/
|
|
539
|
+
export const EARLY_CONNECT_SLOT_IDS = Object.keys(SOCKET_SLOTS).filter((id) => SOCKET_SLOTS[id].auth === 'none' && SOCKET_SLOTS[id].connectable && !NEVER_AT_BOOT.includes(id));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counts the decimal places represented by a number, including scientific notation.
|
|
3
|
+
* Kept worker-local so numeric processing does not load the chart engine.
|
|
4
|
+
*/
|
|
5
|
+
export function getDecimalPlaces(num) {
|
|
6
|
+
const match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
|
|
7
|
+
if (!match)
|
|
8
|
+
return 0;
|
|
9
|
+
return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns UTC midnight on the Monday that contains the supplied timestamp.
|
|
3
|
+
* Kept worker-local so time bucketing does not load the chart engine.
|
|
4
|
+
*/
|
|
5
|
+
export declare function findMonday(unixTimeStamp: number): number;
|
|
6
|
+
/**
|
|
7
|
+
* The period of a history window from `fromSec` that ends where the bar
|
|
8
|
+
* holding `nowSec` opens, so the ask keeps every closed bar. A calendar bar
|
|
9
|
+
* (1M 3M 6M 1Y) opens on its UTC boundary; any other length keeps the fixed
|
|
10
|
+
* UTC floor, computed exactly as before.
|
|
11
|
+
*/
|
|
12
|
+
export declare function periodToFormingBarSec(fromSec: number, nowSec: number, intervalMs: number): number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { barStartMs, isCalendarIntervalMs } from '../../utility/chart/calendar-interval.util.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns UTC midnight on the Monday that contains the supplied timestamp.
|
|
4
|
+
* Kept worker-local so time bucketing does not load the chart engine.
|
|
5
|
+
*/
|
|
6
|
+
export function findMonday(unixTimeStamp) {
|
|
7
|
+
const startDate = new Date(unixTimeStamp);
|
|
8
|
+
const startDay = startDate.getUTCDay();
|
|
9
|
+
const diff = startDate.getUTCDate() - startDay + (startDay === 0 ? -6 : 1);
|
|
10
|
+
const monday = new Date(startDate.setUTCDate(diff));
|
|
11
|
+
monday.setUTCHours(0, 0, 0, 0);
|
|
12
|
+
return monday.valueOf();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The period of a history window from `fromSec` that ends where the bar
|
|
16
|
+
* holding `nowSec` opens, so the ask keeps every closed bar. A calendar bar
|
|
17
|
+
* (1M 3M 6M 1Y) opens on its UTC boundary; any other length keeps the fixed
|
|
18
|
+
* UTC floor, computed exactly as before.
|
|
19
|
+
*/
|
|
20
|
+
export function periodToFormingBarSec(fromSec, nowSec, intervalMs) {
|
|
21
|
+
if (!isCalendarIntervalMs(intervalMs))
|
|
22
|
+
return nowSec - fromSec - (nowSec % (intervalMs / 1000));
|
|
23
|
+
return barStartMs(nowSec * 1000, intervalMs) / 1000 - fromSec;
|
|
24
|
+
}
|