@orangecharts/wrun-chart-host 0.6.0 → 0.7.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 +13 -5
- package/dist/constants/marketCapabilities.constants.d.ts +5 -0
- package/dist/constants/marketCapabilities.constants.js +16 -0
- package/dist/host-ports.types.d.ts +35 -3
- package/dist/index.d.ts +11 -1
- package/dist/index.js +11 -1
- package/dist/indicators/controls/tpo-session.util.js +42 -18
- package/dist/market-data/billing.interface.d.ts +2 -1
- package/dist/settings-templates/indicator-fields.js +10 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +16 -0
- package/dist/utility/chart/crypto-index.leaf.js +19 -0
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- package/dist/utility/chart/index-mode.util.d.ts +11 -5
- package/dist/utility/chart/index-mode.util.js +22 -10
- package/dist/utility/chart/kscript-source-answer-budget.leaf.d.ts +36 -0
- package/dist/utility/chart/kscript-source-answer-budget.leaf.js +39 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +38 -1
- package/dist/utility/chart/kscript-source-degrade.leaf.js +39 -1
- package/dist/utility/chart/live-bucket.util.d.ts +2 -1
- package/dist/utility/chart/live-bucket.util.js +47 -15
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +15 -1
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +9 -0
- package/dist/utility/chart/market-session-schedule.util.d.ts +3 -1
- package/dist/utility/chart/market-session-schedule.util.js +24 -2
- package/dist/utility/chart/marketKind.util.d.ts +12 -7
- package/dist/utility/chart/marketKind.util.js +15 -5
- package/dist/utility/chart/ny-calendar.util.d.ts +104 -0
- package/dist/utility/chart/ny-calendar.util.js +346 -0
- package/dist/utility/chart/om-panel.util.d.ts +14 -2
- package/dist/utility/chart/om-panel.util.js +108 -40
- package/dist/utility/chart/rth-session.util.d.ts +10 -7
- package/dist/utility/chart/rth-session.util.js +17 -22
- package/dist/utility/chart/trading-day.util.js +90 -18
- package/dist/utility/chart/us-equities-session.util.js +20 -67
- package/dist/utility/chart/wrun-bar-session-facts.util.js +14 -1
- package/dist/utility/common/time.util.d.ts +7 -1
- package/dist/utility/common/time.util.js +11 -41
- package/dist/utility/number-format.util.d.ts +17 -7
- package/dist/utility/number-format.util.js +18 -8
- package/dist/utility/options/option-symbol.util.js +13 -2
- package/dist/utility/symbol-selection/contract-expiry.util.js +9 -1
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +4 -1
- package/dist/utility/watchlist/import/import-request.leaf.js +5 -2
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +25 -4
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +62 -4
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +19 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +57 -0
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +23 -0
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +90 -0
- package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.d.ts +39 -0
- package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.js +60 -0
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +77 -0
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +195 -0
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +56 -0
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +70 -0
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +53 -0
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +239 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +16 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +14 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +43 -18
- package/dist/utility/wrun/sources/lanes/options_flow.js +209 -72
- package/dist/utility/wrun/sources/lanes/token_supply.js +5 -31
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +12 -57
- package/dist/utility/wrun/sources/row-lane-registry.d.ts +1 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +22 -8
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +61 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +103 -8
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +5 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +24 -12
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +55 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +95 -18
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +15 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +23 -8
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +11 -11
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +14 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.js +6 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +43 -8
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +77 -11
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -16
- package/dist/utility/wrun/sources/wrun-row-lane.types.js +2 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +52 -12
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +110 -46
- package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +10 -0
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +12 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +53 -18
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +45 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +14 -8
- package/dist/utility/wrun/wrun-failure-cause.d.ts +1 -1
- package/dist/utility/wrun/wrun-failure-cause.js +14 -0
- package/dist/utility/wrun/wrun-frames.js +6 -2
- package/dist/utility/wrun/wrun-host.service.d.ts +26 -18
- package/dist/utility/wrun/wrun-host.service.js +49 -52
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +1 -1
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +2 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +7 -4
- package/dist/utility/wrun/wrun-kit-run-tables.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-kit-run-tables.util.js +87 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +2 -1
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +8 -2
- package/dist/utility/wrun/wrun-live-tick.util.js +35 -16
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +40 -13
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +39 -12
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +70 -21
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +257 -112
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +62 -22
- package/dist/utility/wrun/wrun-option-prints.util.js +148 -46
- package/dist/utility/wrun/wrun-option-views.util.d.ts +262 -0
- package/dist/utility/wrun/wrun-option-views.util.js +356 -0
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +23 -2
- package/dist/utility/wrun/wrun-options-chain.util.js +37 -3
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +18 -3
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +32 -7
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +146 -18
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +50 -6
- package/dist/utility/wrun/wrun-overlay-run.util.js +816 -243
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +28 -12
- package/dist/utility/wrun/wrun-pin-venues.util.js +4 -6
- package/dist/utility/wrun/wrun-present-bits.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-present-bits.util.js +39 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-refusal-surface.util.js +5 -4
- package/dist/utility/wrun/wrun-refusal.util.d.ts +66 -6
- package/dist/utility/wrun/wrun-refusal.util.js +335 -40
- package/dist/utility/wrun/wrun-source-rows.util.js +11 -0
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +28 -3
- package/dist/utility/wrun/wrun-tier-grid.util.js +79 -19
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +14 -3
- package/dist/utility/wrun/wrun-transient-rerun.util.js +33 -8
- package/package.json +5 -5
- package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +0 -12
- package/dist/utility/wrun/wrun-opra-underlying.util.js +0 -1
package/README.md
CHANGED
|
@@ -10,8 +10,8 @@ Peers, pinned exactly (install them beside the package):
|
|
|
10
10
|
|
|
11
11
|
| Peer | Version | Why |
|
|
12
12
|
| --- | --- | --- |
|
|
13
|
-
| `@orangecharts/indicator-kit` | 0.
|
|
14
|
-
| `@orangecharts/orange-v2-pb-common` | 12.
|
|
13
|
+
| `@orangecharts/indicator-kit` | 0.88.0 | the shared host's types (`@orangecharts/indicator-kit/host`); the host module itself comes through the env |
|
|
14
|
+
| `@orangecharts/orange-v2-pb-common` | 12.72.0 | the protocol enums the lanes, pins and venue rules read (`Exchange`, `Type`, `Category`), from 0.3.0 |
|
|
15
15
|
| `dayjs` | 1.11.23 | sessions and trading days (the `utc`, `timezone`, `isoWeek` and `quarterOfYear` plugins) |
|
|
16
16
|
| `lodash-es` | 4.18.1 | the color settings and the transforms, by per-function subpath |
|
|
17
17
|
|
|
@@ -30,8 +30,9 @@ At 0.4.0, 27: the panel mount `utility/wrun/wrun-panel-mount.util` joins them (i
|
|
|
30
30
|
`utility/wrun/wrun-overlay-lifecycle.lazy`, the run pass `utility/wrun/wrun-overlay-run.util`, `replay/replayLadder`,
|
|
31
31
|
`utility/market-events/market-events.util` and `utility/wrun/wrun-overlay-identity.util` join them. The entry served
|
|
32
32
|
the last one at 0.4.0: from 0.5.0 its `isWrunDraftOverlaySettings` is the draft overlay module's (a draft ref, or a
|
|
33
|
-
draft script id without a package ref), so import the identity module's names by its subpath.
|
|
34
|
-
the modules it
|
|
33
|
+
draft script id without a package ref), so import the identity module's names by its subpath. 0.6.0 and 0.7.0 keep
|
|
34
|
+
the same 33: the eleven modules 0.7.0 adds all join the entry, and the one it deletes
|
|
35
|
+
(`utility/wrun/wrun-opra-underlying.util`) was in it. `src/index.ts` names the modules it joins.
|
|
35
36
|
|
|
36
37
|
## The host env (ports)
|
|
37
38
|
|
|
@@ -76,7 +77,13 @@ that parks its chart while the page stays visible reports it, and the package's
|
|
|
76
77
|
as live). It retires the three `run` loaders: they are optional at 0.5.0 (the package loads the lifecycle door, the
|
|
77
78
|
refusal surface and the series stream itself), and 0.6.0 removes them with the `run` namespace: 131 members by the
|
|
78
79
|
contract's count (134 at 0.5.0), 133 in `host-env` with 0.5.0's two optional members. Their payload types and loader
|
|
79
|
-
views are `host-ports.types`.
|
|
80
|
+
views are `host-ports.types`. 0.7.0 keeps the 133 members and widens one loader view: the module
|
|
81
|
+
`transport.loadV2Service()` answers (`WrunV2ServiceModule`) gains `warmGateReaderFor(exchange)` and
|
|
82
|
+
`warmGateReaderOnIntent(exchange, surface)`, which package code calls only inside the two gate reader warms a host's
|
|
83
|
+
door calls (`warmWrunSheetGateReaders`, `warmWrunChartGateReaderOnIntent`). From 0.7.0 no package code reads
|
|
84
|
+
`transport.loadWrunKit`: a run reads the kit's two tables from `utility/wrun/wrun-kit-run-tables.util`, pinned to the
|
|
85
|
+
kit. A source fetch also takes an optional `onSent` (the request's own wire send, which a lane's budget then counts
|
|
86
|
+
from). The guide lists every member, what reads it and what web binds it.
|
|
80
87
|
|
|
81
88
|
A read before the set throws `wrun_chart_host_env_unset`. The env lives on the realm's global object under
|
|
82
89
|
`Symbol.for('@orangecharts/wrun-chart-host/env')`, so every copy of the package in a realm reads the same one.
|
|
@@ -99,6 +106,7 @@ What each published version holds. A host installs a version with the peers of i
|
|
|
99
106
|
|
|
100
107
|
| Version | Peers | What changed |
|
|
101
108
|
| --- | --- | --- |
|
|
109
|
+
| 0.7.0 | `@orangecharts/indicator-kit` 0.88.0, `@orangecharts/orange-v2-pb-common` 12.72.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The options lanes of OPTIONS-PORT P7: `options_flow` becomes a chain lane, and with `option_prints` and `option_contract_flow` it reads the chart's option chain on a crypto option venue and on a CME futures chart as well as on OPRA; option contract flow plans to one source answer budget every layer reads (`utility/chart/kscript-source-answer-budget.leaf`). The run schedule (`utility/wrun/run-schedule/`, six modules): each lane group is sent at its own plan, held or in-flight reads are reused, and a host's door can dial the chart's gate reader before an add (`warmWrunSheetGateReaders`) or when a surface opens (`warmWrunChartGateReaderOnIntent`). Row lanes ask end-exclusive (`WrunSourceFetchOptions.endExclusive`) and keep held bars over budget markers; panel rows paint with missing readings, and a lane is asked only within its reach (`WrunWarmupEvidence.sourceReachFromTs`, the `source-reach` backfill outcome). Trading-day opens are solved as titan solves them across DST edges, and each zone's offset is read once a day (`utility/chart/ny-calendar.util`). Crypto indices chart as main symbols (`utility/chart/crypto-index.leaf`); the symbol comparison keeps its user label as instance state in the settings templates; a run no longer loads the kit on the main thread (`utility/wrun/wrun-kit-run-tables.util`). Every failed run names its cause: `WRUN_FAILURE_CAUSES` gains eight words (`package-withdrawn`, `package-hosted`, `compile-failed`, `twin-declined` and `integration-error` for what stopped a package before it ran; `source-budget`, `source-failed` and `source-declined` for a source lane the ladder gave up on), a package the registry no longer serves shows "no longer available from its publisher" with Remove and never Retry, and a source chip names the feed and what happened (the words under `wrun.unavailable` and `kscript.legend.card.removeIndicator`, which a host's word table needs). A lane's budget counts from its dispatch until the transport reports the request's wire send (`WrunSourceFetchOptions.onSent`, optional: a transport that never reports keeps the dispatch budget), then from the send, 60 s at most from the dispatch; the ladder never ends a lane while a late read is out, and the record it ends on names its cause and the episode that armed it (a restore, a person's add, a live rebuild). The transient grace holds a failure only for an overlay a rerun driver runs, unless the host declares that it reruns the overlay itself (`holdWrunTransientRefusal(target, onExpire, { hostReruns: true })`, `WrunTransientHoldOptions`; off by default): the mobile app's protected run heal does, so its Marketplace indicators load through an outage instead of showing their chip at once. `onWrunOverlayRunSettled` announces a run of a standing overlay only: a run that settles after its overlay's teardown (typically dropped by the teardown's cancel of its pending row-source ask) is the ring's alone, so a same-id remount no longer reads its predecessor's dropped run as its own first run. OPTLOAD G5: an `options_chain` or `option_contract_state` input may declare chain page views (`page_view`, `page_views`; `utility/wrun/wrun-option-views.util`), which ride the lane's ask as view fields for the host's chain transport to send in one chain summary read; a fold view refuses by name (`wrun_option_view_unread`) and a view param's `"@<param>"` handle is painted like `ticks_per_bar`. On the OPRA plane both lanes hold the plane's chain by coin instead of reading the chain directory (`wrunHeldOpraPlaneChain`). One loader view widens: the module `transport.loadV2Service()` answers gains `warmGateReaderFor(exchange)` and `warmGateReaderOnIntent(exchange, surface)`; the env keeps its 133 members, and no package code reads `transport.loadWrunKit` any more. 11 modules join, all in the entry, and `utility/wrun/wrun-opra-underlying.util` goes with its `WrunOpraUnderlyingContext`: 416 dist modules (406 at 0.6.0), 33 by subpath only. `utility/wrun/sources/opra-option-lanes.util` drops `resolveWrunOpraLaneUnderlying` and `resolveWrunLaneOpraChain`; a lane resolves its chain through `resolveWrunLaneChainChart` and `decideWrunLaneChain`. The kit peer moves from 0.87.0 to 0.88.0 and the protocol enums peer from 12.69.0 to 12.72.0. |
|
|
102
110
|
| 0.6.0 | `@orangecharts/indicator-kit` 0.87.0, `@orangecharts/orange-v2-pb-common` 12.69.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The shared engine protocol: a module's bytes cross `postMessage` (the mobile app's portability rule) and the engine worker hashes them (`utility/wrun/wrun-sha256.leaf`), checks the sheet's pin, clamps, prepares and compiles them, caching up to 16 compiled modules per worker, so the main thread neither hashes nor compiles. `compileModule` becomes `loadModule`, which answers an opaque `WrunModuleHandle` (key, sha256, ABI, imports as `{ module, name }` pairs; no bytes); every full run and live-start carries the module's key, ABI and bytes (copied, never transferred), and the worker reuses its cached module or compiles the bytes on a miss, so a respawned worker compiles again. A request runs on two 20 s clocks, the start ceiling from the post (queue plus compile) and the run deadline from the worker's `running`; `loadModule` rejects a failed compile as a `WebAssembly.CompileError` with the worker's words and a pin mismatch with the words it had before 0.6.0. The `run` namespace goes with its three loaders (`run.loadOverlayLifecycleDoor`, `run.loadRefusalSurface`, `run.loadSeriesStream`, retired at 0.5.0), `WrunHostRun` and their three loader views in `host-ports.types`: 131 members by the contract's count, 133 with 0.5.0's two optional ones. Peers unchanged. |
|
|
103
111
|
| 0.5.0 | `@orangecharts/indicator-kit` 0.87.0, `@orangecharts/orange-v2-pb-common` 12.69.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | Phase 2: the live session (the live tick, intake, hidden-tab hold, coin lane live channels, series stream), the drivers and the heal ladder (the lifecycle door, `utility/wrun/wrun-overlay-lifecycle.lazy` by subpath, its runtime and the recovery ladders), the prefix runs, the engine (`workers/wrun/wrun-abi-host`, `workers/wrun/wrun-engine-handler`, the browser host), the host facts and the executor (`utility/wrun/wrun-overlay-run.util`, by subpath) with its row sources: 135 modules, 398 in all. The env gains the 84 phase 2 members, the `ui` and `engine` namespaces and the optional `clock.watchHostSuspended` and `chart.commonStore`; the three `run` loaders turn optional (gone at 0.6.0). The panel mount reads a host's planned pane heights on every cell and retranslates an unchanged child in place, keeping a reader's expanded pane through a retire. The entry no longer serves `utility/wrun/wrun-overlay-identity.util` (by subpath; above). The kit peer moves from 0.86.3 to 0.87.0 (`option_multiplier`); the other peers are unchanged. |
|
|
104
112
|
| 0.4.0 | `@orangecharts/indicator-kit` 0.86.3, `@orangecharts/orange-v2-pb-common` 12.69.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | Phase 1b: the panel mount (`utility/wrun/wrun-panel-mount.util`, by subpath) and its door (`utility/wrun/wrun-panel-mount.lazy`), the run interval rules (`utility/chart/indicator-run-interval.util`) with the builtin script snippets they type against, the pause dim and six leaves (the window owner and window geometry rules, the date-labelled interval rule, the HTML escape, the run interval projection and plot gate types): 11 modules, 262 in all. The mount reads the host through the env: the 12 members reserved until 0.4.0, `t` and `diagnostics.debug`. Peers unchanged. |
|
|
@@ -25,6 +25,11 @@ export interface IMarketCapabilities {
|
|
|
25
25
|
/** Determines how alert symbols are formatted. Polymarket uses the market's
|
|
26
26
|
* conditionId; tradfi/forex/etc. use coin-style; dex uses pool slug. */
|
|
27
27
|
alertSymbolMode: 'coin' | 'slug' | 'conditionId';
|
|
28
|
+
/** Whether alerts can be CREATED on this venue. Absent = true. False where
|
|
29
|
+
* the alert engine serves no lane for the venue, so an armed alert would
|
|
30
|
+
* save and never fire (the crypto indices). Read by the creation doors only
|
|
31
|
+
* (venue-alerts.util); listing, editing and deleting alerts never read it. */
|
|
32
|
+
supportsAlerts?: boolean;
|
|
28
33
|
/** Finest interval the venue serves, in ms. Absent = the interval ladder's
|
|
29
34
|
* own floor applies (economic series observe at most once a day). */
|
|
30
35
|
minIntervalMs?: number;
|
|
@@ -179,6 +179,22 @@ export const MARKET_CAPABILITIES = {
|
|
|
179
179
|
// keep record identity with CME_FUTURES_CAPABILITIES.
|
|
180
180
|
futures: CME_FUTURES_CAPABILITIES,
|
|
181
181
|
options: OPRA_OPTIONS_CAPABILITIES,
|
|
182
|
+
// The crypto-wide indices (CRYPTOCAP: BTC.D, TOTAL, ...). Value candles on
|
|
183
|
+
// the period fetch, 24/7 on uniform bars like crypto, at every interval from
|
|
184
|
+
// 1m up (the calendar ones included; nothing below 1m, checkIsBlockedOn1s),
|
|
185
|
+
// but no trades, volume, book or profile behind them, and no alert engine lane.
|
|
186
|
+
cryptoIndex: {
|
|
187
|
+
barTimestamps: 'uniform',
|
|
188
|
+
fetchMode: 'period',
|
|
189
|
+
supportsVolumeStats: false,
|
|
190
|
+
supportsTradesFeed: false,
|
|
191
|
+
supportsMarketStats: false,
|
|
192
|
+
supportsFRVP: false,
|
|
193
|
+
supportsOrderbook: false,
|
|
194
|
+
supportsAlerts: false,
|
|
195
|
+
alertSymbolMode: 'coin',
|
|
196
|
+
allowsCalendarIntervals: true,
|
|
197
|
+
},
|
|
182
198
|
};
|
|
183
199
|
// =============================================================================
|
|
184
200
|
// MarketKind shorthand sets — for `IIndicatorControl.marketKinds` declarations.
|
|
@@ -330,11 +330,28 @@ export interface WrunMainCandleFetchOptions {
|
|
|
330
330
|
operationName?: string;
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
|
+
/** What suspects an options add is coming and warms the chart's gate reader for it, with no add asked yet (OPTLOAD g1
|
|
334
|
+
* round 2): a surface's open (`indicators-dialog`, `options-panel`: run-schedule/wrun-chart-gate-reader.util
|
|
335
|
+
* `warmWrunChartGateReaderOnIntent`), or a row's settled intent (`add-intent`: a hover's dwell, a detail panel; the
|
|
336
|
+
* loader's intent warm through wrun-gate-reader-warm.util `warmWrunSheetGateReaders`). */
|
|
337
|
+
export type WrunGateReaderIntentSurface = 'indicators-dialog' | 'options-panel' | 'add-intent';
|
|
338
|
+
/** What an intent warm did: `dialed` (this tab dials the reader and holds its lease), `already` (this tab's reader was
|
|
339
|
+
* dialing or open), `held-elsewhere` (another tab holds that reader for this identity and tier), `busy` (another tab is
|
|
340
|
+
* deciding its warm now), `unknown` (the browser cannot say who holds it: never dialed), `no-plane` (the chart's options
|
|
341
|
+
* ride no gate plane), `not-served` (no reader carries the account's reads: a guest, a CME terms wall),
|
|
342
|
+
* `not-entitled` (the gate refused this identity there, or the dial's own guards stopped it), `failed` (a load or a
|
|
343
|
+
* port failed). */
|
|
344
|
+
export type WrunGateReaderIntentWarm = 'dialed' | 'already' | 'held-elsewhere' | 'busy' | 'unknown' | 'no-plane' | 'not-served' | 'not-entitled' | 'failed';
|
|
333
345
|
/** Loader view of the V2 transport the main candles ride (web: services/v2.service.ts default `fetchData`, generic on
|
|
334
|
-
* web; the payload is the transport's own type, `never` here)
|
|
346
|
+
* web; the payload is the transport's own type, `never` here), the gate reader warm a door asks of it
|
|
347
|
+
* (`warmGateReaderFor`: dial the reader a read naming the exchange rides, under the on-demand guards; a hint,
|
|
348
|
+
* run-schedule/wrun-gate-reader-warm.util), and the intent warm a surface's open asks of it (`warmGateReaderOnIntent`:
|
|
349
|
+
* the same reader, only when no other tab of the browser holds it). */
|
|
335
350
|
export interface WrunV2ServiceModule {
|
|
336
351
|
readonly default: {
|
|
337
352
|
fetchData(indicator: string, payload: never, chartIndex: number, options: WrunMainCandleFetchOptions): Promise<void>;
|
|
353
|
+
warmGateReaderFor(exchange: string): void;
|
|
354
|
+
warmGateReaderOnIntent(exchange: string, surface: WrunGateReaderIntentSurface): Promise<WrunGateReaderIntentWarm>;
|
|
338
355
|
};
|
|
339
356
|
}
|
|
340
357
|
/** A markets request as the app hands it to the worker (web: workers/messages/indicator-v2.messages.ts
|
|
@@ -838,8 +855,16 @@ export interface WrunSourceFetchOptions {
|
|
|
838
855
|
preferPackedOrderbookWorker?: boolean;
|
|
839
856
|
latestAnchorBars?: number;
|
|
840
857
|
retryAttempt?: number;
|
|
841
|
-
/** SRCDEGRADE dispatch anchor: called when the request actually goes to the wire (or joins one that has).
|
|
858
|
+
/** SRCDEGRADE dispatch anchor: called when the request actually goes to the wire (or joins one that has). A wrun
|
|
859
|
+
* lane's budget counts from it (wrun-overlay-run.util `WrunLaneSendAnchor`). */
|
|
842
860
|
onDispatched?: () => void;
|
|
861
|
+
/** The request's own wire send (the transport worker's REQUEST_SENT), for a transport that reports it: a wrun lane's
|
|
862
|
+
* budget moves its anchor to it, so the socket's open and the worker's queue spend none of it. Optional for the
|
|
863
|
+
* host (web's dataFetch reports it once per call: its first own v2 send, the packed book request handed to the
|
|
864
|
+
* worker, or a joined leader's send; the web port then forwards `onSent` alone, so a request waiting in the v2
|
|
865
|
+
* queue or behind the socket open keeps its full budget, and a transport that never reports keeps the dispatch
|
|
866
|
+
* budget). */
|
|
867
|
+
onSent?: () => void;
|
|
843
868
|
/** Slow-link watchdog hint from the engine proxy: a longer transport silence bound for this source's wire pieces. */
|
|
844
869
|
responseWatchdogMs?: number;
|
|
845
870
|
/** Never touch the overlay's legend errorMessage on this fetch. */
|
|
@@ -848,6 +873,9 @@ export interface WrunSourceFetchOptions {
|
|
|
848
873
|
interval?: string;
|
|
849
874
|
/** The caller joins the rows onto the chart itself: the asked window stands and the control's own rows return. */
|
|
850
875
|
nativeRows?: boolean;
|
|
876
|
+
/** The asked window's end is exclusive and already closes its last bar (a row lane's host-grid ask): no inclusive
|
|
877
|
+
* bar is padded past it. */
|
|
878
|
+
endExclusive?: boolean;
|
|
851
879
|
/** Called once with the acquisition's wire verdict when the rows this call answers were acquired. */
|
|
852
880
|
onSourceVerdict?: (verdict: WrunSourceFetchVerdict) => void;
|
|
853
881
|
}
|
|
@@ -1002,6 +1030,10 @@ export interface WrunWarmupEvidence {
|
|
|
1002
1030
|
replayCapBars?: number;
|
|
1003
1031
|
/** The bar the result's declared warm-up ends at, null or absent when it declares none. */
|
|
1004
1032
|
declaredWarmupEndTs?: number | null;
|
|
1033
|
+
/** Where the rows of the result's history sources begin at the clock (sources/wrun-row-lanes.util
|
|
1034
|
+
* `wrunRunSourceReachFromMs`), null or absent when unknown or when a source reads without a reach: a first value
|
|
1035
|
+
* that history explains buys no page ('source-reach'). */
|
|
1036
|
+
sourceReachFromTs?: number | null;
|
|
1005
1037
|
}
|
|
1006
1038
|
/** A warm-up backfill ask after a run (web: `LocalKScriptWarmupBackfillAsk`; the engine is the chart handle). */
|
|
1007
1039
|
export interface WrunWarmupBackfillAsk {
|
|
@@ -1031,7 +1063,7 @@ export interface WrunWarmupBackfillAsk {
|
|
|
1031
1063
|
* `LocalKScriptWarmupBackfillOutcome`; the reasons of local-kscript-warmup-depth.util.ts and the decider's own). */
|
|
1032
1064
|
export interface WrunWarmupBackfillOutcome {
|
|
1033
1065
|
requested: boolean;
|
|
1034
|
-
reason: 'warmup-visible' | 'no-values-yet' | 'declared-depth' | 'no-rows' | 'no-viewport' | 'warmup-offscreen' | 'gap-too-small' | 'rounds-exhausted' | 'left-exhausted' | 'gesture-active' | 'sources-pending' | 'zero-lookback-empty' | 'no-dense-output' | 'no-progress' | 'page-pending';
|
|
1066
|
+
reason: 'warmup-visible' | 'no-values-yet' | 'declared-depth' | 'no-rows' | 'no-viewport' | 'warmup-offscreen' | 'gap-too-small' | 'rounds-exhausted' | 'left-exhausted' | 'gesture-active' | 'sources-pending' | 'zero-lookback-empty' | 'source-reach' | 'no-dense-output' | 'no-progress' | 'page-pending';
|
|
1035
1067
|
roundsUsed: number;
|
|
1036
1068
|
range?: {
|
|
1037
1069
|
startTs: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export * from './utility/chart/cme-session-bucket.util.js';
|
|
|
73
73
|
export * from './utility/chart/cme-trade-calendar.util.js';
|
|
74
74
|
export * from './utility/chart/color-customization.leaf.js';
|
|
75
75
|
export * from './utility/chart/continuous-contracts.util.js';
|
|
76
|
+
export * from './utility/chart/crypto-index.leaf.js';
|
|
76
77
|
export * from './utility/chart/date-labelled-interval.leaf.js';
|
|
77
78
|
export * from './utility/chart/feed-interval.util.js';
|
|
78
79
|
export * from './utility/chart/fetch-dedupe-policy.util.js';
|
|
@@ -115,6 +116,7 @@ export * from './utility/chart/kscript-run-result-equality.util.js';
|
|
|
115
116
|
export * from './utility/chart/kscript-run-result-normalize.util.js';
|
|
116
117
|
export * from './utility/chart/kscript-run-result-shape.util.js';
|
|
117
118
|
export * from './utility/chart/kscript-settings-revision.leaf.js';
|
|
119
|
+
export * from './utility/chart/kscript-source-answer-budget.leaf.js';
|
|
118
120
|
export * from './utility/chart/kscript-source-degrade.leaf.js';
|
|
119
121
|
export * from './utility/chart/kscript-source-retention.util.js';
|
|
120
122
|
export * from './utility/chart/kscript-standin-identity.leaf.js';
|
|
@@ -136,6 +138,7 @@ export * from './utility/chart/local-technical-script-range.leaf.js';
|
|
|
136
138
|
export * from './utility/chart/market-session-schedule.util.js';
|
|
137
139
|
export * from './utility/chart/marketKind.util.js';
|
|
138
140
|
export * from './utility/chart/mixed-mode.util.js';
|
|
141
|
+
export * from './utility/chart/ny-calendar.util.js';
|
|
139
142
|
export * from './utility/chart/ohlcv-row-readiness.util.js';
|
|
140
143
|
export * from './utility/chart/om-panel-push-style.util.js';
|
|
141
144
|
export * from './utility/chart/om-panel.util.js';
|
|
@@ -199,6 +202,12 @@ export * from './utility/watchlist/import/import-request.leaf.js';
|
|
|
199
202
|
export * from './utility/watchlist/import/tradingview-symbols.leaf.js';
|
|
200
203
|
export * from './utility/wrun-alert-params.leaf.js';
|
|
201
204
|
export * from './utility/wrun-display-name.util.js';
|
|
205
|
+
export * from './utility/wrun/run-schedule/wrun-chart-gate-reader.util.js';
|
|
206
|
+
export * from './utility/wrun/run-schedule/wrun-gate-reader-warm.util.js';
|
|
207
|
+
export * from './utility/wrun/run-schedule/wrun-lane-groups.util.js';
|
|
208
|
+
export * from './utility/wrun/run-schedule/wrun-late-reads.util.js';
|
|
209
|
+
export * from './utility/wrun/run-schedule/wrun-own-candles.util.js';
|
|
210
|
+
export * from './utility/wrun/run-schedule/wrun-prefix-feeds.util.js';
|
|
202
211
|
export * from './utility/wrun/sources/host-grid-landing.js';
|
|
203
212
|
export * from './utility/wrun/sources/lanes/bitfinex_funding.js';
|
|
204
213
|
export * from './utility/wrun/sources/lanes/economic.js';
|
|
@@ -266,6 +275,7 @@ export * from './utility/wrun/wrun-inert-legend.util.js';
|
|
|
266
275
|
export * from './utility/wrun/wrun-input-requirements.leaf.js';
|
|
267
276
|
export * from './utility/wrun/wrun-integration-budget.util.js';
|
|
268
277
|
export * from './utility/wrun/wrun-integration-route.util.js';
|
|
278
|
+
export * from './utility/wrun/wrun-kit-run-tables.util.js';
|
|
269
279
|
export * from './utility/wrun/wrun-lane-refusal.leaf.js';
|
|
270
280
|
export * from './utility/wrun/wrun-lane-warmup.util.js';
|
|
271
281
|
export * from './utility/wrun/wrun-latest-history.leaf.js';
|
|
@@ -290,11 +300,11 @@ export * from './utility/wrun/wrun-oi-lane.util.js';
|
|
|
290
300
|
export * from './utility/wrun/wrun-opra-flow.leaf.js';
|
|
291
301
|
export * from './utility/wrun/wrun-opra-lane.util.js';
|
|
292
302
|
export * from './utility/wrun/wrun-opra-stats.leaf.js';
|
|
293
|
-
export * from './utility/wrun/wrun-opra-underlying.util.js';
|
|
294
303
|
export * from './utility/wrun/wrun-option-contract-flow.util.js';
|
|
295
304
|
export * from './utility/wrun/wrun-option-knobs.util.js';
|
|
296
305
|
export * from './utility/wrun/wrun-option-prints.util.js';
|
|
297
306
|
export * from './utility/wrun/wrun-option-summary-lane.util.js';
|
|
307
|
+
export * from './utility/wrun/wrun-option-views.util.js';
|
|
298
308
|
export * from './utility/wrun/wrun-options-stop.util.js';
|
|
299
309
|
export * from './utility/wrun/wrun-output-style.util.js';
|
|
300
310
|
export * from './utility/wrun/wrun-overlay-drivers.util.js';
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,7 @@ export * from './utility/chart/cme-session-bucket.util.js';
|
|
|
76
76
|
export * from './utility/chart/cme-trade-calendar.util.js';
|
|
77
77
|
export * from './utility/chart/color-customization.leaf.js';
|
|
78
78
|
export * from './utility/chart/continuous-contracts.util.js';
|
|
79
|
+
export * from './utility/chart/crypto-index.leaf.js';
|
|
79
80
|
export * from './utility/chart/date-labelled-interval.leaf.js';
|
|
80
81
|
export * from './utility/chart/feed-interval.util.js';
|
|
81
82
|
export * from './utility/chart/fetch-dedupe-policy.util.js';
|
|
@@ -118,6 +119,7 @@ export * from './utility/chart/kscript-run-result-equality.util.js';
|
|
|
118
119
|
export * from './utility/chart/kscript-run-result-normalize.util.js';
|
|
119
120
|
export * from './utility/chart/kscript-run-result-shape.util.js';
|
|
120
121
|
export * from './utility/chart/kscript-settings-revision.leaf.js';
|
|
122
|
+
export * from './utility/chart/kscript-source-answer-budget.leaf.js';
|
|
121
123
|
export * from './utility/chart/kscript-source-degrade.leaf.js';
|
|
122
124
|
export * from './utility/chart/kscript-source-retention.util.js';
|
|
123
125
|
export * from './utility/chart/kscript-standin-identity.leaf.js';
|
|
@@ -139,6 +141,7 @@ export * from './utility/chart/local-technical-script-range.leaf.js';
|
|
|
139
141
|
export * from './utility/chart/market-session-schedule.util.js';
|
|
140
142
|
export * from './utility/chart/marketKind.util.js';
|
|
141
143
|
export * from './utility/chart/mixed-mode.util.js';
|
|
144
|
+
export * from './utility/chart/ny-calendar.util.js';
|
|
142
145
|
export * from './utility/chart/ohlcv-row-readiness.util.js';
|
|
143
146
|
export * from './utility/chart/om-panel-push-style.util.js';
|
|
144
147
|
export * from './utility/chart/om-panel.util.js';
|
|
@@ -202,6 +205,12 @@ export * from './utility/watchlist/import/import-request.leaf.js';
|
|
|
202
205
|
export * from './utility/watchlist/import/tradingview-symbols.leaf.js';
|
|
203
206
|
export * from './utility/wrun-alert-params.leaf.js';
|
|
204
207
|
export * from './utility/wrun-display-name.util.js';
|
|
208
|
+
export * from './utility/wrun/run-schedule/wrun-chart-gate-reader.util.js';
|
|
209
|
+
export * from './utility/wrun/run-schedule/wrun-gate-reader-warm.util.js';
|
|
210
|
+
export * from './utility/wrun/run-schedule/wrun-lane-groups.util.js';
|
|
211
|
+
export * from './utility/wrun/run-schedule/wrun-late-reads.util.js';
|
|
212
|
+
export * from './utility/wrun/run-schedule/wrun-own-candles.util.js';
|
|
213
|
+
export * from './utility/wrun/run-schedule/wrun-prefix-feeds.util.js';
|
|
205
214
|
export * from './utility/wrun/sources/host-grid-landing.js';
|
|
206
215
|
export * from './utility/wrun/sources/lanes/bitfinex_funding.js';
|
|
207
216
|
export * from './utility/wrun/sources/lanes/economic.js';
|
|
@@ -269,6 +278,7 @@ export * from './utility/wrun/wrun-inert-legend.util.js';
|
|
|
269
278
|
export * from './utility/wrun/wrun-input-requirements.leaf.js';
|
|
270
279
|
export * from './utility/wrun/wrun-integration-budget.util.js';
|
|
271
280
|
export * from './utility/wrun/wrun-integration-route.util.js';
|
|
281
|
+
export * from './utility/wrun/wrun-kit-run-tables.util.js';
|
|
272
282
|
export * from './utility/wrun/wrun-lane-refusal.leaf.js';
|
|
273
283
|
export * from './utility/wrun/wrun-lane-warmup.util.js';
|
|
274
284
|
export * from './utility/wrun/wrun-latest-history.leaf.js';
|
|
@@ -293,11 +303,11 @@ export * from './utility/wrun/wrun-oi-lane.util.js';
|
|
|
293
303
|
export * from './utility/wrun/wrun-opra-flow.leaf.js';
|
|
294
304
|
export * from './utility/wrun/wrun-opra-lane.util.js';
|
|
295
305
|
export * from './utility/wrun/wrun-opra-stats.leaf.js';
|
|
296
|
-
export * from './utility/wrun/wrun-opra-underlying.util.js';
|
|
297
306
|
export * from './utility/wrun/wrun-option-contract-flow.util.js';
|
|
298
307
|
export * from './utility/wrun/wrun-option-knobs.util.js';
|
|
299
308
|
export * from './utility/wrun/wrun-option-prints.util.js';
|
|
300
309
|
export * from './utility/wrun/wrun-option-summary-lane.util.js';
|
|
310
|
+
export * from './utility/wrun/wrun-option-views.util.js';
|
|
301
311
|
export * from './utility/wrun/wrun-options-stop.util.js';
|
|
302
312
|
export * from './utility/wrun/wrun-output-style.util.js';
|
|
303
313
|
export * from './utility/wrun/wrun-overlay-drivers.util.js';
|
|
@@ -2,6 +2,7 @@ import dayjs from 'dayjs';
|
|
|
2
2
|
import isoWeek from 'dayjs/plugin/isoWeek.js';
|
|
3
3
|
import timezone from 'dayjs/plugin/timezone.js';
|
|
4
4
|
import utc from 'dayjs/plugin/utc.js';
|
|
5
|
+
import { zoneWallMsAt } from '../../utility/chart/ny-calendar.util.js';
|
|
5
6
|
import { getTradingDayAnchor, getTradingDayTpoTimeRange } from '../../utility/chart/trading-day.util.js';
|
|
6
7
|
dayjs.extend(utc);
|
|
7
8
|
dayjs.extend(isoWeek);
|
|
@@ -122,14 +123,15 @@ const WALL_TIME_MEMO_CAP = 512;
|
|
|
122
123
|
const wallTimeUnixMemo = new Map();
|
|
123
124
|
/**
|
|
124
125
|
* The instant whose wall clock in `zone` reads `minutes` past midnight on
|
|
125
|
-
*
|
|
126
|
-
* `startOf('day').add(minutes, 'minute')` counts REAL
|
|
127
|
-
* by the offset delta on 23h/25h transition days. For
|
|
126
|
+
* the calendar date `dayKey` ('YYYY-MM-DD'). Parsing the wall string with
|
|
127
|
+
* dayjs.tz is DST-exact: `startOf('day').add(minutes, 'minute')` counts REAL
|
|
128
|
+
* minutes, which drifts by the offset delta on 23h/25h transition days. For
|
|
129
|
+
* UTC zones both agree.
|
|
128
130
|
*/
|
|
129
|
-
function wallTimeOnDay(
|
|
131
|
+
function wallTimeOnDay(dayKey, minutes, zone) {
|
|
130
132
|
const hours = String(Math.floor(minutes / 60)).padStart(2, '0');
|
|
131
133
|
const mins = String(minutes % 60).padStart(2, '0');
|
|
132
|
-
const wall = `${
|
|
134
|
+
const wall = `${dayKey} ${hours}:${mins}`;
|
|
133
135
|
try {
|
|
134
136
|
return dayjs.tz(wall, zone);
|
|
135
137
|
}
|
|
@@ -138,17 +140,40 @@ function wallTimeOnDay(day, minutes, zone) {
|
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
/** `wallTimeOnDay(...).unix()`, memoised per (day, minutes, zone): the same few wall times are asked every tick. */
|
|
141
|
-
function wallTimeUnixOnDay(
|
|
143
|
+
function wallTimeUnixOnDay(dayKey, minutes, zone) {
|
|
142
144
|
const key = `${dayKey}|${minutes}|${zone}`;
|
|
143
145
|
const hit = wallTimeUnixMemo.get(key);
|
|
144
146
|
if (hit !== undefined)
|
|
145
147
|
return hit;
|
|
146
|
-
const value = wallTimeOnDay(
|
|
148
|
+
const value = wallTimeOnDay(dayKey, minutes, zone).unix();
|
|
147
149
|
if (wallTimeUnixMemo.size >= WALL_TIME_MEMO_CAP)
|
|
148
150
|
wallTimeUnixMemo.clear();
|
|
149
151
|
wallTimeUnixMemo.set(key, value);
|
|
150
152
|
return value;
|
|
151
153
|
}
|
|
154
|
+
const DAY_MS = 86_400_000;
|
|
155
|
+
const pad = (value, width) => String(value).padStart(width, '0');
|
|
156
|
+
/**
|
|
157
|
+
* The 'YYYY-MM-DD' key of the `zone` calendar date after the one holding
|
|
158
|
+
* `timestamp` (unix seconds), as `unixInTimeZone(...).startOf('day').add(1, 'day')`
|
|
159
|
+
* formats it, from the zone clock (ny-calendar.util: one Intl reading per UTC
|
|
160
|
+
* day). An unknown zone reads UTC, as `unixInTimeZone` does; dayjs reads the
|
|
161
|
+
* instants the zone clock does not serve. The day cache is left alone: its
|
|
162
|
+
* last-day span is the one `resolveTpoTimeRangeWindow` answers from.
|
|
163
|
+
*/
|
|
164
|
+
function nextZoneDateKey(timestamp, zone) {
|
|
165
|
+
let wallMs;
|
|
166
|
+
try {
|
|
167
|
+
wallMs = zoneWallMsAt(zone, timestamp * 1000);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
wallMs = timestamp * 1000;
|
|
171
|
+
}
|
|
172
|
+
if (Number.isNaN(wallMs))
|
|
173
|
+
return unixInTimeZone(timestamp, zone).startOf('day').add(1, 'day').format('YYYY-MM-DD');
|
|
174
|
+
const next = new Date(Math.floor(wallMs / DAY_MS) * DAY_MS + DAY_MS);
|
|
175
|
+
return `${pad(next.getUTCFullYear(), 4)}-${pad(next.getUTCMonth() + 1, 2)}-${pad(next.getUTCDate(), 2)}`;
|
|
176
|
+
}
|
|
152
177
|
export function resolveTpoTimeRangeWindow(timestamp, customTimeRange) {
|
|
153
178
|
if (!customTimeRange)
|
|
154
179
|
return undefined;
|
|
@@ -165,22 +190,20 @@ export function resolveTpoTimeRangeWindow(timestamp, customTimeRange) {
|
|
|
165
190
|
const nextDay = dayStart.add(1, 'day');
|
|
166
191
|
const previousKey = previousDay.format('YYYY-MM-DD');
|
|
167
192
|
const nextKey = nextDay.format('YYYY-MM-DD');
|
|
168
|
-
const startToday = wallTimeUnixOnDay(
|
|
169
|
-
const endToday = wallTimeUnixOnDay(
|
|
193
|
+
const startToday = wallTimeUnixOnDay(dayKey, startMinutes, zone);
|
|
194
|
+
const endToday = wallTimeUnixOnDay(dayKey, endMinutes, zone);
|
|
170
195
|
if (startMinutes === endMinutes) {
|
|
171
196
|
const crossesIntoToday = timestamp < startToday;
|
|
172
|
-
const start = crossesIntoToday ? wallTimeUnixOnDay(
|
|
173
|
-
const end = crossesIntoToday ? startToday : wallTimeUnixOnDay(
|
|
197
|
+
const start = crossesIntoToday ? wallTimeUnixOnDay(previousKey, startMinutes, zone) : startToday;
|
|
198
|
+
const end = crossesIntoToday ? startToday : wallTimeUnixOnDay(nextKey, startMinutes, zone);
|
|
174
199
|
return { startSec: start, endSec: end, fullSession: true };
|
|
175
200
|
}
|
|
176
201
|
if (startMinutes < endMinutes) {
|
|
177
202
|
return { startSec: startToday, endSec: endToday, fullSession: false };
|
|
178
203
|
}
|
|
179
204
|
const isPostMidnightContinuation = timestamp < endToday;
|
|
180
|
-
const start = isPostMidnightContinuation
|
|
181
|
-
|
|
182
|
-
: startToday;
|
|
183
|
-
const end = isPostMidnightContinuation ? endToday : wallTimeUnixOnDay(nextDay, nextKey, endMinutes, zone);
|
|
205
|
+
const start = isPostMidnightContinuation ? wallTimeUnixOnDay(previousKey, startMinutes, zone) : startToday;
|
|
206
|
+
const end = isPostMidnightContinuation ? endToday : wallTimeUnixOnDay(nextKey, endMinutes, zone);
|
|
184
207
|
return { startSec: start, endSec: end, fullSession: false };
|
|
185
208
|
}
|
|
186
209
|
export function containsTpoWindowTime(timestamp, window) {
|
|
@@ -207,11 +230,12 @@ export function getNextTpoSessionStart(timestamp, sessionType, customTimeRange)
|
|
|
207
230
|
if (sessionType === 'Daily' && timeWindow) {
|
|
208
231
|
// The next session opens at the window's start wall time on the next
|
|
209
232
|
// wall day, computed wall-exactly: a flat +24h drifts by an hour across
|
|
210
|
-
// DST transitions (23h/25h days).
|
|
233
|
+
// DST transitions (23h/25h days). The date from the zone clock and the
|
|
234
|
+
// instant from the window's own wall-time memo: the TPO folds ask once
|
|
235
|
+
// per period, where three dayjs conversions ran each time.
|
|
211
236
|
const zone = timezoneName(customTimeRange?.timezone);
|
|
212
237
|
const startMinutes = parseTpoTimeToMinutes(customTimeRange?.start_time) ?? 0;
|
|
213
|
-
|
|
214
|
-
return wallTimeOnDay(startDay.add(1, 'day'), startMinutes, zone).unix();
|
|
238
|
+
return wallTimeUnixOnDay(nextZoneDateKey(timeWindow.startSec, zone), startMinutes, zone);
|
|
215
239
|
}
|
|
216
240
|
const date = dayjs.unix(timestamp).utc();
|
|
217
241
|
const offset = getTpoCrossDayOffset(customTimeRange);
|
|
@@ -161,7 +161,8 @@ export declare function marketDataAttestationRenewBy(venue: MarketDataVenue, att
|
|
|
161
161
|
export declare function isMarketDataAgreementCurrent(venue: MarketDataVenue, agreement: MarketDataAgreement | null | undefined): boolean;
|
|
162
162
|
/**
|
|
163
163
|
* Normalized checkout outcome. 'redirect' = leave for Stripe. 'refused' = the server declined (or the store answered a
|
|
164
|
-
* professional account itself); 'professional_unavailable'
|
|
164
|
+
* professional account itself); 'professional_unavailable' ends the purchase until a later non-professional declaration,
|
|
165
|
+
* never a re-price. 'busy' = a checkout is
|
|
165
166
|
* already in flight, or the guest wall took the click.
|
|
166
167
|
*/
|
|
167
168
|
export type MarketDataCheckoutResult = {
|
|
@@ -726,6 +726,13 @@ const METRIC_PROFILE_FIELDS = [
|
|
|
726
726
|
['deltaLayout', PREFERENCE],
|
|
727
727
|
['levelBasis', PREFERENCE],
|
|
728
728
|
];
|
|
729
|
+
/**
|
|
730
|
+
* The Symbol Comparison overlays (new price scale, same % scale, new pane): the name the user gave the series (`label`,
|
|
731
|
+
* the settings dialogs' Label row, web comparison-series-display.util) is instance state like its symbol. The row
|
|
732
|
+
* keeps it; a template or a saved default never renames another series. Scoped to the three types: the name is
|
|
733
|
+
* generic, and declared for every overlay it would start persisting other natives' engine keys.
|
|
734
|
+
*/
|
|
735
|
+
const SYMBOL_COMPARISON_FIELDS = [['label', INSTANCE]];
|
|
729
736
|
/**
|
|
730
737
|
* The fields one indicator type declares beyond INDICATOR_COMMON_FIELDS: a row here adds a key, or replaces the shared
|
|
731
738
|
* row of the same owner and key.
|
|
@@ -742,6 +749,9 @@ export const INDICATOR_TYPE_FIELDS = {
|
|
|
742
749
|
DELTA_PROFILE: [['profileWindow', PREFERENCE]],
|
|
743
750
|
OPEN_INTEREST_PROFILE: METRIC_PROFILE_FIELDS,
|
|
744
751
|
LIQUIDATION_PROFILE: METRIC_PROFILE_FIELDS,
|
|
752
|
+
SYMBOL_COMPARISON_SCALE: SYMBOL_COMPARISON_FIELDS,
|
|
753
|
+
SYMBOL_COMPARISON_PCT_SCALE: SYMBOL_COMPARISON_FIELDS,
|
|
754
|
+
SYMBOL_COMPARISON_PANE: SYMBOL_COMPARISON_FIELDS,
|
|
745
755
|
/** Margin Rates derives `multipleStyles` (a style row per source) from its own sources: never carried onto another row. */
|
|
746
756
|
MARGIN_RATES: [['multipleStyles', META_DERIVED]],
|
|
747
757
|
// The meta preferences the settings dialogs write (TEMPLATES-PLAN decision 6): template-lane.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRYPTOCAP: the venue of the crypto-wide indices and dominance series (BTC.D, TOTAL, TOTAL2, OTHERS.D, ...; see
|
|
3
|
+
* docs/features/data/cryptocap-indices.md). The backend prints each series as raw CRYPTO_DOMINANCE points and serves
|
|
4
|
+
* its candles as CRYPTO_DOMINANCE_AGG on tsdb-gateway v2: value candles with no volume, trades or book behind them.
|
|
5
|
+
*
|
|
6
|
+
* A leaf on purpose, with no imports: the market-kind table (`marketKind.util`) and the ticker hub and the sub-minute
|
|
7
|
+
* block (`index-mode.util`) both read this list, and neither may call into the other at module load. Web code asks
|
|
8
|
+
* `checkIsCryptoIndex` here, never through `index-mode.util` or `marketKind.util`: over a hundred specs mock those two
|
|
9
|
+
* with partial factories, and a predicate read through such a mock throws.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CRYPTO_INDEX_EXCHANGES: readonly ["CRYPTOCAP"];
|
|
12
|
+
/**
|
|
13
|
+
* A crypto index venue (`CRYPTO_INDEX_EXCHANGES`), the `'cryptoIndex'` market kind. Case-insensitive like the kind
|
|
14
|
+
* table, and a foreign shape (a persisted object, a number) is no venue, never a throw.
|
|
15
|
+
*/
|
|
16
|
+
export declare function checkIsCryptoIndex(exchange: string | undefined | null): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRYPTOCAP: the venue of the crypto-wide indices and dominance series (BTC.D, TOTAL, TOTAL2, OTHERS.D, ...; see
|
|
3
|
+
* docs/features/data/cryptocap-indices.md). The backend prints each series as raw CRYPTO_DOMINANCE points and serves
|
|
4
|
+
* its candles as CRYPTO_DOMINANCE_AGG on tsdb-gateway v2: value candles with no volume, trades or book behind them.
|
|
5
|
+
*
|
|
6
|
+
* A leaf on purpose, with no imports: the market-kind table (`marketKind.util`) and the ticker hub and the sub-minute
|
|
7
|
+
* block (`index-mode.util`) both read this list, and neither may call into the other at module load. Web code asks
|
|
8
|
+
* `checkIsCryptoIndex` here, never through `index-mode.util` or `marketKind.util`: over a hundred specs mock those two
|
|
9
|
+
* with partial factories, and a predicate read through such a mock throws.
|
|
10
|
+
*/
|
|
11
|
+
export const CRYPTO_INDEX_EXCHANGES = ['CRYPTOCAP'];
|
|
12
|
+
const CRYPTO_INDEX_EXCHANGES_SET = new Set(CRYPTO_INDEX_EXCHANGES);
|
|
13
|
+
/**
|
|
14
|
+
* A crypto index venue (`CRYPTO_INDEX_EXCHANGES`), the `'cryptoIndex'` market kind. Case-insensitive like the kind
|
|
15
|
+
* table, and a foreign shape (a persisted object, a number) is no venue, never a throw.
|
|
16
|
+
*/
|
|
17
|
+
export function checkIsCryptoIndex(exchange) {
|
|
18
|
+
return typeof exchange === 'string' && CRYPTO_INDEX_EXCHANGES_SET.has(exchange.toUpperCase());
|
|
19
|
+
}
|
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
* Two market facts narrow it for a browser-run Indicator's lanes (`wrunLaneServiceOnMarket`):
|
|
15
15
|
* - the market-kind table: forex and commodities trade no volume the chart can split, keep no
|
|
16
16
|
* book and list no options, so they serve no volume profile, buy/sell volume, order book,
|
|
17
|
-
* implied volatility or skew, whatever the index-mode admission lets through;
|
|
17
|
+
* implied volatility or skew, whatever the index-mode admission lets through; a crypto index
|
|
18
|
+
* (CRYPTOCAP, not index-mode: it fetches by period like crypto) serves its value candles and no
|
|
19
|
+
* other lane at all;
|
|
18
20
|
* - the coin table: the option-summary lanes (implied volatility, skew) hold a series for the
|
|
19
21
|
* coins `WRUN_OPTION_SUMMARY_COINS` lists (BTC and ETH) and no other.
|
|
20
22
|
* The dispatcher's own admission (`isKScriptTypeServedOnIndexMode`) stays as it is.
|
|
21
23
|
*/
|
|
24
|
+
import { checkIsCryptoIndex } from './crypto-index.leaf.js';
|
|
22
25
|
import { checkIsIndexMode } from './index-mode.util.js';
|
|
23
26
|
import { checkIsForexOrCommodity } from './marketKind.util.js';
|
|
24
27
|
import { WRUN_OPTION_SUMMARY_COINS, WRUN_OPTION_SUMMARY_LANES } from '../wrun/wrun-option-summary-lane.util.js';
|
|
@@ -34,6 +37,8 @@ const FOREX_COMMODITY_UNSERVED_TYPES = new Set([
|
|
|
34
37
|
WRUN_OPTION_SUMMARY_LANES.implied_volatility.type,
|
|
35
38
|
WRUN_OPTION_SUMMARY_LANES.skew.type,
|
|
36
39
|
]);
|
|
40
|
+
/** The one lane fetch type a crypto index market serves (the market-kind table): its value candles. */
|
|
41
|
+
const CRYPTO_INDEX_SERVED_TYPES = new Set(['ohlcv']);
|
|
37
42
|
/** The lane fetch types served for some coins only, and those coins (the coin table). */
|
|
38
43
|
const COIN_SERVED_TYPES = Object.freeze({
|
|
39
44
|
[WRUN_OPTION_SUMMARY_LANES.implied_volatility.type]: WRUN_OPTION_SUMMARY_COINS,
|
|
@@ -55,6 +60,9 @@ export function wrunLaneServiceOnMarket({ type, exchange, coin, nativeRows, }) {
|
|
|
55
60
|
if (FOREX_COMMODITY_UNSERVED_TYPES.has(type) && checkIsForexOrCommodity(exchange)) {
|
|
56
61
|
return { served: false, reason: 'market-kind' };
|
|
57
62
|
}
|
|
63
|
+
if (!CRYPTO_INDEX_SERVED_TYPES.has(type) && checkIsCryptoIndex(exchange)) {
|
|
64
|
+
return { served: false, reason: 'market-kind' };
|
|
65
|
+
}
|
|
58
66
|
const coins = COIN_SERVED_TYPES[type];
|
|
59
67
|
const word = typeof coin === 'string' ? coin.trim().toUpperCase() : '';
|
|
60
68
|
if (coins !== undefined && word !== '' && !coins.includes(word))
|
|
@@ -55,11 +55,17 @@ export declare function checkIsIndexMode(exchange: string | undefined): boolean;
|
|
|
55
55
|
/** An index venue (`INDEX_VENUE_EXCHANGES`): a quote series on the US session grid. */
|
|
56
56
|
export declare function checkIsIndexVenue(exchange: string | undefined): boolean;
|
|
57
57
|
/**
|
|
58
|
-
* Exchanges that
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
58
|
+
* Exchanges that print quotes instead of trades: value-only candles with no
|
|
59
|
+
* volume and a quote channel live (forex, commodity and the index venues on
|
|
60
|
+
* TICKER/TICKER_AGG, the crypto indices on CRYPTO_DOMINANCE/CRYPTO_DOMINANCE_AGG).
|
|
61
|
+
* The hub of the quote routing: the candle parse (the ohlcv and K_OHLCV
|
|
62
|
+
* workers keep a volume-less row), the sided-candle refusal and the live
|
|
63
|
+
* channel (`liveQuoteType`, live-feed-channel-factory.util) all read it; the
|
|
64
|
+
* wire candle Type follows `seriesDomainOf` (V2_CANDLE_TYPE). Governed CME
|
|
65
|
+
* needs no carve-out here: the flag-dependent kind already classifies it
|
|
66
|
+
* futures (TRADE data) with the release gate on and commodity (TICKER,
|
|
67
|
+
* fail-closed) with it off; both states are pinned by
|
|
68
|
+
* cme-futures-capability.spec.ts.
|
|
63
69
|
*/
|
|
64
70
|
export declare function checkIsTickerDataType(exchange: string | undefined): boolean;
|
|
65
71
|
export declare function checkIsBlockedOn1s(exchange: string | undefined): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { formatDisplayToExchange } from '../exchange-normalization.util.js';
|
|
2
|
+
import { CRYPTO_INDEX_EXCHANGES, checkIsCryptoIndex } from './crypto-index.leaf.js';
|
|
2
3
|
import { PREDICTION_MARKET_EXCHANGE_NAMES } from './prediction-identity.util.js';
|
|
3
4
|
// ============================================================================
|
|
4
5
|
// EXCHANGE CONSTANTS
|
|
@@ -48,10 +49,15 @@ const INDEX_MODE_EXCHANGES = [
|
|
|
48
49
|
...COMMODITY_EXCHANGES,
|
|
49
50
|
...INDEX_VENUE_EXCHANGES,
|
|
50
51
|
];
|
|
51
|
-
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity
|
|
52
|
-
// Prediction venues poll a price rather than printing trades, so none of them can
|
|
53
|
-
// host a 1s bar
|
|
54
|
-
|
|
52
|
+
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity + the
|
|
53
|
+
// crypto indices). Prediction venues poll a price rather than printing trades, so none of them can
|
|
54
|
+
// host a 1s bar: the list tracks the venue SET, not Polymarket alone. The crypto indices'
|
|
55
|
+
// candle tables start at 1m, so no sub-minute rung is ever served there.
|
|
56
|
+
const EXCHANGES_BLOCKED_ON_1S = [
|
|
57
|
+
...INDEX_MODE_EXCHANGES,
|
|
58
|
+
...PREDICTION_MARKET_EXCHANGE_NAMES,
|
|
59
|
+
...CRYPTO_INDEX_EXCHANGES,
|
|
60
|
+
];
|
|
55
61
|
const PM_SIGNAL_CRYPTO_SYMBOLS = ['BTC', 'ETH', 'SOL', 'XRP'];
|
|
56
62
|
const PM_SIGNAL_TRADFI_SYMBOLS = [
|
|
57
63
|
'TSLA',
|
|
@@ -315,14 +321,20 @@ export function checkIsIndexVenue(exchange) {
|
|
|
315
321
|
return checkIsExchangeInSet(exchange, INDEX_VENUE_EXCHANGES_SET);
|
|
316
322
|
}
|
|
317
323
|
/**
|
|
318
|
-
* Exchanges that
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
324
|
+
* Exchanges that print quotes instead of trades: value-only candles with no
|
|
325
|
+
* volume and a quote channel live (forex, commodity and the index venues on
|
|
326
|
+
* TICKER/TICKER_AGG, the crypto indices on CRYPTO_DOMINANCE/CRYPTO_DOMINANCE_AGG).
|
|
327
|
+
* The hub of the quote routing: the candle parse (the ohlcv and K_OHLCV
|
|
328
|
+
* workers keep a volume-less row), the sided-candle refusal and the live
|
|
329
|
+
* channel (`liveQuoteType`, live-feed-channel-factory.util) all read it; the
|
|
330
|
+
* wire candle Type follows `seriesDomainOf` (V2_CANDLE_TYPE). Governed CME
|
|
331
|
+
* needs no carve-out here: the flag-dependent kind already classifies it
|
|
332
|
+
* futures (TRADE data) with the release gate on and commodity (TICKER,
|
|
333
|
+
* fail-closed) with it off; both states are pinned by
|
|
334
|
+
* cme-futures-capability.spec.ts.
|
|
323
335
|
*/
|
|
324
336
|
export function checkIsTickerDataType(exchange) {
|
|
325
|
-
return checkIsForex(exchange) || checkIsCommodity(exchange) || checkIsIndexVenue(exchange);
|
|
337
|
+
return (checkIsForex(exchange) || checkIsCommodity(exchange) || checkIsIndexVenue(exchange) || checkIsCryptoIndex(exchange));
|
|
326
338
|
}
|
|
327
339
|
export function checkIsBlockedOn1s(exchange) {
|
|
328
340
|
if (isCmeFuturesPolicyActive(exchange))
|