@orangecharts/wrun-chart-host 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -8
- 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/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -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 +163 -5
- package/dist/host-ports.types.d.ts +431 -0
- package/dist/host-ports.types.js +1 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +138 -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/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -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/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -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/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +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/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -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 +58 -0
- package/dist/utility/wrun/sources/lanes/option_daily.js +111 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +27 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +21 -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 +215 -0
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +477 -0
- package/dist/utility/wrun/sources/registry.d.ts +21 -0
- package/dist/utility/wrun/sources/registry.js +237 -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 +55 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +126 -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 +62 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +147 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +70 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +144 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +309 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +350 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +576 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +275 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +207 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +450 -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 +49 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +115 -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-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +377 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2251 -0
- 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-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -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-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -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-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
- package/dist/utility/wrun/wrun-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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live Series feeds (LIVE-SERIES-CONTRACTS C4): the shared shapes the chart's
|
|
3
|
+
* feed indicator (U3) and the Feeds dialog (U4) read. A feed is a hosted time
|
|
4
|
+
* series at `@scope/name` on the relay (`LEDGER_API_ENDPOINT`), read through
|
|
5
|
+
* `src/services/feeds.service.ts`. Frozen: a change here is a contract change.
|
|
6
|
+
*/
|
|
7
|
+
/** How a value column combines when a chart zooms out (P3 C7): by name when undeclared. */
|
|
8
|
+
export type FeedCombineRule = 'last' | 'first' | 'max' | 'min' | 'sum' | 'mean';
|
|
9
|
+
/** A numeric value key a feed declares (C1): each row carries one number per key, in order. */
|
|
10
|
+
export interface FeedValueKey {
|
|
11
|
+
key: string;
|
|
12
|
+
/** The column's unit, when declared (P3 C7). */
|
|
13
|
+
unit?: string;
|
|
14
|
+
/** The column's combine rule; the relay resolves the default by name (P3 C7). */
|
|
15
|
+
combine?: FeedCombineRule;
|
|
16
|
+
}
|
|
17
|
+
/** `GET /api/v2/feeds/{scope}/{name}/head`: the feed's newest row and its state at read time. */
|
|
18
|
+
export interface FeedHead {
|
|
19
|
+
address: string;
|
|
20
|
+
version: number;
|
|
21
|
+
cadence_s: number;
|
|
22
|
+
units: string;
|
|
23
|
+
/** The numeric value keys the feed declares, in order (a bars read regroups the first by default). */
|
|
24
|
+
values: FeedValueKey[];
|
|
25
|
+
/** The states the feed declares: non-empty for a state feed, whose rows carry one of them instead
|
|
26
|
+
* of numbers (the relay's own test for a state feed). */
|
|
27
|
+
states: string[];
|
|
28
|
+
last_ts: number | null;
|
|
29
|
+
received_at: number | null;
|
|
30
|
+
rows: number;
|
|
31
|
+
state: 'live' | 'lagging' | 'stale' | 'offline';
|
|
32
|
+
/** P3 C7 head facts (optional until every relay serves them). */
|
|
33
|
+
tier?: 'free' | 'plus' | 'request';
|
|
34
|
+
/** Readings the feed keeps before the oldest drop (the tier's cap). */
|
|
35
|
+
cap?: number;
|
|
36
|
+
/** The storage grain in seconds: one reading kept per slot of this length. */
|
|
37
|
+
floor_s?: number;
|
|
38
|
+
/** The oldest stored reading's stamp, null for an empty feed. */
|
|
39
|
+
first_ts?: number | null;
|
|
40
|
+
/** The median gap of the newest 50 stored readings (the stored cadence), null under 2 rows. */
|
|
41
|
+
observed_cadence_s?: number | null;
|
|
42
|
+
/** True when the feed is published at its cadence only: no coarser bars. */
|
|
43
|
+
exact_interval?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** One row on the wire (C1): `[ts_seconds, v1..vN]`, or `[ts_seconds, state]` for a state feed. */
|
|
46
|
+
export type FeedWireRow = [number, ...(number | string | null)[]];
|
|
47
|
+
/** One bar on the wire (C2): `[bucket_ts, open, high, low, close, count]`, or `[bucket_ts, last_state, count]`. */
|
|
48
|
+
export type FeedWireBar = [number, ...(number | string | null)[]];
|
|
49
|
+
/** `GET /api/v2/feeds/{scope}/{name}/record` plus the registry's install and reader counts. */
|
|
50
|
+
export interface FeedRecord {
|
|
51
|
+
uptime_30d: number | null;
|
|
52
|
+
median_lag_s: number | null;
|
|
53
|
+
installs: number | null;
|
|
54
|
+
read_by: number | null;
|
|
55
|
+
}
|
|
56
|
+
/** Who reads a feed (C2, P3 C12): anyone; its owner (and the viewers of a chart of the owner's that pins it); or the
|
|
57
|
+
* members of one room or space its owner owns (a chart that pins it opens it to no one else). */
|
|
58
|
+
export type FeedVisibility = 'public' | 'private' | 'members';
|
|
59
|
+
/** The room or space whose members read a `members` feed (P3 C12): a room id, or a space's slug. */
|
|
60
|
+
export interface FeedMembersOf {
|
|
61
|
+
kind: 'room' | 'space';
|
|
62
|
+
id: string;
|
|
63
|
+
}
|
|
64
|
+
/** One `live-series` row of the registry search, or one feed of the relay's shared listing (P3 C12), as the dialog
|
|
65
|
+
* lists it and the mount seam reads it. */
|
|
66
|
+
export interface FeedCatalogEntry {
|
|
67
|
+
address: string;
|
|
68
|
+
scope: string;
|
|
69
|
+
name: string;
|
|
70
|
+
title: string;
|
|
71
|
+
cadence_s: number;
|
|
72
|
+
units: string;
|
|
73
|
+
visibility: FeedVisibility;
|
|
74
|
+
/** The room or space a `members` feed is read by; absent on every other feed. */
|
|
75
|
+
members_of?: FeedMembersOf;
|
|
76
|
+
description?: string;
|
|
77
|
+
head?: Pick<FeedHead, 'state' | 'last_ts'>;
|
|
78
|
+
record?: FeedRecord;
|
|
79
|
+
publishedAt?: string;
|
|
80
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live Series feeds (LIVE-SERIES-CONTRACTS C4): the shared shapes the chart's
|
|
3
|
+
* feed indicator (U3) and the Feeds dialog (U4) read. A feed is a hosted time
|
|
4
|
+
* series at `@scope/name` on the relay (`LEDGER_API_ENDPOINT`), read through
|
|
5
|
+
* `src/services/feeds.service.ts`. Frozen: a change here is a contract change.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The engine's market kinds: TitanCharts' `MarketKind` union (`@orangecharts/titan-charts-next`), copied so the market
|
|
3
|
+
* utilities type the kinds they hand the engine without importing it (the wrun chart-host package never reaches the
|
|
4
|
+
* engine: docs/features/kscript/wrun/wrun-chart-host.md, "Narrowing and type pins"). The FE's own vocabulary is
|
|
5
|
+
* `VenueMarketKind` (utility/chart/marketKind.util.ts), which narrows to this union through `toTitanMarketKind`.
|
|
6
|
+
* tests/interfaces/market-kind.interface.spec.ts pins the copy to the installed engine's union, both ways.
|
|
7
|
+
*/
|
|
8
|
+
export type MarketKind = 'crypto' | 'tradfi' | 'forex' | 'commodity' | 'dex' | 'polymarket' | 'fred' | 'hip3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type { CancelFeedback } from './cancel-reason.interface.js';
|
|
2
|
+
/**
|
|
3
|
+
* OPRA (US equity and index options) governed plane: the exchange catalog the
|
|
4
|
+
* plane keys on. Deliberately separate from `CME_EXCHANGE_CATALOG`: that
|
|
5
|
+
* catalog is also the CME Stripe bundle, the Surface A guest snapshot and the
|
|
6
|
+
* futures session lattice, none of which apply to OPRA. Billing DTOs for the
|
|
7
|
+
* OPRA add-on live here too once the backend twin of `/cme/*` exists.
|
|
8
|
+
*/
|
|
9
|
+
export type OpraGovernedExchange = 'OPRA';
|
|
10
|
+
/** Every OPRA-governed exchange code (one consolidated venue by design). */
|
|
11
|
+
export declare const OPRA_GOVERNED_EXCHANGES: readonly OpraGovernedExchange[];
|
|
12
|
+
/** OPRA defines delayed data as at least 15 minutes old; the gate's delayed window matches. */
|
|
13
|
+
export declare const OPRA_DELAY_MINUTES = 15;
|
|
14
|
+
/** The one OPRA plan: real-time top of book, billed monthly. */
|
|
15
|
+
export declare const OPRA_REALTIME_MONTHLY_USD = 4.95;
|
|
16
|
+
export type OpraBillingInterval = '1m';
|
|
17
|
+
/**
|
|
18
|
+
* Both declarations go to the server: a non-professional one makes the account eligible for real-time, a
|
|
19
|
+
* professional one is recorded too and withdraws real-time eligibility for good (the server cancels an owned
|
|
20
|
+
* subscription and keeps the account on the delayed tier). Never a re-price.
|
|
21
|
+
*/
|
|
22
|
+
export type OpraClassification = 'non_professional' | 'professional';
|
|
23
|
+
export declare const OPRA_ATTESTATION_FORM_VERSION = "opra-v1";
|
|
24
|
+
/**
|
|
25
|
+
* POST /opra/attestation request body (201 for both classifications). The server derives the classification
|
|
26
|
+
* from `answers` and refuses a body whose `classification` disagrees, so the client sends the one
|
|
27
|
+
* `isOpraNonProfessional` reads from the same answers.
|
|
28
|
+
*/
|
|
29
|
+
/** The server's bound on each identity field (`legalName`, `employer`, `occupation`), trimmed. */
|
|
30
|
+
export declare const OPRA_IDENTITY_FIELD_MAX_LENGTH = 200;
|
|
31
|
+
export interface OpraAttestationDto {
|
|
32
|
+
classification: OpraClassification;
|
|
33
|
+
/** Keyed by stable machine question ids, never translated question text. */
|
|
34
|
+
answers: Record<string, unknown>;
|
|
35
|
+
legalName: string;
|
|
36
|
+
employer?: string;
|
|
37
|
+
occupation?: string;
|
|
38
|
+
formVersion: typeof OPRA_ATTESTATION_FORM_VERSION;
|
|
39
|
+
}
|
|
40
|
+
export interface OpraAttestationRecordDto {
|
|
41
|
+
id: number;
|
|
42
|
+
classification: OpraClassification;
|
|
43
|
+
attestedAt: string;
|
|
44
|
+
formVersion: string;
|
|
45
|
+
/**
|
|
46
|
+
* ISO end of the declaration's validity (a year after it was made). Additive: a server that names none
|
|
47
|
+
* leaves the record without a client-side expiry, and the checkout's refusal stays the authority.
|
|
48
|
+
*/
|
|
49
|
+
expiresAt?: string;
|
|
50
|
+
}
|
|
51
|
+
/** GET /opra/attestation -> 200 body. */
|
|
52
|
+
export interface GetOpraAttestationResponseDto {
|
|
53
|
+
attestation: OpraAttestationRecordDto | null;
|
|
54
|
+
}
|
|
55
|
+
/** POST /opra/checkout request body. */
|
|
56
|
+
export interface OpraCheckoutDto {
|
|
57
|
+
interval: OpraBillingInterval;
|
|
58
|
+
locale?: string;
|
|
59
|
+
}
|
|
60
|
+
/** POST /opra/checkout -> 200: a Stripe redirect, or a terminal refusal the UI shows as "not available". */
|
|
61
|
+
export type OpraCheckoutResponseDto = {
|
|
62
|
+
url: string;
|
|
63
|
+
} | {
|
|
64
|
+
refused: OpraPurchaseRefusalCode;
|
|
65
|
+
};
|
|
66
|
+
export type OpraPurchaseRefusalCode = 'professional_unavailable' | 'agreement_required' | 'attestation_required';
|
|
67
|
+
/** Subscription as served by GET /opra/subscription. */
|
|
68
|
+
export interface OpraSubscriptionDto {
|
|
69
|
+
interval: OpraBillingInterval;
|
|
70
|
+
/** ISO timestamp of the current period end. */
|
|
71
|
+
renewsAt: string;
|
|
72
|
+
pendingCancellation: boolean;
|
|
73
|
+
priceUsd: number;
|
|
74
|
+
}
|
|
75
|
+
export interface GetOpraSubscriptionResponseDto {
|
|
76
|
+
subscription: OpraSubscriptionDto | null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* GET /opra/data-terms -> 200; POST /opra/data-terms -> 201. Acceptance is an explicit record of
|
|
80
|
+
* the OPRA subscriber agreement version the user accepted; a grant or a subscription never
|
|
81
|
+
* implies it (the CME shape infers acceptance, OPRA must not).
|
|
82
|
+
*/
|
|
83
|
+
export interface OpraDataTermsDto {
|
|
84
|
+
accepted: boolean;
|
|
85
|
+
agreementVersion: string;
|
|
86
|
+
acceptedAt?: string;
|
|
87
|
+
}
|
|
88
|
+
/** POST /opra/attestation -> 201 body. */
|
|
89
|
+
export interface SubmitOpraAttestationResponseDto {
|
|
90
|
+
attestationId: number;
|
|
91
|
+
}
|
|
92
|
+
/** POST /opra/data-terms request body: the agreement version the subscriber was shown and accepted. */
|
|
93
|
+
export interface AcceptOpraDataTermsDto {
|
|
94
|
+
agreementVersion: string;
|
|
95
|
+
}
|
|
96
|
+
/** POST /opra/subscription/cancel and DELETE /opra/subscription/cancel -> 200 body. */
|
|
97
|
+
export interface OpraCancelResponseDto {
|
|
98
|
+
message?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The OPRA subscriber agreement version this build presents and posts. Bump on ANY change to the
|
|
102
|
+
* agreement text the dialog shows or links: a new version is a new acceptance, and the store reads a
|
|
103
|
+
* record of any other version as not accepted. RELEASE BLOCKER (named, do not bury): the agreement
|
|
104
|
+
* text, this version id and the link below need the compliance sign-off before the flag is lit.
|
|
105
|
+
*/
|
|
106
|
+
export declare const OPRA_SUBSCRIBER_AGREEMENT_VERSION = "opra-subscriber-2026-10";
|
|
107
|
+
/** Where the agreement step links for OPRA's own subscriber terms (see the release blocker above). */
|
|
108
|
+
export declare const OPRA_SUBSCRIBER_AGREEMENT_URL = "https://www.opraplan.com/";
|
|
109
|
+
/**
|
|
110
|
+
* OPRA's non-professional qualification, one stable machine id per question: these ids key the
|
|
111
|
+
* submitted `answers` record and are never swapped for translated question text. `qualifying` is the
|
|
112
|
+
* answer a non-professional gives. Every answer must match it; anything else is a professional
|
|
113
|
+
* declaration, which v1 does not sell: it is submitted (the server records it and withdraws eligibility)
|
|
114
|
+
* and then ends in "not available". Bump OPRA_ATTESTATION_FORM_VERSION on any change to this set, its
|
|
115
|
+
* order or its wording.
|
|
116
|
+
*/
|
|
117
|
+
export declare const OPRA_QUALIFICATION_QUESTIONS: readonly [{
|
|
118
|
+
readonly id: "natural_person";
|
|
119
|
+
readonly qualifying: true;
|
|
120
|
+
}, {
|
|
121
|
+
readonly id: "personal_use_only";
|
|
122
|
+
readonly qualifying: true;
|
|
123
|
+
}, {
|
|
124
|
+
readonly id: "securities_registered";
|
|
125
|
+
readonly qualifying: false;
|
|
126
|
+
}, {
|
|
127
|
+
readonly id: "investment_adviser";
|
|
128
|
+
readonly qualifying: false;
|
|
129
|
+
}, {
|
|
130
|
+
readonly id: "exempt_institution_role";
|
|
131
|
+
readonly qualifying: false;
|
|
132
|
+
}];
|
|
133
|
+
export type OpraQualificationQuestionId = (typeof OPRA_QUALIFICATION_QUESTIONS)[number]['id'];
|
|
134
|
+
export type OpraQualificationAnswers = Partial<Record<OpraQualificationQuestionId, boolean>>;
|
|
135
|
+
/** Every question answered with its qualifying answer. A missing answer never qualifies. */
|
|
136
|
+
export declare function isOpraNonProfessional(answers: OpraQualificationAnswers): boolean;
|
|
137
|
+
export type OpraAttestation = OpraAttestationRecordDto;
|
|
138
|
+
export type OpraSubscription = OpraSubscriptionDto;
|
|
139
|
+
/** The explicit agreement record: accepted, for which version, and when. */
|
|
140
|
+
export interface OpraAgreement {
|
|
141
|
+
accepted: boolean;
|
|
142
|
+
agreementVersion: string;
|
|
143
|
+
acceptedAt: string | null;
|
|
144
|
+
}
|
|
145
|
+
/** How long before a declaration's expiry the management page asks the subscriber to renew it. */
|
|
146
|
+
export declare const OPRA_ATTESTATION_RENEW_WINDOW_DAYS = 30;
|
|
147
|
+
/**
|
|
148
|
+
* A declaration on the current form (a new question set means a new declaration) whose validity has not
|
|
149
|
+
* ended at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's
|
|
150
|
+
* last evaluation), never an implied Date.now(). A record without `expiresAt` never expires here; one whose
|
|
151
|
+
* `expiresAt` does not parse reads expired (ask again rather than trust it).
|
|
152
|
+
*/
|
|
153
|
+
export declare function isOpraAttestationLive(attestation: OpraAttestation | null | undefined, now: number): boolean;
|
|
154
|
+
/** A non-professional declaration on the current form, still valid at `now`: the account may buy real-time. */
|
|
155
|
+
export declare function isOpraAttestationCurrent(attestation: OpraAttestation | null | undefined, now: number): boolean;
|
|
156
|
+
/** A professional declaration on the current form, still valid at `now`: real-time is not sold to the account. */
|
|
157
|
+
export declare function isOpraProfessionalDeclaration(attestation: OpraAttestation | null | undefined, now: number): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* The expiry (ISO, as served) a still-current non-professional declaration must be renewed by, once `now` is
|
|
160
|
+
* inside the renewal window before it; null otherwise (no expiry named, further off, or already lapsed).
|
|
161
|
+
*/
|
|
162
|
+
export declare function opraAttestationRenewBy(attestation: OpraAttestation | null | undefined, now: number): string | null;
|
|
163
|
+
/** An acceptance counts only for the version this build presents, never for an older text. */
|
|
164
|
+
export declare function isOpraAgreementCurrent(agreement: OpraAgreement | null | undefined): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Normalized checkout outcome. 'redirect' = leave for Stripe. 'refused' = the server (or the store's
|
|
167
|
+
* own precondition check) declined; 'professional_unavailable' is terminal, never a re-price.
|
|
168
|
+
* 'busy' = a checkout is already in flight, or the guest wall took the click.
|
|
169
|
+
*/
|
|
170
|
+
export type OpraCheckoutResult = {
|
|
171
|
+
kind: 'redirect';
|
|
172
|
+
url: string;
|
|
173
|
+
} | {
|
|
174
|
+
kind: 'refused';
|
|
175
|
+
code: OpraPurchaseRefusalCode;
|
|
176
|
+
} | {
|
|
177
|
+
kind: 'busy';
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Transport-free failure surface for the OPRA billing calls. Unlike CME, a 403 is NOT an attestation
|
|
181
|
+
* gate (refusals ride the 200 checkout body), so it never routes back into the declaration.
|
|
182
|
+
* 'invoice_owed' is the tagged 409 while Stripe still collects an invoice on the line.
|
|
183
|
+
*/
|
|
184
|
+
export type OpraBillingErrorKind = 'conflict' | 'invoice_owed' | 'unauthorized' | 'forbidden' | 'network' | 'aborted' | 'server';
|
|
185
|
+
export declare class OpraBillingError extends Error {
|
|
186
|
+
readonly kind: OpraBillingErrorKind;
|
|
187
|
+
readonly status: number | null;
|
|
188
|
+
/** Raw backend message: diagnostic content only, never primary UI copy. */
|
|
189
|
+
readonly diagnosticMessage: string | null;
|
|
190
|
+
/** Stripe's hosted invoice on an 'invoice_owed' refusal; null otherwise. */
|
|
191
|
+
readonly invoiceUrl: string | null;
|
|
192
|
+
constructor(kind: OpraBillingErrorKind, options?: {
|
|
193
|
+
status?: number | null;
|
|
194
|
+
diagnosticMessage?: string | null;
|
|
195
|
+
invoiceUrl?: string | null;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/** The live repository's boundary (implemented in the service; specs substitute it through the accessor). */
|
|
199
|
+
export interface OpraBillingRepository {
|
|
200
|
+
getAttestation(signal?: AbortSignal): Promise<OpraAttestation | null>;
|
|
201
|
+
submitAttestation(body: OpraAttestationDto, signal?: AbortSignal): Promise<{
|
|
202
|
+
attestationId: number;
|
|
203
|
+
}>;
|
|
204
|
+
getSubscription(signal?: AbortSignal): Promise<OpraSubscription | null>;
|
|
205
|
+
/** Never resolves 'busy' (that is the store's own answer); a refusal resolves, a failure throws. */
|
|
206
|
+
checkout(body: OpraCheckoutDto, options: {
|
|
207
|
+
idempotencyId: string;
|
|
208
|
+
signal?: AbortSignal;
|
|
209
|
+
}): Promise<Exclude<OpraCheckoutResult, {
|
|
210
|
+
kind: 'busy';
|
|
211
|
+
}>>;
|
|
212
|
+
/**
|
|
213
|
+
* Cancels at period end (OPRA has one classification, so there is no immediate switch-cancel), with the
|
|
214
|
+
* subscriber's optional reason as the body.
|
|
215
|
+
*/
|
|
216
|
+
cancelSubscription(signal?: AbortSignal, feedback?: CancelFeedback): Promise<{
|
|
217
|
+
message: string | null;
|
|
218
|
+
}>;
|
|
219
|
+
retractCancellation(signal?: AbortSignal): Promise<{
|
|
220
|
+
message: string | null;
|
|
221
|
+
}>;
|
|
222
|
+
getDataTerms(signal?: AbortSignal): Promise<OpraAgreement>;
|
|
223
|
+
acceptDataTerms(agreementVersion: string, signal?: AbortSignal): Promise<OpraAgreement>;
|
|
224
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** Every OPRA-governed exchange code (one consolidated venue by design). */
|
|
2
|
+
export const OPRA_GOVERNED_EXCHANGES = ['OPRA'];
|
|
3
|
+
/** OPRA defines delayed data as at least 15 minutes old; the gate's delayed window matches. */
|
|
4
|
+
export const OPRA_DELAY_MINUTES = 15;
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Billing wire proposal for the `/opra/*` twin of `/cme/*` (the backend does
|
|
7
|
+
// not exist yet; this is the schema the frontend builds against and the
|
|
8
|
+
// backend must implement or renegotiate). Differences from CME are deliberate:
|
|
9
|
+
// one product, no depth, non-professional only, and EXPLICIT agreement
|
|
10
|
+
// acceptance (never inferred from a grant or a subscription).
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
/** The one OPRA plan: real-time top of book, billed monthly. */
|
|
13
|
+
export const OPRA_REALTIME_MONTHLY_USD = 4.95;
|
|
14
|
+
export const OPRA_ATTESTATION_FORM_VERSION = 'opra-v1';
|
|
15
|
+
/**
|
|
16
|
+
* POST /opra/attestation request body (201 for both classifications). The server derives the classification
|
|
17
|
+
* from `answers` and refuses a body whose `classification` disagrees, so the client sends the one
|
|
18
|
+
* `isOpraNonProfessional` reads from the same answers.
|
|
19
|
+
*/
|
|
20
|
+
/** The server's bound on each identity field (`legalName`, `employer`, `occupation`), trimmed. */
|
|
21
|
+
export const OPRA_IDENTITY_FIELD_MAX_LENGTH = 200;
|
|
22
|
+
/**
|
|
23
|
+
* The OPRA subscriber agreement version this build presents and posts. Bump on ANY change to the
|
|
24
|
+
* agreement text the dialog shows or links: a new version is a new acceptance, and the store reads a
|
|
25
|
+
* record of any other version as not accepted. RELEASE BLOCKER (named, do not bury): the agreement
|
|
26
|
+
* text, this version id and the link below need the compliance sign-off before the flag is lit.
|
|
27
|
+
*/
|
|
28
|
+
export const OPRA_SUBSCRIBER_AGREEMENT_VERSION = 'opra-subscriber-2026-10';
|
|
29
|
+
/** Where the agreement step links for OPRA's own subscriber terms (see the release blocker above). */
|
|
30
|
+
export const OPRA_SUBSCRIBER_AGREEMENT_URL = 'https://www.opraplan.com/';
|
|
31
|
+
/**
|
|
32
|
+
* OPRA's non-professional qualification, one stable machine id per question: these ids key the
|
|
33
|
+
* submitted `answers` record and are never swapped for translated question text. `qualifying` is the
|
|
34
|
+
* answer a non-professional gives. Every answer must match it; anything else is a professional
|
|
35
|
+
* declaration, which v1 does not sell: it is submitted (the server records it and withdraws eligibility)
|
|
36
|
+
* and then ends in "not available". Bump OPRA_ATTESTATION_FORM_VERSION on any change to this set, its
|
|
37
|
+
* order or its wording.
|
|
38
|
+
*/
|
|
39
|
+
export const OPRA_QUALIFICATION_QUESTIONS = [
|
|
40
|
+
{ id: 'natural_person', qualifying: true },
|
|
41
|
+
{ id: 'personal_use_only', qualifying: true },
|
|
42
|
+
{ id: 'securities_registered', qualifying: false },
|
|
43
|
+
{ id: 'investment_adviser', qualifying: false },
|
|
44
|
+
{ id: 'exempt_institution_role', qualifying: false },
|
|
45
|
+
];
|
|
46
|
+
/** Every question answered with its qualifying answer. A missing answer never qualifies. */
|
|
47
|
+
export function isOpraNonProfessional(answers) {
|
|
48
|
+
return OPRA_QUALIFICATION_QUESTIONS.every((question) => answers[question.id] === question.qualifying);
|
|
49
|
+
}
|
|
50
|
+
/** How long before a declaration's expiry the management page asks the subscriber to renew it. */
|
|
51
|
+
export const OPRA_ATTESTATION_RENEW_WINDOW_DAYS = 30;
|
|
52
|
+
const DAY_MS = 86_400_000;
|
|
53
|
+
/**
|
|
54
|
+
* A declaration on the current form (a new question set means a new declaration) whose validity has not
|
|
55
|
+
* ended at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's
|
|
56
|
+
* last evaluation), never an implied Date.now(). A record without `expiresAt` never expires here; one whose
|
|
57
|
+
* `expiresAt` does not parse reads expired (ask again rather than trust it).
|
|
58
|
+
*/
|
|
59
|
+
export function isOpraAttestationLive(attestation, now) {
|
|
60
|
+
if (!attestation || attestation.formVersion !== OPRA_ATTESTATION_FORM_VERSION)
|
|
61
|
+
return false;
|
|
62
|
+
if (attestation.expiresAt === undefined)
|
|
63
|
+
return true;
|
|
64
|
+
const ends = Date.parse(attestation.expiresAt);
|
|
65
|
+
return Number.isFinite(ends) && now < ends;
|
|
66
|
+
}
|
|
67
|
+
/** A non-professional declaration on the current form, still valid at `now`: the account may buy real-time. */
|
|
68
|
+
export function isOpraAttestationCurrent(attestation, now) {
|
|
69
|
+
return attestation?.classification === 'non_professional' && isOpraAttestationLive(attestation, now);
|
|
70
|
+
}
|
|
71
|
+
/** A professional declaration on the current form, still valid at `now`: real-time is not sold to the account. */
|
|
72
|
+
export function isOpraProfessionalDeclaration(attestation, now) {
|
|
73
|
+
return attestation?.classification === 'professional' && isOpraAttestationLive(attestation, now);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The expiry (ISO, as served) a still-current non-professional declaration must be renewed by, once `now` is
|
|
77
|
+
* inside the renewal window before it; null otherwise (no expiry named, further off, or already lapsed).
|
|
78
|
+
*/
|
|
79
|
+
export function opraAttestationRenewBy(attestation, now) {
|
|
80
|
+
if (!isOpraAttestationCurrent(attestation, now) || attestation?.expiresAt === undefined)
|
|
81
|
+
return null;
|
|
82
|
+
return Date.parse(attestation.expiresAt) - now <= OPRA_ATTESTATION_RENEW_WINDOW_DAYS * DAY_MS
|
|
83
|
+
? attestation.expiresAt
|
|
84
|
+
: null;
|
|
85
|
+
}
|
|
86
|
+
/** An acceptance counts only for the version this build presents, never for an older text. */
|
|
87
|
+
export function isOpraAgreementCurrent(agreement) {
|
|
88
|
+
return agreement?.accepted === true && agreement.agreementVersion === OPRA_SUBSCRIBER_AGREEMENT_VERSION;
|
|
89
|
+
}
|
|
90
|
+
export class OpraBillingError extends Error {
|
|
91
|
+
kind;
|
|
92
|
+
status;
|
|
93
|
+
/** Raw backend message: diagnostic content only, never primary UI copy. */
|
|
94
|
+
diagnosticMessage;
|
|
95
|
+
/** Stripe's hosted invoice on an 'invoice_owed' refusal; null otherwise. */
|
|
96
|
+
invoiceUrl;
|
|
97
|
+
constructor(kind, options) {
|
|
98
|
+
super(`opra billing error: ${kind}`);
|
|
99
|
+
this.name = 'OpraBillingError';
|
|
100
|
+
this.kind = kind;
|
|
101
|
+
this.status = options?.status ?? null;
|
|
102
|
+
this.diagnosticMessage = options?.diagnosticMessage ?? null;
|
|
103
|
+
this.invoiceUrl = options?.invoiceUrl ?? null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One option instrument of a chain snapshot, as the options GEX math (utility/indicators/options-gex.util.ts, which
|
|
3
|
+
* re-exports both types) and the wrun options chain's tuple builder (utility/wrun/wrun-options-chain.util.ts) read it:
|
|
4
|
+
* a type leaf with no imports, which the wrun chart-host package may read.
|
|
5
|
+
*/
|
|
6
|
+
export type OptionSide = 'CALL' | 'PUT';
|
|
7
|
+
export interface OptionInstrumentSnapshot {
|
|
8
|
+
symbol: string;
|
|
9
|
+
side: OptionSide;
|
|
10
|
+
strike: number;
|
|
11
|
+
/** Expiry in ms epoch. */
|
|
12
|
+
expiryMs: number;
|
|
13
|
+
/**
|
|
14
|
+
* Open interest in BASE-COIN UNITS ("amount units"): Deribit's ticker OI is
|
|
15
|
+
* already contract-size-expanded on the linears (trade-verified 2026-07-14:
|
|
16
|
+
* trade `amount` = `contracts` × contract_size, ratio 10/100/1000/10000 on
|
|
17
|
+
* SOL/AVAX/XRP/TRX). USD notionals use it DIRECTLY; never multiply by
|
|
18
|
+
* contract size (that double-applies the multiplier).
|
|
19
|
+
*/
|
|
20
|
+
oi: number;
|
|
21
|
+
/** dDelta per one quoted underlying-price-unit move. */
|
|
22
|
+
gamma: number;
|
|
23
|
+
/** USD value of one quoted-price-unit move per OI unit. Deribit defaults to 1. */
|
|
24
|
+
multiplier?: number;
|
|
25
|
+
delta: number;
|
|
26
|
+
markIv: number;
|
|
27
|
+
underlyingPrice: number;
|
|
28
|
+
/** Snapshot row time in ms epoch. */
|
|
29
|
+
updatedAtMs: number;
|
|
30
|
+
/** Venue vega (price change per 1 IV point). Optional: older fixtures omit it. */
|
|
31
|
+
vega?: number;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scope of one governed options chain read (the expiries it asks for and the strikes around each at-the-money
|
|
3
|
+
* strike), as the worker's chain store (workers/indicators/options-chain-state.worker.util.ts, which re-exports both
|
|
4
|
+
* types) and the wrun options chain (utility/wrun/wrun-options-chain.util.ts) read it: a type leaf with no imports,
|
|
5
|
+
* which the wrun chart-host package may read.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Which expiries one governed chain read asks the gateway for: every listed
|
|
9
|
+
* expiry, the nearest `count` live ones, or every live one within `ms` of now
|
|
10
|
+
* (never fewer than the nearest one).
|
|
11
|
+
*/
|
|
12
|
+
export type OptionsChainExpiryScope = {
|
|
13
|
+
kind: 'all';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'nearest';
|
|
16
|
+
count: number;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'horizon';
|
|
19
|
+
ms: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* What one governed chain read asks the gateway for: its expiries, and the
|
|
23
|
+
* strikes each side of every expiry's at-the-money strike (0 = every strike).
|
|
24
|
+
* Two scopes on one underlying are two chain states (see `optionsChainKey`).
|
|
25
|
+
*/
|
|
26
|
+
export interface OptionsChainScope {
|
|
27
|
+
expiries: OptionsChainExpiryScope;
|
|
28
|
+
neighborStrikes: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scope of one governed options chain read (the expiries it asks for and the strikes around each at-the-money
|
|
3
|
+
* strike), as the worker's chain store (workers/indicators/options-chain-state.worker.util.ts, which re-exports both
|
|
4
|
+
* types) and the wrun options chain (utility/wrun/wrun-options-chain.util.ts) read it: a type leaf with no imports,
|
|
5
|
+
* which the wrun chart-host package may read.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prediction market types: an event's metadata as the StreamMarkets API serves it (`PolymarketMetadata`, and its
|
|
3
|
+
* venue-neutral name `PredictionMarketMetadata`) and the outcome snapshot the order book widgets persist
|
|
4
|
+
* (`IPolymarketPredictionMarket`). Their own interface with no imports, so the outcome identity helpers
|
|
5
|
+
* (utility/chart/prediction-identity.util.ts) read them without the chart and order book interfaces, which reach the
|
|
6
|
+
* app layers and the DOM ladder's settings types. chart.interface.ts and orderbook.interface.ts re-export them.
|
|
7
|
+
*/
|
|
8
|
+
export interface IPolymarketPredictionMarket {
|
|
9
|
+
slug: string;
|
|
10
|
+
conditionId?: string;
|
|
11
|
+
/** Generic per-outcome series key; a complement carries the `~complement:` sentinel. */
|
|
12
|
+
tokenId?: string;
|
|
13
|
+
isComplement?: boolean;
|
|
14
|
+
complementOf?: string;
|
|
15
|
+
question: string;
|
|
16
|
+
groupItemTitle?: string;
|
|
17
|
+
lastPrice?: number;
|
|
18
|
+
closed?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Polymarket prediction market metadata interface
|
|
22
|
+
* Stores complete event and market data from StreamMarkets API
|
|
23
|
+
* Single source of truth for all Polymarket data
|
|
24
|
+
*/
|
|
25
|
+
export interface PolymarketMetadata {
|
|
26
|
+
id?: string;
|
|
27
|
+
rawSymbol: string;
|
|
28
|
+
normalizedSymbol: string;
|
|
29
|
+
coin: string;
|
|
30
|
+
coinName: string;
|
|
31
|
+
title: string;
|
|
32
|
+
fullName: string;
|
|
33
|
+
category: number;
|
|
34
|
+
closed: boolean;
|
|
35
|
+
iconUrl?: string;
|
|
36
|
+
tags?: Array<{
|
|
37
|
+
label: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
}>;
|
|
40
|
+
liquidity: number;
|
|
41
|
+
totalVolume: number;
|
|
42
|
+
volume24h: number;
|
|
43
|
+
predictionMarkets: Array<{
|
|
44
|
+
slug: string;
|
|
45
|
+
question: string;
|
|
46
|
+
lastPrice: number;
|
|
47
|
+
groupItemTitle?: string;
|
|
48
|
+
oneDayPriceChange?: number;
|
|
49
|
+
prices?: number[];
|
|
50
|
+
closed?: boolean;
|
|
51
|
+
outcomes: string[];
|
|
52
|
+
availableTo: {
|
|
53
|
+
seconds: number;
|
|
54
|
+
};
|
|
55
|
+
availableSince?: {
|
|
56
|
+
seconds: number;
|
|
57
|
+
};
|
|
58
|
+
resolutionTime?: {
|
|
59
|
+
seconds: number;
|
|
60
|
+
};
|
|
61
|
+
totalVolume: number;
|
|
62
|
+
buyVolume24H?: number;
|
|
63
|
+
sellVolume24H?: number;
|
|
64
|
+
uniqueTraders: number;
|
|
65
|
+
orderPriceMinTickSize: number;
|
|
66
|
+
conditionId: string;
|
|
67
|
+
tokenId?: string;
|
|
68
|
+
isComplement?: boolean;
|
|
69
|
+
complementOf?: string;
|
|
70
|
+
sportsMarketType?: string;
|
|
71
|
+
line?: number;
|
|
72
|
+
sourceEventSlug?: string;
|
|
73
|
+
}>;
|
|
74
|
+
fetchedAt?: string;
|
|
75
|
+
lastUpdated?: string;
|
|
76
|
+
parentEventId?: string;
|
|
77
|
+
sourceEvents?: Array<{
|
|
78
|
+
slug: string;
|
|
79
|
+
title: string;
|
|
80
|
+
marketCount: number;
|
|
81
|
+
}>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Venue-neutral name for the same shape. The persisted field stays
|
|
85
|
+
* `polymarketMetadata` (a storage contract), but the pipeline it feeds is
|
|
86
|
+
* generic: prefer this alias in new and touched signatures.
|
|
87
|
+
*/
|
|
88
|
+
export type PredictionMarketMetadata = PolymarketMetadata;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prediction market types: an event's metadata as the StreamMarkets API serves it (`PolymarketMetadata`, and its
|
|
3
|
+
* venue-neutral name `PredictionMarketMetadata`) and the outcome snapshot the order book widgets persist
|
|
4
|
+
* (`IPolymarketPredictionMarket`). Their own interface with no imports, so the outcome identity helpers
|
|
5
|
+
* (utility/chart/prediction-identity.util.ts) read them without the chart and order book interfaces, which reach the
|
|
6
|
+
* app layers and the DOM ladder's settings types. chart.interface.ts and orderbook.interface.ts re-export them.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -1073,6 +1073,11 @@ export interface WrunLevels {
|
|
|
1073
1073
|
value_area_width?: number;
|
|
1074
1074
|
value_area_line_style?: WrunLineStyleWord;
|
|
1075
1075
|
value_area_labels?: boolean;
|
|
1076
|
+
/** WRUN-OI-PROFILE D8: where the VAH, VAL and POC tags sit, at the dock's
|
|
1077
|
+
* inner end (`inner`, the default and the place before the word) or on
|
|
1078
|
+
* the price-axis side (`axis`). A Style word: `"@<param>"` binds it to a
|
|
1079
|
+
* `param.choice` like the other word keys. */
|
|
1080
|
+
tag_place?: 'inner' | 'axis';
|
|
1076
1081
|
/** DL-gradient: 2..8 stops across each bar (default direction horizontal
|
|
1077
1082
|
* here). */
|
|
1078
1083
|
gradient?: WrunColorWord[];
|