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
|
@@ -23,269 +23,508 @@ class FuturesClient extends BaseRestClient_js_1.BaseRestClient {
|
|
|
23
23
|
generateNewOrderID() {
|
|
24
24
|
return (0, nanoid_1.nanoid)(32);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* REST - ACCOUNT INFO - Account & Funding
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Get Account - Futures
|
|
33
|
+
* Request via this endpoint to get the info of the futures account.
|
|
34
|
+
*/
|
|
35
|
+
getBalance(params) {
|
|
36
|
+
return this.getPrivate('api/v1/account-overview', params);
|
|
31
37
|
}
|
|
32
38
|
/**
|
|
33
|
-
* REST - ACCOUNT - BASIC INFO
|
|
34
39
|
* Get Account Ledgers - Futures
|
|
40
|
+
* This endpoint can query the ledger records of the futures business line
|
|
35
41
|
*/
|
|
36
42
|
getTransactions(params) {
|
|
37
43
|
return this.getPrivate('api/v1/transaction-history', params);
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
|
-
*
|
|
46
|
+
*
|
|
47
|
+
* REST - ACCOUNT INFO - Sub Account
|
|
48
|
+
*
|
|
41
49
|
*/
|
|
42
|
-
getSubAPIs(params) {
|
|
43
|
-
return this.getPrivate('api/v1/sub/api-key', params);
|
|
44
|
-
}
|
|
45
|
-
createSubAPI(params) {
|
|
46
|
-
return this.postPrivate('api/v1/sub/api-key', params);
|
|
47
|
-
}
|
|
48
|
-
updateSubAPI(params) {
|
|
49
|
-
return this.postPrivate('api/v1/sub/api-key/update', params);
|
|
50
|
-
}
|
|
51
|
-
deleteSubAPI(params) {
|
|
52
|
-
return this.deletePrivate('api/v1/sub/api-key', params);
|
|
53
|
-
}
|
|
54
50
|
/**
|
|
55
|
-
*
|
|
51
|
+
* Get SubAccount List - Futures Balance(V2)
|
|
52
|
+
* This endpoint can be used to get Futures sub-account information.
|
|
56
53
|
*/
|
|
57
|
-
getBalance(params) {
|
|
58
|
-
return this.getPrivate('api/v1/account-overview', params);
|
|
59
|
-
}
|
|
60
54
|
getSubBalances(params) {
|
|
61
55
|
return this.getPrivate('api/v1/account-overview-all', params);
|
|
62
56
|
}
|
|
63
57
|
/**
|
|
64
|
-
*
|
|
58
|
+
*
|
|
59
|
+
* REST - Account Info - Trade Fee
|
|
60
|
+
*
|
|
65
61
|
*/
|
|
66
62
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
63
|
+
* Get Actual Fee - Futures
|
|
64
|
+
* 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.
|
|
69
65
|
*/
|
|
70
|
-
|
|
71
|
-
return this.
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* @deprecated This method is deprecated.
|
|
75
|
-
* It is recommended to use the GET /api/v3/accounts/universal-transfer endpoint instead of this endpoint
|
|
76
|
-
*/
|
|
77
|
-
submitTransferIn(params) {
|
|
78
|
-
return this.postPrivate('api/v1/transfer-in', params);
|
|
66
|
+
getTradingPairFee(params) {
|
|
67
|
+
return this.getPrivate('api/v1/trade-fees', params);
|
|
79
68
|
}
|
|
80
69
|
/**
|
|
81
|
-
*
|
|
70
|
+
*
|
|
71
|
+
* REST - Futures Trading - Market Data
|
|
72
|
+
*
|
|
82
73
|
*/
|
|
83
|
-
getTransfers(params) {
|
|
84
|
-
return this.getPrivate('api/v1/transfer-list', params);
|
|
85
|
-
}
|
|
86
74
|
/**
|
|
87
|
-
*
|
|
75
|
+
* Get Symbol
|
|
76
|
+
* Get information of specified contracts that can be traded.
|
|
77
|
+
* 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
78
|
*/
|
|
89
|
-
|
|
90
|
-
return this.
|
|
79
|
+
getSymbol(params) {
|
|
80
|
+
return this.get(`api/v1/contracts/${params.symbol}`);
|
|
91
81
|
}
|
|
92
82
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
83
|
+
* Get Symbol
|
|
84
|
+
* Get information of specified contracts that can be traded.
|
|
85
|
+
* 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.
|
|
96
86
|
*/
|
|
97
87
|
getSymbols() {
|
|
98
88
|
return this.get('api/v1/contracts/active');
|
|
99
89
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Get Ticker
|
|
92
|
+
* This endpoint returns "last traded price/size"、"best bid/ask price/size" etc. of a single symbol.
|
|
93
|
+
*/
|
|
103
94
|
getTicker(params) {
|
|
104
95
|
return this.get('api/v1/ticker', params);
|
|
105
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Get All Tickers
|
|
99
|
+
* This endpoint returns "last traded price/size"、"best bid/ask price/size" etc. of all symbol.
|
|
100
|
+
*/
|
|
106
101
|
getTickers() {
|
|
107
102
|
return this.get('api/v1/allTickers');
|
|
108
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Get Full OrderBook
|
|
106
|
+
* Query for Full orderbook depth data. (aggregated by price)
|
|
107
|
+
*/
|
|
109
108
|
getFullOrderBookLevel2(params) {
|
|
110
109
|
return this.get('api/v1/level2/snapshot', params);
|
|
111
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Get Part OrderBook
|
|
113
|
+
* Query for part orderbook depth data. (aggregated by price)
|
|
114
|
+
*/
|
|
112
115
|
getPartOrderBookLevel2Depth20(params) {
|
|
113
116
|
return this.get('api/v1/level2/depth20', params);
|
|
114
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Get Part OrderBook
|
|
120
|
+
* Query for part orderbook depth data. (aggregated by price)
|
|
121
|
+
*/
|
|
115
122
|
getPartOrderBookLevel2Depth100(params) {
|
|
116
123
|
return this.get('api/v1/level2/depth100', params);
|
|
117
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Get Trade History
|
|
127
|
+
* Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.
|
|
128
|
+
*/
|
|
118
129
|
getMarketTrades(params) {
|
|
119
130
|
return this.get('api/v1/trade/history', params);
|
|
120
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Get Klines
|
|
134
|
+
* Get the Kline of the symbol. Data are returned in grouped buckets based on requested type.
|
|
135
|
+
*/
|
|
121
136
|
getKlines(params) {
|
|
122
137
|
return this.get('api/v1/kline/query', params);
|
|
123
138
|
}
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Get Mark Price
|
|
141
|
+
* Get the mark price of the symbol.
|
|
142
|
+
*/
|
|
143
|
+
getMarkPrice(params) {
|
|
144
|
+
return this.get(`api/v1/mark-price/${params.symbol}/current`);
|
|
126
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Get Spot Index Price
|
|
148
|
+
* This endpoint returns the index price of the specified symbol.
|
|
149
|
+
*/
|
|
127
150
|
getIndex(params) {
|
|
128
151
|
return this.get('api/v1/index/query', params);
|
|
129
152
|
}
|
|
130
|
-
|
|
131
|
-
|
|
153
|
+
/**
|
|
154
|
+
* Get Interest Rate Index
|
|
155
|
+
* This endpoint returns the interest rate index of the specified symbol.
|
|
156
|
+
*/
|
|
157
|
+
getInterestRates(params) {
|
|
158
|
+
return this.get('api/v1/interest/query', params);
|
|
132
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Get Premium Index
|
|
162
|
+
* This endpoint returns the premium index of the specified symbol.
|
|
163
|
+
*/
|
|
133
164
|
getPremiumIndex(params) {
|
|
134
165
|
return this.get('api/v1/premium/query', params);
|
|
135
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Get 24hr Stats
|
|
169
|
+
* Get the statistics of the platform futures trading volume in the last 24 hours.
|
|
170
|
+
*/
|
|
136
171
|
get24HourTransactionVolume() {
|
|
137
172
|
return this.get('api/v1/trade-statistics');
|
|
138
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Get Server Time
|
|
176
|
+
* Get the API server time. This is the Unix timestamp.
|
|
177
|
+
*/
|
|
178
|
+
getServerTime() {
|
|
179
|
+
return this.get('api/v1/timestamp');
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get Service Status
|
|
183
|
+
* This endpoint returns the status of the API service.
|
|
184
|
+
*/
|
|
185
|
+
getServiceStatus() {
|
|
186
|
+
return this.get('api/v1/status');
|
|
187
|
+
}
|
|
139
188
|
/**
|
|
140
189
|
*
|
|
141
|
-
* REST -
|
|
190
|
+
* REST - Futures Trading - Orders
|
|
142
191
|
*
|
|
143
192
|
*/
|
|
193
|
+
/**
|
|
194
|
+
* Add Order
|
|
195
|
+
* Place order to the futures trading system
|
|
196
|
+
*/
|
|
144
197
|
submitOrder(params) {
|
|
145
198
|
return this.postPrivate('api/v1/orders', params);
|
|
146
199
|
}
|
|
147
|
-
|
|
148
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Add Order Test
|
|
202
|
+
* 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.
|
|
203
|
+
*/
|
|
204
|
+
submitNewOrderTest(params) {
|
|
205
|
+
return this.postPrivate('api/v1/orders/test', params);
|
|
149
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Batch Add Orders
|
|
209
|
+
* Place multiple order to the futures trading system
|
|
210
|
+
*/
|
|
211
|
+
submitMultipleOrders(params) {
|
|
212
|
+
return this.postPrivate('api/v1/orders/multi', params);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Add Take Profit And Stop Loss Order
|
|
216
|
+
* 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.
|
|
217
|
+
*/
|
|
218
|
+
submitSLTPOrder(params) {
|
|
219
|
+
return this.postPrivate('api/v1/st-orders', params);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Cancel Order By OrderId
|
|
223
|
+
* Cancel an order (including a stop order).
|
|
224
|
+
*/
|
|
150
225
|
cancelOrderById(params) {
|
|
151
226
|
return this.deletePrivate(`api/v1/orders/${params.orderId}`);
|
|
152
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Cancel Order By Client Order Id
|
|
230
|
+
* Cancel an order (including a stop order) by client order id.
|
|
231
|
+
*/
|
|
153
232
|
cancelOrderByClientOid(params) {
|
|
154
|
-
|
|
233
|
+
const { clientOid, symbol } = params;
|
|
234
|
+
return this.deletePrivate(`api/v1/orders/client-order/${clientOid}`, {
|
|
235
|
+
symbol,
|
|
236
|
+
});
|
|
155
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Batch Cancel Orders
|
|
240
|
+
* Cancel multiple orders.
|
|
241
|
+
*/
|
|
156
242
|
batchCancelOrders(params) {
|
|
157
243
|
return this.deletePrivate('api/v1/orders/multi-cancel', params);
|
|
158
244
|
}
|
|
159
|
-
submitSLTPOrder(params) {
|
|
160
|
-
return this.postPrivate('api/v1/st-orders', params);
|
|
161
|
-
}
|
|
162
|
-
submitMultipleOrders(params) {
|
|
163
|
-
return this.postPrivate('api/v1/orders/multi', params);
|
|
164
|
-
}
|
|
165
245
|
/**
|
|
166
|
-
*
|
|
246
|
+
* Cancel All Orders
|
|
247
|
+
* Using this endpoint, all open orders (excluding stop orders) can be canceled in batches.
|
|
167
248
|
*/
|
|
168
|
-
cancelAllOrders(params) {
|
|
169
|
-
return this.deletePrivate('api/v1/orders', params);
|
|
170
|
-
}
|
|
171
249
|
cancelAllOrdersV3(params) {
|
|
172
250
|
return this.deletePrivate('api/v3/orders', params);
|
|
173
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Cancel All Stop orders
|
|
254
|
+
* Using this endpoint, all untriggered stop orders can be canceled in batches.
|
|
255
|
+
*/
|
|
174
256
|
cancelAllStopOrders(params) {
|
|
175
257
|
return this.deletePrivate('api/v1/stopOrders', params);
|
|
176
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Get Order By OrderId
|
|
261
|
+
* Get order details by order id.
|
|
262
|
+
*/
|
|
263
|
+
getOrderByOrderId(params) {
|
|
264
|
+
return this.getPrivate(`api/v1/orders/${params.orderId}`);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Get Order By Client Order Id
|
|
268
|
+
* Get order details by client order id.
|
|
269
|
+
*/
|
|
270
|
+
getOrderByClientOrderId(params) {
|
|
271
|
+
return this.getPrivate(`api/v1/orders/byClientOid`, params);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get Order List
|
|
275
|
+
* List your current orders. Any limit order on the exchange order book is in active status.
|
|
276
|
+
*/
|
|
177
277
|
getOrders(params) {
|
|
178
278
|
return this.getPrivate('api/v1/orders', params);
|
|
179
279
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Get Recent Closed Orders
|
|
282
|
+
* Get a list of recent 1000 closed orders in the last 24 hours.
|
|
283
|
+
*/
|
|
183
284
|
getRecentOrders(params) {
|
|
184
285
|
return this.getPrivate('api/v1/recentDoneOrders', params);
|
|
185
286
|
}
|
|
186
|
-
|
|
187
|
-
|
|
287
|
+
/**
|
|
288
|
+
* Get Stop Order List
|
|
289
|
+
* Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order endpoint
|
|
290
|
+
*/
|
|
291
|
+
getStopOrders(params) {
|
|
292
|
+
return this.getPrivate('api/v1/stopOrders', params);
|
|
188
293
|
}
|
|
189
|
-
|
|
190
|
-
|
|
294
|
+
/**
|
|
295
|
+
* Get Open Order Value
|
|
296
|
+
* You can query this endpoint to get the the total number and value of the all your active orders.
|
|
297
|
+
*/
|
|
298
|
+
getOpenOrderStatistics(params) {
|
|
299
|
+
return this.getPrivate('api/v1/openOrderStatistics', params);
|
|
191
300
|
}
|
|
192
301
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
302
|
+
* Get Recent Trade History
|
|
303
|
+
* Get a list of recent 1000 fills in the last 24 hours.
|
|
196
304
|
*/
|
|
305
|
+
getRecentFills(params) {
|
|
306
|
+
return this.getPrivate('api/v1/recentFills', params);
|
|
307
|
+
}
|
|
197
308
|
/**
|
|
309
|
+
* Get Trade History
|
|
198
310
|
* Get a list of recent fills.
|
|
199
|
-
*
|
|
200
|
-
* If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h.
|
|
201
|
-
* The requested data is not real-time.
|
|
311
|
+
* 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.
|
|
202
312
|
*/
|
|
203
313
|
getFills(params) {
|
|
204
314
|
return this.getPrivate('api/v1/fills', params);
|
|
205
315
|
}
|
|
206
316
|
/**
|
|
207
|
-
* Get a list of recent 1000 fills in the last 24 hours.
|
|
208
317
|
*
|
|
209
|
-
*
|
|
318
|
+
* REST - Futures Trading - Positions
|
|
319
|
+
*
|
|
210
320
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
321
|
+
/**
|
|
322
|
+
* Get Margin Mode
|
|
323
|
+
* This endpoint can query the margin mode of the current symbol.
|
|
324
|
+
*/
|
|
325
|
+
getMarginMode(params) {
|
|
326
|
+
return this.getPrivate('api/v2/position/getMarginMode', params);
|
|
213
327
|
}
|
|
214
|
-
|
|
215
|
-
|
|
328
|
+
/**
|
|
329
|
+
* Switch Margin Mode
|
|
330
|
+
* Modify the margin mode of the current symbol.
|
|
331
|
+
*/
|
|
332
|
+
updateMarginMode(params) {
|
|
333
|
+
return this.postPrivate('api/v2/position/changeMarginMode', params);
|
|
216
334
|
}
|
|
217
335
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
336
|
+
* Get Max Open Size
|
|
337
|
+
* Get Maximum Open Position Size.
|
|
221
338
|
*/
|
|
222
339
|
getMaxOpenSize(params) {
|
|
223
340
|
return this.getPrivate('api/v2/getMaxOpenSize', params);
|
|
224
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Get Position Details
|
|
344
|
+
* Get the position details of a specified position.
|
|
345
|
+
*/
|
|
225
346
|
getPosition(params) {
|
|
226
347
|
return this.getPrivate('api/v1/position', params);
|
|
227
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Get Position List
|
|
351
|
+
* Get the position details of a specified position.
|
|
352
|
+
*/
|
|
228
353
|
getPositions(params) {
|
|
229
354
|
return this.getPrivate('api/v1/positions', params);
|
|
230
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Get Positions History
|
|
358
|
+
* This endpoint can query position history information records.
|
|
359
|
+
*/
|
|
231
360
|
getHistoryPositions(params) {
|
|
232
361
|
return this.getPrivate('api/v1/history-positions', params);
|
|
233
362
|
}
|
|
234
363
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* It is recommended to switch to the cross margin mode.
|
|
238
|
-
* Please refer to POST /api/v2/position/changeMarginMode endpoint
|
|
364
|
+
* Get Max Withdraw Margin
|
|
365
|
+
* This endpoint can query the maximum amount of margin that the current position supports withdrawal.
|
|
239
366
|
*/
|
|
240
|
-
updateAutoDepositStatus(params) {
|
|
241
|
-
return this.postPrivate('api/v1/position/margin/auto-deposit-status', params);
|
|
242
|
-
}
|
|
243
367
|
getMaxWithdrawMargin(params) {
|
|
244
368
|
return this.getPrivate('api/v1/margin/maxWithdrawMargin', params);
|
|
245
369
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return this.postPrivate('api/v1/position/margin/deposit-margin', params);
|
|
251
|
-
}
|
|
252
|
-
getMarginMode(params) {
|
|
253
|
-
return this.getPrivate('api/v2/position/getMarginMode', params);
|
|
254
|
-
}
|
|
255
|
-
updateMarginMode(params) {
|
|
256
|
-
return this.postPrivate('api/v2/position/changeMarginMode', params);
|
|
257
|
-
}
|
|
370
|
+
/**
|
|
371
|
+
* Get Cross Margin Leverage
|
|
372
|
+
* This endpoint can query the current symbol’s cross-margin leverage multiple.
|
|
373
|
+
*/
|
|
258
374
|
getCrossMarginLeverage(params) {
|
|
259
375
|
return this.getPrivate('api/v2/getCrossUserLeverage', params);
|
|
260
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Modify Cross Margin Leverage
|
|
379
|
+
* This endpoint can modify the current symbol’s cross-margin leverage multiple.
|
|
380
|
+
*/
|
|
261
381
|
changeCrossMarginLeverage(params) {
|
|
262
382
|
return this.postPrivate('api/v2/changeCrossUserLeverage', params);
|
|
263
383
|
}
|
|
264
384
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
|
|
385
|
+
* Add Isolated Margin
|
|
386
|
+
* Add Isolated Margin Manually.
|
|
387
|
+
*/
|
|
388
|
+
depositMargin(params) {
|
|
389
|
+
return this.postPrivate('api/v1/position/margin/deposit-margin', params);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Remove Isolated Margin
|
|
393
|
+
* Remove Isolated Margin Manually.
|
|
394
|
+
*/
|
|
395
|
+
withdrawMargin(params) {
|
|
396
|
+
return this.postPrivate('api/v1/margin/withdrawMargin', params);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Get Isolated Margin Risk Limit
|
|
400
|
+
* This endpoint can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).
|
|
268
401
|
*/
|
|
269
402
|
getRiskLimitLevel(params) {
|
|
270
403
|
return this.getPrivate(`api/v1/contracts/risk-limit/${params.symbol}`);
|
|
271
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Modify Isolated Margin Risk Limit
|
|
407
|
+
* This endpoint is for the adjustment of the risk limit level(Only valid for isolated Margin).
|
|
408
|
+
*/
|
|
272
409
|
updateRiskLimitLevel(params) {
|
|
273
410
|
return this.postPrivate('api/v1/position/risk-limit-level/change', params);
|
|
274
411
|
}
|
|
275
412
|
/**
|
|
276
413
|
*
|
|
277
|
-
* REST -
|
|
414
|
+
* REST - Futures Trading - Funding Fees
|
|
278
415
|
*
|
|
279
416
|
*/
|
|
417
|
+
/**
|
|
418
|
+
* Get Current Funding Rate
|
|
419
|
+
* This endpoint can be used to obtain the current funding rate of the specified symbol.
|
|
420
|
+
*/
|
|
280
421
|
getFundingRate(params) {
|
|
281
|
-
return this.
|
|
422
|
+
return this.getPrivate(`api/v1/funding-rate/${params.symbol}/current`);
|
|
282
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* Get Public Funding History
|
|
426
|
+
* Query the funding rate at each settlement time point within a certain time range of the corresponding contract
|
|
427
|
+
*/
|
|
283
428
|
getFundingRates(params) {
|
|
284
|
-
return this.
|
|
429
|
+
return this.getPrivate('api/v1/contract/funding-rates', params);
|
|
285
430
|
}
|
|
431
|
+
/**
|
|
432
|
+
* Get Private Funding History
|
|
433
|
+
* Submit request to get the funding history.
|
|
434
|
+
*/
|
|
286
435
|
getFundingHistory(params) {
|
|
287
436
|
return this.getPrivate('api/v1/funding-history', params);
|
|
288
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
*
|
|
440
|
+
* REST - Futures Trading - CopyTrading
|
|
441
|
+
*
|
|
442
|
+
*/
|
|
443
|
+
/**
|
|
444
|
+
* Add Order
|
|
445
|
+
* Place order to the futures trading system for copy trading
|
|
446
|
+
*/
|
|
447
|
+
submitCopyTradeOrder(params) {
|
|
448
|
+
return this.postPrivate('api/v1/copy-trade/futures/orders', params);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Add Order Test
|
|
452
|
+
* Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint,
|
|
453
|
+
* and can be used to verify whether the signature is correct and other operations.
|
|
454
|
+
*/
|
|
455
|
+
submitCopyTradeOrderTest(params) {
|
|
456
|
+
return this.postPrivate('api/v1/copy-trade/futures/orders/test', params);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Add Take Profit And Stop Loss Order
|
|
460
|
+
* 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.
|
|
461
|
+
*/
|
|
462
|
+
submitCopyTradeSLTPOrder(params) {
|
|
463
|
+
return this.postPrivate('api/v1/copy-trade/futures/st-orders', params);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Cancel Order By OrderId
|
|
467
|
+
* Cancel an order (including a stop order) in copy trading.
|
|
468
|
+
*/
|
|
469
|
+
cancelCopyTradeOrderById(params) {
|
|
470
|
+
return this.deletePrivate('api/v1/copy-trade/futures/orders', params);
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Cancel Order By Client Order Id
|
|
474
|
+
* Cancel an order (including a stop order) in copy trading by client order id.
|
|
475
|
+
*/
|
|
476
|
+
cancelCopyTradeOrderByClientOid(params) {
|
|
477
|
+
return this.deletePrivate(`api/v1/copy-trade/futures/orders/client-order`, params);
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Get Max Open Size
|
|
481
|
+
* Get Maximum Open Position Size.
|
|
482
|
+
*/
|
|
483
|
+
getCopyTradeMaxOpenSize(params) {
|
|
484
|
+
return this.getPrivate('api/v1/copy-trade/futures/get-max-open-size', params);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Get Max Withdraw Margin
|
|
488
|
+
* This endpoint can query the maximum amount of margin that the current position supports withdrawal.
|
|
489
|
+
*/
|
|
490
|
+
getCopyTradeMaxWithdrawMargin(params) {
|
|
491
|
+
return this.getPrivate('api/v1/copy-trade/futures/position/margin/max-withdraw-margin', params);
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Add Isolated Margin
|
|
495
|
+
* Add Isolated Margin Manually.
|
|
496
|
+
*/
|
|
497
|
+
addCopyTradeIsolatedMargin(params) {
|
|
498
|
+
return this.postPrivate('api/v1/copy-trade/futures/position/margin/deposit-margin', params);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Remove Isolated Margin
|
|
502
|
+
* Remove Isolated Margin Manually.
|
|
503
|
+
*/
|
|
504
|
+
removeCopyTradeIsolatedMargin(params) {
|
|
505
|
+
return this.postPrivate('api/v1/copy-trade/futures/position/margin/withdraw-margin', params);
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Modify Isolated Margin Risk Limit
|
|
509
|
+
* This endpoint is for the adjustment of the risk limit level(Only valid for isolated Margin).
|
|
510
|
+
* 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.
|
|
511
|
+
*/
|
|
512
|
+
modifyCopyTradeRiskLimitLevel(params) {
|
|
513
|
+
return this.postPrivate('api/v1/copy-trade/futures/position/risk-limit-level/change', params);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Modify Isolated Margin Auto-Deposit Status
|
|
517
|
+
* This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.
|
|
518
|
+
* @deprecated - It is recommended to use cross margin instead
|
|
519
|
+
*/
|
|
520
|
+
updateCopyTradeAutoDepositStatus(params) {
|
|
521
|
+
return this.postPrivate('api/v1/copy-trade/futures/position/margin/auto-deposit-status', params);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
*
|
|
525
|
+
* REST - Futures - Broker
|
|
526
|
+
*
|
|
527
|
+
*/
|
|
289
528
|
/**
|
|
290
529
|
* Get download link for broker rebate orders
|
|
291
530
|
*
|
|
@@ -305,6 +544,35 @@ class FuturesClient extends BaseRestClient_js_1.BaseRestClient {
|
|
|
305
544
|
getPrivateWSConnectionToken() {
|
|
306
545
|
return this.postPrivate('api/v1/bullet-private');
|
|
307
546
|
}
|
|
547
|
+
/*
|
|
548
|
+
*
|
|
549
|
+
* DEPRECATED
|
|
550
|
+
*
|
|
551
|
+
*/
|
|
552
|
+
/**
|
|
553
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
554
|
+
*/
|
|
555
|
+
submitTransferOut(params) {
|
|
556
|
+
return this.postPrivate('api/v3/transfer-out', params);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
560
|
+
*/
|
|
561
|
+
submitTransferIn(params) {
|
|
562
|
+
return this.postPrivate('api/v1/transfer-in', params);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
566
|
+
*/
|
|
567
|
+
getTransfers(params) {
|
|
568
|
+
return this.getPrivate('api/v1/transfer-list', params);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* @deprecated - please use updateMarginMode() instead
|
|
572
|
+
*/
|
|
573
|
+
updateAutoDepositStatus(params) {
|
|
574
|
+
return this.postPrivate('api/v1/position/margin/auto-deposit-status', params);
|
|
575
|
+
}
|
|
308
576
|
}
|
|
309
577
|
exports.FuturesClient = FuturesClient;
|
|
310
578
|
//# sourceMappingURL=FuturesClient.js.map
|