@hitrading/ctp-node 1.2.0 → 3.0.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 (104) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +52 -31
  3. package/README.zh-CN.md +42 -26
  4. package/RELEASING.md +78 -0
  5. package/binding.gyp +13 -13
  6. package/dist/client.d.ts +40 -15
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +241 -62
  9. package/dist/client.js.map +1 -1
  10. package/dist/codec.d.ts.map +1 -1
  11. package/dist/codec.js +84 -19
  12. package/dist/codec.js.map +1 -1
  13. package/dist/generated/structs.gen.d.ts +5461 -5461
  14. package/dist/generated/structs.gen.d.ts.map +1 -1
  15. package/dist/generated/trader.gen.d.ts.map +1 -1
  16. package/dist/generated/trader.gen.js +788 -94
  17. package/dist/generated/trader.gen.js.map +1 -1
  18. package/dist/index.cjs +1896 -420
  19. package/dist/index.d.cts +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/market-data.d.ts +48 -21
  24. package/dist/market-data.d.ts.map +1 -1
  25. package/dist/market-data.js +165 -26
  26. package/dist/market-data.js.map +1 -1
  27. package/dist/native-binding.d.ts.map +1 -1
  28. package/dist/native-binding.js +5 -1
  29. package/dist/native-binding.js.map +1 -1
  30. package/dist/trader.d.ts +127 -79
  31. package/dist/trader.d.ts.map +1 -1
  32. package/dist/trader.js +788 -200
  33. package/dist/trader.js.map +1 -1
  34. package/dist/validation.d.ts +27 -0
  35. package/dist/validation.d.ts.map +1 -0
  36. package/dist/validation.js +85 -0
  37. package/dist/validation.js.map +1 -0
  38. package/docs/API.md +1437 -0
  39. package/docs/API.zh-CN.md +1278 -0
  40. package/docs/MIGRATION.md +54 -0
  41. package/docs/assets/validation.svg +27 -0
  42. package/docs/integration.md +60 -0
  43. package/docs/native-hooks.md +281 -0
  44. package/docs/native-hooks.zh-CN.md +205 -0
  45. package/docs/troubleshooting.md +257 -0
  46. package/docs/troubleshooting.zh-CN.md +220 -0
  47. package/package.json +14 -6
  48. package/prebuilds/linux-x64/@hitrading+ctp-node.node +0 -0
  49. package/prebuilds/win32-x64/@hitrading+ctp-node.node +0 -0
  50. package/scripts/bench-decode.mjs +37 -0
  51. package/scripts/bench-fullmarket-offline.mjs +207 -0
  52. package/scripts/stress-fullmarket.mjs +255 -0
  53. package/src/addon.cc +2 -2
  54. package/src/client.ts +263 -65
  55. package/src/codec.ts +86 -19
  56. package/src/generated/structs.gen.ts +5461 -5461
  57. package/src/generated/trader.gen.ts +309 -94
  58. package/src/generated/traderreq.gen.cc +194 -18
  59. package/src/generated/traderreq.gen.h +4 -0
  60. package/src/generated/traderspi.gen.cc +130 -10
  61. package/src/generated/traderspi.gen.h +4 -2
  62. package/src/index.ts +8 -1
  63. package/src/market-data.ts +219 -43
  64. package/src/native/arm.cc +114 -30
  65. package/src/native/arm.h +16 -4
  66. package/src/native/channel.cc +209 -81
  67. package/src/native/channel.h +65 -24
  68. package/src/native/ctp_field.h +23 -0
  69. package/src/native/mdapi.cc +621 -61
  70. package/src/native/mdspi.cc +221 -14
  71. package/src/native/mdspi.h +62 -9
  72. package/src/native/order_capability.h +75 -0
  73. package/src/native/risk.cc +2051 -205
  74. package/src/native/risk.h +450 -57
  75. package/src/native/shared_handle.h +37 -0
  76. package/src/native/snapshot.h +120 -0
  77. package/src/native/traderapi.cc +749 -170
  78. package/src/native-binding.ts +5 -1
  79. package/src/trader.ts +993 -229
  80. package/src/validation.ts +96 -0
  81. /package/{tradeapi → ctpsdk}/ThostFtdcMdApi.h +0 -0
  82. /package/{tradeapi → ctpsdk}/ThostFtdcTraderApi.h +0 -0
  83. /package/{tradeapi → ctpsdk}/ThostFtdcUserApiDataType.h +0 -0
  84. /package/{tradeapi → ctpsdk}/ThostFtdcUserApiStruct.h +0 -0
  85. /package/{tradeapi → ctpsdk}/error.dtd +0 -0
  86. /package/{tradeapi → ctpsdk}/error.xml +0 -0
  87. /package/{tradeapi → ctpsdk}/linux/thostmduserapi_se.so +0 -0
  88. /package/{tradeapi → ctpsdk}/linux/thosttraderapi_se.so +0 -0
  89. /package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/Headers/ThostFtdcMdApi.h +0 -0
  90. /package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/Headers/ThostFtdcUserApiDataType.h +0 -0
  91. /package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/Headers/ThostFtdcUserApiStruct.h +0 -0
  92. /package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/Resources/Info.plist +0 -0
  93. /package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/_CodeSignature/CodeResources +0 -0
  94. /package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/thostmduserapi_se +0 -0
  95. /package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/Headers/ThostFtdcTraderApi.h +0 -0
  96. /package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/Headers/ThostFtdcUserApiDataType.h +0 -0
  97. /package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/Headers/ThostFtdcUserApiStruct.h +0 -0
  98. /package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/Resources/Info.plist +0 -0
  99. /package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/_CodeSignature/CodeResources +0 -0
  100. /package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/thosttraderapi_se +0 -0
  101. /package/{tradeapi → ctpsdk}/windows/thostmduserapi_se.dll +0 -0
  102. /package/{tradeapi → ctpsdk}/windows/thostmduserapi_se.lib +0 -0
  103. /package/{tradeapi → ctpsdk}/windows/thosttraderapi_se.dll +0 -0
  104. /package/{tradeapi → ctpsdk}/windows/thosttraderapi_se.lib +0 -0
package/dist/trader.d.ts CHANGED
@@ -3,34 +3,61 @@ import type { CallbackOptions } from "./client.js";
3
3
  import type { Order, Trade, InputOrder, RspUserLogin } from "./generated/structs.gen.js";
4
4
  import type { MarketData } from "./market-data.js";
5
5
  /** Pre-trade risk limits, enforced in C++ before each order is sent. */
6
- export interface RiskConfig {
6
+ export interface RiskLimits {
7
7
  /** Max volume per single order. Omit/0 = disabled. */
8
8
  maxOrderVolume?: number;
9
9
  /** Reject if order price deviates from the reference by > this ratio (e.g.
10
- * 0.02 = 2%). Feed the reference via trackMarketData() or setRefPrice();
11
- * with no reference the check is skipped. */
10
+ * 0.02 = 2%). Feed the reference via trackMarketData(md) (the MD snapshot is
11
+ * read in C++); missing or stale data rejects opening orders. */
12
12
  maxPriceDeviation?: number;
13
- /** Max notional (price × volume) per order. Omit/0 = disabled. */
13
+ /** Max futures notional (price × volume × multiplier) per opening order.
14
+ * Unknown/unsupported product metadata fails closed. Omit/0 = disabled. */
14
15
  maxNotional?: number;
15
- /** Max order sends per second (token bucket). Omit/0 = disabled. */
16
+ /** Max opening-order sends per second (token bucket). Omit/0 = disabled. */
16
17
  maxOrdersPerSec?: number;
17
18
  /** Token-bucket burst; defaults to maxOrdersPerSec. */
18
19
  orderBurst?: number;
19
- /** Cap on total open-position cost (Σ open price × volume × multiplier).
20
- * 0/undefined = disabled. Multipliers and existing positions are picked up
21
- * automatically via syncMultipliers() / syncPositions(). */
22
- maxPositionCost?: number;
20
+ /** Independent rate for risk-reducing close inserts. Disabled by default so
21
+ * emergency exits are not throttled by the opening-order bucket. */
22
+ maxCloseOrdersPerSec?: number;
23
+ /** Close-order token-bucket burst; defaults to maxCloseOrdersPerSec. */
24
+ closeOrderBurst?: number;
25
+ /** Maximum age of the market-data reference used by the deviation guard.
26
+ * Default 3000 ms. Missing or older data fails closed when the guard is on. */
27
+ maxReferenceAgeMs?: number;
28
+ /** Cap on total open-position MARGIN (Σ open price × volume × multiplier ×
29
+ * absolute by-money/by-volume margin schedule) — a zero-lag hard cap enforced in
30
+ * C++ on every opening order (regular AND armed). 0/undefined = disabled.
31
+ * Margin rates are fed automatically from CTP's OnRspQryInstrumentMarginRate
32
+ * inside C++ (populate them by calling reqQryInstrumentMarginRate); until a
33
+ * multiplier or usable absolute schedule is missing, opening orders fail
34
+ * closed. Both by-money and per-lot components are included; relative
35
+ * investor schedules are combined with their exchange base schedule.
36
+ * Multipliers / existing positions are picked up via syncMultipliers() /
37
+ * syncPositions(). */
38
+ maxAccountMargin?: number;
23
39
  }
24
40
  /** A per-instrument lot cap: a single number caps both sides at that value;
25
41
  * `{ long, short }` caps each side separately (omit a side to leave it open). */
26
- export type LotCap = number | {
42
+ export type InstrumentPositionLimit = number | {
27
43
  long?: number;
28
44
  short?: number;
29
45
  };
46
+ /** One bucket in a complete manually reconciled held-position snapshot. */
47
+ export interface PositionSeed {
48
+ instrumentId: string;
49
+ side: "long" | "short";
50
+ hedgeFlag: "1" | "2" | "3" | "5" | "6" | "7";
51
+ volume: number;
52
+ margin: number;
53
+ }
30
54
  /** Options for the one-call post-connect handshake, {@link Trader.session}. */
31
55
  export interface SessionOptions {
32
56
  brokerId: string;
33
57
  userId: string;
58
+ /** Trading account. Defaults to userId for ordinary retail accounts; set it
59
+ * explicitly when the login operator UserID differs from InvestorID. */
60
+ investorId?: string;
34
61
  password: string;
35
62
  /** Terminal authentication (real accounts require it; SimNow uses
36
63
  * appId "simnow_client_test" / authCode of 16 zeros). Omit both to skip. */
@@ -40,10 +67,14 @@ export interface SessionOptions {
40
67
  * before trading (brokers reject orders otherwise). Default true; set false
41
68
  * for environments that don't need it. */
42
69
  confirmSettlement?: boolean;
43
- /** Which risk inputs to fetch after login (default: all). `multipliers` may
70
+ /** Which risk inputs to fetch after login. Multipliers/positions/orders default
71
+ * on; margin rates require an explicit contract list. `multipliers` may
44
72
  * be `true` (all instruments) or a list of symbols. */
45
73
  sync?: {
46
74
  multipliers?: boolean | string[];
75
+ /** Contracts whose speculation margin schedules should be queried. Omitted
76
+ * by default because CTP requires one rate query per contract. */
77
+ marginRates?: string[];
47
78
  positions?: boolean;
48
79
  orders?: boolean;
49
80
  };
@@ -69,18 +100,31 @@ export declare class Trader extends TraderBase {
69
100
  private investor?;
70
101
  private orderRefSeq;
71
102
  constructor(flowPath: string, fronts: string | string[]);
72
- getApiVersion(): string;
73
- getTradingDay(): string;
103
+ /** A raw login Promise may resolve only with a structurally usable session.
104
+ * Account confirmation itself happens in session(), after request-vs-response
105
+ * identity validation; merely observing a protocol event never grants order
106
+ * authority. */
107
+ protected onRequestResolved(eventName: string | undefined, value: unknown, _options: CallbackOptions): void;
108
+ /** Generated login/logout methods call this only after their request has
109
+ * encoded successfully. Revoke the confirmed JS account at that same atomic
110
+ * transition boundary, so a concurrent sync helper cannot start with the old
111
+ * identity while native risk state is already fail-closed for the new session. */
112
+ protected beginRequestContextTransition(reason: string): void;
113
+ protected shouldTimeoutRequest(requestId: number, sessionTransition: boolean): boolean;
114
+ get apiVersion(): string;
115
+ get tradingDay(): string;
74
116
  /**
75
117
  * One-call post-connect handshake. Call it from the `front-connected` handler
76
118
  * (and again after a reconnect): authenticate (if appId/authCode given) →
77
- * login → confirm settlement → sync multipliers / positions / orders. Each
119
+ * login → confirm settlement → sync multipliers / margin rates / orders /
120
+ * positions. Each
78
121
  * step just wraps the matching req / sync method, so you can hand-roll your
79
122
  * own flow instead when you need finer control. Returns the row counts from
80
123
  * the sync steps. Must run on a connected front (queries need the session up).
81
124
  */
82
125
  session(opts: SessionOptions): Promise<{
83
126
  multipliers: number;
127
+ marginRates: number;
84
128
  positions: number;
85
129
  orders: number;
86
130
  }>;
@@ -88,6 +132,8 @@ export declare class Trader extends TraderBase {
88
132
  * OrderRef as a per-session sequence and rejects a duplicate or non-numeric
89
133
  * ref with "不允许重复报单", so an unset ref would otherwise collide. */
90
134
  private withAutoOrderRef;
135
+ private commitOrderRef;
136
+ private validateOrder;
91
137
  /**
92
138
  * Insert an order through the C++ pre-trade risk gate. Resolves on submission:
93
139
  * CTP sends no success acknowledgement for an accepted order - only
@@ -98,70 +144,74 @@ export declare class Trader extends TraderBase {
98
144
  */
99
145
  reqOrderInsert(req?: Partial<InputOrder>): Promise<void>;
100
146
  /** Publish pre-trade risk limits to the C++ enforcer (takes effect at once). */
101
- riskSet(config: RiskConfig): this;
102
- /** Kill-switch: C++ immediately blocks every order-opening send that reaches
103
- * the exchange at once — regular, exec, quote, for-quote, option-self-close
104
- * and comb-action inserts. Cancels and other *actions* are deliberately left
105
- * open so you can still pull working orders while halted; parked/staged orders
106
- * (not sent to the exchange immediately) are likewise not gated. Takes effect
107
- * at once; reverse with {@link resume}. */
108
- halt(): this;
109
- /** Release the kill-switch (see {@link halt}). */
147
+ setRiskLimits(config: RiskLimits): this;
148
+ /** Enter REDUCE_ONLY atomically at the final vendor-API send barrier. Armed
149
+ * opens remain registered but cannot send until resume(). */
150
+ reduceOnly(): this;
151
+ /** Enter HALT_ALL atomically: both opening and closing order inserts, advanced
152
+ * mutations and bank/futures transfers are refused, and all existing armed
153
+ * triggers are cleared. New arm() calls are rejected until resume().
154
+ * Cancellation actions remain available so working
155
+ * exchange orders can still be withdrawn. */
156
+ haltAll(): this;
157
+ /** Return to NORMAL mode after reduceOnly() or haltAll(). */
110
158
  resume(): this;
111
- /** Set the reference price for an instrument (used by maxPriceDeviation). */
112
- setRefPrice(instrumentId: string, price: number): this;
113
- /** Auto-feed last prices from a MarketData feed so the maxPriceDeviation
114
- * check has a live reference. */
159
+ /** Use a MarketData feed as the live reference for the maxPriceDeviation check.
160
+ * Wires the feed's C++ snapshot cache straight into this Trader's risk engine,
161
+ * so the deviation check reads current prices in C++ on the order path (no JS
162
+ * round-trip, and it also covers armed orders that fire with no JS in the loop).
163
+ * Without a fresh reference, an enabled deviation check fails closed. */
115
164
  trackMarketData(md: MarketData): this;
116
- /** Set a contract's multiplier (合约乘数) for position-cost accounting. */
117
- setMultiplier(instrumentId: string, multiplier: number): this;
118
165
  /**
119
166
  * Cap the open position (in lots) for one instrument, enforced in C++ on
120
167
  * every opening order. Pass a number to cap both sides at once, or
121
168
  * `{ long, short }` to cap each side separately. Within `{ long, short }`,
122
169
  * **omitting a side leaves that side's current cap unchanged** (on a re-call it
123
- * is NOT reset to uncapped), and passing `<= 0` for a side removes its cap.
170
+ * is NOT reset to uncapped), and passing `0` for a side removes its cap.
124
171
  * Long and short are always tracked independently.
125
172
  *
126
- * The check is fill-based (counts confirmed position, like maxPositionCost),
127
- * so rapid bursts of opens can momentarily overshoot before the fills land —
128
- * size the cap with that in mind.
173
+ * Held positions and in-flight working opens are counted atomically.
129
174
  *
130
- * td.setMaxPosition("rb2610", 100); // long<=100 and short<=100
131
- * td.setMaxPosition("ru2610", { long: 100, short: 20 });
175
+ * td.setInstrumentPositionLimit("rb2610", 100);
176
+ * td.setInstrumentPositionLimit("ru2610", { long: 100, short: 20 });
132
177
  */
133
- setMaxPosition(instrumentId: string, max: LotCap): this;
178
+ setInstrumentPositionLimit(instrumentId: string, limit: InstrumentPositionLimit): this;
134
179
  /** Cap several instruments at once, e.g.
135
180
  * `{ rb2610: 100, ru2610: { long: 100, short: 20 } }`. */
136
- setMaxPositions(limits: Record<string, LotCap>): this;
181
+ setInstrumentPositionLimits(limits: Record<string, InstrumentPositionLimit>): this;
182
+ private normalizePositionLimit;
137
183
  /**
138
- * Cap one instrument's open-position cost (Σ open price × volume × multiplier,
139
- * long and short summed - a gross capital/concentration limit), enforced in
140
- * C++ on every opening order. This is per-instrument and independent of the
141
- * account-wide cap set via riskSet({ maxPositionCost }); both apply. Pass
142
- * `maxCost <= 0` to remove it. Fill-based, same caveat as maxPositionCost.
184
+ * Cap one instrument's scheduled open margin (CTP by-money + by-volume,
185
+ * long and short summed), enforced in C++ on every opening order. This is
186
+ * independent of the account-wide maxAccountMargin cap; both apply. Pass
187
+ * `limit = 0` to remove it. Held and in-flight exposure both count.
143
188
  */
144
- setMaxPositionCost(instrumentId: string, maxCost: number): this;
145
- /** Cap several instruments' open-position cost at once, e.g.
189
+ setInstrumentMarginLimit(instrumentId: string, limit: number): this;
190
+ /** Cap several instruments' scheduled open margin at once, e.g.
146
191
  * `{ ag2608: 2_000_000, au2608: 5_000_000 }`. */
147
- setMaxPositionCosts(limits: Record<string, number>): this;
148
- /** Seed a pre-existing position's open cost (for the maxPositionCost cap). */
149
- seedPosition(instrumentId: string, side: "long" | "short", volume: number, openCost: number): this;
150
- /** Seed open-position cost from reqQryInvestorPosition() rows for GROSS-mode
151
- * accounts (posiDirection '2' = long, '3' = short; any other value, incl. net
152
- * '1', is bucketed as short). Cost caps sum both sides so the bucket doesn't
153
- * matter for them, but a per-side *volume* cap on a net-mode instrument would
154
- * track the wrong side — for net-mode accounts, seed those via seedPosition()
155
- * with the side you intend. */
192
+ setInstrumentMarginLimits(limits: Record<string, number>): this;
193
+ /** Atomically replace held positions from a complete manually reconciled
194
+ * snapshot. `margin` is CTP InvestorPosition.UseMargin. An empty array is an
195
+ * authoritative flat book. Partial/incremental seeding is intentionally not
196
+ * exposed because armed orders can run between JS calls. */
197
+ seedPositions(positions: ReadonlyArray<PositionSeed>): this;
198
+ private replacePositionSeeds;
199
+ /** Atomically replace held position margin from complete gross-mode query rows
200
+ * (`posiDirection` '2' long, '3' short). Net/unknown direction is rejected
201
+ * because guessing a side corrupts per-side volume caps. */
156
202
  seedFromPositions(positions: ReadonlyArray<{
157
203
  instrumentId: string;
158
204
  posiDirection: string;
205
+ hedgeFlag: string;
159
206
  position: number;
160
- openCost: number;
207
+ useMargin: number;
161
208
  }>): this;
162
- /** Current total open-position cost tracked by the C++ risk engine. */
163
- positionCost(): number;
164
- /** Clear all tracked position cost. */
209
+ private aggregatePositions;
210
+ /** Current total open-position margin tracked by the C++ risk engine. */
211
+ get accountMargin(): number;
212
+ /** Clear held position state only and mark it uncertain. Working-order
213
+ * reservations are preserved; openings remain blocked until a complete
214
+ * seedFromPositions() or syncPositions() succeeds. */
165
215
  resetPositions(): this;
166
216
  /**
167
217
  * Run a CTP query with flow-control retries. CTP rate-limits queries (~1/sec)
@@ -172,16 +222,23 @@ export declare class Trader extends TraderBase {
172
222
  * position book, so a flat account doesn't waste the full retry budget).
173
223
  */
174
224
  private queryWithRetry;
175
- /** Fetch contract multipliers from CTP and apply them. No args queries all
176
- * instruments (one request); otherwise queries the given symbols. Retries
177
- * through cold-start flow control so the multiplier is reliably applied. */
225
+ /** Empty position/order snapshots are ambiguous immediately after login. Require
226
+ * the same empty result twice, one query interval apart, before treating it as
227
+ * authoritative. */
228
+ private authoritativeQuery;
229
+ /** Query instruments so the C++ risk engine picks up their multipliers (it
230
+ * sources them directly from OnRspQryInstrument — no JS feed). No args queries
231
+ * all instruments (one request); otherwise the given symbols. Retries through
232
+ * cold-start flow control. Returns the count of contracts with a multiplier. */
178
233
  syncMultipliers(instrumentIds?: string[]): Promise<number>;
179
- /** Seed open-position cost from CTP (reqQryInvestorPosition). Uses the
180
- * logged-in account unless brokerId/investorId are supplied. */
181
- syncPositions(opts?: {
182
- brokerId?: string;
183
- investorId?: string;
184
- }): Promise<number>;
234
+ /** Query investor margin schedules for a bounded universe. The exchange-base
235
+ * query is issued only when the investor row is relative; the shared query
236
+ * scheduler enforces spacing. Returns the number of usable schedules. */
237
+ syncMarginRates(instrumentIds: string[], hedgeFlag?: "1" | "2" | "3" | "5" | "6" | "7"): Promise<number>;
238
+ /** Replace held position margin from CTP (`reqQryInvestorPosition`). The
239
+ * replacement is revision-checked: if an order/trade callback races the
240
+ * snapshot it retries without clearing live state or reservations. */
241
+ syncPositions(): Promise<number>;
185
242
  /**
186
243
  * Rebuild the in-flight reservation from CTP's currently-working orders
187
244
  * (reqQryOrder) - an authoritative resync. Call it after login and after any
@@ -191,16 +248,7 @@ export declare class Trader extends TraderBase {
191
248
  * of working open orders re-reserved. Run syncMultipliers() first so the
192
249
  * reserved cost uses the right contract multiplier.
193
250
  */
194
- syncOrders(opts?: {
195
- brokerId?: string;
196
- investorId?: string;
197
- }): Promise<number>;
198
- /** @internal test-only: feed a synthetic fill into the position-cost tracker. */
199
- _applyTestTrade(instrumentId: string, isBuy: boolean, isOpen: boolean, price: number, volume: number): void;
200
- /** @internal test-only: drive the in-flight reservation tracker (OnRtnOrder).
201
- * status: '1'/'3' = working (queueing), others (e.g. '0' filled, '5'
202
- * cancelled) = terminal. */
203
- _applyTestOrder(frontId: number, sessionId: number, orderRef: string, instrumentId: string, isOpen: boolean, isLong: boolean, status: string, limitPrice: number, volTotal: number, volTraded: number): void;
251
+ syncOrders(): Promise<number>;
204
252
  /**
205
253
  * Arm a latency-critical trigger: when `md` sees the condition, the order is
206
254
  * sent from C++ on the callback thread (through this Trader's risk gate),
@@ -212,7 +260,7 @@ export declare class Trader extends TraderBase {
212
260
  * how many fired and were sent vs were refused by the risk gate / send.
213
261
  * A blocked armed order is otherwise invisible, so poll this after a trigger
214
262
  * you expected to fire. */
215
- armStats(): {
263
+ get armStats(): {
216
264
  fired: number;
217
265
  blocked: number;
218
266
  };
@@ -226,8 +274,8 @@ export declare class Trader extends TraderBase {
226
274
  on(event: "rtn-trade", cb: (data: Trade, opts: CallbackOptions) => void): this;
227
275
  on(event: "front-connected", cb: (data: undefined, opts: CallbackOptions) => void): this;
228
276
  on(event: "front-disconnected", cb: (reason: number, opts: CallbackOptions) => void): this;
229
- on(event: "rsp-user-login", cb: (data: RspUserLogin, opts: CallbackOptions) => void): this;
230
- on(event: "err-rtn-order-insert", cb: (data: InputOrder, opts: CallbackOptions) => void): this;
277
+ on(event: "rsp-user-login", cb: (data: RspUserLogin | undefined, opts: CallbackOptions) => void): this;
278
+ on(event: "err-rtn-order-insert", cb: (data: InputOrder | undefined, opts: CallbackOptions) => void): this;
231
279
  on(event: string, cb: (...args: never[]) => void): this;
232
280
  }
233
281
  export { TraderEvent };
@@ -1 +1 @@
1
- {"version":3,"file":"trader.d.ts","sourceRoot":"","sources":["../src/trader.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAiB,WAAW,EAAE,MAAM,2BAA2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