@orangecharts/wrun-chart-host 0.9.0 → 0.10.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 +1 -0
- package/dist/constants/feature-flags.constants.d.ts +6 -1
- package/dist/constants/feature-flags.constants.js +67 -24
- package/dist/constants/opra-compliance.constants.d.ts +3 -2
- package/dist/constants/opra-compliance.constants.js +3 -2
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +20 -20
- package/dist/constants/venue-presets.constants.js +24 -26
- package/dist/host-env.d.ts +29 -5
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +69 -15
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +41 -4
- package/dist/kscript-data/controls/live-trades-merge.util.js +52 -7
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
- package/dist/market-data/billing.interface.d.ts +95 -31
- package/dist/market-data/billing.interface.js +36 -5
- package/dist/market-data/venue.d.ts +88 -6
- package/dist/market-data/venues/cme.contract.copy.json +66 -0
- package/dist/market-data/venues/cme.d.ts +126 -0
- package/dist/market-data/venues/cme.js +133 -0
- package/dist/market-data/venues/index.d.ts +162 -5
- package/dist/market-data/venues/index.js +48 -6
- package/dist/settings-templates/index.js +7 -3
- package/dist/settings-templates/indicator-fields.d.ts +5 -4
- package/dist/settings-templates/indicator-fields.js +45 -6
- package/dist/settings-templates/tool-rules.d.ts +27 -17
- package/dist/settings-templates/tool-rules.js +27 -11
- package/dist/settings-templates/tool-tables.generated.js +91 -31
- package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
- package/dist/utility/chart/book-live-bucket.util.js +47 -0
- package/dist/utility/chart/index-mode-admission.util.js +15 -2
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
- package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
- package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +54 -35
- package/dist/utility/chart/kscript-venue-policy.util.js +78 -42
- package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
- package/dist/utility/chart/market-session-schedule.util.js +16 -0
- package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
- package/dist/utility/chart/opra-read-access.leaf.js +5 -3
- package/dist/utility/chart/rth-session.util.d.ts +3 -2
- package/dist/utility/chart/rth-session.util.js +2 -1
- package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
- package/dist/utility/chart/window-geometry.leaf.js +22 -6
- package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
- package/dist/utility/chart/wrun-run-result.util.js +141 -6
- package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
- package/dist/utility/options/option-bar-anchor.util.js +340 -0
- package/dist/utility/options/option-venue.util.d.ts +18 -0
- package/dist/utility/options/option-venue.util.js +27 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
- package/dist/utility/wrun/derived-roots.util.js +471 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
- package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
- package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +39 -10
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +174 -13
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +685 -27
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +53 -12
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +101 -53
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
- package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +73 -10
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
- package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +13 -7
- package/dist/utility/wrun/wrun-live-intake.util.js +82 -29
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +158 -14
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +49 -10
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +65 -5
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
- package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
- package/dist/utility/wrun/wrun-option-views.util.d.ts +47 -13
- package/dist/utility/wrun/wrun-option-views.util.js +98 -26
- package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-output-style.util.js +20 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +17 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +100 -31
- package/dist/utility/wrun/wrun-overlay-run.util.js +733 -114
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
- package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
- package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
- package/dist/utility/wrun/wrun-param-map.util.js +10 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
- package/dist/utility/wrun/wrun-param-values.util.js +4 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
- package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
- package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
- package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
- package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +5 -1
- package/dist/utility/wrun/wrun-source-rows.util.js +16 -3
- package/dist/utility/wrun/wrun-style-words.util.js +6 -4
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
- package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/package.json +11 -11
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"revision": "2026-10-23.1",
|
|
3
|
+
"key": "cme",
|
|
4
|
+
"productGroups": ["CME", "CBOT", "NYMEX", "COMEX"],
|
|
5
|
+
"products": [
|
|
6
|
+
{
|
|
7
|
+
"name": "cme_bundle_l1_1m",
|
|
8
|
+
"plan": "p1",
|
|
9
|
+
"classifications": ["non_professional"],
|
|
10
|
+
"interval": "1m",
|
|
11
|
+
"id": "l1",
|
|
12
|
+
"level": 1
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "cme_bundle_depth_1m",
|
|
16
|
+
"plan": "p2",
|
|
17
|
+
"classifications": ["non_professional"],
|
|
18
|
+
"interval": "1m",
|
|
19
|
+
"id": "depth",
|
|
20
|
+
"level": 2
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "cme_bundle_depth_pro_1m",
|
|
24
|
+
"plan": "p2",
|
|
25
|
+
"classifications": ["professional"],
|
|
26
|
+
"interval": "1m",
|
|
27
|
+
"id": "depth_pro",
|
|
28
|
+
"level": 3
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"formVersion": "v1",
|
|
32
|
+
"questions": [
|
|
33
|
+
{ "id": "individual_own_account", "qualifying": true },
|
|
34
|
+
{ "id": "personal_non_business_use", "qualifying": true },
|
|
35
|
+
{ "id": "not_registered_or_qualified", "qualifying": true },
|
|
36
|
+
{ "id": "not_advisor_or_asset_manager", "qualifying": true },
|
|
37
|
+
{ "id": "no_redistribution_or_business_application", "qualifying": true }
|
|
38
|
+
],
|
|
39
|
+
"identityFields": [
|
|
40
|
+
"legalName",
|
|
41
|
+
"employer",
|
|
42
|
+
"occupation",
|
|
43
|
+
"country",
|
|
44
|
+
"address"
|
|
45
|
+
],
|
|
46
|
+
"identityLimits": { "text": 200, "address": 300 },
|
|
47
|
+
"agreement": {
|
|
48
|
+
"recordedAs": "registration",
|
|
49
|
+
"version": "cme-data-terms-v1",
|
|
50
|
+
"url": "/api/v1/market-data/cme/agreement"
|
|
51
|
+
},
|
|
52
|
+
"delaySeconds": 600,
|
|
53
|
+
"basePath": "/market-data/cme",
|
|
54
|
+
"acceptedFormVersions": ["v1", ""],
|
|
55
|
+
"presentation": "two-way",
|
|
56
|
+
"addendum": {
|
|
57
|
+
"id": "ila_subscriber_addendum_2026_06_accepted",
|
|
58
|
+
"version": "v1"
|
|
59
|
+
},
|
|
60
|
+
"postalAddressAnswer": "postal_address",
|
|
61
|
+
"professionalPolicy": { "kind": "sellable", "products": ["depth_pro"] },
|
|
62
|
+
"internalPolicy": "report",
|
|
63
|
+
"checkoutOrder": "attest-first",
|
|
64
|
+
"planChanges": { "downgradeAtPeriodEnd": true, "prorateUpgrades": true },
|
|
65
|
+
"offers": true
|
|
66
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export declare const CME_VENUE: {
|
|
2
|
+
readonly key: "cme";
|
|
3
|
+
readonly displayName: "CME Group";
|
|
4
|
+
readonly productGroups: readonly ["CME", "CBOT", "NYMEX", "COMEX"];
|
|
5
|
+
readonly basePath: "/market-data/cme";
|
|
6
|
+
readonly products: readonly [{
|
|
7
|
+
readonly name: "cme_bundle_l1_1m";
|
|
8
|
+
readonly key: "l1";
|
|
9
|
+
readonly plan: "p1";
|
|
10
|
+
readonly level: 1;
|
|
11
|
+
readonly classifications: readonly ["non_professional"];
|
|
12
|
+
readonly interval: "1m";
|
|
13
|
+
readonly priceUsd: 7;
|
|
14
|
+
readonly planCard: {
|
|
15
|
+
readonly name: "Real-time L1";
|
|
16
|
+
readonly level: "LEVEL 1";
|
|
17
|
+
readonly market: "CME";
|
|
18
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
19
|
+
readonly region: "🇺🇸 USA";
|
|
20
|
+
readonly descPath: "subscription.l1Desc";
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "cme_bundle_depth_1m";
|
|
24
|
+
readonly key: "depth";
|
|
25
|
+
readonly plan: "p2";
|
|
26
|
+
readonly level: 2;
|
|
27
|
+
readonly classifications: readonly ["non_professional"];
|
|
28
|
+
readonly interval: "1m";
|
|
29
|
+
readonly priceUsd: 45;
|
|
30
|
+
readonly planCard: {
|
|
31
|
+
readonly name: "Real-time depth";
|
|
32
|
+
readonly level: "LEVEL 2";
|
|
33
|
+
readonly market: "CME";
|
|
34
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
35
|
+
readonly region: "🇺🇸 USA";
|
|
36
|
+
readonly descPath: "subscription.depthDesc";
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "cme_bundle_depth_pro_1m";
|
|
40
|
+
readonly key: "depth_pro";
|
|
41
|
+
readonly plan: "p2";
|
|
42
|
+
readonly level: 3;
|
|
43
|
+
readonly classifications: readonly ["professional"];
|
|
44
|
+
readonly interval: "1m";
|
|
45
|
+
readonly priceUsd: 538;
|
|
46
|
+
readonly planCard: {
|
|
47
|
+
readonly name: "Real-time depth";
|
|
48
|
+
readonly level: "LEVEL 2";
|
|
49
|
+
readonly market: "CME";
|
|
50
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
51
|
+
readonly region: "🇺🇸 USA";
|
|
52
|
+
readonly descPath: "subscription.depthDesc";
|
|
53
|
+
};
|
|
54
|
+
}];
|
|
55
|
+
readonly planCard: {
|
|
56
|
+
readonly name: "Real-time L1";
|
|
57
|
+
readonly level: "LEVEL 1";
|
|
58
|
+
readonly market: "CME";
|
|
59
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
60
|
+
readonly region: "🇺🇸 USA";
|
|
61
|
+
readonly descPath: "subscription.l1Desc";
|
|
62
|
+
};
|
|
63
|
+
readonly paymentItemPrefix: "cme_";
|
|
64
|
+
readonly professionalPolicy: "sell";
|
|
65
|
+
readonly internalRolePolicy: "report";
|
|
66
|
+
readonly payFirst: false;
|
|
67
|
+
readonly planChanges: {
|
|
68
|
+
readonly downgradeAtPeriodEnd: true;
|
|
69
|
+
readonly prorateUpgrades: true;
|
|
70
|
+
};
|
|
71
|
+
readonly offers: true;
|
|
72
|
+
readonly questionnaire: {
|
|
73
|
+
readonly formVersion: "v1";
|
|
74
|
+
readonly acceptedFormVersions: readonly ["v1", ""];
|
|
75
|
+
readonly presentation: "two-way";
|
|
76
|
+
readonly questions: readonly [{
|
|
77
|
+
readonly id: "individual_own_account";
|
|
78
|
+
readonly qualifying: true;
|
|
79
|
+
}, {
|
|
80
|
+
readonly id: "personal_non_business_use";
|
|
81
|
+
readonly qualifying: true;
|
|
82
|
+
}, {
|
|
83
|
+
readonly id: "not_registered_or_qualified";
|
|
84
|
+
readonly qualifying: true;
|
|
85
|
+
}, {
|
|
86
|
+
readonly id: "not_advisor_or_asset_manager";
|
|
87
|
+
readonly qualifying: true;
|
|
88
|
+
}, {
|
|
89
|
+
readonly id: "no_redistribution_or_business_application";
|
|
90
|
+
readonly qualifying: true;
|
|
91
|
+
}];
|
|
92
|
+
readonly groups: readonly [];
|
|
93
|
+
readonly addendum: {
|
|
94
|
+
readonly id: "ila_subscriber_addendum_2026_06_accepted";
|
|
95
|
+
readonly version: "v1";
|
|
96
|
+
};
|
|
97
|
+
readonly postalAddress: {
|
|
98
|
+
readonly answerId: "postal_address";
|
|
99
|
+
};
|
|
100
|
+
readonly identityFields: readonly ["legalName", "employer", "occupation", "country", "address"];
|
|
101
|
+
readonly identityLimits: {
|
|
102
|
+
readonly legalName: 200;
|
|
103
|
+
readonly employer: 200;
|
|
104
|
+
readonly occupation: 200;
|
|
105
|
+
readonly country: 2;
|
|
106
|
+
readonly address: 300;
|
|
107
|
+
};
|
|
108
|
+
readonly validityDays: 365;
|
|
109
|
+
readonly renewalWindowDays: 30;
|
|
110
|
+
};
|
|
111
|
+
readonly agreement: {
|
|
112
|
+
readonly recordedAs: "registration";
|
|
113
|
+
readonly version: "cme-data-terms-v1";
|
|
114
|
+
readonly url: "/api/v1/market-data/cme/agreement";
|
|
115
|
+
readonly delayedRequiresAcceptance: true;
|
|
116
|
+
};
|
|
117
|
+
readonly delayMinutes: 10;
|
|
118
|
+
readonly disclosure: {
|
|
119
|
+
readonly kind: "translated";
|
|
120
|
+
};
|
|
121
|
+
readonly flagKey: "cme-engine";
|
|
122
|
+
readonly i18nNamespace: "cmeRealtimeData";
|
|
123
|
+
readonly storeId: "cmeMarketData";
|
|
124
|
+
readonly surfaces: readonly ["contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "purchase-live-price"];
|
|
125
|
+
readonly contractRevision: "2026-10-23.1";
|
|
126
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CME Group's venue card (the four DCMs CME, CBOT, NYMEX and COMEX as one bundle): the frontend descriptor of the CME
|
|
3
|
+
* deal on the venue-generic market-data plane (docs/features/market-data/plane.md, "CME on the plane"; plan 12.1 and
|
|
4
|
+
* 12.2 KB1). Carried DARK: the registry lists it only while the `cme-engine` flag reads on
|
|
5
|
+
* (`FLAG_GATED_MARKET_DATA_VENUES`, `marketDataVenueIsServed`), so with the flag off every CME surface keeps the legacy
|
|
6
|
+
* flow on `/cme/*` and nothing here is read. Pinned against the backend's contract export (`cme.contract.copy.json`
|
|
7
|
+
* beside this file, a copy of orange's cme.contract.json) and the gate's release mirror (`gate-mirror.copy.yaml` beside
|
|
8
|
+
* the spec) by tests/packages/wrun-chart-host/market-data/venues/cme.contract.spec.ts.
|
|
9
|
+
*
|
|
10
|
+
* Three products in level order (l1 then depth for non-professionals, depth_pro for professionals only), each its own
|
|
11
|
+
* Stripe line and plan card; professionals are sold (at the depth_pro price), the declaration comes first (attest
|
|
12
|
+
* first: the price follows the classification), plans change in place, the data terms are the registration the
|
|
13
|
+
* delayed-data wall records (never a purchase step), and the declaration is today's two-way choice recording the five
|
|
14
|
+
* live condition ids, the ILA Subscriber Addendum and the postal address. The ids and the addendum are the live form's
|
|
15
|
+
* (src/constants/cme-realtime.constants.ts: CME_NON_PROFESSIONAL_CONDITION_IDS, CME_ILA_ADDENDUM_ANSWER_ID,
|
|
16
|
+
* CME_POSTAL_ADDRESS_ANSWER_ID), so a record made here reads like one made by the legacy form.
|
|
17
|
+
*/
|
|
18
|
+
import { FeatureFlag } from '../../constants/feature-flags.constants.js';
|
|
19
|
+
/** Every DCM the bundle covers, in the order the CME surfaces list them. */
|
|
20
|
+
const CME_BUNDLE_MARKETS = ['CME', 'CBOT', 'COMEX', 'NYMEX'];
|
|
21
|
+
const L1_CARD = {
|
|
22
|
+
name: 'Real-time L1',
|
|
23
|
+
level: 'LEVEL 1',
|
|
24
|
+
market: 'CME',
|
|
25
|
+
markets: CME_BUNDLE_MARKETS,
|
|
26
|
+
region: '🇺🇸 USA',
|
|
27
|
+
descPath: 'subscription.l1Desc',
|
|
28
|
+
};
|
|
29
|
+
const DEPTH_CARD = {
|
|
30
|
+
name: 'Real-time depth',
|
|
31
|
+
level: 'LEVEL 2',
|
|
32
|
+
market: 'CME',
|
|
33
|
+
markets: CME_BUNDLE_MARKETS,
|
|
34
|
+
region: '🇺🇸 USA',
|
|
35
|
+
descPath: 'subscription.depthDesc',
|
|
36
|
+
};
|
|
37
|
+
export const CME_VENUE = {
|
|
38
|
+
key: 'cme',
|
|
39
|
+
displayName: 'CME Group',
|
|
40
|
+
// The gate release's product groups (venue mirror `cme.product_groups`).
|
|
41
|
+
productGroups: ['CME', 'CBOT', 'NYMEX', 'COMEX'],
|
|
42
|
+
basePath: '/market-data/cme',
|
|
43
|
+
// Monthly only (plan section 8: no annual pricing); an annual subscriber of the legacy lane keeps its own interval,
|
|
44
|
+
// which the subscription answers. Display prices: the server subscription price is authoritative once one exists.
|
|
45
|
+
// These are the ONE copy of the CME prices (src/constants/cme-realtime.constants.ts reads them), checked against the
|
|
46
|
+
// live Stripe prices on 2026-10-23: unit_amount 700, 4500 and 53800 ("L2 Depth, pro").
|
|
47
|
+
products: [
|
|
48
|
+
{
|
|
49
|
+
name: 'cme_bundle_l1_1m',
|
|
50
|
+
key: 'l1',
|
|
51
|
+
plan: 'p1',
|
|
52
|
+
level: 1,
|
|
53
|
+
classifications: ['non_professional'],
|
|
54
|
+
interval: '1m',
|
|
55
|
+
priceUsd: 7,
|
|
56
|
+
planCard: L1_CARD,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'cme_bundle_depth_1m',
|
|
60
|
+
key: 'depth',
|
|
61
|
+
plan: 'p2',
|
|
62
|
+
level: 2,
|
|
63
|
+
classifications: ['non_professional'],
|
|
64
|
+
interval: '1m',
|
|
65
|
+
priceUsd: 45,
|
|
66
|
+
planCard: DEPTH_CARD,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'cme_bundle_depth_pro_1m',
|
|
70
|
+
key: 'depth_pro',
|
|
71
|
+
plan: 'p2',
|
|
72
|
+
level: 3,
|
|
73
|
+
classifications: ['professional'],
|
|
74
|
+
interval: '1m',
|
|
75
|
+
priceUsd: 538,
|
|
76
|
+
planCard: DEPTH_CARD,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
planCard: L1_CARD,
|
|
80
|
+
paymentItemPrefix: 'cme_',
|
|
81
|
+
professionalPolicy: 'sell',
|
|
82
|
+
internalRolePolicy: 'report',
|
|
83
|
+
payFirst: false,
|
|
84
|
+
planChanges: { downgradeAtPeriodEnd: true, prorateUpgrades: true },
|
|
85
|
+
offers: true,
|
|
86
|
+
questionnaire: {
|
|
87
|
+
// The server's stored form (plan 12.1 D8): the five live ids under `v1`, and '' for a record a release stored with
|
|
88
|
+
// no version. A new question set is a new version, asked again at renewal, never a demotion.
|
|
89
|
+
formVersion: 'v1',
|
|
90
|
+
acceptedFormVersions: ['v1', ''],
|
|
91
|
+
presentation: 'two-way',
|
|
92
|
+
questions: [
|
|
93
|
+
{ id: 'individual_own_account', qualifying: true },
|
|
94
|
+
{ id: 'personal_non_business_use', qualifying: true },
|
|
95
|
+
{ id: 'not_registered_or_qualified', qualifying: true },
|
|
96
|
+
{ id: 'not_advisor_or_asset_manager', qualifying: true },
|
|
97
|
+
{ id: 'no_redistribution_or_business_application', qualifying: true },
|
|
98
|
+
],
|
|
99
|
+
groups: [],
|
|
100
|
+
addendum: { id: 'ila_subscriber_addendum_2026_06_accepted', version: 'v1' },
|
|
101
|
+
postalAddress: { answerId: 'postal_address' },
|
|
102
|
+
identityFields: ['legalName', 'employer', 'occupation', 'country', 'address'],
|
|
103
|
+
identityLimits: { legalName: 200, employer: 200, occupation: 200, country: 2, address: 300 },
|
|
104
|
+
validityDays: 365,
|
|
105
|
+
renewalWindowDays: 30,
|
|
106
|
+
},
|
|
107
|
+
// The data terms (plan 12.1 D7): served by `GET /market-data/cme/agreement` with this version and recorded as the
|
|
108
|
+
// registration by the CME data-terms wall; they gate delayed display too, so they are the wall's, never a step.
|
|
109
|
+
agreement: {
|
|
110
|
+
recordedAs: 'registration',
|
|
111
|
+
version: 'cme-data-terms-v1',
|
|
112
|
+
url: '/api/v1/market-data/cme/agreement',
|
|
113
|
+
delayedRequiresAcceptance: true,
|
|
114
|
+
},
|
|
115
|
+
// The gate's delayed window (600 s).
|
|
116
|
+
delayMinutes: 10,
|
|
117
|
+
// CME's delay line is translated copy ("{mins} min delay"), never a verbatim phrase.
|
|
118
|
+
disclosure: { kind: 'translated' },
|
|
119
|
+
flagKey: FeatureFlag.CmeEngine,
|
|
120
|
+
// The CME strings stay where they are (no namespace move): the generic flow reads `cmeRealtimeData.*`.
|
|
121
|
+
i18nNamespace: 'cmeRealtimeData',
|
|
122
|
+
// Never `cmeRealtime`: that id is the served-access store's, which stays.
|
|
123
|
+
storeId: 'cmeMarketData',
|
|
124
|
+
surfaces: [
|
|
125
|
+
'contract-chart-delay-chip',
|
|
126
|
+
'contract-chart-delay-card',
|
|
127
|
+
'chart-source-line',
|
|
128
|
+
'watchlist-panel',
|
|
129
|
+
'watchlist-cell-tooltip',
|
|
130
|
+
'purchase-live-price',
|
|
131
|
+
],
|
|
132
|
+
contractRevision: '2026-10-23.1',
|
|
133
|
+
};
|
|
@@ -3,8 +3,18 @@
|
|
|
3
3
|
* exchange deal adds its card here; the purchase flow, the payment return and the openers find a venue by its key or
|
|
4
4
|
* by a payment line item, never by a venue literal. The finders over an explicit list (`findVenueBy*`) are the same
|
|
5
5
|
* rules the bound finders apply to the registry, for a spec that serves a venue of its own beside the registered ones.
|
|
6
|
+
*
|
|
7
|
+
* Two lists. `MARKET_DATA_VENUES` is served in every session. `FLAG_GATED_MARKET_DATA_VENUES` is carried dark: a card
|
|
8
|
+
* there is listed only while its `flagKey` reads on, through ONE selector (`marketDataVenueIsServed`), so a venue whose
|
|
9
|
+
* generic flow replaces a flow of its own (CME behind `cme-engine`) changes nothing while its flag is off: the bound
|
|
10
|
+
* finders never return it, the payment return never takes its venue branch and its doors stay shut. The flag reader is
|
|
11
|
+
* the app's, published into this dependency-free module when the app's market-data store module loads
|
|
12
|
+
* (`publishMarketDataVenueFlags`); unpublished, a read that throws (no store in this realm: a worker, a bare spec) or a
|
|
13
|
+
* card with no flag all read dark.
|
|
6
14
|
*/
|
|
15
|
+
import type { FeatureFlagKey } from '../../constants/feature-flags.constants.js';
|
|
7
16
|
import type { MarketDataVenue } from '../venue.js';
|
|
17
|
+
/** The venues served in every session. */
|
|
8
18
|
export declare const MARKET_DATA_VENUES: readonly [{
|
|
9
19
|
readonly key: "opra";
|
|
10
20
|
readonly displayName: "OPRA";
|
|
@@ -75,8 +85,136 @@ export declare const MARKET_DATA_VENUES: readonly [{
|
|
|
75
85
|
readonly surfaces: readonly ["chain-page-subtitle", "chain-price-pill", "chain-table-marker", "chain-strike-preview", "chain-index-notice", "flow-tape", "terminal-options-tab", "options-overlay-legends", "indicator-legend-notes", "contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "board", "purchase-live-price"];
|
|
76
86
|
readonly contractRevision: "2026-10-22.1";
|
|
77
87
|
}];
|
|
78
|
-
/**
|
|
79
|
-
export
|
|
88
|
+
/** The venues carried dark: each is listed only while its `flagKey` reads on (`marketDataVenueIsServed`). */
|
|
89
|
+
export declare const FLAG_GATED_MARKET_DATA_VENUES: readonly [{
|
|
90
|
+
readonly key: "cme";
|
|
91
|
+
readonly displayName: "CME Group";
|
|
92
|
+
readonly productGroups: readonly ["CME", "CBOT", "NYMEX", "COMEX"];
|
|
93
|
+
readonly basePath: "/market-data/cme";
|
|
94
|
+
readonly products: readonly [{
|
|
95
|
+
readonly name: "cme_bundle_l1_1m";
|
|
96
|
+
readonly key: "l1";
|
|
97
|
+
readonly plan: "p1";
|
|
98
|
+
readonly level: 1;
|
|
99
|
+
readonly classifications: readonly ["non_professional"];
|
|
100
|
+
readonly interval: "1m";
|
|
101
|
+
readonly priceUsd: 7;
|
|
102
|
+
readonly planCard: {
|
|
103
|
+
readonly name: "Real-time L1";
|
|
104
|
+
readonly level: "LEVEL 1";
|
|
105
|
+
readonly market: "CME";
|
|
106
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
107
|
+
readonly region: "🇺🇸 USA";
|
|
108
|
+
readonly descPath: "subscription.l1Desc";
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "cme_bundle_depth_1m";
|
|
112
|
+
readonly key: "depth";
|
|
113
|
+
readonly plan: "p2";
|
|
114
|
+
readonly level: 2;
|
|
115
|
+
readonly classifications: readonly ["non_professional"];
|
|
116
|
+
readonly interval: "1m";
|
|
117
|
+
readonly priceUsd: 45;
|
|
118
|
+
readonly planCard: {
|
|
119
|
+
readonly name: "Real-time depth";
|
|
120
|
+
readonly level: "LEVEL 2";
|
|
121
|
+
readonly market: "CME";
|
|
122
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
123
|
+
readonly region: "🇺🇸 USA";
|
|
124
|
+
readonly descPath: "subscription.depthDesc";
|
|
125
|
+
};
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "cme_bundle_depth_pro_1m";
|
|
128
|
+
readonly key: "depth_pro";
|
|
129
|
+
readonly plan: "p2";
|
|
130
|
+
readonly level: 3;
|
|
131
|
+
readonly classifications: readonly ["professional"];
|
|
132
|
+
readonly interval: "1m";
|
|
133
|
+
readonly priceUsd: 538;
|
|
134
|
+
readonly planCard: {
|
|
135
|
+
readonly name: "Real-time depth";
|
|
136
|
+
readonly level: "LEVEL 2";
|
|
137
|
+
readonly market: "CME";
|
|
138
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
139
|
+
readonly region: "🇺🇸 USA";
|
|
140
|
+
readonly descPath: "subscription.depthDesc";
|
|
141
|
+
};
|
|
142
|
+
}];
|
|
143
|
+
readonly planCard: {
|
|
144
|
+
readonly name: "Real-time L1";
|
|
145
|
+
readonly level: "LEVEL 1";
|
|
146
|
+
readonly market: "CME";
|
|
147
|
+
readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
|
|
148
|
+
readonly region: "🇺🇸 USA";
|
|
149
|
+
readonly descPath: "subscription.l1Desc";
|
|
150
|
+
};
|
|
151
|
+
readonly paymentItemPrefix: "cme_";
|
|
152
|
+
readonly professionalPolicy: "sell";
|
|
153
|
+
readonly internalRolePolicy: "report";
|
|
154
|
+
readonly payFirst: false;
|
|
155
|
+
readonly planChanges: {
|
|
156
|
+
readonly downgradeAtPeriodEnd: true;
|
|
157
|
+
readonly prorateUpgrades: true;
|
|
158
|
+
};
|
|
159
|
+
readonly offers: true;
|
|
160
|
+
readonly questionnaire: {
|
|
161
|
+
readonly formVersion: "v1";
|
|
162
|
+
readonly acceptedFormVersions: readonly ["v1", ""];
|
|
163
|
+
readonly presentation: "two-way";
|
|
164
|
+
readonly questions: readonly [{
|
|
165
|
+
readonly id: "individual_own_account";
|
|
166
|
+
readonly qualifying: true;
|
|
167
|
+
}, {
|
|
168
|
+
readonly id: "personal_non_business_use";
|
|
169
|
+
readonly qualifying: true;
|
|
170
|
+
}, {
|
|
171
|
+
readonly id: "not_registered_or_qualified";
|
|
172
|
+
readonly qualifying: true;
|
|
173
|
+
}, {
|
|
174
|
+
readonly id: "not_advisor_or_asset_manager";
|
|
175
|
+
readonly qualifying: true;
|
|
176
|
+
}, {
|
|
177
|
+
readonly id: "no_redistribution_or_business_application";
|
|
178
|
+
readonly qualifying: true;
|
|
179
|
+
}];
|
|
180
|
+
readonly groups: readonly [];
|
|
181
|
+
readonly addendum: {
|
|
182
|
+
readonly id: "ila_subscriber_addendum_2026_06_accepted";
|
|
183
|
+
readonly version: "v1";
|
|
184
|
+
};
|
|
185
|
+
readonly postalAddress: {
|
|
186
|
+
readonly answerId: "postal_address";
|
|
187
|
+
};
|
|
188
|
+
readonly identityFields: readonly ["legalName", "employer", "occupation", "country", "address"];
|
|
189
|
+
readonly identityLimits: {
|
|
190
|
+
readonly legalName: 200;
|
|
191
|
+
readonly employer: 200;
|
|
192
|
+
readonly occupation: 200;
|
|
193
|
+
readonly country: 2;
|
|
194
|
+
readonly address: 300;
|
|
195
|
+
};
|
|
196
|
+
readonly validityDays: 365;
|
|
197
|
+
readonly renewalWindowDays: 30;
|
|
198
|
+
};
|
|
199
|
+
readonly agreement: {
|
|
200
|
+
readonly recordedAs: "registration";
|
|
201
|
+
readonly version: "cme-data-terms-v1";
|
|
202
|
+
readonly url: "/api/v1/market-data/cme/agreement";
|
|
203
|
+
readonly delayedRequiresAcceptance: true;
|
|
204
|
+
};
|
|
205
|
+
readonly delayMinutes: 10;
|
|
206
|
+
readonly disclosure: {
|
|
207
|
+
readonly kind: "translated";
|
|
208
|
+
};
|
|
209
|
+
readonly flagKey: "cme-engine";
|
|
210
|
+
readonly i18nNamespace: "cmeRealtimeData";
|
|
211
|
+
readonly storeId: "cmeMarketData";
|
|
212
|
+
readonly surfaces: readonly ["contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "purchase-live-price"];
|
|
213
|
+
readonly contractRevision: "2026-10-23.1";
|
|
214
|
+
}];
|
|
215
|
+
type CarriedMarketDataVenue = (typeof MARKET_DATA_VENUES)[number] | (typeof FLAG_GATED_MARKET_DATA_VENUES)[number];
|
|
216
|
+
/** A registered venue's key: a card the build carries, served now or dark. */
|
|
217
|
+
export type MarketDataVenueKey = CarriedMarketDataVenue['key'];
|
|
80
218
|
/** A registered venue: the descriptor, its key narrowed to the registered keys. */
|
|
81
219
|
export type RegisteredMarketDataVenue = MarketDataVenue & {
|
|
82
220
|
readonly key: MarketDataVenueKey;
|
|
@@ -89,9 +227,28 @@ export declare function findVenueByKey<V extends MarketDataVenue>(venues: readon
|
|
|
89
227
|
* for an item no venue names.
|
|
90
228
|
*/
|
|
91
229
|
export declare function findVenueByPaymentProduct<V extends MarketDataVenue>(venues: readonly V[], item: unknown): V | null;
|
|
92
|
-
/**
|
|
230
|
+
/**
|
|
231
|
+
* Called by the app's market-data store module when it loads (src/store/market-data.ts), and by specs: the flag reader
|
|
232
|
+
* the dark cards ride (the app's override-aware `isOn`). Null unpublishes: every dark card reads dark again.
|
|
233
|
+
*/
|
|
234
|
+
export declare function publishMarketDataVenueFlags(reader: ((flag: FeatureFlagKey) => boolean) | null): void;
|
|
235
|
+
/**
|
|
236
|
+
* THE flag-aware selector: whether the venue-generic plane serves the venue in this session. A card of
|
|
237
|
+
* `MARKET_DATA_VENUES` always; a dark card only while the published reader says its flag is on; anything else never.
|
|
238
|
+
* The bound finders below list exactly the venues it serves, and every app door, reader, store definition and the
|
|
239
|
+
* payment return asks it (directly or through them), so one flag decides every surface of a dark venue at once.
|
|
240
|
+
*/
|
|
241
|
+
export declare function marketDataVenueIsServed(key: unknown): boolean;
|
|
242
|
+
/** The venues the registry lists now: every served card, then each dark card whose flag reads on. */
|
|
243
|
+
export declare function servedMarketDataVenues(): readonly RegisteredMarketDataVenue[];
|
|
244
|
+
/** The served venue with this key, or null (a dark card reads null while its flag is off). */
|
|
93
245
|
export declare function venueByKey(key: unknown): RegisteredMarketDataVenue | null;
|
|
94
|
-
/**
|
|
246
|
+
/**
|
|
247
|
+
* The card of a registered venue key, served or dark; a key no card has throws (a programming error, never an
|
|
248
|
+
* account's state). A caller that holds a venue key already (a mounted venue dialog, a store being defined) reads its
|
|
249
|
+
* card here; whether the venue is served is the selector's question, asked at the doors.
|
|
250
|
+
*/
|
|
95
251
|
export declare function requireVenueByKey(key: unknown): RegisteredMarketDataVenue;
|
|
96
|
-
/** The
|
|
252
|
+
/** The served venue a payment line item belongs to (`findVenueByPaymentProduct` over the served venues), or null. */
|
|
97
253
|
export declare function venueByPaymentProduct(item: unknown): RegisteredMarketDataVenue | null;
|
|
254
|
+
export {};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { CME_VENUE } from './cme.js';
|
|
1
2
|
import { OPRA_VENUE } from './opra.js';
|
|
3
|
+
/** The venues served in every session. */
|
|
2
4
|
export const MARKET_DATA_VENUES = [OPRA_VENUE];
|
|
5
|
+
/** The venues carried dark: each is listed only while its `flagKey` reads on (`marketDataVenueIsServed`). */
|
|
6
|
+
export const FLAG_GATED_MARKET_DATA_VENUES = [CME_VENUE];
|
|
7
|
+
/** Every card the build carries, served or dark, for the card lookup (`requireVenueByKey`). */
|
|
8
|
+
const CARRIED_VENUES = [...MARKET_DATA_VENUES, ...FLAG_GATED_MARKET_DATA_VENUES];
|
|
3
9
|
/** The venue in `venues` with this key, or null. */
|
|
4
10
|
export function findVenueByKey(venues, key) {
|
|
5
11
|
return venues.find((venue) => venue.key === key) ?? null;
|
|
@@ -16,18 +22,54 @@ export function findVenueByPaymentProduct(venues, item) {
|
|
|
16
22
|
venues.find((venue) => item.startsWith(venue.paymentItemPrefix)) ??
|
|
17
23
|
null);
|
|
18
24
|
}
|
|
19
|
-
|
|
25
|
+
let flagReader = null;
|
|
26
|
+
/**
|
|
27
|
+
* Called by the app's market-data store module when it loads (src/store/market-data.ts), and by specs: the flag reader
|
|
28
|
+
* the dark cards ride (the app's override-aware `isOn`). Null unpublishes: every dark card reads dark again.
|
|
29
|
+
*/
|
|
30
|
+
export function publishMarketDataVenueFlags(reader) {
|
|
31
|
+
flagReader = reader;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* THE flag-aware selector: whether the venue-generic plane serves the venue in this session. A card of
|
|
35
|
+
* `MARKET_DATA_VENUES` always; a dark card only while the published reader says its flag is on; anything else never.
|
|
36
|
+
* The bound finders below list exactly the venues it serves, and every app door, reader, store definition and the
|
|
37
|
+
* payment return asks it (directly or through them), so one flag decides every surface of a dark venue at once.
|
|
38
|
+
*/
|
|
39
|
+
export function marketDataVenueIsServed(key) {
|
|
40
|
+
if (MARKET_DATA_VENUES.some((venue) => venue.key === key))
|
|
41
|
+
return true;
|
|
42
|
+
const gated = FLAG_GATED_MARKET_DATA_VENUES.find((venue) => venue.key === key);
|
|
43
|
+
if (!gated || gated.flagKey === null)
|
|
44
|
+
return false;
|
|
45
|
+
try {
|
|
46
|
+
return flagReader?.(gated.flagKey) === true;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** The venues the registry lists now: every served card, then each dark card whose flag reads on. */
|
|
53
|
+
export function servedMarketDataVenues() {
|
|
54
|
+
const lit = FLAG_GATED_MARKET_DATA_VENUES.filter((venue) => marketDataVenueIsServed(venue.key));
|
|
55
|
+
return lit.length === 0 ? MARKET_DATA_VENUES : [...MARKET_DATA_VENUES, ...lit];
|
|
56
|
+
}
|
|
57
|
+
/** The served venue with this key, or null (a dark card reads null while its flag is off). */
|
|
20
58
|
export function venueByKey(key) {
|
|
21
|
-
return findVenueByKey(
|
|
59
|
+
return findVenueByKey(servedMarketDataVenues(), key);
|
|
22
60
|
}
|
|
23
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* The card of a registered venue key, served or dark; a key no card has throws (a programming error, never an
|
|
63
|
+
* account's state). A caller that holds a venue key already (a mounted venue dialog, a store being defined) reads its
|
|
64
|
+
* card here; whether the venue is served is the selector's question, asked at the doors.
|
|
65
|
+
*/
|
|
24
66
|
export function requireVenueByKey(key) {
|
|
25
|
-
const venue =
|
|
67
|
+
const venue = findVenueByKey(CARRIED_VENUES, key);
|
|
26
68
|
if (!venue)
|
|
27
69
|
throw new Error(`market-data: no registered venue "${String(key)}"`);
|
|
28
70
|
return venue;
|
|
29
71
|
}
|
|
30
|
-
/** The
|
|
72
|
+
/** The served venue a payment line item belongs to (`findVenueByPaymentProduct` over the served venues), or null. */
|
|
31
73
|
export function venueByPaymentProduct(item) {
|
|
32
|
-
return findVenueByPaymentProduct(
|
|
74
|
+
return findVenueByPaymentProduct(servedMarketDataVenues(), item);
|
|
33
75
|
}
|
|
@@ -73,6 +73,8 @@ const RESERVED_INPUT_NAMES = new Set(RESERVED_SCRIPT_INPUT_NAMES);
|
|
|
73
73
|
/** Names an object prototype reserves: never a field, whatever a script declares (a write would reach the prototype). */
|
|
74
74
|
const PROTOTYPE_NAMES = new Set(['__proto__', 'constructor', 'prototype']);
|
|
75
75
|
const TOOL_INSTANCE_KEYS = TOOL_TEMPLATE_RULES.instanceKeys;
|
|
76
|
+
/** Per type, the values its engine computes for one drawing (a GhostFeed's seeded volatility): instance state too. */
|
|
77
|
+
const TYPE_INSTANCE_KEYS = TOOL_TEMPLATE_RULES.instanceKeysByType;
|
|
76
78
|
const LABEL_KEY = TOOL_TEMPLATE_RULES.text.key;
|
|
77
79
|
const INTERVAL_BOUND_TYPES = new Set(TOOL_TEMPLATE_RULES.intervalBoundTypes);
|
|
78
80
|
const DEFAULT_EXCLUDED_KEYS = new Set(TOOL_TEMPLATE_RULES.defaultExcludedKeys);
|
|
@@ -123,8 +125,9 @@ function indicatorSpecs(type) {
|
|
|
123
125
|
/**
|
|
124
126
|
* A drawing type's fields, from the generated tables: its style (registry defaultStyle and held extras) and "Show on"
|
|
125
127
|
* in the template lane, its style minus the geometry and financial inputs in the default lane, a label type's label
|
|
126
|
-
* in the template lane only, and the per-drawing instance keys
|
|
127
|
-
*
|
|
128
|
+
* in the template lane only, and the per-drawing instance keys, the type's own included (a GhostFeed's seeded average
|
|
129
|
+
* high-low and variance: in its style, in no lane). The FRVP's are its own table (box and profile). A type the
|
|
130
|
+
* registry does not know declares only the instance keys: nothing of it is taken from a template.
|
|
128
131
|
*/
|
|
129
132
|
function toolSpecs(type) {
|
|
130
133
|
if (type === FRVP_TOOL_TYPE)
|
|
@@ -133,7 +136,8 @@ function toolSpecs(type) {
|
|
|
133
136
|
const templateKeys = new Set(ownRecord(TOOL_TEMPLATE_KEYS, type) ?? []);
|
|
134
137
|
const keepsDefaults = !DEFAULT_EXCLUDED_TYPES.has(type);
|
|
135
138
|
const labelled = templateKeys.has(LABEL_KEY);
|
|
136
|
-
const
|
|
139
|
+
const shared = labelled ? TOOL_INSTANCE_KEYS.filter((key) => key !== LABEL_KEY) : TOOL_INSTANCE_KEYS;
|
|
140
|
+
const instanceKeys = [...shared, ...(ownRecord(TYPE_INSTANCE_KEYS, type) ?? [])];
|
|
137
141
|
const specs = [];
|
|
138
142
|
for (const key of new Set([...Object.keys(style ?? {}), ...templateKeys])) {
|
|
139
143
|
if (key === VISIBLE_INTERVALS_KEY || instanceKeys.includes(key))
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
* Moved here from the web app, content unchanged: the persistence list settingsToSave and its type lists
|
|
8
8
|
* (src/constants/indicator.constants.ts), the instance keys and the template meta allowlists
|
|
9
9
|
* (src/utility/chart/indicator-defaults-apply.util.ts), the volatile keys (src/utility/chart/settings-templates.util.ts).
|
|
10
|
-
* Three changes are decisions of the plan, not drift: `runMode` is row-only instance state (A11);
|
|
10
|
+
* Three changes are decisions of the plan, not drift: `runMode` is row-only instance state (A11); six meta
|
|
11
11
|
* preferences a settings dialog writes are template-lane (decision 6: the Bitfinex position side, the Put/Call mode,
|
|
12
|
-
* the Turnover sides and period, the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* the Turnover sides and period, the Sector Volume asset type and the Insurance fund group; the Aggregated Volume
|
|
13
|
+
* margin category was a seventh until its row, which nothing read, left on 2026-10-25), the ETF pick stays identity;
|
|
14
|
+
* and "all" is a declared value (`visibleIntervalsMs: []` is All intervals, `maxNakedLevels: 0` is all levels,
|
|
15
|
+
* decision 3), which a capture writes where the engine holds none.
|
|
15
16
|
*
|
|
16
17
|
* A row is `[key, field]`: the field's owner (the settings bag when it names none, else `meta`, the bag's `meta`
|
|
17
18
|
* object), its lanes, whether it is instance state (which instance this is: never written by a template or a saved
|