kucoin-api 1.0.23 → 2.0.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/README.md +3 -3
- package/dist/cjs/FuturesClient.d.ts +300 -111
- package/dist/cjs/FuturesClient.js +286 -110
- package/dist/cjs/FuturesClient.js.map +1 -1
- package/dist/cjs/SpotClient.d.ts +879 -306
- package/dist/cjs/SpotClient.js +900 -338
- package/dist/cjs/SpotClient.js.map +1 -1
- package/dist/mjs/FuturesClient.d.ts +300 -111
- package/dist/mjs/FuturesClient.js +286 -110
- package/dist/mjs/FuturesClient.js.map +1 -1
- package/dist/mjs/SpotClient.d.ts +879 -306
- package/dist/mjs/SpotClient.js +900 -338
- package/dist/mjs/SpotClient.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,266 +23,412 @@ 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 interface 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
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* @deprecated This method is deprecated.
|
|
68
|
-
* It is recommended to use the GET /api/v3/accounts/universal-transfer endpoint instead of this endpoint
|
|
58
|
+
*
|
|
59
|
+
* REST - Account Info - Trade Fee
|
|
60
|
+
*
|
|
69
61
|
*/
|
|
70
|
-
submitTransferOut(params) {
|
|
71
|
-
return this.postPrivate('api/v3/transfer-out', params);
|
|
72
|
-
}
|
|
73
62
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
63
|
+
* Get Actual Fee - Futures
|
|
64
|
+
* This interface 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.
|
|
76
65
|
*/
|
|
77
|
-
|
|
78
|
-
return this.
|
|
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);
|
|
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);
|
|
149
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 interface.
|
|
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
|
return this.deletePrivate(`api/v1/orders/client-order/${params.clientOid}`);
|
|
155
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Batch Cancel Orders
|
|
237
|
+
* Cancel multiple orders.
|
|
238
|
+
*/
|
|
156
239
|
batchCancelOrders(params) {
|
|
157
240
|
return this.deletePrivate('api/v1/orders/multi-cancel', params);
|
|
158
241
|
}
|
|
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
242
|
/**
|
|
166
|
-
*
|
|
243
|
+
* Cancel All Orders
|
|
244
|
+
* Using this endpoint, all open orders (excluding stop orders) can be canceled in batches.
|
|
167
245
|
*/
|
|
168
|
-
cancelAllOrders(params) {
|
|
169
|
-
return this.deletePrivate('api/v1/orders', params);
|
|
170
|
-
}
|
|
171
246
|
cancelAllOrdersV3(params) {
|
|
172
247
|
return this.deletePrivate('api/v3/orders', params);
|
|
173
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Cancel All Stop orders
|
|
251
|
+
* Using this endpoint, all untriggered stop orders can be canceled in batches.
|
|
252
|
+
*/
|
|
174
253
|
cancelAllStopOrders(params) {
|
|
175
254
|
return this.deletePrivate('api/v1/stopOrders', params);
|
|
176
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Get Order By OrderId
|
|
258
|
+
* Get order details by order id.
|
|
259
|
+
*/
|
|
260
|
+
getOrderByOrderId(params) {
|
|
261
|
+
return this.getPrivate(`api/v1/orders/${params.orderId}`);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Get Order By Client Order Id
|
|
265
|
+
* Get order details by client order id.
|
|
266
|
+
*/
|
|
267
|
+
getOrderByClientOrderId(params) {
|
|
268
|
+
return this.getPrivate(`api/v1/orders/byClientOid`, params);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Get Order List
|
|
272
|
+
* List your current orders. Any limit order on the exchange order book is in active status.
|
|
273
|
+
*/
|
|
177
274
|
getOrders(params) {
|
|
178
275
|
return this.getPrivate('api/v1/orders', params);
|
|
179
276
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Get Recent Closed Orders
|
|
279
|
+
* Get a list of recent 1000 closed orders in the last 24 hours.
|
|
280
|
+
*/
|
|
183
281
|
getRecentOrders(params) {
|
|
184
282
|
return this.getPrivate('api/v1/recentDoneOrders', params);
|
|
185
283
|
}
|
|
186
|
-
|
|
187
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Get Stop Order List
|
|
286
|
+
* Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface
|
|
287
|
+
*/
|
|
288
|
+
getStopOrders(params) {
|
|
289
|
+
return this.getPrivate('api/v1/stopOrders', params);
|
|
188
290
|
}
|
|
189
|
-
|
|
190
|
-
|
|
291
|
+
/**
|
|
292
|
+
* Get Open Order Value
|
|
293
|
+
* You can query this endpoint to get the the total number and value of the all your active orders.
|
|
294
|
+
*/
|
|
295
|
+
getOpenOrderStatistics(params) {
|
|
296
|
+
return this.getPrivate('api/v1/openOrderStatistics', params);
|
|
191
297
|
}
|
|
192
298
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
299
|
+
* Get Recent Trade History
|
|
300
|
+
* Get a list of recent 1000 fills in the last 24 hours.
|
|
196
301
|
*/
|
|
302
|
+
getRecentFills(params) {
|
|
303
|
+
return this.getPrivate('api/v1/recentFills', params);
|
|
304
|
+
}
|
|
197
305
|
/**
|
|
306
|
+
* Get Trade History
|
|
198
307
|
* 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.
|
|
308
|
+
* 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
309
|
*/
|
|
203
310
|
getFills(params) {
|
|
204
311
|
return this.getPrivate('api/v1/fills', params);
|
|
205
312
|
}
|
|
206
313
|
/**
|
|
207
|
-
* Get a list of recent 1000 fills in the last 24 hours.
|
|
208
314
|
*
|
|
209
|
-
*
|
|
315
|
+
* REST - Futures Trading - Positions
|
|
316
|
+
*
|
|
210
317
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
318
|
+
/**
|
|
319
|
+
* Get Margin Mode
|
|
320
|
+
* This interface can query the margin mode of the current symbol.
|
|
321
|
+
*/
|
|
322
|
+
getMarginMode(params) {
|
|
323
|
+
return this.getPrivate('api/v2/position/getMarginMode', params);
|
|
213
324
|
}
|
|
214
|
-
|
|
215
|
-
|
|
325
|
+
/**
|
|
326
|
+
* Switch Margin Mode
|
|
327
|
+
* Modify the margin mode of the current symbol.
|
|
328
|
+
*/
|
|
329
|
+
updateMarginMode(params) {
|
|
330
|
+
return this.postPrivate('api/v2/position/changeMarginMode', params);
|
|
216
331
|
}
|
|
217
332
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
333
|
+
* Get Max Open Size
|
|
334
|
+
* Get Maximum Open Position Size.
|
|
221
335
|
*/
|
|
222
336
|
getMaxOpenSize(params) {
|
|
223
337
|
return this.getPrivate('api/v2/getMaxOpenSize', params);
|
|
224
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* Get Position Details
|
|
341
|
+
* Get the position details of a specified position.
|
|
342
|
+
*/
|
|
225
343
|
getPosition(params) {
|
|
226
344
|
return this.getPrivate('api/v1/position', params);
|
|
227
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* Get Position List
|
|
348
|
+
* Get the position details of a specified position.
|
|
349
|
+
*/
|
|
228
350
|
getPositions(params) {
|
|
229
351
|
return this.getPrivate('api/v1/positions', params);
|
|
230
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Get Positions History
|
|
355
|
+
* This interface can query position history information records.
|
|
356
|
+
*/
|
|
231
357
|
getHistoryPositions(params) {
|
|
232
358
|
return this.getPrivate('api/v1/history-positions', params);
|
|
233
359
|
}
|
|
234
360
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* It is recommended to switch to the cross margin mode.
|
|
238
|
-
* Please refer to POST /api/v2/position/changeMarginMode endpoint
|
|
361
|
+
* Get Max Withdraw Margin
|
|
362
|
+
* This interface can query the maximum amount of margin that the current position supports withdrawal.
|
|
239
363
|
*/
|
|
240
|
-
updateAutoDepositStatus(params) {
|
|
241
|
-
return this.postPrivate('api/v1/position/margin/auto-deposit-status', params);
|
|
242
|
-
}
|
|
243
364
|
getMaxWithdrawMargin(params) {
|
|
244
365
|
return this.getPrivate('api/v1/margin/maxWithdrawMargin', params);
|
|
245
366
|
}
|
|
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
|
-
}
|
|
367
|
+
/**
|
|
368
|
+
* Get Cross Margin Leverage
|
|
369
|
+
* This interface can query the current symbol’s cross-margin leverage multiple.
|
|
370
|
+
*/
|
|
258
371
|
getCrossMarginLeverage(params) {
|
|
259
372
|
return this.getPrivate('api/v2/getCrossUserLeverage', params);
|
|
260
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* Modify Cross Margin Leverage
|
|
376
|
+
* This interface can modify the current symbol’s cross-margin leverage multiple.
|
|
377
|
+
*/
|
|
261
378
|
changeCrossMarginLeverage(params) {
|
|
262
379
|
return this.postPrivate('api/v2/changeCrossUserLeverage', params);
|
|
263
380
|
}
|
|
264
381
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
|
|
382
|
+
* Add Isolated Margin
|
|
383
|
+
* Add Isolated Margin Manually.
|
|
384
|
+
*/
|
|
385
|
+
depositMargin(params) {
|
|
386
|
+
return this.postPrivate('api/v1/position/margin/deposit-margin', params);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Remove Isolated Margin
|
|
390
|
+
* Remove Isolated Margin Manually.
|
|
391
|
+
*/
|
|
392
|
+
withdrawMargin(params) {
|
|
393
|
+
return this.postPrivate('api/v1/margin/withdrawMargin', params);
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Get Isolated Margin Risk Limit
|
|
397
|
+
* This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).
|
|
268
398
|
*/
|
|
269
399
|
getRiskLimitLevel(params) {
|
|
270
400
|
return this.getPrivate(`api/v1/contracts/risk-limit/${params.symbol}`);
|
|
271
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Modify Isolated Margin Risk Limit
|
|
404
|
+
* This interface is for the adjustment of the risk limit level(Only valid for isolated Margin).
|
|
405
|
+
*/
|
|
272
406
|
updateRiskLimitLevel(params) {
|
|
273
407
|
return this.postPrivate('api/v1/position/risk-limit-level/change', params);
|
|
274
408
|
}
|
|
275
409
|
/**
|
|
276
410
|
*
|
|
277
|
-
* REST -
|
|
411
|
+
* REST - Futures Trading - Funding Fees
|
|
278
412
|
*
|
|
279
413
|
*/
|
|
414
|
+
/**
|
|
415
|
+
* Get Current Funding Rate
|
|
416
|
+
* This interface can be used to obtain the current funding rate of the specified symbol.
|
|
417
|
+
*/
|
|
280
418
|
getFundingRate(params) {
|
|
281
419
|
return this.get(`api/v1/funding-rate/${params.symbol}/current`);
|
|
282
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* Get Public Funding History
|
|
423
|
+
* Query the funding rate at each settlement time point within a certain time range of the corresponding contract
|
|
424
|
+
*/
|
|
283
425
|
getFundingRates(params) {
|
|
284
426
|
return this.get('api/v1/contract/funding-rates', params);
|
|
285
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* Get Private Funding History
|
|
430
|
+
* Submit request to get the funding history.
|
|
431
|
+
*/
|
|
286
432
|
getFundingHistory(params) {
|
|
287
433
|
return this.getPrivate('api/v1/funding-history', params);
|
|
288
434
|
}
|
|
@@ -305,6 +451,36 @@ class FuturesClient extends BaseRestClient_js_1.BaseRestClient {
|
|
|
305
451
|
getPrivateWSConnectionToken() {
|
|
306
452
|
return this.postPrivate('api/v1/bullet-private');
|
|
307
453
|
}
|
|
454
|
+
/*
|
|
455
|
+
*
|
|
456
|
+
* DEPRECATED
|
|
457
|
+
*
|
|
458
|
+
*/
|
|
459
|
+
/**
|
|
460
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
461
|
+
*/
|
|
462
|
+
submitTransferOut(params) {
|
|
463
|
+
return this.postPrivate('api/v3/transfer-out', params);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
467
|
+
*/
|
|
468
|
+
submitTransferIn(params) {
|
|
469
|
+
return this.postPrivate('api/v1/transfer-in', params);
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
473
|
+
*/
|
|
474
|
+
getTransfers(params) {
|
|
475
|
+
return this.getPrivate('api/v1/transfer-list', params);
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* @deprecated - please use updateMarginMode() instead
|
|
479
|
+
*/
|
|
480
|
+
updateAutoDepositStatus(params) {
|
|
481
|
+
console.warn('WARNING: This method is deprecated. It is recommended to use cross margin mode instead.');
|
|
482
|
+
return this.postPrivate('api/v1/position/margin/auto-deposit-status', params);
|
|
483
|
+
}
|
|
308
484
|
}
|
|
309
485
|
exports.FuturesClient = FuturesClient;
|
|
310
486
|
//# sourceMappingURL=FuturesClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FuturesClient.js","sourceRoot":"","sources":["../../src/FuturesClient.ts"],"names":[],"mappings":";;;AACA,mCAAgC;AAEhC,+DAAyD;AACzD,2DAI+B;
|
|
1
|
+
{"version":3,"file":"FuturesClient.js","sourceRoot":"","sources":["../../src/FuturesClient.ts"],"names":[],"mappings":";;;AACA,mCAAgC;AAEhC,+DAAyD;AACzD,2DAI+B;AAmD/B;;GAEG;AACH,MAAa,aAAc,SAAQ,kCAAc;IAC/C,YACE,oBAAuC,EAAE,EACzC,iBAAqC,EAAE;QAEvC,KAAK,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa;QACX,OAAO,uCAAqB,CAAC,OAAO,CAAC;IACvC,CAAC;IAED;;;;OAIG;IAEH,kBAAkB;QAChB,OAAO,IAAA,eAAM,EAAC,EAAE,C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