okx-api 3.1.3 → 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.
- package/README.md +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/rest-client.d.ts +62 -30
- package/dist/cjs/rest-client.js +71 -4
- package/dist/cjs/rest-client.js.map +1 -1
- package/dist/cjs/types/rest/request/account.d.ts +13 -1
- package/dist/cjs/types/rest/request/dual-investment.d.ts +35 -0
- package/dist/cjs/types/rest/request/dual-investment.js +3 -0
- package/dist/cjs/types/rest/request/dual-investment.js.map +1 -0
- package/dist/cjs/types/rest/request/funding.d.ts +8 -0
- package/dist/cjs/types/rest/request/public.d.ts +45 -0
- package/dist/cjs/types/rest/request/trade.d.ts +64 -49
- package/dist/cjs/types/rest/response/private-account.d.ts +33 -3
- package/dist/cjs/types/rest/response/private-dual-investment.d.ts +87 -0
- package/dist/cjs/types/rest/response/private-dual-investment.js +3 -0
- package/dist/cjs/types/rest/response/private-dual-investment.js.map +1 -0
- package/dist/cjs/types/rest/response/private-flexible-loan.d.ts +22 -0
- package/dist/cjs/types/rest/response/private-trade.d.ts +30 -6
- package/dist/cjs/types/rest/response/public-data.d.ts +138 -3
- package/dist/cjs/types/rest/shared.d.ts +1 -1
- package/dist/cjs/types/websockets/ws-api-request.d.ts +13 -2
- package/dist/cjs/types/websockets/ws-api-response.d.ts +11 -0
- package/dist/cjs/types/websockets/ws-events.d.ts +1 -0
- package/dist/cjs/types/websockets/ws-request.d.ts +11 -4
- package/dist/mjs/index.d.ts +2 -0
- package/dist/mjs/index.js +2 -0
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/rest-client.d.ts +62 -30
- package/dist/mjs/rest-client.js +71 -4
- package/dist/mjs/rest-client.js.map +1 -1
- package/dist/mjs/types/rest/request/account.d.ts +13 -1
- package/dist/mjs/types/rest/request/dual-investment.d.ts +35 -0
- package/dist/mjs/types/rest/request/dual-investment.js +2 -0
- package/dist/mjs/types/rest/request/dual-investment.js.map +1 -0
- package/dist/mjs/types/rest/request/funding.d.ts +8 -0
- package/dist/mjs/types/rest/request/public.d.ts +45 -0
- package/dist/mjs/types/rest/request/trade.d.ts +64 -49
- package/dist/mjs/types/rest/response/private-account.d.ts +33 -3
- package/dist/mjs/types/rest/response/private-dual-investment.d.ts +87 -0
- package/dist/mjs/types/rest/response/private-dual-investment.js +2 -0
- package/dist/mjs/types/rest/response/private-dual-investment.js.map +1 -0
- package/dist/mjs/types/rest/response/private-flexible-loan.d.ts +22 -0
- package/dist/mjs/types/rest/response/private-trade.d.ts +30 -6
- package/dist/mjs/types/rest/response/public-data.d.ts +138 -3
- package/dist/mjs/types/rest/shared.d.ts +1 -1
- package/dist/mjs/types/websockets/ws-api-request.d.ts +13 -2
- package/dist/mjs/types/websockets/ws-api-response.d.ts +11 -0
- package/dist/mjs/types/websockets/ws-events.d.ts +1 -0
- package/dist/mjs/types/websockets/ws-request.d.ts +11 -4
- package/llms.txt +7972 -7170
- package/package.json +1 -1
|
@@ -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,9 +169,14 @@ export interface FillsHistoryRequest {
|
|
|
132
169
|
limit?: string;
|
|
133
170
|
}
|
|
134
171
|
export interface OrderIdRequest {
|
|
135
|
-
/**
|
|
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
|
+
*/
|
|
136
176
|
instId?: string;
|
|
137
|
-
/**
|
|
177
|
+
/**
|
|
178
|
+
* Where supported, may take precedence over `instId` if both are present. Get instruments to map.
|
|
179
|
+
*/
|
|
138
180
|
instIdCode?: number;
|
|
139
181
|
ordId?: string;
|
|
140
182
|
clOrdId?: string;
|
|
@@ -180,6 +222,12 @@ export interface OrderRequest {
|
|
|
180
222
|
stpMode?: 'cancel_maker' | 'cancel_taker' | 'cancel_both';
|
|
181
223
|
/** ELP taker access. true = can trade with ELP orders (speed bump applied). Default false. Only applicable to ioc orders */
|
|
182
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;
|
|
183
231
|
/** Take Profit & Stop Loss params */
|
|
184
232
|
tpTriggerPx?: string;
|
|
185
233
|
tpOrdPx?: string;
|
|
@@ -187,33 +235,8 @@ export interface OrderRequest {
|
|
|
187
235
|
slOrdPx?: string;
|
|
188
236
|
tpTriggerPxType?: PriceTriggerType;
|
|
189
237
|
slTriggerPxType?: PriceTriggerType;
|
|
190
|
-
/** TP/SL
|
|
191
|
-
attachAlgoOrds?:
|
|
192
|
-
/** Client-supplied Algo ID when placing order attaching TP/SL */
|
|
193
|
-
attachAlgoClOrdId?: string;
|
|
194
|
-
/** Take-profit trigger price */
|
|
195
|
-
tpTriggerPx?: string;
|
|
196
|
-
/** Take profit trigger ratio, 0.3 represents 30%. Only one of tpTriggerPx and tpTriggerRatio can be passed */
|
|
197
|
-
tpTriggerRatio?: string;
|
|
198
|
-
/** Take-profit order price. -1 means market price */
|
|
199
|
-
tpOrdPx?: string;
|
|
200
|
-
/** TP order kind: "condition" or "limit". Default is "condition" */
|
|
201
|
-
tpOrdKind?: 'condition' | 'limit';
|
|
202
|
-
/** Stop-loss trigger price */
|
|
203
|
-
slTriggerPx?: string;
|
|
204
|
-
/** Stop loss trigger ratio, 0.3 represents 30%. Only one of slTriggerPx and slTriggerRatio can be passed */
|
|
205
|
-
slTriggerRatio?: string;
|
|
206
|
-
/** Stop-loss order price. -1 means market price */
|
|
207
|
-
slOrdPx?: string;
|
|
208
|
-
/** Take-profit trigger price type: last, index, or mark. Default is last */
|
|
209
|
-
tpTriggerPxType?: 'last' | 'index' | 'mark';
|
|
210
|
-
/** Stop-loss trigger price type: last, index, or mark. Default is last */
|
|
211
|
-
slTriggerPxType?: 'last' | 'index' | 'mark';
|
|
212
|
-
/** Size. Only applicable to TP order of split TPs, and it is required for TP order of split TPs */
|
|
213
|
-
sz?: string;
|
|
214
|
-
/** Whether to enable Cost-price SL. "0" = disable (default), "1" = Enable. Only applicable to SL order of split TPs */
|
|
215
|
-
amendPxOnTriggerType?: '0' | '1';
|
|
216
|
-
}[];
|
|
238
|
+
/** TP/SL / trailing (attach) when placing the parent order */
|
|
239
|
+
attachAlgoOrds?: AttachAlgoOrdRequest[];
|
|
217
240
|
/** Quick margin type */
|
|
218
241
|
quickMgnType?: 'manual' | 'auto_borrow' | 'auto_repay';
|
|
219
242
|
}
|
|
@@ -231,16 +254,8 @@ export interface OrderPrecheckRequest {
|
|
|
231
254
|
px?: string;
|
|
232
255
|
reduceOnly?: boolean;
|
|
233
256
|
tgtCcy?: string;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
tpOrdPx?: string;
|
|
238
|
-
tpOrdKind?: string;
|
|
239
|
-
slTriggerPx?: string;
|
|
240
|
-
slOrdPx?: string;
|
|
241
|
-
tpTriggerPxType?: string;
|
|
242
|
-
slTriggerPxType?: string;
|
|
243
|
-
sz?: string;
|
|
244
|
-
}[];
|
|
257
|
+
/** EVENTS: `yes` / `no`. */
|
|
258
|
+
outcome?: string;
|
|
259
|
+
attachAlgoOrds?: AttachAlgoOrdRequest[];
|
|
245
260
|
}
|
|
246
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
|
|
169
|
-
result
|
|
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;
|
|
@@ -369,7 +395,10 @@ export interface AccountInstrument {
|
|
|
369
395
|
auctionEndTime: string;
|
|
370
396
|
futureSettlement: boolean;
|
|
371
397
|
instIdCode: number;
|
|
372
|
-
/**
|
|
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
|
+
*/
|
|
373
402
|
instCategory?: string;
|
|
374
403
|
posLmtAmt: string;
|
|
375
404
|
posLmtPct: string;
|
|
@@ -381,6 +410,7 @@ export interface AccountInstrument {
|
|
|
381
410
|
groupId?: string;
|
|
382
411
|
/** ELP maker permission. "0" = not enabled, "1" = enabled but no permission, "2" = enabled with permission */
|
|
383
412
|
elp?: string;
|
|
413
|
+
upcChg?: InstrumentUpcomingParamChange[];
|
|
384
414
|
}
|
|
385
415
|
export interface QuickMarginBorrowRepayResult {
|
|
386
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 @@
|
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
328
|
+
attachAlgoOrds?: AttachAlgoOrderDetail[];
|
|
305
329
|
cTime: string;
|
|
306
330
|
callbackRatio: string;
|
|
307
331
|
callbackSpread: string;
|