kucoin-api 2.5.1 → 2.5.3

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.
Files changed (37) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/BrokerClient.d.ts +23 -2
  3. package/dist/cjs/BrokerClient.js +23 -0
  4. package/dist/cjs/BrokerClient.js.map +1 -1
  5. package/dist/cjs/FuturesClient.d.ts +1 -0
  6. package/dist/cjs/FuturesClient.js +1 -0
  7. package/dist/cjs/FuturesClient.js.map +1 -1
  8. package/dist/cjs/SpotClient.d.ts +1 -0
  9. package/dist/cjs/SpotClient.js +1 -0
  10. package/dist/cjs/SpotClient.js.map +1 -1
  11. package/dist/cjs/UnifiedAPIClient.d.ts +93 -4
  12. package/dist/cjs/UnifiedAPIClient.js +124 -2
  13. package/dist/cjs/UnifiedAPIClient.js.map +1 -1
  14. package/dist/cjs/types/request/broker.types.d.ts +32 -1
  15. package/dist/cjs/types/request/uta-types.d.ts +103 -8
  16. package/dist/cjs/types/response/broker.types.d.ts +15 -1
  17. package/dist/cjs/types/response/futures.types.d.ts +1 -1
  18. package/dist/cjs/types/response/uta-types.d.ts +150 -10
  19. package/dist/mjs/BrokerClient.d.ts +23 -2
  20. package/dist/mjs/BrokerClient.js +23 -0
  21. package/dist/mjs/BrokerClient.js.map +1 -1
  22. package/dist/mjs/FuturesClient.d.ts +1 -0
  23. package/dist/mjs/FuturesClient.js +1 -0
  24. package/dist/mjs/FuturesClient.js.map +1 -1
  25. package/dist/mjs/SpotClient.d.ts +1 -0
  26. package/dist/mjs/SpotClient.js +1 -0
  27. package/dist/mjs/SpotClient.js.map +1 -1
  28. package/dist/mjs/UnifiedAPIClient.d.ts +93 -4
  29. package/dist/mjs/UnifiedAPIClient.js +124 -2
  30. package/dist/mjs/UnifiedAPIClient.js.map +1 -1
  31. package/dist/mjs/types/request/broker.types.d.ts +32 -1
  32. package/dist/mjs/types/request/uta-types.d.ts +103 -8
  33. package/dist/mjs/types/response/broker.types.d.ts +15 -1
  34. package/dist/mjs/types/response/futures.types.d.ts +1 -1
  35. package/dist/mjs/types/response/uta-types.d.ts +150 -10
  36. package/llms.txt +11030 -10418
  37. package/package.json +2 -4
@@ -43,6 +43,7 @@ export interface BrokerSubAccountApi {
43
43
  }
44
44
  export type BrokerTransferAccountType = 'MAIN' | 'TRADE' | 'CONTRACT' | 'MARGIN' | 'ISOLATED';
45
45
  export type BrokerTransferStatus = 'PROCESSING' | 'SUCCESS' | 'FAILURE';
46
+ export type BrokerDepositStatus = 'PROCESSING' | 'SUCCESS' | 'FAILURE' | 'PRE_SUCCESS' | 'WAIT_TRM_MGT' | 'TRM_MGT_REJECTED' | 'ROLLBACKING' | 'ROLLBACK' | 'WAIT_RISK_MGT' | 'RISK_MGT_REJECTED';
46
47
  export interface BrokerTransferHistory {
47
48
  orderId: string;
48
49
  currency: string;
@@ -67,12 +68,25 @@ export interface BrokerDepositRecord {
67
68
  currency: string;
68
69
  isInner: boolean;
69
70
  walletTxId: string;
70
- status: BrokerTransferStatus;
71
+ status: BrokerDepositStatus;
71
72
  remark: string;
72
73
  chain: string;
73
74
  createdAt: number;
74
75
  updatedAt: number;
76
+ statusRemark?: string;
77
+ preConfirms?: number;
78
+ confirms?: number;
79
+ currentConfirms?: number;
80
+ }
81
+ export interface FastApiWithdrawApplyInitialResponse {
82
+ transactionId: string;
83
+ allFactors: string[][];
84
+ sentFactors: string[][];
85
+ }
86
+ export interface FastApiWithdrawApplyCompleteResponse {
87
+ withdrawalId: string;
75
88
  }
89
+ export type FastApiWithdrawApplyResponse = FastApiWithdrawApplyInitialResponse | FastApiWithdrawApplyCompleteResponse;
76
90
  export type BrokerWithdrawalStatus = 'PROCESSING' | 'WALLET_PROCESSING' | 'REVIEW' | 'SUCCESS' | 'FAILURE';
77
91
  export interface BrokerWithdrawalRecord {
78
92
  id: string;
@@ -362,7 +362,7 @@ export interface FuturesFill {
362
362
  settleCurrency: string;
363
363
  orderType: 'market' | 'limit';
364
364
  displayType: 'limit' | 'market' | 'limit_stop' | 'market_stop';
365
- tradeType: 'trade' | 'cancel' | 'liquid' | 'adl' | 'settlement';
365
+ tradeType: 'trade' | 'liquid' | 'adl' | 'settlement';
366
366
  subTradeType: string | null;
367
367
  /** Trade time (execution time), standardized to nanoseconds as of 2026.01.12 */
368
368
  tradeTime: number;
@@ -174,6 +174,12 @@ export interface GetCurrentFundingRateResponseUTA {
174
174
  fundingTime: number;
175
175
  fundingRateCap: number;
176
176
  fundingRateFloor: number;
177
+ /** Current funding settlement interval (ms); as of 2026.04.19 */
178
+ currentGranularity: number;
179
+ /** New interval after change (ms); as of 2026.04.19 */
180
+ newGranularity: number;
181
+ /** When newGranularity takes effect (ms); as of 2026.04.19 */
182
+ newGranularityStartTime: number;
177
183
  }
178
184
  export interface FundingRateHistoryItemUTA {
179
185
  fundingRate: number;
@@ -183,6 +189,43 @@ export interface GetHistoryFundingRateResponseUTA {
183
189
  symbol: string;
184
190
  list: FundingRateHistoryItemUTA[];
185
191
  }
192
+ export interface ModifyMarginCrossLeverageResponseUTA {
193
+ currency?: string;
194
+ leverage?: string;
195
+ }
196
+ /** One row from Get Leverage (UTA) — margin uses currency, futures uses symbol */
197
+ export interface GetLeverageItemUTA {
198
+ leverage: string;
199
+ marginMode: string;
200
+ currency?: string;
201
+ symbol?: string;
202
+ }
203
+ export interface PrivateFundingFeeHistoryItemUTA {
204
+ symbol: string;
205
+ marginMode: 'CROSS' | 'ISOLATED';
206
+ fundingRate: string;
207
+ markPrice: string;
208
+ size: string;
209
+ positionValue: string;
210
+ fundingFee: string;
211
+ settleCurrency: string;
212
+ settlementTime: number;
213
+ }
214
+ export interface GetPrivateFundingFeeHistoryResponseUTA {
215
+ lastId: number;
216
+ items: PrivateFundingFeeHistoryItemUTA[];
217
+ }
218
+ export interface GetBorrowingRatesAndLimitsResponseUTA {
219
+ currentRateHourly: string;
220
+ currentRateDaily: string;
221
+ borrowLimitTotal: string;
222
+ borrowLimitTotalHold: string;
223
+ borrowLimitHold: string;
224
+ interestFreeBorrowLimit: string;
225
+ }
226
+ export interface BorrowableCurrencyUTA {
227
+ currency: string;
228
+ }
186
229
  export interface GetCrossMarginConfigResponseUTA {
187
230
  maxLeverage: number;
188
231
  alertRiskRatio: string;
@@ -203,6 +246,8 @@ export interface AccountCurrencyUTA {
203
246
  available: string;
204
247
  balance: string;
205
248
  equity: string;
249
+ /** Potential borrow reserved by open orders (UTA; as of 2026.04.19) */
250
+ potentialBorrow?: string;
206
251
  liability?: string;
207
252
  totalCrossMargin?: string;
208
253
  crossPosMargin?: string;
@@ -251,7 +296,7 @@ export interface GetSubAccountResponseUTA {
251
296
  export interface GetTransferQuotasResponseUTA {
252
297
  currency: string;
253
298
  transferable: string;
254
- accountType: string;
299
+ accountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'ISOLATED' | 'UNIFIED';
255
300
  }
256
301
  export interface FlexTransferResponseUTA {
257
302
  orderId: string;
@@ -281,6 +326,7 @@ export interface AccountLedgerItemUTA {
281
326
  currency: string;
282
327
  direction: 'IN' | 'OUT';
283
328
  businessType: string;
329
+ /** Change in funds balance. Always positive as of 2026.04.28; use direction (IN/OUT) for flow. */
284
330
  amount: string;
285
331
  balance: string;
286
332
  fee: string;
@@ -310,18 +356,78 @@ export interface DepositAddressUTA {
310
356
  address: string;
311
357
  memo: string;
312
358
  chainId: string;
313
- to: 'MAIN' | 'TRADE';
359
+ to: 'FUNDING' | 'SPOT' | 'UNIFIED';
314
360
  currency: string;
315
361
  contractAddress: string;
316
362
  chainName: string;
317
363
  expirationDate: string;
318
364
  remark: string;
319
365
  }
366
+ export interface WithdrawalQuotasUTA {
367
+ currency: string;
368
+ limitBTCAmount: string;
369
+ usedBTCAmount: string;
370
+ quotaCurrency: string;
371
+ limitQuotaCurrencyAmount: string;
372
+ usedQuotaCurrencyAmount: string;
373
+ remainAmount: string;
374
+ availableAmount: string;
375
+ withdrawMinFee: string;
376
+ innerWithdrawMinFee: string;
377
+ withdrawMinSize: string;
378
+ isWithdrawEnabled: boolean;
379
+ precision: number;
380
+ reason: string | null;
381
+ lockedAmount: string;
382
+ chainId: string;
383
+ chainName: string;
384
+ }
385
+ export interface SubmitWithdrawResponseUTA {
386
+ withdrawalId: string;
387
+ }
388
+ export interface AddSubAccountResponseUTA {
389
+ uid: number;
390
+ subName: string;
391
+ remarks: string;
392
+ access: string;
393
+ }
394
+ export interface AddSubAccountApiResponseUTA {
395
+ subName: string;
396
+ remark: string;
397
+ apiKey: string;
398
+ apiSecret: string;
399
+ apiVersion: number;
400
+ passphrase: string;
401
+ permission: string;
402
+ ipWhitelist?: string;
403
+ createdAt: number;
404
+ }
405
+ export interface KYCRegionUTA {
406
+ code: string;
407
+ enName: string;
408
+ }
409
+ export interface ApiKeyInfoUTA {
410
+ uid: number;
411
+ parentUid?: number;
412
+ region: string;
413
+ kycStatus: 0 | 1;
414
+ subName?: string;
415
+ remark: string;
416
+ apiKey: string;
417
+ apiVersion: number;
418
+ permission: string;
419
+ ipWhitelist?: string;
420
+ isMaster: boolean;
421
+ createdAt: number;
422
+ expiredAt?: number | null;
423
+ thirdPartyApp?: string;
424
+ siteType?: 'global' | 'turkey' | 'australia' | 'europe' | 'thailand';
425
+ }
320
426
  /**
321
427
  * Order Response Types
322
428
  */
323
429
  export interface PlaceOrderResponseUTA {
324
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
430
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
325
431
  orderId: string;
326
432
  clientOid: string;
327
433
  /** Timestamp when system completes order request in nanoseconds. Classic mode not supported */
@@ -339,11 +445,11 @@ export interface BatchPlaceOrderItemResponseUTA {
339
445
  msg?: string;
340
446
  }
341
447
  export interface BatchPlaceOrderResponseUTA {
342
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
448
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
343
449
  items: BatchPlaceOrderItemResponseUTA[];
344
450
  }
345
451
  export interface OrderDetailsUTA {
346
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
452
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
347
453
  orderId: string;
348
454
  clientOid: string;
349
455
  /**
@@ -404,12 +510,12 @@ export interface GetOpenOrderListResponseUTA {
404
510
  pageSize?: number;
405
511
  totalNum?: number;
406
512
  totalPage?: number;
407
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
513
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
408
514
  items: OrderDetailsUTA[];
409
515
  }
410
516
  export interface GetOrderHistoryResponseUTA {
411
517
  lastId: number;
412
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
518
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
413
519
  items: OrderDetailsUTA[];
414
520
  }
415
521
  export interface TradeHistoryItemUTA {
@@ -435,11 +541,11 @@ export interface TradeHistoryItemUTA {
435
541
  }
436
542
  export interface GetTradeHistoryResponseUTA {
437
543
  lastId: number;
438
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
544
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
439
545
  items: TradeHistoryItemUTA[];
440
546
  }
441
547
  export interface CancelOrderResponseUTA {
442
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
548
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
443
549
  orderId?: string;
444
550
  clientOid?: string;
445
551
  /** Timestamp when system completes order cancellation request (nanoseconds). Only for unified accounts */
@@ -454,7 +560,7 @@ export interface BatchCancelOrderItemResponseUTA {
454
560
  ts?: number;
455
561
  }
456
562
  export interface BatchCancelOrdersResponseUTA {
457
- tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
563
+ tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
458
564
  items: BatchCancelOrderItemResponseUTA[];
459
565
  }
460
566
  /** Batch cancel by symbol - Classic response (orderId list) */
@@ -490,6 +596,8 @@ export interface PositionUTA {
490
596
  size: string;
491
597
  entryPrice: string;
492
598
  positionValue: string;
599
+ /** Margin occupied by the futures position */
600
+ positionMargin: string;
493
601
  markPrice: string;
494
602
  leverage: string;
495
603
  unrealizedPnL: string;
@@ -499,6 +607,12 @@ export interface PositionUTA {
499
607
  maintenanceMargin: string;
500
608
  /** Timestamp when position was first opened (nanoseconds, standardized as of 2026.01.12) */
501
609
  creationTime: number;
610
+ /** Estimated liquidation price (as of 2026.04.09) */
611
+ liquidationPrice: string;
612
+ /** ADL ranking percentile (0.12 = 12%). Added 2026.05.15 */
613
+ adlPercentage: string;
614
+ /** Isolated futures risk ratio (0.65 = 65%). Empty for cross margin positions */
615
+ riskRatio: string;
502
616
  }
503
617
  export interface PositionHistoryItemUTA {
504
618
  closeId: string;
@@ -523,6 +637,19 @@ export interface GetPositionsHistoryResponseUTA {
523
637
  items: PositionHistoryItemUTA[];
524
638
  lastId?: number;
525
639
  }
640
+ /** Row from Get Third-Party Custody Currencies */
641
+ export interface ThirdPartyCustodyCurrencyUTA {
642
+ custodian: string;
643
+ currency: string;
644
+ precision: number;
645
+ }
646
+ /** Row from Get Third-Party Custody Account Currency Limits */
647
+ export interface ThirdPartyCustodyQuotaUTA {
648
+ custodian: string;
649
+ currency: string;
650
+ /** Remaining custodial quota (shared across custodian sub-accounts under master) */
651
+ custodyQuota: string;
652
+ }
526
653
  export interface PositionTierUTA {
527
654
  symbol: string;
528
655
  tier: number;
@@ -532,3 +659,16 @@ export interface PositionTierUTA {
532
659
  initialMarginRate: string;
533
660
  maintainMarginRate: string;
534
661
  }
662
+ export interface BatchModifyMarginModeItemUTA {
663
+ symbol: string;
664
+ marginMode: string;
665
+ code: string;
666
+ msg: string;
667
+ }
668
+ export interface BatchModifyMarginModeResponseUTA {
669
+ ts: number;
670
+ items: BatchModifyMarginModeItemUTA[];
671
+ }
672
+ export interface ModifyIsolatedFuturesMarginResponseUTA {
673
+ ts: number;
674
+ }