bitget-api 2.0.13 → 2.2.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.
- package/lib/broker-client.d.ts +1 -1
- package/lib/futures-client.d.ts +1 -1
- package/lib/futures-client.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/rest-client-v2.d.ts +537 -233
- package/lib/rest-client-v2.js +258 -234
- package/lib/rest-client-v2.js.map +1 -1
- package/lib/spot-client.d.ts +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/request/index.d.ts +6 -1
- package/lib/types/request/index.js +6 -1
- package/lib/types/request/index.js.map +1 -1
- package/lib/types/request/shared.d.ts +2 -0
- package/lib/types/request/v2/broker.d.ts +69 -0
- package/lib/types/request/v2/broker.js +8 -0
- package/lib/types/request/v2/broker.js.map +1 -0
- package/lib/types/request/v2/common.d.ts +163 -0
- package/lib/types/request/v2/common.js +3 -0
- package/lib/types/request/v2/common.js.map +1 -0
- package/lib/types/request/v2/copytrading.d.ts +196 -0
- package/lib/types/request/v2/copytrading.js +10 -0
- package/lib/types/request/v2/copytrading.js.map +1 -0
- package/lib/types/request/v2/earn.d.ts +121 -0
- package/lib/types/request/v2/earn.js +10 -0
- package/lib/types/request/v2/earn.js.map +1 -0
- package/lib/types/request/v2/futures.d.ts +342 -1
- package/lib/types/request/v2/margin.d.ts +121 -0
- package/lib/types/request/v2/margin.js +8 -0
- package/lib/types/request/v2/margin.js.map +1 -0
- package/lib/types/request/v2/spot.d.ts +256 -0
- package/lib/types/response/index.d.ts +1 -1
- package/lib/types/response/index.js +1 -1
- package/lib/types/response/index.js.map +1 -1
- package/lib/types/shared.d.ts +1 -1
- package/lib/types/websockets/events.d.ts +11 -11
- package/lib/util/BaseRestClient.js.map +1 -1
- package/lib/util/BaseWSClient.d.ts +2 -4
- package/lib/util/BaseWSClient.js +10 -9
- package/lib/util/BaseWSClient.js.map +1 -1
- package/lib/util/WsStore.js.map +1 -1
- package/lib/util/browser-support.js +1 -0
- package/lib/util/browser-support.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/logger.js +1 -0
- package/lib/util/logger.js.map +1 -1
- package/lib/util/node-support.js +1 -0
- package/lib/util/node-support.js.map +1 -1
- package/lib/util/requestUtils.d.ts +1 -1
- package/lib/util/type-guards.js +1 -1
- package/lib/util/websocket-util.js +5 -3
- package/lib/util/websocket-util.js.map +1 -1
- package/lib/websocket-client-v2.js +2 -2
- package/lib/websocket-client-v2.js.map +1 -1
- package/lib/websocket-client.js +11 -10
- package/lib/websocket-client.js.map +1 -1
- package/package.json +7 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
*
|
|
4
|
+
* Earn | Savings
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export interface GetEarnSavingsAssetsRequestV2 {
|
|
9
|
+
periodType: string;
|
|
10
|
+
startTime?: string;
|
|
11
|
+
endTime?: string;
|
|
12
|
+
limit?: string;
|
|
13
|
+
idLessThan?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface GetEarnSavingsRecordsRequestV2 {
|
|
16
|
+
coin?: string;
|
|
17
|
+
periodType: string;
|
|
18
|
+
orderType?: string;
|
|
19
|
+
startTime?: string;
|
|
20
|
+
endTime?: string;
|
|
21
|
+
limit?: string;
|
|
22
|
+
idLessThan?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RedeemSavingsRequestV2 {
|
|
25
|
+
productId: string;
|
|
26
|
+
orderId?: string;
|
|
27
|
+
periodType: string;
|
|
28
|
+
amount: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* Earn | Shark Fin
|
|
34
|
+
*
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export interface GetSharkfinAssetsRequestV2 {
|
|
38
|
+
status: string;
|
|
39
|
+
startTime?: string;
|
|
40
|
+
endTime?: string;
|
|
41
|
+
limit?: string;
|
|
42
|
+
idLessThan?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GetSharkfinRecordsRequestV2 {
|
|
45
|
+
coin?: string;
|
|
46
|
+
type: string;
|
|
47
|
+
startTime?: string;
|
|
48
|
+
endTime?: string;
|
|
49
|
+
limit?: string;
|
|
50
|
+
idLessThan?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* Earn | Loan
|
|
56
|
+
*
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export interface GetLoanEstInterestAndBorrowableRequestV2 {
|
|
60
|
+
loanCoin: string;
|
|
61
|
+
pledgeCoin: string;
|
|
62
|
+
daily: 'SEVEN' | 'THIRTY';
|
|
63
|
+
pledgeAmount?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface BorrowLoanRequestV2 {
|
|
66
|
+
loanCoin: string;
|
|
67
|
+
pledgeCoin: string;
|
|
68
|
+
daily: 'SEVEN' | 'THIRTY';
|
|
69
|
+
pledgeAmount?: string;
|
|
70
|
+
loanAmount?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface RepayLoanRequestV2 {
|
|
73
|
+
orderId: string;
|
|
74
|
+
amount?: string;
|
|
75
|
+
repayUnlock?: string;
|
|
76
|
+
repayAll: string;
|
|
77
|
+
}
|
|
78
|
+
export interface GetLoanRepayHistoryRequestV2 {
|
|
79
|
+
orderId?: string;
|
|
80
|
+
loanCoin?: string;
|
|
81
|
+
pledgeCoin?: string;
|
|
82
|
+
startTime: string;
|
|
83
|
+
endTime: string;
|
|
84
|
+
pageNo?: string;
|
|
85
|
+
pageSize?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface ModifyLoanPledgeRateRequestV2 {
|
|
88
|
+
orderId: string;
|
|
89
|
+
amount: string;
|
|
90
|
+
pledgeCoin: string;
|
|
91
|
+
reviseType: string;
|
|
92
|
+
}
|
|
93
|
+
export interface GetLoanPledgeRateHistoryRequestV2 {
|
|
94
|
+
orderId?: string;
|
|
95
|
+
reviseSide?: string;
|
|
96
|
+
pledgeCoin?: string;
|
|
97
|
+
startTime: string;
|
|
98
|
+
endTime: string;
|
|
99
|
+
pageNo?: string;
|
|
100
|
+
pageSize?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface GetLoanHistoryRequestV2 {
|
|
103
|
+
orderId?: string;
|
|
104
|
+
loanCoin?: string;
|
|
105
|
+
pledgeCoin?: string;
|
|
106
|
+
status?: string;
|
|
107
|
+
startTime: string;
|
|
108
|
+
endTime: string;
|
|
109
|
+
pageNo?: string;
|
|
110
|
+
pageSize?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface GetLiquidationRecordsRequestV2 {
|
|
113
|
+
orderId?: string;
|
|
114
|
+
loanCoin?: string;
|
|
115
|
+
pledgeCoin?: string;
|
|
116
|
+
status?: string;
|
|
117
|
+
startTime: string;
|
|
118
|
+
endTime: string;
|
|
119
|
+
pageNo?: string;
|
|
120
|
+
pageSize?: string;
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"earn.js","sourceRoot":"","sources":["../../../../src/types/request/v2/earn.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { FuturesPlanTypeV2, FuturesProductTypeV2 } from '../shared';
|
|
1
2
|
import { FuturesKlineInterval } from '../v1/futuresV1';
|
|
2
|
-
export declare type FuturesProductTypeV2 = 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES' | 'SUSDT-FUTURES' | 'SCOIN-FUTURES' | 'SUSDC-FUTURES';
|
|
3
3
|
export declare type FuturesKlineTypeV2 = 'MARKET' | 'MARK' | 'INDEX';
|
|
4
4
|
export interface FuturesAccountBillRequestV2 {
|
|
5
5
|
productType: FuturesProductTypeV2;
|
|
@@ -11,6 +11,30 @@ export interface FuturesAccountBillRequestV2 {
|
|
|
11
11
|
endTime?: string;
|
|
12
12
|
limit?: string;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* * Futures | Market
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export interface FuturesMergeDepthRequestV2 {
|
|
20
|
+
symbol: string;
|
|
21
|
+
productType: FuturesProductTypeV2;
|
|
22
|
+
precision?: 'scale0' | 'scale1' | 'scale2' | 'scale3';
|
|
23
|
+
limit?: '1' | '5' | '15' | '50' | 'max';
|
|
24
|
+
}
|
|
25
|
+
export interface FuturesRecentTradesRequestV2 {
|
|
26
|
+
symbol: string;
|
|
27
|
+
productType: FuturesProductTypeV2;
|
|
28
|
+
limit?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface FuturesHistoricTradesRequestV2 {
|
|
31
|
+
symbol: string;
|
|
32
|
+
productType: FuturesProductTypeV2;
|
|
33
|
+
limit?: string;
|
|
34
|
+
idLessThan?: string;
|
|
35
|
+
startTime?: string;
|
|
36
|
+
endTime?: string;
|
|
37
|
+
}
|
|
14
38
|
export interface FuturesCandlesRequestV2 {
|
|
15
39
|
symbol: string;
|
|
16
40
|
productType: FuturesProductTypeV2;
|
|
@@ -20,3 +44,320 @@ export interface FuturesCandlesRequestV2 {
|
|
|
20
44
|
kLineType?: FuturesKlineTypeV2;
|
|
21
45
|
limit?: string;
|
|
22
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* * Futures | Account
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
export interface FuturesSingleAccountRequestV2 {
|
|
53
|
+
symbol: string;
|
|
54
|
+
productType: FuturesProductTypeV2;
|
|
55
|
+
marginCoin: string;
|
|
56
|
+
}
|
|
57
|
+
export interface FuturesInterestHistoryRequestV2 {
|
|
58
|
+
productType: 'USDT-FUTURES' | 'SUSDT-FUTURES';
|
|
59
|
+
coin?: string;
|
|
60
|
+
idLessThan?: string;
|
|
61
|
+
startTime?: string;
|
|
62
|
+
endTime?: string;
|
|
63
|
+
limit?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface FuturesOpenCountRequestV2 {
|
|
66
|
+
symbol: string;
|
|
67
|
+
productType: FuturesProductTypeV2;
|
|
68
|
+
marginCoin: string;
|
|
69
|
+
openAmount: string;
|
|
70
|
+
openPrice: string;
|
|
71
|
+
leverage?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface FuturesSetAutoMarginRequestV2 {
|
|
74
|
+
symbol: string;
|
|
75
|
+
autoMargin: 'on' | 'off';
|
|
76
|
+
marginCoin: string;
|
|
77
|
+
amount: string;
|
|
78
|
+
holdSide?: 'long' | 'short';
|
|
79
|
+
}
|
|
80
|
+
export interface FuturesSetLeverageRequestV2 {
|
|
81
|
+
symbol: string;
|
|
82
|
+
productType: FuturesProductTypeV2;
|
|
83
|
+
marginCoin: string;
|
|
84
|
+
leverage: string;
|
|
85
|
+
holdSide?: 'long' | 'short';
|
|
86
|
+
}
|
|
87
|
+
export interface FuturesSetPositionMarginRequestV2 {
|
|
88
|
+
symbol: string;
|
|
89
|
+
productType: FuturesProductTypeV2;
|
|
90
|
+
marginCoin: string;
|
|
91
|
+
holdSide: 'long' | 'short';
|
|
92
|
+
amount: string;
|
|
93
|
+
}
|
|
94
|
+
export interface FuturesSetMarginModeRequestV2 {
|
|
95
|
+
symbol: string;
|
|
96
|
+
productType: FuturesProductTypeV2;
|
|
97
|
+
marginCoin: string;
|
|
98
|
+
marginMode: 'isolated' | 'crossed';
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* * Futures | Position
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
export interface FuturesHistoricalPositionsRequestV2 {
|
|
106
|
+
symbol?: string;
|
|
107
|
+
productType?: FuturesProductTypeV2;
|
|
108
|
+
idLessThan?: string;
|
|
109
|
+
startTime?: string;
|
|
110
|
+
endTime?: string;
|
|
111
|
+
limit?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* * Futures | Trade
|
|
116
|
+
*
|
|
117
|
+
*/
|
|
118
|
+
export interface FuturesPlaceOrderRequestV2 {
|
|
119
|
+
symbol: string;
|
|
120
|
+
productType: FuturesProductTypeV2;
|
|
121
|
+
marginMode: 'isolated' | 'crossed';
|
|
122
|
+
marginCoin: string;
|
|
123
|
+
size: string;
|
|
124
|
+
price?: string;
|
|
125
|
+
side: 'buy' | 'sell';
|
|
126
|
+
tradeSide?: 'open' | 'close';
|
|
127
|
+
orderType: 'limit' | 'market';
|
|
128
|
+
force?: 'ioc' | 'fok' | 'gtc' | 'post_only';
|
|
129
|
+
clientOid?: string;
|
|
130
|
+
reduceOnly?: 'YES' | 'NO';
|
|
131
|
+
presetStopSurplusPrice?: string;
|
|
132
|
+
presetStopLossPrice?: string;
|
|
133
|
+
stpMode?: 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
|
|
134
|
+
}
|
|
135
|
+
export interface FuturesReversalOrderRequestV2 {
|
|
136
|
+
symbol: string;
|
|
137
|
+
productType: FuturesProductTypeV2;
|
|
138
|
+
marginCoin: string;
|
|
139
|
+
size: string;
|
|
140
|
+
side?: 'buy' | 'sell';
|
|
141
|
+
tradeSide?: 'open' | 'close';
|
|
142
|
+
clientOid?: string;
|
|
143
|
+
}
|
|
144
|
+
interface FuturesBatchOrderItem {
|
|
145
|
+
size: string;
|
|
146
|
+
price?: string;
|
|
147
|
+
side: 'buy' | 'sell';
|
|
148
|
+
tradeSide?: 'open' | 'close';
|
|
149
|
+
orderType: 'limit' | 'market';
|
|
150
|
+
force?: 'ioc' | 'fok' | 'gtc' | 'post_only';
|
|
151
|
+
clientOid?: string;
|
|
152
|
+
reduceOnly?: 'YES' | 'NO';
|
|
153
|
+
presetStopSurplusPrice?: string;
|
|
154
|
+
presetStopLossPrice?: string;
|
|
155
|
+
stpMode?: 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
|
|
156
|
+
}
|
|
157
|
+
export interface FuturesBatchOrderRequestV2 {
|
|
158
|
+
symbol: string;
|
|
159
|
+
productType: FuturesProductTypeV2;
|
|
160
|
+
marginCoin: string;
|
|
161
|
+
marginMode: 'isolated' | 'crossed';
|
|
162
|
+
orderList: FuturesBatchOrderItem[];
|
|
163
|
+
}
|
|
164
|
+
export interface FuturesModifyOrderRequestV2 {
|
|
165
|
+
orderId?: string;
|
|
166
|
+
clientOid?: string;
|
|
167
|
+
symbol: string;
|
|
168
|
+
productType: FuturesProductTypeV2;
|
|
169
|
+
newClientOid: string;
|
|
170
|
+
newSize?: string;
|
|
171
|
+
newPrice?: string;
|
|
172
|
+
newPresetStopSurplusPrice?: string;
|
|
173
|
+
newPresetStopLossPrice?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface FuturesCancelOrderRequestV2 {
|
|
176
|
+
symbol: string;
|
|
177
|
+
productType: FuturesProductTypeV2;
|
|
178
|
+
marginCoin?: string;
|
|
179
|
+
orderId?: string;
|
|
180
|
+
clientOid?: string;
|
|
181
|
+
}
|
|
182
|
+
interface FuturesBatchCancelOrderItem {
|
|
183
|
+
orderId?: string;
|
|
184
|
+
clientOid?: string;
|
|
185
|
+
}
|
|
186
|
+
export interface FuturesBatchCancelOrderRequestV2 {
|
|
187
|
+
orderIdList?: FuturesBatchCancelOrderItem[];
|
|
188
|
+
symbol?: string;
|
|
189
|
+
productType: FuturesProductTypeV2;
|
|
190
|
+
marginCoin?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface FuturesFlashClosePositionsRequestV2 {
|
|
193
|
+
symbol?: string;
|
|
194
|
+
productType: FuturesProductTypeV2;
|
|
195
|
+
holdSide?: 'long' | 'short';
|
|
196
|
+
}
|
|
197
|
+
export interface FuturesGetOrderRequestV2 {
|
|
198
|
+
symbol: string;
|
|
199
|
+
productType: FuturesProductTypeV2;
|
|
200
|
+
orderId?: string;
|
|
201
|
+
clientOid?: string;
|
|
202
|
+
}
|
|
203
|
+
export interface FuturesGetOrderFillsRequestV2 {
|
|
204
|
+
orderId?: string;
|
|
205
|
+
symbol?: string;
|
|
206
|
+
productType: FuturesProductTypeV2;
|
|
207
|
+
idLessThan?: string;
|
|
208
|
+
startTime?: string;
|
|
209
|
+
endTime?: string;
|
|
210
|
+
limit?: string;
|
|
211
|
+
}
|
|
212
|
+
export interface FuturesGetHistoricalFillsRequestV2 {
|
|
213
|
+
orderId?: string;
|
|
214
|
+
symbol?: string;
|
|
215
|
+
productType: FuturesProductTypeV2;
|
|
216
|
+
startTime?: string;
|
|
217
|
+
endTime?: string;
|
|
218
|
+
idLessThan?: string;
|
|
219
|
+
limit?: string;
|
|
220
|
+
}
|
|
221
|
+
export interface FuturesGetOpenOrdersRequestV2 {
|
|
222
|
+
orderId?: string;
|
|
223
|
+
clientOid?: string;
|
|
224
|
+
symbol?: string;
|
|
225
|
+
productType: FuturesProductTypeV2;
|
|
226
|
+
status?: 'live' | 'partially_filled';
|
|
227
|
+
idLessThan?: string;
|
|
228
|
+
startTime?: string;
|
|
229
|
+
endTime?: string;
|
|
230
|
+
limit?: string;
|
|
231
|
+
}
|
|
232
|
+
export declare type FuturesOrderSourceV2 = 'normal' | 'market' | 'profit_market' | 'loss_market' | 'Trader_delegate' | 'trader_profit' | 'trader_loss' | 'reverse' | 'trader_reverse' | 'profit_limit' | 'loss_limit' | 'liquidation' | 'delivery_close_long' | 'delivery_close_short' | 'pos_profit_limit' | 'pos_profit_market' | 'pos_loss_limit' | 'pos_loss_market';
|
|
233
|
+
export interface FuturesGetHistoryOrdersRequestV2 {
|
|
234
|
+
orderId?: string;
|
|
235
|
+
clientOid?: string;
|
|
236
|
+
symbol?: string;
|
|
237
|
+
productType: FuturesProductTypeV2;
|
|
238
|
+
idLessThan?: string;
|
|
239
|
+
orderSource?: FuturesOrderSourceV2;
|
|
240
|
+
startTime?: string;
|
|
241
|
+
endTime?: string;
|
|
242
|
+
limit?: string;
|
|
243
|
+
}
|
|
244
|
+
export interface FuturesCancelAllOrdersRequestV2 {
|
|
245
|
+
symbol?: string;
|
|
246
|
+
productType: FuturesProductTypeV2;
|
|
247
|
+
marginCoin?: string;
|
|
248
|
+
requestTime?: string;
|
|
249
|
+
receiveWindow?: string;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
*
|
|
253
|
+
* * Futures | Trigger Orders
|
|
254
|
+
*
|
|
255
|
+
*/
|
|
256
|
+
export declare type FuturesTriggerTypeV2 = 'fill_price' | 'mark_price';
|
|
257
|
+
export declare type FuturesStpModeV2 = 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
|
|
258
|
+
export interface FuturesTPSLOrderRequestV2 {
|
|
259
|
+
marginCoin: string;
|
|
260
|
+
productType: FuturesProductTypeV2;
|
|
261
|
+
symbol: string;
|
|
262
|
+
planType: FuturesPlanTypeV2;
|
|
263
|
+
triggerPrice: string;
|
|
264
|
+
triggerType?: FuturesTriggerTypeV2;
|
|
265
|
+
executePrice?: string;
|
|
266
|
+
holdSide: 'long' | 'short' | 'buy' | 'sell';
|
|
267
|
+
size: string;
|
|
268
|
+
rangeRate?: string;
|
|
269
|
+
clientOid?: string;
|
|
270
|
+
stpMode?: FuturesStpModeV2;
|
|
271
|
+
}
|
|
272
|
+
export declare type FuturesTriggerPriceTypeV2 = 'fill_price' | 'mark_price' | 'index_price';
|
|
273
|
+
export interface FuturesPlanOrderRequestV2 {
|
|
274
|
+
planType: 'normal_plan' | 'track_plan';
|
|
275
|
+
symbol: string;
|
|
276
|
+
productType: FuturesProductTypeV2;
|
|
277
|
+
marginMode: 'isolated' | 'crossed';
|
|
278
|
+
marginCoin: string;
|
|
279
|
+
size: string;
|
|
280
|
+
price?: string;
|
|
281
|
+
callbackRatio?: string;
|
|
282
|
+
triggerPrice: string;
|
|
283
|
+
triggerType: 'mark_price' | 'fill_price';
|
|
284
|
+
side: 'buy' | 'sell';
|
|
285
|
+
tradeSide?: 'open' | 'close';
|
|
286
|
+
orderType: 'limit' | 'market';
|
|
287
|
+
clientOid?: string;
|
|
288
|
+
reduceOnly?: 'YES' | 'NO';
|
|
289
|
+
stopSurplusTriggerPrice?: string;
|
|
290
|
+
stopSurplusExecutePrice?: string;
|
|
291
|
+
stopSurplusTriggerType?: FuturesTriggerPriceTypeV2;
|
|
292
|
+
stopLossTriggerPrice?: string;
|
|
293
|
+
stopLossExecutePrice?: string;
|
|
294
|
+
stopLossTriggerType?: FuturesTriggerPriceTypeV2;
|
|
295
|
+
stpMode?: FuturesStpModeV2;
|
|
296
|
+
}
|
|
297
|
+
export interface FuturesModifyTPSLOrderRequestV2 {
|
|
298
|
+
orderId?: string;
|
|
299
|
+
clientOid?: string;
|
|
300
|
+
marginCoin: string;
|
|
301
|
+
productType: FuturesProductTypeV2;
|
|
302
|
+
symbol: string;
|
|
303
|
+
triggerPrice: string;
|
|
304
|
+
triggerType?: 'fill_price' | 'mark_price';
|
|
305
|
+
executePrice?: string;
|
|
306
|
+
size: string;
|
|
307
|
+
rangeRate?: string;
|
|
308
|
+
}
|
|
309
|
+
export interface FuturesModifyPlanOrderRequestV2 {
|
|
310
|
+
planType: 'normal_plan' | 'track_plan';
|
|
311
|
+
orderId?: string;
|
|
312
|
+
clientOid?: string;
|
|
313
|
+
symbol: string;
|
|
314
|
+
productType: FuturesProductTypeV2;
|
|
315
|
+
newSize?: string;
|
|
316
|
+
newPrice?: string;
|
|
317
|
+
newCallbackRatio?: string;
|
|
318
|
+
newTriggerPrice?: string;
|
|
319
|
+
newTriggerType?: 'fill_price' | 'mark_price';
|
|
320
|
+
newStopSurplusTriggerPrice?: string;
|
|
321
|
+
newStopSurplusExecutePrice?: string;
|
|
322
|
+
newStopSurplusTriggerType?: FuturesTriggerPriceTypeV2;
|
|
323
|
+
newStopLossTriggerPrice?: string;
|
|
324
|
+
newStopLossExecutePrice?: string;
|
|
325
|
+
newStopLossTriggerType?: FuturesTriggerPriceTypeV2;
|
|
326
|
+
}
|
|
327
|
+
export interface FuturesGetPlanOrdersRequestV2 {
|
|
328
|
+
orderId?: string;
|
|
329
|
+
clientOid?: string;
|
|
330
|
+
symbol?: string;
|
|
331
|
+
planType: 'normal_plan' | 'track_plan' | 'profit_loss';
|
|
332
|
+
productType: FuturesProductTypeV2;
|
|
333
|
+
idLessThan?: string;
|
|
334
|
+
startTime?: string;
|
|
335
|
+
endTime?: string;
|
|
336
|
+
limit?: string;
|
|
337
|
+
}
|
|
338
|
+
interface FuturesCancelPlanOrderItemV2 {
|
|
339
|
+
orderId?: string;
|
|
340
|
+
clientOid?: string;
|
|
341
|
+
}
|
|
342
|
+
export declare type FuturesPlanOrderTypeV2 = 'normal_plan' | 'profit_plan' | 'loss_plan' | 'pos_profit' | 'pos_loss' | 'moving_plan';
|
|
343
|
+
export interface FuturesCancelPlanOrderRequestV2 {
|
|
344
|
+
orderIdList?: FuturesCancelPlanOrderItemV2[];
|
|
345
|
+
symbol?: string;
|
|
346
|
+
productType: FuturesProductTypeV2;
|
|
347
|
+
marginCoin?: string;
|
|
348
|
+
planType?: FuturesPlanOrderTypeV2;
|
|
349
|
+
}
|
|
350
|
+
export declare type FuturesPlanStatusV2 = 'executed' | 'fail_trigger' | 'cancelled';
|
|
351
|
+
export interface FuturesGetHistoryPlanOrdersRequestV2 {
|
|
352
|
+
orderId?: string;
|
|
353
|
+
clientOid?: string;
|
|
354
|
+
planType: 'normal_plan' | 'track_plan' | 'profit_loss';
|
|
355
|
+
planStatus?: FuturesPlanStatusV2;
|
|
356
|
+
symbol?: string;
|
|
357
|
+
productType: FuturesProductTypeV2;
|
|
358
|
+
idLessThan?: string;
|
|
359
|
+
startTime?: string;
|
|
360
|
+
endTime?: string;
|
|
361
|
+
limit?: string;
|
|
362
|
+
}
|
|
363
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* * Margin | Cross/Isolated | Order Record
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export interface GetBorrowHistoryRequestV2 {
|
|
7
|
+
loanId?: string;
|
|
8
|
+
coin?: string;
|
|
9
|
+
startTime: string;
|
|
10
|
+
endTime?: string;
|
|
11
|
+
limit?: string;
|
|
12
|
+
idLessThan?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GetRepayHistoryRequestV2 {
|
|
15
|
+
repayId?: string;
|
|
16
|
+
coin?: string;
|
|
17
|
+
startTime: string;
|
|
18
|
+
endTime?: string;
|
|
19
|
+
limit?: string;
|
|
20
|
+
idLessThan?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GetInterestHistoryRequestV2 {
|
|
23
|
+
coin?: string;
|
|
24
|
+
startTime: string;
|
|
25
|
+
endTime?: string;
|
|
26
|
+
limit?: string;
|
|
27
|
+
idLessThan?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GetLiquidationHistoryRequestV2 {
|
|
30
|
+
startTime: string;
|
|
31
|
+
endTime?: string;
|
|
32
|
+
limit?: string;
|
|
33
|
+
idLessThan?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface GetFinancialHistoryRequestV2 {
|
|
36
|
+
marginType?: string;
|
|
37
|
+
coin?: string;
|
|
38
|
+
startTime: string;
|
|
39
|
+
endTime?: string;
|
|
40
|
+
limit?: string;
|
|
41
|
+
idLessThan?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* * Margin | Cross/Isolated | Account
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* * Margin | Cross/Isolated | Trade
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export declare type MarginOrderTypeV2 = 'limit' | 'market';
|
|
54
|
+
export declare type MarginLoanTypeV2 = 'normal' | 'autoLoan' | 'autoRepay' | 'autoLoanAndRepay';
|
|
55
|
+
export declare type MarginTimeInForceV2 = 'gtc' | 'post_only' | 'fok' | 'ioc';
|
|
56
|
+
export declare type MarginOrderSideV2 = 'buy' | 'sell';
|
|
57
|
+
export declare type MarginSTPModeV2 = 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
|
|
58
|
+
export interface MarginPlaceOrderRequestV2 {
|
|
59
|
+
symbol: string;
|
|
60
|
+
orderType: MarginOrderTypeV2;
|
|
61
|
+
price?: string;
|
|
62
|
+
loanType: MarginLoanTypeV2;
|
|
63
|
+
force: MarginTimeInForceV2;
|
|
64
|
+
baseSize?: string;
|
|
65
|
+
quoteSize?: string;
|
|
66
|
+
clientOid?: string;
|
|
67
|
+
side: MarginOrderSideV2;
|
|
68
|
+
stpMode?: MarginSTPModeV2;
|
|
69
|
+
}
|
|
70
|
+
export interface MarginBatchOrderEntry {
|
|
71
|
+
orderType: MarginOrderTypeV2;
|
|
72
|
+
price?: string;
|
|
73
|
+
loanType: MarginLoanTypeV2;
|
|
74
|
+
force: MarginTimeInForceV2;
|
|
75
|
+
baseSize?: string;
|
|
76
|
+
quoteSize?: string;
|
|
77
|
+
clientOid?: string;
|
|
78
|
+
side: MarginOrderSideV2;
|
|
79
|
+
stpMode?: MarginSTPModeV2;
|
|
80
|
+
}
|
|
81
|
+
export interface MarginBatchOrdersRequestV2 {
|
|
82
|
+
symbol: string;
|
|
83
|
+
orderList: MarginBatchOrderEntry[];
|
|
84
|
+
}
|
|
85
|
+
export interface GetMarginCurrentOrdersRequestV2 {
|
|
86
|
+
symbol: string;
|
|
87
|
+
orderId?: string;
|
|
88
|
+
clientOid?: string;
|
|
89
|
+
startTime: string;
|
|
90
|
+
endTime?: string;
|
|
91
|
+
limit?: string;
|
|
92
|
+
idLessThan?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface GetHistoryOrdersRequestV2 {
|
|
95
|
+
symbol: string;
|
|
96
|
+
orderId?: string;
|
|
97
|
+
enterPointSource?: string;
|
|
98
|
+
clientOid?: string;
|
|
99
|
+
startTime: string;
|
|
100
|
+
endTime?: string;
|
|
101
|
+
limit?: string;
|
|
102
|
+
idLessThan?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface GetMarginOrderFillsRequestV2 {
|
|
105
|
+
symbol: string;
|
|
106
|
+
orderId?: string;
|
|
107
|
+
idLessThan?: string;
|
|
108
|
+
startTime: string;
|
|
109
|
+
endTime?: string;
|
|
110
|
+
limit?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface GetMarginLiquidationOrdersRequestV2 {
|
|
113
|
+
type?: 'swap' | 'place_order';
|
|
114
|
+
symbol?: string;
|
|
115
|
+
fromCoin?: string;
|
|
116
|
+
toCoin?: string;
|
|
117
|
+
startTime?: string;
|
|
118
|
+
endTime?: string;
|
|
119
|
+
limit?: string;
|
|
120
|
+
idLessThan?: string;
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"margin.js","sourceRoot":"","sources":["../../../../src/types/request/v2/margin.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|