okx-api 3.1.3 → 3.1.5
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 +2 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/rest-client.d.ts +87 -33
- package/dist/cjs/rest-client.js +111 -4
- package/dist/cjs/rest-client.js.map +1 -1
- package/dist/cjs/types/rest/client.d.ts +1 -0
- package/dist/cjs/types/rest/request/account.d.ts +13 -1
- package/dist/cjs/types/rest/request/affiliate.d.ts +52 -0
- package/dist/cjs/types/rest/request/affiliate.js +3 -0
- package/dist/cjs/types/rest/request/affiliate.js.map +1 -0
- 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/stable-rewards.d.ts +27 -0
- package/dist/cjs/types/rest/request/stable-rewards.js +3 -0
- package/dist/cjs/types/rest/request/stable-rewards.js.map +1 -0
- package/dist/cjs/types/rest/request/trade.d.ts +70 -49
- package/dist/cjs/types/rest/response/private-account.d.ts +34 -4
- package/dist/cjs/types/rest/response/private-affiliate.d.ts +106 -0
- package/dist/cjs/types/rest/response/private-affiliate.js +3 -0
- package/dist/cjs/types/rest/response/private-affiliate.js.map +1 -0
- 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-stable-rewards.d.ts +57 -0
- package/dist/cjs/types/rest/response/private-stable-rewards.js +3 -0
- package/dist/cjs/types/rest/response/private-stable-rewards.js.map +1 -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/shared.d.ts +3 -2
- package/dist/cjs/types/websockets/ws-api-request.d.ts +19 -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-general.d.ts +1 -0
- package/dist/cjs/types/websockets/ws-request.d.ts +11 -4
- package/dist/cjs/util/requestUtils.js +3 -0
- package/dist/cjs/util/requestUtils.js.map +1 -1
- package/dist/cjs/util/websocket-util.js +17 -1
- package/dist/cjs/util/websocket-util.js.map +1 -1
- package/dist/cjs/websocket-client.js +2 -1
- package/dist/cjs/websocket-client.js.map +1 -1
- package/dist/mjs/index.d.ts +6 -0
- package/dist/mjs/index.js +6 -0
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/rest-client.d.ts +87 -33
- package/dist/mjs/rest-client.js +111 -4
- package/dist/mjs/rest-client.js.map +1 -1
- package/dist/mjs/types/rest/client.d.ts +1 -0
- package/dist/mjs/types/rest/request/account.d.ts +13 -1
- package/dist/mjs/types/rest/request/affiliate.d.ts +52 -0
- package/dist/mjs/types/rest/request/affiliate.js +2 -0
- package/dist/mjs/types/rest/request/affiliate.js.map +1 -0
- 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/stable-rewards.d.ts +27 -0
- package/dist/mjs/types/rest/request/stable-rewards.js +2 -0
- package/dist/mjs/types/rest/request/stable-rewards.js.map +1 -0
- package/dist/mjs/types/rest/request/trade.d.ts +70 -49
- package/dist/mjs/types/rest/response/private-account.d.ts +34 -4
- package/dist/mjs/types/rest/response/private-affiliate.d.ts +106 -0
- package/dist/mjs/types/rest/response/private-affiliate.js +2 -0
- package/dist/mjs/types/rest/response/private-affiliate.js.map +1 -0
- 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-stable-rewards.d.ts +57 -0
- package/dist/mjs/types/rest/response/private-stable-rewards.js +2 -0
- package/dist/mjs/types/rest/response/private-stable-rewards.js.map +1 -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/shared.d.ts +3 -2
- package/dist/mjs/types/websockets/ws-api-request.d.ts +19 -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-general.d.ts +1 -0
- package/dist/mjs/types/websockets/ws-request.d.ts +11 -4
- package/dist/mjs/util/requestUtils.js +3 -0
- package/dist/mjs/util/requestUtils.js.map +1 -1
- package/dist/mjs/util/websocket-util.js +17 -1
- package/dist/mjs/util/websocket-util.js.map +1 -1
- package/dist/mjs/websocket-client.js +2 -1
- package/dist/mjs/websocket-client.js.map +1 -1
- package/llms.txt +7922 -6666
- package/package.json +3 -5
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type AffiliatePeriodType = 'last_7d' | 'last_30d' | 'this_month' | 'last_month' | 'total' | 'today' | 'this_week' | 'custom';
|
|
2
|
+
export type AffiliateCommissionCategory = 'SPOT' | 'DERIVATIVE' | 'BSC';
|
|
3
|
+
export type AffiliateKycStatus = 'unverified' | 'verified';
|
|
4
|
+
export type AffiliateLinkType = 'standard' | 'co_inviter';
|
|
5
|
+
export type AffiliateLinkStatus = 'normal' | 'abnormal';
|
|
6
|
+
export type AffiliateInviteeListOrderBy = 'cTime' | 'depAmt' | 'vol' | 'fee' | 'rebate';
|
|
7
|
+
export type AffiliateSubAffiliateListOrderBy = 'cTime' | 'depAmt' | 'vol' | 'fee' | 'rebate';
|
|
8
|
+
export type AffiliateOrderDir = 'asc' | 'desc';
|
|
9
|
+
export interface GetAffiliatePerformanceSummaryRequest {
|
|
10
|
+
periodType?: AffiliatePeriodType;
|
|
11
|
+
/** Required when periodType=custom, together with end. Inclusive. */
|
|
12
|
+
begin?: string;
|
|
13
|
+
/** Required when periodType=custom, together with begin. Inclusive. */
|
|
14
|
+
end?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface GetInviteeDetailRequest {
|
|
17
|
+
uid: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GetAffiliateInviteeListRequest {
|
|
20
|
+
page?: string;
|
|
21
|
+
limit?: string;
|
|
22
|
+
periodType?: AffiliatePeriodType;
|
|
23
|
+
/** Required when periodType=custom, together with end. Inclusive. */
|
|
24
|
+
begin?: string;
|
|
25
|
+
/** Required when periodType=custom, together with begin. Inclusive. */
|
|
26
|
+
end?: string;
|
|
27
|
+
keyword?: string;
|
|
28
|
+
commissionCategory?: AffiliateCommissionCategory;
|
|
29
|
+
orderBy?: AffiliateInviteeListOrderBy;
|
|
30
|
+
orderDir?: AffiliateOrderDir;
|
|
31
|
+
kycStatus?: AffiliateKycStatus;
|
|
32
|
+
subAffiliateUid?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GetAffiliateLinkListRequest {
|
|
35
|
+
page?: string;
|
|
36
|
+
limit?: string;
|
|
37
|
+
linkType?: AffiliateLinkType;
|
|
38
|
+
linkStatus?: AffiliateLinkStatus;
|
|
39
|
+
}
|
|
40
|
+
export interface GetAffiliateCoInviterLinkListRequest {
|
|
41
|
+
page?: string;
|
|
42
|
+
limit?: string;
|
|
43
|
+
linkStatus?: AffiliateLinkStatus;
|
|
44
|
+
}
|
|
45
|
+
export interface GetAffiliateSubAffiliateListRequest {
|
|
46
|
+
page?: string;
|
|
47
|
+
limit?: string;
|
|
48
|
+
keyword?: string;
|
|
49
|
+
commissionCategory?: AffiliateCommissionCategory;
|
|
50
|
+
orderBy?: AffiliateSubAffiliateListOrderBy;
|
|
51
|
+
orderDir?: AffiliateOrderDir;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affiliate.js","sourceRoot":"","sources":["../../../../../src/types/rest/request/affiliate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface GetDcdProductsRequest {
|
|
2
|
+
baseCcy: string;
|
|
3
|
+
quoteCcy: string;
|
|
4
|
+
optType: 'C' | 'P';
|
|
5
|
+
}
|
|
6
|
+
export interface RequestDcdQuoteRequest {
|
|
7
|
+
productId: string;
|
|
8
|
+
notionalSz: string;
|
|
9
|
+
notionalCcy: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SubmitDcdTradeRequest {
|
|
12
|
+
quoteId: string;
|
|
13
|
+
}
|
|
14
|
+
export interface RequestDcdRedeemQuoteRequest {
|
|
15
|
+
ordId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface SubmitDcdRedeemRequest {
|
|
18
|
+
ordId: string;
|
|
19
|
+
quoteId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GetDcdOrderStatusRequest {
|
|
22
|
+
ordId: string;
|
|
23
|
+
}
|
|
24
|
+
export type DcdOrderState = 'initial' | 'live' | 'pending_settle' | 'settled' | 'pending_redeem' | 'redeemed' | 'rejected';
|
|
25
|
+
export interface GetDcdOrderHistoryRequest {
|
|
26
|
+
ordId?: string;
|
|
27
|
+
productId?: string;
|
|
28
|
+
uly?: string;
|
|
29
|
+
state?: DcdOrderState;
|
|
30
|
+
beginId?: string;
|
|
31
|
+
endId?: string;
|
|
32
|
+
begin?: string;
|
|
33
|
+
end?: string;
|
|
34
|
+
limit?: string;
|
|
35
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface GetStableRewardsProductInfoRequest {
|
|
2
|
+
ccy: string;
|
|
3
|
+
}
|
|
4
|
+
export interface RequestStableRewardsQuoteRequest {
|
|
5
|
+
ccy: string;
|
|
6
|
+
settleCcy: string;
|
|
7
|
+
action: 'subscribe' | 'redeem';
|
|
8
|
+
amt: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SubmitStableRewardsTradeRequest {
|
|
11
|
+
quoteId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetStableRewardsBalanceRequest {
|
|
14
|
+
ccy?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface GetStableRewardsApyHistoryRequest {
|
|
17
|
+
ccy: string;
|
|
18
|
+
days?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetStableRewardsSubscribeRedeemHistoryRequest {
|
|
21
|
+
ccy: string;
|
|
22
|
+
type?: 'subscribe' | 'redeem';
|
|
23
|
+
status?: 'pending' | 'success' | 'failed';
|
|
24
|
+
after?: string;
|
|
25
|
+
before?: string;
|
|
26
|
+
limit?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stable-rewards.js","sourceRoot":"","sources":["../../../../../src/types/rest/request/stable-rewards.ts"],"names":[],"mappings":""}
|
|
@@ -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;
|
|
@@ -171,6 +213,12 @@ export interface OrderRequest {
|
|
|
171
213
|
reduceOnly?: boolean;
|
|
172
214
|
/** A spot buy on BTC-USDT with "base_ccy" would mean the QTY (sz) is in USDT */
|
|
173
215
|
tgtCcy?: 'base_ccy' | 'quote_ccy';
|
|
216
|
+
/**
|
|
217
|
+
* Maximum acceptable slippage for spot and spot margin market-side orders, where tgtCcy is the received currency (base_ccy for buy, quote_ccy for sell).
|
|
218
|
+
* Range: 0 to 0.05 (0% to 5%, inclusive). Up to 2 decimal places, e.g. 0.01 (1%) and 0.0123 (1.23%). Defaults to 0.00% if not specified.
|
|
219
|
+
* Only applicable to SPOT and SPOT margin market orders. Cannot be amended on an existing order.
|
|
220
|
+
*/
|
|
221
|
+
slippagePct?: string;
|
|
174
222
|
banAmend?: boolean;
|
|
175
223
|
/** Price amendment type: "0" = do not allow amendment, "1" = allow amendment within price limit. Default is "0" */
|
|
176
224
|
pxAmendType?: '0' | '1';
|
|
@@ -180,6 +228,12 @@ export interface OrderRequest {
|
|
|
180
228
|
stpMode?: 'cancel_maker' | 'cancel_taker' | 'cancel_both';
|
|
181
229
|
/** ELP taker access. true = can trade with ELP orders (speed bump applied). Default false. Only applicable to ioc orders */
|
|
182
230
|
isElpTakerAccess?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* EVENTS: set to `"1"` for non-`post_only` orders. Error 54086 if missing when required.
|
|
233
|
+
*/
|
|
234
|
+
speedBump?: string;
|
|
235
|
+
/** EVENTS: `yes` or `no`. */
|
|
236
|
+
outcome?: string;
|
|
183
237
|
/** Take Profit & Stop Loss params */
|
|
184
238
|
tpTriggerPx?: string;
|
|
185
239
|
tpOrdPx?: string;
|
|
@@ -187,33 +241,8 @@ export interface OrderRequest {
|
|
|
187
241
|
slOrdPx?: string;
|
|
188
242
|
tpTriggerPxType?: PriceTriggerType;
|
|
189
243
|
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
|
-
}[];
|
|
244
|
+
/** TP/SL / trailing (attach) when placing the parent order */
|
|
245
|
+
attachAlgoOrds?: AttachAlgoOrdRequest[];
|
|
217
246
|
/** Quick margin type */
|
|
218
247
|
quickMgnType?: 'manual' | 'auto_borrow' | 'auto_repay';
|
|
219
248
|
}
|
|
@@ -231,16 +260,8 @@ export interface OrderPrecheckRequest {
|
|
|
231
260
|
px?: string;
|
|
232
261
|
reduceOnly?: boolean;
|
|
233
262
|
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
|
-
}[];
|
|
263
|
+
/** EVENTS: `yes` / `no`. */
|
|
264
|
+
outcome?: string;
|
|
265
|
+
attachAlgoOrds?: AttachAlgoOrdRequest[];
|
|
245
266
|
}
|
|
246
267
|
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;
|
|
@@ -360,7 +386,7 @@ export interface AccountInstrument {
|
|
|
360
386
|
quoteCcy: string;
|
|
361
387
|
tradeQuoteCcyList: string[];
|
|
362
388
|
settleCcy: string;
|
|
363
|
-
/** Instrument status: live, suspend, rebase (SWAP only), preopen, test */
|
|
389
|
+
/** Instrument status: live, suspend, rebase (SWAP only), post_only (SWAP only), preopen, test */
|
|
364
390
|
state: string;
|
|
365
391
|
stk: string;
|
|
366
392
|
tickSz: 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,106 @@
|
|
|
1
|
+
import type { AffiliateCommissionCategory } from '../request/affiliate.js';
|
|
2
|
+
export interface AffiliatePerformanceSummaryDetail {
|
|
3
|
+
commissionCategory: AffiliateCommissionCategory;
|
|
4
|
+
firstTraderCnt: string;
|
|
5
|
+
traderCnt: string;
|
|
6
|
+
vol: string;
|
|
7
|
+
commission: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AffiliatePerformanceSummary {
|
|
10
|
+
uTime: string;
|
|
11
|
+
inviteeCnt: string;
|
|
12
|
+
depAmt: string;
|
|
13
|
+
details: AffiliatePerformanceSummaryDetail[];
|
|
14
|
+
}
|
|
15
|
+
export interface InviteeDetail {
|
|
16
|
+
inviteeLevel: string;
|
|
17
|
+
joinTime: string;
|
|
18
|
+
inviteeRebateRate: string;
|
|
19
|
+
totalCommission: string;
|
|
20
|
+
firstTradeTime: string;
|
|
21
|
+
level: string;
|
|
22
|
+
depAmt: string;
|
|
23
|
+
wdAmt: string;
|
|
24
|
+
volMonth: string;
|
|
25
|
+
totalVol: string;
|
|
26
|
+
accFee: string;
|
|
27
|
+
kycTime: string;
|
|
28
|
+
region: string;
|
|
29
|
+
affiliateCode: string;
|
|
30
|
+
}
|
|
31
|
+
export type AffiliateInviteeListKycStatus = 'unverified' | 'verified';
|
|
32
|
+
export interface AffiliateInviteeListItem {
|
|
33
|
+
uid: string;
|
|
34
|
+
country: string;
|
|
35
|
+
joinTime: string;
|
|
36
|
+
firstTradeTime: string;
|
|
37
|
+
channelName: string;
|
|
38
|
+
rebateRate: string;
|
|
39
|
+
feeTierRank: string;
|
|
40
|
+
kycStatus: AffiliateInviteeListKycStatus;
|
|
41
|
+
kycTime: string;
|
|
42
|
+
depAmt: string;
|
|
43
|
+
totalVol: string;
|
|
44
|
+
totalFee: string;
|
|
45
|
+
totalCommission: string;
|
|
46
|
+
isCompliant: boolean;
|
|
47
|
+
}
|
|
48
|
+
export type AffiliateLinkListLinkType = 'standard' | 'co_inviter';
|
|
49
|
+
export type AffiliateLinkListLinkStatus = 'normal' | 'abnormal';
|
|
50
|
+
export interface AffiliateLinkListItem {
|
|
51
|
+
channelId: string;
|
|
52
|
+
channelName: string;
|
|
53
|
+
joinLink: string;
|
|
54
|
+
linkType: AffiliateLinkListLinkType;
|
|
55
|
+
inviterCommissionRate: string;
|
|
56
|
+
coInviterCommissionRate: string;
|
|
57
|
+
inviteeDiscountRate: string;
|
|
58
|
+
inviteeCnt: string;
|
|
59
|
+
traderCnt: string;
|
|
60
|
+
totalCommission: string;
|
|
61
|
+
commission24h: string;
|
|
62
|
+
cTime: string;
|
|
63
|
+
isDefault: boolean;
|
|
64
|
+
linkStatus: AffiliateLinkListLinkStatus;
|
|
65
|
+
}
|
|
66
|
+
export type AffiliateChannelAssessmentStatus = 'valid' | 'not_reach_trade' | 'not_reach_invite' | 'not_reach_both';
|
|
67
|
+
export type AffiliateInviterChannelStatus = 'valid' | 'identity_invalid' | 'level_downgraded';
|
|
68
|
+
export type AffiliateCoInviterChannelStatus = 'valid' | 'identity_invalid' | 'not_reach_assessment' | 'identity_invalid_and_not_reach_assessment';
|
|
69
|
+
export interface AffiliateCoInviterLinkListItem {
|
|
70
|
+
channelId: string;
|
|
71
|
+
channelName: string;
|
|
72
|
+
joinLink: string;
|
|
73
|
+
inviterCommissionRate: string;
|
|
74
|
+
coInviterCommissionRate: string;
|
|
75
|
+
inviteeDiscountRate: string;
|
|
76
|
+
parUserName: string;
|
|
77
|
+
coUserName: string;
|
|
78
|
+
isCompliant: boolean;
|
|
79
|
+
note?: string;
|
|
80
|
+
isDefault: boolean;
|
|
81
|
+
totalCommission: string;
|
|
82
|
+
commission24h: string;
|
|
83
|
+
inviteeCnt: string;
|
|
84
|
+
traderCnt: string;
|
|
85
|
+
clickCnt: string;
|
|
86
|
+
totalFee: string;
|
|
87
|
+
cTime: string;
|
|
88
|
+
channelAssessmentStatus: AffiliateChannelAssessmentStatus;
|
|
89
|
+
inviterChannelStatus: AffiliateInviterChannelStatus;
|
|
90
|
+
coInviterChannelStatus: AffiliateCoInviterChannelStatus;
|
|
91
|
+
linkStatus: AffiliateLinkListLinkStatus;
|
|
92
|
+
}
|
|
93
|
+
export interface AffiliateSubAffiliateListItem {
|
|
94
|
+
subAffiliateUid: string;
|
|
95
|
+
country: string;
|
|
96
|
+
joinTime: string;
|
|
97
|
+
subAffiliateLevel: string;
|
|
98
|
+
commissionRate: string;
|
|
99
|
+
isCompliant: boolean;
|
|
100
|
+
inviteeCnt: string;
|
|
101
|
+
traderCnt: string;
|
|
102
|
+
depAmt: string;
|
|
103
|
+
totalVol: string;
|
|
104
|
+
totalFee: string;
|
|
105
|
+
totalCommission: string;
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private-affiliate.js","sourceRoot":"","sources":["../../../../../src/types/rest/response/private-affiliate.ts"],"names":[],"mappings":""}
|
|
@@ -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":""}
|