@orangecharts/wrun-chart-host 0.15.0 → 0.16.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.
Files changed (175) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/economic.constants.d.ts +2 -0
  3. package/dist/constants/economic.constants.js +2 -0
  4. package/dist/constants/feature-flags.constants.d.ts +10 -0
  5. package/dist/constants/feature-flags.constants.js +52 -4
  6. package/dist/constants/feature-limits.constants.d.ts +72 -4
  7. package/dist/constants/feature-limits.constants.js +98 -20
  8. package/dist/constants/interval.constants.js +5 -0
  9. package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +12 -0
  10. package/dist/constants/kscript-data-interval-restrictions.constants.js +14 -0
  11. package/dist/constants/typed-width-fold.leaf.d.ts +50 -0
  12. package/dist/constants/typed-width-fold.leaf.js +99 -0
  13. package/dist/constants/typed-width-source.leaf.d.ts +24 -0
  14. package/dist/constants/typed-width-source.leaf.js +126 -0
  15. package/dist/constants/typed-width.leaf.d.ts +57 -0
  16. package/dist/constants/typed-width.leaf.js +78 -0
  17. package/dist/host-env.d.ts +10 -0
  18. package/dist/host-env.js +7 -0
  19. package/dist/host-ports.types.d.ts +11 -0
  20. package/dist/index.d.ts +3 -0
  21. package/dist/index.js +3 -0
  22. package/dist/interfaces/kscript-diagnostics.interface.d.ts +28 -0
  23. package/dist/interfaces/wrun-runtime.interface.d.ts +63 -3
  24. package/dist/interfaces/wrun-runtime.interface.js +11 -0
  25. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +13 -0
  26. package/dist/kscript-data/controls/live-trades-merge.util.js +16 -1
  27. package/dist/market-data/billing.interface.d.ts +12 -45
  28. package/dist/market-data/billing.interface.js +2 -2
  29. package/dist/replay/replayLadder.js +7 -4
  30. package/dist/settings-templates/footprint-rows.d.ts +6 -0
  31. package/dist/settings-templates/footprint-rows.js +6 -0
  32. package/dist/settings-templates/frvp-fields.js +14 -0
  33. package/dist/settings-templates/indicator-fields.js +31 -0
  34. package/dist/settings-templates/tool-tables.generated.js +19 -1
  35. package/dist/utility/chart/__fixtures__/live-bucket-regular-golden.json +1706 -0
  36. package/dist/utility/chart/cache-alignment.util.d.ts +42 -0
  37. package/dist/utility/chart/cache-alignment.util.js +88 -18
  38. package/dist/utility/chart/calendar-interval.util.d.ts +83 -1
  39. package/dist/utility/chart/calendar-interval.util.js +152 -4
  40. package/dist/utility/chart/candle-bar-end.util.d.ts +11 -4
  41. package/dist/utility/chart/candle-bar-end.util.js +17 -6
  42. package/dist/utility/chart/chart-time-domain.util.d.ts +3 -0
  43. package/dist/utility/chart/chart-time-domain.util.js +13 -4
  44. package/dist/utility/chart/feed-interval.util.d.ts +4 -2
  45. package/dist/utility/chart/feed-interval.util.js +5 -2
  46. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +3 -1
  47. package/dist/utility/chart/fetch-dedupe-policy.util.js +19 -1
  48. package/dist/utility/chart/footprint-display-mode.util.d.ts +2 -0
  49. package/dist/utility/chart/footprint-display-mode.util.js +5 -0
  50. package/dist/utility/chart/governed-lanes-gate.util.d.ts +46 -0
  51. package/dist/utility/chart/governed-lanes-gate.util.js +71 -0
  52. package/dist/utility/chart/governed-lanes-reader-seat.d.ts +14 -0
  53. package/dist/utility/chart/governed-lanes-reader-seat.js +14 -0
  54. package/dist/utility/chart/history-wall.util.d.ts +13 -2
  55. package/dist/utility/chart/history-wall.util.js +11 -4
  56. package/dist/utility/chart/interval-ladder.util.d.ts +5 -2
  57. package/dist/utility/chart/interval-ladder.util.js +44 -4
  58. package/dist/utility/chart/interval-registry.util.d.ts +22 -1
  59. package/dist/utility/chart/interval-registry.util.js +50 -2
  60. package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +32 -4
  61. package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +22 -5
  62. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +10 -0
  63. package/dist/utility/chart/kscript-drawing-safe-area.util.js +30 -3
  64. package/dist/utility/chart/kscript-legend-entries.util.d.ts +21 -4
  65. package/dist/utility/chart/kscript-legend-entries.util.js +27 -5
  66. package/dist/utility/chart/kscript-main-grid-stages.util.js +74 -24
  67. package/dist/utility/chart/kscript-row-name.leaf.d.ts +13 -0
  68. package/dist/utility/chart/kscript-row-name.leaf.js +18 -0
  69. package/dist/utility/chart/kscript-venue-policy.util.d.ts +61 -26
  70. package/dist/utility/chart/kscript-venue-policy.util.js +138 -37
  71. package/dist/utility/chart/live-bucket.util.d.ts +29 -4
  72. package/dist/utility/chart/live-bucket.util.js +45 -12
  73. package/dist/utility/chart/market-session.util.d.ts +62 -10
  74. package/dist/utility/chart/market-session.util.js +93 -13
  75. package/dist/utility/chart/marketKind.util.d.ts +1 -7
  76. package/dist/utility/chart/marketKind.util.js +6 -8
  77. package/dist/utility/chart/mixed-mode.util.d.ts +17 -0
  78. package/dist/utility/chart/om-target.util.js +6 -4
  79. package/dist/utility/chart/price-precision.util.d.ts +20 -6
  80. package/dist/utility/chart/price-precision.util.js +34 -7
  81. package/dist/utility/chart/profile-frame-window.util.d.ts +15 -0
  82. package/dist/utility/chart/profile-frame-window.util.js +12 -0
  83. package/dist/utility/chart/rth-session.util.d.ts +3 -1
  84. package/dist/utility/chart/rth-session.util.js +3 -1
  85. package/dist/utility/chart/script-source-session.util.d.ts +43 -0
  86. package/dist/utility/chart/script-source-session.util.js +61 -0
  87. package/dist/utility/chart/typed-width-grid.util.d.ts +23 -0
  88. package/dist/utility/chart/typed-width-grid.util.js +203 -0
  89. package/dist/utility/common/transformations.util.d.ts +6 -0
  90. package/dist/utility/common/transformations.util.js +28 -4
  91. package/dist/utility/number-format.util.d.ts +14 -1
  92. package/dist/utility/number-format.util.js +22 -4
  93. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +24 -1
  94. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +113 -0
  95. package/dist/utility/v2/v2-enums.leaf.js +3 -0
  96. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +9 -3
  97. package/dist/utility/wrun/wrun-batched-marks.util.js +65 -17
  98. package/dist/utility/wrun/wrun-canvases.util.d.ts +4 -2
  99. package/dist/utility/wrun/wrun-canvases.util.js +7 -12
  100. package/dist/utility/wrun/wrun-cap-notice.util.d.ts +5 -0
  101. package/dist/utility/wrun/wrun-cap-notice.util.js +23 -0
  102. package/dist/utility/wrun/wrun-card-style.util.d.ts +1 -1
  103. package/dist/utility/wrun/wrun-card-style.util.js +2 -2
  104. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +8 -0
  105. package/dist/utility/wrun/wrun-chart-market-facts.util.js +13 -1
  106. package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +10 -0
  107. package/dist/utility/wrun/wrun-child-overlay-id.util.js +24 -0
  108. package/dist/utility/wrun/wrun-cloud-cme-stamp.util.d.ts +72 -0
  109. package/dist/utility/wrun/wrun-cloud-cme-stamp.util.js +151 -0
  110. package/dist/utility/wrun/wrun-color-facts.util.d.ts +3 -3
  111. package/dist/utility/wrun/wrun-color-facts.util.js +8 -5
  112. package/dist/utility/wrun/wrun-colour-tone.lazy.d.ts +20 -0
  113. package/dist/utility/wrun/wrun-colour-tone.lazy.js +23 -0
  114. package/dist/utility/wrun/wrun-colour-tone.util.d.ts +14 -0
  115. package/dist/utility/wrun/wrun-colour-tone.util.js +119 -0
  116. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +3 -2
  117. package/dist/utility/wrun/wrun-dark-pool.util.js +5 -4
  118. package/dist/utility/wrun/wrun-frames.d.ts +1 -1
  119. package/dist/utility/wrun/wrun-frames.js +2 -2
  120. package/dist/utility/wrun/wrun-handles.util.d.ts +1 -1
  121. package/dist/utility/wrun/wrun-handles.util.js +1 -1
  122. package/dist/utility/wrun/wrun-host.service.d.ts +32 -2
  123. package/dist/utility/wrun/wrun-host.service.js +44 -2
  124. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +20 -0
  125. package/dist/utility/wrun/wrun-hosted-wire-caps.js +85 -2
  126. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +37 -0
  127. package/dist/utility/wrun/wrun-hosted-wire.util.js +54 -0
  128. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +1 -0
  129. package/dist/utility/wrun/wrun-hud-looks.util.js +6 -11
  130. package/dist/utility/wrun/wrun-integration-route.util.d.ts +24 -0
  131. package/dist/utility/wrun/wrun-integration-route.util.js +19 -0
  132. package/dist/utility/wrun/wrun-live-intake.util.js +17 -1
  133. package/dist/utility/wrun/wrun-live-patch.util.d.ts +6 -1
  134. package/dist/utility/wrun/wrun-live-patch.util.js +10 -4
  135. package/dist/utility/wrun/wrun-live-tick.util.js +59 -4
  136. package/dist/utility/wrun/wrun-overlay-drivers.util.js +3 -0
  137. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +15 -0
  138. package/dist/utility/wrun/wrun-overlay-run.util.js +274 -47
  139. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +1 -1
  140. package/dist/utility/wrun/wrun-panel-mount.util.js +42 -13
  141. package/dist/utility/wrun/wrun-pin-venues.util.js +5 -1
  142. package/dist/utility/wrun/wrun-refusal.util.d.ts +4 -0
  143. package/dist/utility/wrun/wrun-refusal.util.js +102 -13
  144. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
  145. package/dist/utility/wrun/wrun-registry-errors.util.js +5 -3
  146. package/dist/utility/wrun/wrun-row-source-factory.js +17 -1
  147. package/dist/utility/wrun/wrun-row-source.d.ts +8 -1
  148. package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +1 -1
  149. package/dist/utility/wrun/wrun-sandbox-row-source.js +9 -0
  150. package/dist/utility/wrun/wrun-setting-words.util.d.ts +12 -5
  151. package/dist/utility/wrun/wrun-setting-words.util.js +25 -8
  152. package/dist/utility/wrun/wrun-socket-row-source.d.ts +26 -1
  153. package/dist/utility/wrun/wrun-socket-row-source.js +125 -12
  154. package/dist/utility/wrun/wrun-source-rows.util.d.ts +3 -3
  155. package/dist/utility/wrun/wrun-source-rows.util.js +8 -7
  156. package/dist/utility/wrun/wrun-style-words.util.d.ts +31 -9
  157. package/dist/utility/wrun/wrun-style-words.util.js +46 -15
  158. package/dist/utility/wrun/wrun-trades-lane.util.js +2 -1
  159. package/dist/utility/wrun/wrun-trap-replay.util.d.ts +42 -0
  160. package/dist/utility/wrun/wrun-trap-replay.util.js +63 -0
  161. package/dist/utility/wrun/wrun-volume-profile.util.js +6 -5
  162. package/dist/utility/wrun-display-name.util.d.ts +10 -0
  163. package/dist/utility/wrun-display-name.util.js +21 -0
  164. package/dist/utils/replay/replay-buffer-math.d.ts +2 -0
  165. package/dist/utils/replay/replay-buffer-math.js +2 -0
  166. package/dist/workers/constants/socket-slots.d.ts +1 -1
  167. package/dist/workers/utils/time.worker.util.js +2 -2
  168. package/dist/workers/utils/volume-profile.worker.util.d.ts +9 -0
  169. package/dist/workers/utils/volume-profile.worker.util.js +20 -0
  170. package/dist/workers/wrun/wrun-abi-host.d.ts +3 -0
  171. package/dist/workers/wrun/wrun-abi-host.js +82 -5
  172. package/dist/workers/wrun/wrun-engine-handler.js +53 -4
  173. package/dist/workers/wrun/wrun-trap-frames.leaf.d.ts +28 -0
  174. package/dist/workers/wrun/wrun-trap-frames.leaf.js +108 -0
  175. package/package.json +11 -11
@@ -55,6 +55,17 @@ export class WrunLiveOrderError extends Error {
55
55
  this.name = 'WrunLiveOrderError';
56
56
  }
57
57
  }
58
+ const trapContextByError = new WeakMap();
59
+ /** The trap record rides beside the Error it explains (like `attachWrunLive`), so the Error's message stays the
60
+ * host's words every other reader matches on. Kept with the wire types so the worker and the main thread share one
61
+ * registry. */
62
+ export function attachWrunTrap(error, trap) {
63
+ if (typeof error === 'object' && error !== null)
64
+ trapContextByError.set(error, trap);
65
+ }
66
+ export function wrunTrapOf(error) {
67
+ return typeof error === 'object' && error !== null ? trapContextByError.get(error) : undefined;
68
+ }
58
69
  const liveBlockStatsByRows = new WeakMap();
59
70
  /** The live block's restore/snapshot accounting rides beside the rows it
60
71
  * belongs to (like the handle set and the strategy output), keeping each
@@ -82,6 +82,8 @@ export interface LiveTradesMergeOptions extends TradesTapeFloor {
82
82
  }
83
83
  /** One live print as the fold reads it: a raw TRADE fill, or a TRADE_LARGE row (one order). */
84
84
  export interface LiveTradePrint {
85
+ /** The stamp in ms exact to the microsecond (`tradeStampMs`, never rounded to the ms): one order's fills share it,
86
+ * and the history worker keys the same print on the same value (`TradeColumns.tsExact`). */
85
87
  tsMs: number;
86
88
  price: number;
87
89
  size: number;
@@ -166,6 +168,17 @@ export declare function tradesServedStartMs(nowMs: number, historySec: number, i
166
168
  exchange?: unknown;
167
169
  historyAsOfMs?: unknown;
168
170
  }): number;
171
+ /** The precision every tape stamp is keyed at, in ns: the gateway stores a trade's stamp in microseconds (a served
172
+ * row's nanoseconds always end in three zeros), while a live CME frame carries Databento's nanoseconds. */
173
+ export declare const TAPE_STAMP_PRECISION_NS = 1000;
174
+ /**
175
+ * A trade's stamp in ms as every tape reader keys it: exact to the microsecond, the stored precision. The fills of one
176
+ * aggressor order share it and no other order does (the gateway's `minAmountPerOrder` key), so the package joins an
177
+ * order on it alone; rounded to the millisecond, orders 0.5 ms apart read as one (Discord ticket #683). Floored to the
178
+ * microsecond, a live print and its served row land on the SAME double, so the reconcile matches them by offset; kept
179
+ * to the nanosecond, the live copy of an order would sit beside its history row and draw twice.
180
+ */
181
+ export declare function tradeStampMs(seconds: number, nanos: number): number;
169
182
  /** Null for a point the fold rejects, another channel's included; without `large`, either channel (stamp readers). */
170
183
  export declare function readLiveTradePrint(newPoint: unknown, large?: boolean): LiveTradePrint | null;
171
184
  /** Whether a quote asset's amounts are US dollars (`TRADES_LARGE_USD_QUOTES`). */
@@ -184,6 +184,20 @@ export function tradesServedStartMs(nowMs, historySec, intervalMs, options = {})
184
184
  ? Number.NEGATIVE_INFINITY
185
185
  : tradesBarLimitStartMs(options.windowEndMs ?? nowMs, options.barLimitSec, intervalMs, options.exchange));
186
186
  }
187
+ /** The precision every tape stamp is keyed at, in ns: the gateway stores a trade's stamp in microseconds (a served
188
+ * row's nanoseconds always end in three zeros), while a live CME frame carries Databento's nanoseconds. */
189
+ export const TAPE_STAMP_PRECISION_NS = 1_000;
190
+ /**
191
+ * A trade's stamp in ms as every tape reader keys it: exact to the microsecond, the stored precision. The fills of one
192
+ * aggressor order share it and no other order does (the gateway's `minAmountPerOrder` key), so the package joins an
193
+ * order on it alone; rounded to the millisecond, orders 0.5 ms apart read as one (Discord ticket #683). Floored to the
194
+ * microsecond, a live print and its served row land on the SAME double, so the reconcile matches them by offset; kept
195
+ * to the nanosecond, the live copy of an order would sit beside its history row and draw twice.
196
+ */
197
+ export function tradeStampMs(seconds, nanos) {
198
+ const micros = Number.isFinite(nanos) ? Math.floor(nanos / TAPE_STAMP_PRECISION_NS) : 0;
199
+ return seconds * 1000 + micros / 1000;
200
+ }
187
201
  /** Null for a point the fold rejects, another channel's included; without `large`, either channel (stamp readers). */
188
202
  export function readLiveTradePrint(newPoint, large) {
189
203
  if (!newPoint || typeof newPoint !== 'object')
@@ -198,7 +212,8 @@ export function readLiveTradePrint(newPoint, large) {
198
212
  return null;
199
213
  }
200
214
  const nanos = Number(trade?.timestamp?.nanoseconds ?? trade?.timestamp?.nanos ?? 0);
201
- const tsMs = seconds * 1000 + (Number.isFinite(nanos) ? Math.round(nanos / 1e6) : 0);
215
+ // The order key at the stored precision (tradeStampMs): the history worker keys the same print on the same value.
216
+ const tsMs = tradeStampMs(seconds, nanos);
202
217
  if (!Number.isFinite(tsMs))
203
218
  return null;
204
219
  const exchange = point.series?.exchange;
@@ -94,39 +94,15 @@ export interface MarketDataChangePlanDto {
94
94
  }
95
95
  /**
96
96
  * POST <basePath>/checkout -> 200: a Stripe redirect, or a refusal. 'professional_unavailable' is terminal (the UI
97
- * shows "not available"). 'review_held' and 'review_withdrawn': a review of the account's answers only an operator
98
- * resolves, or one that withdrew real-time (the review card says which). Pay first, the server no longer answers
99
- * 'attestation_required' or 'agreement_required'; they stay in the union and are handled defensively (the flow routes
100
- * into that step).
97
+ * shows "not available"). Pay first, the server no longer answers 'attestation_required' or 'agreement_required'; they
98
+ * stay in the union and are handled defensively (the flow routes into that step).
101
99
  */
102
100
  export type MarketDataCheckoutResponseDto = {
103
101
  url: string;
104
102
  } | {
105
103
  refused: MarketDataPurchaseRefusalCode;
106
104
  };
107
- export type MarketDataPurchaseRefusalCode = 'professional_unavailable' | 'review_held' | 'review_withdrawn' | 'agreement_required' | 'attestation_required';
108
- /**
109
- * GET <basePath>/subscription `review`: the review of the account's answers that bears on real-time (Exhibit A Q19.2),
110
- * or null. 'pending': an employer or occupation that suggests a financial firm or a registered person asks the
111
- * subscriber to confirm the declaration before `deadline` (POST <basePath>/attestation/review/confirm); real-time runs
112
- * until the deadline passes. 'held': an operator reviews the declaration and real-time waits. 'withdrawn': an operator
113
- * withdrew real-time (`resolvedAt`); the way back is a new declaration.
114
- */
115
- export interface MarketDataReviewDto {
116
- state: 'pending' | 'held' | 'withdrawn';
117
- reason: string;
118
- openedAt: string;
119
- deadline: string | null;
120
- resolvedAt: string | null;
121
- }
122
- /**
123
- * POST <basePath>/attestation/review/confirm (no body) -> 200: the pending review confirmed; 409
124
- * `<VENUE>_REVIEW_NOT_OPEN` when no review is pending (none, or one only an operator resolves).
125
- */
126
- export interface MarketDataReviewConfirmDto {
127
- confirmed: boolean;
128
- confirmedAt: string;
129
- }
105
+ export type MarketDataPurchaseRefusalCode = 'professional_unavailable' | 'agreement_required' | 'attestation_required';
130
106
  /**
131
107
  * Why the server set a subscription to end at its period end on its own: 'unqualified', the account is paid but has
132
108
  * not completed the subscriber questions and the agreement.
@@ -180,8 +156,6 @@ export interface MarketDataOperatorGrantDto {
180
156
  }
181
157
  export interface GetMarketDataSubscriptionResponseDto {
182
158
  subscription: MarketDataSubscriptionDto | null;
183
- /** Additive (a server from before the review answers none). */
184
- review?: MarketDataReviewDto | null;
185
159
  /** Additive (a server from before operator grants on the answer answers none). */
186
160
  grant?: MarketDataOperatorGrantDto | null;
187
161
  }
@@ -316,14 +290,11 @@ export interface MarketDataCancelResponseDto {
316
290
  }
317
291
  export type MarketDataAttestation = MarketDataAttestationRecordDto;
318
292
  export type MarketDataSubscription = MarketDataSubscriptionDto;
319
- /** The review of the account's answers, as served (`MarketDataReviewDto`). */
320
- export type MarketDataReview = MarketDataReviewDto;
321
293
  /** The operator's grant as the store holds it: no subscription, its steps release the grant at the gate. */
322
294
  export type MarketDataOperatorGrant = MarketDataOperatorGrantDto;
323
- /** GET <basePath>/subscription in the domain: the subscription, the review and the operator's grant, each or none. */
295
+ /** GET <basePath>/subscription in the domain: the subscription and the operator's grant, each or none. */
324
296
  export interface MarketDataSubscriptionAnswer {
325
297
  subscription: MarketDataSubscription | null;
326
- review: MarketDataReview | null;
327
298
  grant: MarketDataOperatorGrant | null;
328
299
  }
329
300
  /** The explicit agreement record: accepted, for which version, and when. */
@@ -365,8 +336,8 @@ export declare function isMarketDataListedAgreementCurrent(current: Pick<MarketD
365
336
  * A declaration on the venue's current form (a new question set means a new declaration) whose validity has not ended
366
337
  * at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's last evaluation),
367
338
  * never an implied Date.now(). A record without `expiresAt` reads lapsed, as does one whose `expiresAt` does not parse
368
- * (ask again rather than trust it): status is reconfirmed every 12 months (Exhibit A Q19.3), and a record that names
369
- * no end can never be shown to be inside its year.
339
+ * (ask again rather than trust it): status is reconfirmed every 12 months, and a record that names no end can never be
340
+ * shown to be inside its year.
370
341
  */
371
342
  export declare function isMarketDataAttestationLive(venue: MarketDataVenue, attestation: MarketDataAttestation | null | undefined, now: number): boolean;
372
343
  /** A non-professional declaration on the current form, still valid at `now`: the account may buy real-time. */
@@ -412,12 +383,12 @@ export type MarketDataCheckoutResult = {
412
383
  * 'refused': the server answered and refused (any status but a 401, a 429 or a 5xx), so what the account holds may
413
384
  * differ from what the page shows and the store reads the records again. The refusals a store acts on itself, read from
414
385
  * the body's tag, are refusals too: 'agreement_stale' (409 `<VENUE>_AGREEMENT_STALE`: the text changed, read it
415
- * again), 'attestation_required' (`<VENUE>_ATTESTATION_REQUIRED`: the declaration on file does not count),
416
- * 'email_unverified' (403 `<VENUE>_EMAIL_UNVERIFIED`: the verify-email card opens) and 'review_not_open' (409
417
- * `<VENUE>_REVIEW_NOT_OPEN`: read the records again). 'unauthorized': a 401 or an expired session. 'server': a 5xx or a
418
- * rate limit, where a retry can succeed. 'network': no answer. 'aborted': the caller's own abort, no refusal at all.
386
+ * again), 'attestation_required' (`<VENUE>_ATTESTATION_REQUIRED`: the declaration on file does not count) and
387
+ * 'email_unverified' (403 `<VENUE>_EMAIL_UNVERIFIED`: the verify-email card opens). 'unauthorized': a 401 or an expired
388
+ * session. 'server': a 5xx or a rate limit, where a retry can succeed. 'network': no answer. 'aborted': the caller's
389
+ * own abort, no refusal at all.
419
390
  */
420
- export type MarketDataBillingErrorKind = 'refused' | 'agreement_stale' | 'attestation_required' | 'email_unverified' | 'review_not_open' | 'unauthorized' | 'network' | 'aborted' | 'server';
391
+ export type MarketDataBillingErrorKind = 'refused' | 'agreement_stale' | 'attestation_required' | 'email_unverified' | 'unauthorized' | 'network' | 'aborted' | 'server';
421
392
  export declare class MarketDataBillingError extends Error {
422
393
  readonly kind: MarketDataBillingErrorKind;
423
394
  readonly status: number | null;
@@ -436,12 +407,8 @@ export declare class MarketDataBillingError extends Error {
436
407
  export interface MarketDataBillingRepository {
437
408
  getAttestation(signal?: AbortSignal): Promise<MarketDataAttestation | null>;
438
409
  submitAttestation(body: MarketDataAttestationDto, signal?: AbortSignal): Promise<MarketDataAttestationSubmitResult>;
439
- /** GET <basePath>/subscription: the subscription and the review of the account's answers, each or none. */
410
+ /** GET <basePath>/subscription: the subscription and the operator's grant, each or none. */
440
411
  getSubscription(signal?: AbortSignal): Promise<MarketDataSubscriptionAnswer>;
441
- /** POST <basePath>/attestation/review/confirm: the subscriber confirms a pending review (a typed refusal throws). */
442
- confirmReview(signal?: AbortSignal): Promise<{
443
- confirmedAt: string;
444
- }>;
445
412
  /** Never resolves 'busy' (that is the store's own answer); a refusal resolves, a failure throws. */
446
413
  checkout(body: MarketDataCheckoutDto | MarketDataProductCheckoutDto, options: {
447
414
  idempotencyId: string;
@@ -54,8 +54,8 @@ export function isMarketDataListedAgreementCurrent(current, assent) {
54
54
  * A declaration on the venue's current form (a new question set means a new declaration) whose validity has not ended
55
55
  * at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's last evaluation),
56
56
  * never an implied Date.now(). A record without `expiresAt` reads lapsed, as does one whose `expiresAt` does not parse
57
- * (ask again rather than trust it): status is reconfirmed every 12 months (Exhibit A Q19.3), and a record that names
58
- * no end can never be shown to be inside its year.
57
+ * (ask again rather than trust it): status is reconfirmed every 12 months, and a record that names no end can never be
58
+ * shown to be inside its year.
59
59
  */
60
60
  export function isMarketDataAttestationLive(venue, attestation, now) {
61
61
  if (!attestation || !isMarketDataFormVersionAccepted(venue, attestation.formVersion))
@@ -1,6 +1,6 @@
1
1
  // Replay fidelity ladder: measured retention and request-shaping constants.
2
2
  import { RAIL_TFS, RAIL_TF_BOOK_EDGE_SEC, RAIL_TF_BUCKET_SEC, RAIL_TF_EDGE_SEC, REPLAY_LADDER_EDGES_SEC, REPLAY_STEP_TFS, REPLAY_STEP_TF_BOOK_EDGE_SEC, REPLAY_STEP_TF_BUCKET_SEC, REPLAY_STEP_TF_EDGE_SEC, } from '../constants/replay-ladder.leaf.js';
3
- import { FEATURE_LIMITS, GATEWAY_TIER_MAX_BARS } from '../constants/feature-limits.constants.js';
3
+ import { FEATURE_LIMITS, GATEWAY_TIER_MAX_BARS, upgradeOfferTier, } from '../constants/feature-limits.constants.js';
4
4
  import { checkIsCryptoIndex } from '../utility/chart/crypto-index.leaf.js';
5
5
  import { checkIsBlockedOn1s } from '../utility/chart/index-mode.util.js';
6
6
  import { standardIntervalMsAtOrBelow } from '../utility/chart/interval-registry.util.js';
@@ -223,10 +223,13 @@ export function gatewayTierMaxBars(tier, resolution) {
223
223
  * wall now explains itself the way a paid one does.
224
224
  */
225
225
  export function replayPlusReachesFurther(tier, reachBars, resolution) {
226
- if (tier !== 'free')
226
+ // The plan an upgrade prompt may offer from the viewer's own (Plus from free; none from a paid plan while
227
+ // Ultimate is not sold), compared against the viewer's own gateway wall.
228
+ const offer = upgradeOfferTier(tier);
229
+ if (offer === null)
227
230
  return false;
228
- return (FEATURE_LIMITS.replayReachBars.plus > reachBars ||
229
- gatewayTierMaxBars('plus', resolution) > gatewayTierMaxBars('free', resolution));
231
+ return (FEATURE_LIMITS.replayReachBars[offer] > reachBars ||
232
+ gatewayTierMaxBars(offer, resolution) > gatewayTierMaxBars(tier, resolution));
230
233
  }
231
234
  export function gatewayTierReachMs(tier, resolution) {
232
235
  const label = replayResolutionRequestIntervalLabel(resolution);
@@ -17,6 +17,12 @@ import type { SettingsFormModel, SettingsFormRow } from './form-rows.js';
17
17
  */
18
18
  /** The groups a host draws, by the slot names of both web footprint dialogs. */
19
19
  export declare const FOOTPRINT_FORM_SLOTS: readonly ["sierra-look", "footprint-columns"];
20
+ /**
21
+ * Web-only footprint slots: rows web's dialogs draw that a host's form does not describe yet. `footprint-row-split`
22
+ * (Split rows by, FootprintRowSplitPicker.vue) waits on the phone's engine pin; until then the phone keeps the split
23
+ * at none through withFootprintDisplayMode, which sets it back on every display mode pick other than Total.
24
+ */
25
+ export declare const FOOTPRINT_WEB_ONLY_SLOTS: readonly ["footprint-row-split"];
20
26
  export type FootprintFormSlot = (typeof FOOTPRINT_FORM_SLOTS)[number];
21
27
  /**
22
28
  * The rows of one group for `model`, top to bottom: `sierra-look` is the Classic Presets row; `footprint-columns` is
@@ -19,6 +19,12 @@ import { withFootprintSierraLook } from '../utility/chart/footprint-sierra-look.
19
19
  */
20
20
  /** The groups a host draws, by the slot names of both web footprint dialogs. */
21
21
  export const FOOTPRINT_FORM_SLOTS = ['sierra-look', 'footprint-columns'];
22
+ /**
23
+ * Web-only footprint slots: rows web's dialogs draw that a host's form does not describe yet. `footprint-row-split`
24
+ * (Split rows by, FootprintRowSplitPicker.vue) waits on the phone's engine pin; until then the phone keeps the split
25
+ * at none through withFootprintDisplayMode, which sets it back on every display mode pick other than Total.
26
+ */
27
+ export const FOOTPRINT_WEB_ONLY_SLOTS = ['footprint-row-split'];
22
28
  const DISPLAY_MODE_WORDS = {
23
29
  'split-bar': 'indicators.settings.options.split',
24
30
  'stacked-bar-delta': 'indicators.settings.options.delta',
@@ -122,6 +122,20 @@ export const FRVP_FIELD_ROWS = [
122
122
  // Not a setting: the stamp the saved defaults' profile half carries in the account's style memory, written with it
123
123
  // (FRVP_PROFILE_DEFAULTS_STAMP below). In the default lane so the memory keeps it; no panel, row or copy holds it.
124
124
  ['profileDefaultsVersion', { owner: 'profile', lanes: ['default'] }],
125
+ // Dynamic Profile parity (Exocharts, 2026-11-13). The profile's row text and imbalance marks, read with the session
126
+ // volume profile's keys and words, and the candle the box draws for its range ('none' by default).
127
+ ['rowText', PREFERENCE],
128
+ ['imbalance', PREFERENCE],
129
+ ['imbalanceRatio', PREFERENCE],
130
+ ['imbalanceBuyColor', PREFERENCE],
131
+ ['imbalanceSellColor', PREFERENCE],
132
+ ['rangeCandle', PREFERENCE],
133
+ // The box's fill (null: none) and its border: the Style tab's rows beside the boundary lines.
134
+ ['backgroundColor', BOX_STYLE],
135
+ ['showBorder', BOX_STYLE],
136
+ // The range's own figures the printed stats read (change, high, low, open interest change, liquidations, the
137
+ // window's ends): written by the control for the box it draws, never saved.
138
+ ['profileRangeStats', BOX_DRAWN],
125
139
  ];
126
140
  /**
127
141
  * The stamp of the saved FRVP defaults' profile half in the account's style memory (the `profileDefaultsVersion` row):
@@ -513,6 +513,10 @@ export const INDICATOR_COMMON_FIELDS = [
513
513
  // Without this entry the reconcile pick sites silently strip the merge on
514
514
  // the next save and panes un-merge on reload.
515
515
  ['hostPaneId', INSTANCE],
516
+ // Pane place (PANES-ANY-SIDE): the side, look, size, order and orientation of this indicator's pane, `{ side, look?,
517
+ // sizePx?, order?, flip? }`. Row-only: templates, Save as default and Reset skip it. The mount restamps it before the engine add
518
+ // (chart.add-indicator, pane-place.util restampPanePlace), so a build with the feature off keeps it through a save.
519
+ ['panePlace', INSTANCE],
516
520
  // Pane hosting axes: the member's requested axis side (left/right/hidden).
517
521
  // The axis side lives and dies with the `hostPaneId` association. `hideLegendName` is NOT here:
518
522
  // it is a per-indicator preference (the settings dialog's "Show indicator name").
@@ -773,9 +777,19 @@ export const INDICATOR_COMMON_FIELDS = [
773
777
  // Center, written either way once picked (a pick of Left must replace a saved Center); absent reads Left.
774
778
  ['candlePosition', PREFERENCE],
775
779
  ['footprintColumns', PREFERENCE],
780
+ // Footprint Split rows by (FOOTPRINT-ROW-SPLIT, 2026-11-14), declared after the fixture in its own change: none, time,
781
+ // venue or market; absent reads none.
782
+ ['rowSplit', PREFERENCE],
776
783
  // The Aggregated Volume Footprint's Trim empty tail rows (settings no-op audit, 2026-10-25): its template stamps
777
784
  // the key on, and a row the user switched off must keep it off through a reload.
778
785
  ['trimZeroTails', PREFERENCE],
786
+ // A TPO scheme's colours per mode (TPO TimeOfDay, 2026-11-15), declared after the fixture in its own change:
787
+ // the bundle travels with the scheme it names (tpoSchemeBundleOf), so a template and a saved default carry it.
788
+ ['tpoScheme', PREFERENCE],
789
+ // What a Split rows by pick changed, as it was (FOOTPRINT-ROW-SPLIT round 2, 2026-11-14), declared after the fixture
790
+ // in its own change: None puts it back. Instance state: the row keeps it through a reload; a template or a saved
791
+ // default never carries it onto another instance.
792
+ ['rowSplitFrom', INSTANCE],
779
793
  // A window's projection stamps (window-cell.util, 2026-10-23), declared after the fixture in their own change: the
780
794
  // chart Indicator a window door copied the owner from (`{ overlayId, chartIndex }`), and the mark of a window that
781
795
  // shows its tables alone (the window an add opens beside its chart Indicator). The row keeps both (a reload keeps
@@ -803,6 +817,9 @@ export const INDICATOR_COMMON_FIELDS = [
803
817
  // The footprint anchor's read stamp (2026-11-07, footprint-anchor-tick.util): a stamped anchor only moves finer, an
804
818
  // older read's may heal coarser. Appended here, after the rows the golden fixture knows (row-keys.golden.spec).
805
819
  ['anchorTickInference', PREFERENCE],
820
+ // The Fixed Range Volume Profile's range candle (2026-11-13, Dynamic Profile parity): 'none', 'body', 'outline' or
821
+ // 'openClose'. Declared here so the companion's workspace row keeps it; draw-only, no refetch.
822
+ ['rangeCandle', PREFERENCE],
806
823
  ];
807
824
  /**
808
825
  * FEED (live series, docs/features/indicators/feeds.md): the rest of the C4 record beside `address`, `scope` and
@@ -900,6 +917,16 @@ const OPTIONS_GEX_FIELDS = [
900
917
  const ORDERBOOK_PROFILE_FIELDS = [
901
918
  ['groupingMode', { lanes: ['row', 'template', 'default'], unset: 'dynamic' }],
902
919
  ];
920
+ /**
921
+ * The TPO block shape ('square' or 'wide', the Block shape row, 2026-11-16). A row that never picked holds no key and
922
+ * draws wide: untouched workspace rows are never rewritten (the row lane writes no unset). A template or a saved
923
+ * default captured from such a row carries 'wide' (`unset`), so applied over a square TPO it restores wide instead of
924
+ * leaving square (the Order Book Profile's `groupingMode` rule). Scoped to the two TPO types: with an unset value a
925
+ * shared row would write 'wide' into every other indicator's template.
926
+ */
927
+ const TPO_FIELDS = [
928
+ ['blockShape', { lanes: ['row', 'template', 'default'], unset: 'wide' }],
929
+ ];
903
930
  /** The VRVP own-window scope rows (see INDICATOR_TYPE_FIELDS below). */
904
931
  const VISIBLE_RANGE_PROFILE_FIELDS = [
905
932
  ['profileWindow', PREFERENCE],
@@ -927,6 +954,8 @@ export const INDICATOR_TYPE_FIELDS = {
927
954
  VISIBLE_RANGE_VOLUME_PROFILE: VISIBLE_RANGE_PROFILE_FIELDS,
928
955
  AGGREGATED_VISIBLE_RANGE_VOLUME_PROFILE: VISIBLE_RANGE_PROFILE_FIELDS,
929
956
  ORDERBOOK_PROFILE: ORDERBOOK_PROFILE_FIELDS,
957
+ TIME_PRICE_OPPORTUNITY: TPO_FIELDS,
958
+ AGGREGATED_TIME_PRICE_OPPORTUNITY: TPO_FIELDS,
930
959
  OPEN_INTEREST_PROFILE: METRIC_PROFILE_FIELDS,
931
960
  LIQUIDATION_PROFILE: METRIC_PROFILE_FIELDS,
932
961
  OPTIONS_HEATMAP: OPTIONS_HEATMAP_FIELDS,
@@ -988,4 +1017,6 @@ export const INDICATOR_TYPE_FIELDS = {
988
1017
  ['lines', META_PREFERENCE],
989
1018
  ['plots', META_DERIVED],
990
1019
  ],
1020
+ /** Net Longs & Shorts: Per candle or Running total (OpenInterestPositionsSettings.vue `meta.display`). */
1021
+ OPEN_INTEREST_POSITIONS: [['display', META_PREFERENCE]],
991
1022
  };
@@ -736,12 +736,21 @@ export const TOOL_DEFAULT_STYLE = {
736
736
  lineStyle: 'solid',
737
737
  fontSize: 14,
738
738
  textPosition: 'center',
739
- textVerticalPosition: 'top',
739
+ textVerticalPosition: 'middle',
740
740
  fontWeight: 400,
741
741
  fontStyle: 'normal',
742
742
  fillBackground: true,
743
743
  fillColor: '#4DA3FF26',
744
744
  middleLine: true,
745
+ parallelLevels: [
746
+ { value: -0.25, enabled: false },
747
+ { value: 0, enabled: true },
748
+ { value: 0.25, enabled: false },
749
+ { value: 0.5, enabled: true, lineStyle: 'dashed' },
750
+ { value: 0.75, enabled: false },
751
+ { value: 1, enabled: true },
752
+ { value: 1.25, enabled: false },
753
+ ],
745
754
  },
746
755
  Path: { color: '#4DA3FF', lineStyle: 'solid', lineWidth: 1.5 },
747
756
  Pencil: { color: '#4DA3FF', lineStyle: 'solid', lineWidth: 2, smoothing: 10 },
@@ -1329,6 +1338,14 @@ export const TOOL_TEMPLATE_KEYS = {
1329
1338
  'profileStatsPosition',
1330
1339
  'levelLineWidth',
1331
1340
  'levelLineStyle',
1341
+ 'rowText',
1342
+ 'imbalance',
1343
+ 'imbalanceRatio',
1344
+ 'imbalanceBuyColor',
1345
+ 'imbalanceSellColor',
1346
+ 'rangeCandle',
1347
+ 'backgroundColor',
1348
+ 'showBorder',
1332
1349
  ],
1333
1350
  FlagMark: ['color', 'visibleIntervalsMs'],
1334
1351
  FlatTopBottom: [
@@ -1515,6 +1532,7 @@ export const TOOL_TEMPLATE_KEYS = {
1515
1532
  'fillBackground',
1516
1533
  'fillColor',
1517
1534
  'middleLine',
1535
+ 'parallelLevels',
1518
1536
  'text',
1519
1537
  'visibleIntervalsMs',
1520
1538
  ],