@lumencharts/trading-platform 0.0.0-stage → 0.1.1
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/CHANGELOG.md +31 -0
- package/LICENSE +55 -0
- package/README.md +53 -2
- package/dist/asset-entry.d.ts +3 -0
- package/dist/asset.d.ts +3 -0
- package/dist/asset.js +21689 -0
- package/dist/chart/bracket-links.d.ts +8 -0
- package/dist/chart/context-actions.d.ts +7 -0
- package/dist/chart/edit-presentation.d.ts +32 -0
- package/dist/chart/edit-preview.d.ts +26 -0
- package/dist/chart/exit-profit.d.ts +32 -0
- package/dist/chart/frame-batch.d.ts +15 -0
- package/dist/chart/overlay-coordinator.d.ts +18 -0
- package/dist/chart/overlay-events.d.ts +3 -0
- package/dist/chart/overlay-gesture.d.ts +40 -0
- package/dist/chart/overlay-index.d.ts +30 -0
- package/dist/chart/overlay-projection.d.ts +51 -0
- package/dist/chart/overlay-types.d.ts +42 -0
- package/dist/chart/parent-links.d.ts +33 -0
- package/dist/chart/position-profit.d.ts +15 -0
- package/dist/chart/review-lock.d.ts +14 -0
- package/dist/chart/ticket-projection.d.ts +36 -0
- package/dist/compat/default-formatters.d.ts +6 -0
- package/dist/compat/delegate.d.ts +11 -0
- package/dist/compat/factory.d.ts +5 -0
- package/dist/compat/formatters.d.ts +26 -0
- package/dist/compat/host-dialogs.d.ts +5 -0
- package/dist/compat/host-preferences.d.ts +8 -0
- package/dist/compat/host.d.ts +39 -0
- package/dist/compat/watched-value.d.ts +25 -0
- package/dist/conformance/index.d.ts +78 -0
- package/dist/conformance/index.js +6859 -0
- package/dist/conformance/replay.d.ts +35 -0
- package/dist/contracts/broker.d.ts +1122 -0
- package/dist/contracts/broker.js +168 -0
- package/dist/contracts/index.d.ts +3 -0
- package/dist/contracts/index.js +168 -0
- package/dist/contracts/market-data.d.ts +289 -0
- package/dist/contracts/market-data.js +11 -0
- package/dist/contracts/ports.d.ts +469 -0
- package/dist/contracts/ports.js +5 -0
- package/dist/core/account-datasets.d.ts +29 -0
- package/dist/core/account-lifecycle.d.ts +70 -0
- package/dist/core/account-types.d.ts +6 -0
- package/dist/core/bounded-map.d.ts +12 -0
- package/dist/core/bracket-input.d.ts +32 -0
- package/dist/core/bracket-modification.d.ts +6 -0
- package/dist/core/bracket-parent.d.ts +11 -0
- package/dist/core/broker-debug.d.ts +10 -0
- package/dist/core/capabilities.d.ts +34 -0
- package/dist/core/capability-metadata.d.ts +60 -0
- package/dist/core/capability-policy.d.ts +32 -0
- package/dist/core/chart-exit-level.d.ts +11 -0
- package/dist/core/chart-order-edit.d.ts +50 -0
- package/dist/core/clock.d.ts +2 -0
- package/dist/core/close-commands.d.ts +24 -0
- package/dist/core/close-flow.d.ts +14 -0
- package/dist/core/command-context.d.ts +16 -0
- package/dist/core/command-coordinator.d.ts +71 -0
- package/dist/core/command-follow.d.ts +32 -0
- package/dist/core/command-keys.d.ts +11 -0
- package/dist/core/context-orders.d.ts +19 -0
- package/dist/core/deferred.d.ts +5 -0
- package/dist/core/dialog-coordinator.d.ts +73 -0
- package/dist/core/display-preferences.d.ts +10 -0
- package/dist/core/disposal.d.ts +8 -0
- package/dist/core/entity-store.d.ts +56 -0
- package/dist/core/entity-validation.d.ts +9 -0
- package/dist/core/errors.d.ts +24 -0
- package/dist/core/execution-demand.d.ts +11 -0
- package/dist/core/execution-sound.d.ts +10 -0
- package/dist/core/exit-level-draft.d.ts +9 -0
- package/dist/core/exit-level-summary.d.ts +3 -0
- package/dist/core/exit-level-template.d.ts +16 -0
- package/dist/core/features.d.ts +39 -0
- package/dist/core/financial-rules.d.ts +70 -0
- package/dist/core/history-limit.d.ts +11 -0
- package/dist/core/identity.d.ts +14 -0
- package/dist/core/immutable.d.ts +8 -0
- package/dist/core/keyed-ref-count.d.ts +18 -0
- package/dist/core/leverage-commands.d.ts +42 -0
- package/dist/core/modification-context.d.ts +22 -0
- package/dist/core/modification-routing.d.ts +43 -0
- package/dist/core/notification-log.d.ts +33 -0
- package/dist/core/number-precision.d.ts +4 -0
- package/dist/core/order-commands.d.ts +50 -0
- package/dist/core/order-duration.d.ts +14 -0
- package/dist/core/order-labels.d.ts +7 -0
- package/dist/core/order-matching.d.ts +16 -0
- package/dist/core/order-modification.d.ts +20 -0
- package/dist/core/order-notifications.d.ts +30 -0
- package/dist/core/order-protection.d.ts +4 -0
- package/dist/core/parent-protection.d.ts +10 -0
- package/dist/core/position-commands.d.ts +45 -0
- package/dist/core/position-custom-fields.d.ts +5 -0
- package/dist/core/position-estimates.d.ts +22 -0
- package/dist/core/position-protection-permissions.d.ts +4 -0
- package/dist/core/preferences-key.d.ts +2 -0
- package/dist/core/preview-leases.d.ts +12 -0
- package/dist/core/protection-legs.d.ts +23 -0
- package/dist/core/protection-notifications.d.ts +9 -0
- package/dist/core/protection-rules.d.ts +21 -0
- package/dist/core/quantity-input.d.ts +53 -0
- package/dist/core/read-coordinator.d.ts +15 -0
- package/dist/core/readers.d.ts +6 -0
- package/dist/core/relative-price.d.ts +4 -0
- package/dist/core/review-policy.d.ts +17 -0
- package/dist/core/session-types.d.ts +1 -0
- package/dist/core/session.d.ts +114 -0
- package/dist/core/snapshot-dataset.d.ts +47 -0
- package/dist/core/symbol-catalog.d.ts +37 -0
- package/dist/core/tradability.d.ts +26 -0
- package/dist/core/trading-commands.d.ts +104 -0
- package/dist/core/trading-rules.d.ts +14 -0
- package/dist/core/trading-settings.d.ts +39 -0
- package/dist/core/trading-state.d.ts +52 -0
- package/dist/core/value-store.d.ts +11 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +6593 -0
- package/dist/market-data/depth-book.d.ts +18 -0
- package/dist/market-data/index.d.ts +3 -0
- package/dist/market-data/index.js +735 -0
- package/dist/market-data/session-demand.d.ts +15 -0
- package/dist/market-data/subscriptions.d.ts +13 -0
- package/dist/mock/broker.d.ts +75 -0
- package/dist/mock/clock.d.ts +12 -0
- package/dist/mock/feeds.d.ts +18 -0
- package/dist/mock/index.d.ts +5 -0
- package/dist/mock/index.js +1956 -0
- package/dist/mock/protection-cancellation.d.ts +7 -0
- package/dist/mock/scenarios.d.ts +5 -0
- package/dist/paper/broker.d.ts +41 -0
- package/dist/paper/index.d.ts +6 -0
- package/dist/paper/index.js +469 -0
- package/dist/paper/market.d.ts +57 -0
- package/dist/paper/rules.d.ts +40 -0
- package/dist/ui/account-manager/account-pages.d.ts +18 -0
- package/dist/ui/account-manager/column-presentation.d.ts +5 -0
- package/dist/ui/account-manager/context-menu.d.ts +13 -0
- package/dist/ui/account-manager/csv-downloads.d.ts +5 -0
- package/dist/ui/account-manager/custom-page.d.ts +16 -0
- package/dist/ui/account-manager/custom-table.d.ts +18 -0
- package/dist/ui/account-manager/format-account-value.d.ts +12 -0
- package/dist/ui/account-manager/position-reader.d.ts +19 -0
- package/dist/ui/account-manager/row-action-tracker.d.ts +12 -0
- package/dist/ui/account-manager/row-actions.d.ts +37 -0
- package/dist/ui/account-manager/status-counts.d.ts +6 -0
- package/dist/ui/account-manager/table-controls.d.ts +13 -0
- package/dist/ui/account-manager/table-export.d.ts +30 -0
- package/dist/ui/account-manager/table-model.d.ts +11 -0
- package/dist/ui/account-manager/table-toolbar.d.ts +25 -0
- package/dist/ui/account-manager/table.d.ts +24 -0
- package/dist/ui/account-manager/view.d.ts +19 -0
- package/dist/ui/account-manager/workspace.d.ts +15 -0
- package/dist/ui/chart-actions.d.ts +11 -0
- package/dist/ui/chart-controls/eligibility.d.ts +6 -0
- package/dist/ui/chart-controls/quote-buttons.d.ts +15 -0
- package/dist/ui/chart-controls/quote-controls.d.ts +12 -0
- package/dist/ui/chart-controls/quote-widths.d.ts +8 -0
- package/dist/ui/dialogs/close-amount-form.d.ts +8 -0
- package/dist/ui/dialogs/close-preview-dialog.d.ts +5 -0
- package/dist/ui/dialogs/confirm-dialog.d.ts +7 -0
- package/dist/ui/dialogs/dialog-body.d.ts +11 -0
- package/dist/ui/dialogs/leverage-form.d.ts +10 -0
- package/dist/ui/dialogs/message-dialog.d.ts +6 -0
- package/dist/ui/dialogs/position-protection.d.ts +14 -0
- package/dist/ui/dialogs/properties-dialog.d.ts +9 -0
- package/dist/ui/dialogs/sanitize-html.d.ts +2 -0
- package/dist/ui/dialogs/types.d.ts +5 -0
- package/dist/ui/dialogs/view.d.ts +5 -0
- package/dist/ui/dock-sizes.d.ts +20 -0
- package/dist/ui/dom/controller.d.ts +34 -0
- package/dist/ui/dom/ladder.d.ts +23 -0
- package/dist/ui/dom/view.d.ts +8 -0
- package/dist/ui/dom/workspace.d.ts +17 -0
- package/dist/ui/effective-mode.d.ts +11 -0
- package/dist/ui/financial-lease.d.ts +3 -0
- package/dist/ui/icons.d.ts +4 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +15918 -0
- package/dist/ui/layout.d.ts +5 -0
- package/dist/ui/mount.d.ts +11 -0
- package/dist/ui/notifications/log.d.ts +6 -0
- package/dist/ui/notifications/toasts.d.ts +5 -0
- package/dist/ui/number-input.d.ts +2 -0
- package/dist/ui/order-ticket/chart-draft-controls.d.ts +8 -0
- package/dist/ui/order-ticket/chart-projection.d.ts +9 -0
- package/dist/ui/order-ticket/controller.d.ts +41 -0
- package/dist/ui/order-ticket/custom-field.d.ts +9 -0
- package/dist/ui/order-ticket/duration-input.d.ts +9 -0
- package/dist/ui/order-ticket/exit-input.d.ts +34 -0
- package/dist/ui/order-ticket/financial-controls.d.ts +10 -0
- package/dist/ui/order-ticket/layout-context.d.ts +7 -0
- package/dist/ui/order-ticket/market.d.ts +12 -0
- package/dist/ui/order-ticket/menu.d.ts +6 -0
- package/dist/ui/order-ticket/mode-rules.d.ts +4 -0
- package/dist/ui/order-ticket/modification-fields.d.ts +23 -0
- package/dist/ui/order-ticket/move-handle.d.ts +4 -0
- package/dist/ui/order-ticket/order-sent.d.ts +4 -0
- package/dist/ui/order-ticket/placement.d.ts +27 -0
- package/dist/ui/order-ticket/preview-message.d.ts +4 -0
- package/dist/ui/order-ticket/price-input.d.ts +14 -0
- package/dist/ui/order-ticket/quantity-input.d.ts +26 -0
- package/dist/ui/order-ticket/review-panel.d.ts +10 -0
- package/dist/ui/order-ticket/rules.d.ts +16 -0
- package/dist/ui/order-ticket/stop-input.d.ts +17 -0
- package/dist/ui/order-ticket/submit-bar.d.ts +13 -0
- package/dist/ui/order-ticket/symbol-search-controller.d.ts +50 -0
- package/dist/ui/order-ticket/symbol-search.d.ts +12 -0
- package/dist/ui/order-ticket/untradable-notice.d.ts +8 -0
- package/dist/ui/order-ticket/view.d.ts +16 -0
- package/dist/ui/panel-visibility.d.ts +6 -0
- package/dist/ui/pointer-drag.d.ts +20 -0
- package/dist/ui/popup-mount.d.ts +4 -0
- package/dist/ui/primitives.d.ts +29 -0
- package/dist/ui/protection/editor.d.ts +18 -0
- package/dist/ui/protection/fields.d.ts +30 -0
- package/dist/ui/protection/level.d.ts +14 -0
- package/dist/ui/protection/protected-size.d.ts +5 -0
- package/dist/ui/protection/ticket-workspace.d.ts +7 -0
- package/dist/ui/resize-handle.css +34 -0
- package/dist/ui/resize-handle.d.ts +20 -0
- package/dist/ui/resize-handle.js +185 -0
- package/dist/ui/select.d.ts +26 -0
- package/dist/ui/surface-theme.d.ts +3 -0
- package/dist/ui/switch.d.ts +7 -0
- package/dist/ui/symbol-logo.d.ts +7 -0
- package/dist/ui/tabs.d.ts +19 -0
- package/dist/ui/ticket-dock.d.ts +18 -0
- package/dist/ui/ticket-shell.d.ts +15 -0
- package/dist/ui/trading.css +1808 -0
- package/dist/ui/trap-tab.d.ts +11 -0
- package/dist/vendor/solid-ui/index.d.ts +3 -0
- package/dist/vendor/solid-ui/paged-list-window.d.ts +27 -0
- package/dist/vendor/solid-ui/virtual-list.d.ts +21 -0
- package/package.json +104 -3
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { IBrokerConnectionAdapterHost, IBrokerTerminal, SingleBrokerMetaInfo } from "../contracts/broker.js";
|
|
2
|
+
import type { LumenBrokerExtensions, TradingBrokerProfile, TradingClock, TradingMarketDataPort } from "../contracts/ports.js";
|
|
3
|
+
export { createReplayBroker, recordBroker, type BrokerTranscript, type TranscriptEvent } from "./replay.js";
|
|
4
|
+
/** Drives the adapter's market and failure paths; every control is optional and its scenarios skip without it. */
|
|
5
|
+
export interface ConformanceControls {
|
|
6
|
+
/** Sets the executable price of a symbol. */
|
|
7
|
+
quote?(symbol: string, price: number): void;
|
|
8
|
+
/** Fills a working order (when the adapter does not fill market orders by itself). */
|
|
9
|
+
fill?(orderId: string): void;
|
|
10
|
+
disconnect?(): void;
|
|
11
|
+
reconnect?(): void;
|
|
12
|
+
/** The next mutation is rejected by the broker. */
|
|
13
|
+
rejectNext?(message: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* The broker accepts the next write, but its reads and streams do not show the result until the returned release
|
|
16
|
+
* is called: an acknowledged write whose result appears late.
|
|
17
|
+
*/
|
|
18
|
+
holdNextWrite?(): () => void;
|
|
19
|
+
/** The broker applies the next write, but its reply never reaches the adapter (the connection drops on the way back). */
|
|
20
|
+
loseNextReply?(): void;
|
|
21
|
+
}
|
|
22
|
+
/** One fresh adapter per scenario. */
|
|
23
|
+
export interface ConformanceSetup {
|
|
24
|
+
readonly brokerFactory: (host: IBrokerConnectionAdapterHost) => IBrokerTerminal;
|
|
25
|
+
readonly brokerConfig?: SingleBrokerMetaInfo;
|
|
26
|
+
readonly extensions?: LumenBrokerExtensions;
|
|
27
|
+
readonly marketData: TradingMarketDataPort;
|
|
28
|
+
/** The session clock; `advance` moves it for deadlines (a manual clock in tests). */
|
|
29
|
+
readonly clock?: TradingClock & {
|
|
30
|
+
advance?(milliseconds: number): void;
|
|
31
|
+
};
|
|
32
|
+
/** A tradable symbol, its current price and a valid order quantity. */
|
|
33
|
+
readonly symbol: string;
|
|
34
|
+
readonly price: number;
|
|
35
|
+
readonly qty: number;
|
|
36
|
+
readonly controls?: ConformanceControls;
|
|
37
|
+
/** The adapter rejects with the `BrokerRejection` shape; O02 then requires the broker's message to reach the user. */
|
|
38
|
+
readonly rejectsWithBrokerRejection?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* What the adapter declares about itself. A declared behaviour turns the matching scenarios from optional into
|
|
41
|
+
* required: their missing controls fail instead of skipping.
|
|
42
|
+
*/
|
|
43
|
+
readonly profile?: TradingBrokerProfile;
|
|
44
|
+
destroy?(): void;
|
|
45
|
+
}
|
|
46
|
+
export interface ConformanceOptions {
|
|
47
|
+
readonly name: string;
|
|
48
|
+
setup(): ConformanceSetup | Promise<ConformanceSetup>;
|
|
49
|
+
/** Scenario IDs to run; default: all. */
|
|
50
|
+
readonly scenarios?: readonly string[];
|
|
51
|
+
/** Real milliseconds to wait for an asynchronous adapter (default 2,000). */
|
|
52
|
+
readonly timeout?: number;
|
|
53
|
+
}
|
|
54
|
+
export type ConformanceStatus = "pass" | "fail" | "skip";
|
|
55
|
+
export interface ConformanceResult {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly title: string;
|
|
58
|
+
readonly status: ConformanceStatus;
|
|
59
|
+
/** Why it failed or was skipped. */
|
|
60
|
+
readonly reason?: string;
|
|
61
|
+
/** Broker calls and outcomes observed. */
|
|
62
|
+
readonly evidence: readonly string[];
|
|
63
|
+
}
|
|
64
|
+
export interface ConformanceReport {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly results: readonly ConformanceResult[];
|
|
67
|
+
readonly passed: number;
|
|
68
|
+
readonly failed: number;
|
|
69
|
+
readonly skipped: number;
|
|
70
|
+
}
|
|
71
|
+
/** IDs of the scenarios the kit runs. */
|
|
72
|
+
export declare const conformanceScenarios: readonly string[];
|
|
73
|
+
/**
|
|
74
|
+
* Runs the acceptance scenarios against an adapter through a real trading session. Each scenario gets a fresh
|
|
75
|
+
* adapter from `setup()`; scenarios whose capability flag is off or whose control is missing are skipped
|
|
76
|
+
* explicitly, never passed.
|
|
77
|
+
*/
|
|
78
|
+
export declare function runConformance(options: ConformanceOptions): Promise<ConformanceReport>;
|