kucoin-api 1.0.22 → 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.
@@ -73,679 +73,1073 @@ export class SpotClient extends BaseRestClient {
73
73
  getServiceStatus() {
74
74
  return this.get('api/v1/status');
75
75
  }
76
- getAnnouncements(params) {
77
- return this.get('api/v3/announcements', params);
78
- }
79
76
  /**
80
77
  *
81
- * REST - ACCOUNT - Basic Info
78
+ * REST - Account Info - Account & Funding
79
+ *
80
+ */
81
+ /**
82
+ * Get Account Summary Info
82
83
  *
84
+ * This endpoint can be used to obtain account summary information.
83
85
  */
84
86
  getAccountSummary() {
85
87
  return this.getPrivate('api/v2/user-info');
86
88
  }
89
+ /**
90
+ * Get API Key Information
91
+ *
92
+ * Get information about the API key being used. Works for both master and sub user API keys.
93
+ */
94
+ getApikeyInfo() {
95
+ return this.getPrivate('api/v1/user/api-key');
96
+ }
97
+ /**
98
+ * Get Account Type - Spot
99
+ *
100
+ * This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.
101
+ */
102
+ getUserType() {
103
+ return this.getPrivate('api/v1/hf/accounts/opened');
104
+ }
87
105
  /**
88
106
  * Get a list of acounts and their balance states (spot/margin/trade_hf)
89
107
  *
90
- * Get Account List - Spot/Margin/trade_hf
108
+ * Get Account List - Spot
91
109
  */
92
110
  getBalances(params) {
93
111
  return this.getPrivate('api/v1/accounts', params);
94
112
  }
113
+ /**
114
+ * Get Account Detail - Spot
115
+ *
116
+ * Get Information for a single spot account. Use this endpoint when you know the accountId.
117
+ */
95
118
  getAccountDetail(params) {
96
119
  return this.getPrivate(`api/v1/accounts/${params.accountId}`);
97
120
  }
121
+ /**
122
+ * Get Account - Cross Margin
123
+ *
124
+ * Request via this endpoint to get the info of the cross margin account.
125
+ */
126
+ getMarginBalance(params) {
127
+ return this.getPrivate('api/v3/margin/accounts', params);
128
+ }
129
+ /**
130
+ * Get Account - Isolated Margin
131
+ *
132
+ * Request via this endpoint to get the info of the isolated margin account.
133
+ */
134
+ getIsolatedMarginBalance(params) {
135
+ return this.getPrivate('api/v3/isolated/accounts', params);
136
+ }
98
137
  /**
99
138
  * Get Account Ledgers - Spot/Margin
139
+ *
140
+ * This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies.
141
+ * Items are paginated and sorted to show the latest first.
142
+ * See the Pagination section for retrieving additional entries after the first page.
100
143
  */
101
144
  getTransactions(params) {
102
145
  return this.getPrivate('api/v1/accounts/ledgers', params);
103
146
  }
104
147
  /**
105
148
  * Get Account Ledgers - trade_hf
149
+ *
150
+ * This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries.
151
+ * The query results are sorted in descending order by createdAt and id.
106
152
  */
107
153
  getHFTransactions(params) {
108
154
  return this.getPrivate('api/v1/hf/accounts/ledgers', params);
109
155
  }
110
156
  /**
111
157
  * Get Account Ledgers - margin_hf
158
+ *
159
+ * This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries.
160
+ * The query results are sorted in descending order by createdAt and id.
112
161
  */
113
162
  getHFMarginTransactions(params) {
114
163
  return this.getPrivate('api/v3/hf/margin/account/ledgers', params);
115
164
  }
116
165
  /**
117
166
  *
118
- * REST - ACCOUNT - Sub-Account
167
+ * REST - Account Info - Sub Account
119
168
  *
120
169
  */
121
- getSubAccountsV1() {
122
- return this.getPrivate('api/v1/sub/user');
123
- }
124
- getSubAccountsV2(params) {
125
- return this.getPrivate('api/v2/sub/user', params);
126
- }
170
+ /**
171
+ * Add SubAccount
172
+ *
173
+ * This endpoint is used to create a sub-account.
174
+ */
127
175
  createSubAccount(params) {
128
176
  return this.postPrivate('api/v2/sub/user/created', params);
129
177
  }
178
+ /**
179
+ * Add SubAccount Margin Permission
180
+ *
181
+ * This endpoint can be used to add sub-accounts Margin permission.
182
+ * Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.
183
+ */
130
184
  enableSubAccountMargin(params) {
131
185
  return this.postPrivate('api/v3/sub/user/margin/enable', params);
132
186
  }
187
+ /**
188
+ * Add SubAccount Futures Permission
189
+ *
190
+ * This endpoint can be used to add sub-accounts Futures permission.
191
+ * Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.
192
+ */
133
193
  enableSubAccountFutures(params) {
134
194
  return this.postPrivate('api/v3/sub/user/futures/enable', params);
135
195
  }
196
+ /**
197
+ * Get SubAccount List - Summary Info
198
+ *
199
+ * This endpoint can be used to get a paginated list of sub-accounts. Pagination is required.
200
+ */
201
+ getSubAccountsV2(params) {
202
+ return this.getPrivate('api/v2/sub/user', params);
203
+ }
204
+ /**
205
+ * @deprecated This method is deprecated.
206
+ * It is recommended to use the GET /api/v2/sub/accounts/balance endpoint instead of this endpoint
207
+ */
136
208
  getSubAccountBalance(params) {
137
209
  return this.getPrivate(`api/v1/sub-accounts/${params.subUserId}`, params);
138
210
  }
139
- getSubAccountBalancesV1() {
140
- return this.getPrivate('api/v1/sub-accounts');
141
- }
211
+ /**
212
+ * Get SubAccount List - Spot Balance(V2)
213
+ *
214
+ * This endpoint can be used to get paginated Spot sub-account information.
215
+ * Pagination is required.
216
+ */
142
217
  getSubAccountBalancesV2(params) {
143
218
  return this.getPrivate('api/v2/sub-accounts', params);
144
219
  }
145
220
  /**
146
221
  *
147
- * REST - ACCOUNT - Sub-Account API
222
+ * REST - Account Info - Sub Account API
148
223
  *
224
+ */
225
+ /**
226
+ * Add SubAccount API
149
227
  *
228
+ * This endpoint can be used to create APIs for sub-accounts.
150
229
  */
151
- getSubAPIs(params) {
152
- return this.getPrivate('api/v1/sub/api-key', params);
153
- }
154
230
  createSubAPI(params) {
155
231
  return this.postPrivate('api/v1/sub/api-key', params);
156
232
  }
233
+ /**
234
+ * Modify SubAccount API
235
+ *
236
+ * This endpoint can be used to update APIs for sub-accounts.
237
+ */
157
238
  updateSubAPI(params) {
158
239
  return this.postPrivate('api/v1/sub/api-key/update', params);
159
240
  }
160
- deleteSubAPI(params) {
161
- return this.deletePrivate('api/v1/sub/api-key', params);
162
- }
163
241
  /**
242
+ * Get SubAccount API List
164
243
  *
165
- * REST - FUNDING - Funding overview
166
- *
244
+ * This endpoint can be used to obtain a list of APIs pertaining to a sub-account.
245
+ * (Not contain ND Broker Sub Account)
167
246
  */
168
- getMarginBalances() {
169
- return this.getPrivate('api/v1/margin/account');
170
- }
171
- getMarginBalance(params) {
172
- return this.getPrivate('api/v3/margin/accounts', params);
247
+ getSubAPIs(params) {
248
+ return this.getPrivate('api/v1/sub/api-key', params);
173
249
  }
174
- getIsolatedMarginBalance(params) {
175
- return this.getPrivate('api/v3/isolated/accounts', params);
250
+ /**
251
+ * Delete SubAccount API
252
+ *
253
+ * This endpoint can be used to delete an API for a sub-account.
254
+ */
255
+ deleteSubAPI(params) {
256
+ return this.deletePrivate('api/v1/sub/api-key', params);
176
257
  }
177
258
  /**
178
259
  *
179
- * REST - FUNDING -Deposit
260
+ * REST - Account Info - Deposit
180
261
  *
181
262
  */
182
263
  /**
183
- * @deprecated This method is deprecated. Please use createDepositAddressV3 instead.
264
+ * Add Deposit Address(V3)
265
+ *
266
+ * Request via this endpoint to create a deposit address for a currency you intend to deposit.
184
267
  */
185
- createDepositAddress(params) {
186
- return this.postPrivate('api/v1/deposit-addresses', params);
187
- }
188
268
  createDepositAddressV3(params) {
189
269
  return this.postPrivate('api/v3/deposit-address/create', params);
190
270
  }
191
271
  /**
192
- * @deprecated This method is deprecated. Please use getDepositAddressesV3 instead.
193
- */
194
- getDepositAddressesV2(params) {
195
- return this.getPrivate('api/v2/deposit-addresses', params);
196
- }
197
- /**
198
- * @deprecated This method is deprecated. Please use getDepositAddressesV3 instead.
272
+ * Get Deposit Address(V3)
273
+ *
274
+ * Get all deposit addresses for the currency you intend to deposit.
275
+ * If the returned data is empty, you may need to Add Deposit Address first.
199
276
  */
200
- getDepositAddressV1(params) {
201
- return this.getPrivate('api/v1/deposit-addresses', params);
202
- }
203
277
  getDepositAddressesV3(params) {
204
278
  return this.getPrivate('api/v3/deposit-addresses', params);
205
279
  }
280
+ /**
281
+ * Get Deposit History
282
+ *
283
+ * Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first.
284
+ * See the Pagination section for retrieving additional entries after the first page.
285
+ */
206
286
  getDeposits(params) {
207
287
  return this.getPrivate('api/v1/deposits', params);
208
288
  }
209
- getHistoricalDepositsV1(params) {
210
- return this.getPrivate('api/v1/hist-deposits', params);
211
- }
212
289
  /**
213
290
  *
214
- * REST - FUNDING -Withdrawals
291
+ * REST - Account Info - Withdrawals
215
292
  *
216
293
  */
217
- getWithdrawals(params) {
218
- return this.getPrivate('api/v1/withdrawals', params);
219
- }
220
- getHistoricalWithdrawalsV1(params) {
221
- return this.getPrivate('api/v1/hist-withdrawals', params);
222
- }
294
+ /**
295
+ * Get Withdrawal Quotas
296
+ *
297
+ * This interface can obtain the withdrawal quotas information of this currency.
298
+ */
223
299
  getWithdrawalQuotas(params) {
224
300
  return this.getPrivate('api/v1/withdrawals/quotas', params);
225
301
  }
226
302
  /**
227
- * @deprecated This method is deprecated. Please use submitWithdrawalV3 instead.
303
+ * Withdraw(V3)
304
+ *
305
+ * Use this interface to withdraw the specified currency
228
306
  */
229
- submitWithdraw(params) {
230
- return this.postPrivate('api/v1/withdrawals', params);
231
- }
232
307
  submitWithdrawV3(params) {
233
308
  return this.postPrivate('api/v3/withdrawals', params);
234
309
  }
310
+ /**
311
+ * Cancel Withdrawal
312
+ *
313
+ * This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.
314
+ */
235
315
  cancelWithdrawal(params) {
236
316
  return this.deletePrivate(`api/v1/withdrawals/${params.withdrawalId}`);
237
317
  }
238
318
  /**
319
+ * Get Withdrawal History
239
320
  *
240
- * REST - FUNDING - Transfer
321
+ * Request via this endpoint to get withdrawal list Items are paginated and sorted to show the latest first.
322
+ * See the Pagination section for retrieving additional entries after the first page.
323
+ */
324
+ getWithdrawals(params) {
325
+ return this.getPrivate('api/v1/withdrawals', params);
326
+ }
327
+ /**
328
+ *
329
+ * REST - Account Info - Transfer
330
+ *
331
+ */
332
+ /**
333
+ * Get Transfer Quotas
241
334
  *
335
+ * This endpoint returns the transferable balance of a specified account.
242
336
  */
243
337
  getTransferable(params) {
244
338
  return this.getPrivate('api/v1/accounts/transferable', params);
245
339
  }
340
+ /**
341
+ * Flex Transfer
342
+ *
343
+ * This interface can be used for transfers between master and sub accounts and inner transfers
344
+ */
246
345
  submitFlexTransfer(params) {
247
346
  return this.postPrivate('api/v3/accounts/universal-transfer', params);
248
347
  }
249
- submitTransferMasterSub(params) {
250
- return this.postPrivate('api/v2/accounts/sub-transfer', params);
251
- }
252
- submitInnerTransfer(params) {
253
- return this.postPrivate('api/v2/accounts/inner-transfer', params);
254
- }
255
348
  /**
256
349
  *
257
- * REST - FUNDING - Trade Fee
350
+ * REST - Account Info - Trade Fee
351
+ *
352
+ */
353
+ /**
354
+ * Get Basic Fee - Spot/Margin
258
355
  *
356
+ * This interface is for the spot/margin basic fee rate of users
259
357
  */
260
358
  getBasicUserFee(params) {
261
359
  return this.getPrivate('api/v1/base-fee', params);
262
360
  }
361
+ /**
362
+ * Get Actual Fee - Spot/Margin
363
+ *
364
+ * This interface is for the actual fee rate of the trading pair.
365
+ * You can inquire about fee rates of 10 trading pairs each time at most.
366
+ * The fee rate of your sub-account is the same as that of the master account.
367
+ */
263
368
  getTradingPairFee(params) {
264
369
  return this.getPrivate('api/v1/trade-fees', params);
265
370
  }
266
371
  /**
267
372
  *
268
- * REST - SPOT TRADING -Market data
373
+ * REST - SPOT TRADING - Market Data
269
374
  *
270
375
  */
271
- getCurrencies() {
272
- return this.get('api/v3/currencies');
376
+ /**
377
+ * Get Announcements
378
+ *
379
+ * This interface can obtain the latest news announcements, and the default page search is for announcements within a month.
380
+ */
381
+ getAnnouncements(params) {
382
+ return this.get('api/v3/announcements', params);
273
383
  }
384
+ /**
385
+ * Get Currency
386
+ *
387
+ * Request via this endpoint to get the currency details of a specified currency.
388
+ */
274
389
  getCurrency(params) {
275
390
  return this.get(`api/v3/currencies/${params.currency}`, params);
276
391
  }
277
- getSymbols(params) {
278
- return this.get('api/v2/symbols', params);
392
+ /**
393
+ * Get All Currencies
394
+ *
395
+ * Request via this endpoint to get the currency list. Not all currencies currently can be used for trading.
396
+ */
397
+ getCurrencies() {
398
+ return this.get('api/v3/currencies');
279
399
  }
400
+ /**
401
+ * Get Symbol
402
+ *
403
+ * Request via this endpoint to get detail currency pairs for trading.
404
+ * If you want to get the market information of the trading symbol, please use Get All Tickers.
405
+ */
280
406
  getSymbol(params) {
281
407
  return this.get(`api/v2/symbols/${params.symbol}`);
282
408
  }
409
+ /**
410
+ * Get All Symbols
411
+ *
412
+ * Request via this endpoint to get detail currency pairs for trading.
413
+ * If you want to get the market information of the trading symbol, please use Get All Tickers.
414
+ */
415
+ getSymbols(params) {
416
+ return this.get('api/v2/symbols', params);
417
+ }
418
+ /**
419
+ * Get Ticker
420
+ *
421
+ * Request via this endpoint to get Level 1 Market Data.
422
+ * The returned value includes the best bid price and size,
423
+ * the best ask price and size as well as the last traded price and the last traded size.
424
+ */
283
425
  getTicker(params) {
284
426
  return this.get(`api/v1/market/orderbook/level1`, params);
285
427
  }
428
+ /**
429
+ * Get All Tickers
430
+ *
431
+ * Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds.
432
+ */
286
433
  getTickers() {
287
434
  return this.get('api/v1/market/allTickers');
288
435
  }
289
- get24hrStats(params) {
290
- return this.get('api/v1/market/stats', params);
436
+ /**
437
+ * Get Trade History
438
+ *
439
+ * Request via this endpoint to get the trade history of the specified symbol,
440
+ * the returned quantity is the last 100 transaction records.
441
+ */
442
+ getTradeHistories(params) {
443
+ return this.get('api/v1/market/histories', params);
291
444
  }
292
- getMarkets() {
293
- return this.get('api/v1/markets');
445
+ /**
446
+ * Get Klines
447
+ *
448
+ * Get the Kline of the symbol.
449
+ * Data are returned in grouped buckets based on requested type.
450
+ */
451
+ getKlines(params) {
452
+ return this.get('api/v1/market/candles', params);
294
453
  }
454
+ /**
455
+ * Get Part OrderBook
456
+ *
457
+ * Query for part orderbook depth data. Level 20(aggregated by price)
458
+ */
295
459
  getOrderBookLevel20(params) {
296
460
  return this.get(`api/v1/market/orderbook/level2_20`, params);
297
461
  }
462
+ /**
463
+ * Get Part OrderBook
464
+ *
465
+ * Query for part orderbook depth data. Level 100(aggregated by price)
466
+ */
298
467
  getOrderBookLevel100(params) {
299
468
  return this.get(`api/v1/market/orderbook/level2_100`, params);
300
469
  }
470
+ /**
471
+ * Get Full OrderBook
472
+ *
473
+ * Query for full orderbook depth data. (aggregated by price)
474
+ */
301
475
  getFullOrderBook(params) {
302
476
  return this.getPrivate('api/v3/market/orderbook/level2', params);
303
477
  }
304
- getTradeHistories(params) {
305
- return this.get('api/v1/market/histories', params);
306
- }
307
- getKlines(params) {
308
- return this.get('api/v1/market/candles', params);
309
- }
478
+ /**
479
+ * Get Fiat Price
480
+ *
481
+ * Request via this endpoint to get the fiat price of the currencies for the available trading pairs.
482
+ */
310
483
  getFiatPrice(params) {
311
484
  return this.get('api/v1/prices', params);
312
485
  }
313
486
  /**
487
+ * Get 24hr Stats
314
488
  *
315
- * REST - SPOT TRADING - Spot HF trade
489
+ * Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.
490
+ */
491
+ get24hrStats(params) {
492
+ return this.get('api/v1/market/stats', params);
493
+ }
494
+ /**
495
+ * Get Market List
316
496
  *
497
+ * Request via this endpoint to get the transaction currency for the entire trading market.
317
498
  */
318
- getUserType() {
319
- return this.getPrivate('api/v1/hf/accounts/opened');
499
+ getMarkets() {
500
+ return this.get('api/v1/markets');
320
501
  }
502
+ /**
503
+ *
504
+ * REST - SPOT TRADING - Orders
505
+ *
506
+ */
507
+ /**
508
+ * Add Order
509
+ *
510
+ * Place order to the Spot trading system, you can place two major types of orders: limit and market.
511
+ * Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order.
512
+ * The amount of funds on hold depends on the order type and parameters specified.
513
+ */
321
514
  submitHFOrder(params) {
322
515
  return this.postPrivate('api/v1/hf/orders', params);
323
516
  }
324
- submitHFOrderTest() {
325
- return this.postPrivate('api/v1/hf/orders/test');
326
- }
517
+ /**
518
+ * Add Order Sync
519
+ *
520
+ * Place order to the spot trading system
521
+ *
522
+ * The difference between this interface and "Add order" is that this interface will synchronously return the order information after the order matching is completed.
523
+ */
327
524
  submitHFOrderSync(params) {
328
525
  return this.postPrivate('api/v1/hf/orders/sync', params);
329
526
  }
527
+ /**
528
+ * Add Order Test
529
+ *
530
+ * Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint,
531
+ * and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.
532
+ */
533
+ submitHFOrderTest() {
534
+ return this.postPrivate('api/v1/hf/orders/test');
535
+ }
536
+ /**
537
+ * Batch Add Orders
538
+ *
539
+ * This endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.
540
+ */
330
541
  submitHFMultipleOrders(params) {
331
542
  return this.postPrivate('api/v1/hf/orders/multi', params);
332
543
  }
544
+ /**
545
+ * Batch Add Orders Sync
546
+ *
547
+ * This endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.
548
+ * The difference between this interface and "Batch Add Orders" is that this interface will synchronously return the order information after the order matching is completed.
549
+ */
333
550
  submitHFMultipleOrdersSync(params) {
334
551
  return this.postPrivate('api/v1/hf/orders/multi/sync', params);
335
552
  }
336
- updateHFOrder(params) {
337
- return this.postPrivate('api/v1/hf/orders/alter', params);
338
- }
553
+ /**
554
+ * Cancel Order By OrderId
555
+ *
556
+ * This endpoint can be used to cancel a spot order by orderId.
557
+ * This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.
558
+ */
339
559
  cancelHFOrder(params) {
340
560
  return this.deletePrivate(`api/v1/hf/orders/${params.orderId}`, params);
341
561
  }
562
+ /**
563
+ * Cancel Order By OrderId Sync
564
+ *
565
+ * This endpoint can be used to cancel a spot order by orderId.
566
+ * The difference between this interface and "Cancel Order By OrderId" is that this interface will synchronously return the order information after the order canceling is completed.
567
+ */
342
568
  cancelHFOrderSync(params) {
343
569
  return this.deletePrivate(`api/v1/hf/orders/sync/${params.orderId}`, params);
344
570
  }
571
+ /**
572
+ * Cancel Order By ClientOid
573
+ *
574
+ * This endpoint can be used to cancel a spot order by clientOid.
575
+ * This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.
576
+ */
345
577
  cancelHFOrderByClientOId(params) {
346
578
  return this.deletePrivate(`api/v1/hf/orders/client-order/${params.clientOid}`, params);
347
579
  }
580
+ /**
581
+ * Cancel Order By ClientOid Sync
582
+ *
583
+ * This endpoint can be used to cancel a spot order by clientOid.
584
+ * The difference between this interface and "Cancel Order By ClientOid" is that this interface will synchronously return the order information after the order canceling is completed.
585
+ */
348
586
  cancelHFOrderSyncByClientOId(params) {
349
587
  return this.deletePrivate(`api/v1/hf/orders/sync/client-order/${params.clientOid}`, params);
350
588
  }
589
+ /**
590
+ * Cancel Partial Order
591
+ *
592
+ * This interface can cancel the specified quantity of the order according to the orderId.
593
+ */
351
594
  cancelHFOrdersNumber(params) {
352
595
  return this.deletePrivate(`api/v1/hf/orders/cancel/${params.orderId}`, params);
353
596
  }
597
+ /**
598
+ * Cancel All Orders By Symbol
599
+ *
600
+ * This endpoint can cancel all spot orders for specific symbol.
601
+ */
354
602
  cancelHFAllOrdersBySymbol(params) {
355
603
  return this.deletePrivate(`api/v1/hf/orders`, params);
356
604
  }
605
+ /**
606
+ * Cancel All Orders
607
+ *
608
+ * This endpoint can cancel all spot orders for all symbol.
609
+ */
357
610
  cancelHFAllOrders() {
358
611
  return this.deletePrivate(`api/v1/hf/orders/cancelAll`);
359
612
  }
360
- getHFActiveOrders(params) {
361
- return this.getPrivate(`api/v1/hf/orders/active`, params);
362
- }
363
- getHFActiveSymbols() {
364
- return this.getPrivate(`api/v1/hf/orders/active/symbols`);
365
- }
366
- getHFCompletedOrders(params) {
367
- return this.getPrivate(`api/v1/hf/orders/done`, params);
613
+ /**
614
+ * Modify Order
615
+ *
616
+ * This interface can modify the price and quantity of the order according to orderId or clientOid.
617
+ */
618
+ updateHFOrder(params) {
619
+ return this.postPrivate('api/v1/hf/orders/alter', params);
368
620
  }
621
+ /**
622
+ * Get Order By OrderId
623
+ *
624
+ * This endpoint can be used to obtain information for a single Spot order using the order id.
625
+ */
369
626
  getHFOrderDetailsByOrderId(params) {
370
627
  return this.getPrivate(`api/v1/hf/orders/${params.orderId}`, params);
371
628
  }
629
+ /**
630
+ * Get Order By ClientOid
631
+ *
632
+ * This endpoint can be used to obtain information for a single Spot order using the clientOid.
633
+ */
372
634
  getHFOrderDetailsByClientOid(params) {
373
635
  return this.getPrivate(`api/v1/hf/orders/client-order/${params.clientOid}`, params);
374
636
  }
375
- cancelHFOrderAutoSetting(params) {
376
- return this.postPrivate('api/v1/hf/orders/dead-cancel-all', params);
637
+ /**
638
+ * Get Symbols With Open Order
639
+ *
640
+ * This interface can query all spot symbol that has active orders
641
+ */
642
+ getHFActiveSymbols() {
643
+ return this.getPrivate(`api/v1/hf/orders/active/symbols`);
377
644
  }
378
- cancelHFOrderAutoSettingQuery() {
379
- return this.getPrivate('api/v1/hf/orders/dead-cancel-all/query');
645
+ /**
646
+ * Get Open Orders
647
+ *
648
+ * This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists.
649
+ * The returned data is sorted in descending order according to the latest update time of the order.
650
+ */
651
+ getHFActiveOrders(params) {
652
+ return this.getPrivate(`api/v1/hf/orders/active`, params);
653
+ }
654
+ /**
655
+ * Get Closed Orders
656
+ *
657
+ * This interface is to obtain all Spot completed order lists, and the return value of the completed order interface is the paged data of all completed order lists.
658
+ * The returned data is sorted in descending order according to the latest update time of the order.
659
+ */
660
+ getHFCompletedOrders(params) {
661
+ return this.getPrivate(`api/v1/hf/orders/done`, params);
380
662
  }
663
+ /**
664
+ * Get Trade History
665
+ *
666
+ * This endpoint can be used to obtain a list of the latest Spot transaction details.
667
+ */
381
668
  getHFFilledOrders(params) {
382
669
  return this.getPrivate('api/v1/hf/fills', params);
383
670
  }
384
671
  /**
672
+ * Get DCP
385
673
  *
386
- * REST - SPOT TRADING - Orders
387
- *
674
+ * Get Disconnection Protect(Deadman Swich)
675
+ * Through this interface, you can query the settings of automatic order cancellation
388
676
  */
389
- // SPOT and MARGIN
390
- submitOrder(params) {
391
- return this.postPrivate('api/v1/orders', params);
392
- }
393
- // SPOT and MARGIN
394
- submitOrderTest() {
395
- return this.postPrivate('api/v1/orders/test');
396
- }
397
- //SPOT
398
- submitMultipleOrders(params) {
399
- return this.postPrivate('api/v1/orders/multi', params);
400
- }
401
- // Used for Spot and Margin Trading: Cancels a single order by orderId.
402
- cancelOrderById(params) {
403
- return this.deletePrivate(`api/v1/orders/${params.orderId}`);
404
- }
405
- // Used for Spot and Margin Trading: Cancels a single order by clientOid.
406
- cancelOrderByClientOid(params) {
407
- return this.deletePrivate(`api/v1/order/client-order/${params.clientOid}`);
408
- }
409
- // Used for Spot and Margin Trading: Cancels all open orders.
410
- cancelAllOrders(params) {
411
- return this.deletePrivate('api/v1/orders', params);
412
- }
413
- // Retrieves the current list of orders. Supports filtering by status and trade type.
414
- getOrders(params) {
415
- return this.getPrivate('api/v1/orders', params);
416
- }
417
- // Needs General permission, Retrieves a list of the most recent 1000 orders within the last 24 hours, sorted in descending order by time.
418
- getRecentOrders(params) {
419
- return this.getPrivate('api/v1/limit/orders', params);
420
- }
421
- // Needs General Permission, Retrieves the details of a single order by its orderId. Useful for tracking the status and details of specific trades.
422
- getOrderByOrderId(params) {
423
- return this.getPrivate(`api/v1/orders/${params.orderId}`);
424
- }
425
- // Needs general permission, Retrieves the details of a single order by its clientOid. This is useful for checking the status of orders submitd with a unique client-provided identifier.
426
- getOrderByClientOid(params) {
427
- return this.getPrivate(`api/v1/order/client-order/${params.clientOid}`);
677
+ cancelHFOrderAutoSettingQuery() {
678
+ return this.getPrivate('api/v1/hf/orders/dead-cancel-all/query');
428
679
  }
429
680
  /**
681
+ * Set DCP
430
682
  *
431
- * REST - SPOT TRADING -Fills
432
- *
683
+ * Set Disconnection Protect(Deadman Swich)
684
+ * Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time.
685
+ * If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.
433
686
  */
434
- // General permission, Retrieves a list of fills for your orders, providing details such as the executed price, size, and the fees incurred. Useful for tracking trade executions and their impact on your portfolio.
435
- getFills(params) {
436
- return this.getPrivate('api/v1/fills', params);
437
- }
438
- // General permission, Retrieves a list of the most recent 1000 fills within the last 24 hours, sorted in descending order by time.
439
- getRecentFills() {
440
- return this.getPrivate('api/v1/limit/fills');
687
+ cancelHFOrderAutoSetting(params) {
688
+ return this.postPrivate('api/v1/hf/orders/dead-cancel-all', params);
441
689
  }
442
690
  /**
691
+ * Add Stop Order
443
692
  *
444
- * REST - SPOT TRADING - Stop order
445
- *
693
+ * Place stop order to the Spot trading system.
446
694
  */
447
- // Spot and margin trading, submits a stop order on the platform.
448
695
  submitStopOrder(params) {
449
696
  return this.postPrivate('api/v1/stop-order', params);
450
697
  }
451
698
  /**
452
- * Cancels a single stop order by orderId. Applicable for both spot and margin trading.
699
+ * Cancel Stop Order By ClientOid
453
700
  *
454
- * This endpoint requires the "Spot Trading" or "Margin Trading" permission on your API key.
701
+ * This endpoint can be used to cancel a spot stop order by clientOid.
455
702
  */
456
- // Cancels a single stop order by orderId. Applicable for both spot and margin trading.
457
- // This endpoint requires the "Spot Trading" or "Margin Trading" permission on your API key.
458
- cancelStopOrderById(params) {
459
- return this.deletePrivate(`api/v1/stop-order/${params.orderId}`);
703
+ cancelStopOrderByClientOid(params) {
704
+ return this.deletePrivate(`api/v1/stop-order/cancelOrderByClientOid`, params);
460
705
  }
461
706
  /**
462
- * Cancels a stop order by clientOid. Requires "Spot Trading" or "Margin Trading" permission.
707
+ * Cancel Stop Order By OrderId
708
+ *
709
+ * Request via this endpoint to cancel a single stop order previously placed.
463
710
  */
464
- cancelStopOrderByClientOid(params) {
465
- return this.deletePrivate(`api/v1/stop-order/cancelOrderByClientOid`, params);
711
+ cancelStopOrderById(params) {
712
+ return this.deletePrivate(`api/v1/stop-order/${params.orderId}`);
466
713
  }
467
714
  /**
468
- * Cancels a batch of stop orders. Requires "Spot Trading" or "Margin Trading" permission.
715
+ * Batch Cancel Stop Orders
716
+ *
717
+ * Request via this interface to cancel a batch of stop orders.
469
718
  */
470
719
  cancelStopOrders(params) {
471
720
  return this.deletePrivate(`api/v1/stop-order/cancel`, params);
472
721
  }
473
722
  /**
474
- * Retrieves your current untriggered stop order list, paginated and sorted to show the latest first.
723
+ * Get Stop Orders List
724
+ *
725
+ * Request via this endpoint to get your current untriggered stop order list.
475
726
  */
476
727
  getStopOrders(params) {
477
728
  return this.getPrivate('api/v1/stop-order', params);
478
729
  }
479
730
  /**
480
- * Retrieves the details of a single stop order by its orderId.
731
+ * Get Stop Order By OrderId
732
+ *
733
+ * Request via this interface to get a stop order information via the order ID.
734
+
735
+
481
736
  */
482
737
  getStopOrderByOrderId(params) {
483
738
  return this.getPrivate(`api/v1/stop-order/${params.orderId}`);
484
739
  }
485
740
  /**
486
- * Retrieves the details of a single stop order by its clientOid.
741
+ * Get Stop Order By ClientOid
742
+ *
743
+ *
487
744
  */
488
745
  getStopOrderByClientOid(params) {
489
746
  return this.getPrivate('api/v1/stop-order/queryOrderByClientOid', params);
490
747
  }
491
748
  /**
749
+ * Add OCO Order
492
750
  *
493
- * REST - SPOT TRADING - OCO order
494
- *
751
+ * Place OCO order to the Spot trading system
495
752
  */
496
- // submits an OCO (One Cancels the Other) order on the platform.
497
753
  submitOCOOrder(params) {
498
754
  return this.postPrivate('api/v3/oco/order', params);
499
755
  }
500
756
  /**
501
- * Cancels a single OCO order by orderId.
757
+ * Cancel OCO Order By OrderId
758
+ *
759
+ * Request via this endpoint to cancel a single oco order previously placed.
502
760
  */
503
761
  cancelOCOOrderById(params) {
504
762
  return this.deletePrivate(`api/v3/oco/order/${params.orderId}`);
505
763
  }
506
764
  /**
507
- * Cancels a single OCO order by clientOid.
765
+ * Cancel OCO Order By ClientOid
766
+ *
767
+ * Request via this endpoint to cancel a single oco order previously placed.
508
768
  */
509
769
  cancelOCOOrderByClientOid(params) {
510
770
  return this.deletePrivate(`api/v3/oco/client-order/${params.clientOid}`);
511
771
  }
512
772
  /**
513
- * Batch cancels OCO orders through orderIds.
773
+ * Batch Cancel OCO Order
774
+ *
775
+ * This interface can batch cancel OCO orders through orderIds.
514
776
  */
515
777
  cancelMultipleOCOOrders(params) {
516
778
  return this.deletePrivate('api/v3/oco/orders', params);
517
779
  }
518
780
  /**
519
- * Retrieves the details of a single OCO order by its orderId.
781
+ * Get OCO Order By OrderId
782
+ *
783
+ * Request via this interface to get a oco order information via the order ID.
520
784
  */
521
785
  getOCOOrderByOrderId(params) {
522
786
  return this.getPrivate(`api/v3/oco/order/${params.orderId}`);
523
787
  }
524
788
  /**
525
- * Retrieves the details of a single OCO order by its clientOid.
789
+ * Get OCO Order By ClientOid
790
+ *
791
+ * Request via this interface to get a oco order information via the clientOid.
526
792
  */
527
793
  getOCOOrderByClientOid(params) {
528
794
  return this.getPrivate(`api/v3/oco/client-order/${params.clientOid}`);
529
795
  }
530
796
  /**
531
- * Retrieves the details of a single OCO order by its orderId, including detailed information about the individual orders.
797
+ * Get OCO Order Details
798
+ *
799
+ * Request via this interface to get a oco order information via the order ID.
532
800
  */
533
801
  getOCOOrderDetails(params) {
534
802
  return this.getPrivate(`api/v3/oco/order/details/${params.orderId}`);
535
803
  }
536
804
  /**
537
- * Retrieves your current OCO order list, paginated and sorted to show the latest first.
805
+ * Get OCO Order List
806
+ *
807
+ * Request via this endpoint to get your current OCO order list.
538
808
  */
539
809
  getOCOOrders(params) {
540
810
  return this.getPrivate('api/v3/oco/orders', params);
541
811
  }
542
812
  /**
543
813
  *
544
- * REST - MARGIN TRADING -Margin HF trade
814
+ * REST - MARGIN TRADING - Market Data
545
815
  *
546
816
  */
547
- submitHFMarginOrder(params) {
548
- return this.postPrivate('api/v3/hf/margin/order', params);
549
- }
550
- submitHFMarginOrderTest() {
551
- return this.postPrivate('api/v3/hf/margin/order/test');
552
- }
553
- cancelHFMarginOrder(params) {
554
- return this.deletePrivate(`api/v3/hf/margin/orders/${params.orderId}`, params);
555
- }
556
- cancelHFMarginOrderByClientOid(params) {
557
- return this.deletePrivate(`api/v3/hf/margin/orders/client-order/${params.clientOid}`, params);
558
- }
559
- cancelHFAllMarginOrders(params) {
560
- return this.deletePrivate(`api/v3/hf/margin/orders`, params);
561
- }
562
- getHFActiveMarginOrders(params) {
563
- return this.getPrivate(`api/v3/hf/margin/orders/active`, params);
564
- }
565
- getHFMarginFilledOrders(params) {
566
- return this.getPrivate('api/v3/hf/margin/orders/done', params);
567
- }
568
- getHFMarginOrderByOrderId(params) {
569
- return this.getPrivate(`api/v3/hf/margin/orders/${params.orderId}`, params);
570
- }
571
- getHFMarginOrderByClientOid(params) {
572
- return this.getPrivate(`api/v3/hf/margin/orders/client-order/${params.clientOid}?symbol=${params.symbol}`);
573
- }
574
- getHFMarginFills(params) {
575
- return this.getPrivate('api/v3/hf/margin/fills', params);
576
- }
577
- getHFMarginOpenSymbols(params) {
578
- return this.getPrivate('api/v3/hf/margin/order/active/symbols', params);
579
- }
580
817
  /**
818
+ * Get Symbols - Cross Margin
581
819
  *
582
- * REST - MARGIN TRADING - Orders
583
- *
820
+ * This endpoint allows querying the configuration of cross margin symbol.
584
821
  */
585
- submitMarginOrder(params) {
586
- return this.postPrivate('api/v1/margin/order', params);
587
- }
588
- submitMarginOrderTest() {
589
- return this.postPrivate('api/v1/margin/order/test');
822
+ getMarginActivePairsV3(params) {
823
+ return this.getPrivate('api/v3/margin/symbols', params);
590
824
  }
591
825
  /**
826
+ * Get Margin Config
592
827
  *
593
- * REST - MARGIN TRADING - Margin info
828
+ * Request via this endpoint to get the configure info of the cross margin.
829
+ */
830
+ getMarginConfigInfo() {
831
+ return this.get('api/v1/margin/config');
832
+ }
833
+ /**
834
+ * Get ETF Info
594
835
  *
836
+ * This interface returns leveraged token information
595
837
  */
596
838
  getMarginLeveragedToken(params) {
597
839
  return this.getPrivate('api/v3/etf/info', params);
598
840
  }
841
+ /**
842
+ * Get Mark Price List
843
+ *
844
+ * This endpoint returns the current Mark price for all margin trading pairs.
845
+ */
599
846
  getMarginMarkPrices() {
600
847
  return this.get('api/v3/mark-price/all-symbols');
601
848
  }
849
+ /**
850
+ * Get Mark Price Detail
851
+ *
852
+ * This endpoint returns the current Mark price for specified margin trading pairs.
853
+ */
602
854
  getMarginMarkPrice(params) {
603
855
  return this.get(`api/v1/mark-price/${params.symbol}/current`);
604
856
  }
605
- getMarginConfigInfo() {
606
- return this.get('api/v1/margin/config');
607
- }
608
- getMarginRiskLimitConfig(params) {
609
- return this.getPrivate('api/v3/margin/currencies', params);
610
- }
611
857
  /**
858
+ * Get Symbols - Isolated Margin
612
859
  *
613
- * REST - MARGIN TRADING - Isolated Margin
614
- *
860
+ * This endpoint allows querying the configuration of isolated margin symbol.
615
861
  */
616
862
  getIsolatedMarginSymbolsConfig() {
617
863
  return this.getPrivate('api/v1/isolated/symbols');
618
864
  }
619
- getIsolatedMarginAccounts(params) {
620
- return this.getPrivate('api/v1/isolated/accounts', params);
621
- }
622
- getIsolatedMarginAccount(params) {
623
- return this.getPrivate(`api/v1/isolated/account/${params.symbol}`);
624
- }
625
865
  /**
626
866
  *
627
- * REST - MARGIN TRADING - Margin trading(v3)
867
+ * REST - MARGIN TRADING - Orders
628
868
  *
629
869
  */
630
- marginBorrowV3(params) {
631
- return this.postPrivate('api/v3/margin/borrow', params);
632
- }
633
- marginRepayV3(params) {
634
- return this.postPrivate('api/v3/margin/repay', params);
635
- }
636
- getMarginBorrowHistoryV3(params) {
637
- return this.getPrivate('api/v3/margin/borrow', params);
638
- }
639
- getMarginRepayHistoryV3(params) {
640
- return this.getPrivate('api/v3/margin/repay', params);
641
- }
642
- getMarginInterestRecordsV3(params) {
643
- return this.getPrivate('api/v3/margin/interest', params);
644
- }
645
- getMarginActivePairsV3(params) {
646
- return this.getPrivate('api/v3/margin/symbols', params);
647
- }
648
- updateMarginLeverageV3(params) {
649
- return this.postPrivate('api/v3/position/update-user-leverage', params);
650
- }
651
870
  /**
871
+ * Add Order
652
872
  *
653
- * REST - MARGIN TRADING - Lending market(v3)
654
- *
873
+ * Place order to the Cross-margin or Isolated-margin trading system
655
874
  */
656
- getLendingCurrencyV3(params) {
657
- return this.get('api/v3/project/list', params);
658
- }
659
- getLendingInterestRateV3(params) {
660
- return this.get('api/v3/project/marketInterestRate', params);
661
- }
662
- submitLendingSubscriptionV3(params) {
663
- return this.postPrivate('api/v3/purchase', params);
664
- }
665
- submitLendingRedemptionV3(params) {
666
- return this.postPrivate('api/v3/redeem', params);
667
- }
668
- updateLendingSubscriptionOrdersV3(params) {
669
- return this.postPrivate('api/v3/lend/purchase/update', params);
670
- }
671
- getLendingRedemptionOrdersV3(params) {
672
- return this.getPrivate('api/v3/redeem/orders', params);
673
- }
674
- getLendingSubscriptionOrdersV3(params) {
675
- return this.getPrivate('api/v3/purchase/orders', params);
875
+ submitHFMarginOrder(params) {
876
+ return this.postPrivate('api/v3/hf/margin/order', params);
676
877
  }
677
878
  /**
879
+ * Add Order Test
678
880
  *
679
- * REST - EARN -General
680
- *
881
+ * This interface is used to test the order submission.
681
882
  */
883
+ submitHFMarginOrderTest() {
884
+ return this.postPrivate('api/v3/hf/margin/order/test');
885
+ }
682
886
  /**
683
- * Subscribe to Earn Fixed Income Products
887
+ * Cancel Order By OrderId
684
888
  *
685
- * This endpoint allows subscribing to fixed income products.
686
- * If the subscription fails, it returns the corresponding error code.
889
+ * This endpoint can be used to cancel a margin order by orderId.
687
890
  */
688
- subscribeEarnFixedIncome(params) {
689
- return this.postPrivate('api/v1/earn/orders', params);
891
+ cancelHFMarginOrder(params) {
892
+ return this.deletePrivate(`api/v3/hf/margin/orders/${params.orderId}`, params);
690
893
  }
691
894
  /**
692
- * Initiate redemption by holding ID
895
+ * Cancel Order By ClientOid
693
896
  *
694
- * This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.
897
+ * This endpoint can be used to cancel a margin order by clientOid.
695
898
  */
696
- submitRedemption(params) {
697
- return this.deletePrivate('api/v1/earn/orders', params);
899
+ cancelHFMarginOrderByClientOid(params) {
900
+ return this.deletePrivate(`api/v3/hf/margin/orders/client-order/${params.clientOid}`, params);
698
901
  }
699
902
  /**
700
- * Get Earn Redeem Preview by Holding ID
903
+ * Cancel All Orders By Symbol
701
904
  *
702
- * This endpoint retrieves redemption preview information by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.
905
+ * This interface can cancel all open Margin orders by symbol
703
906
  */
704
- getEarnRedeemPreview(params) {
705
- return this.getPrivate('api/v1/earn/redeem-preview', params);
907
+ cancelHFAllMarginOrders(params) {
908
+ return this.deletePrivate(`api/v3/hf/margin/orders`, params);
706
909
  }
707
910
  /**
911
+ * Get Symbols With Open Order
708
912
  *
709
- * REST - EARN -KUCOIN EARN
913
+ * This interface can query all Margin symbol that has active orders
914
+ */
915
+ getHFMarginOpenSymbols(params) {
916
+ return this.getPrivate('api/v3/hf/margin/order/active/symbols', params);
917
+ }
918
+ /**
919
+ * Get Open Orders
710
920
  *
921
+ * This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists.
711
922
  */
923
+ getHFActiveMarginOrders(params) {
924
+ return this.getPrivate(`api/v3/hf/margin/orders/active`, params);
925
+ }
712
926
  /**
713
- * Get Earn Savings Products
927
+ * Get Closed Orders
714
928
  *
715
- * This endpoint retrieves savings products. If no savings products are available, an empty list is returned.
929
+ * This interface is to obtain all Margin Closed order lists
716
930
  */
717
- getEarnSavingsProducts(params) {
718
- return this.getPrivate('api/v1/earn/saving/products', params);
931
+ getHFMarginFilledOrders(params) {
932
+ return this.getPrivate('api/v3/hf/margin/orders/done', params);
719
933
  }
720
934
  /**
721
- * Get Earn Fixed Income Current Holdings
935
+ * Get Trade History
722
936
  *
723
- * This endpoint retrieves current holding assets of fixed income products. If no current holding assets are available, an empty list is returned.
937
+ * This endpoint can be used to obtain a list of the latest Margin transaction details.
724
938
  */
725
- getEarnFixedIncomeHoldAssets(params) {
726
- return this.getPrivate('api/v1/earn/hold-assets', params);
939
+ getHFMarginFills(params) {
940
+ return this.getPrivate('api/v3/hf/margin/fills', params);
727
941
  }
728
942
  /**
729
- * Get Earn Limited-Time Promotion Products
943
+ * Get Order By OrderId
730
944
  *
731
- * This endpoint retrieves limited-time promotion products. If no products are available, an empty list is returned.
945
+ * This endpoint can be used to obtain a Margin order by orderId.
732
946
  */
733
- getEarnPromotionProducts(params) {
734
- return this.getPrivate('api/v1/earn/promotion/products', params);
947
+ getHFMarginOrderByOrderId(params) {
948
+ return this.getPrivate(`api/v3/hf/margin/orders/${params.orderId}`, params);
949
+ }
950
+ /**
951
+ * Get Order By ClientOid
952
+ *
953
+ * This endpoint can be used to obtain a Margin order by clientOid.
954
+ */
955
+ getHFMarginOrderByClientOid(params) {
956
+ return this.getPrivate(`api/v3/hf/margin/orders/client-order/${params.clientOid}?symbol=${params.symbol}`);
735
957
  }
736
958
  /**
737
959
  *
738
- * REST - EARN - Staking
960
+ * REST - MARGIN TRADING - Debit
739
961
  *
740
962
  */
741
963
  /**
742
- * Get Earn KCS Staking Products
964
+ * Borrow
743
965
  *
744
- * This endpoint retrieves KCS Staking products. If no KCS Staking products are available, an empty list is returned.
966
+ * This API endpoint is used to initiate an application for cross or isolated margin borrowing.
967
+ */
968
+ marginBorrowV3(params) {
969
+ return this.postPrivate('api/v3/margin/borrow', params);
970
+ }
971
+ /**
972
+ * Get Borrow History
745
973
  *
974
+ * This API endpoint is used to get the borrowing orders for cross and isolated margin accounts
746
975
  */
747
- getEarnKcsStakingProducts(params) {
748
- return this.getPrivate('api/v1/earn/kcs-staking/products', params);
976
+ getMarginBorrowHistoryV3(params) {
977
+ return this.getPrivate('api/v3/margin/borrow', params);
978
+ }
979
+ /**
980
+ * Repay
981
+ *
982
+ * This API endpoint is used to initiate an application for cross or isolated margin repayment.
983
+ */
984
+ marginRepayV3(params) {
985
+ return this.postPrivate('api/v3/margin/repay', params);
986
+ }
987
+ /**
988
+ * Get Repay History
989
+ *
990
+ * This API endpoint is used to get the repayment orders for cross and isolated margin accounts
991
+ */
992
+ getMarginRepayHistoryV3(params) {
993
+ return this.getPrivate('api/v3/margin/repay', params);
994
+ }
995
+ /**
996
+ * Get Interest History
997
+ *
998
+ * Request via this endpoint to get the interest records of the cross/isolated margin lending.
999
+ */
1000
+ getMarginInterestRecordsV3(params) {
1001
+ return this.getPrivate('api/v3/margin/interest', params);
1002
+ }
1003
+ /**
1004
+ * Modify Leverage
1005
+ *
1006
+ * This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.
1007
+ */
1008
+ updateMarginLeverageV3(params) {
1009
+ return this.postPrivate('api/v3/position/update-user-leverage', params);
1010
+ }
1011
+ /**
1012
+ *
1013
+ * REST - MARGIN TRADING - Credit
1014
+ *
1015
+ */
1016
+ /**
1017
+ * Get Loan Market
1018
+ *
1019
+ * This API endpoint is used to get the information about the currencies available for lending.
1020
+ */
1021
+ getLendingCurrencyV3(params) {
1022
+ return this.get('api/v3/project/list', params);
1023
+ }
1024
+ /**
1025
+ * Get Loan Market Interest Rate
1026
+ *
1027
+ * This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.
1028
+ */
1029
+ getLendingInterestRateV3(params) {
1030
+ return this.get('api/v3/project/marketInterestRate', params);
1031
+ }
1032
+ /**
1033
+ * Purchase
1034
+ *
1035
+ * Invest credit in the market and earn interest,Please ensure that the funds are in the main(funding) account
1036
+ */
1037
+ submitLendingSubscriptionV3(params) {
1038
+ return this.postPrivate('api/v3/purchase', params);
1039
+ }
1040
+ /**
1041
+ * Modify Purchase
1042
+ *
1043
+ * This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.
1044
+ */
1045
+ updateLendingSubscriptionOrdersV3(params) {
1046
+ return this.postPrivate('api/v3/lend/purchase/update', params);
1047
+ }
1048
+ /**
1049
+ * Get Purchase Orders
1050
+ *
1051
+ * This API endpoint provides pagination query for the purchase orders.
1052
+ */
1053
+ getLendingSubscriptionOrdersV3(params) {
1054
+ return this.getPrivate('api/v3/purchase/orders', params);
1055
+ }
1056
+ /**
1057
+ * Redeem
1058
+ *
1059
+ * Redeem your loan order
1060
+ */
1061
+ submitLendingRedemptionV3(params) {
1062
+ return this.postPrivate('api/v3/redeem', params);
1063
+ }
1064
+ /**
1065
+ * Get Redeem Orders
1066
+ *
1067
+ * This API endpoint provides pagination query for the redeem orders.
1068
+ */
1069
+ getLendingRedemptionOrdersV3(params) {
1070
+ return this.getPrivate('api/v3/redeem/orders', params);
1071
+ }
1072
+ /**
1073
+ *
1074
+ * REST - MARGIN TRADING - Risk Limit
1075
+ *
1076
+ */
1077
+ /**
1078
+ * Get Margin Risk Limit
1079
+ *
1080
+ * Request via this endpoint to get the Configure and Risk limit info of the margin.
1081
+ */
1082
+ getMarginRiskLimitConfig(params) {
1083
+ return this.getPrivate('api/v3/margin/currencies', params);
1084
+ }
1085
+ /**
1086
+ *
1087
+ * REST - COPY TRADING
1088
+ *
1089
+ */
1090
+ /**
1091
+ *
1092
+ * REST - EARN
1093
+ *
1094
+ */
1095
+ /**
1096
+ /**
1097
+ * Earn Purchase
1098
+ *
1099
+ * This endpoint allows subscribing earn product
1100
+ */
1101
+ subscribeEarnFixedIncome(params) {
1102
+ return this.postPrivate('api/v1/earn/orders', params);
1103
+ }
1104
+ /**
1105
+ * Get Earn Redeem Preview
1106
+ *
1107
+ * This endpoint retrieves redemption preview information by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.
1108
+ */
1109
+ getEarnRedeemPreview(params) {
1110
+ return this.getPrivate('api/v1/earn/redeem-preview', params);
1111
+ }
1112
+ /**
1113
+ * Earn Redeem
1114
+ *
1115
+ * This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.
1116
+ */
1117
+ submitRedemption(params) {
1118
+ return this.deletePrivate('api/v1/earn/orders', params);
1119
+ }
1120
+ /**
1121
+ * Get Earn Savings Products
1122
+ *
1123
+ * This endpoint retrieves savings products. If no savings products are available, an empty list is returned.
1124
+ */
1125
+ getEarnSavingsProducts(params) {
1126
+ return this.getPrivate('api/v1/earn/saving/products', params);
1127
+ }
1128
+ /**
1129
+ * Get Earn Limited-Time Promotion Products
1130
+ *
1131
+ * This endpoint retrieves limited-time promotion products. If no products are available, an empty list is returned.
1132
+ */
1133
+ getEarnPromotionProducts(params) {
1134
+ return this.getPrivate('api/v1/earn/promotion/products', params);
1135
+ }
1136
+ /**
1137
+ * Get Earn Account Holdings
1138
+ *
1139
+ * This endpoint retrieves current holding assets of fixed income products. If no current holding assets are available, an empty list is returned.
1140
+ */
1141
+ getEarnFixedIncomeHoldAssets(params) {
1142
+ return this.getPrivate('api/v1/earn/hold-assets', params);
749
1143
  }
750
1144
  /**
751
1145
  * Get Earn Staking Products
@@ -755,6 +1149,15 @@ export class SpotClient extends BaseRestClient {
755
1149
  getEarnStakingProducts(params) {
756
1150
  return this.getPrivate('api/v1/earn/staking/products', params);
757
1151
  }
1152
+ /**
1153
+ * Get Earn KCS Staking Products
1154
+ *
1155
+ * This endpoint retrieves KCS Staking products. If no KCS Staking products are available, an empty list is returned.
1156
+ *
1157
+ */
1158
+ getEarnKcsStakingProducts(params) {
1159
+ return this.getPrivate('api/v1/earn/kcs-staking/products', params);
1160
+ }
758
1161
  /**
759
1162
  * Get Earn ETH Staking Products
760
1163
  *
@@ -767,20 +1170,22 @@ export class SpotClient extends BaseRestClient {
767
1170
  /**
768
1171
  *
769
1172
  * REST - VIP LENDING
1173
+ *
770
1174
  */
771
1175
  /**
772
- * Get information on off-exchange funding and loans
1176
+ * Get Account Detail - VIP Lending
773
1177
  *
1178
+ * The following information is only applicable to loans.
1179
+ * Get information on off-exchange funding and loans.
774
1180
  * This endpoint is only for querying accounts that are currently involved in loans.
775
- *
776
1181
  */
777
1182
  getOtcLoan() {
778
1183
  return this.getPrivate('api/v1/otc-loan/loan');
779
1184
  }
780
1185
  /**
781
- * Get information on accounts involved in off-exchange loans
1186
+ * Get Accounts - VIP Lending
782
1187
  *
783
- * This endpoint is only for querying accounts that are currently involved in off-exchange funding and loans.
1188
+ * Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending.
784
1189
  */
785
1190
  getOtcLoanAccounts() {
786
1191
  return this.getPrivate('api/v1/otc-loan/accounts');
@@ -794,13 +1199,15 @@ export class SpotClient extends BaseRestClient {
794
1199
  * Get Affiliate User Rebate Information
795
1200
  *
796
1201
  * This endpoint allows getting affiliate user rebate information.
797
- *
798
- * @param params - The parameters for the request
799
- * @returns A promise that resolves to the affiliate user rebate information
800
1202
  */
801
1203
  getAffiliateUserRebateInfo(params) {
802
1204
  return this.getPrivate('api/v2/affiliate/inviter/statistics', params);
803
1205
  }
1206
+ /**
1207
+ *
1208
+ * REST - BROKER
1209
+ *
1210
+ */
804
1211
  /**
805
1212
  * Get download link for broker rebate orders
806
1213
  *
@@ -820,5 +1227,240 @@ export class SpotClient extends BaseRestClient {
820
1227
  getPrivateWSConnectionToken() {
821
1228
  return this.postPrivate('api/v1/bullet-private');
822
1229
  }
1230
+ /**
1231
+ *
1232
+ * DEPRECATED
1233
+ *
1234
+ */
1235
+ /**
1236
+ *
1237
+ * REST - ACCOUNT - Sub-Account
1238
+ * DEPRECATED
1239
+ */
1240
+ /**
1241
+ * @deprecated This method is deprecated.
1242
+ * It is recommended to use the getSubAccountsV2() endpoint instead of this endpoint
1243
+ */
1244
+ getSubAccountsV1() {
1245
+ return this.getPrivate('api/v1/sub/user');
1246
+ }
1247
+ /**
1248
+ * @deprecated This method is deprecated.
1249
+ * It is recommended to use the getSubAccountsV2() endpoint instead of this endpoint
1250
+ */
1251
+ getSubAccountBalancesV1() {
1252
+ return this.getPrivate('api/v1/sub-accounts');
1253
+ }
1254
+ /**
1255
+ *
1256
+ * REST - FUNDING - Funding overview
1257
+ * DEPRECATED
1258
+ */
1259
+ /**
1260
+ * @deprecated This method is deprecated.
1261
+ * It is recommended to use the getMarginBalance() endpoint instead of this endpoint
1262
+ */
1263
+ getMarginBalances() {
1264
+ return this.getPrivate('api/v1/margin/account');
1265
+ }
1266
+ /**
1267
+ *
1268
+ * REST - FUNDING -Deposit
1269
+ * DEPRECATED
1270
+ */
1271
+ /**
1272
+ * @deprecated This method is deprecated. Please use createDepositAddressV3() instead.
1273
+ */
1274
+ createDepositAddress(params) {
1275
+ return this.postPrivate('api/v1/deposit-addresses', params);
1276
+ }
1277
+ /**
1278
+ * @deprecated This method is deprecated. Please use getDepositAddressesV3() instead.
1279
+ */
1280
+ getDepositAddressesV2(params) {
1281
+ return this.getPrivate('api/v2/deposit-addresses', params);
1282
+ }
1283
+ /**
1284
+ * @deprecated This method is deprecated. Please use getDepositAddressesV3() instead.
1285
+ */
1286
+ getDepositAddressV1(params) {
1287
+ return this.getPrivate('api/v1/deposit-addresses', params);
1288
+ }
1289
+ /**
1290
+ * @deprecated This method is deprecated.
1291
+ * It is recommended to use the getDeposits() endpoint instead of this endpoint
1292
+ */
1293
+ getHistoricalDepositsV1(params) {
1294
+ return this.getPrivate('api/v1/hist-deposits', params);
1295
+ }
1296
+ /**
1297
+ *
1298
+ * REST - FUNDING -Withdrawals
1299
+ * DEPRECATED
1300
+ */
1301
+ /**
1302
+ * @deprecated This method is deprecated.
1303
+ * It is recommended to use the getWithdrawals() endpoint instead of this endpoint
1304
+ */
1305
+ getHistoricalWithdrawalsV1(params) {
1306
+ return this.getPrivate('api/v1/hist-withdrawals', params);
1307
+ }
1308
+ /**
1309
+ * @deprecated This method is deprecated. Please use submitWithdrawV3() instead.
1310
+ */
1311
+ submitWithdraw(params) {
1312
+ return this.postPrivate('api/v1/withdrawals', params);
1313
+ }
1314
+ /**
1315
+ *
1316
+ * REST - FUNDING - Transfer
1317
+ * DEPRECATED
1318
+ */
1319
+ /**
1320
+ * @deprecated This method is deprecated.
1321
+ * It is recommended to use the submitFlexTransfer() endpoint instead of this endpoint
1322
+ */
1323
+ submitTransferMasterSub(params) {
1324
+ return this.postPrivate('api/v2/accounts/sub-transfer', params);
1325
+ }
1326
+ /**
1327
+ * @deprecated This method is deprecated.
1328
+ * It is recommended to use the submitFlexTransfer() endpoint instead of this endpoint
1329
+ */
1330
+ submitInnerTransfer(params) {
1331
+ return this.postPrivate('api/v2/accounts/inner-transfer', params);
1332
+ }
1333
+ /**
1334
+ *
1335
+ * REST - SPOT TRADING - Orders
1336
+ * DEPRECATED
1337
+ */
1338
+ /**
1339
+ * @deprecated This method is deprecated.
1340
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1341
+ */
1342
+ submitOrder(params) {
1343
+ return this.postPrivate('api/v1/orders', params);
1344
+ }
1345
+ /**
1346
+ * @deprecated This method is deprecated.
1347
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1348
+ */
1349
+ submitOrderTest() {
1350
+ return this.postPrivate('api/v1/orders/test');
1351
+ }
1352
+ /**
1353
+ * @deprecated This method is deprecated.
1354
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1355
+ */
1356
+ submitMultipleOrders(params) {
1357
+ return this.postPrivate('api/v1/orders/multi', params);
1358
+ }
1359
+ /**
1360
+ * @deprecated This method is deprecated.
1361
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1362
+ */
1363
+ cancelOrderById(params) {
1364
+ return this.deletePrivate(`api/v1/orders/${params.orderId}`);
1365
+ }
1366
+ /**
1367
+ * @deprecated This method is deprecated.
1368
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1369
+ */
1370
+ cancelOrderByClientOid(params) {
1371
+ return this.deletePrivate(`api/v1/order/client-order/${params.clientOid}`);
1372
+ }
1373
+ /**
1374
+ * @deprecated This method is deprecated.
1375
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1376
+ */
1377
+ cancelAllOrders(params) {
1378
+ return this.deletePrivate('api/v1/orders', params);
1379
+ }
1380
+ /**
1381
+ * @deprecated This method is deprecated.
1382
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1383
+ */
1384
+ getOrders(params) {
1385
+ return this.getPrivate('api/v1/orders', params);
1386
+ }
1387
+ /**
1388
+ * @deprecated This method is deprecated.
1389
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1390
+ */
1391
+ getRecentOrders(params) {
1392
+ return this.getPrivate('api/v1/limit/orders', params);
1393
+ }
1394
+ /**
1395
+ * @deprecated This method is deprecated.
1396
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1397
+ */
1398
+ getOrderByOrderId(params) {
1399
+ return this.getPrivate(`api/v1/orders/${params.orderId}`);
1400
+ }
1401
+ /**
1402
+ * @deprecated This method is deprecated.
1403
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1404
+ */
1405
+ getOrderByClientOid(params) {
1406
+ return this.getPrivate(`api/v1/order/client-order/${params.clientOid}`);
1407
+ }
1408
+ /**
1409
+ *
1410
+ * REST - SPOT TRADING -Fills
1411
+ * DEPRECATED
1412
+ */
1413
+ /**
1414
+ * @deprecated This method is deprecated.
1415
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1416
+ */
1417
+ getFills(params) {
1418
+ return this.getPrivate('api/v1/fills', params);
1419
+ }
1420
+ /**
1421
+ * @deprecated This method is deprecated.
1422
+ * It is recommended to use the HF trading endpoints instead of this endpoint
1423
+ */
1424
+ getRecentFills() {
1425
+ return this.getPrivate('api/v1/limit/fills');
1426
+ }
1427
+ /**
1428
+ *
1429
+ * REST - MARGIN TRADING - Orders
1430
+ * DEPRECATED
1431
+ */
1432
+ /**
1433
+ * @deprecated This method is deprecated.
1434
+ * It is recommended to use the submitHFMarginOrder() endpoint instead of this endpoint
1435
+ */
1436
+ submitMarginOrder(params) {
1437
+ return this.postPrivate('api/v1/margin/order', params);
1438
+ }
1439
+ /**
1440
+ * @deprecated This method is deprecated.
1441
+ * It is recommended to use the submitHFMarginOrderTest() endpoint instead of this endpoint
1442
+ */
1443
+ submitMarginOrderTest() {
1444
+ return this.postPrivate('api/v1/margin/order/test');
1445
+ }
1446
+ /**
1447
+ *
1448
+ * REST - MARGIN TRADING - Isolated Margin
1449
+ * DEPRECATED
1450
+ */
1451
+ /**
1452
+ * @deprecated This method is deprecated.
1453
+ * It is recommended to use the getMarginBalance() endpoint instead of this endpoint
1454
+ */
1455
+ getIsolatedMarginAccounts(params) {
1456
+ return this.getPrivate('api/v1/isolated/accounts', params);
1457
+ }
1458
+ /**
1459
+ * @deprecated This method is deprecated.
1460
+ * It is recommended to use the getIsolatedMarginBalance() endpoint instead of this endpoint
1461
+ */
1462
+ getIsolatedMarginAccount(params) {
1463
+ return this.getPrivate(`api/v1/isolated/account/${params.symbol}`);
1464
+ }
823
1465
  }
824
1466
  //# sourceMappingURL=SpotClient.js.map