kucoin-api 2.6.2 → 2.6.4
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 +1 -3
- package/dist/cjs/BrokerClient.d.ts +12 -2
- package/dist/cjs/BrokerClient.js +14 -0
- package/dist/cjs/BrokerClient.js.map +1 -1
- package/dist/cjs/UnifiedAPIClient.d.ts +23 -8
- package/dist/cjs/UnifiedAPIClient.js +104 -71
- package/dist/cjs/UnifiedAPIClient.js.map +1 -1
- package/dist/cjs/types/request/broker.types.d.ts +13 -0
- package/dist/cjs/types/request/uta-types.d.ts +62 -7
- package/dist/cjs/types/response/broker.types.d.ts +21 -0
- package/dist/cjs/types/response/futures.types.d.ts +4 -0
- package/dist/cjs/types/response/spot-trading.d.ts +4 -0
- package/dist/cjs/types/response/uta-types.d.ts +125 -27
- package/dist/cjs/types/websockets/ws-events.d.ts +63 -0
- package/dist/mjs/BrokerClient.d.ts +12 -2
- package/dist/mjs/BrokerClient.js +14 -0
- package/dist/mjs/BrokerClient.js.map +1 -1
- package/dist/mjs/UnifiedAPIClient.d.ts +23 -8
- package/dist/mjs/UnifiedAPIClient.js +104 -71
- package/dist/mjs/UnifiedAPIClient.js.map +1 -1
- package/dist/mjs/types/request/broker.types.d.ts +13 -0
- package/dist/mjs/types/request/uta-types.d.ts +62 -7
- package/dist/mjs/types/response/broker.types.d.ts +21 -0
- package/dist/mjs/types/response/futures.types.d.ts +4 -0
- package/dist/mjs/types/response/spot-trading.d.ts +4 -0
- package/dist/mjs/types/response/uta-types.d.ts +125 -27
- package/dist/mjs/types/websockets/ws-events.d.ts +63 -0
- package/llms.txt +733 -245
- package/package.json +13 -5
package/llms.txt
CHANGED
|
@@ -130,6 +130,7 @@ src/
|
|
|
130
130
|
webpack/
|
|
131
131
|
webpack.config.cjs
|
|
132
132
|
.gitignore
|
|
133
|
+
.npmrc
|
|
133
134
|
.nvmrc
|
|
134
135
|
.prettierrc
|
|
135
136
|
eslint.config.cjs
|
|
@@ -1833,8 +1834,14 @@ export interface SymbolInfo {
|
|
|
1833
1834
|
callauctionSecondStageStartTime: number | null;
|
|
1834
1835
|
callauctionThirdStageStartTime: number | null;
|
|
1835
1836
|
tradingStartTime: number | null;
|
|
1837
|
+
assetClass?: string;
|
|
1838
|
+
subMarketType?: string;
|
|
1839
|
+
/** @deprecated Prefer assetClass and subMarketType (2026.09.21) */
|
|
1840
|
+
marketType?: string;
|
|
1836
1841
|
}
|
|
1837
1842
|
⋮----
|
|
1843
|
+
/** @deprecated Prefer assetClass and subMarketType (2026.09.21) */
|
|
1844
|
+
⋮----
|
|
1838
1845
|
export interface Ticker {
|
|
1839
1846
|
sequence: string;
|
|
1840
1847
|
price: string;
|
|
@@ -4881,6 +4888,12 @@ export interface WsConnectionInfoV2 {
|
|
|
4881
4888
|
instanceServers: undefined;
|
|
4882
4889
|
}
|
|
4883
4890
|
|
|
4891
|
+
================
|
|
4892
|
+
File: .npmrc
|
|
4893
|
+
================
|
|
4894
|
+
min-release-age=30
|
|
4895
|
+
save-exact=true
|
|
4896
|
+
|
|
4884
4897
|
================
|
|
4885
4898
|
File: .nvmrc
|
|
4886
4899
|
================
|
|
@@ -6948,6 +6961,22 @@ export interface BrokerTransferRequest {
|
|
|
6948
6961
|
specialAccountType: BrokerAccountType;
|
|
6949
6962
|
}
|
|
6950
6963
|
⋮----
|
|
6964
|
+
export type BrokerMarkupTradeType = 'SPOT' | 'FUTURES';
|
|
6965
|
+
export type BrokerMarkupEffectiveType = 'DEFAULT' | 'UID';
|
|
6966
|
+
⋮----
|
|
6967
|
+
export interface SetBrokerMarkupFeeRequest {
|
|
6968
|
+
tradeType: BrokerMarkupTradeType;
|
|
6969
|
+
effectiveType: BrokerMarkupEffectiveType;
|
|
6970
|
+
makerMarkUp: number;
|
|
6971
|
+
takerMarkUp: number;
|
|
6972
|
+
effectAt?: number;
|
|
6973
|
+
subUids?: string;
|
|
6974
|
+
}
|
|
6975
|
+
⋮----
|
|
6976
|
+
export interface GetBrokerMarkupFeeRequest {
|
|
6977
|
+
subUids?: string;
|
|
6978
|
+
}
|
|
6979
|
+
⋮----
|
|
6951
6980
|
export interface GetBrokerDepositListRequest {
|
|
6952
6981
|
currency?: string;
|
|
6953
6982
|
status?:
|
|
@@ -7558,6 +7587,30 @@ export interface BrokerWithdrawalRecord {
|
|
|
7558
7587
|
createdAt: number;
|
|
7559
7588
|
updatedAt: number;
|
|
7560
7589
|
}
|
|
7590
|
+
⋮----
|
|
7591
|
+
export interface SetBrokerMarkupFeeResponse {
|
|
7592
|
+
effectiveType: string;
|
|
7593
|
+
subUids: string | null;
|
|
7594
|
+
tradeType: string;
|
|
7595
|
+
makerMarkUp: string;
|
|
7596
|
+
takerMarkUp: string;
|
|
7597
|
+
effectAt: number;
|
|
7598
|
+
createdAt: number;
|
|
7599
|
+
}
|
|
7600
|
+
⋮----
|
|
7601
|
+
export interface BrokerMarkupFeeItem {
|
|
7602
|
+
uid?: number;
|
|
7603
|
+
spotMakerMarkUp: string;
|
|
7604
|
+
spotTakerMarkUp: string;
|
|
7605
|
+
futuresMakerMarkUp: string;
|
|
7606
|
+
futuresTakerMarkUp: string;
|
|
7607
|
+
updatedAt: number;
|
|
7608
|
+
}
|
|
7609
|
+
⋮----
|
|
7610
|
+
export interface GetBrokerMarkupFeeResponse {
|
|
7611
|
+
defaultMarkUp: BrokerMarkupFeeItem;
|
|
7612
|
+
items: BrokerMarkupFeeItem[];
|
|
7613
|
+
}
|
|
7561
7614
|
|
|
7562
7615
|
================
|
|
7563
7616
|
File: src/types/response/futures.types.ts
|
|
@@ -7847,6 +7900,10 @@ export interface FuturesSymbolInfo {
|
|
|
7847
7900
|
mmrLimit: number;
|
|
7848
7901
|
mmrLevConstant: number;
|
|
7849
7902
|
supportCross: boolean;
|
|
7903
|
+
assetClass?: string;
|
|
7904
|
+
subMarketType?: string;
|
|
7905
|
+
/** @deprecated Prefer assetClass and subMarketType (2026.09.21) */
|
|
7906
|
+
marketType?: string;
|
|
7850
7907
|
}
|
|
7851
7908
|
⋮----
|
|
7852
7909
|
/** Display symbol for multilingual compatibility (added 2025.12.26 & 2026.01.12) */
|
|
@@ -7856,6 +7913,8 @@ export interface FuturesSymbolInfo {
|
|
|
7856
7913
|
effectiveFundingRateCycleStartTime: number; // Funding rate time interval (fundingRateGranularity) configuration start effective time
|
|
7857
7914
|
currentFundingRateGranularity: number; // Current effective funding rate period granularity (e.g., 8 hours/4 hours)
|
|
7858
7915
|
⋮----
|
|
7916
|
+
/** @deprecated Prefer assetClass and subMarketType (2026.09.21) */
|
|
7917
|
+
⋮----
|
|
7859
7918
|
export interface TickerDetail {
|
|
7860
7919
|
sequence: number; // Sequence number
|
|
7861
7920
|
symbol: string; // Symbol
|
|
@@ -8529,8 +8588,10 @@ import {
|
|
|
8529
8588
|
FastApiWithdrawApplyRequest,
|
|
8530
8589
|
GetBrokerDepositListRequest,
|
|
8531
8590
|
GetBrokerInfoRequest,
|
|
8591
|
+
GetBrokerMarkupFeeRequest,
|
|
8532
8592
|
GetBrokerSubAccountApisRequest,
|
|
8533
8593
|
GetBrokerSubAccountsRequest,
|
|
8594
|
+
SetBrokerMarkupFeeRequest,
|
|
8534
8595
|
UpdateBrokerSubAccountApiRequest,
|
|
8535
8596
|
} from './types/request/broker.types.js';
|
|
8536
8597
|
import {
|
|
@@ -8542,7 +8603,9 @@ import {
|
|
|
8542
8603
|
CreateBrokerSubAccountApiResponse,
|
|
8543
8604
|
CreateBrokerSubAccountResponse,
|
|
8544
8605
|
FastApiWithdrawApplyResponse,
|
|
8606
|
+
GetBrokerMarkupFeeResponse,
|
|
8545
8607
|
GetBrokerSubAccountsResponse,
|
|
8608
|
+
SetBrokerMarkupFeeResponse,
|
|
8546
8609
|
} from './types/response/broker.types.js';
|
|
8547
8610
|
import { APISuccessResponse } from './types/response/shared.types.js';
|
|
8548
8611
|
⋮----
|
|
@@ -8760,6 +8823,22 @@ getBrokerRebate(params: {
|
|
|
8760
8823
|
applyFastWithdrawal(
|
|
8761
8824
|
params: FastApiWithdrawApplyRequest,
|
|
8762
8825
|
): Promise<APISuccessResponse<FastApiWithdrawApplyResponse>>
|
|
8826
|
+
⋮----
|
|
8827
|
+
/**
|
|
8828
|
+
* Set Markup Fee
|
|
8829
|
+
* Maker and taker markup must be set together. Both 0 cancels markup.
|
|
8830
|
+
*/
|
|
8831
|
+
setMarkupFee(
|
|
8832
|
+
params: SetBrokerMarkupFeeRequest,
|
|
8833
|
+
): Promise<APISuccessResponse<SetBrokerMarkupFeeResponse>>
|
|
8834
|
+
⋮----
|
|
8835
|
+
/**
|
|
8836
|
+
* Get Markup Fee
|
|
8837
|
+
* Default markup plus optional per-UID items.
|
|
8838
|
+
*/
|
|
8839
|
+
getMarkupFee(
|
|
8840
|
+
params?: GetBrokerMarkupFeeRequest,
|
|
8841
|
+
): Promise<APISuccessResponse<GetBrokerMarkupFeeResponse>>
|
|
8763
8842
|
|
|
8764
8843
|
================
|
|
8765
8844
|
File: webpack/webpack.config.cjs
|
|
@@ -8794,6 +8873,257 @@ coverage
|
|
|
8794
8873
|
privaterepotracker
|
|
8795
8874
|
restClientRegex.ts
|
|
8796
8875
|
|
|
8876
|
+
================
|
|
8877
|
+
File: src/types/websockets/ws-events.ts
|
|
8878
|
+
================
|
|
8879
|
+
export interface WsDataEvent<TData = any, TWSKey = string> {
|
|
8880
|
+
data: TData;
|
|
8881
|
+
table: string;
|
|
8882
|
+
wsKey: TWSKey;
|
|
8883
|
+
}
|
|
8884
|
+
⋮----
|
|
8885
|
+
export interface MessageEventLike<TDataType = string> {
|
|
8886
|
+
target: WebSocket;
|
|
8887
|
+
type: 'message';
|
|
8888
|
+
data: TDataType;
|
|
8889
|
+
}
|
|
8890
|
+
⋮----
|
|
8891
|
+
export function isMessageEvent(msg: unknown): msg is MessageEventLike
|
|
8892
|
+
⋮----
|
|
8893
|
+
/**
|
|
8894
|
+
* UTA WebSocket private balance push (`channel: balance`).
|
|
8895
|
+
* Field `cS` added 2026.07.01 (platform-level margin collateral status).
|
|
8896
|
+
* @see https://www.kucoin.com/docs-new/3470231w0
|
|
8897
|
+
*/
|
|
8898
|
+
export interface WsUTABalancePushData {
|
|
8899
|
+
U: number | string;
|
|
8900
|
+
a: string;
|
|
8901
|
+
b: string;
|
|
8902
|
+
c: string;
|
|
8903
|
+
e?: string;
|
|
8904
|
+
h: string;
|
|
8905
|
+
l?: string;
|
|
8906
|
+
/** Platform-level margin collateral status (UNIFIED balance pushes) */
|
|
8907
|
+
cS?: string;
|
|
8908
|
+
}
|
|
8909
|
+
⋮----
|
|
8910
|
+
/** Platform-level margin collateral status (UNIFIED balance pushes) */
|
|
8911
|
+
⋮----
|
|
8912
|
+
export interface WsUTABalancePush {
|
|
8913
|
+
P: number;
|
|
8914
|
+
T: string;
|
|
8915
|
+
d: WsUTABalancePushData;
|
|
8916
|
+
}
|
|
8917
|
+
⋮----
|
|
8918
|
+
/**
|
|
8919
|
+
* UTA WebSocket private position push (`channel: position` / `positionAll`).
|
|
8920
|
+
* Fields `pM` and `r` added 2026.06.03; `adl` added 2026.05.15.
|
|
8921
|
+
* @see https://www.kucoin.com/docs-new/3470233w0
|
|
8922
|
+
*/
|
|
8923
|
+
export interface WsUTAPositionPushData {
|
|
8924
|
+
O?: number;
|
|
8925
|
+
U: number;
|
|
8926
|
+
l?: string;
|
|
8927
|
+
q: string;
|
|
8928
|
+
s: string;
|
|
8929
|
+
bP?: string;
|
|
8930
|
+
eP?: string;
|
|
8931
|
+
iM?: string;
|
|
8932
|
+
lP?: string;
|
|
8933
|
+
mM: string;
|
|
8934
|
+
/** Mark price */
|
|
8935
|
+
mP?: string;
|
|
8936
|
+
pV?: string;
|
|
8937
|
+
pi?: string;
|
|
8938
|
+
mmr?: string;
|
|
8939
|
+
mtM?: string;
|
|
8940
|
+
rPL?: string;
|
|
8941
|
+
uPL?: string;
|
|
8942
|
+
/** Margin occupied by the futures position (as of 2026.06.03) */
|
|
8943
|
+
pM?: string;
|
|
8944
|
+
/** Isolated futures risk ratio, e.g. 0.65 = 65% (as of 2026.06.03) */
|
|
8945
|
+
r?: string;
|
|
8946
|
+
/** ADL ranking percentile, e.g. 0.46 = 46% (as of 2026.05.15) */
|
|
8947
|
+
adl?: string;
|
|
8948
|
+
}
|
|
8949
|
+
⋮----
|
|
8950
|
+
/** Mark price */
|
|
8951
|
+
⋮----
|
|
8952
|
+
/** Margin occupied by the futures position (as of 2026.06.03) */
|
|
8953
|
+
⋮----
|
|
8954
|
+
/** Isolated futures risk ratio, e.g. 0.65 = 65% (as of 2026.06.03) */
|
|
8955
|
+
⋮----
|
|
8956
|
+
/** ADL ranking percentile, e.g. 0.46 = 46% (as of 2026.05.15) */
|
|
8957
|
+
⋮----
|
|
8958
|
+
export interface WsUTAPositionPush {
|
|
8959
|
+
P: number;
|
|
8960
|
+
T: string;
|
|
8961
|
+
d: WsUTAPositionPushData;
|
|
8962
|
+
}
|
|
8963
|
+
⋮----
|
|
8964
|
+
/**
|
|
8965
|
+
* UTA WebSocket public Funding Fee channel (`channel: fundingFee`, FUTURES).
|
|
8966
|
+
* Added 2026.07.01.
|
|
8967
|
+
*/
|
|
8968
|
+
export interface WsUTAFundingFeePublicPush {
|
|
8969
|
+
T: string;
|
|
8970
|
+
P: number;
|
|
8971
|
+
d: {
|
|
8972
|
+
s: string;
|
|
8973
|
+
fR?: string;
|
|
8974
|
+
fT?: number;
|
|
8975
|
+
/** Current funding rate (UTA V2 `funding-fee` channel) */
|
|
8976
|
+
fr?: string;
|
|
8977
|
+
/** Funding time (UTA V2) */
|
|
8978
|
+
ft?: number;
|
|
8979
|
+
/** Last settled funding fee rate (UTA V2 2026.08.27) */
|
|
8980
|
+
lfr?: string;
|
|
8981
|
+
nt?: number;
|
|
8982
|
+
gl?: number;
|
|
8983
|
+
fc?: string;
|
|
8984
|
+
ff?: string;
|
|
8985
|
+
M?: number;
|
|
8986
|
+
[key: string]: string | number | boolean | undefined;
|
|
8987
|
+
};
|
|
8988
|
+
}
|
|
8989
|
+
⋮----
|
|
8990
|
+
/** Current funding rate (UTA V2 `funding-fee` channel) */
|
|
8991
|
+
⋮----
|
|
8992
|
+
/** Funding time (UTA V2) */
|
|
8993
|
+
⋮----
|
|
8994
|
+
/** Last settled funding fee rate (UTA V2 2026.08.27) */
|
|
8995
|
+
⋮----
|
|
8996
|
+
/**
|
|
8997
|
+
* UTA WebSocket public All Funding Fee Rates channel (`channel: funding-fee-all-symbols`).
|
|
8998
|
+
* Added 2026.08.27.
|
|
8999
|
+
* @see https://www.kucoin.com/docs-new/3470412w0
|
|
9000
|
+
*/
|
|
9001
|
+
export interface WsUTAAllFundingFeeRatesPublicPush {
|
|
9002
|
+
T: string;
|
|
9003
|
+
P: number;
|
|
9004
|
+
d: WsUTAFundingFeePublicPush['d'][];
|
|
9005
|
+
}
|
|
9006
|
+
⋮----
|
|
9007
|
+
/**
|
|
9008
|
+
* UTA WebSocket private execution push (`channel: execution`).
|
|
9009
|
+
* Field `fP` added 2026.09.21. Empty before 2026.09.05 (UTC-8).
|
|
9010
|
+
* When fT is ADL/LIQUID/SETTLEMENT, q is a positive value (2026.08.20).
|
|
9011
|
+
* @see https://www.kucoin.com/docs-new/3470407w0
|
|
9012
|
+
*/
|
|
9013
|
+
export interface WsUTAExecutionPushData {
|
|
9014
|
+
oi?: string;
|
|
9015
|
+
s?: string;
|
|
9016
|
+
S?: string;
|
|
9017
|
+
oT?: string;
|
|
9018
|
+
p?: string;
|
|
9019
|
+
q?: string;
|
|
9020
|
+
ti?: string;
|
|
9021
|
+
E?: number;
|
|
9022
|
+
lR?: string;
|
|
9023
|
+
f?: string;
|
|
9024
|
+
fC?: string;
|
|
9025
|
+
fT?: string;
|
|
9026
|
+
ci?: string;
|
|
9027
|
+
/** Fill PnL. Empty string when data is before 2026.09.05 (UTC-8) */
|
|
9028
|
+
fP?: string;
|
|
9029
|
+
[key: string]: string | number | boolean | undefined;
|
|
9030
|
+
}
|
|
9031
|
+
⋮----
|
|
9032
|
+
/** Fill PnL. Empty string when data is before 2026.09.05 (UTC-8) */
|
|
9033
|
+
⋮----
|
|
9034
|
+
export interface WsUTAExecutionPush {
|
|
9035
|
+
T: string;
|
|
9036
|
+
P: number;
|
|
9037
|
+
d: WsUTAExecutionPushData;
|
|
9038
|
+
}
|
|
9039
|
+
⋮----
|
|
9040
|
+
/**
|
|
9041
|
+
* UTA WebSocket private order push (`channel: order` / `orderAll`).
|
|
9042
|
+
* Field `brokerTag` added 2026.09.21.
|
|
9043
|
+
* @see https://www.kucoin.com/docs-new/3470228w0
|
|
9044
|
+
*/
|
|
9045
|
+
export interface WsUTAOrderPushData {
|
|
9046
|
+
brokerTag?: string;
|
|
9047
|
+
[key: string]: string | number | boolean | undefined;
|
|
9048
|
+
}
|
|
9049
|
+
⋮----
|
|
9050
|
+
export interface WsUTAOrderPush {
|
|
9051
|
+
T: string;
|
|
9052
|
+
P: number;
|
|
9053
|
+
d: WsUTAOrderPushData;
|
|
9054
|
+
}
|
|
9055
|
+
⋮----
|
|
9056
|
+
/**
|
|
9057
|
+
* UTA WebSocket public Mark Price channel (`channel: markPrice`, FUTURES).
|
|
9058
|
+
* Added 2026.07.01.
|
|
9059
|
+
*/
|
|
9060
|
+
export interface WsUTAMarkPricePublicPush {
|
|
9061
|
+
T: string;
|
|
9062
|
+
P: number;
|
|
9063
|
+
d: {
|
|
9064
|
+
s: string;
|
|
9065
|
+
mP?: string;
|
|
9066
|
+
M?: number;
|
|
9067
|
+
[key: string]: string | number | boolean | undefined;
|
|
9068
|
+
};
|
|
9069
|
+
}
|
|
9070
|
+
⋮----
|
|
9071
|
+
/**
|
|
9072
|
+
* UTA WebSocket public Call Auction Info channel (`channel: callAuctionInfo`).
|
|
9073
|
+
* Added 2026.07.17.
|
|
9074
|
+
* @see https://www.kucoin.com/docs-new/3470268w0
|
|
9075
|
+
*/
|
|
9076
|
+
export interface WsUTACallAuctionInfoPublicPush {
|
|
9077
|
+
T: string;
|
|
9078
|
+
t?: string;
|
|
9079
|
+
P: number;
|
|
9080
|
+
d: {
|
|
9081
|
+
s: string;
|
|
9082
|
+
/** Estimated price */
|
|
9083
|
+
eq?: number | string;
|
|
9084
|
+
/** Estimated size */
|
|
9085
|
+
es?: number | string;
|
|
9086
|
+
/** Sell order range low price */
|
|
9087
|
+
slp?: number | string;
|
|
9088
|
+
/** Sell order range high price */
|
|
9089
|
+
shp?: number | string;
|
|
9090
|
+
/** Buy order range low price */
|
|
9091
|
+
blp?: number | string;
|
|
9092
|
+
/** Buy order range high price */
|
|
9093
|
+
bhp?: number | string;
|
|
9094
|
+
ts?: number;
|
|
9095
|
+
[key: string]: string | number | boolean | undefined;
|
|
9096
|
+
};
|
|
9097
|
+
}
|
|
9098
|
+
⋮----
|
|
9099
|
+
/** Estimated price */
|
|
9100
|
+
⋮----
|
|
9101
|
+
/** Estimated size */
|
|
9102
|
+
⋮----
|
|
9103
|
+
/** Sell order range low price */
|
|
9104
|
+
⋮----
|
|
9105
|
+
/** Sell order range high price */
|
|
9106
|
+
⋮----
|
|
9107
|
+
/** Buy order range low price */
|
|
9108
|
+
⋮----
|
|
9109
|
+
/** Buy order range high price */
|
|
9110
|
+
⋮----
|
|
9111
|
+
/**
|
|
9112
|
+
* Classic futures WebSocket `/contract/positionAll` funding fee settlement push.
|
|
9113
|
+
* `symbol` added to `data` field 2026.07.01.
|
|
9114
|
+
* @see https://www.kucoin.com/docs-new/3470088w0
|
|
9115
|
+
*/
|
|
9116
|
+
export interface WsClassicFuturesFundingFeeSettlement {
|
|
9117
|
+
topic: string;
|
|
9118
|
+
subject: 'funding.begin' | 'funding.end';
|
|
9119
|
+
data: {
|
|
9120
|
+
symbol: string;
|
|
9121
|
+
fundingTime: number;
|
|
9122
|
+
fundingRate: number;
|
|
9123
|
+
timestamp: number;
|
|
9124
|
+
};
|
|
9125
|
+
}
|
|
9126
|
+
|
|
8797
9127
|
================
|
|
8798
9128
|
File: docs/KUCOIN_SDK_QUICKSTART_GUIDE.md
|
|
8799
9129
|
================
|
|
@@ -9013,10 +9343,10 @@ siebly:
|
|
|
9013
9343
|
href: /examples/Kucoin
|
|
9014
9344
|
- heading: Endpoint map
|
|
9015
9345
|
summary: Find the SDK method for each supported KuCoin endpoint.
|
|
9016
|
-
href: https://github.com/
|
|
9346
|
+
href: https://github.com/sieblyio/kucoin-api/blob/master/docs/endpointFunctionList.md
|
|
9017
9347
|
- heading: Source repository
|
|
9018
9348
|
summary: Browse SDK source, releases, issues, and endpoint coverage on GitHub.
|
|
9019
|
-
href: https://github.com/
|
|
9349
|
+
href: https://github.com/sieblyio/kucoin-api
|
|
9020
9350
|
-->
|
|
9021
9351
|
|
|
9022
9352
|
# KuCoin API JavaScript Tutorial for Node.js
|
|
@@ -9036,7 +9366,7 @@ The SDK handles private request signing, connection-token requests, product-spec
|
|
|
9036
9366
|
|
|
9037
9367
|
- KuCoin JavaScript SDK by Siebly: [`kucoin-api`](https://siebly.io/sdk/kucoin/javascript)
|
|
9038
9368
|
- npm package: [`kucoin-api`](https://www.npmjs.com/package/kucoin-api)
|
|
9039
|
-
- GitHub repository: [`
|
|
9369
|
+
- GitHub repository: [`sieblyio/kucoin-api`](https://github.com/sieblyio/kucoin-api)
|
|
9040
9370
|
- SDK examples: [KuCoin SDK examples](https://siebly.io/examples/Kucoin)
|
|
9041
9371
|
- SDK endpoint map: [KuCoin JavaScript endpoint reference](./endpointFunctionList.md)
|
|
9042
9372
|
- Official API documentation: [KuCoin API](https://www.kucoin.com/docs-new/)
|
|
@@ -10576,200 +10906,25 @@ Allow the SDK to restore cached subscriptions, then reload affected balances, op
|
|
|
10576
10906
|
- Find methods in the [complete endpoint map](./endpointFunctionList.md).
|
|
10577
10907
|
- Review the [KuCoin SDK page](https://siebly.io/sdk/kucoin/javascript).
|
|
10578
10908
|
- Install or update [`kucoin-api` from npm](https://www.npmjs.com/package/kucoin-api).
|
|
10579
|
-
- Browse the [`kucoin-api` source repository](https://github.com/
|
|
10909
|
+
- Browse the [`kucoin-api` source repository](https://github.com/sieblyio/kucoin-api).
|
|
10580
10910
|
- Read the official [KuCoin API documentation](https://www.kucoin.com/docs-new/).
|
|
10581
10911
|
- Review [Exchange State](https://siebly.io/reference/exchange-state) before building private state management.
|
|
10582
10912
|
- Use [Runtime Workflows](https://siebly.io/reference/runtime-workflows) when designing startup, reconnect, and reconciliation behavior.
|
|
10583
10913
|
- Open the [Siebly glossary](https://siebly.io/reference/glossary) for order, stream, and recovery terms.
|
|
10584
|
-
- Report SDK issues in the [`kucoin-api` GitHub repository](https://github.com/
|
|
10914
|
+
- Report SDK issues in the [`kucoin-api` GitHub repository](https://github.com/sieblyio/kucoin-api/issues).
|
|
10585
10915
|
|
|
10586
10916
|
================
|
|
10587
|
-
File:
|
|
10917
|
+
File: examples/WebSockets/ws-private-pro-v2.ts
|
|
10588
10918
|
================
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
}
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
target: WebSocket;
|
|
10597
|
-
type: 'message';
|
|
10598
|
-
data: TDataType;
|
|
10599
|
-
}
|
|
10919
|
+
import {
|
|
10920
|
+
WebsocketClient,
|
|
10921
|
+
WS_KEY_MAP,
|
|
10922
|
+
WsTopicRequest,
|
|
10923
|
+
} from '../../src/index.js';
|
|
10924
|
+
// import { DefaultLogger, WebsocketClient } from 'kucoin-api';
|
|
10925
|
+
// normally you should install this module via npm: `npm install kucoin-api`
|
|
10600
10926
|
⋮----
|
|
10601
|
-
|
|
10602
|
-
⋮----
|
|
10603
|
-
/**
|
|
10604
|
-
* UTA WebSocket private balance push (`channel: balance`).
|
|
10605
|
-
* Field `cS` added 2026.07.01 (platform-level margin collateral status).
|
|
10606
|
-
* @see https://www.kucoin.com/docs-new/3470231w0
|
|
10607
|
-
*/
|
|
10608
|
-
export interface WsUTABalancePushData {
|
|
10609
|
-
U: number | string;
|
|
10610
|
-
a: string;
|
|
10611
|
-
b: string;
|
|
10612
|
-
c: string;
|
|
10613
|
-
e?: string;
|
|
10614
|
-
h: string;
|
|
10615
|
-
l?: string;
|
|
10616
|
-
/** Platform-level margin collateral status (UNIFIED balance pushes) */
|
|
10617
|
-
cS?: string;
|
|
10618
|
-
}
|
|
10619
|
-
⋮----
|
|
10620
|
-
/** Platform-level margin collateral status (UNIFIED balance pushes) */
|
|
10621
|
-
⋮----
|
|
10622
|
-
export interface WsUTABalancePush {
|
|
10623
|
-
P: number;
|
|
10624
|
-
T: string;
|
|
10625
|
-
d: WsUTABalancePushData;
|
|
10626
|
-
}
|
|
10627
|
-
⋮----
|
|
10628
|
-
/**
|
|
10629
|
-
* UTA WebSocket private position push (`channel: position` / `positionAll`).
|
|
10630
|
-
* Fields `pM` and `r` added 2026.06.03; `adl` added 2026.05.15.
|
|
10631
|
-
* @see https://www.kucoin.com/docs-new/3470233w0
|
|
10632
|
-
*/
|
|
10633
|
-
export interface WsUTAPositionPushData {
|
|
10634
|
-
O?: number;
|
|
10635
|
-
U: number;
|
|
10636
|
-
l?: string;
|
|
10637
|
-
q: string;
|
|
10638
|
-
s: string;
|
|
10639
|
-
bP?: string;
|
|
10640
|
-
eP?: string;
|
|
10641
|
-
iM?: string;
|
|
10642
|
-
lP?: string;
|
|
10643
|
-
mM: string;
|
|
10644
|
-
/** Mark price */
|
|
10645
|
-
mP?: string;
|
|
10646
|
-
pV?: string;
|
|
10647
|
-
pi?: string;
|
|
10648
|
-
mmr?: string;
|
|
10649
|
-
mtM?: string;
|
|
10650
|
-
rPL?: string;
|
|
10651
|
-
uPL?: string;
|
|
10652
|
-
/** Margin occupied by the futures position (as of 2026.06.03) */
|
|
10653
|
-
pM?: string;
|
|
10654
|
-
/** Isolated futures risk ratio, e.g. 0.65 = 65% (as of 2026.06.03) */
|
|
10655
|
-
r?: string;
|
|
10656
|
-
/** ADL ranking percentile, e.g. 0.46 = 46% (as of 2026.05.15) */
|
|
10657
|
-
adl?: string;
|
|
10658
|
-
}
|
|
10659
|
-
⋮----
|
|
10660
|
-
/** Mark price */
|
|
10661
|
-
⋮----
|
|
10662
|
-
/** Margin occupied by the futures position (as of 2026.06.03) */
|
|
10663
|
-
⋮----
|
|
10664
|
-
/** Isolated futures risk ratio, e.g. 0.65 = 65% (as of 2026.06.03) */
|
|
10665
|
-
⋮----
|
|
10666
|
-
/** ADL ranking percentile, e.g. 0.46 = 46% (as of 2026.05.15) */
|
|
10667
|
-
⋮----
|
|
10668
|
-
export interface WsUTAPositionPush {
|
|
10669
|
-
P: number;
|
|
10670
|
-
T: string;
|
|
10671
|
-
d: WsUTAPositionPushData;
|
|
10672
|
-
}
|
|
10673
|
-
⋮----
|
|
10674
|
-
/**
|
|
10675
|
-
* UTA WebSocket public Funding Fee channel (`channel: fundingFee`, FUTURES).
|
|
10676
|
-
* Added 2026.07.01.
|
|
10677
|
-
*/
|
|
10678
|
-
export interface WsUTAFundingFeePublicPush {
|
|
10679
|
-
T: string;
|
|
10680
|
-
P: number;
|
|
10681
|
-
d: {
|
|
10682
|
-
s: string;
|
|
10683
|
-
fR?: string;
|
|
10684
|
-
fT?: number;
|
|
10685
|
-
M?: number;
|
|
10686
|
-
[key: string]: string | number | boolean | undefined;
|
|
10687
|
-
};
|
|
10688
|
-
}
|
|
10689
|
-
⋮----
|
|
10690
|
-
/**
|
|
10691
|
-
* UTA WebSocket public Mark Price channel (`channel: markPrice`, FUTURES).
|
|
10692
|
-
* Added 2026.07.01.
|
|
10693
|
-
*/
|
|
10694
|
-
export interface WsUTAMarkPricePublicPush {
|
|
10695
|
-
T: string;
|
|
10696
|
-
P: number;
|
|
10697
|
-
d: {
|
|
10698
|
-
s: string;
|
|
10699
|
-
mP?: string;
|
|
10700
|
-
M?: number;
|
|
10701
|
-
[key: string]: string | number | boolean | undefined;
|
|
10702
|
-
};
|
|
10703
|
-
}
|
|
10704
|
-
⋮----
|
|
10705
|
-
/**
|
|
10706
|
-
* UTA WebSocket public Call Auction Info channel (`channel: callAuctionInfo`).
|
|
10707
|
-
* Added 2026.07.17.
|
|
10708
|
-
* @see https://www.kucoin.com/docs-new/3470268w0
|
|
10709
|
-
*/
|
|
10710
|
-
export interface WsUTACallAuctionInfoPublicPush {
|
|
10711
|
-
T: string;
|
|
10712
|
-
t?: string;
|
|
10713
|
-
P: number;
|
|
10714
|
-
d: {
|
|
10715
|
-
s: string;
|
|
10716
|
-
/** Estimated price */
|
|
10717
|
-
eq?: number | string;
|
|
10718
|
-
/** Estimated size */
|
|
10719
|
-
es?: number | string;
|
|
10720
|
-
/** Sell order range low price */
|
|
10721
|
-
slp?: number | string;
|
|
10722
|
-
/** Sell order range high price */
|
|
10723
|
-
shp?: number | string;
|
|
10724
|
-
/** Buy order range low price */
|
|
10725
|
-
blp?: number | string;
|
|
10726
|
-
/** Buy order range high price */
|
|
10727
|
-
bhp?: number | string;
|
|
10728
|
-
ts?: number;
|
|
10729
|
-
[key: string]: string | number | boolean | undefined;
|
|
10730
|
-
};
|
|
10731
|
-
}
|
|
10732
|
-
⋮----
|
|
10733
|
-
/** Estimated price */
|
|
10734
|
-
⋮----
|
|
10735
|
-
/** Estimated size */
|
|
10736
|
-
⋮----
|
|
10737
|
-
/** Sell order range low price */
|
|
10738
|
-
⋮----
|
|
10739
|
-
/** Sell order range high price */
|
|
10740
|
-
⋮----
|
|
10741
|
-
/** Buy order range low price */
|
|
10742
|
-
⋮----
|
|
10743
|
-
/** Buy order range high price */
|
|
10744
|
-
⋮----
|
|
10745
|
-
/**
|
|
10746
|
-
* Classic futures WebSocket `/contract/positionAll` funding fee settlement push.
|
|
10747
|
-
* `symbol` added to `data` field 2026.07.01.
|
|
10748
|
-
* @see https://www.kucoin.com/docs-new/3470088w0
|
|
10749
|
-
*/
|
|
10750
|
-
export interface WsClassicFuturesFundingFeeSettlement {
|
|
10751
|
-
topic: string;
|
|
10752
|
-
subject: 'funding.begin' | 'funding.end';
|
|
10753
|
-
data: {
|
|
10754
|
-
symbol: string;
|
|
10755
|
-
fundingTime: number;
|
|
10756
|
-
fundingRate: number;
|
|
10757
|
-
timestamp: number;
|
|
10758
|
-
};
|
|
10759
|
-
}
|
|
10760
|
-
|
|
10761
|
-
================
|
|
10762
|
-
File: examples/WebSockets/ws-private-pro-v2.ts
|
|
10763
|
-
================
|
|
10764
|
-
import {
|
|
10765
|
-
WebsocketClient,
|
|
10766
|
-
WS_KEY_MAP,
|
|
10767
|
-
WsTopicRequest,
|
|
10768
|
-
} from '../../src/index.js';
|
|
10769
|
-
// import { DefaultLogger, WebsocketClient } from 'kucoin-api';
|
|
10770
|
-
// normally you should install this module via npm: `npm install kucoin-api`
|
|
10771
|
-
⋮----
|
|
10772
|
-
async function start()
|
|
10927
|
+
async function start()
|
|
10773
10928
|
⋮----
|
|
10774
10929
|
// Optional: inject a custom logger to override internal logging behaviour
|
|
10775
10930
|
// const logger: typeof DefaultLogger = {
|
|
@@ -13248,6 +13403,12 @@ rpiFilter: 0, // 0:Only NoneRPI orders [Default] 1(Only Support Futures):No
|
|
|
13248
13403
|
// UTA public Funding Fee channel
|
|
13249
13404
|
// https://www.kucoin.com/docs-new/websocket-api/base-info/introduction-uta#5-subscribe
|
|
13250
13405
|
⋮----
|
|
13406
|
+
// UTA V2 public Funding Fee Rate (`symbols` for multiple contracts, 2026.08.27)
|
|
13407
|
+
// https://www.kucoin.com/docs-new/3470357w0
|
|
13408
|
+
⋮----
|
|
13409
|
+
// UTA V2 public All Funding Fee Rates
|
|
13410
|
+
// https://www.kucoin.com/docs-new/3470412w0
|
|
13411
|
+
⋮----
|
|
13251
13412
|
// UTA public Mark Price channel
|
|
13252
13413
|
|
|
13253
13414
|
================
|
|
@@ -15823,10 +15984,24 @@ export interface GetAnnouncementsRequestUTA {
|
|
|
15823
15984
|
}
|
|
15824
15985
|
⋮----
|
|
15825
15986
|
export interface GetCurrencyRequestUTA {
|
|
15826
|
-
|
|
15987
|
+
/** Required as of UTA V2 (2026.08.27) */
|
|
15988
|
+
currency: string;
|
|
15989
|
+
chain?: string;
|
|
15990
|
+
}
|
|
15991
|
+
⋮----
|
|
15992
|
+
/** Required as of UTA V2 (2026.08.27) */
|
|
15993
|
+
⋮----
|
|
15994
|
+
export interface GetCurrenciesRequestUTA {
|
|
15995
|
+
/** Lowercase chain identifier, e.g. trx */
|
|
15827
15996
|
chain?: string;
|
|
15997
|
+
/** Uppercase currency codes. Docs send repeated currencyList query params. */
|
|
15998
|
+
currencyList?: string[] | string;
|
|
15828
15999
|
}
|
|
15829
16000
|
⋮----
|
|
16001
|
+
/** Lowercase chain identifier, e.g. trx */
|
|
16002
|
+
⋮----
|
|
16003
|
+
/** Uppercase currency codes. Docs send repeated currencyList query params. */
|
|
16004
|
+
⋮----
|
|
15830
16005
|
export interface GetSymbolRequestUTA {
|
|
15831
16006
|
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
15832
16007
|
symbol?: string;
|
|
@@ -15861,15 +16036,21 @@ export interface GetOrderBookRequestUTA {
|
|
|
15861
16036
|
*/
|
|
15862
16037
|
⋮----
|
|
15863
16038
|
export interface GetFiatPriceRequestUTA {
|
|
15864
|
-
/** Fiat base currency, e.g. USD, EUR.
|
|
15865
|
-
base
|
|
15866
|
-
/**
|
|
15867
|
-
|
|
16039
|
+
/** Fiat base currency, e.g. USD, EUR. Required as of UTA V2 (2026.08.27) */
|
|
16040
|
+
base: string;
|
|
16041
|
+
/**
|
|
16042
|
+
* Crypto symbols. UTA V2 expects a string array (2026.08.27).
|
|
16043
|
+
* Comma-separated string still accepted for older callers.
|
|
16044
|
+
*/
|
|
16045
|
+
currencies?: string[] | string;
|
|
15868
16046
|
}
|
|
15869
16047
|
⋮----
|
|
15870
|
-
/** Fiat base currency, e.g. USD, EUR.
|
|
16048
|
+
/** Fiat base currency, e.g. USD, EUR. Required as of UTA V2 (2026.08.27) */
|
|
15871
16049
|
⋮----
|
|
15872
|
-
/**
|
|
16050
|
+
/**
|
|
16051
|
+
* Crypto symbols. UTA V2 expects a string array (2026.08.27).
|
|
16052
|
+
* Comma-separated string still accepted for older callers.
|
|
16053
|
+
*/
|
|
15873
16054
|
⋮----
|
|
15874
16055
|
export interface GetRateLimitRequestUTA {
|
|
15875
16056
|
/** Comma-separated UIDs to query */
|
|
@@ -15890,6 +16071,11 @@ export interface SetSubAccountsRateLimitRequestUTA {
|
|
|
15890
16071
|
export interface GetKlinesRequestUTA {
|
|
15891
16072
|
tradeType: 'SPOT' | 'FUTURES';
|
|
15892
16073
|
symbol: string;
|
|
16074
|
+
/**
|
|
16075
|
+
* Replaces `{symbol}-index-price` / `-mark-price` / `-premium-index` suffixes (UTA V2 2026.08.27).
|
|
16076
|
+
* Suffix encoding remains backward compatible.
|
|
16077
|
+
*/
|
|
16078
|
+
klineType?: 'TRADE' | 'INDEX' | 'MARK' | 'PREMIUM' | string;
|
|
15893
16079
|
interval:
|
|
15894
16080
|
| '1min'
|
|
15895
16081
|
| '3min'
|
|
@@ -15909,10 +16095,22 @@ export interface GetKlinesRequestUTA {
|
|
|
15909
16095
|
endAt?: number;
|
|
15910
16096
|
}
|
|
15911
16097
|
⋮----
|
|
16098
|
+
/**
|
|
16099
|
+
* Replaces `{symbol}-index-price` / `-mark-price` / `-premium-index` suffixes (UTA V2 2026.08.27).
|
|
16100
|
+
* Suffix encoding remains backward compatible.
|
|
16101
|
+
*/
|
|
16102
|
+
⋮----
|
|
15912
16103
|
export interface GetCurrentFundingRateRequestUTA {
|
|
15913
|
-
symbol
|
|
16104
|
+
/** Contract symbol. Optional when productType is set (UTA V2 2026.08.27). */
|
|
16105
|
+
symbol?: string;
|
|
16106
|
+
/** Product type when querying by category instead of a single symbol. */
|
|
16107
|
+
productType?: 'COIN-FUTURES' | string;
|
|
15914
16108
|
}
|
|
15915
16109
|
⋮----
|
|
16110
|
+
/** Contract symbol. Optional when productType is set (UTA V2 2026.08.27). */
|
|
16111
|
+
⋮----
|
|
16112
|
+
/** Product type when querying by category instead of a single symbol. */
|
|
16113
|
+
⋮----
|
|
15916
16114
|
export interface GetHistoryFundingRateRequestUTA {
|
|
15917
16115
|
symbol: string;
|
|
15918
16116
|
startAt: number;
|
|
@@ -15937,11 +16135,17 @@ accountSubtype?: string; // For ISOLATED (trading pair) or FUTURES (settlement c
|
|
|
15937
16135
|
currency?: string; // Up to 20 currencies, comma-separated
|
|
15938
16136
|
⋮----
|
|
15939
16137
|
export interface GetSubAccountRequestUTA {
|
|
16138
|
+
/** UTA V2 request field (2026.08.27). Up to 50 UIDs, comma-separated */
|
|
16139
|
+
uid?: string;
|
|
16140
|
+
/** @deprecated UTA V2 renamed to uid (2026.08.27) */
|
|
15940
16141
|
UID?: string; // Up to 50 UIDs, comma-separated
|
|
15941
16142
|
pageSize?: number; // Default 10, max 50
|
|
15942
16143
|
lastId?: number;
|
|
15943
16144
|
}
|
|
15944
16145
|
⋮----
|
|
16146
|
+
/** UTA V2 request field (2026.08.27). Up to 50 UIDs, comma-separated */
|
|
16147
|
+
⋮----
|
|
16148
|
+
/** @deprecated UTA V2 renamed to uid (2026.08.27) */
|
|
15945
16149
|
UID?: string; // Up to 50 UIDs, comma-separated
|
|
15946
16150
|
pageSize?: number; // Default 10, max 50
|
|
15947
16151
|
⋮----
|
|
@@ -15963,7 +16167,10 @@ export interface FlexTransferRequestUTA {
|
|
|
15963
16167
|
clientOid: string;
|
|
15964
16168
|
currency: string;
|
|
15965
16169
|
amount: string;
|
|
15966
|
-
|
|
16170
|
+
/** UTA V2 transfer type (2026.08.27). Replaces numeric `type`. */
|
|
16171
|
+
transferType?: 'INTERNAL' | 'PARENT_TO_SUB' | 'SUB_TO_PARENT' | 'SUB_TO_SUB';
|
|
16172
|
+
/** @deprecated UTA V2 uses transferType: 0=INTERNAL, 1=PARENT_TO_SUB, 2=SUB_TO_PARENT, 3=SUB_TO_SUB */
|
|
16173
|
+
type?: '0' | '1' | '2' | '3'; // 0=INTERNAL, 1=PARENT_TO_SUB, 2=SUB_TO_PARENT, 3=SUB_TO_SUB
|
|
15967
16174
|
fromAccountType:
|
|
15968
16175
|
| 'FUNDING'
|
|
15969
16176
|
| 'SPOT'
|
|
@@ -15978,15 +16185,30 @@ export interface FlexTransferRequestUTA {
|
|
|
15978
16185
|
| 'CROSS'
|
|
15979
16186
|
| 'ISOLATED'
|
|
15980
16187
|
| 'UNIFIED';
|
|
16188
|
+
/** UTA V2 required isolated-account tag (2026.08.27). Replaces fromAccountSymbol. */
|
|
16189
|
+
fromAccountTag?: string;
|
|
16190
|
+
/** UTA V2 required isolated-account tag (2026.08.27). Replaces toAccountSymbol. */
|
|
16191
|
+
toAccountTag?: string;
|
|
16192
|
+
/** @deprecated UTA V2 uses fromAccountTag */
|
|
15981
16193
|
fromAccountSymbol?: string; // Required when fromAccountType is ISOLATED
|
|
16194
|
+
/** @deprecated UTA V2 uses toAccountTag */
|
|
15982
16195
|
toAccountSymbol?: string; // Required when toAccountType is ISOLATED
|
|
15983
16196
|
fromUid?: string; // Required for SUB transfers
|
|
15984
16197
|
toUid?: string; // Required for SUB transfers
|
|
15985
16198
|
}
|
|
15986
16199
|
⋮----
|
|
15987
|
-
|
|
16200
|
+
/** UTA V2 transfer type (2026.08.27). Replaces numeric `type`. */
|
|
16201
|
+
⋮----
|
|
16202
|
+
/** @deprecated UTA V2 uses transferType: 0=INTERNAL, 1=PARENT_TO_SUB, 2=SUB_TO_PARENT, 3=SUB_TO_SUB */
|
|
16203
|
+
type?: '0' | '1' | '2' | '3'; // 0=INTERNAL, 1=PARENT_TO_SUB, 2=SUB_TO_PARENT, 3=SUB_TO_SUB
|
|
16204
|
+
⋮----
|
|
16205
|
+
/** UTA V2 required isolated-account tag (2026.08.27). Replaces fromAccountSymbol. */
|
|
15988
16206
|
⋮----
|
|
16207
|
+
/** UTA V2 required isolated-account tag (2026.08.27). Replaces toAccountSymbol. */
|
|
16208
|
+
⋮----
|
|
16209
|
+
/** @deprecated UTA V2 uses fromAccountTag */
|
|
15989
16210
|
fromAccountSymbol?: string; // Required when fromAccountType is ISOLATED
|
|
16211
|
+
/** @deprecated UTA V2 uses toAccountTag */
|
|
15990
16212
|
toAccountSymbol?: string; // Required when toAccountType is ISOLATED
|
|
15991
16213
|
fromUid?: string; // Required for SUB transfers
|
|
15992
16214
|
toUid?: string; // Required for SUB transfers
|
|
@@ -16103,14 +16325,29 @@ chain?: string; // If both currency and chain provided, address will be created
|
|
|
16103
16325
|
⋮----
|
|
16104
16326
|
export interface GetWithdrawalQuotasRequestUTA {
|
|
16105
16327
|
currency: string;
|
|
16328
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
16329
|
+
chain?: string;
|
|
16330
|
+
/** @deprecated UTA V2 renamed to chain */
|
|
16106
16331
|
chainId?: string;
|
|
16332
|
+
/** Required as of UTA V2 (2026.08.27) */
|
|
16333
|
+
withdrawType?: 'ADDRESS' | 'UID' | 'MAIL' | 'PHONE';
|
|
16334
|
+
isInner?: boolean;
|
|
16107
16335
|
}
|
|
16108
16336
|
⋮----
|
|
16337
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
16338
|
+
⋮----
|
|
16339
|
+
/** @deprecated UTA V2 renamed to chain */
|
|
16340
|
+
⋮----
|
|
16341
|
+
/** Required as of UTA V2 (2026.08.27) */
|
|
16342
|
+
⋮----
|
|
16109
16343
|
export interface SubmitWithdrawRequestUTA {
|
|
16110
16344
|
currency: string;
|
|
16111
16345
|
toAddress: string;
|
|
16112
16346
|
amount: string;
|
|
16113
16347
|
withdrawType: 'ADDRESS' | 'UID' | 'MAIL' | 'PHONE';
|
|
16348
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
16349
|
+
chain?: string;
|
|
16350
|
+
/** @deprecated UTA V2 renamed to chain */
|
|
16114
16351
|
chainId?: string;
|
|
16115
16352
|
memo?: string;
|
|
16116
16353
|
isInner?: boolean;
|
|
@@ -16118,6 +16355,10 @@ export interface SubmitWithdrawRequestUTA {
|
|
|
16118
16355
|
feeDeductType?: 'INTERNAL' | 'EXTERNAL';
|
|
16119
16356
|
}
|
|
16120
16357
|
⋮----
|
|
16358
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
16359
|
+
⋮----
|
|
16360
|
+
/** @deprecated UTA V2 renamed to chain */
|
|
16361
|
+
⋮----
|
|
16121
16362
|
export interface AddSubAccountRequestUTA {
|
|
16122
16363
|
password: string;
|
|
16123
16364
|
subName: string;
|
|
@@ -16166,6 +16407,8 @@ export interface PlaceOrderRequestUTA {
|
|
|
16166
16407
|
autoBorrow?: boolean; // Only for Isolated/Cross Margin (Classic only)
|
|
16167
16408
|
autoRepay?: boolean; // Only for Isolated/Cross Margin (Classic only)
|
|
16168
16409
|
tags?: string; // Max length 20
|
|
16410
|
+
/** Broker tag, max 50 chars. Decoupled from capped tags (2026.09.21) */
|
|
16411
|
+
brokerTag?: string;
|
|
16169
16412
|
triggerDirection?: 'DOWN' | 'UP'; // Required when triggerPrice is set
|
|
16170
16413
|
triggerPrice?: string;
|
|
16171
16414
|
triggerPriceType?: 'TP' | 'IP' | 'MP'; // Only for Futures
|
|
@@ -16201,6 +16444,8 @@ cancelAfter?: number; // Only effective when timeInForce is GTT
|
|
|
16201
16444
|
autoBorrow?: boolean; // Only for Isolated/Cross Margin (Classic only)
|
|
16202
16445
|
autoRepay?: boolean; // Only for Isolated/Cross Margin (Classic only)
|
|
16203
16446
|
tags?: string; // Max length 20
|
|
16447
|
+
/** Broker tag, max 50 chars. Decoupled from capped tags (2026.09.21) */
|
|
16448
|
+
⋮----
|
|
16204
16449
|
triggerDirection?: 'DOWN' | 'UP'; // Required when triggerPrice is set
|
|
16205
16450
|
⋮----
|
|
16206
16451
|
triggerPriceType?: 'TP' | 'IP' | 'MP'; // Only for Futures
|
|
@@ -16271,6 +16516,8 @@ export interface GetTradeHistoryRequestUTA {
|
|
|
16271
16516
|
endAt?: number; // milliseconds
|
|
16272
16517
|
lastId?: string;
|
|
16273
16518
|
pageSize?: number; // Default 50, max 200
|
|
16519
|
+
/** Query all trade kinds (UTA V2 2026.08.27), e.g. NORMAL / ADL / LIQUID / SETTLEMENT */
|
|
16520
|
+
fillType?: string;
|
|
16274
16521
|
}
|
|
16275
16522
|
⋮----
|
|
16276
16523
|
symbol?: string; // Required for SPOT, ISOLATED, and CROSS
|
|
@@ -16279,6 +16526,21 @@ startAt?: number; // milliseconds
|
|
|
16279
16526
|
endAt?: number; // milliseconds
|
|
16280
16527
|
⋮----
|
|
16281
16528
|
pageSize?: number; // Default 50, max 200
|
|
16529
|
+
/** Query all trade kinds (UTA V2 2026.08.27), e.g. NORMAL / ADL / LIQUID / SETTLEMENT */
|
|
16530
|
+
⋮----
|
|
16531
|
+
export interface AmendOrderRequestUTA {
|
|
16532
|
+
symbol: string;
|
|
16533
|
+
orderId?: string;
|
|
16534
|
+
clientOid?: string;
|
|
16535
|
+
newPrice?: number | string;
|
|
16536
|
+
newSize?: number | string;
|
|
16537
|
+
tpTriggerPrice?: string;
|
|
16538
|
+
slTriggerPrice?: string;
|
|
16539
|
+
}
|
|
16540
|
+
⋮----
|
|
16541
|
+
export interface GetIndexPriceRequestUTA {
|
|
16542
|
+
symbol: string;
|
|
16543
|
+
}
|
|
16282
16544
|
⋮----
|
|
16283
16545
|
export interface CancelOrderRequestUTA {
|
|
16284
16546
|
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
@@ -16510,28 +16772,58 @@ export interface CurrencyChainUTA {
|
|
|
16510
16772
|
minWithdrawFee: string;
|
|
16511
16773
|
isWithdrawEnabled: boolean;
|
|
16512
16774
|
isDepositEnabled: boolean;
|
|
16513
|
-
confirms
|
|
16775
|
+
confirms?: number;
|
|
16514
16776
|
preConfirms: number;
|
|
16515
|
-
contractAddress
|
|
16777
|
+
contractAddress?: string;
|
|
16516
16778
|
withdrawPrecision: number;
|
|
16517
16779
|
maxWithdrawSize: string | null;
|
|
16518
16780
|
maxDepositSize: string | null;
|
|
16519
16781
|
needTag: boolean;
|
|
16520
|
-
|
|
16782
|
+
/** @deprecated UTA V2 renamed to chain (2026.08.27) */
|
|
16783
|
+
chainId?: string;
|
|
16784
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
16785
|
+
chain?: string;
|
|
16786
|
+
addressRegex?: string;
|
|
16787
|
+
memoRegex?: string;
|
|
16788
|
+
depositFeeRate?: string;
|
|
16789
|
+
depositTierFee?: string;
|
|
16790
|
+
fixedDepositFee?: string;
|
|
16791
|
+
maxDepositFee?: string;
|
|
16792
|
+
maxWithdrawFee?: string;
|
|
16793
|
+
isMemoRequired?: boolean;
|
|
16521
16794
|
}
|
|
16522
16795
|
⋮----
|
|
16796
|
+
/** @deprecated UTA V2 renamed to chain (2026.08.27) */
|
|
16797
|
+
⋮----
|
|
16798
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
16799
|
+
⋮----
|
|
16523
16800
|
export interface GetCurrencyResponseUTA {
|
|
16524
16801
|
currency: string;
|
|
16525
16802
|
name: string;
|
|
16526
16803
|
fullName: string;
|
|
16527
16804
|
precision: number;
|
|
16528
|
-
confirms
|
|
16529
|
-
contractAddress
|
|
16530
|
-
|
|
16531
|
-
|
|
16805
|
+
confirms?: number | null;
|
|
16806
|
+
contractAddress?: string | null;
|
|
16807
|
+
/** Removed from UTA V2 Get Currencies currency-level payload (2026.08.27) */
|
|
16808
|
+
isMarginEnabled?: boolean;
|
|
16809
|
+
/** Removed from UTA V2 Get Currencies currency-level payload (2026.08.27) */
|
|
16810
|
+
isDebitEnabled?: boolean;
|
|
16811
|
+
/** UTA V2 chain list (2026.08.27). Replaces items. */
|
|
16532
16812
|
list: CurrencyChainUTA[];
|
|
16813
|
+
/** @deprecated UTA V2 renamed to list */
|
|
16814
|
+
items?: CurrencyChainUTA[];
|
|
16533
16815
|
}
|
|
16534
16816
|
⋮----
|
|
16817
|
+
/** Removed from UTA V2 Get Currencies currency-level payload (2026.08.27) */
|
|
16818
|
+
⋮----
|
|
16819
|
+
/** Removed from UTA V2 Get Currencies currency-level payload (2026.08.27) */
|
|
16820
|
+
⋮----
|
|
16821
|
+
/** UTA V2 chain list (2026.08.27). Replaces items. */
|
|
16822
|
+
⋮----
|
|
16823
|
+
/** @deprecated UTA V2 renamed to list */
|
|
16824
|
+
⋮----
|
|
16825
|
+
export type GetCurrenciesResponseUTA = GetCurrencyResponseUTA[];
|
|
16826
|
+
⋮----
|
|
16535
16827
|
export interface SymbolUTA {
|
|
16536
16828
|
symbol: string;
|
|
16537
16829
|
name?: string;
|
|
@@ -16546,10 +16838,22 @@ export interface SymbolUTA {
|
|
|
16546
16838
|
quoteOrderStep?: string;
|
|
16547
16839
|
tickSize?: string | number;
|
|
16548
16840
|
feeCurrency?: string;
|
|
16549
|
-
tradingStatus?:
|
|
16841
|
+
tradingStatus?:
|
|
16842
|
+
| string
|
|
16843
|
+
| 'TradingEnabled'
|
|
16844
|
+
| 'TradingDisabled'
|
|
16845
|
+
| 'Init'
|
|
16846
|
+
| 'Open'
|
|
16847
|
+
| 'PrepareSettled'
|
|
16848
|
+
| 'BeingSettled'
|
|
16849
|
+
| 'Settled'
|
|
16850
|
+
| 'Paused'
|
|
16851
|
+
| 'Closed'
|
|
16852
|
+
| 'CancelOnly';
|
|
16550
16853
|
marginMode?: string;
|
|
16551
16854
|
priceLimitRatio?: string;
|
|
16552
|
-
|
|
16855
|
+
/** UTA V2: classA / classB / classC. Numeric 1/2/3 remains on older payloads. */
|
|
16856
|
+
feeCategory?: number | 'classA' | 'classB' | 'classC' | string;
|
|
16553
16857
|
makerFeeCoefficient?: string;
|
|
16554
16858
|
takerFeeCoefficient?: string;
|
|
16555
16859
|
st?: boolean;
|
|
@@ -16557,8 +16861,8 @@ export interface SymbolUTA {
|
|
|
16557
16861
|
contractType?: string;
|
|
16558
16862
|
isInverse?: boolean;
|
|
16559
16863
|
launchTime?: number;
|
|
16560
|
-
expiryTime?: number | null;
|
|
16561
|
-
settlementTime?: number | null;
|
|
16864
|
+
expiryTime?: number | string | null;
|
|
16865
|
+
settlementTime?: number | string | null;
|
|
16562
16866
|
maxPrice?: string | number;
|
|
16563
16867
|
lotSize?: string | number;
|
|
16564
16868
|
/**
|
|
@@ -16570,7 +16874,7 @@ export interface SymbolUTA {
|
|
|
16570
16874
|
makerFeeRate?: string | number;
|
|
16571
16875
|
takerFeeRate?: string | number;
|
|
16572
16876
|
settlementFeeRate?: string | number | null;
|
|
16573
|
-
maxLeverage?: number;
|
|
16877
|
+
maxLeverage?: number | string;
|
|
16574
16878
|
indexSourceExchanges?: string[];
|
|
16575
16879
|
k?: string | number;
|
|
16576
16880
|
m?: string | number;
|
|
@@ -16587,8 +16891,20 @@ export interface SymbolUTA {
|
|
|
16587
16891
|
displaySymbol?: string;
|
|
16588
16892
|
/** Display base currency for Futures (added 2025.12.26 & 2026.01.12) */
|
|
16589
16893
|
displayBaseCurrency?: string;
|
|
16894
|
+
maxMarketOrderSize?: string;
|
|
16895
|
+
preMarketToPerpDate?: number | string | null;
|
|
16896
|
+
minFunds?: string;
|
|
16897
|
+
callauctionIsEnabled?: boolean;
|
|
16898
|
+
callauctionPriceFloor?: string | null;
|
|
16899
|
+
callauctionPriceCeiling?: string | null;
|
|
16900
|
+
callauctionFirstStageStartTime?: number | string | null;
|
|
16901
|
+
callauctionSecondStageStartTime?: number | string | null;
|
|
16902
|
+
callauctionThirdStageStartTime?: number | string | null;
|
|
16903
|
+
tradingStartTime?: number | string | null;
|
|
16590
16904
|
}
|
|
16591
16905
|
⋮----
|
|
16906
|
+
/** UTA V2: classA / classB / classC. Numeric 1/2/3 remains on older payloads. */
|
|
16907
|
+
⋮----
|
|
16592
16908
|
/**
|
|
16593
16909
|
* Unit size. As of 2026.01.12:
|
|
16594
16910
|
* - For inverse contracts: changed from -1 to 1 (1 contract = 1 USD)
|
|
@@ -16720,10 +17036,10 @@ list: string[][]; // [time, open, close, high, low, volume, turnover]
|
|
|
16720
17036
|
⋮----
|
|
16721
17037
|
export interface GetCurrentFundingRateResponseUTA {
|
|
16722
17038
|
symbol: string;
|
|
16723
|
-
nextFundingRate: number;
|
|
17039
|
+
nextFundingRate: number | string;
|
|
16724
17040
|
fundingTime: number;
|
|
16725
|
-
fundingRateCap: number;
|
|
16726
|
-
fundingRateFloor: number;
|
|
17041
|
+
fundingRateCap: number | string;
|
|
17042
|
+
fundingRateFloor: number | string;
|
|
16727
17043
|
/** Current funding settlement interval (ms); as of 2026.04.19 */
|
|
16728
17044
|
currentGranularity: number;
|
|
16729
17045
|
/** New interval after change (ms); as of 2026.04.19 */
|
|
@@ -16738,6 +17054,24 @@ export interface GetCurrentFundingRateResponseUTA {
|
|
|
16738
17054
|
⋮----
|
|
16739
17055
|
/** When newGranularity takes effect (ms); as of 2026.04.19 */
|
|
16740
17056
|
⋮----
|
|
17057
|
+
export interface GetIndexPriceDecompositionUTA {
|
|
17058
|
+
exchange: string;
|
|
17059
|
+
price: string;
|
|
17060
|
+
weight: string;
|
|
17061
|
+
}
|
|
17062
|
+
⋮----
|
|
17063
|
+
export interface GetIndexPriceItemUTA {
|
|
17064
|
+
symbol: string;
|
|
17065
|
+
granularity: number;
|
|
17066
|
+
ts: number;
|
|
17067
|
+
indexPrice: string;
|
|
17068
|
+
decompositionList?: GetIndexPriceDecompositionUTA[];
|
|
17069
|
+
}
|
|
17070
|
+
⋮----
|
|
17071
|
+
export interface GetIndexPriceResponseUTA {
|
|
17072
|
+
items: GetIndexPriceItemUTA[];
|
|
17073
|
+
}
|
|
17074
|
+
⋮----
|
|
16741
17075
|
export interface FundingRateHistoryItemUTA {
|
|
16742
17076
|
fundingRate: number;
|
|
16743
17077
|
ts: number;
|
|
@@ -16810,7 +17144,10 @@ export interface GetServiceStatusResponseUTA {
|
|
|
16810
17144
|
⋮----
|
|
16811
17145
|
export interface AccountCurrencyUTA {
|
|
16812
17146
|
currency: string;
|
|
16813
|
-
|
|
17147
|
+
/** @deprecated UTA V2 renamed to locked (2026.08.27) */
|
|
17148
|
+
hold?: string;
|
|
17149
|
+
/** UTA V2 locked amount (2026.08.27). Replaces hold. */
|
|
17150
|
+
locked?: string;
|
|
16814
17151
|
available: string;
|
|
16815
17152
|
balance: string;
|
|
16816
17153
|
equity: string;
|
|
@@ -16827,15 +17164,23 @@ export interface AccountCurrencyUTA {
|
|
|
16827
17164
|
isolatedOrderMargin?: string;
|
|
16828
17165
|
isolatedFundingFeeMargin?: string;
|
|
16829
17166
|
isolatedUnPnl?: string;
|
|
17167
|
+
/** @deprecated UTA V2 renamed to liabilityPrincipal (2026.08.27) */
|
|
16830
17168
|
liabilityPrinciple?: string;
|
|
17169
|
+
liabilityPrincipal?: string;
|
|
16831
17170
|
liabilityInterest?: string;
|
|
16832
17171
|
unrealisedPnl?: string;
|
|
16833
17172
|
}
|
|
16834
17173
|
⋮----
|
|
17174
|
+
/** @deprecated UTA V2 renamed to locked (2026.08.27) */
|
|
17175
|
+
⋮----
|
|
17176
|
+
/** UTA V2 locked amount (2026.08.27). Replaces hold. */
|
|
17177
|
+
⋮----
|
|
16835
17178
|
/** Platform-level margin collateral status (as of 2026.07.01) */
|
|
16836
17179
|
⋮----
|
|
16837
17180
|
/** Potential borrow reserved by open orders (UTA; as of 2026.04.19) */
|
|
16838
17181
|
⋮----
|
|
17182
|
+
/** @deprecated UTA V2 renamed to liabilityPrincipal (2026.08.27) */
|
|
17183
|
+
⋮----
|
|
16839
17184
|
export interface AccountDataUTA {
|
|
16840
17185
|
accountSubtype?: string; // For ISOLATED (trading pair) or FUTURES (settlement currency)
|
|
16841
17186
|
riskRatio?: string;
|
|
@@ -16863,7 +17208,8 @@ export interface GetAccountOverviewResponseUTA {
|
|
|
16863
17208
|
⋮----
|
|
16864
17209
|
export interface SubAccountUserUTA {
|
|
16865
17210
|
uid: number;
|
|
16866
|
-
|
|
17211
|
+
/** @deprecated UTA V2 renamed to accounts (2026.08.27) */
|
|
17212
|
+
accountList?: {
|
|
16867
17213
|
accountType:
|
|
16868
17214
|
| 'FUNDING'
|
|
16869
17215
|
| 'SPOT'
|
|
@@ -16875,8 +17221,46 @@ export interface SubAccountUserUTA {
|
|
|
16875
17221
|
accountSubType: string | null;
|
|
16876
17222
|
currencyList: AccountCurrencyUTA[];
|
|
16877
17223
|
}[];
|
|
17224
|
+
/** UTA V2 accounts list (2026.08.27). Replaces accountList. OPTIONS removed. */
|
|
17225
|
+
accounts?: {
|
|
17226
|
+
accountType:
|
|
17227
|
+
| 'FUNDING'
|
|
17228
|
+
| 'SPOT'
|
|
17229
|
+
| 'FUTURES'
|
|
17230
|
+
| 'CROSS'
|
|
17231
|
+
| 'ISOLATED'
|
|
17232
|
+
| 'UNIFIED';
|
|
17233
|
+
/** UTA V2 renamed from accountSubType */
|
|
17234
|
+
subAccountType?: string | null;
|
|
17235
|
+
/** @deprecated UTA V2 renamed to subAccountType */
|
|
17236
|
+
accountSubType?: string | null;
|
|
17237
|
+
/** UTA V2 renamed from currencyList */
|
|
17238
|
+
currencies?: AccountCurrencyUTA[];
|
|
17239
|
+
/** @deprecated UTA V2 renamed to currencies */
|
|
17240
|
+
currencyList?: AccountCurrencyUTA[];
|
|
17241
|
+
/** UTA V2 renamed from liabilityPrinciple */
|
|
17242
|
+
liabilityPrincipal?: string;
|
|
17243
|
+
/** @deprecated UTA V2 renamed to liabilityPrincipal */
|
|
17244
|
+
liabilityPrinciple?: string;
|
|
17245
|
+
}[];
|
|
16878
17246
|
}
|
|
16879
17247
|
⋮----
|
|
17248
|
+
/** @deprecated UTA V2 renamed to accounts (2026.08.27) */
|
|
17249
|
+
⋮----
|
|
17250
|
+
/** UTA V2 accounts list (2026.08.27). Replaces accountList. OPTIONS removed. */
|
|
17251
|
+
⋮----
|
|
17252
|
+
/** UTA V2 renamed from accountSubType */
|
|
17253
|
+
⋮----
|
|
17254
|
+
/** @deprecated UTA V2 renamed to subAccountType */
|
|
17255
|
+
⋮----
|
|
17256
|
+
/** UTA V2 renamed from currencyList */
|
|
17257
|
+
⋮----
|
|
17258
|
+
/** @deprecated UTA V2 renamed to currencies */
|
|
17259
|
+
⋮----
|
|
17260
|
+
/** UTA V2 renamed from liabilityPrinciple */
|
|
17261
|
+
⋮----
|
|
17262
|
+
/** @deprecated UTA V2 renamed to liabilityPrincipal */
|
|
17263
|
+
⋮----
|
|
16880
17264
|
export interface GetSubAccountResponseUTA {
|
|
16881
17265
|
ts: number;
|
|
16882
17266
|
userList: SubAccountUserUTA[];
|
|
@@ -16964,16 +17348,30 @@ export interface GetInterestHistoryResponseUTA {
|
|
|
16964
17348
|
⋮----
|
|
16965
17349
|
export interface DepositAddressUTA {
|
|
16966
17350
|
address: string;
|
|
16967
|
-
memo
|
|
16968
|
-
|
|
16969
|
-
|
|
17351
|
+
memo?: string;
|
|
17352
|
+
/** @deprecated UTA V2 renamed to chain (2026.08.27) */
|
|
17353
|
+
chainId?: string;
|
|
17354
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
17355
|
+
chain?: string;
|
|
17356
|
+
/** @deprecated UTA V2 renamed to toAccountType (2026.08.27) */
|
|
17357
|
+
to?: 'FUNDING' | 'SPOT' | 'UNIFIED';
|
|
17358
|
+
/** UTA V2 destination account type (2026.08.27). Replaces to. */
|
|
17359
|
+
toAccountType?: 'FUNDING' | 'SPOT' | 'UNIFIED';
|
|
16970
17360
|
currency: string;
|
|
16971
17361
|
contractAddress: string;
|
|
16972
17362
|
chainName: string;
|
|
16973
17363
|
expirationDate: string;
|
|
16974
|
-
remark
|
|
17364
|
+
remark?: string;
|
|
16975
17365
|
}
|
|
16976
17366
|
⋮----
|
|
17367
|
+
/** @deprecated UTA V2 renamed to chain (2026.08.27) */
|
|
17368
|
+
⋮----
|
|
17369
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
17370
|
+
⋮----
|
|
17371
|
+
/** @deprecated UTA V2 renamed to toAccountType (2026.08.27) */
|
|
17372
|
+
⋮----
|
|
17373
|
+
/** UTA V2 destination account type (2026.08.27). Replaces to. */
|
|
17374
|
+
⋮----
|
|
16977
17375
|
export interface WithdrawalQuotasUTA {
|
|
16978
17376
|
currency: string;
|
|
16979
17377
|
limitBTCAmount: string;
|
|
@@ -16981,19 +17379,42 @@ export interface WithdrawalQuotasUTA {
|
|
|
16981
17379
|
quotaCurrency: string;
|
|
16982
17380
|
limitQuotaCurrencyAmount: string;
|
|
16983
17381
|
usedQuotaCurrencyAmount: string;
|
|
16984
|
-
remainAmount
|
|
16985
|
-
availableAmount
|
|
16986
|
-
withdrawMinFee
|
|
16987
|
-
innerWithdrawMinFee
|
|
17382
|
+
remainAmount?: string;
|
|
17383
|
+
availableAmount?: string;
|
|
17384
|
+
withdrawMinFee?: string;
|
|
17385
|
+
innerWithdrawMinFee?: string;
|
|
17386
|
+
/** UTA V2 remaining quota (2026.08.27). Replaces remainAmount. */
|
|
17387
|
+
remainingQuotaAmount?: string;
|
|
17388
|
+
/** UTA V2 available withdraw amount (2026.08.27). Replaces availableAmount. */
|
|
17389
|
+
availableWithdrawAmount?: string;
|
|
17390
|
+
/** UTA V2 min withdraw fee (2026.08.27). Replaces withdrawMinFee. */
|
|
17391
|
+
minWithdrawFee?: string;
|
|
17392
|
+
/** UTA V2 min inner withdraw fee (2026.08.27). Replaces innerWithdrawMinFee. */
|
|
17393
|
+
minInnerWithdrawFee?: string;
|
|
16988
17394
|
withdrawMinSize: string;
|
|
16989
17395
|
isWithdrawEnabled: boolean;
|
|
16990
17396
|
precision: number;
|
|
16991
17397
|
reason: string | null;
|
|
16992
17398
|
lockedAmount: string;
|
|
16993
|
-
|
|
17399
|
+
/** @deprecated UTA V2 renamed to chain (2026.08.27) */
|
|
17400
|
+
chainId?: string;
|
|
17401
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
17402
|
+
chain?: string;
|
|
16994
17403
|
chainName: string;
|
|
16995
17404
|
}
|
|
16996
17405
|
⋮----
|
|
17406
|
+
/** UTA V2 remaining quota (2026.08.27). Replaces remainAmount. */
|
|
17407
|
+
⋮----
|
|
17408
|
+
/** UTA V2 available withdraw amount (2026.08.27). Replaces availableAmount. */
|
|
17409
|
+
⋮----
|
|
17410
|
+
/** UTA V2 min withdraw fee (2026.08.27). Replaces withdrawMinFee. */
|
|
17411
|
+
⋮----
|
|
17412
|
+
/** UTA V2 min inner withdraw fee (2026.08.27). Replaces innerWithdrawMinFee. */
|
|
17413
|
+
⋮----
|
|
17414
|
+
/** @deprecated UTA V2 renamed to chain (2026.08.27) */
|
|
17415
|
+
⋮----
|
|
17416
|
+
/** UTA V2 chain identifier (2026.08.27). Replaces chainId. */
|
|
17417
|
+
⋮----
|
|
16997
17418
|
export interface SubmitWithdrawResponseUTA {
|
|
16998
17419
|
withdrawalId: string;
|
|
16999
17420
|
}
|
|
@@ -17112,7 +17533,8 @@ export interface OrderDetailsUTA {
|
|
|
17112
17533
|
* Time in Force. Added 'RPI' as of 2025.01.02
|
|
17113
17534
|
*/
|
|
17114
17535
|
timeInForce: 'GTC' | 'IOC' | 'GTT' | 'FOK' | 'RPI';
|
|
17115
|
-
|
|
17536
|
+
/** UTA V1+V2: enum value instead of descriptive cancellation reason (2026.08.27) */
|
|
17537
|
+
cancelReason?: number | string;
|
|
17116
17538
|
cancelSize: string;
|
|
17117
17539
|
cancelAfter?: number;
|
|
17118
17540
|
triggerDirection?: 'UP' | 'DOWN';
|
|
@@ -17126,6 +17548,8 @@ export interface OrderDetailsUTA {
|
|
|
17126
17548
|
slOrderPrice?: string;
|
|
17127
17549
|
postOnly?: boolean;
|
|
17128
17550
|
tags?: string;
|
|
17551
|
+
/** Broker tag, max 50 chars (2026.09.21) */
|
|
17552
|
+
brokerTag?: string;
|
|
17129
17553
|
triggerOrderId?: string;
|
|
17130
17554
|
/** Order creation time in nanoseconds (standardized as of 2026.01.12) */
|
|
17131
17555
|
orderTime: number;
|
|
@@ -17149,6 +17573,10 @@ export interface OrderDetailsUTA {
|
|
|
17149
17573
|
* Time in Force. Added 'RPI' as of 2025.01.02
|
|
17150
17574
|
*/
|
|
17151
17575
|
⋮----
|
|
17576
|
+
/** UTA V1+V2: enum value instead of descriptive cancellation reason (2026.08.27) */
|
|
17577
|
+
⋮----
|
|
17578
|
+
/** Broker tag, max 50 chars (2026.09.21) */
|
|
17579
|
+
⋮----
|
|
17152
17580
|
/** Order creation time in nanoseconds (standardized as of 2026.01.12) */
|
|
17153
17581
|
⋮----
|
|
17154
17582
|
/** Latest order update time in nanoseconds (standardized as of 2026.01.12) */
|
|
@@ -17193,6 +17621,15 @@ export interface TradeHistoryItemUTA {
|
|
|
17193
17621
|
executionTime: number;
|
|
17194
17622
|
/** Whether it is an RPI trade (added 2025.01.02, Futures only) */
|
|
17195
17623
|
isRpiTrade?: boolean;
|
|
17624
|
+
/**
|
|
17625
|
+
* Fill PnL. Empty string when data is before 2026.09.05 (UTC-8) (2026.09.21).
|
|
17626
|
+
* When fillType is ADL/LIQUID/SETTLEMENT, size is a positive value (2026.08.20).
|
|
17627
|
+
*/
|
|
17628
|
+
fillPnl?: string;
|
|
17629
|
+
clientOid?: string;
|
|
17630
|
+
marginMode?: 'ISOLATED' | 'CROSS';
|
|
17631
|
+
tradeType?: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
17632
|
+
orderType?: 'LIMIT' | 'MARKET';
|
|
17196
17633
|
}
|
|
17197
17634
|
⋮----
|
|
17198
17635
|
/** e.g. NORMAL, ADL. When ADL, liquidityRole is empty (as of 2026.08.12) */
|
|
@@ -17205,6 +17642,16 @@ export interface TradeHistoryItemUTA {
|
|
|
17205
17642
|
⋮----
|
|
17206
17643
|
/** Whether it is an RPI trade (added 2025.01.02, Futures only) */
|
|
17207
17644
|
⋮----
|
|
17645
|
+
/**
|
|
17646
|
+
* Fill PnL. Empty string when data is before 2026.09.05 (UTC-8) (2026.09.21).
|
|
17647
|
+
* When fillType is ADL/LIQUID/SETTLEMENT, size is a positive value (2026.08.20).
|
|
17648
|
+
*/
|
|
17649
|
+
⋮----
|
|
17650
|
+
export interface AmendOrderResponseUTA {
|
|
17651
|
+
orderId: string;
|
|
17652
|
+
clientOid: string | null;
|
|
17653
|
+
}
|
|
17654
|
+
⋮----
|
|
17208
17655
|
export interface GetTradeHistoryResponseUTA {
|
|
17209
17656
|
lastId: number;
|
|
17210
17657
|
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
@@ -17548,6 +17995,7 @@ import {
|
|
|
17548
17995
|
import type {
|
|
17549
17996
|
AddSubAccountApiRequestUTA,
|
|
17550
17997
|
AddSubAccountRequestUTA,
|
|
17998
|
+
AmendOrderRequestUTA,
|
|
17551
17999
|
BatchCancelOrdersBySymbolRequestUTA,
|
|
17552
18000
|
BatchCancelOrdersRequestUTA,
|
|
17553
18001
|
BatchModifyMarginModeRequestUTA,
|
|
@@ -17560,6 +18008,7 @@ import type {
|
|
|
17560
18008
|
GetBorrowingRatesAndLimitsRequestUTA,
|
|
17561
18009
|
GetCallAuctionInfoRequestUTA,
|
|
17562
18010
|
GetClassicAccountRequestUTA,
|
|
18011
|
+
GetCurrenciesRequestUTA,
|
|
17563
18012
|
GetCurrencyRequestUTA,
|
|
17564
18013
|
GetCurrentFundingRateRequestUTA,
|
|
17565
18014
|
GetDCPRequestUTA,
|
|
@@ -17568,6 +18017,7 @@ import type {
|
|
|
17568
18017
|
GetFeeRateRequestUTA,
|
|
17569
18018
|
GetFiatPriceRequestUTA,
|
|
17570
18019
|
GetHistoryFundingRateRequestUTA,
|
|
18020
|
+
GetIndexPriceRequestUTA,
|
|
17571
18021
|
GetInterestHistoryRequestUTA,
|
|
17572
18022
|
GetInterestRateIndexRequestUTA,
|
|
17573
18023
|
GetKlinesRequestUTA,
|
|
@@ -17607,6 +18057,7 @@ import type { APISuccessResponse } from './types/response/shared.types.js';
|
|
|
17607
18057
|
import type {
|
|
17608
18058
|
AddSubAccountApiResponseUTA,
|
|
17609
18059
|
AddSubAccountResponseUTA,
|
|
18060
|
+
AmendOrderResponseUTA,
|
|
17610
18061
|
ApiKeyInfoUTA,
|
|
17611
18062
|
BatchCancelOrdersBySymbolResponseUTA,
|
|
17612
18063
|
BatchCancelOrdersResponseUTA,
|
|
@@ -17626,12 +18077,14 @@ import type {
|
|
|
17626
18077
|
GetCallAuctionInfoResponseUTA,
|
|
17627
18078
|
GetClassicAccountResponseUTA,
|
|
17628
18079
|
GetCrossMarginConfigResponseUTA,
|
|
18080
|
+
GetCurrenciesResponseUTA,
|
|
17629
18081
|
GetCurrencyResponseUTA,
|
|
17630
18082
|
GetCurrentFundingRateResponseUTA,
|
|
17631
18083
|
GetDepositHistoryResponseUTA,
|
|
17632
18084
|
GetFeeRateResponseUTA,
|
|
17633
18085
|
GetFiatPriceResponseUTA,
|
|
17634
18086
|
GetHistoryFundingRateResponseUTA,
|
|
18087
|
+
GetIndexPriceResponseUTA,
|
|
17635
18088
|
GetInterestHistoryResponseUTA,
|
|
17636
18089
|
GetInterestRateIndexResponseUTA,
|
|
17637
18090
|
GetKlinesResponseUTA,
|
|
@@ -17699,9 +18152,17 @@ getAnnouncements(
|
|
|
17699
18152
|
* Request the currency details of a specified currency via this endpoint.
|
|
17700
18153
|
*/
|
|
17701
18154
|
getCurrency(
|
|
17702
|
-
params
|
|
18155
|
+
params: GetCurrencyRequestUTA,
|
|
17703
18156
|
): Promise<APISuccessResponse<GetCurrencyResponseUTA>>
|
|
17704
18157
|
⋮----
|
|
18158
|
+
/**
|
|
18159
|
+
* Get Currencies
|
|
18160
|
+
* Currency and chain-level deposit/withdrawal configuration.
|
|
18161
|
+
*/
|
|
18162
|
+
getCurrencies(
|
|
18163
|
+
params?: GetCurrenciesRequestUTA,
|
|
18164
|
+
): Promise<APISuccessResponse<GetCurrenciesResponseUTA>>
|
|
18165
|
+
⋮----
|
|
17705
18166
|
/**
|
|
17706
18167
|
* Get Third-Party Custody Currencies
|
|
17707
18168
|
* Query settlement currencies supported by third-party (OES) custodian institutions.
|
|
@@ -17750,13 +18211,26 @@ getKlines(
|
|
|
17750
18211
|
params: GetKlinesRequestUTA,
|
|
17751
18212
|
): Promise<APISuccessResponse<GetKlinesResponseUTA>>
|
|
17752
18213
|
⋮----
|
|
18214
|
+
/**
|
|
18215
|
+
* Get Index Price
|
|
18216
|
+
* Index price snapshots (updated once per second).
|
|
18217
|
+
*/
|
|
18218
|
+
getIndexPrice(
|
|
18219
|
+
params: GetIndexPriceRequestUTA,
|
|
18220
|
+
): Promise<APISuccessResponse<GetIndexPriceResponseUTA>>
|
|
18221
|
+
⋮----
|
|
17753
18222
|
/**
|
|
17754
18223
|
* Get Current Funding Rate
|
|
17755
18224
|
* Get current Futures funding fee rate.
|
|
17756
18225
|
*/
|
|
17757
18226
|
getCurrentFundingRate(
|
|
17758
|
-
params
|
|
17759
|
-
): Promise<
|
|
18227
|
+
params?: GetCurrentFundingRateRequestUTA,
|
|
18228
|
+
): Promise<
|
|
18229
|
+
APISuccessResponse<
|
|
18230
|
+
GetCurrentFundingRateResponseUTA | GetCurrentFundingRateResponseUTA[]
|
|
18231
|
+
>
|
|
18232
|
+
> {
|
|
18233
|
+
return this.get('api/ua/v2/market/funding-rate', params);
|
|
17760
18234
|
⋮----
|
|
17761
18235
|
/**
|
|
17762
18236
|
* Get History Funding Rate
|
|
@@ -17782,7 +18256,7 @@ getCrossMarginConfig(): Promise<
|
|
|
17782
18256
|
getBorrowableCurrencies(): Promise<
|
|
17783
18257
|
APISuccessResponse<BorrowableCurrencyUTA[]>
|
|
17784
18258
|
> {
|
|
17785
|
-
return this.get('api/ua/
|
|
18259
|
+
return this.get('api/ua/v2/market/borrowable-currency');
|
|
17786
18260
|
⋮----
|
|
17787
18261
|
/**
|
|
17788
18262
|
* Get Service Status
|
|
@@ -17803,7 +18277,7 @@ getClientIPAddress(): Promise<APISuccessResponse<string>>
|
|
|
17803
18277
|
* Request the fiat price of currencies for available trading pairs. Added 2026.07.01.
|
|
17804
18278
|
*/
|
|
17805
18279
|
getFiatPrice(
|
|
17806
|
-
params
|
|
18280
|
+
params: GetFiatPriceRequestUTA,
|
|
17807
18281
|
): Promise<APISuccessResponse<GetFiatPriceResponseUTA>>
|
|
17808
18282
|
⋮----
|
|
17809
18283
|
/**
|
|
@@ -17821,7 +18295,7 @@ getInterestRateIndex(
|
|
|
17821
18295
|
getTradeStatistics(): Promise<
|
|
17822
18296
|
APISuccessResponse<GetTradeStatisticsResponseUTA>
|
|
17823
18297
|
> {
|
|
17824
|
-
return this.get('api/ua/
|
|
18298
|
+
return this.get('api/ua/v2/trade-statistics');
|
|
17825
18299
|
⋮----
|
|
17826
18300
|
/**
|
|
17827
18301
|
* Get Call Auction Info (UTA)
|
|
@@ -17859,7 +18333,7 @@ getAccount(): Promise<APISuccessResponse<GetClassicAccountResponseUTA>>
|
|
|
17859
18333
|
getAccountOverview(): Promise<
|
|
17860
18334
|
APISuccessResponse<GetAccountOverviewResponseUTA>
|
|
17861
18335
|
> {
|
|
17862
|
-
return this.getPrivate('api/ua/
|
|
18336
|
+
return this.getPrivate('api/ua/v2/unified/account/overview');
|
|
17863
18337
|
⋮----
|
|
17864
18338
|
/**
|
|
17865
18339
|
* Get Sub Account
|
|
@@ -17945,7 +18419,7 @@ getAccountLedger(
|
|
|
17945
18419
|
GetAccountLedgerResponseUTA | GetAccountLedgerResponseClassicUTA
|
|
17946
18420
|
>
|
|
17947
18421
|
> {
|
|
17948
|
-
return this.getPrivate('api/ua/
|
|
18422
|
+
return this.getPrivate('api/ua/v2/account/ledger', params);
|
|
17949
18423
|
⋮----
|
|
17950
18424
|
/**
|
|
17951
18425
|
* Get Interest History (UTA)
|
|
@@ -17977,7 +18451,7 @@ modifyLeverage(
|
|
|
17977
18451
|
*/
|
|
17978
18452
|
modifyMarginCrossLeverage(
|
|
17979
18453
|
params: ModifyMarginCrossLeverageRequestUTA,
|
|
17980
|
-
accountMode: 'unified' = 'unified',
|
|
18454
|
+
accountMode: 'classic' | 'unified' = 'unified',
|
|
17981
18455
|
): Promise<APISuccessResponse<ModifyMarginCrossLeverageResponseUTA>>
|
|
17982
18456
|
⋮----
|
|
17983
18457
|
/**
|
|
@@ -17992,7 +18466,7 @@ getLeverage(
|
|
|
17992
18466
|
* Get Deposit Address
|
|
17993
18467
|
* Return a deposit address; when both currency and chain are provided,
|
|
17994
18468
|
* the address will be created if it does not exist.
|
|
17995
|
-
* URL unified to GET /api/ua/
|
|
18469
|
+
* URL unified to GET /api/ua/v2/asset/deposit/address as of 2026.01.17.
|
|
17996
18470
|
*/
|
|
17997
18471
|
getDepositAddress(
|
|
17998
18472
|
params: GetDepositAddressRequestUTA,
|
|
@@ -18131,10 +18605,18 @@ placeOrder(
|
|
|
18131
18605
|
accountMode: 'classic' | 'unified' = 'unified',
|
|
18132
18606
|
): Promise<APISuccessResponse<PlaceOrderResponseUTA>>
|
|
18133
18607
|
⋮----
|
|
18608
|
+
/**
|
|
18609
|
+
* Amend Order
|
|
18610
|
+
* Modify price, size, or TP/SL trigger prices. Futures only. Provide orderId or clientOid.
|
|
18611
|
+
*/
|
|
18612
|
+
amendOrder(
|
|
18613
|
+
params: AmendOrderRequestUTA,
|
|
18614
|
+
): Promise<APISuccessResponse<AmendOrderResponseUTA>>
|
|
18615
|
+
⋮----
|
|
18134
18616
|
/**
|
|
18135
18617
|
* Batch Place Order (Classic)
|
|
18136
18618
|
* This interface can be used for placing batch orders.
|
|
18137
|
-
* URL changed to /api/ua/
|
|
18619
|
+
* URL changed to /api/ua/v2/{accountMode}/order/place-batch as of 2026.01.17.
|
|
18138
18620
|
* Note: timeInForce supports 'RPI' value for Futures as of 2025.01.02.
|
|
18139
18621
|
*/
|
|
18140
18622
|
batchPlaceOrder(
|
|
@@ -18621,9 +19103,6 @@ File: README.md
|
|
|
18621
19103
|
|
|
18622
19104
|
[1]: https://www.npmjs.com/package/kucoin-api
|
|
18623
19105
|
|
|
18624
|
-
> [!TIP]
|
|
18625
|
-
> Upcoming change: As part of the Siebly.io brand, this SDK is now hosted under our [Siebly.io GitHub organisation](https://github.com/sieblyio). The migration is seamless and requires no user changes.
|
|
18626
|
-
|
|
18627
19106
|
Updated & performant JavaScript & Node.js SDK for the KuCoin REST APIs and WebSockets:
|
|
18628
19107
|
|
|
18629
19108
|
- Professional, robust & performant KuCoin SDK with extensive production use in live trading environments.
|
|
@@ -18649,6 +19128,7 @@ Updated & performant JavaScript & Node.js SDK for the KuCoin REST APIs and WebSo
|
|
|
18649
19128
|
- Proxy support via axios integration.
|
|
18650
19129
|
- Active community support & collaboration in telegram: [Node.js Algo Traders](https://t.me/nodetraders).
|
|
18651
19130
|
- QuickStart Guide: [Kucoin JavaScript QuickStart Guide](https://siebly.io/sdk/kucoin/javascript)
|
|
19131
|
+
- KuCoin JavaScript Tutorial: [KuCoin JavaScript REST API and WebSocket Tutorial](https://siebly.io/sdk/kucoin/javascript/tutorial)
|
|
18652
19132
|
|
|
18653
19133
|
## Table of Contents
|
|
18654
19134
|
|
|
@@ -19180,7 +19660,7 @@ File: package.json
|
|
|
19180
19660
|
================
|
|
19181
19661
|
{
|
|
19182
19662
|
"name": "kucoin-api",
|
|
19183
|
-
"version": "2.6.
|
|
19663
|
+
"version": "2.6.4",
|
|
19184
19664
|
"description": "Complete & robust JavaScript SDK for Kucoin's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
|
|
19185
19665
|
"scripts": {
|
|
19186
19666
|
"clean": "rm -rf dist",
|
|
@@ -19209,10 +19689,10 @@ File: package.json
|
|
|
19209
19689
|
"Jerko J (https://github.com/JJ-Cro)"
|
|
19210
19690
|
],
|
|
19211
19691
|
"dependencies": {
|
|
19212
|
-
"@types/ws": "
|
|
19213
|
-
"axios": "
|
|
19214
|
-
"isomorphic-ws": "
|
|
19215
|
-
"nanoid": "
|
|
19692
|
+
"@types/ws": "8.18.1",
|
|
19693
|
+
"axios": "1.18.1",
|
|
19694
|
+
"isomorphic-ws": "5.0.0",
|
|
19695
|
+
"nanoid": "3.3.18",
|
|
19216
19696
|
"ws": "8.21.1"
|
|
19217
19697
|
},
|
|
19218
19698
|
"devDependencies": {
|
|
@@ -19233,6 +19713,14 @@ File: package.json
|
|
|
19233
19713
|
"webpack": "^5.0.0",
|
|
19234
19714
|
"webpack-cli": "^4.0.0"
|
|
19235
19715
|
},
|
|
19716
|
+
"overrides": {
|
|
19717
|
+
"brace-expansion@<2": "1.1.18",
|
|
19718
|
+
"brace-expansion@>=2 <3": "2.1.4",
|
|
19719
|
+
"brace-expansion@>=5 <6": "5.0.9",
|
|
19720
|
+
"fast-uri@>=3 <4": "3.1.5",
|
|
19721
|
+
"js-yaml@>=3 <4": "3.15.1",
|
|
19722
|
+
"js-yaml@>=4 <5": "4.3.1"
|
|
19723
|
+
},
|
|
19236
19724
|
"keywords": [
|
|
19237
19725
|
"kucoin",
|
|
19238
19726
|
"kucoin api",
|