@orangecharts/wrun-chart-host 0.2.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 +14 -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 +128 -0
- package/dist/index.js +128 -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/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-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-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-frames.d.ts +20 -1
- package/dist/utility/wrun/wrun-frames.js +103 -49
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +27 -0
- 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-param-map.util.d.ts +298 -0
- package/dist/utility/wrun/wrun-param-map.util.js +581 -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 +41 -1
- package/dist/utility/wrun/wrun-refusal.util.js +69 -2
- 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-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-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,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A POLL SCALAR LANE of the browser (chart) lane, as one descriptor.
|
|
3
|
+
*
|
|
4
|
+
* A poll lane serves one kit source class whose series has no live channel: scalar inputs
|
|
5
|
+
* (`input("name", <class>.<field>, { knobs })`) read off ONE kScript K control (or off the lane's
|
|
6
|
+
* own `fetch`, for a series no K control serves: a relay feed), fetched with the full run and
|
|
7
|
+
* re-asked by the live tick's poll reconcile. Everything such a class needs from the host is
|
|
8
|
+
* derived from its descriptor, so adding one is two files and no shared edit:
|
|
9
|
+
*
|
|
10
|
+
* 1. `src/utility/wrun/sources/lanes/<source_class>.ts`, exporting `lane` (one descriptor) or
|
|
11
|
+
* `lanes` (several: a class whose fields ride different K controls exports one lane per
|
|
12
|
+
* field group). The FILE is named after the source class its lanes serve; the registry
|
|
13
|
+
* (`registry.ts`) discovers it by glob and refuses a file whose lanes declare another
|
|
14
|
+
* class, and the template extractor (plain Node) lists the folder by file name.
|
|
15
|
+
* 2. `tests/utility/wrun/sources/<source_class>.spec.ts`.
|
|
16
|
+
*
|
|
17
|
+
* What the host derives from the registry (nothing lists a lane by name):
|
|
18
|
+
* - the served-class set (`wrun-browser-sources.ts`) and the template picker's verdicts;
|
|
19
|
+
* - the full run (`wrun-overlay-run.util.ts`): the plan before any fetch, one fetch per lane
|
|
20
|
+
* INSTANCE beside the other lanes, the labeled "data is unavailable" refusal on an empty
|
|
21
|
+
* answer, the live context's buffers;
|
|
22
|
+
* - the row builder (`wrun-source-rows.util.ts`): each input's column and join, the `missing`
|
|
23
|
+
* policy, the tail build equal to the full build;
|
|
24
|
+
* - the live tick (`wrun-live-tick.util.ts`): the lane in every poll reconcile at its own
|
|
25
|
+
* interval (through its own `fetch` when it has one; a routine poll at its `pollIntervalMs`
|
|
26
|
+
* pace when it names one), fetched rows winning, a revised closed bar reseeding;
|
|
27
|
+
* - a lane naming `live`: its channel per session (`wrun-series-stream.util.ts`).
|
|
28
|
+
*
|
|
29
|
+
* Rules a lane file keeps:
|
|
30
|
+
* - LIGHT at module load. The registry is on the import graph of the row builder and of the
|
|
31
|
+
* served-class set, so a lane file imports types and small pure helpers only; anything heavy
|
|
32
|
+
* (the metadata service, a store, the i18n plugin) is imported lazily inside `plan`.
|
|
33
|
+
* - `plan` is the ONLY place a lane refuses: by name (`refuseWrunPollInput`), before any fetch.
|
|
34
|
+
* - It never serves a class the row builder serves itself (the registry refuses that), and it
|
|
35
|
+
* is scalar: a celled input of its class refuses by name.
|
|
36
|
+
*
|
|
37
|
+
* What the kit owns and the lane does not re-check: a market pin (`symbol` / `exchange`), an
|
|
38
|
+
* interval pin and a view on these classes refuse in the pinned-wire planner before the lane is
|
|
39
|
+
* planned; `forming` views and bindings are refused by the kit.
|
|
40
|
+
*/
|
|
41
|
+
import type { WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
|
|
42
|
+
import type { WrunDailyLanding } from '../wrun-daily-lane.util.js';
|
|
43
|
+
import { type WrunRefusalSeed } from '../wrun-refusal.util.js';
|
|
44
|
+
import type { WrunBackendTier, WrunTierLanding } from '../wrun-tier-grid.util.js';
|
|
45
|
+
/** An input's declaration as a lane reads it: the typed fields, and any knob the sheet carries
|
|
46
|
+
* that the interface does not name yet (`asset`, `publisher`, `series`, ...), as `unknown`. */
|
|
47
|
+
export type WrunPollLaneSource = WrunInputSource & Readonly<Record<string, unknown>>;
|
|
48
|
+
/** The chart a lane is planned against, and the input being planned. */
|
|
49
|
+
export interface WrunPollLaneContext {
|
|
50
|
+
/** The input's declared name (every refusal names it). */
|
|
51
|
+
inputName: string;
|
|
52
|
+
/** The input's source class (the lane's own; carried so a refusal can name it). */
|
|
53
|
+
sourceClass: string;
|
|
54
|
+
/** The chart market's coin, exchange and symbol as the chart holds them ('' when absent). */
|
|
55
|
+
coin: string;
|
|
56
|
+
exchange: string;
|
|
57
|
+
symbol: string;
|
|
58
|
+
/** The chart market's category as the chart holds it (pb-common `Category`: an option contract chart's `OPTION`),
|
|
59
|
+
* handed to a lane that resolves the chart's options chain (the chart's options controls read it); absent when
|
|
60
|
+
* unknown. */
|
|
61
|
+
category?: number;
|
|
62
|
+
/** The chart's bar interval in ms. */
|
|
63
|
+
intervalMs: number;
|
|
64
|
+
/** The chart is index-mode (a stock, forex, commodity or DEX chart): only a `global` lane is
|
|
65
|
+
* planned there, and the chart's coin is not a crypto asset a lane may default to. */
|
|
66
|
+
indexMode: boolean;
|
|
67
|
+
/** The chart's venue is a crypto venue (a DEX pool is one AND index-mode), as the predicate the
|
|
68
|
+
* run pass injects answers it; undefined when no predicate was injected. A refusal's copy
|
|
69
|
+
* follows it: "it comes from crypto markets" only on `false`, the neutral market words
|
|
70
|
+
* otherwise. */
|
|
71
|
+
cryptoVenue?: boolean;
|
|
72
|
+
/** The run is an OpenMarket package's (`isOfficialWrunOverlay`, read at the run's wall door), handed to an
|
|
73
|
+
* `opra` lane's plan (and every row lane's). Absent reads false (fail closed). */
|
|
74
|
+
official?: boolean;
|
|
75
|
+
/** The `opra-user-scripts` flag opened the OPRA plane to the run (`isOpraUserScriptRun`), handed like
|
|
76
|
+
* `official`. Absent reads false. With `official`, the one OPRA decision (`mayReadOpra`): an `opra` lane is
|
|
77
|
+
* refused before its `plan` runs for a run it says no to, so a lane reads these only for its own choices. */
|
|
78
|
+
opraUserScripts?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* How a lane's rows land on the chart grid:
|
|
82
|
+
* - `'bar'`: rows are stamped at the chart's bar opens; an input exact-joins its bar under the
|
|
83
|
+
* `missing` policy (the join every scalar lane uses).
|
|
84
|
+
* - `{ kind: 'daily', landing }`: rows are one per UTC day whatever the chart's interval (the
|
|
85
|
+
* lane asks `1d` unless `interval` says otherwise), landed by the daily-lane rules
|
|
86
|
+
* (wrun-daily-lane.util): `sum` for flows, `last` for levels. `lookbackDays` opens the full
|
|
87
|
+
* run's fetch that many days before the chart window, so a `last` series reported weekly or
|
|
88
|
+
* monthly still has the observation standing at the window's head. Every live reconcile
|
|
89
|
+
* re-asks the same number of days before its own window, so it is also the publication-lag
|
|
90
|
+
* horizon: a row published that long after its stamp date still reaches a live session.
|
|
91
|
+
*/
|
|
92
|
+
export type WrunPollLaneJoin = 'bar' | {
|
|
93
|
+
kind: 'daily';
|
|
94
|
+
landing: WrunDailyLanding;
|
|
95
|
+
lookbackDays?: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* How a per-bar NATIVE-ROWS lane (`nativeRows`) lands its rows on the host chart's bars (UW-PARITY source
|
|
99
|
+
* contract v2, rule 9): its asks return the control's own stamps (a tier's buckets), which the host lands on
|
|
100
|
+
* the chart's bar grid (`liveBucketStartMs` over the chart's bar-grid venue: a regular-session stock chart's
|
|
101
|
+
* 09:30-anchored bars, the UTC floor elsewhere), summed for a `flow`, the newest sealed row for a `snapshot`
|
|
102
|
+
* (wrun-tier-grid.util). `tiers` (the backend tiers the series is stored at, each with its retention) puts
|
|
103
|
+
* the asks under the tier rule: each bar is read from the finest tier that fits it and still retains it, one
|
|
104
|
+
* ask per run of bars on a tier, the tier's key in the ask's payload (`tier`); a bar no tier retains reads
|
|
105
|
+
* no row (the input's `missing` policy). Absent: one ask, the rows as the control answers them.
|
|
106
|
+
*/
|
|
107
|
+
export interface WrunPollLaneBarGrid {
|
|
108
|
+
landing: WrunTierLanding;
|
|
109
|
+
tiers?: readonly WrunBackendTier[];
|
|
110
|
+
}
|
|
111
|
+
/** What `plan` returns: the payload fields beyond the current-market placeholders (`symbol:
|
|
112
|
+
* 'currentSymbol'`, `exchange: 'currentExchange'`), or nothing when the placeholders are the
|
|
113
|
+
* whole ask. `coin: 'currentCoin'` is a placeholder the chart's fetch resolves too. */
|
|
114
|
+
export type WrunPollLaneExtras = Readonly<Record<string, unknown>>;
|
|
115
|
+
/** One ask of a lane's own `fetch`: the full run's, or a live reconcile's. */
|
|
116
|
+
export interface WrunPollLaneFetchAsk {
|
|
117
|
+
/** The instance's payload extras, as `plan` answered them (a reconcile hands the run's recorded
|
|
118
|
+
* acquisition, the current-market placeholders beside them). */
|
|
119
|
+
extras: Readonly<Record<string, unknown>>;
|
|
120
|
+
/** The first chart-bar open the ask covers, ms. */
|
|
121
|
+
fromTs: number;
|
|
122
|
+
/** The last chart-bar open the ask covers, ms, inclusive (a reconcile's: the forming bar's end). */
|
|
123
|
+
toTs: number;
|
|
124
|
+
/** The grid's bar interval, ms (the run interval on a run at another interval). */
|
|
125
|
+
intervalMs: number;
|
|
126
|
+
/** Told, once the answer is in, whether it is the whole window: true when the source said nothing more follows,
|
|
127
|
+
* false when the answer ended early (the source named more without a way to it). A lane that cannot tell never
|
|
128
|
+
* calls it; a caller that needs the verdict (a wrun prefix page) reads its absence as not whole. */
|
|
129
|
+
onComplete?: (complete: boolean) => void;
|
|
130
|
+
}
|
|
131
|
+
/** A lane's live channel (`WrunPollLane.live`; contract in `wrun-series-stream.util.ts`): its ask,
|
|
132
|
+
* its sink (rows on the grid's bar opens, reopens, spans it cannot vouch for, re-plans) and its
|
|
133
|
+
* open handle. */
|
|
134
|
+
export interface WrunPollLaneLiveAsk {
|
|
135
|
+
extras: Readonly<Record<string, unknown>>;
|
|
136
|
+
intervalMs: number;
|
|
137
|
+
newestTs: number | null;
|
|
138
|
+
}
|
|
139
|
+
export interface WrunPollLaneLiveSink {
|
|
140
|
+
rows(rows: readonly ArrayLike<number>[]): void;
|
|
141
|
+
reopened(): void;
|
|
142
|
+
stale(fromTs: number): void;
|
|
143
|
+
replan(): void;
|
|
144
|
+
}
|
|
145
|
+
export interface WrunPollLaneLiveSubscription {
|
|
146
|
+
unsubscribe(): void;
|
|
147
|
+
isUp(): boolean;
|
|
148
|
+
}
|
|
149
|
+
export interface WrunPollLane {
|
|
150
|
+
/** The kit source class this lane serves. Its file is named `<sourceClass>.ts`. */
|
|
151
|
+
sourceClass: string;
|
|
152
|
+
/** Unique in the registry (lower snake case): the stem of the lane's fetch key and of its
|
|
153
|
+
* row buffer's key. */
|
|
154
|
+
laneKey: string;
|
|
155
|
+
/** The kScript source type the chart's fetch rides (`deribit_volatility_index` asks the
|
|
156
|
+
* `K_DERIBIT_VOLATILITY_INDEX` control). A lane with its own `fetch` rides no K control: its
|
|
157
|
+
* `kType` only names the lane where a K type would be printed (the degrade chips, the "data is
|
|
158
|
+
* unavailable" sentence). */
|
|
159
|
+
kType: string;
|
|
160
|
+
/** The fields this lane serves, each with its lane row column (column 0 is the ts). A field
|
|
161
|
+
* of the class no lane names refuses by name, listing the served ones. */
|
|
162
|
+
fields: Readonly<Record<string, number>>;
|
|
163
|
+
/**
|
|
164
|
+
* Validate one input against the chart BEFORE any fetch and answer the payload fields its
|
|
165
|
+
* ask carries, or refuse by name (`refuseWrunPollInput`). May be async (a metadata lookup).
|
|
166
|
+
* Inputs whose answers are equal share ONE fetch and one buffer; inputs whose answers differ
|
|
167
|
+
* (two venues, two assets) fetch separately.
|
|
168
|
+
*/
|
|
169
|
+
plan(source: WrunPollLaneSource, ctx: WrunPollLaneContext): WrunPollLaneExtras | void | Promise<WrunPollLaneExtras | void>;
|
|
170
|
+
join: WrunPollLaneJoin;
|
|
171
|
+
/** A fixed fetch interval (an `Intervals.map_unit` key such as `'1d'`) when the lane does
|
|
172
|
+
* not ask the chart's own; a daily join asks `'1d'` without naming it. The K control must
|
|
173
|
+
* honor `settings.interval` (as `k-etf-flow.control.ts` does). */
|
|
174
|
+
interval?: string;
|
|
175
|
+
/** The series' name in the "data is unavailable" refusal (`<label> data is unavailable for
|
|
176
|
+
* '<indicator>' ...`), a noun phrase with a leading capital. */
|
|
177
|
+
label: string;
|
|
178
|
+
/**
|
|
179
|
+
* The lane's series names its own subject (a publisher's series, a token's supply, a venue's
|
|
180
|
+
* asset) and reads nothing of the chart's market, so it is served on EVERY chart, index-mode
|
|
181
|
+
* ones included (a stock, a forex pair, a commodity, a DEX pool), where a lane reading the
|
|
182
|
+
* chart's market refuses by name. Its asks ride the chart fetch's native-rows path (the asked
|
|
183
|
+
* window stands, the control's own rows return), and it must be a DAILY join: the landing is
|
|
184
|
+
* by UTC day whatever grid the chart's bars sit on (the registry refuses a `bar` join here).
|
|
185
|
+
*/
|
|
186
|
+
global?: true;
|
|
187
|
+
/**
|
|
188
|
+
* The lane reads the chart's own market from ANOTHER plane's rows (a stock chart's US options), so its asks
|
|
189
|
+
* ride the chart fetch's native-rows path (the asked window stands, the control's own stamps return) and it
|
|
190
|
+
* is admitted on an index-mode chart too, where a lane reading the chart's market is refused. Per bar such a
|
|
191
|
+
* lane lands itself on the host bar grid (`barGrid`, required); with a daily join it keeps the daily landing
|
|
192
|
+
* (by UTC day, any grid; a stock's daily options statistics), no `barGrid`. The registry refuses it on a
|
|
193
|
+
* `global` lane (that one rides native rows already) and with its own `fetch`.
|
|
194
|
+
*/
|
|
195
|
+
nativeRows?: true;
|
|
196
|
+
/** The host-grid landing of a per-bar `nativeRows` lane (required there, refused on any other lane). */
|
|
197
|
+
barGrid?: WrunPollLaneBarGrid;
|
|
198
|
+
/**
|
|
199
|
+
* The lane reads US options data (the OPRA plane): an input of it is refused by name before its `plan`
|
|
200
|
+
* runs for a run that may not read OPRA (`opra-official-only:<class>`, wrun-opra-lane.util), its asks name
|
|
201
|
+
* the plane and their routed tier, the run stamps the overlay's OPRA provenance before the first ask, and
|
|
202
|
+
* the legend names a delayed tier.
|
|
203
|
+
*/
|
|
204
|
+
opra?: true;
|
|
205
|
+
/**
|
|
206
|
+
* The record each refusal BY NAME its K control's worker twin may answer (wrun-lane-refusal.leaf: a backend switch
|
|
207
|
+
* that keeps the read off, a series the data plane samples for a configured list only), by its code. The run
|
|
208
|
+
* degrades such an answer terminally under the lane's label and shows this seed (`feed` is the lane key unless the
|
|
209
|
+
* seed names one; the severity follows the run's hold); a code without a seed reads the lane's no-answer record.
|
|
210
|
+
*/
|
|
211
|
+
refusedAnswers?: Readonly<Record<string, WrunRefusalSeed>>;
|
|
212
|
+
/**
|
|
213
|
+
* The lane's OWN fetch, for a series no K control serves (a relay feed): one ask over chart-bar
|
|
214
|
+
* opens, answered as lane rows `[ts_ms, ...columns]`, ascending. When present the full run asks
|
|
215
|
+
* it in place of the chart's fetch, everything else of a poll lane unchanged (the plan before
|
|
216
|
+
* it, the instance grouping, the acquisition record, a settings save's held buffer, the
|
|
217
|
+
* deadline, the empty-answer and valueless-field rules); `interval` and the native-rows path do
|
|
218
|
+
* not apply, the lane reads its interval off the ask. It refuses nothing: a declaration is
|
|
219
|
+
* judged in `plan`, before any fetch, and a rejection degrades the lane like a failed K fetch.
|
|
220
|
+
* The live tick's poll reconcile asks it the same way over its window, the run's recorded
|
|
221
|
+
* payload as the extras (wrun-live-tick.util `fetchWrunPollLaneReconcile`).
|
|
222
|
+
*/
|
|
223
|
+
fetch?: (ask: WrunPollLaneFetchAsk) => Promise<ArrayLike<number>[]>;
|
|
224
|
+
/**
|
|
225
|
+
* The lane's own poll period for one instance (its planned extras), ms: a ROUTINE live poll
|
|
226
|
+
* re-asks the instance only once its last answer is this old, or while its coverage is behind
|
|
227
|
+
* (a failed or missing answer keeps asking); a session start, a main jump and a wake re-ask it
|
|
228
|
+
* whatever the pace. For a series with a publication cadence of its own (a relay feed), which
|
|
229
|
+
* the chart's poll cycle would otherwise ask several times a minute. Absent: every routine poll
|
|
230
|
+
* re-asks it.
|
|
231
|
+
*/
|
|
232
|
+
pollIntervalMs?: (extras: Readonly<Record<string, unknown>>) => number;
|
|
233
|
+
/** The lane's own live channel (a relay feed's stream), opened per instance at every session
|
|
234
|
+
* install: its rows fold without a fetch, a routine poll waits while it is up. `subscribe`
|
|
235
|
+
* answers at once and imports its transport inside (`wrun-series-stream.util.ts`). */
|
|
236
|
+
live?: {
|
|
237
|
+
subscribe(ask: WrunPollLaneLiveAsk, sink: WrunPollLaneLiveSink): WrunPollLaneLiveSubscription;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/** What a lane file may export: one lane, several, or both. */
|
|
241
|
+
export interface WrunPollLaneModule {
|
|
242
|
+
lane?: WrunPollLane;
|
|
243
|
+
lanes?: readonly WrunPollLane[];
|
|
244
|
+
}
|
|
245
|
+
/** The id of one lane INSTANCE (a lane under one set of payload extras): its row buffer's key,
|
|
246
|
+
* its fetch-key suffix and its live lane name. The prefix keeps it apart from the row
|
|
247
|
+
* builder's own lanes wherever lanes are keyed together. */
|
|
248
|
+
export type WrunPollLaneId = `poll:${string}`;
|
|
249
|
+
export declare const WRUN_POLL_LANE_ID_PREFIX = "poll:";
|
|
250
|
+
export declare function isWrunPollLaneId(value: unknown): value is WrunPollLaneId;
|
|
251
|
+
/** One planned lane instance of a run: plain data (the live context keeps it for the poll
|
|
252
|
+
* reconcile and the reseed); the descriptor is looked up by `laneKey`. */
|
|
253
|
+
export interface WrunPollLaneInstance {
|
|
254
|
+
key: WrunPollLaneId;
|
|
255
|
+
sourceClass: string;
|
|
256
|
+
laneKey: string;
|
|
257
|
+
/** The payload fields `plan` answered (empty when it answered none). */
|
|
258
|
+
extras: Record<string, unknown>;
|
|
259
|
+
/** The inputs reading this instance, by index, ascending. */
|
|
260
|
+
inputIndexes: number[];
|
|
261
|
+
}
|
|
262
|
+
/** Refuse an input by name: `Input '<name>' (<class>) <reason>`. The one spelling every lane's
|
|
263
|
+
* pre-fetch refusal uses, so the legend card reads the same across sources. The text is the
|
|
264
|
+
* technical half (Copy details); `seed` is the refusal record's seed the surfaces word it by
|
|
265
|
+
* (`attachWrunRefusal`, the nearest raiser wins): a coin gate names the lane key, its coin list
|
|
266
|
+
* and the chart's coin, an interval gate the bound, an unserved feed its lane key. An unseeded
|
|
267
|
+
* refusal reads as a failed run. */
|
|
268
|
+
export declare function refuseWrunPollInput(ctx: Pick<WrunPollLaneContext, 'inputName' | 'sourceClass'>, reason: string, seed?: WrunRefusalSeed): never;
|
|
269
|
+
/** The seed of a coin gate: the lane's feed (its lane key) exists for `coins` only, and the chart's
|
|
270
|
+
* coin is another. A chart that names no coin has no such feed at all (the market words), so a
|
|
271
|
+
* sentence never ends on an empty coin. */
|
|
272
|
+
export declare function wrunPollCoinGateSeed(feed: string, coins: readonly string[], chartCoin: string): WrunRefusalSeed;
|
|
273
|
+
/** The seed of a gate the author fixes in the code (a knob word, a fund the coin does not list): a
|
|
274
|
+
* failed run, its text in the details. */
|
|
275
|
+
export declare const WRUN_POLL_AUTHOR_GATE_SEED: WrunRefusalSeed;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { attachWrunRefusal } from '../wrun-refusal.util.js';
|
|
2
|
+
export const WRUN_POLL_LANE_ID_PREFIX = 'poll:';
|
|
3
|
+
export function isWrunPollLaneId(value) {
|
|
4
|
+
return typeof value === 'string' && value.startsWith(WRUN_POLL_LANE_ID_PREFIX);
|
|
5
|
+
}
|
|
6
|
+
/** Refuse an input by name: `Input '<name>' (<class>) <reason>`. The one spelling every lane's
|
|
7
|
+
* pre-fetch refusal uses, so the legend card reads the same across sources. The text is the
|
|
8
|
+
* technical half (Copy details); `seed` is the refusal record's seed the surfaces word it by
|
|
9
|
+
* (`attachWrunRefusal`, the nearest raiser wins): a coin gate names the lane key, its coin list
|
|
10
|
+
* and the chart's coin, an interval gate the bound, an unserved feed its lane key. An unseeded
|
|
11
|
+
* refusal reads as a failed run. */
|
|
12
|
+
export function refuseWrunPollInput(ctx, reason, seed) {
|
|
13
|
+
const error = new Error(`Input '${ctx.inputName}' (${ctx.sourceClass}) ${reason}`);
|
|
14
|
+
throw seed === undefined ? error : attachWrunRefusal(error, seed);
|
|
15
|
+
}
|
|
16
|
+
/** The seed of a coin gate: the lane's feed (its lane key) exists for `coins` only, and the chart's
|
|
17
|
+
* coin is another. A chart that names no coin has no such feed at all (the market words), so a
|
|
18
|
+
* sentence never ends on an empty coin. */
|
|
19
|
+
export function wrunPollCoinGateSeed(feed, coins, chartCoin) {
|
|
20
|
+
if (chartCoin === '')
|
|
21
|
+
return { cls: 'feed-missing', variant: 'market-paused', params: { feed } };
|
|
22
|
+
return { cls: 'coin-outside-feed', params: { feed, coins: coins.join(', '), coin: chartCoin } };
|
|
23
|
+
}
|
|
24
|
+
/** The seed of a gate the author fixes in the code (a knob word, a fund the coin does not list): a
|
|
25
|
+
* failed run, its text in the details. */
|
|
26
|
+
export const WRUN_POLL_AUTHOR_GATE_SEED = Object.freeze({ cls: 'run-failed', variant: 'generic' });
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generic half of every registry poll lane (`wrun-poll-lane.types.ts` is the contract a
|
|
3
|
+
* lane file keeps, `registry.ts` the discovery): what the run pass, the row builder and the
|
|
4
|
+
* live tick ask of a lane, written once over the descriptor, so no consumer names a lane.
|
|
5
|
+
*
|
|
6
|
+
* - `planWrunPollLaneInputs`: the STATIC plan, from the sheet alone. Each input of a registry
|
|
7
|
+
* class gets the lane serving its field and that field's column; a celled input and a field
|
|
8
|
+
* no lane serves refuse by name. The row builder runs it before any row, the run pass before
|
|
9
|
+
* any fetch.
|
|
10
|
+
* - `planWrunPollLanes`: the run's plan against the chart, before any fetch. Each input's
|
|
11
|
+
* `plan()` answers its payload extras (or refuses by name); inputs with equal extras share
|
|
12
|
+
* ONE lane instance (one fetch, one buffer), inputs with different extras get their own. On
|
|
13
|
+
* an index-mode chart (US stocks, forex, commodities, DEX) the chart's fetch never serves a
|
|
14
|
+
* lane that reads the chart's market: an input of one that declared a missing fill is dropped
|
|
15
|
+
* from planning and named in `missingFeeds` (the run draws, a note says which feed), any other
|
|
16
|
+
* refuses by name before its lane's `plan` runs; a `global` lane (a series naming its own
|
|
17
|
+
* subject) is planned there like anywhere. `planWrunPollLaneInstances` is the lanes alone.
|
|
18
|
+
* - `wrunPollLaneRequired`: the empty-answer rule. An instance must answer rows unless every
|
|
19
|
+
* input reading it declares `missing: "nan"` or `"zero"` (the funding rule, generalized:
|
|
20
|
+
* `wrunLaneRowsRequired`).
|
|
21
|
+
* - `wrunPollLaneValuelessInput`: the same rule per field. An answer with rows but no finite
|
|
22
|
+
* value in the column an input on the default carry policy reads has nothing to carry
|
|
23
|
+
* either: the run pass refuses with the lane's label and the field named.
|
|
24
|
+
* - the fetch shape: the lane's own interval (`wrunPollLaneFetchInterval`: a fixed one, `1d`
|
|
25
|
+
* for a daily join, else the chart's) and, for a `global` lane, the native-rows path
|
|
26
|
+
* (`wrunPollLaneFetchOptions`), the full run's window start and end
|
|
27
|
+
* (`wrunPollLaneFetchFrom`, `wrunPollLaneFetchTo`) and the reconcile's start
|
|
28
|
+
* (`wrunPollLaneReconcileFrom`).
|
|
29
|
+
*/
|
|
30
|
+
import type { WrunIndicatorMetadata, WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
|
|
31
|
+
import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
|
|
32
|
+
import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
33
|
+
import { type WrunPollLane, type WrunPollLaneContext, type WrunPollLaneId, type WrunPollLaneInstance } from './wrun-poll-lane.types.js';
|
|
34
|
+
import type { WrunMissingFeed } from '../wrun-run-health.util.js';
|
|
35
|
+
import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
|
|
36
|
+
/** One input of a registry class under the static plan. */
|
|
37
|
+
export interface WrunPollLaneInput {
|
|
38
|
+
inputIndex: number;
|
|
39
|
+
inputName: string;
|
|
40
|
+
source: WrunInputSource;
|
|
41
|
+
/** The lane serving the input's field. */
|
|
42
|
+
lane: WrunPollLane;
|
|
43
|
+
/** The lane row column the field reads. */
|
|
44
|
+
column: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The static plan: every input whose class the registry serves, in declaration order, with the
|
|
48
|
+
* lane serving its field and the field's column. Refused by name: a celled input (poll lanes
|
|
49
|
+
* are scalar) and a field no lane of the class serves (the message lists the served ones).
|
|
50
|
+
* Empty when the sheet reads no registry class.
|
|
51
|
+
*/
|
|
52
|
+
export declare function planWrunPollLaneInputs(metadata: WrunIndicatorMetadata): WrunPollLaneInput[];
|
|
53
|
+
/** A value's canonical text: object keys sorted at every depth, `undefined` members dropped (the instance key's
|
|
54
|
+
* suffix, here and for the row lanes). */
|
|
55
|
+
export declare function stableJson(value: unknown): string;
|
|
56
|
+
/** The id of the lane instance `extras` names: `poll:<laneKey>` when the ask carries no extras,
|
|
57
|
+
* else the extras' canonical text appended, so equal asks are ONE instance whatever order
|
|
58
|
+
* their fields were written in and different asks never collide. */
|
|
59
|
+
export declare function wrunPollLaneInstanceKey(laneKey: string, extras: Readonly<Record<string, unknown>>): WrunPollLaneId;
|
|
60
|
+
/** Why a lane reading the chart's market is not served on an index-mode chart, as its refusal
|
|
61
|
+
* says it: such a chart serves candles, time and the global series (named by class). */
|
|
62
|
+
export declare function wrunPollLaneIndexModeReason(): string;
|
|
63
|
+
/** What the run hands the poll planner beside the chart: its OPRA facts (`mayReadOpra`: who may read the plane)
|
|
64
|
+
* and the predicate an `opra` lane is admitted by (`isOpraPlaneExchange`: the chart's options ride the OPRA plane,
|
|
65
|
+
* a US stock or ETF chart under either venue spelling while the `opra` flag is lit, an OPRA contract chart; absent,
|
|
66
|
+
* no chart is judged off the plane). */
|
|
67
|
+
export interface WrunPollLaneRunFacts extends OpraReadFacts {
|
|
68
|
+
isOpraPlaneExchange?: (exchange: string) => boolean;
|
|
69
|
+
/** Why a chart off the plane is off it although its options list on OPRA (opra-options-gate.util
|
|
70
|
+
* `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, the market's own
|
|
71
|
+
* words ("no such feed here"). */
|
|
72
|
+
opraPlaneStop?: (exchange: string) => OpraOptionPlaneStop | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** The technical words of an OPRA lane a known stop keeps off the chart (Copy details), by the stop's reason. */
|
|
75
|
+
export declare function wrunOpraPlaneStopDetail(stop: OpraOptionPlaneStop): string;
|
|
76
|
+
/** The run's plan against the chart (WRUN-REFUSALS contract): the lane instances to fetch, and
|
|
77
|
+
* the feeds the chart's fetch never serves to inputs that declared a missing fill (one entry per
|
|
78
|
+
* lane key, its inputs in declaration order). */
|
|
79
|
+
export interface WrunPollLanePlan {
|
|
80
|
+
lanes: WrunPollLaneInstance[];
|
|
81
|
+
missingFeeds: WrunMissingFeed[];
|
|
82
|
+
}
|
|
83
|
+
/** What `planWrunPollLanes` answers: the plan, which is ALSO its `lanes` array (`lanes` and
|
|
84
|
+
* `missingFeeds` are non-enumerable members of that array), so a caller written against the
|
|
85
|
+
* array keeps working while every new caller reads `lanes` and `missingFeeds`. Compare the
|
|
86
|
+
* members, never the whole value, with a deep equality. */
|
|
87
|
+
export type WrunPollLanePlanResult = WrunPollLanePlan & WrunPollLaneInstance[];
|
|
88
|
+
/**
|
|
89
|
+
* The run's plan against the chart, before any fetch: every registry input's `plan()` in
|
|
90
|
+
* declaration order (the first refusal by name wins, like every other pre-fetch refusal),
|
|
91
|
+
* grouped into lane instances by lane and payload extras. Empty when the sheet reads no
|
|
92
|
+
* registry class.
|
|
93
|
+
*
|
|
94
|
+
* On an index-mode chart (US stocks, forex, commodities, DEX: `isIndexModeExchange` answers for
|
|
95
|
+
* the chart's exchange) the chart's fetch answers nothing for a source other than candles asked
|
|
96
|
+
* on the chart's own exchange, so a lane that reads the chart's market is not served there (the
|
|
97
|
+
* capability evidence, never an empty window):
|
|
98
|
+
* - an input of such a lane that declares `missing: "nan"` or `"zero"` is dropped from planning
|
|
99
|
+
* (its lane's `plan` never runs, no fetch) and named in `missingFeeds` under its lane key: the
|
|
100
|
+
* row builder hands it an empty lane, so it reads its fill on every bar and the run draws;
|
|
101
|
+
* - any other input of such a lane (the default `carry` policy has nothing to carry) refuses by
|
|
102
|
+
* name (`wrunPollLaneIndexModeReason`), seeded `feed-missing` with its lane key.
|
|
103
|
+
* Both say "it comes from crypto markets" only when the chart is provably no crypto venue
|
|
104
|
+
* (`isCryptoVenueExchange` answers false; a DEX pool is index-mode AND a crypto venue), the
|
|
105
|
+
* neutral market words otherwise.
|
|
106
|
+
*
|
|
107
|
+
* A `global` lane (a series naming its own subject: a publisher's series, a token's supply, a
|
|
108
|
+
* venue's asset) is planned there like anywhere; its asks ride the fetch's native-rows path
|
|
109
|
+
* (`wrunPollLaneFetchOptions`), so the asked window stands and the control's own rows return
|
|
110
|
+
* instead of the chart's span re-stamped onto its sparse bars, and its daily landing finds the
|
|
111
|
+
* day's first bar on a session grid (wrun-daily-lane.util). The chart's index-mode verdict
|
|
112
|
+
* reaches each lane's `plan` as `ctx.indexMode`, the venue verdict as `ctx.cryptoVenue`.
|
|
113
|
+
*
|
|
114
|
+
* A `nativeRows` lane (a per-bar series of the chart's own market read from another plane: a stock
|
|
115
|
+
* chart's US options) is planned there too: its asks ride the native-rows path and land on the host
|
|
116
|
+
* bar grid (`barGrid`).
|
|
117
|
+
*
|
|
118
|
+
* An `opra` lane (US options data) is refused by name before its lane's `plan` runs for a run that may
|
|
119
|
+
* not read the OPRA plane (`mayReadOpra` over `run`: an official package always, a draft or community
|
|
120
|
+
* package only under the `opra-user-scripts` flag; absent reads closed): `opra-official-only:<class>`.
|
|
121
|
+
* It is served only where the chart's options ride the plane (`run.isOpraPlaneExchange`): on any other chart
|
|
122
|
+
* an input of it that declared a missing fill is dropped like an index-mode one, any other refuses by name.
|
|
123
|
+
* A chart whose options list on OPRA but ride no plane for a known reason (`run.opraPlaneStop`: the `opra`
|
|
124
|
+
* flag dark, `flag-off`; an index chart the router sends no OPRA read for, `chart-kind`) says that reason in the
|
|
125
|
+
* note and in the refusal (`options-stopped`), never "this market has no such feed".
|
|
126
|
+
* The run's facts reach an `opra` lane's `plan` as `ctx.official` and `ctx.opraUserScripts`.
|
|
127
|
+
*
|
|
128
|
+
* An input the market leaves undemanded (its `needed_by` leaves the market out, wrunSheetWithLaneDemand) is planned
|
|
129
|
+
* nowhere, before all of the above: no wall, no admission, no `plan`, no fetch, no note; the row builder reads its
|
|
130
|
+
* fill on every bar.
|
|
131
|
+
*
|
|
132
|
+
* The predicates are injected (the run pass hands the chart's own `checkIsIndexMode` and its
|
|
133
|
+
* crypto-venue rule), so this module, which the row builder imports, stays off those modules'
|
|
134
|
+
* import graphs; without one no chart reads as index-mode, and without the other the venue is
|
|
135
|
+
* unknown (the neutral words).
|
|
136
|
+
*/
|
|
137
|
+
export declare function planWrunPollLanes(metadata: WrunIndicatorMetadata, chart: Pick<WrunPollLaneContext, 'coin' | 'exchange' | 'symbol' | 'intervalMs'>, isIndexModeExchange?: (exchange: string) => boolean, isCryptoVenueExchange?: (exchange: string) => boolean, run?: WrunPollLaneRunFacts): Promise<WrunPollLanePlanResult>;
|
|
138
|
+
/** The lane instances of `planWrunPollLanes` alone (the array every caller that plans no notes
|
|
139
|
+
* reads): the same plan, the same refusals by name, an input that declared a missing fill on an
|
|
140
|
+
* index-mode chart dropped. */
|
|
141
|
+
export declare function planWrunPollLaneInstances(metadata: WrunIndicatorMetadata, chart: Pick<WrunPollLaneContext, 'coin' | 'exchange' | 'symbol' | 'intervalMs'>, isIndexModeExchange?: (exchange: string) => boolean, isCryptoVenueExchange?: (exchange: string) => boolean, run?: WrunPollLaneRunFacts): Promise<WrunPollLaneInstance[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Whether a lane must answer rows for the package: true when any input reading it (`reads`)
|
|
144
|
+
* rides the default carry policy (an absent series has nothing to carry, so an empty lane
|
|
145
|
+
* refuses loud); when every such input declares `missing: "nan"` or `"zero"` the lane stays
|
|
146
|
+
* quiet and the inputs read that fill. The funding lane's rule, for any lane.
|
|
147
|
+
*/
|
|
148
|
+
export declare function wrunLaneRowsRequired(metadata: WrunIndicatorMetadata, reads: (input: WrunIndicatorMetadata['inputs'][number], source: WrunInputSource) => boolean): boolean;
|
|
149
|
+
/** `wrunLaneRowsRequired` for one registry lane instance (the inputs it serves). */
|
|
150
|
+
export declare function wrunPollLaneRequired(metadata: WrunIndicatorMetadata, instance: Pick<WrunPollLaneInstance, 'inputIndexes'>): boolean;
|
|
151
|
+
/**
|
|
152
|
+
* The first input of a lane instance, in declaration order, that rides the default carry policy
|
|
153
|
+
* and whose column holds NO finite value anywhere in the lane's answer (`rows`: the full answer,
|
|
154
|
+
* a daily lane's lookback included, so a series printed once before the chart window passes);
|
|
155
|
+
* undefined when every such input has one. A `null` cell is no value, never 0 (the controls lay
|
|
156
|
+
* `null` where the gateway has none), and a 0 is a value.
|
|
157
|
+
*
|
|
158
|
+
* The empty-answer rule (`wrunPollLaneRequired`) counts rows; this is the same rule per field. A
|
|
159
|
+
* lane can answer a row for every bar and no value for one field (Bitfinex publishes the margin
|
|
160
|
+
* rate for `fUSD` and `fETH`, not `fBTC`; a token's supply row leaves a field the gateway does
|
|
161
|
+
* not hold for it unset): under `carry` the input would read NaN on every bar with no message.
|
|
162
|
+
* An input declaring `missing: "nan"` or `"zero"` has said what an absent value reads as and
|
|
163
|
+
* stays quiet.
|
|
164
|
+
*/
|
|
165
|
+
export declare function wrunPollLaneValuelessInput(metadata: WrunIndicatorMetadata, instance: Pick<WrunPollLaneInstance, 'inputIndexes'>, lane: Pick<WrunPollLane, 'fields'>, rows: ReadonlyArray<ArrayLike<unknown>>): {
|
|
166
|
+
inputName: string;
|
|
167
|
+
field: string;
|
|
168
|
+
} | undefined;
|
|
169
|
+
/** The interval a lane's asks name (the fetch's `interval` option): its fixed one, `1d` for a
|
|
170
|
+
* daily join that names none, undefined for the chart's own. */
|
|
171
|
+
export declare function wrunPollLaneFetchInterval(lane: Pick<WrunPollLane, 'interval' | 'join'>): string | undefined;
|
|
172
|
+
/** The fetch options a lane's asks carry (the full run's and the reconcile's alike): its
|
|
173
|
+
* interval (`wrunPollLaneFetchInterval`) and, for a `global` or a `nativeRows` lane, the native-rows
|
|
174
|
+
* path (the asked window stands and the control's own rows return on an index-mode chart too).
|
|
175
|
+
* Undefined when the ask carries neither (the chart's own interval, the chart's own market). */
|
|
176
|
+
export declare function wrunPollLaneFetchOptions(lane: Pick<WrunPollLane, 'interval' | 'join' | 'global' | 'nativeRows'>): {
|
|
177
|
+
interval?: string;
|
|
178
|
+
nativeRows?: true;
|
|
179
|
+
} | undefined;
|
|
180
|
+
/** Where the full run's ask opens for a chart window opening at `fromTs`: there for a `bar`
|
|
181
|
+
* join, at the first row's day (its `lookbackDays` earlier) for a daily one. */
|
|
182
|
+
export declare function wrunPollLaneFetchFrom(lane: Pick<WrunPollLane, 'join'>, fromTs: number): number;
|
|
183
|
+
/** Where the full run's ask closes for a chart whose last bar opens at `lastBarTs` on a grid of
|
|
184
|
+
* `intervalMs`: at that open for a `bar` join, at that bar's END for a host-grid one (`barGrid`: its
|
|
185
|
+
* rows are a tier's buckets, the forming bar's included); for a daily one at that open on an intraday or
|
|
186
|
+
* daily chart and at the bar's END on a coarser one (`wrunDailyLaneFetchTo`: the forming week
|
|
187
|
+
* or month holds days after its open). */
|
|
188
|
+
export declare function wrunPollLaneFetchTo(lane: Pick<WrunPollLane, 'join' | 'barGrid'>, lastBarTs: number, intervalMs: number, nowMs?: number): number;
|
|
189
|
+
/** Where a reconcile's ask closes for a chart-bar window closing at `toTs`: there for a `bar`
|
|
190
|
+
* join; for a daily one the day after the clock's day when the window closed before it on a
|
|
191
|
+
* chart coarser than a day (`wrunDailyLaneReconcileTo`, the forming bar of a session grid). */
|
|
192
|
+
export declare function wrunPollLaneReconcileTo(lane: Pick<WrunPollLane, 'join'>, toTs: number, intervalMs: number, nowMs: number): number;
|
|
193
|
+
/** Where a reconcile's ask (and its answer's authority) opens for the chart-bar window opening
|
|
194
|
+
* at `fromTs`, in a session whose first row is `sessionFirstRowTs`: at `fromTs` for a `bar`
|
|
195
|
+
* join; for a daily one where the full run's ask would open for that window (its day, the
|
|
196
|
+
* lane's `lookbackDays` earlier), never before the session's own full run opened
|
|
197
|
+
* (`wrunDailyLaneReconcileFrom`). A daily row is often published after its stamp date (a daily
|
|
198
|
+
* rate the next business day, a monthly series weeks later), so the lane's lookback is the
|
|
199
|
+
* publication-lag horizon: a reconcile that opened at the window's own day never fetched such
|
|
200
|
+
* a row, and the live tail kept a value a fresh full run no longer showed. */
|
|
201
|
+
export declare function wrunPollLaneReconcileFrom(lane: Pick<WrunPollLane, 'join'>, fromTs: number, sessionFirstRowTs: number): number;
|
|
202
|
+
/** The payload field a host-grid lane's ask names its backend tier in (`WrunPollLaneBarGrid.tiers`, a tier's
|
|
203
|
+
* `key`): the K control asks that tier. */
|
|
204
|
+
export declare const WRUN_POLL_LANE_TIER_FIELD = "tier";
|
|
205
|
+
/** The chart window a host-grid lane's asks cover: the host bars it lands on, ascending, the chart's bar
|
|
206
|
+
* span and grid, and the clock. */
|
|
207
|
+
export interface WrunHostGridWindow {
|
|
208
|
+
barOpens: readonly number[];
|
|
209
|
+
intervalMs: number;
|
|
210
|
+
barGrid?: LiveBucketVenue | null;
|
|
211
|
+
nowMs: number;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* A lane's rows over a chart window, landed on the host bars when it is a host-grid lane (`barGrid`): its asks
|
|
215
|
+
* under the tier rule (`wrunHostGridAsks` over the window's host bars: one per run of bars on a tier, the
|
|
216
|
+
* tier's key in its extras as `tier`), each answer landed by the lane's landing (`wrunLandScalarRowsOnHostBars`:
|
|
217
|
+
* a flow summed per bar, a snapshot's newest sealed row, sealed by its ask's tier), ascending. A bar no tier
|
|
218
|
+
* retains asks nothing and reads no row. Any other lane is asked once over `[fromTs, toTs]` (`fallback`), its
|
|
219
|
+
* rows as they come. `ask` is the caller's fetch (the full run's, a reconcile's).
|
|
220
|
+
*/
|
|
221
|
+
export declare function fetchWrunPollLaneHostGridRows(lane: Pick<WrunPollLane, 'barGrid'>, extras: Readonly<Record<string, unknown>>, window: WrunHostGridWindow, fallback: {
|
|
222
|
+
fromTs: number;
|
|
223
|
+
toTs: number;
|
|
224
|
+
}, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number) => Promise<ArrayLike<number>[]>): Promise<ArrayLike<number>[]>;
|