kucoin-api 1.0.23 → 2.0.1
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 +3 -3
- package/dist/cjs/FuturesClient.d.ts +411 -117
- package/dist/cjs/FuturesClient.js +381 -113
- package/dist/cjs/FuturesClient.js.map +1 -1
- package/dist/cjs/SpotClient.d.ts +906 -338
- package/dist/cjs/SpotClient.js +926 -364
- package/dist/cjs/SpotClient.js.map +1 -1
- package/dist/cjs/types/request/futures.types.d.ts +68 -16
- package/dist/cjs/types/request/spot-account.d.ts +1 -1
- package/dist/cjs/types/request/spot-funding.d.ts +0 -2
- package/dist/cjs/types/request/spot-trading.d.ts +11 -20
- package/dist/cjs/types/response/futures.types.d.ts +118 -58
- package/dist/cjs/types/response/spot-account.d.ts +76 -28
- package/dist/cjs/types/response/spot-funding.d.ts +34 -32
- package/dist/cjs/types/response/spot-margin-trading.d.ts +80 -15
- package/dist/cjs/types/response/spot-misc.d.ts +1 -1
- package/dist/cjs/types/response/spot-trading.d.ts +100 -74
- package/dist/mjs/FuturesClient.d.ts +411 -117
- package/dist/mjs/FuturesClient.js +381 -113
- package/dist/mjs/FuturesClient.js.map +1 -1
- package/dist/mjs/SpotClient.d.ts +906 -338
- package/dist/mjs/SpotClient.js +926 -364
- package/dist/mjs/SpotClient.js.map +1 -1
- package/dist/mjs/types/request/futures.types.d.ts +68 -16
- package/dist/mjs/types/request/spot-account.d.ts +1 -1
- package/dist/mjs/types/request/spot-funding.d.ts +0 -2
- package/dist/mjs/types/request/spot-trading.d.ts +11 -20
- package/dist/mjs/types/response/futures.types.d.ts +118 -58
- package/dist/mjs/types/response/spot-account.d.ts +76 -28
- package/dist/mjs/types/response/spot-funding.d.ts +34 -32
- package/dist/mjs/types/response/spot-margin-trading.d.ts +80 -15
- package/dist/mjs/types/response/spot-misc.d.ts +1 -1
- package/dist/mjs/types/response/spot-trading.d.ts +100 -74
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { BaseRestClient } from './lib/BaseRestClient.js';
|
|
3
3
|
import { RestClientOptions, RestClientType } from './lib/requestUtils.js';
|
|
4
|
-
import { AccountFillsRequest, BatchCancelOrdersRequest,
|
|
5
|
-
import { AccountBalance, AccountSummary, AddMargin, BatchCancelOrderResult,
|
|
4
|
+
import { AccountFillsRequest, BatchCancelOrdersRequest, CopyTradeOrderRequest, CopyTradeSLTPOrderRequest, GetFundingHistoryRequest, GetFundingRatesRequest, GetInterestRatesRequest, GetKlinesRequest, GetOrdersRequest, GetStopOrdersRequest, GetTransactionsRequest, MaxOpenSizeRequest, Order, SLTPOrder } from './types/request/futures.types.js';
|
|
5
|
+
import { AccountBalance, AccountSummary, AddMargin, BatchCancelOrderResult, CopyTradePosition, FullOrderBookDetail, FuturesAccountFundingRateHistory, FuturesAccountTransaction, FuturesActiveOrder, FuturesClosedPositions, FuturesCurrentFundingRate, FuturesFill, FuturesFills, FuturesHistoricFundingRate, FuturesKline, FuturesMarkPrice, FuturesOrder, FuturesOrders, FuturesPosition, FuturesRiskLimit, FuturesSubAccount, FuturesSymbolInfo, IndexListItem, InterestRateItem, MarketTradeDetail, MaxOpenSize, PremiumIndexItem, SubmitMultipleOrdersFuturesResponse, TickerDetail } from './types/response/futures.types.js';
|
|
6
6
|
import { APISuccessResponse, ServiceStatus } from './types/response/shared.types.js';
|
|
7
7
|
import { WsConnectionInfo } from './types/response/ws.js';
|
|
8
8
|
/**
|
|
@@ -17,57 +17,49 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
generateNewOrderID(): string;
|
|
20
|
-
getServerTime(): Promise<APISuccessResponse<number>>;
|
|
21
|
-
getServiceStatus(): Promise<APISuccessResponse<ServiceStatus>>;
|
|
22
20
|
/**
|
|
23
|
-
*
|
|
21
|
+
*
|
|
22
|
+
* REST - ACCOUNT INFO - Account & Funding
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Get Account - Futures
|
|
27
|
+
* Request via this endpoint to get the info of the futures account.
|
|
28
|
+
*/
|
|
29
|
+
getBalance(params?: {
|
|
30
|
+
currency?: string;
|
|
31
|
+
}): Promise<APISuccessResponse<AccountBalance>>;
|
|
32
|
+
/**
|
|
24
33
|
* Get Account Ledgers - Futures
|
|
34
|
+
* This endpoint can query the ledger records of the futures business line
|
|
25
35
|
*/
|
|
26
36
|
getTransactions(params: GetTransactionsRequest): Promise<APISuccessResponse<{
|
|
27
37
|
hasMore: boolean;
|
|
28
38
|
dataList: FuturesAccountTransaction[];
|
|
29
39
|
}>>;
|
|
30
40
|
/**
|
|
31
|
-
*
|
|
41
|
+
*
|
|
42
|
+
* REST - ACCOUNT INFO - Sub Account
|
|
43
|
+
*
|
|
32
44
|
*/
|
|
33
|
-
getSubAPIs(params: GetSubAPIsRequest): Promise<APISuccessResponse<SubAccountAPI[]>>;
|
|
34
|
-
createSubAPI(params: CreateSubAPIRequest): Promise<APISuccessResponse<CreateSubAccountAPI>>;
|
|
35
|
-
updateSubAPI(params: UpdateSubAPIRequest): Promise<APISuccessResponse<UpdateSubAccountAPI>>;
|
|
36
|
-
deleteSubAPI(params: DeleteSubAPIRequest): Promise<APISuccessResponse<{
|
|
37
|
-
subName: string;
|
|
38
|
-
apiKey: string;
|
|
39
|
-
}>>;
|
|
40
45
|
/**
|
|
41
|
-
*
|
|
46
|
+
* Get SubAccount List - Futures Balance(V2)
|
|
47
|
+
* This endpoint can be used to get Futures sub-account information.
|
|
42
48
|
*/
|
|
43
|
-
getBalance(params?: {
|
|
44
|
-
currency?: string;
|
|
45
|
-
}): Promise<APISuccessResponse<AccountBalance>>;
|
|
46
49
|
getSubBalances(params?: {
|
|
47
50
|
currency?: string;
|
|
48
51
|
}): Promise<APISuccessResponse<{
|
|
49
52
|
summary: AccountSummary;
|
|
50
|
-
accounts:
|
|
53
|
+
accounts: FuturesSubAccount[];
|
|
51
54
|
}>>;
|
|
52
55
|
/**
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* @deprecated This method is deprecated.
|
|
57
|
-
* It is recommended to use the GET /api/v3/accounts/universal-transfer endpoint instead of this endpoint
|
|
58
|
-
*/
|
|
59
|
-
submitTransferOut(params: SubmitTransfer): Promise<Promise<APISuccessResponse<TransferDetail>>>;
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated This method is deprecated.
|
|
62
|
-
* It is recommended to use the GET /api/v3/accounts/universal-transfer endpoint instead of this endpoint
|
|
63
|
-
*/
|
|
64
|
-
submitTransferIn(params: SubmitTransfer): Promise<any>;
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated This method is deprecated.
|
|
56
|
+
*
|
|
57
|
+
* REST - Account Info - Trade Fee
|
|
58
|
+
*
|
|
67
59
|
*/
|
|
68
|
-
getTransfers(params: GetTransfersRequest): Promise<APISuccessResponse<FuturesTransferRecords>>;
|
|
69
60
|
/**
|
|
70
|
-
*
|
|
61
|
+
* Get Actual Fee - Futures
|
|
62
|
+
* This endpoint is for the actual futures fee rate of the trading pair. The fee rate of your sub-account is the same as that of the master account.
|
|
71
63
|
*/
|
|
72
64
|
getTradingPairFee(params: {
|
|
73
65
|
symbol: string;
|
|
@@ -78,143 +70,292 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
78
70
|
}>>;
|
|
79
71
|
/**
|
|
80
72
|
*
|
|
81
|
-
* REST -
|
|
73
|
+
* REST - Futures Trading - Market Data
|
|
82
74
|
*
|
|
83
75
|
*/
|
|
84
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Get Symbol
|
|
78
|
+
* Get information of specified contracts that can be traded.
|
|
79
|
+
* This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.
|
|
80
|
+
*/
|
|
85
81
|
getSymbol(params: {
|
|
86
82
|
symbol: string;
|
|
87
83
|
}): Promise<APISuccessResponse<FuturesSymbolInfo>>;
|
|
84
|
+
/**
|
|
85
|
+
* Get Symbol
|
|
86
|
+
* Get information of specified contracts that can be traded.
|
|
87
|
+
* This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.
|
|
88
|
+
*/
|
|
89
|
+
getSymbols(): Promise<APISuccessResponse<FuturesSymbolInfo[]>>;
|
|
90
|
+
/**
|
|
91
|
+
* Get Ticker
|
|
92
|
+
* This endpoint returns "last traded price/size"、"best bid/ask price/size" etc. of a single symbol.
|
|
93
|
+
*/
|
|
88
94
|
getTicker(params: {
|
|
89
95
|
symbol: string;
|
|
90
96
|
}): Promise<APISuccessResponse<TickerDetail>>;
|
|
97
|
+
/**
|
|
98
|
+
* Get All Tickers
|
|
99
|
+
* This endpoint returns "last traded price/size"、"best bid/ask price/size" etc. of all symbol.
|
|
100
|
+
*/
|
|
91
101
|
getTickers(): Promise<APISuccessResponse<TickerDetail[]>>;
|
|
102
|
+
/**
|
|
103
|
+
* Get Full OrderBook
|
|
104
|
+
* Query for Full orderbook depth data. (aggregated by price)
|
|
105
|
+
*/
|
|
92
106
|
getFullOrderBookLevel2(params: {
|
|
93
107
|
symbol: string;
|
|
94
108
|
}): Promise<APISuccessResponse<FullOrderBookDetail>>;
|
|
109
|
+
/**
|
|
110
|
+
* Get Part OrderBook
|
|
111
|
+
* Query for part orderbook depth data. (aggregated by price)
|
|
112
|
+
*/
|
|
95
113
|
getPartOrderBookLevel2Depth20(params: {
|
|
96
114
|
symbol: string;
|
|
97
115
|
}): Promise<APISuccessResponse<FullOrderBookDetail>>;
|
|
116
|
+
/**
|
|
117
|
+
* Get Part OrderBook
|
|
118
|
+
* Query for part orderbook depth data. (aggregated by price)
|
|
119
|
+
*/
|
|
98
120
|
getPartOrderBookLevel2Depth100(params: {
|
|
99
121
|
symbol: string;
|
|
100
122
|
}): Promise<APISuccessResponse<FullOrderBookDetail>>;
|
|
123
|
+
/**
|
|
124
|
+
* Get Trade History
|
|
125
|
+
* Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.
|
|
126
|
+
*/
|
|
101
127
|
getMarketTrades(params: {
|
|
102
128
|
symbol: string;
|
|
103
129
|
}): Promise<APISuccessResponse<MarketTradeDetail>>;
|
|
130
|
+
/**
|
|
131
|
+
* Get Klines
|
|
132
|
+
* Get the Kline of the symbol. Data are returned in grouped buckets based on requested type.
|
|
133
|
+
*/
|
|
104
134
|
getKlines(params: GetKlinesRequest): Promise<APISuccessResponse<FuturesKline[]>>;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Get Mark Price
|
|
137
|
+
* Get the mark price of the symbol.
|
|
138
|
+
*/
|
|
139
|
+
getMarkPrice(params: {
|
|
140
|
+
symbol: string;
|
|
141
|
+
}): Promise<APISuccessResponse<FuturesMarkPrice>>;
|
|
142
|
+
/**
|
|
143
|
+
* Get Spot Index Price
|
|
144
|
+
* This endpoint returns the index price of the specified symbol.
|
|
145
|
+
*/
|
|
109
146
|
getIndex(params: GetInterestRatesRequest): Promise<APISuccessResponse<{
|
|
110
147
|
dataList: IndexListItem[];
|
|
111
148
|
hasMore: boolean;
|
|
112
149
|
}>>;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Get Interest Rate Index
|
|
152
|
+
* This endpoint returns the interest rate index of the specified symbol.
|
|
153
|
+
*/
|
|
154
|
+
getInterestRates(params: GetInterestRatesRequest): Promise<APISuccessResponse<{
|
|
155
|
+
dataList: InterestRateItem[];
|
|
156
|
+
hasMore: boolean;
|
|
157
|
+
}>>;
|
|
158
|
+
/**
|
|
159
|
+
* Get Premium Index
|
|
160
|
+
* This endpoint returns the premium index of the specified symbol.
|
|
161
|
+
*/
|
|
116
162
|
getPremiumIndex(params: GetInterestRatesRequest): Promise<APISuccessResponse<{
|
|
117
163
|
dataList: PremiumIndexItem[];
|
|
118
164
|
hasMore: boolean;
|
|
119
165
|
}>>;
|
|
166
|
+
/**
|
|
167
|
+
* Get 24hr Stats
|
|
168
|
+
* Get the statistics of the platform futures trading volume in the last 24 hours.
|
|
169
|
+
*/
|
|
120
170
|
get24HourTransactionVolume(): Promise<APISuccessResponse<{
|
|
121
171
|
turnoverOf24h: number;
|
|
122
172
|
}>>;
|
|
173
|
+
/**
|
|
174
|
+
* Get Server Time
|
|
175
|
+
* Get the API server time. This is the Unix timestamp.
|
|
176
|
+
*/
|
|
177
|
+
getServerTime(): Promise<APISuccessResponse<number>>;
|
|
178
|
+
/**
|
|
179
|
+
* Get Service Status
|
|
180
|
+
* This endpoint returns the status of the API service.
|
|
181
|
+
*/
|
|
182
|
+
getServiceStatus(): Promise<APISuccessResponse<ServiceStatus>>;
|
|
123
183
|
/**
|
|
124
184
|
*
|
|
125
|
-
* REST -
|
|
185
|
+
* REST - Futures Trading - Orders
|
|
126
186
|
*
|
|
127
187
|
*/
|
|
188
|
+
/**
|
|
189
|
+
* Add Order
|
|
190
|
+
* Place order to the futures trading system
|
|
191
|
+
*/
|
|
128
192
|
submitOrder(params: Order): Promise<APISuccessResponse<{
|
|
129
193
|
orderId?: string;
|
|
130
194
|
clientOid?: string;
|
|
131
195
|
}>>;
|
|
132
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Add Order Test
|
|
198
|
+
* Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations.
|
|
199
|
+
*/
|
|
200
|
+
submitNewOrderTest(params: Order): Promise<{
|
|
133
201
|
orderId?: string;
|
|
134
202
|
clientOid?: string;
|
|
135
203
|
}>;
|
|
204
|
+
/**
|
|
205
|
+
* Batch Add Orders
|
|
206
|
+
* Place multiple order to the futures trading system
|
|
207
|
+
*/
|
|
208
|
+
submitMultipleOrders(params: Order[]): Promise<APISuccessResponse<SubmitMultipleOrdersFuturesResponse[]>>;
|
|
209
|
+
/**
|
|
210
|
+
* Add Take Profit And Stop Loss Order
|
|
211
|
+
* Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order endpoint.
|
|
212
|
+
*/
|
|
213
|
+
submitSLTPOrder(params: SLTPOrder): Promise<APISuccessResponse<{
|
|
214
|
+
orderId?: string;
|
|
215
|
+
clientOid?: string;
|
|
216
|
+
}>>;
|
|
217
|
+
/**
|
|
218
|
+
* Cancel Order By OrderId
|
|
219
|
+
* Cancel an order (including a stop order).
|
|
220
|
+
*/
|
|
136
221
|
cancelOrderById(params: {
|
|
137
222
|
orderId: string;
|
|
138
223
|
}): Promise<APISuccessResponse<{
|
|
139
224
|
cancelledOrderIds: string[];
|
|
140
225
|
}>>;
|
|
226
|
+
/**
|
|
227
|
+
* Cancel Order By Client Order Id
|
|
228
|
+
* Cancel an order (including a stop order) by client order id.
|
|
229
|
+
*/
|
|
141
230
|
cancelOrderByClientOid(params: {
|
|
142
231
|
clientOid: string;
|
|
232
|
+
symbol: string;
|
|
143
233
|
}): Promise<APISuccessResponse<{
|
|
144
234
|
clientOid: string;
|
|
145
235
|
}>>;
|
|
146
|
-
batchCancelOrders(params: BatchCancelOrdersRequest): Promise<APISuccessResponse<{
|
|
147
|
-
data: BatchCancelOrderResult[];
|
|
148
|
-
}>>;
|
|
149
|
-
submitSLTPOrder(params: SLTPOrder): Promise<APISuccessResponse<{
|
|
150
|
-
orderId?: string;
|
|
151
|
-
clientOid?: string;
|
|
152
|
-
}>>;
|
|
153
|
-
submitMultipleOrders(params: Order[]): Promise<APISuccessResponse<SubmitMultipleOrdersFuturesResponse[]>>;
|
|
154
236
|
/**
|
|
155
|
-
*
|
|
237
|
+
* Batch Cancel Orders
|
|
238
|
+
* Cancel multiple orders.
|
|
239
|
+
*/
|
|
240
|
+
batchCancelOrders(params: BatchCancelOrdersRequest): Promise<APISuccessResponse<BatchCancelOrderResult[]>>;
|
|
241
|
+
/**
|
|
242
|
+
* Cancel All Orders
|
|
243
|
+
* Using this endpoint, all open orders (excluding stop orders) can be canceled in batches.
|
|
156
244
|
*/
|
|
157
|
-
cancelAllOrders(params?: {
|
|
158
|
-
symbol?: string;
|
|
159
|
-
}): Promise<APISuccessResponse<{
|
|
160
|
-
cancelledOrderIds: string[];
|
|
161
|
-
}>>;
|
|
162
245
|
cancelAllOrdersV3(params: {
|
|
163
246
|
symbol: string;
|
|
164
247
|
}): Promise<APISuccessResponse<{
|
|
165
248
|
cancelledOrderIds: string[];
|
|
166
249
|
}>>;
|
|
250
|
+
/**
|
|
251
|
+
* Cancel All Stop orders
|
|
252
|
+
* Using this endpoint, all untriggered stop orders can be canceled in batches.
|
|
253
|
+
*/
|
|
167
254
|
cancelAllStopOrders(params?: {
|
|
168
255
|
symbol?: string;
|
|
169
256
|
}): Promise<APISuccessResponse<{
|
|
170
257
|
cancelledOrderIds: string[];
|
|
171
258
|
}>>;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}): Promise<APISuccessResponse<FuturesOrder[]>>;
|
|
259
|
+
/**
|
|
260
|
+
* Get Order By OrderId
|
|
261
|
+
* Get order details by order id.
|
|
262
|
+
*/
|
|
177
263
|
getOrderByOrderId(params: {
|
|
178
264
|
orderId: string;
|
|
179
265
|
}): Promise<APISuccessResponse<FuturesOrder>>;
|
|
266
|
+
/**
|
|
267
|
+
* Get Order By Client Order Id
|
|
268
|
+
* Get order details by client order id.
|
|
269
|
+
*/
|
|
180
270
|
getOrderByClientOrderId(params: {
|
|
181
271
|
clientOid: string;
|
|
182
272
|
}): Promise<APISuccessResponse<FuturesOrder>>;
|
|
183
273
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
274
|
+
* Get Order List
|
|
275
|
+
* List your current orders. Any limit order on the exchange order book is in active status.
|
|
187
276
|
*/
|
|
277
|
+
getOrders(params?: GetOrdersRequest): Promise<APISuccessResponse<FuturesOrders>>;
|
|
188
278
|
/**
|
|
189
|
-
* Get
|
|
190
|
-
*
|
|
191
|
-
* If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h.
|
|
192
|
-
* The requested data is not real-time.
|
|
279
|
+
* Get Recent Closed Orders
|
|
280
|
+
* Get a list of recent 1000 closed orders in the last 24 hours.
|
|
193
281
|
*/
|
|
194
|
-
|
|
282
|
+
getRecentOrders(params?: {
|
|
283
|
+
symbol?: string;
|
|
284
|
+
}): Promise<APISuccessResponse<FuturesOrder[]>>;
|
|
285
|
+
/**
|
|
286
|
+
* Get Stop Order List
|
|
287
|
+
* Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order endpoint
|
|
288
|
+
*/
|
|
289
|
+
getStopOrders(params?: GetStopOrdersRequest): Promise<APISuccessResponse<FuturesOrders>>;
|
|
195
290
|
/**
|
|
291
|
+
* Get Open Order Value
|
|
292
|
+
* You can query this endpoint to get the the total number and value of the all your active orders.
|
|
293
|
+
*/
|
|
294
|
+
getOpenOrderStatistics(params: {
|
|
295
|
+
symbol: string;
|
|
296
|
+
}): Promise<APISuccessResponse<FuturesActiveOrder>>;
|
|
297
|
+
/**
|
|
298
|
+
* Get Recent Trade History
|
|
196
299
|
* Get a list of recent 1000 fills in the last 24 hours.
|
|
197
|
-
*
|
|
198
|
-
* If you need to get your recent traded order history with low latency, you may query this endpoint.
|
|
199
300
|
*/
|
|
200
301
|
getRecentFills(params?: {
|
|
201
302
|
symbol?: string;
|
|
202
303
|
}): Promise<APISuccessResponse<FuturesFill[]>>;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
304
|
+
/**
|
|
305
|
+
* Get Trade History
|
|
306
|
+
* Get a list of recent fills.
|
|
307
|
+
* If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.
|
|
308
|
+
*/
|
|
309
|
+
getFills(params?: AccountFillsRequest): Promise<APISuccessResponse<FuturesFills>>;
|
|
206
310
|
/**
|
|
207
311
|
*
|
|
208
|
-
* REST -
|
|
312
|
+
* REST - Futures Trading - Positions
|
|
209
313
|
*
|
|
210
314
|
*/
|
|
315
|
+
/**
|
|
316
|
+
* Get Margin Mode
|
|
317
|
+
* This endpoint can query the margin mode of the current symbol.
|
|
318
|
+
*/
|
|
319
|
+
getMarginMode(params: {
|
|
320
|
+
symbol: string;
|
|
321
|
+
}): Promise<APISuccessResponse<{
|
|
322
|
+
symbol: string;
|
|
323
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
324
|
+
}>>;
|
|
325
|
+
/**
|
|
326
|
+
* Switch Margin Mode
|
|
327
|
+
* Modify the margin mode of the current symbol.
|
|
328
|
+
*/
|
|
329
|
+
updateMarginMode(params: {
|
|
330
|
+
symbol: string;
|
|
331
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
332
|
+
}): Promise<APISuccessResponse<{
|
|
333
|
+
symbol: string;
|
|
334
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
335
|
+
}>>;
|
|
336
|
+
/**
|
|
337
|
+
* Get Max Open Size
|
|
338
|
+
* Get Maximum Open Position Size.
|
|
339
|
+
*/
|
|
211
340
|
getMaxOpenSize(params: MaxOpenSizeRequest): Promise<APISuccessResponse<MaxOpenSize>>;
|
|
341
|
+
/**
|
|
342
|
+
* Get Position Details
|
|
343
|
+
* Get the position details of a specified position.
|
|
344
|
+
*/
|
|
212
345
|
getPosition(params: {
|
|
213
346
|
symbol: string;
|
|
214
347
|
}): Promise<APISuccessResponse<FuturesPosition>>;
|
|
348
|
+
/**
|
|
349
|
+
* Get Position List
|
|
350
|
+
* Get the position details of a specified position.
|
|
351
|
+
*/
|
|
215
352
|
getPositions(params?: {
|
|
216
353
|
currency?: string;
|
|
217
354
|
}): Promise<APISuccessResponse<FuturesPosition[]>>;
|
|
355
|
+
/**
|
|
356
|
+
* Get Positions History
|
|
357
|
+
* This endpoint can query position history information records.
|
|
358
|
+
*/
|
|
218
359
|
getHistoryPositions(params?: {
|
|
219
360
|
symbol?: string;
|
|
220
361
|
from?: number;
|
|
@@ -223,49 +364,26 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
223
364
|
pageId?: number;
|
|
224
365
|
}): Promise<APISuccessResponse<FuturesClosedPositions>>;
|
|
225
366
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* It is recommended to switch to the cross margin mode.
|
|
229
|
-
* Please refer to POST /api/v2/position/changeMarginMode endpoint
|
|
367
|
+
* Get Max Withdraw Margin
|
|
368
|
+
* This endpoint can query the maximum amount of margin that the current position supports withdrawal.
|
|
230
369
|
*/
|
|
231
|
-
updateAutoDepositStatus(params: {
|
|
232
|
-
symbol: string;
|
|
233
|
-
status: boolean;
|
|
234
|
-
}): Promise<APISuccessResponse<boolean>>;
|
|
235
370
|
getMaxWithdrawMargin(params: {
|
|
236
371
|
symbol: string;
|
|
237
|
-
}): Promise<APISuccessResponse<
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
sybmol: string;
|
|
243
|
-
withdrawAmount: number;
|
|
244
|
-
}>>;
|
|
245
|
-
depositMargin(params: {
|
|
246
|
-
symbol: string;
|
|
247
|
-
margin: number;
|
|
248
|
-
bizNo: string;
|
|
249
|
-
}): Promise<APISuccessResponse<AddMargin>>;
|
|
250
|
-
getMarginMode(params: {
|
|
251
|
-
symbol: string;
|
|
252
|
-
}): Promise<APISuccessResponse<{
|
|
253
|
-
symbol: string;
|
|
254
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
255
|
-
}>>;
|
|
256
|
-
updateMarginMode(params: {
|
|
257
|
-
symbol: string;
|
|
258
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
259
|
-
}): Promise<APISuccessResponse<{
|
|
260
|
-
symbol: string;
|
|
261
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
262
|
-
}>>;
|
|
372
|
+
}): Promise<APISuccessResponse<string>>;
|
|
373
|
+
/**
|
|
374
|
+
* Get Cross Margin Leverage
|
|
375
|
+
* This endpoint can query the current symbol’s cross-margin leverage multiple.
|
|
376
|
+
*/
|
|
263
377
|
getCrossMarginLeverage(params: {
|
|
264
378
|
symbol: string;
|
|
265
379
|
}): Promise<APISuccessResponse<{
|
|
266
380
|
symbol: string;
|
|
267
381
|
leverage: string;
|
|
268
382
|
}>>;
|
|
383
|
+
/**
|
|
384
|
+
* Modify Cross Margin Leverage
|
|
385
|
+
* This endpoint can modify the current symbol’s cross-margin leverage multiple.
|
|
386
|
+
*/
|
|
269
387
|
changeCrossMarginLeverage(params: {
|
|
270
388
|
symbol: string;
|
|
271
389
|
leverage: string;
|
|
@@ -274,30 +392,171 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
274
392
|
leverage: string;
|
|
275
393
|
}>>;
|
|
276
394
|
/**
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
|
|
395
|
+
* Add Isolated Margin
|
|
396
|
+
* Add Isolated Margin Manually.
|
|
397
|
+
*/
|
|
398
|
+
depositMargin(params: {
|
|
399
|
+
symbol: string;
|
|
400
|
+
margin: number;
|
|
401
|
+
bizNo: string;
|
|
402
|
+
}): Promise<APISuccessResponse<AddMargin>>;
|
|
403
|
+
/**
|
|
404
|
+
* Remove Isolated Margin
|
|
405
|
+
* Remove Isolated Margin Manually.
|
|
406
|
+
*/
|
|
407
|
+
withdrawMargin(params: {
|
|
408
|
+
symbol: string;
|
|
409
|
+
withdrawAmount: string;
|
|
410
|
+
}): Promise<APISuccessResponse<string>>;
|
|
411
|
+
/**
|
|
412
|
+
* Get Isolated Margin Risk Limit
|
|
413
|
+
* This endpoint can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).
|
|
280
414
|
*/
|
|
281
415
|
getRiskLimitLevel(params: {
|
|
282
416
|
symbol: string;
|
|
283
417
|
}): Promise<APISuccessResponse<FuturesRiskLimit[]>>;
|
|
418
|
+
/**
|
|
419
|
+
* Modify Isolated Margin Risk Limit
|
|
420
|
+
* This endpoint is for the adjustment of the risk limit level(Only valid for isolated Margin).
|
|
421
|
+
*/
|
|
284
422
|
updateRiskLimitLevel(params: {
|
|
285
423
|
symbol: string;
|
|
286
424
|
level: number;
|
|
287
|
-
}): Promise<
|
|
425
|
+
}): Promise<boolean>;
|
|
288
426
|
/**
|
|
289
427
|
*
|
|
290
|
-
* REST -
|
|
428
|
+
* REST - Futures Trading - Funding Fees
|
|
291
429
|
*
|
|
292
430
|
*/
|
|
431
|
+
/**
|
|
432
|
+
* Get Current Funding Rate
|
|
433
|
+
* This endpoint can be used to obtain the current funding rate of the specified symbol.
|
|
434
|
+
*/
|
|
293
435
|
getFundingRate(params: {
|
|
294
436
|
symbol: string;
|
|
295
437
|
}): Promise<APISuccessResponse<FuturesCurrentFundingRate>>;
|
|
438
|
+
/**
|
|
439
|
+
* Get Public Funding History
|
|
440
|
+
* Query the funding rate at each settlement time point within a certain time range of the corresponding contract
|
|
441
|
+
*/
|
|
296
442
|
getFundingRates(params: GetFundingRatesRequest): Promise<APISuccessResponse<FuturesHistoricFundingRate[]>>;
|
|
443
|
+
/**
|
|
444
|
+
* Get Private Funding History
|
|
445
|
+
* Submit request to get the funding history.
|
|
446
|
+
*/
|
|
297
447
|
getFundingHistory(params: GetFundingHistoryRequest): Promise<APISuccessResponse<{
|
|
298
448
|
dataList: FuturesAccountFundingRateHistory[];
|
|
299
449
|
hasMore: boolean;
|
|
300
450
|
}>>;
|
|
451
|
+
/**
|
|
452
|
+
*
|
|
453
|
+
* REST - Futures Trading - CopyTrading
|
|
454
|
+
*
|
|
455
|
+
*/
|
|
456
|
+
/**
|
|
457
|
+
* Add Order
|
|
458
|
+
* Place order to the futures trading system for copy trading
|
|
459
|
+
*/
|
|
460
|
+
submitCopyTradeOrder(params: CopyTradeOrderRequest): Promise<APISuccessResponse<{
|
|
461
|
+
orderId: string;
|
|
462
|
+
clientOid: string;
|
|
463
|
+
}>>;
|
|
464
|
+
/**
|
|
465
|
+
* Add Order Test
|
|
466
|
+
* Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint,
|
|
467
|
+
* and can be used to verify whether the signature is correct and other operations.
|
|
468
|
+
*/
|
|
469
|
+
submitCopyTradeOrderTest(params: CopyTradeOrderRequest): Promise<APISuccessResponse<{
|
|
470
|
+
orderId: string;
|
|
471
|
+
clientOid: string;
|
|
472
|
+
}>>;
|
|
473
|
+
/**
|
|
474
|
+
* Add Take Profit And Stop Loss Order
|
|
475
|
+
* Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order endpoint.
|
|
476
|
+
*/
|
|
477
|
+
submitCopyTradeSLTPOrder(params: CopyTradeSLTPOrderRequest): Promise<APISuccessResponse<{
|
|
478
|
+
orderId: string;
|
|
479
|
+
clientOid: string;
|
|
480
|
+
}>>;
|
|
481
|
+
/**
|
|
482
|
+
* Cancel Order By OrderId
|
|
483
|
+
* Cancel an order (including a stop order) in copy trading.
|
|
484
|
+
*/
|
|
485
|
+
cancelCopyTradeOrderById(params: {
|
|
486
|
+
orderId: string;
|
|
487
|
+
}): Promise<APISuccessResponse<{
|
|
488
|
+
cancelledOrderIds: string[];
|
|
489
|
+
}>>;
|
|
490
|
+
/**
|
|
491
|
+
* Cancel Order By Client Order Id
|
|
492
|
+
* Cancel an order (including a stop order) in copy trading by client order id.
|
|
493
|
+
*/
|
|
494
|
+
cancelCopyTradeOrderByClientOid(params: {
|
|
495
|
+
clientOid?: string;
|
|
496
|
+
symbol: string;
|
|
497
|
+
}): Promise<APISuccessResponse<{
|
|
498
|
+
clientOid: string;
|
|
499
|
+
}>>;
|
|
500
|
+
/**
|
|
501
|
+
* Get Max Open Size
|
|
502
|
+
* Get Maximum Open Position Size.
|
|
503
|
+
*/
|
|
504
|
+
getCopyTradeMaxOpenSize(params: {
|
|
505
|
+
symbol: string;
|
|
506
|
+
maxBuyOpenSize: string;
|
|
507
|
+
maxSellOpenSize: string;
|
|
508
|
+
}): Promise<APISuccessResponse<{
|
|
509
|
+
symbol: string;
|
|
510
|
+
price: string;
|
|
511
|
+
leverage: number;
|
|
512
|
+
}>>;
|
|
513
|
+
/**
|
|
514
|
+
* Get Max Withdraw Margin
|
|
515
|
+
* This endpoint can query the maximum amount of margin that the current position supports withdrawal.
|
|
516
|
+
*/
|
|
517
|
+
getCopyTradeMaxWithdrawMargin(params: {
|
|
518
|
+
symbol: string;
|
|
519
|
+
}): Promise<APISuccessResponse<string>>;
|
|
520
|
+
/**
|
|
521
|
+
* Add Isolated Margin
|
|
522
|
+
* Add Isolated Margin Manually.
|
|
523
|
+
*/
|
|
524
|
+
addCopyTradeIsolatedMargin(params: {
|
|
525
|
+
symbol: string;
|
|
526
|
+
margin: number;
|
|
527
|
+
bizNo: string;
|
|
528
|
+
}): Promise<APISuccessResponse<CopyTradePosition>>;
|
|
529
|
+
/**
|
|
530
|
+
* Remove Isolated Margin
|
|
531
|
+
* Remove Isolated Margin Manually.
|
|
532
|
+
*/
|
|
533
|
+
removeCopyTradeIsolatedMargin(params: {
|
|
534
|
+
symbol: string;
|
|
535
|
+
withdrawAmount: string;
|
|
536
|
+
}): Promise<APISuccessResponse<string>>;
|
|
537
|
+
/**
|
|
538
|
+
* Modify Isolated Margin Risk Limit
|
|
539
|
+
* This endpoint is for the adjustment of the risk limit level(Only valid for isolated Margin).
|
|
540
|
+
* To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.
|
|
541
|
+
*/
|
|
542
|
+
modifyCopyTradeRiskLimitLevel(params: {
|
|
543
|
+
symbol: string;
|
|
544
|
+
level: number;
|
|
545
|
+
}): Promise<APISuccessResponse<boolean>>;
|
|
546
|
+
/**
|
|
547
|
+
* Modify Isolated Margin Auto-Deposit Status
|
|
548
|
+
* This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.
|
|
549
|
+
* @deprecated - It is recommended to use cross margin instead
|
|
550
|
+
*/
|
|
551
|
+
updateCopyTradeAutoDepositStatus(params: {
|
|
552
|
+
symbol: string;
|
|
553
|
+
status: boolean;
|
|
554
|
+
}): Promise<APISuccessResponse<boolean>>;
|
|
555
|
+
/**
|
|
556
|
+
*
|
|
557
|
+
* REST - Futures - Broker
|
|
558
|
+
*
|
|
559
|
+
*/
|
|
301
560
|
/**
|
|
302
561
|
* Get download link for broker rebate orders
|
|
303
562
|
*
|
|
@@ -315,4 +574,39 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
315
574
|
*/
|
|
316
575
|
getPublicWSConnectionToken(): Promise<APISuccessResponse<WsConnectionInfo>>;
|
|
317
576
|
getPrivateWSConnectionToken(): Promise<APISuccessResponse<WsConnectionInfo>>;
|
|
577
|
+
/**
|
|
578
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
579
|
+
*/
|
|
580
|
+
submitTransferOut(params: {
|
|
581
|
+
currency: string;
|
|
582
|
+
amount: number;
|
|
583
|
+
recAccountType: 'MAIN' | 'TRADE';
|
|
584
|
+
}): Promise<APISuccessResponse<any>>;
|
|
585
|
+
/**
|
|
586
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
587
|
+
*/
|
|
588
|
+
submitTransferIn(params: {
|
|
589
|
+
currency: string;
|
|
590
|
+
amount: number;
|
|
591
|
+
payAccountType: 'MAIN' | 'TRADE';
|
|
592
|
+
}): Promise<APISuccessResponse<any>>;
|
|
593
|
+
/**
|
|
594
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
595
|
+
*/
|
|
596
|
+
getTransfers(params?: {
|
|
597
|
+
currency?: string;
|
|
598
|
+
type?: 'MAIN' | 'TRADE' | 'MARGIN' | 'ISOLATED';
|
|
599
|
+
tag?: string[];
|
|
600
|
+
startAt?: number;
|
|
601
|
+
endAt?: number;
|
|
602
|
+
currentPage?: number;
|
|
603
|
+
pageSize?: number;
|
|
604
|
+
}): Promise<APISuccessResponse<any>>;
|
|
605
|
+
/**
|
|
606
|
+
* @deprecated - please use updateMarginMode() instead
|
|
607
|
+
*/
|
|
608
|
+
updateAutoDepositStatus(params: {
|
|
609
|
+
symbol: string;
|
|
610
|
+
status: boolean;
|
|
611
|
+
}): Promise<APISuccessResponse<any>>;
|
|
318
612
|
}
|