okx-api 3.1.2 → 3.1.4

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 (55) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/index.d.ts +2 -0
  3. package/dist/cjs/index.js +2 -0
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/rest-client.d.ts +66 -31
  6. package/dist/cjs/rest-client.js +71 -4
  7. package/dist/cjs/rest-client.js.map +1 -1
  8. package/dist/cjs/types/rest/request/account.d.ts +13 -1
  9. package/dist/cjs/types/rest/request/convert.d.ts +4 -0
  10. package/dist/cjs/types/rest/request/dual-investment.d.ts +35 -0
  11. package/dist/cjs/types/rest/request/dual-investment.js +3 -0
  12. package/dist/cjs/types/rest/request/dual-investment.js.map +1 -0
  13. package/dist/cjs/types/rest/request/funding.d.ts +8 -0
  14. package/dist/cjs/types/rest/request/public.d.ts +45 -0
  15. package/dist/cjs/types/rest/request/trade.d.ts +68 -48
  16. package/dist/cjs/types/rest/response/private-account.d.ts +42 -2
  17. package/dist/cjs/types/rest/response/private-dual-investment.d.ts +87 -0
  18. package/dist/cjs/types/rest/response/private-dual-investment.js +3 -0
  19. package/dist/cjs/types/rest/response/private-dual-investment.js.map +1 -0
  20. package/dist/cjs/types/rest/response/private-flexible-loan.d.ts +22 -0
  21. package/dist/cjs/types/rest/response/private-trade.d.ts +30 -6
  22. package/dist/cjs/types/rest/response/public-data.d.ts +147 -0
  23. package/dist/cjs/types/rest/shared.d.ts +1 -1
  24. package/dist/cjs/types/websockets/ws-api-request.d.ts +21 -2
  25. package/dist/cjs/types/websockets/ws-api-response.d.ts +11 -0
  26. package/dist/cjs/types/websockets/ws-events.d.ts +1 -0
  27. package/dist/cjs/types/websockets/ws-request.d.ts +11 -4
  28. package/dist/mjs/index.d.ts +2 -0
  29. package/dist/mjs/index.js +2 -0
  30. package/dist/mjs/index.js.map +1 -1
  31. package/dist/mjs/rest-client.d.ts +66 -31
  32. package/dist/mjs/rest-client.js +71 -4
  33. package/dist/mjs/rest-client.js.map +1 -1
  34. package/dist/mjs/types/rest/request/account.d.ts +13 -1
  35. package/dist/mjs/types/rest/request/convert.d.ts +4 -0
  36. package/dist/mjs/types/rest/request/dual-investment.d.ts +35 -0
  37. package/dist/mjs/types/rest/request/dual-investment.js +2 -0
  38. package/dist/mjs/types/rest/request/dual-investment.js.map +1 -0
  39. package/dist/mjs/types/rest/request/funding.d.ts +8 -0
  40. package/dist/mjs/types/rest/request/public.d.ts +45 -0
  41. package/dist/mjs/types/rest/request/trade.d.ts +68 -48
  42. package/dist/mjs/types/rest/response/private-account.d.ts +42 -2
  43. package/dist/mjs/types/rest/response/private-dual-investment.d.ts +87 -0
  44. package/dist/mjs/types/rest/response/private-dual-investment.js +2 -0
  45. package/dist/mjs/types/rest/response/private-dual-investment.js.map +1 -0
  46. package/dist/mjs/types/rest/response/private-flexible-loan.d.ts +22 -0
  47. package/dist/mjs/types/rest/response/private-trade.d.ts +30 -6
  48. package/dist/mjs/types/rest/response/public-data.d.ts +147 -0
  49. package/dist/mjs/types/rest/shared.d.ts +1 -1
  50. package/dist/mjs/types/websockets/ws-api-request.d.ts +21 -2
  51. package/dist/mjs/types/websockets/ws-api-response.d.ts +11 -0
  52. package/dist/mjs/types/websockets/ws-events.d.ts +1 -0
  53. package/dist/mjs/types/websockets/ws-request.d.ts +11 -4
  54. package/llms.txt +7972 -7170
  55. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dual-investment.js","sourceRoot":"","sources":["../../../../../src/types/rest/request/dual-investment.ts"],"names":[],"mappings":""}
@@ -34,7 +34,15 @@ export interface WithdrawRequest {
34
34
  rcvrStreetName?: string;
35
35
  };
36
36
  }
37
+ /**
38
+ * @see GET /api/v5/public/funding-rate
39
+ * `instId` may be a specific instrument, or the literal `ANY` for all perpetuals and X-Perp (FUTURES) contracts.
40
+ */
41
+ export interface GetFundingRateRequest {
42
+ instId: string;
43
+ }
37
44
  export interface FundingRateRequest {
45
+ /** Perpetual or X-Perp FUTURES instrument id (not `ANY` on this route). */
38
46
  instId: string;
39
47
  before?: string;
40
48
  after?: string;
@@ -53,3 +53,48 @@ export interface GetOptionTradesRequest {
53
53
  instFamily?: string;
54
54
  optType?: 'C' | 'P';
55
55
  }
56
+ /**
57
+ * @see GET /api/v5/public/market-data-history
58
+ * Module 11: borrowing rate (T+2 typical, UTC+8 for timestamp parsing).
59
+ */
60
+ export interface GetHistoricalMarketDataRequest {
61
+ /**
62
+ * 1: trades, 2: 1m candles, 3: funding rate, 4: 400-level book, 5: 5000-level, 6: 50-level (use 4/5), 11: borrowing rate
63
+ */
64
+ module: string;
65
+ instType: 'SPOT' | 'FUTURES' | 'SWAP' | 'OPTION';
66
+ instIdList?: string;
67
+ instFamilyList?: string;
68
+ dateAggrType: 'daily' | 'monthly';
69
+ begin: string;
70
+ end: string;
71
+ }
72
+ /**
73
+ * @see GET /api/v5/public/event-contract/series
74
+ */
75
+ export interface GetEventContractSeriesRequest {
76
+ seriesId?: string;
77
+ }
78
+ /**
79
+ * @see GET /api/v5/public/event-contract/events
80
+ */
81
+ export interface GetEventContractEventsRequest {
82
+ seriesId: string;
83
+ eventId?: string;
84
+ state?: 'preopen' | 'live' | 'settling' | 'expired' | string;
85
+ limit?: string;
86
+ before?: string;
87
+ after?: string;
88
+ }
89
+ /**
90
+ * @see GET /api/v5/public/event-contract/markets
91
+ */
92
+ export interface GetEventContractMarketsRequest {
93
+ seriesId: string;
94
+ eventId?: string;
95
+ instId?: string;
96
+ state?: 'preopen' | 'live' | 'settling' | 'expired' | string;
97
+ limit?: string;
98
+ before?: string;
99
+ after?: string;
100
+ }
@@ -18,6 +18,15 @@ export interface AlgoLongHistoryRequest {
18
18
  before?: string;
19
19
  limit?: string;
20
20
  }
21
+ /**
22
+ * When amending an attached trailing stop via amend algo / attach block (2026-04-13).
23
+ * Only one of newCallbackRatio or newCallbackSpread.
24
+ */
25
+ export interface AmendAttachedTrailingStop {
26
+ newCallbackRatio?: string;
27
+ newCallbackSpread?: string;
28
+ newActivePx?: string;
29
+ }
21
30
  interface AlgoTriggerOrder {
22
31
  newTpTriggerPx?: string;
23
32
  newTpTriggerPxType?: 'last' | 'index' | 'mark';
@@ -25,6 +34,36 @@ interface AlgoTriggerOrder {
25
34
  newSlTriggerPx?: string;
26
35
  newSlTriggerPxType?: 'last' | 'index' | 'mark';
27
36
  newSlOrdPx?: string;
37
+ newCallbackRatio?: string;
38
+ newCallbackSpread?: string;
39
+ newActivePx?: string;
40
+ }
41
+ /**
42
+ * TP/SL and trailing (move_order_stop) attached to a parent `order` (2026-04-13: callbackRatio | callbackSpread, activePx).
43
+ */
44
+ export interface AttachAlgoOrdRequest {
45
+ attachAlgoClOrdId?: string;
46
+ tpTriggerPx?: string;
47
+ /** Only one of tpTriggerPx and tpTriggerRatio (FUTURES/SWAP). */
48
+ tpTriggerRatio?: string;
49
+ tpOrdPx?: string;
50
+ tpOrdKind?: 'condition' | 'limit';
51
+ slTriggerPx?: string;
52
+ slTriggerRatio?: string;
53
+ slOrdPx?: string;
54
+ tpTriggerPxType?: 'last' | 'index' | 'mark';
55
+ slTriggerPxType?: 'last' | 'index' | 'mark';
56
+ sz?: string;
57
+ amendPxOnTriggerType?: '0' | '1';
58
+ /**
59
+ * Trailing stop: one of `callbackRatio` or `callbackSpread` when attached ordType is `move_order_stop`.
60
+ * e.g. 0.05 = 5%
61
+ */
62
+ callbackRatio?: string;
63
+ /** Trailing: price distance (alternative to callbackRatio). */
64
+ callbackSpread?: string;
65
+ /** Trailing: activation; omit = activate immediately. */
66
+ activePx?: string;
28
67
  }
29
68
  export interface AlgoOrderRequest {
30
69
  instId: string;
@@ -64,15 +103,7 @@ export interface AlgoOrderRequest {
64
103
  quickMgnType?: string;
65
104
  closeFraction?: numberInString;
66
105
  advanceOrdType?: 'fok' | 'ioc' | '';
67
- attachAlgoOrds?: {
68
- attachAlgoClOrdId?: string;
69
- tpTriggerPx?: string;
70
- tpOrdPx?: string;
71
- slTriggerPx?: string;
72
- slOrdPx?: string;
73
- tpTriggerPxType?: string;
74
- slTriggerPxType?: string;
75
- }[];
106
+ attachAlgoOrds?: AttachAlgoOrdRequest[];
76
107
  }
77
108
  export interface AmendOrderRequest {
78
109
  instId: string;
@@ -82,6 +113,12 @@ export interface AmendOrderRequest {
82
113
  reqId?: string;
83
114
  newSz?: string;
84
115
  newPx?: string;
116
+ /** EVENTS: `"1"` for non-`post_only` amends when applicable. */
117
+ speedBump?: string;
118
+ /**
119
+ * Amend attached trailing stop (or related attach algo) — only one of newCallbackRatio / newCallbackSpread per item (2026-04-13).
120
+ */
121
+ attachAlgoOrds?: AmendAttachedTrailingStop[];
85
122
  }
86
123
  export type AlgoOrderDetailsRequest = {
87
124
  algoId: string;
@@ -132,7 +169,15 @@ export interface FillsHistoryRequest {
132
169
  limit?: string;
133
170
  }
134
171
  export interface OrderIdRequest {
135
- instId: string;
172
+ /**
173
+ * REST: use as in trade docs. WebSocket `cancel-order` / `batch-cancel-orders`: deprecated (2026-04-07) — if sent, ignored; use
174
+ * `ordId` or `clOrdId`. Optional `instIdCode` may still be used to map the instrument.
175
+ */
176
+ instId?: string;
177
+ /**
178
+ * Where supported, may take precedence over `instId` if both are present. Get instruments to map.
179
+ */
180
+ instIdCode?: number;
136
181
  ordId?: string;
137
182
  clOrdId?: string;
138
183
  }
@@ -175,6 +220,14 @@ export interface OrderRequest {
175
220
  tradeQuoteCcy?: string;
176
221
  /** Self trade prevention mode: cancel_maker, cancel_taker, cancel_both. Default is cancel_maker */
177
222
  stpMode?: 'cancel_maker' | 'cancel_taker' | 'cancel_both';
223
+ /** ELP taker access. true = can trade with ELP orders (speed bump applied). Default false. Only applicable to ioc orders */
224
+ isElpTakerAccess?: boolean;
225
+ /**
226
+ * EVENTS: set to `"1"` for non-`post_only` orders. Error 54086 if missing when required.
227
+ */
228
+ speedBump?: string;
229
+ /** EVENTS: `yes` or `no`. */
230
+ outcome?: string;
178
231
  /** Take Profit & Stop Loss params */
179
232
  tpTriggerPx?: string;
180
233
  tpOrdPx?: string;
@@ -182,33 +235,8 @@ export interface OrderRequest {
182
235
  slOrdPx?: string;
183
236
  tpTriggerPxType?: PriceTriggerType;
184
237
  slTriggerPxType?: PriceTriggerType;
185
- /** TP/SL information attached when placing order (supports split TPs and advanced TP/SL configurations) */
186
- attachAlgoOrds?: {
187
- /** Client-supplied Algo ID when placing order attaching TP/SL */
188
- attachAlgoClOrdId?: string;
189
- /** Take-profit trigger price */
190
- tpTriggerPx?: string;
191
- /** Take profit trigger ratio, 0.3 represents 30%. Only one of tpTriggerPx and tpTriggerRatio can be passed */
192
- tpTriggerRatio?: string;
193
- /** Take-profit order price. -1 means market price */
194
- tpOrdPx?: string;
195
- /** TP order kind: "condition" or "limit". Default is "condition" */
196
- tpOrdKind?: 'condition' | 'limit';
197
- /** Stop-loss trigger price */
198
- slTriggerPx?: string;
199
- /** Stop loss trigger ratio, 0.3 represents 30%. Only one of slTriggerPx and slTriggerRatio can be passed */
200
- slTriggerRatio?: string;
201
- /** Stop-loss order price. -1 means market price */
202
- slOrdPx?: string;
203
- /** Take-profit trigger price type: last, index, or mark. Default is last */
204
- tpTriggerPxType?: 'last' | 'index' | 'mark';
205
- /** Stop-loss trigger price type: last, index, or mark. Default is last */
206
- slTriggerPxType?: 'last' | 'index' | 'mark';
207
- /** Size. Only applicable to TP order of split TPs, and it is required for TP order of split TPs */
208
- sz?: string;
209
- /** Whether to enable Cost-price SL. "0" = disable (default), "1" = Enable. Only applicable to SL order of split TPs */
210
- amendPxOnTriggerType?: '0' | '1';
211
- }[];
238
+ /** TP/SL / trailing (attach) when placing the parent order */
239
+ attachAlgoOrds?: AttachAlgoOrdRequest[];
212
240
  /** Quick margin type */
213
241
  quickMgnType?: 'manual' | 'auto_borrow' | 'auto_repay';
214
242
  }
@@ -226,16 +254,8 @@ export interface OrderPrecheckRequest {
226
254
  px?: string;
227
255
  reduceOnly?: boolean;
228
256
  tgtCcy?: string;
229
- attachAlgoOrds?: {
230
- attachAlgoClOrdId?: string;
231
- tpTriggerPx?: string;
232
- tpOrdPx?: string;
233
- tpOrdKind?: string;
234
- slTriggerPx?: string;
235
- slOrdPx?: string;
236
- tpTriggerPxType?: string;
237
- slTriggerPxType?: string;
238
- sz?: string;
239
- }[];
257
+ /** EVENTS: `yes` / `no`. */
258
+ outcome?: string;
259
+ attachAlgoOrds?: AttachAlgoOrdRequest[];
240
260
  }
241
261
  export {};
@@ -1,4 +1,5 @@
1
1
  import { AccountLevel, MarginMode, PositionSide, WithdrawState } from '../shared.js';
2
+ import type { InstrumentUpcomingParamChange } from './public-data.js';
2
3
  export interface AccountBalanceDetail {
3
4
  availBal: string;
4
5
  availEq: string;
@@ -164,9 +165,25 @@ export interface AccountBill {
164
165
  earnAmt?: string;
165
166
  earnApr?: string;
166
167
  }
168
+ export interface BillSubTypeDetail {
169
+ subType: string;
170
+ subTypeDesc: string;
171
+ }
172
+ /**
173
+ * @see GET /api/v5/account/subtypes
174
+ */
175
+ export interface AccountBillTypeDefinition {
176
+ type: string;
177
+ typeDesc: string;
178
+ subTypeDetails: BillSubTypeDetail[];
179
+ }
180
+ /**
181
+ * Apply (POST) may return { result, ts }; get link (GET) may return { fileHref, state, ts }.
182
+ */
167
183
  export interface AccountHistoryBill {
168
- fileHref: string;
169
- result: string;
184
+ fileHref?: string;
185
+ result?: string;
186
+ state?: 'finished' | 'ongoing' | 'failed' | string;
170
187
  ts: string;
171
188
  }
172
189
  export interface AccountConfiguration {
@@ -261,6 +278,7 @@ export interface AccountFeeRate {
261
278
  makerU: string;
262
279
  taker: string;
263
280
  takerU: string;
281
+ settle?: string;
264
282
  ts: string;
265
283
  ruleType: string;
266
284
  feeGroup?: FeeGroup[];
@@ -341,6 +359,14 @@ export interface AccountInstrument {
341
359
  instFamily: string;
342
360
  instId: string;
343
361
  instType: string;
362
+ seriesId?: string;
363
+ uly?: string;
364
+ /**
365
+ * FUTURES label (deprecated — prefer `expTime`; may include this_five_years, next_five_years, …).
366
+ */
367
+ alias?: string;
368
+ /** Deprecated; see `instCategory` on public `Instrument` where used. */
369
+ category?: string;
344
370
  lever: string;
345
371
  listTime: string;
346
372
  contTdSwTime: string;
@@ -360,17 +386,31 @@ export interface AccountInstrument {
360
386
  quoteCcy: string;
361
387
  tradeQuoteCcyList: string[];
362
388
  settleCcy: string;
389
+ /** Instrument status: live, suspend, rebase (SWAP only), preopen, test */
363
390
  state: string;
364
391
  stk: string;
365
392
  tickSz: string;
393
+ /** Trading rule types: normal, pre_market, rebase_contract */
366
394
  ruleType: string;
367
395
  auctionEndTime: string;
368
396
  futureSettlement: boolean;
369
397
  instIdCode: number;
398
+ /**
399
+ * Asset category of the instrument's base asset (see public `Instrument.instCategory` for values).
400
+ * 1: Crypto, 3: Stocks, 4: Commodities, 5: Forex, 6: Bonds, "": not available
401
+ */
402
+ instCategory?: string;
370
403
  posLmtAmt: string;
371
404
  posLmtPct: string;
372
405
  maxPlatOILmt: string;
406
+ /** Remaining long position value (USD) the user is permitted to open. Applicable to SWAP/FUTURES. */
407
+ longPosRemainingQuota?: string;
408
+ /** Remaining short position value (USD) the user is permitted to open. Applicable to SWAP/FUTURES. */
409
+ shortPosRemainingQuota?: string;
373
410
  groupId?: string;
411
+ /** ELP maker permission. "0" = not enabled, "1" = enabled but no permission, "2" = enabled with permission */
412
+ elp?: string;
413
+ upcChg?: InstrumentUpcomingParamChange[];
374
414
  }
375
415
  export interface QuickMarginBorrowRepayResult {
376
416
  instId: string;
@@ -0,0 +1,87 @@
1
+ export interface DcdCurrencyPair {
2
+ baseCcy: string;
3
+ quoteCcy: string;
4
+ optType: 'C' | 'P';
5
+ uly: string;
6
+ }
7
+ export interface DcdProduct {
8
+ absYield: string;
9
+ annualizedYield: string;
10
+ baseCcy: string;
11
+ quoteCcy: string;
12
+ expTime: string;
13
+ interestAccrualTime: string;
14
+ listTime: string;
15
+ maxSize: string;
16
+ minSize: string;
17
+ notionalCcy: string;
18
+ optType: 'C' | 'P';
19
+ productId: string;
20
+ quoteTime: string;
21
+ redeemEndTime: string;
22
+ redeemStartTime: string;
23
+ stepSz: string;
24
+ tradeEndTime: string;
25
+ strike: string;
26
+ uly: string;
27
+ }
28
+ export interface DcdQuote {
29
+ absYield: string;
30
+ annualizedYield: string;
31
+ interestAccrualTime: string;
32
+ notionalSz: string;
33
+ notionalCcy: string;
34
+ productId: string;
35
+ quoteId: string;
36
+ validUntil: string;
37
+ idxPx: string;
38
+ }
39
+ export type DcdTradeOrderState = 'initial' | 'pending_book' | 'live' | 'rejected';
40
+ export interface DcdTradeResult {
41
+ quoteId: string;
42
+ ordId: string;
43
+ state: DcdTradeOrderState;
44
+ }
45
+ export interface DcdRedeemQuote {
46
+ ordId: string;
47
+ quoteId: string;
48
+ redeemCcy: string;
49
+ redeemSz: string;
50
+ termRate: string;
51
+ validUntil: string;
52
+ }
53
+ export type DcdRedeemConfirmState = 'pending_redeem_booking' | 'pending_redeem' | 'redeeming' | 'redeemed';
54
+ export interface DcdRedeemResult {
55
+ ordId: string;
56
+ state: DcdRedeemConfirmState;
57
+ }
58
+ export type DcdOrderStatusState = 'initial' | 'live' | 'pending_settle' | 'settled' | 'pending_redeem' | 'redeemed' | 'rejected';
59
+ export interface DcdOrderStatus {
60
+ ordId: string;
61
+ state: DcdOrderStatusState;
62
+ }
63
+ export interface DcdOrderHistoryItem {
64
+ ordId: string;
65
+ quoteId: string;
66
+ state: DcdOrderStatusState;
67
+ productId: string;
68
+ baseCcy: string;
69
+ quoteCcy: string;
70
+ uly: string;
71
+ strike: string;
72
+ notionalSz: string;
73
+ notionalCcy: string;
74
+ absYield: string;
75
+ annualizedYield: string;
76
+ yieldSz: string;
77
+ yieldCcy: string;
78
+ settleSz: string;
79
+ settleCcy: string;
80
+ settlePx: string;
81
+ settleTime: string;
82
+ expTime: string;
83
+ redeemStartTime: string;
84
+ redeemEndTime: string;
85
+ cTime: string;
86
+ uTime: string;
87
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=private-dual-investment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-dual-investment.js","sourceRoot":"","sources":["../../../../../src/types/rest/response/private-dual-investment.ts"],"names":[],"mappings":""}
@@ -10,9 +10,16 @@ export interface SupplementaryCollateral {
10
10
  ccy: string;
11
11
  amt: string;
12
12
  }
13
+ export interface GetFlexibleLoanCollateralAssetsRequest {
14
+ ccy?: string;
15
+ /** When the account has multiple active flexible-loan positions. */
16
+ ordId?: string;
17
+ }
13
18
  export interface MaxLoanRequest {
14
19
  borrowCcy: string;
15
20
  supCollateral?: SupplementaryCollateral[];
21
+ /** When multiple active loans exist. */
22
+ ordId?: string;
16
23
  }
17
24
  export interface MaxLoanResponse {
18
25
  borrowCcy: string;
@@ -24,6 +31,8 @@ export interface AdjustCollateralRequest {
24
31
  type: 'add' | 'reduce';
25
32
  collateralCcy: string;
26
33
  collateralAmt: string;
34
+ /** When multiple active loans exist. */
35
+ ordId?: string;
27
36
  }
28
37
  export interface LoanCurrencyData {
29
38
  ccy: string;
@@ -33,9 +42,18 @@ export interface RiskWarningData {
33
42
  instId: string;
34
43
  liqPx: string;
35
44
  }
45
+ export interface GetLoanInfoRequest {
46
+ /** When the account has multiple active flexible loans . */
47
+ ordId?: string;
48
+ }
36
49
  export interface LoanInfo {
50
+ /**
51
+ * Active loan / position id when the account can hold multiple loan orders.
52
+ */
53
+ ordId?: string;
37
54
  loanNotionalUsd: string;
38
55
  loanData: LoanCurrencyData[];
56
+ /** Adjusted collateral value in USD. */
39
57
  collateralNotionalUsd: string;
40
58
  collateralData: LoanCurrencyData[];
41
59
  riskWarningData: RiskWarningData;
@@ -45,6 +63,8 @@ export interface LoanInfo {
45
63
  }
46
64
  export interface LoanHistoryRequest {
47
65
  type?: 'borrowed' | 'repaid' | 'collateral_locked' | 'collateral_released' | 'forced_repayment_buy' | 'forced_repayment_sell' | 'forced_liquidation' | 'partial_liquidation';
66
+ /** When multiple active loans exist. */
67
+ ordId?: string;
48
68
  after?: string;
49
69
  before?: string;
50
70
  limit?: string;
@@ -58,6 +78,8 @@ export interface LoanHistoryItem {
58
78
  }
59
79
  export interface AccruedInterestRequest {
60
80
  ccy?: string;
81
+ /** When multiple active loans exist. */
82
+ ordId?: string;
61
83
  after?: string;
62
84
  before?: string;
63
85
  limit?: string;
@@ -1,4 +1,24 @@
1
1
  import { AlgoOrderState, AlgoOrderType, AlgoPositionSide, numberInString, OrderState, OrderType, PositionSide } from '../shared.js';
2
+ /**
3
+ * Nested rows in `attachAlgoOrds` on orders / history (incl. trailing stop fields)
4
+ */
5
+ export interface AttachAlgoOrderDetail {
6
+ attachAlgoClOrdId?: string;
7
+ tpTriggerPx?: string;
8
+ tpTriggerRatio?: string;
9
+ tpOrdPx?: string;
10
+ tpOrdKind?: string;
11
+ slTriggerPx?: string;
12
+ slTriggerRatio?: string;
13
+ slOrdPx?: string;
14
+ tpTriggerPxType?: string;
15
+ slTriggerPxType?: string;
16
+ sz?: string;
17
+ amendPxOnTriggerType?: string;
18
+ callbackRatio?: string;
19
+ callbackSpread?: string;
20
+ activePx?: string;
21
+ }
2
22
  export interface OrderResult {
3
23
  clOrdId: string;
4
24
  ordId: string;
@@ -52,12 +72,14 @@ export interface OrderDetails {
52
72
  slTriggerPx: string;
53
73
  slTriggerPxType: string;
54
74
  slOrdPx: string;
75
+ attachAlgoOrds?: AttachAlgoOrderDetail[];
55
76
  feeCcy: string;
56
77
  fee: string;
57
78
  rebateCcy: string;
58
79
  rebate: string;
59
80
  tgtCcy: string;
60
81
  category: string;
82
+ outcome?: string;
61
83
  uTime: string;
62
84
  cTime: string;
63
85
  }
@@ -91,7 +113,6 @@ export interface OrderListItem {
91
113
  slOrdPx: string;
92
114
  slTriggerPx: string;
93
115
  slTriggerPxType: string;
94
- attachAlgoOrds: any[];
95
116
  state: OrderState;
96
117
  stpId: string;
97
118
  stpMode: string;
@@ -109,6 +130,8 @@ export interface OrderListItem {
109
130
  algoClOrdId: string;
110
131
  algoId: string;
111
132
  uTime: string;
133
+ attachAlgoOrds?: AttachAlgoOrderDetail[];
134
+ outcome?: string;
112
135
  }
113
136
  export interface HistoricOrder {
114
137
  instType: string;
@@ -141,7 +164,7 @@ export interface HistoricOrder {
141
164
  slTriggerPx: string;
142
165
  slTriggerPxType: string;
143
166
  slOrdPx: string;
144
- attachAlgoOrds: any[];
167
+ attachAlgoOrds?: AttachAlgoOrderDetail[];
145
168
  stpId: string;
146
169
  stpMode: string;
147
170
  feeCcy: string;
@@ -157,6 +180,7 @@ export interface HistoricOrder {
157
180
  cancelSourceReason: string;
158
181
  algoClOrdId: string;
159
182
  algoId: string;
183
+ outcome?: string;
160
184
  uTime: string;
161
185
  cTime: string;
162
186
  }
@@ -194,7 +218,7 @@ export interface AlgoOrderDetailsResult {
194
218
  ccy: string;
195
219
  clOrdId: string;
196
220
  algoId: string;
197
- attachAlgoOrds: any[];
221
+ attachAlgoOrds?: AttachAlgoOrderDetail[];
198
222
  sz: string;
199
223
  closeFraction: string;
200
224
  ordType: AlgoOrderType;
@@ -246,7 +270,7 @@ export interface AlgoOrderListItem {
246
270
  actualSide: string;
247
271
  actualSz: string;
248
272
  algoId: string;
249
- attachAlgoOrds: any[];
273
+ attachAlgoOrds?: AttachAlgoOrderDetail[];
250
274
  cTime: string;
251
275
  callbackRatio: string;
252
276
  callbackSpread: string;
@@ -257,7 +281,7 @@ export interface AlgoOrderListItem {
257
281
  lever: string;
258
282
  moveTriggerPx: string;
259
283
  ordId: string;
260
- ordIdList: any[];
284
+ ordIdList: string[];
261
285
  ordPx: string;
262
286
  ordType: AlgoOrderType;
263
287
  posSide: AlgoPositionSide;
@@ -301,7 +325,7 @@ export interface HistoricAlgoOrder {
301
325
  actualSz: string;
302
326
  algoClOrdId: string;
303
327
  algoId: string;
304
- attachAlgoOrds: any[];
328
+ attachAlgoOrds?: AttachAlgoOrderDetail[];
305
329
  cTime: string;
306
330
  callbackRatio: string;
307
331
  callbackSpread: string;