@orangecharts/wrun-chart-host 0.7.1 → 0.9.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 +27 -4
- package/dist/constants/feature-flags.constants.d.ts +5 -0
- package/dist/constants/feature-flags.constants.js +32 -0
- package/dist/constants/marketCapabilities.constants.d.ts +14 -9
- package/dist/constants/marketCapabilities.constants.js +36 -13
- package/dist/constants/opra-compliance.constants.d.ts +14 -0
- package/dist/constants/opra-compliance.constants.js +14 -0
- package/dist/constants/option-venues.constants.d.ts +29 -6
- package/dist/constants/option-venues.constants.js +19 -2
- package/dist/constants/venue-presets.constants.d.ts +17 -3
- package/dist/constants/venue-presets.constants.js +17 -3
- package/dist/host-env.d.ts +34 -4
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +51 -3
- package/dist/index.d.ts +17 -0
- package/dist/index.js +17 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +40 -11
- package/dist/indicators/controls/tpo-session.util.js +138 -14
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/option-instrument.interface.d.ts +6 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +57 -10
- package/dist/kscript-data/controls/live-trades-merge.util.js +85 -16
- package/dist/market-data/billing.interface.d.ts +138 -17
- package/dist/market-data/billing.interface.js +25 -8
- package/dist/market-data/venues/index.d.ts +3 -3
- package/dist/market-data/venues/opra.contract.copy.json +5 -3
- package/dist/market-data/venues/opra.d.ts +3 -3
- package/dist/market-data/venues/opra.js +5 -4
- package/dist/replay/replayLadder.js +3 -1
- package/dist/settings-templates/footprint-rows.d.ts +25 -0
- package/dist/settings-templates/footprint-rows.js +127 -0
- package/dist/settings-templates/form-rows.d.ts +56 -0
- package/dist/settings-templates/form-rows.js +19 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/index.d.ts +10 -1
- package/dist/settings-templates/index.js +11 -2
- package/dist/settings-templates/indicator-fields.js +78 -0
- package/dist/settings-templates/tool-rules.d.ts +35 -9
- package/dist/settings-templates/tool-rules.js +42 -8
- package/dist/settings-templates/tool-tables.generated.js +13 -2
- package/dist/utility/chart/candle-volume-unit.leaf.d.ts +16 -0
- package/dist/utility/chart/candle-volume-unit.leaf.js +61 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/footprint-columns.util.d.ts +74 -0
- package/dist/utility/chart/footprint-columns.util.js +106 -0
- package/dist/utility/chart/footprint-display-mode.util.d.ts +40 -0
- package/dist/utility/chart/footprint-display-mode.util.js +62 -0
- package/dist/utility/chart/footprint-sierra-look.util.d.ts +2 -0
- package/dist/utility/chart/footprint-sierra-look.util.js +37 -0
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- package/dist/utility/chart/index-mode.util.d.ts +5 -2
- package/dist/utility/chart/index-mode.util.js +23 -13
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +28 -21
- package/dist/utility/chart/kscript-venue-policy.util.js +34 -26
- package/dist/utility/chart/marketKind.util.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.d.ts +11 -0
- package/dist/utility/chart/om-panel.util.js +65 -6
- package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
- package/dist/utility/chart/profile-block-size.util.js +7 -0
- package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
- package/dist/utility/chart/quote-perp.leaf.js +20 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +23 -1
- package/dist/utility/chart/window-geometry.leaf.js +78 -6
- package/dist/utility/chart/window-owner.leaf.d.ts +13 -0
- package/dist/utility/chart/window-owner.leaf.js +5 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -0
- package/dist/utility/chart/wrun-run-result.util.js +4 -1
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -0
- package/dist/utility/options/cme-options-root.util.d.ts +25 -0
- package/dist/utility/options/cme-options-root.util.js +40 -0
- package/dist/utility/options/option-book.util.d.ts +27 -0
- package/dist/utility/options/option-book.util.js +76 -0
- package/dist/utility/options/option-trade-date.util.d.ts +50 -0
- package/dist/utility/options/option-trade-date.util.js +120 -0
- package/dist/utility/options/option-venue.util.d.ts +3 -3
- package/dist/utility/options/option-venue.util.js +3 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +1 -1
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
- package/dist/utility/wrun/sources/host-grid-landing.d.ts +4 -2
- package/dist/utility/wrun/sources/host-grid-landing.js +8 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +40 -4
- package/dist/utility/wrun/sources/lanes/options_flow.js +115 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +12 -9
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +10 -7
- package/dist/utility/wrun/sources/row-lane-registry.js +10 -5
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +30 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +13 -5
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +25 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +161 -30
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.d.ts +4 -0
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +65 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +83 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +17 -1
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +33 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +7 -1
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +51 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +136 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +42 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +146 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +111 -20
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +291 -48
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
- package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +147 -9
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +345 -11
- package/dist/utility/wrun/wrun-cloud-record.leaf.d.ts +27 -0
- package/dist/utility/wrun/wrun-cloud-record.leaf.js +71 -0
- package/dist/utility/wrun/wrun-cloud-record.util.d.ts +4 -21
- package/dist/utility/wrun/wrun-cloud-record.util.js +5 -65
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +22 -9
- package/dist/utility/wrun/wrun-color-settings.util.js +57 -23
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +92 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +122 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +10 -3
- package/dist/utility/wrun/wrun-draft-overlay.util.js +63 -6
- package/dist/utility/wrun/wrun-frames.js +5 -5
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +11 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +33 -17
- package/dist/utility/wrun/wrun-hud-looks.util.js +30 -16
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +29 -3
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +33 -3
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-live-intake.util.js +136 -21
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -1
- package/dist/utility/wrun/wrun-live-tick.util.js +130 -44
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +224 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +342 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +88 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +471 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +43 -8
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +37 -6
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +51 -10
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +85 -33
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +172 -3
- package/dist/utility/wrun/wrun-option-prints.util.js +394 -17
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +218 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +365 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +797 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +231 -7
- package/dist/utility/wrun/wrun-option-views.util.js +643 -23
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +6 -4
- package/dist/utility/wrun/wrun-options-chain.util.js +8 -5
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +32 -3
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +34 -6
- package/dist/utility/wrun/wrun-overlay-run.util.js +527 -180
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +15 -0
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +22 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +13 -8
- package/dist/utility/wrun/wrun-pack.util.js +38 -21
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +62 -22
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +41 -14
- package/dist/utility/wrun/wrun-panel-style.util.js +86 -26
- package/dist/utility/wrun/wrun-param-map.util.d.ts +7 -6
- package/dist/utility/wrun/wrun-param-map.util.js +8 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +10 -2
- package/dist/utility/wrun/wrun-param-values.util.js +2 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal.util.js +17 -2
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-source-rows.util.js +92 -40
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +133 -48
- package/dist/utility/wrun/wrun-tape-source.util.js +205 -62
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
- package/dist/workers/utils/volume-profile.worker.util.js +5 -2
- package/dist/workers/wrun/wrun-abi-host.js +3 -2
- package/package.json +11 -11
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The footprint columns layout (titan P2, `displayMode: 'columns'`): Sierra Chart's Numbers Bars columns, BackQuant's
|
|
3
|
+
* "your own columns". Every bar's cell span splits into 2 to 4 equal columns, drawn left to right in
|
|
4
|
+
* `footprintColumns` order, one kind each:
|
|
5
|
+
*
|
|
6
|
+
* | kind | the column shows |
|
|
7
|
+
* | ------------------ | ---------------------------------------------------------------- |
|
|
8
|
+
* | 'bidAsk' | bid and ask in its two halves, on the cluster cell metric's heat |
|
|
9
|
+
* | 'delta' | delta on a cell in the sign's colour |
|
|
10
|
+
* | 'deltaColored' | delta in the up / down colour, no cell |
|
|
11
|
+
* | 'diagonalDelta' | the ask minus the bid one row below, on a cell |
|
|
12
|
+
* | 'deltaPct' | delta as a share of the row's volume, on a cell |
|
|
13
|
+
* | 'volume' | volume on a cell in the volume colour |
|
|
14
|
+
* | 'buy' / 'sell' | one side's volume on a cell in its colour |
|
|
15
|
+
* | 'volumeBar' | a volume bar and its number |
|
|
16
|
+
* | 'deltaBar' | a delta bar and its number |
|
|
17
|
+
* | 'volumeBarLeading' | a volume bar in the leading side's colour, no number |
|
|
18
|
+
* | 'splitBar' | the sell bar left of the column's centre, the buy bar right |
|
|
19
|
+
*
|
|
20
|
+
* Titan reads the list as written: invalid entries drop, the first four valid ones draw, and fewer than two valid
|
|
21
|
+
* ones draw its default (bid x ask, then delta). Outside the columns display mode titan ignores the list, so a
|
|
22
|
+
* footprint switched to another mode keeps its columns for the next switch back.
|
|
23
|
+
*
|
|
24
|
+
* Moved from web (src/utility/chart/footprint-columns.util.ts, now its shim), content unchanged: web's dialogs and the
|
|
25
|
+
* phone's settings form read the kinds, the presets and the writes from here (settings-templates/footprint-rows.ts).
|
|
26
|
+
*/
|
|
27
|
+
export const FOOTPRINT_COLUMN_KINDS = [
|
|
28
|
+
'bidAsk',
|
|
29
|
+
'delta',
|
|
30
|
+
'deltaColored',
|
|
31
|
+
'diagonalDelta',
|
|
32
|
+
'deltaPct',
|
|
33
|
+
'volume',
|
|
34
|
+
'buy',
|
|
35
|
+
'sell',
|
|
36
|
+
'volumeBar',
|
|
37
|
+
'deltaBar',
|
|
38
|
+
'volumeBarLeading',
|
|
39
|
+
'splitBar',
|
|
40
|
+
];
|
|
41
|
+
/** The display mode that draws the columns. */
|
|
42
|
+
export const FOOTPRINT_COLUMNS_DISPLAY_MODE = 'columns';
|
|
43
|
+
export const FOOTPRINT_COLUMNS_MIN = 2;
|
|
44
|
+
export const FOOTPRINT_COLUMNS_MAX = 4;
|
|
45
|
+
/** What titan draws in the columns layout without a valid list (the Bid x Ask + Delta preset). */
|
|
46
|
+
const FOOTPRINT_COLUMNS_DEFAULT = ['bidAsk', 'delta'];
|
|
47
|
+
/** One-click layouts: a preset writes `footprintColumns` and nothing else, so every column stays editable. */
|
|
48
|
+
export const FOOTPRINT_COLUMN_PRESETS = [
|
|
49
|
+
{ id: 'bidAskDelta', columns: ['bidAsk', 'delta'] },
|
|
50
|
+
{ id: 'deltaVolumeBar', columns: ['deltaColored', 'volume', 'volumeBar'] },
|
|
51
|
+
{ id: 'volumeDeltaBars', columns: ['volumeBar', 'deltaBar'] },
|
|
52
|
+
{ id: 'profileBars', columns: ['splitBar', 'volume'] },
|
|
53
|
+
];
|
|
54
|
+
const isColumnKind = (value) => FOOTPRINT_COLUMN_KINDS.includes(value);
|
|
55
|
+
/** Whether the footprint draws the columns layout. */
|
|
56
|
+
export function isFootprintColumnsMode(model) {
|
|
57
|
+
return model?.displayMode === FOOTPRINT_COLUMNS_DISPLAY_MODE;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A saved `footprintColumns` as titan reads it: its valid kinds in order, the first four. Undefined when fewer than
|
|
61
|
+
* two are valid (titan then draws its default), so only a list titan draws as written is carried and saved.
|
|
62
|
+
*/
|
|
63
|
+
export function footprintColumnsOf(value) {
|
|
64
|
+
if (!Array.isArray(value))
|
|
65
|
+
return undefined;
|
|
66
|
+
const columns = value.filter(isColumnKind).slice(0, FOOTPRINT_COLUMNS_MAX);
|
|
67
|
+
return columns.length >= FOOTPRINT_COLUMNS_MIN ? columns : undefined;
|
|
68
|
+
}
|
|
69
|
+
/** The columns the footprint draws in the columns layout: its own list, else titan's default. */
|
|
70
|
+
export function footprintColumnsShown(model) {
|
|
71
|
+
return footprintColumnsOf(model.footprintColumns) ?? FOOTPRINT_COLUMNS_DEFAULT.slice();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The model with column `index` (0 = the left one) set to `pick`. A kind replaces that column, or adds one when the
|
|
75
|
+
* index is past the last column; 'off' removes it and the columns after it move left. A pick that names no kind, or
|
|
76
|
+
* that would leave fewer than two columns, returns the model unchanged: the dialog never saves a list titan would
|
|
77
|
+
* not draw as written.
|
|
78
|
+
*/
|
|
79
|
+
export function withFootprintColumn(model, index, pick) {
|
|
80
|
+
if (!Number.isInteger(index) || index < 0 || index >= FOOTPRINT_COLUMNS_MAX)
|
|
81
|
+
return model;
|
|
82
|
+
const columns = footprintColumnsShown(model);
|
|
83
|
+
if (pick === 'off') {
|
|
84
|
+
if (index >= columns.length)
|
|
85
|
+
return model;
|
|
86
|
+
columns.splice(index, 1);
|
|
87
|
+
}
|
|
88
|
+
else if (isColumnKind(pick)) {
|
|
89
|
+
columns[Math.min(index, columns.length)] = pick;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
return model;
|
|
93
|
+
}
|
|
94
|
+
return columns.length >= FOOTPRINT_COLUMNS_MIN ? { ...model, footprintColumns: columns } : model;
|
|
95
|
+
}
|
|
96
|
+
/** The model with a preset's columns. */
|
|
97
|
+
export function withFootprintColumnsPreset(model, id) {
|
|
98
|
+
const preset = FOOTPRINT_COLUMN_PRESETS.find((entry) => entry.id === id);
|
|
99
|
+
return preset ? { ...model, footprintColumns: [...preset.columns] } : model;
|
|
100
|
+
}
|
|
101
|
+
/** The preset the footprint's columns are (no list of its own reads as titan's default), or null for its own. */
|
|
102
|
+
export function footprintColumnsPresetOf(model) {
|
|
103
|
+
const shown = footprintColumnsShown(model);
|
|
104
|
+
const preset = FOOTPRINT_COLUMN_PRESETS.find(({ columns }) => columns.length === shown.length && columns.every((kind, index) => kind === shown[index]));
|
|
105
|
+
return preset?.id ?? null;
|
|
106
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The footprint display mode rules a settings form writes by: titan's cell-grid family, the bar width each mode draws
|
|
3
|
+
* at, the modes a form offers, the mode it shows, and the model a display mode pick writes. Both web footprint dialogs
|
|
4
|
+
* write by them, the Classic Presets patch reads the bar width (./footprint-sierra-look.util), and a host's settings
|
|
5
|
+
* form reads all of them through settings-templates/footprint-rows.ts.
|
|
6
|
+
*
|
|
7
|
+
* Web still holds its own copies: the family and the bar width in src/indicators/controls/footprint-display-mode.util.ts,
|
|
8
|
+
* the offered modes in footprintSettingsTabs.ts createFootprintDisplayModeOptions, the pick as its
|
|
9
|
+
* withFootprintDisplayMode, and the shown mode as VolumeFootprintSettings.vue's currentDisplayMode. Until web reads them
|
|
10
|
+
* from here, tests/packages/wrun-chart-host/utility/chart/footprint-display-mode.util.spec.ts holds every copy it can
|
|
11
|
+
* import equal to this module.
|
|
12
|
+
*/
|
|
13
|
+
export type FootprintClusterGridDisplayMode = 'cluster' | 'imbalance-only' | 'ladder';
|
|
14
|
+
/** Whether a display mode draws titan's cell grid (cluster, imbalance-only, ladder). */
|
|
15
|
+
export declare function isClusterGridProfileDisplayMode(displayMode: unknown): displayMode is FootprintClusterGridDisplayMode;
|
|
16
|
+
/** The bar width a display mode draws at: the stacked bars 0.7, the split bar and the cell grid 1, else `fallback`. */
|
|
17
|
+
export declare function getFootprintDisplayModeBarWidth(displayMode: string, fallback?: number): number;
|
|
18
|
+
/** The display modes a footprint settings form offers, in the order both web dialogs list them. */
|
|
19
|
+
export declare const FOOTPRINT_DISPLAY_MODES: readonly ["split-bar", "stacked-bar-delta", "stacked-bar", "cluster", "imbalance-only", "ladder", "columns"];
|
|
20
|
+
export type FootprintDisplayMode = (typeof FOOTPRINT_DISPLAY_MODES)[number];
|
|
21
|
+
type DisplayModeModel = {
|
|
22
|
+
displayMode?: unknown;
|
|
23
|
+
showDelta?: unknown;
|
|
24
|
+
barWidth?: unknown;
|
|
25
|
+
stickToLeft?: unknown;
|
|
26
|
+
clusterCellMetric?: unknown;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The display mode a form shows for a model, as the Volume Footprint dialog reads it: a cell-grid mode as it is, and the
|
|
30
|
+
* legacy delta flag (`showDelta`, from before the stacked delta mode had its own name) as the stacked delta mode on
|
|
31
|
+
* any other bar. No mode reads as the split bar. A read only: nothing is written until a pick.
|
|
32
|
+
*/
|
|
33
|
+
export declare function footprintDisplayModeShown(model: DisplayModeModel): string;
|
|
34
|
+
/**
|
|
35
|
+
* The model on `displayMode`, as both footprint dialogs write a display mode pick: the legacy delta flag only for the
|
|
36
|
+
* stacked delta mode, the bar width of the mode's family, the cells anchored left, and on a cell grid the cluster cell
|
|
37
|
+
* metric's default (the columns layout is one of titan's cluster-grid family: its bid x ask column reads the metric).
|
|
38
|
+
*/
|
|
39
|
+
export declare function withFootprintDisplayMode<T extends DisplayModeModel>(model: T, displayMode: string): T;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { FOOTPRINT_COLUMNS_DISPLAY_MODE } from './footprint-columns.util.js';
|
|
2
|
+
const FOOTPRINT_CLUSTER_GRID_DISPLAY_MODES = ['cluster', 'imbalance-only', 'ladder'];
|
|
3
|
+
/** Whether a display mode draws titan's cell grid (cluster, imbalance-only, ladder). */
|
|
4
|
+
export function isClusterGridProfileDisplayMode(displayMode) {
|
|
5
|
+
return (typeof displayMode === 'string' &&
|
|
6
|
+
FOOTPRINT_CLUSTER_GRID_DISPLAY_MODES.includes(displayMode));
|
|
7
|
+
}
|
|
8
|
+
/** The bar width a display mode draws at: the stacked bars 0.7, the split bar and the cell grid 1, else `fallback`. */
|
|
9
|
+
export function getFootprintDisplayModeBarWidth(displayMode, fallback = 0.7) {
|
|
10
|
+
if (displayMode === 'stacked-bar' || displayMode === 'stacked-bar-delta')
|
|
11
|
+
return 0.7;
|
|
12
|
+
if (displayMode === 'split-bar' || isClusterGridProfileDisplayMode(displayMode))
|
|
13
|
+
return 1.0;
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
/** The display modes a footprint settings form offers, in the order both web dialogs list them. */
|
|
17
|
+
export const FOOTPRINT_DISPLAY_MODES = [
|
|
18
|
+
'split-bar',
|
|
19
|
+
'stacked-bar-delta',
|
|
20
|
+
'stacked-bar',
|
|
21
|
+
'cluster',
|
|
22
|
+
'imbalance-only',
|
|
23
|
+
'ladder',
|
|
24
|
+
FOOTPRINT_COLUMNS_DISPLAY_MODE,
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* The display mode a form shows for a model, as the Volume Footprint dialog reads it: a cell-grid mode as it is, and the
|
|
28
|
+
* legacy delta flag (`showDelta`, from before the stacked delta mode had its own name) as the stacked delta mode on
|
|
29
|
+
* any other bar. No mode reads as the split bar. A read only: nothing is written until a pick.
|
|
30
|
+
*/
|
|
31
|
+
export function footprintDisplayModeShown(model) {
|
|
32
|
+
const displayMode = (model.displayMode ?? 'split-bar');
|
|
33
|
+
const showDelta = model.showDelta ?? false;
|
|
34
|
+
if (isClusterGridProfileDisplayMode(displayMode))
|
|
35
|
+
return displayMode;
|
|
36
|
+
if (displayMode === 'split-bar' && !showDelta)
|
|
37
|
+
return 'split-bar';
|
|
38
|
+
if (displayMode === 'stacked-bar' && !showDelta)
|
|
39
|
+
return 'stacked-bar';
|
|
40
|
+
if (showDelta || displayMode === 'stacked-bar-delta')
|
|
41
|
+
return 'stacked-bar-delta';
|
|
42
|
+
return displayMode;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The model on `displayMode`, as both footprint dialogs write a display mode pick: the legacy delta flag only for the
|
|
46
|
+
* stacked delta mode, the bar width of the mode's family, the cells anchored left, and on a cell grid the cluster cell
|
|
47
|
+
* metric's default (the columns layout is one of titan's cluster-grid family: its bid x ask column reads the metric).
|
|
48
|
+
*/
|
|
49
|
+
export function withFootprintDisplayMode(model, displayMode) {
|
|
50
|
+
const cellGrid = isClusterGridProfileDisplayMode(displayMode) || displayMode === FOOTPRINT_COLUMNS_DISPLAY_MODE;
|
|
51
|
+
const next = {
|
|
52
|
+
...model,
|
|
53
|
+
displayMode,
|
|
54
|
+
showDelta: displayMode === 'stacked-bar-delta',
|
|
55
|
+
// Web passes the stored width through as it is (`model.barWidth ?? 0.7`); only a mode no rule names returns it.
|
|
56
|
+
barWidth: getFootprintDisplayModeBarWidth(cellGrid ? 'cluster' : displayMode, (model.barWidth ?? 0.7)),
|
|
57
|
+
stickToLeft: true,
|
|
58
|
+
};
|
|
59
|
+
if (cellGrid && !next.clusterCellMetric)
|
|
60
|
+
next.clusterCellMetric = 'delta';
|
|
61
|
+
return next;
|
|
62
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getFootprintDisplayModeBarWidth } from './footprint-display-mode.util.js';
|
|
2
|
+
/**
|
|
3
|
+
* The one-click Sierra look for both footprints: Sierra Chart's Numbers Bars as traders set them up. Cluster cells
|
|
4
|
+
* (bid x ask), each side shaded by its own volume on 4 hard steps, pure green buy steps (0,127,0) to (0,255,0) and
|
|
5
|
+
* pure red sell steps (127,0,0) to (255,0,0), each bar's largest and smallest row boxed by volume, no value-area
|
|
6
|
+
* band, and an outline candle beside the cells.
|
|
7
|
+
*
|
|
8
|
+
* It writes ordinary settings keys and nothing else, so every one stays editable in the dialog, a saved layout
|
|
9
|
+
* keeps it like any edit, and Reset returns to the defaults. The step colours are explicit picks: a theme switch
|
|
10
|
+
* leaves them alone, as it leaves any colour the user picked.
|
|
11
|
+
*
|
|
12
|
+
* The UI calls it Classic Presets (the product never names Sierra Chart); the code name stays. Moved from web
|
|
13
|
+
* (src/utility/chart/footprint-sierra-look.util.ts, now its shim), content unchanged: the bar width rule it reads is
|
|
14
|
+
* this package's copy of web's (./footprint-display-mode.util).
|
|
15
|
+
*/
|
|
16
|
+
const SIERRA_LOOK_BUY_STEP_COLORS = ['#007f00', '#00aa00', '#00d400', '#00ff00'];
|
|
17
|
+
const SIERRA_LOOK_SELL_STEP_COLORS = ['#7f0000', '#aa0000', '#d40000', '#ff0000'];
|
|
18
|
+
/** The model with the Sierra look on top; the display mode change carries what a pick of Cluster carries. */
|
|
19
|
+
export function withFootprintSierraLook(model) {
|
|
20
|
+
const barWidth = typeof model.barWidth === 'number' ? model.barWidth : 0.7;
|
|
21
|
+
return {
|
|
22
|
+
...model,
|
|
23
|
+
displayMode: 'cluster',
|
|
24
|
+
showDelta: false,
|
|
25
|
+
barWidth: getFootprintDisplayModeBarWidth('cluster', barWidth),
|
|
26
|
+
stickToLeft: true,
|
|
27
|
+
clusterCellMetric: 'volume',
|
|
28
|
+
cellShading: 'steps',
|
|
29
|
+
shadingSteps: 4,
|
|
30
|
+
// The even split: steps at 25%, 50% and 75% of the loudest cell.
|
|
31
|
+
shadingThresholds: undefined,
|
|
32
|
+
shadingStepColors: { buy: [...SIERRA_LOOK_BUY_STEP_COLORS], sell: [...SIERRA_LOOK_SELL_STEP_COLORS] },
|
|
33
|
+
highlightExtremes: 'volume',
|
|
34
|
+
showValueAreaBand: false,
|
|
35
|
+
candleMarker: 'outline',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
* book and list no options, so they serve no volume profile, buy/sell volume, order book,
|
|
17
17
|
* implied volatility or skew, whatever the index-mode admission lets through; a crypto index
|
|
18
18
|
* (CRYPTOCAP, not index-mode: it fetches by period like crypto) serves its value candles and no
|
|
19
|
-
* other lane at all;
|
|
19
|
+
* other lane at all; a quote-priced perpetual market (Variational, also period-fetched) serves its
|
|
20
|
+
* quote candles, funding and open interest, and no trade, volume, book, profile or options lane;
|
|
20
21
|
* - the coin table: the option-summary lanes (implied volatility, skew) hold a series for the
|
|
21
22
|
* coins `WRUN_OPTION_SUMMARY_COINS` lists (BTC and ETH) and no other.
|
|
22
23
|
* The dispatcher's own admission (`isKScriptTypeServedOnIndexMode`) stays as it is.
|
|
23
24
|
*/
|
|
24
25
|
import { checkIsCryptoIndex } from './crypto-index.leaf.js';
|
|
26
|
+
import { checkIsQuotePerp } from './quote-perp.leaf.js';
|
|
25
27
|
import { checkIsIndexMode } from './index-mode.util.js';
|
|
26
28
|
import { checkIsForexOrCommodity } from './marketKind.util.js';
|
|
27
29
|
import { WRUN_OPTION_SUMMARY_COINS, WRUN_OPTION_SUMMARY_LANES } from '../wrun/wrun-option-summary-lane.util.js';
|
|
@@ -39,6 +41,9 @@ const FOREX_COMMODITY_UNSERVED_TYPES = new Set([
|
|
|
39
41
|
]);
|
|
40
42
|
/** The one lane fetch type a crypto index market serves (the market-kind table): its value candles. */
|
|
41
43
|
const CRYPTO_INDEX_SERVED_TYPES = new Set(['ohlcv']);
|
|
44
|
+
/** The lane fetch types a quote-priced perpetual market serves (the market-kind table): its quote candles and the
|
|
45
|
+
* two perpetual series the gateway serves beside them. */
|
|
46
|
+
const QUOTE_PERP_SERVED_TYPES = new Set(['ohlcv', 'funding_rate', 'open_interest']);
|
|
42
47
|
/** The lane fetch types served for some coins only, and those coins (the coin table). */
|
|
43
48
|
const COIN_SERVED_TYPES = Object.freeze({
|
|
44
49
|
[WRUN_OPTION_SUMMARY_LANES.implied_volatility.type]: WRUN_OPTION_SUMMARY_COINS,
|
|
@@ -63,6 +68,9 @@ export function wrunLaneServiceOnMarket({ type, exchange, coin, nativeRows, }) {
|
|
|
63
68
|
if (!CRYPTO_INDEX_SERVED_TYPES.has(type) && checkIsCryptoIndex(exchange)) {
|
|
64
69
|
return { served: false, reason: 'market-kind' };
|
|
65
70
|
}
|
|
71
|
+
if (!QUOTE_PERP_SERVED_TYPES.has(type) && checkIsQuotePerp(exchange)) {
|
|
72
|
+
return { served: false, reason: 'market-kind' };
|
|
73
|
+
}
|
|
66
74
|
const coins = COIN_SERVED_TYPES[type];
|
|
67
75
|
const word = typeof coin === 'string' ? coin.trim().toUpperCase() : '';
|
|
68
76
|
if (coins !== undefined && word !== '' && !coins.includes(word))
|
|
@@ -56,8 +56,11 @@ export declare function checkIsIndexMode(exchange: string | undefined): boolean;
|
|
|
56
56
|
export declare function checkIsIndexVenue(exchange: string | undefined): boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Exchanges that print quotes instead of trades: value-only candles with no
|
|
59
|
-
* volume and a quote channel live (forex, commodity
|
|
60
|
-
* TICKER/TICKER_AGG, the crypto indices on
|
|
59
|
+
* volume and a quote channel live (forex, commodity, the index venues and the
|
|
60
|
+
* quote-priced perpetual venues on TICKER/TICKER_AGG, the crypto indices on
|
|
61
|
+
* CRYPTO_DOMINANCE/CRYPTO_DOMINANCE_AGG). A venue the gateway serves only as
|
|
62
|
+
* quotes must answer true here: unlisted, it reads as crypto and asks for
|
|
63
|
+
* trades it is never served (venue-price-source.ratchet.spec.ts).
|
|
61
64
|
* The hub of the quote routing: the candle parse (the ohlcv and K_OHLCV
|
|
62
65
|
* workers keep a volume-less row), the sided-candle refusal and the live
|
|
63
66
|
* channel (`liveQuoteType`, live-feed-channel-factory.util) all read it; the
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { formatDisplayToExchange } from '../exchange-normalization.util.js';
|
|
2
|
-
import {
|
|
2
|
+
import { checkIsCryptoIndex } from './crypto-index.leaf.js';
|
|
3
|
+
import { checkIsQuotePerp } from './quote-perp.leaf.js';
|
|
3
4
|
import { PREDICTION_MARKET_EXCHANGE_NAMES } from './prediction-identity.util.js';
|
|
4
5
|
// ============================================================================
|
|
5
6
|
// EXCHANGE CONSTANTS
|
|
@@ -49,15 +50,12 @@ const INDEX_MODE_EXCHANGES = [
|
|
|
49
50
|
...COMMODITY_EXCHANGES,
|
|
50
51
|
...INDEX_VENUE_EXCHANGES,
|
|
51
52
|
];
|
|
52
|
-
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
...PREDICTION_MARKET_EXCHANGE_NAMES,
|
|
59
|
-
...CRYPTO_INDEX_EXCHANGES,
|
|
60
|
-
];
|
|
53
|
+
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity). Prediction
|
|
54
|
+
// venues poll a price rather than printing trades, so none of them can host a 1s bar: the list tracks
|
|
55
|
+
// the venue SET, not Polymarket alone. The crypto indices (CRYPTOCAP) are not here: their 1s candles
|
|
56
|
+
// read the raw prints (tsdb-gateway's crypto_dominance_agg_1s tier), like a crypto pair's trades. The
|
|
57
|
+
// quote-priced perpetual venues are blocked by their own predicate (checkIsBlockedOn1s).
|
|
58
|
+
const EXCHANGES_BLOCKED_ON_1S = [...INDEX_MODE_EXCHANGES, ...PREDICTION_MARKET_EXCHANGE_NAMES];
|
|
61
59
|
const PM_SIGNAL_CRYPTO_SYMBOLS = ['BTC', 'ETH', 'SOL', 'XRP'];
|
|
62
60
|
const PM_SIGNAL_TRADFI_SYMBOLS = [
|
|
63
61
|
'TSLA',
|
|
@@ -322,8 +320,11 @@ export function checkIsIndexVenue(exchange) {
|
|
|
322
320
|
}
|
|
323
321
|
/**
|
|
324
322
|
* Exchanges that print quotes instead of trades: value-only candles with no
|
|
325
|
-
* volume and a quote channel live (forex, commodity
|
|
326
|
-
* TICKER/TICKER_AGG, the crypto indices on
|
|
323
|
+
* volume and a quote channel live (forex, commodity, the index venues and the
|
|
324
|
+
* quote-priced perpetual venues on TICKER/TICKER_AGG, the crypto indices on
|
|
325
|
+
* CRYPTO_DOMINANCE/CRYPTO_DOMINANCE_AGG). A venue the gateway serves only as
|
|
326
|
+
* quotes must answer true here: unlisted, it reads as crypto and asks for
|
|
327
|
+
* trades it is never served (venue-price-source.ratchet.spec.ts).
|
|
327
328
|
* The hub of the quote routing: the candle parse (the ohlcv and K_OHLCV
|
|
328
329
|
* workers keep a volume-less row), the sided-candle refusal and the live
|
|
329
330
|
* channel (`liveQuoteType`, live-feed-channel-factory.util) all read it; the
|
|
@@ -334,7 +335,11 @@ export function checkIsIndexVenue(exchange) {
|
|
|
334
335
|
* cme-futures-capability.spec.ts.
|
|
335
336
|
*/
|
|
336
337
|
export function checkIsTickerDataType(exchange) {
|
|
337
|
-
return (checkIsForex(exchange) ||
|
|
338
|
+
return (checkIsForex(exchange) ||
|
|
339
|
+
checkIsCommodity(exchange) ||
|
|
340
|
+
checkIsIndexVenue(exchange) ||
|
|
341
|
+
checkIsCryptoIndex(exchange) ||
|
|
342
|
+
checkIsQuotePerp(exchange));
|
|
338
343
|
}
|
|
339
344
|
export function checkIsBlockedOn1s(exchange) {
|
|
340
345
|
if (isCmeFuturesPolicyActive(exchange))
|
|
@@ -345,6 +350,11 @@ export function checkIsBlockedOn1s(exchange) {
|
|
|
345
350
|
// sub-minute rung (1s 5s 15s 30s) is ever servable on a contract.
|
|
346
351
|
if (isOpraGoverned(exchange))
|
|
347
352
|
return true;
|
|
353
|
+
// Quote-priced perpetual venues: the gateway serves TICKER_AGG from the
|
|
354
|
+
// minute up ("interval SECOND is not served for TICKER_AGG"). The leaf
|
|
355
|
+
// predicate, case-insensitive like the kind that routes their quotes.
|
|
356
|
+
if (checkIsQuotePerp(exchange))
|
|
357
|
+
return true;
|
|
348
358
|
return checkIsExchangeInSet(exchange, EXCHANGES_BLOCKED_ON_1S_SET);
|
|
349
359
|
}
|
|
350
360
|
export function getMarketType(exchange) {
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* equity and index options, Kyle 2026-10-14) draws the same line: chart-only
|
|
7
7
|
* first-party indicators are display use, user-authored scripting waits for
|
|
8
8
|
* OPRA's confirmation. Kyle 2026-10-17 assumed that confirmation behind the
|
|
9
|
-
* `opra-user-scripts` flag
|
|
10
|
-
*
|
|
11
|
-
* the display wall, the data wall and the engine policy
|
|
12
|
-
*
|
|
9
|
+
* `opra-user-scripts` flag; since 2026-10-22 (the OPRA gate compliance round,
|
|
10
|
+
* plan row D3) the policy no longer reads it: `isOpraUserScriptRun`, ONE
|
|
11
|
+
* decision for the display wall, the data wall and the engine policy, refuses
|
|
12
|
+
* every user run, so a lit flag reads exactly like a dark one. A scope
|
|
13
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8,
|
|
14
|
+
* Q12, Q13) must come before it opens again. This module is the single
|
|
15
|
+
* decider for both planes.
|
|
13
16
|
* Every run door (add, mount, protected fetch, cache paint, alerts arm,
|
|
14
17
|
* editor Run), the per-payload data guard in titan-charts dataFetch, and the
|
|
15
18
|
* engine policy descriptor consult it; nothing else may re-derive provenance
|
|
@@ -95,20 +98,25 @@ export declare function isFirstPartyKScriptRun(settings: KScriptProvenanceSettin
|
|
|
95
98
|
* server lane, which reads governed data through its own gate identity (UW-PARITY H3), so a browser flag never opens
|
|
96
99
|
* a plane to them. A Cloud run is the record on the socket row source (`wrunRowSourceKindOf`), read through the
|
|
97
100
|
* migration on read (`wrunCloudRecordOf`): the wave-3 record (`wrunRunTarget: 'cloud'`, no `wrunRef`) and a record
|
|
98
|
-
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag
|
|
99
|
-
* without the flag where a door must know a decision waits on it (the
|
|
101
|
+
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag opened the OPRA plane to while it
|
|
102
|
+
* was honoured (`isOpraUserScriptRun`); read without the flag where a door must know a decision waits on it (the
|
|
103
|
+
* flag's hydration).
|
|
100
104
|
*/
|
|
101
105
|
export declare function isOpraUserScriptCandidate(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
102
106
|
/**
|
|
103
|
-
* Whether the
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
107
|
+
* Whether the OPRA plane is open to this user run. The ONE decision every OPRA door reads, directly or through the
|
|
108
|
+
* walls below: the display wall, the data wall (the dataFetch door, the protected pre-flight, the cache paint), the
|
|
109
|
+
* engine policy, and the wrun chain decision. The CME plane never reads it.
|
|
110
|
+
*
|
|
111
|
+
* Always false (2026-10-22, the OPRA gate compliance round, plan row D3): the `opra-user-scripts` flag (Kyle
|
|
112
|
+
* 2026-10-17: the OPRA permission for user-authored scripts assumed) opened the plane to a browser user run
|
|
113
|
+
* (`isOpraUserScriptCandidate`) while lit; it is no longer honoured, and stays defined only so nothing that names it
|
|
114
|
+
* breaks. OPRA's approval covers web display only: user-authored scripting over OPRA data stays refused until a scope
|
|
115
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8, Q12, Q13) allows it.
|
|
108
116
|
*/
|
|
109
|
-
export declare function isOpraUserScriptRun(
|
|
110
|
-
/** Whether a run may consume the OPRA plane's data: every first-party run, and
|
|
111
|
-
*
|
|
117
|
+
export declare function isOpraUserScriptRun(_settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
118
|
+
/** Whether a run may consume the OPRA plane's data: every first-party run, and no user run (`isOpraUserScriptRun`;
|
|
119
|
+
* `mayReadOpra`, the one decision the wrun run head and every source lane read too). */
|
|
112
120
|
export declare function isOpraReadableKScriptRun(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
113
121
|
/** Whether a source exchange touches a CME-governed venue (the CME-only curation and copy). */
|
|
114
122
|
export declare function payloadTouchesCmeVenue(exchange: unknown): boolean;
|
|
@@ -132,8 +140,8 @@ export declare function payloadTouchesGovernedVenue(exchange: unknown): boolean;
|
|
|
132
140
|
* teardown, resubscribe, self-heal, suite/layout/copy apply) consult
|
|
133
141
|
* isKScriptDisplayBlockedOnExchange below instead, which is a strict superset
|
|
134
142
|
* of this predicate. Per plane: a CME leg blocks every user run; an OPRA leg
|
|
135
|
-
* blocks
|
|
136
|
-
*
|
|
143
|
+
* blocks every user run too (`isOpraReadableKScriptRun`: the flag that could
|
|
144
|
+
* open the plane is no longer honoured, see `isOpraUserScriptRun`).
|
|
137
145
|
*/
|
|
138
146
|
export declare function isUserKScriptBlockedOnExchange(exchange: unknown, settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
139
147
|
/**
|
|
@@ -171,9 +179,8 @@ export declare function isUserKScriptBlockedOnExchange(exchange: unknown, settin
|
|
|
171
179
|
* OPRA (no CME leg): every first-party run is explicitly venue-approved, the
|
|
172
180
|
* built-ins, the converted corpus, the official docs and the official
|
|
173
181
|
* packages alike (chart-only display use under the OPRA licence), and every
|
|
174
|
-
* user run is blocked
|
|
175
|
-
*
|
|
176
|
-
* decision). The CME per-script curation is CME evidence and does not apply
|
|
182
|
+
* user run is blocked (the data wall's own per-plane verdict, so the two walls
|
|
183
|
+
* read one decision, `isOpraUserScriptRun`). The CME per-script curation is CME evidence and does not apply
|
|
177
184
|
* there; a book-reading official is refused by the options mode (OPRA has no
|
|
178
185
|
* book), not by this wall.
|
|
179
186
|
*/
|
|
@@ -199,8 +206,8 @@ export declare function shouldBlockKScriptSourcePayload(args: {
|
|
|
199
206
|
* engine: first-party runs get no engine policy at all; user runs get the
|
|
200
207
|
* governed set of every gate plane as deniedExchanges once the engine pin
|
|
201
208
|
* supports it, so a user script on a crypto chart cannot pull an explicit
|
|
202
|
-
* OPRA source either
|
|
203
|
-
*
|
|
209
|
+
* OPRA source either. A run the OPRA plane is open to (`isOpraUserScriptRun`,
|
|
210
|
+
* none since 2026-10-22) would get the CME family alone.
|
|
204
211
|
*/
|
|
205
212
|
export interface KScriptDataAccessPolicyDescriptor {
|
|
206
213
|
governedExchanges: readonly string[];
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* equity and index options, Kyle 2026-10-14) draws the same line: chart-only
|
|
7
7
|
* first-party indicators are display use, user-authored scripting waits for
|
|
8
8
|
* OPRA's confirmation. Kyle 2026-10-17 assumed that confirmation behind the
|
|
9
|
-
* `opra-user-scripts` flag
|
|
10
|
-
*
|
|
11
|
-
* the display wall, the data wall and the engine policy
|
|
12
|
-
*
|
|
9
|
+
* `opra-user-scripts` flag; since 2026-10-22 (the OPRA gate compliance round,
|
|
10
|
+
* plan row D3) the policy no longer reads it: `isOpraUserScriptRun`, ONE
|
|
11
|
+
* decision for the display wall, the data wall and the engine policy, refuses
|
|
12
|
+
* every user run, so a lit flag reads exactly like a dark one. A scope
|
|
13
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8,
|
|
14
|
+
* Q12, Q13) must come before it opens again. This module is the single
|
|
15
|
+
* decider for both planes.
|
|
13
16
|
* Every run door (add, mount, protected fetch, cache paint, alerts arm,
|
|
14
17
|
* editor Run), the per-payload data guard in titan-charts dataFetch, and the
|
|
15
18
|
* engine policy descriptor consult it; nothing else may re-derive provenance
|
|
@@ -31,12 +34,12 @@ import { isWrunDraftScriptId } from '../wrun/wrun-draft-overlay.util.js';
|
|
|
31
34
|
import { isWrunOfficialPackage } from '../wrun/wrun-official-scope.leaf.js';
|
|
32
35
|
// Worker-safe too: it reads the twin stamp, the registry ref and the built-in keys alone.
|
|
33
36
|
import { builtinIdentityOf } from './builtin-identity.util.js';
|
|
34
|
-
// Dependency-free: the flag store hands the flag's live readers to it (no store import here).
|
|
35
|
-
import { isOpraUserScriptsFlagOn } from './opra-user-scripts-gate.util.js';
|
|
36
37
|
// Leaf module (no imports): the row source a record runs on (a Cloud record rides the socket source).
|
|
37
38
|
import { wrunRowSourceKindOf } from '../wrun/wrun-overlay-identity.util.js';
|
|
38
|
-
// Near-leaf (the identity leaf only): the migration on read of a record persisted before lane parity wave 3.
|
|
39
|
-
|
|
39
|
+
// Near-leaf (the identity leaf only): the migration on read of a record persisted before lane parity wave 3. The
|
|
40
|
+
// leaf, never wrun-cloud-record.util: this module rides the boot path (titan-charts' dataFetch guard) and the util
|
|
41
|
+
// does not (tests/utility/wrun/wrun-door.closure.spec.ts).
|
|
42
|
+
import { wrunCloudRecordOf } from '../wrun/wrun-cloud-record.leaf.js';
|
|
40
43
|
// Import-free: the one OPRA read decision every door reads (the wrun lane planners too).
|
|
41
44
|
import { mayReadOpra, payloadReadsOpraPlane } from './opra-read-access.leaf.js';
|
|
42
45
|
// The provenance keys are the pure leaf's (kscript-provenance-keys.util); their importers keep this path.
|
|
@@ -154,8 +157,9 @@ export function isFirstPartyKScriptRun(settings) {
|
|
|
154
157
|
* server lane, which reads governed data through its own gate identity (UW-PARITY H3), so a browser flag never opens
|
|
155
158
|
* a plane to them. A Cloud run is the record on the socket row source (`wrunRowSourceKindOf`), read through the
|
|
156
159
|
* migration on read (`wrunCloudRecordOf`): the wave-3 record (`wrunRunTarget: 'cloud'`, no `wrunRef`) and a record
|
|
157
|
-
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag
|
|
158
|
-
* without the flag where a door must know a decision waits on it (the
|
|
160
|
+
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag opened the OPRA plane to while it
|
|
161
|
+
* was honoured (`isOpraUserScriptRun`); read without the flag where a door must know a decision waits on it (the
|
|
162
|
+
* flag's hydration).
|
|
159
163
|
*/
|
|
160
164
|
export function isOpraUserScriptCandidate(settings) {
|
|
161
165
|
if (!settings || isFirstPartyKScriptRun(settings))
|
|
@@ -165,17 +169,21 @@ export function isOpraUserScriptCandidate(settings) {
|
|
|
165
169
|
return settings.isProtectedScript !== true;
|
|
166
170
|
}
|
|
167
171
|
/**
|
|
168
|
-
* Whether the
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
172
|
+
* Whether the OPRA plane is open to this user run. The ONE decision every OPRA door reads, directly or through the
|
|
173
|
+
* walls below: the display wall, the data wall (the dataFetch door, the protected pre-flight, the cache paint), the
|
|
174
|
+
* engine policy, and the wrun chain decision. The CME plane never reads it.
|
|
175
|
+
*
|
|
176
|
+
* Always false (2026-10-22, the OPRA gate compliance round, plan row D3): the `opra-user-scripts` flag (Kyle
|
|
177
|
+
* 2026-10-17: the OPRA permission for user-authored scripts assumed) opened the plane to a browser user run
|
|
178
|
+
* (`isOpraUserScriptCandidate`) while lit; it is no longer honoured, and stays defined only so nothing that names it
|
|
179
|
+
* breaks. OPRA's approval covers web display only: user-authored scripting over OPRA data stays refused until a scope
|
|
180
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8, Q12, Q13) allows it.
|
|
173
181
|
*/
|
|
174
|
-
export function isOpraUserScriptRun(
|
|
175
|
-
return
|
|
182
|
+
export function isOpraUserScriptRun(_settings) {
|
|
183
|
+
return false;
|
|
176
184
|
}
|
|
177
|
-
/** Whether a run may consume the OPRA plane's data: every first-party run, and
|
|
178
|
-
*
|
|
185
|
+
/** Whether a run may consume the OPRA plane's data: every first-party run, and no user run (`isOpraUserScriptRun`;
|
|
186
|
+
* `mayReadOpra`, the one decision the wrun run head and every source lane read too). */
|
|
179
187
|
export function isOpraReadableKScriptRun(settings) {
|
|
180
188
|
return mayReadOpra({ official: isFirstPartyKScriptRun(settings), opraUserScripts: isOpraUserScriptRun(settings) });
|
|
181
189
|
}
|
|
@@ -213,8 +221,8 @@ export function payloadTouchesGovernedVenue(exchange) {
|
|
|
213
221
|
* teardown, resubscribe, self-heal, suite/layout/copy apply) consult
|
|
214
222
|
* isKScriptDisplayBlockedOnExchange below instead, which is a strict superset
|
|
215
223
|
* of this predicate. Per plane: a CME leg blocks every user run; an OPRA leg
|
|
216
|
-
* blocks
|
|
217
|
-
*
|
|
224
|
+
* blocks every user run too (`isOpraReadableKScriptRun`: the flag that could
|
|
225
|
+
* open the plane is no longer honoured, see `isOpraUserScriptRun`).
|
|
218
226
|
*/
|
|
219
227
|
export function isUserKScriptBlockedOnExchange(exchange, settings) {
|
|
220
228
|
if (payloadTouchesCmeVenue(exchange) && !isFirstPartyKScriptRun(settings))
|
|
@@ -256,9 +264,8 @@ export function isUserKScriptBlockedOnExchange(exchange, settings) {
|
|
|
256
264
|
* OPRA (no CME leg): every first-party run is explicitly venue-approved, the
|
|
257
265
|
* built-ins, the converted corpus, the official docs and the official
|
|
258
266
|
* packages alike (chart-only display use under the OPRA licence), and every
|
|
259
|
-
* user run is blocked
|
|
260
|
-
*
|
|
261
|
-
* decision). The CME per-script curation is CME evidence and does not apply
|
|
267
|
+
* user run is blocked (the data wall's own per-plane verdict, so the two walls
|
|
268
|
+
* read one decision, `isOpraUserScriptRun`). The CME per-script curation is CME evidence and does not apply
|
|
262
269
|
* there; a book-reading official is refused by the options mode (OPRA has no
|
|
263
270
|
* book), not by this wall.
|
|
264
271
|
*/
|
|
@@ -289,7 +296,7 @@ export function isKScriptDisplayBlockedOnExchange(exchange, settings) {
|
|
|
289
296
|
* rejections, and a policy block is a standing state, not an incident.
|
|
290
297
|
*/
|
|
291
298
|
export function shouldBlockKScriptSourcePayload(args) {
|
|
292
|
-
// The data wall's per-plane verdict: an OPRA source a
|
|
299
|
+
// The data wall's per-plane verdict: an OPRA source is served to a first-party run only (`isOpraUserScriptRun`).
|
|
293
300
|
const blocked = isUserKScriptBlockedOnExchange(args.payloadExchange, args.settings) ||
|
|
294
301
|
(payloadReadsOpraPlane(args.payload) && !isOpraReadableKScriptRun(args.settings));
|
|
295
302
|
if (!blocked)
|
|
@@ -301,7 +308,8 @@ const ENGINE_GOVERNED_EXCHANGES = Object.freeze([
|
|
|
301
308
|
...CME_GOVERNED_EXCHANGES,
|
|
302
309
|
...OPRA_GOVERNED_EXCHANGES,
|
|
303
310
|
]);
|
|
304
|
-
/** The CME family alone: the set a user run
|
|
311
|
+
/** The CME family alone: the set a user run OPRA is open to would be denied (none while `isOpraUserScriptRun` is
|
|
312
|
+
* closed). */
|
|
305
313
|
const ENGINE_CME_GOVERNED_EXCHANGES = Object.freeze([...CME_GOVERNED_EXCHANGES]);
|
|
306
314
|
export function buildKScriptDataAccessPolicy(settings) {
|
|
307
315
|
return {
|