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