kucoin-api 2.3.5 → 2.3.6
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/dist/cjs/UnifiedAPIClient.d.ts +193 -2
- package/dist/cjs/UnifiedAPIClient.js +258 -0
- package/dist/cjs/UnifiedAPIClient.js.map +1 -1
- package/dist/cjs/types/request/futures.types.d.ts +21 -3
- package/dist/cjs/types/request/uta-types.d.ts +194 -0
- package/dist/cjs/types/response/futures.types.d.ts +15 -0
- package/dist/cjs/types/response/uta-types.d.ts +353 -8
- package/dist/mjs/UnifiedAPIClient.d.ts +193 -2
- package/dist/mjs/UnifiedAPIClient.js +258 -0
- package/dist/mjs/UnifiedAPIClient.js.map +1 -1
- package/dist/mjs/types/request/futures.types.d.ts +21 -3
- package/dist/mjs/types/request/uta-types.d.ts +194 -0
- package/dist/mjs/types/response/futures.types.d.ts +15 -0
- package/dist/mjs/types/response/uta-types.d.ts +353 -8
- package/llms.txt +11010 -9697
- package/package.json +1 -1
|
@@ -29,6 +29,12 @@ export interface GetOrderBookRequestUTA {
|
|
|
29
29
|
tradeType: 'SPOT' | 'FUTURES';
|
|
30
30
|
symbol: string;
|
|
31
31
|
limit: '20' | '50' | '100' | 'FULL';
|
|
32
|
+
/**
|
|
33
|
+
* Whether it is an RPI Order. Applicable to FUTURES only.
|
|
34
|
+
* 0: noneRPI Orders (default)
|
|
35
|
+
* 1: noneRPI + RPI Orders
|
|
36
|
+
*/
|
|
37
|
+
rpiFilter?: 0 | 1;
|
|
32
38
|
}
|
|
33
39
|
export interface GetKlinesRequestUTA {
|
|
34
40
|
tradeType: 'SPOT' | 'FUTURES';
|
|
@@ -48,3 +54,191 @@ export interface GetHistoryFundingRateRequestUTA {
|
|
|
48
54
|
export interface GetServiceStatusRequestUTA {
|
|
49
55
|
tradeType: 'SPOT' | 'FUTURES';
|
|
50
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Account Endpoints
|
|
59
|
+
*/
|
|
60
|
+
export interface GetClassicAccountRequestUTA {
|
|
61
|
+
accountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'CROSS' | 'ISOLATED';
|
|
62
|
+
accountSubtype?: string;
|
|
63
|
+
currency?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface GetSubAccountRequestUTA {
|
|
66
|
+
UID?: string;
|
|
67
|
+
pageSize?: number;
|
|
68
|
+
lastId?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface GetTransferQuotasRequestUTA {
|
|
71
|
+
currency: string;
|
|
72
|
+
accountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'CROSS' | 'ISOLATED' | 'UNIFIED';
|
|
73
|
+
symbol?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface FlexTransferRequestUTA {
|
|
76
|
+
clientOid: string;
|
|
77
|
+
currency: string;
|
|
78
|
+
amount: string;
|
|
79
|
+
type: '0' | '1' | '2' | '3';
|
|
80
|
+
fromAccountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'CROSS' | 'ISOLATED' | 'UNIFIED';
|
|
81
|
+
toAccountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'CROSS' | 'ISOLATED' | 'UNIFIED';
|
|
82
|
+
fromAccountSymbol?: string;
|
|
83
|
+
toAccountSymbol?: string;
|
|
84
|
+
fromUid?: string;
|
|
85
|
+
toUid?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface SetSubAccountTransferPermissionRequestUTA {
|
|
88
|
+
subUids: string;
|
|
89
|
+
subToSub: boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface SetAccountModeRequestUTA {
|
|
92
|
+
accountType: 'CLASSIC' | 'UNIFIED';
|
|
93
|
+
}
|
|
94
|
+
export interface GetFeeRateRequestUTA {
|
|
95
|
+
tradeType: 'SPOT' | 'FUTURES';
|
|
96
|
+
symbol: string;
|
|
97
|
+
}
|
|
98
|
+
export interface GetAccountLedgerRequestUTA {
|
|
99
|
+
accountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'CROSS' | 'ISOLATED' | 'UNIFIED';
|
|
100
|
+
currency?: string;
|
|
101
|
+
direction?: 'IN' | 'OUT';
|
|
102
|
+
businessType?: 'TRADE_EXCHANGE' | 'TRANSFER' | 'SUB_TRANSFER' | 'RETURNED_FEES' | 'DEDUCTION_FEES' | 'OTHER' | 'SUB_TO_SUB_TRANSFER' | 'SPOT_EXCHANGE' | 'SPOT_EXCHANGE_REBATE' | 'FUTURES_EXCHANGE_OPEN' | 'FUTURES_EXCHANGE_CLOSE' | 'FUTURES_EXCHANGE_REBATE' | 'FUNDING_FEE' | 'LIABILITY_INTEREST' | 'KCS_DEDUCTION_FEES' | 'KCS_RETURNED_FEES' | 'AUTO_EXCHANGE_USER';
|
|
103
|
+
lastId?: number;
|
|
104
|
+
startAt?: number;
|
|
105
|
+
endAt?: number;
|
|
106
|
+
pageSize?: number;
|
|
107
|
+
}
|
|
108
|
+
export interface GetInterestHistoryRequestUTA {
|
|
109
|
+
accountType: 'UNIFIED';
|
|
110
|
+
currency?: string;
|
|
111
|
+
startTime?: number;
|
|
112
|
+
endTime?: number;
|
|
113
|
+
page?: number;
|
|
114
|
+
size?: number;
|
|
115
|
+
}
|
|
116
|
+
export interface ModifyLeverageRequestUTA {
|
|
117
|
+
symbol: string;
|
|
118
|
+
leverage: string;
|
|
119
|
+
}
|
|
120
|
+
export interface GetDepositAddressRequestUTA {
|
|
121
|
+
currency: string;
|
|
122
|
+
chain?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Order Endpoints
|
|
126
|
+
*/
|
|
127
|
+
export interface PlaceOrderRequestUTA {
|
|
128
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
129
|
+
clientOid?: string;
|
|
130
|
+
symbol: string;
|
|
131
|
+
side: 'BUY' | 'SELL';
|
|
132
|
+
positionSide?: 'BOTH' | 'LONG' | 'SHORT';
|
|
133
|
+
orderType: 'LIMIT' | 'MARKET';
|
|
134
|
+
size: string;
|
|
135
|
+
sizeUnit: 'BASECCY' | 'QUOTECCY' | 'UNIT';
|
|
136
|
+
price?: string;
|
|
137
|
+
leverage?: number;
|
|
138
|
+
reduceOnly?: boolean;
|
|
139
|
+
marginMode?: 'ISOLATED' | 'CROSS';
|
|
140
|
+
stp?: 'DC' | 'CO' | 'CN' | 'CB';
|
|
141
|
+
/**
|
|
142
|
+
* Time in Force. Added 'RPI' as of 2025.01.02
|
|
143
|
+
* - GTC: Good Till Cancel (default)
|
|
144
|
+
* - FOK: Fill Or Kill
|
|
145
|
+
* - IOC: Immediate Or Cancel
|
|
146
|
+
* - GTT: Good Till Time (not supported for Futures)
|
|
147
|
+
* - RPI: Retail Price Improvement Order (Phase 1: Futures only)
|
|
148
|
+
*/
|
|
149
|
+
timeInForce?: 'GTC' | 'IOC' | 'GTT' | 'FOK' | 'RPI';
|
|
150
|
+
cancelAfter?: number;
|
|
151
|
+
postOnly?: boolean;
|
|
152
|
+
autoBorrow?: boolean;
|
|
153
|
+
autoRepay?: boolean;
|
|
154
|
+
tags?: string;
|
|
155
|
+
triggerDirection?: 'DOWN' | 'UP';
|
|
156
|
+
triggerPrice?: string;
|
|
157
|
+
triggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
158
|
+
tpTriggerPrice?: string;
|
|
159
|
+
tpTriggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
160
|
+
slTriggerPrice?: string;
|
|
161
|
+
slTriggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
162
|
+
}
|
|
163
|
+
export interface BatchPlaceOrderRequestUTA {
|
|
164
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
165
|
+
orderList: Omit<PlaceOrderRequestUTA, 'tradeType'>[];
|
|
166
|
+
}
|
|
167
|
+
export interface GetOrderDetailsRequestUTA {
|
|
168
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
169
|
+
symbol: string;
|
|
170
|
+
orderId?: string;
|
|
171
|
+
clientOid?: string;
|
|
172
|
+
}
|
|
173
|
+
export interface GetOpenOrderListRequestUTA {
|
|
174
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
175
|
+
symbol?: string;
|
|
176
|
+
orderFilter?: 'NORMAL' | 'CONDITION';
|
|
177
|
+
startAt?: number;
|
|
178
|
+
endAt?: number;
|
|
179
|
+
pageNumber?: number;
|
|
180
|
+
pageSize?: number;
|
|
181
|
+
}
|
|
182
|
+
export interface GetOrderHistoryRequestUTA {
|
|
183
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
184
|
+
symbol?: string;
|
|
185
|
+
side?: 'BUY' | 'SELL';
|
|
186
|
+
orderFilter?: 'NORMAL' | 'CONDITION';
|
|
187
|
+
startAt?: number;
|
|
188
|
+
endAt?: number;
|
|
189
|
+
lastId?: string;
|
|
190
|
+
pageSize?: number;
|
|
191
|
+
}
|
|
192
|
+
export interface GetTradeHistoryRequestUTA {
|
|
193
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
194
|
+
symbol?: string;
|
|
195
|
+
orderId?: string;
|
|
196
|
+
side?: 'BUY' | 'SELL';
|
|
197
|
+
type?: 'LIMIT' | 'MARKET';
|
|
198
|
+
startAt?: number;
|
|
199
|
+
endAt?: number;
|
|
200
|
+
lastId?: string;
|
|
201
|
+
pageSize?: number;
|
|
202
|
+
}
|
|
203
|
+
export interface CancelOrderRequestUTA {
|
|
204
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
205
|
+
symbol: string;
|
|
206
|
+
orderId?: string;
|
|
207
|
+
clientOid?: string;
|
|
208
|
+
}
|
|
209
|
+
export interface CancelOrderItemRequestUTA {
|
|
210
|
+
symbol: string;
|
|
211
|
+
orderId?: string;
|
|
212
|
+
clientOid?: string;
|
|
213
|
+
}
|
|
214
|
+
export interface BatchCancelOrdersRequestUTA {
|
|
215
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
216
|
+
cancelOrderList: CancelOrderItemRequestUTA[];
|
|
217
|
+
}
|
|
218
|
+
export interface SetDCPRequestUTA {
|
|
219
|
+
tradeType: 'SPOT' | 'FUTURES' | 'MARGIN';
|
|
220
|
+
timeout: number;
|
|
221
|
+
symbols?: string[];
|
|
222
|
+
}
|
|
223
|
+
export interface GetDCPRequestUTA {
|
|
224
|
+
tradeType: 'SPOT' | 'FUTURES' | 'MARGIN';
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Position Endpoints
|
|
228
|
+
*/
|
|
229
|
+
export interface GetPositionListRequestUTA {
|
|
230
|
+
symbol?: string;
|
|
231
|
+
}
|
|
232
|
+
export interface GetPositionsHistoryRequestUTA {
|
|
233
|
+
symbol?: string;
|
|
234
|
+
startAt?: number;
|
|
235
|
+
endAt?: number;
|
|
236
|
+
lastId?: number;
|
|
237
|
+
pageSize?: number;
|
|
238
|
+
}
|
|
239
|
+
export interface GetAccountPositionTiersRequestUTA {
|
|
240
|
+
symbol: string;
|
|
241
|
+
tradeType?: 'FUTURES' | 'MARGIN';
|
|
242
|
+
marginMode?: 'ISOLATED' | 'CROSS';
|
|
243
|
+
data?: 'RISK_LIMIT' | 'BORROW';
|
|
244
|
+
}
|
|
@@ -127,6 +127,10 @@ export interface FuturesSymbolInfo {
|
|
|
127
127
|
baseCurrency: string;
|
|
128
128
|
quoteCurrency: string;
|
|
129
129
|
settleCurrency: string;
|
|
130
|
+
/** Display symbol for multilingual compatibility (added 2025.12.26 & 2026.01.12) */
|
|
131
|
+
displaySymbol?: string;
|
|
132
|
+
/** Display base currency for multilingual compatibility (added 2025.12.26 & 2026.01.12) */
|
|
133
|
+
displayBaseCurrency?: string;
|
|
130
134
|
maxOrderQty: number;
|
|
131
135
|
maxPrice: number;
|
|
132
136
|
lotSize: number;
|
|
@@ -279,6 +283,12 @@ export interface FuturesOrder {
|
|
|
279
283
|
stopPriceType: 'TP' | 'MP' | 'IP' | '';
|
|
280
284
|
stopTriggered: boolean;
|
|
281
285
|
stopPrice: number | null;
|
|
286
|
+
/**
|
|
287
|
+
* Time in Force. Added 'RPI' as of 2025.01.02
|
|
288
|
+
* - GTC: Good Till Cancel
|
|
289
|
+
* - IOC: Immediate Or Cancel
|
|
290
|
+
* - RPI: Retail Price Improvement Order (Phase 1: Futures only)
|
|
291
|
+
*/
|
|
282
292
|
timeInForce: string;
|
|
283
293
|
postOnly: boolean;
|
|
284
294
|
hidden: boolean;
|
|
@@ -293,8 +303,10 @@ export interface FuturesOrder {
|
|
|
293
303
|
isActive: boolean;
|
|
294
304
|
cancelExist: boolean;
|
|
295
305
|
createdAt: number;
|
|
306
|
+
/** Updated time, standardized to nanoseconds as of 2026.01.12 */
|
|
296
307
|
updatedAt: number;
|
|
297
308
|
endAt: number | null;
|
|
309
|
+
/** Order time, standardized to nanoseconds as of 2026.01.12 */
|
|
298
310
|
orderTime: number;
|
|
299
311
|
settleCurrency: string;
|
|
300
312
|
marginMode: 'ISOLATED' | 'CROSS';
|
|
@@ -352,8 +364,11 @@ export interface FuturesFill {
|
|
|
352
364
|
displayType: 'limit' | 'market' | 'limit_stop' | 'market_stop';
|
|
353
365
|
tradeType: 'trade' | 'cancel' | 'liquid' | 'adl' | 'settlement';
|
|
354
366
|
subTradeType: string | null;
|
|
367
|
+
/** Trade time (execution time), standardized to nanoseconds as of 2026.01.12 */
|
|
355
368
|
tradeTime: number;
|
|
356
369
|
createdAt: number;
|
|
370
|
+
/** Whether it is an RPI trade (added 2025.01.02) */
|
|
371
|
+
isRpiTrade?: boolean;
|
|
357
372
|
}
|
|
358
373
|
export interface FuturesFills {
|
|
359
374
|
currentPage: number;
|
|
@@ -74,6 +74,11 @@ export interface SymbolUTA {
|
|
|
74
74
|
settlementTime?: number | null;
|
|
75
75
|
maxPrice?: string | number;
|
|
76
76
|
lotSize?: string | number;
|
|
77
|
+
/**
|
|
78
|
+
* Unit size. As of 2026.01.12:
|
|
79
|
+
* - For inverse contracts: changed from -1 to 1 (1 contract = 1 USD)
|
|
80
|
+
* - For Futures: unitSize indicates contract size
|
|
81
|
+
*/
|
|
77
82
|
unitSize?: string | number;
|
|
78
83
|
makerFeeRate?: string | number;
|
|
79
84
|
takerFeeRate?: string | number;
|
|
@@ -91,6 +96,10 @@ export interface SymbolUTA {
|
|
|
91
96
|
quoteBorrowEnable?: boolean | string;
|
|
92
97
|
baseTransferInEnable?: boolean | string;
|
|
93
98
|
quoteTransferInEnable?: boolean | string;
|
|
99
|
+
/** Display symbol for Futures (added 2025.12.26 & 2026.01.12) */
|
|
100
|
+
displaySymbol?: string;
|
|
101
|
+
/** Display base currency for Futures (added 2025.12.26 & 2026.01.12) */
|
|
102
|
+
displayBaseCurrency?: string;
|
|
94
103
|
}
|
|
95
104
|
export interface GetSymbolResponseUTA {
|
|
96
105
|
tradeType: string;
|
|
@@ -113,31 +122,46 @@ export interface TickerUTA {
|
|
|
113
122
|
}
|
|
114
123
|
export interface GetTickerResponseUTA {
|
|
115
124
|
tradeType: string;
|
|
125
|
+
/** Timestamp in nanoseconds (as of 2026.01.12) */
|
|
116
126
|
ts: number;
|
|
117
127
|
list: TickerUTA[];
|
|
118
128
|
}
|
|
119
129
|
export interface TradeUTA {
|
|
120
|
-
sequence: string;
|
|
130
|
+
sequence: string | number;
|
|
121
131
|
tradeId: string;
|
|
122
132
|
price: string;
|
|
123
133
|
size: string;
|
|
124
134
|
side: 'buy' | 'sell';
|
|
135
|
+
/** Timestamp in nanoseconds */
|
|
125
136
|
ts: number;
|
|
137
|
+
/** Whether it is an RPI trade (Futures only) */
|
|
138
|
+
isRpiTrade?: boolean;
|
|
126
139
|
}
|
|
127
140
|
export interface GetTradesResponseUTA {
|
|
128
141
|
tradeType: string;
|
|
129
142
|
list: TradeUTA[];
|
|
130
143
|
}
|
|
131
|
-
export interface OrderBookLevelUTA {
|
|
132
|
-
price: string;
|
|
133
|
-
size: string;
|
|
134
|
-
}
|
|
135
144
|
export interface GetOrderBookResponseUTA {
|
|
136
145
|
tradeType: string;
|
|
137
146
|
symbol: string;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
/** Sequence number. Changed from string to number for Spot as of 2026.01.17 */
|
|
148
|
+
sequence: number;
|
|
149
|
+
/**
|
|
150
|
+
* Bids array, ordered from high to low.
|
|
151
|
+
* When rpiFilter=0 (or not set): each entry is [price, size]
|
|
152
|
+
* When rpiFilter=1: each entry is [price, noneRPISize, RPISize]
|
|
153
|
+
* As of 2026.01.17: All values are strings
|
|
154
|
+
*/
|
|
155
|
+
bids: string[][];
|
|
156
|
+
/**
|
|
157
|
+
* Asks array, ordered from low to high.
|
|
158
|
+
* When rpiFilter=0 (or not set): each entry is [price, size]
|
|
159
|
+
* When rpiFilter=1: each entry is [price, noneRPISize, RPISize]
|
|
160
|
+
* As of 2026.01.17: All values are strings
|
|
161
|
+
*/
|
|
162
|
+
asks: string[][];
|
|
163
|
+
/** Timestamp in nanoseconds (Futures only) */
|
|
164
|
+
ts?: number;
|
|
141
165
|
}
|
|
142
166
|
export interface GetKlinesResponseUTA {
|
|
143
167
|
tradeType: string;
|
|
@@ -170,3 +194,324 @@ export interface GetServiceStatusResponseUTA {
|
|
|
170
194
|
serverStatus: 'open' | 'close' | 'cancelonly';
|
|
171
195
|
msg: string;
|
|
172
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Account Response Types
|
|
199
|
+
*/
|
|
200
|
+
export interface AccountCurrencyUTA {
|
|
201
|
+
currency: string;
|
|
202
|
+
hold: string;
|
|
203
|
+
available: string;
|
|
204
|
+
balance: string;
|
|
205
|
+
equity: string;
|
|
206
|
+
liability?: string;
|
|
207
|
+
totalCrossMargin?: string;
|
|
208
|
+
crossPosMargin?: string;
|
|
209
|
+
crossOrderMargin?: string;
|
|
210
|
+
crossUnPnl?: string;
|
|
211
|
+
isolatedPosMargin?: string;
|
|
212
|
+
isolatedOrderMargin?: string;
|
|
213
|
+
isolatedFundingFeeMargin?: string;
|
|
214
|
+
isolatedUnPnl?: string;
|
|
215
|
+
liabilityPrinciple?: string;
|
|
216
|
+
liabilityInterest?: string;
|
|
217
|
+
unrealisedPnl?: string;
|
|
218
|
+
}
|
|
219
|
+
export interface AccountDataUTA {
|
|
220
|
+
accountSubtype?: string;
|
|
221
|
+
riskRatio?: string;
|
|
222
|
+
currencies: AccountCurrencyUTA[];
|
|
223
|
+
}
|
|
224
|
+
export interface GetClassicAccountResponseUTA {
|
|
225
|
+
accountType: string;
|
|
226
|
+
ts: number;
|
|
227
|
+
accounts: AccountDataUTA[];
|
|
228
|
+
}
|
|
229
|
+
export interface GetAccountOverviewResponseUTA {
|
|
230
|
+
accountType: string;
|
|
231
|
+
riskRatio: string;
|
|
232
|
+
equity: string;
|
|
233
|
+
liability: string;
|
|
234
|
+
availableMargin: string;
|
|
235
|
+
adjustedEquity: string;
|
|
236
|
+
im: string;
|
|
237
|
+
mm: string;
|
|
238
|
+
}
|
|
239
|
+
export interface SubAccountUserUTA {
|
|
240
|
+
uid: number;
|
|
241
|
+
accountList: {
|
|
242
|
+
accountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'CROSS' | 'ISOLATED' | 'OPTIONS' | 'UNIFIED';
|
|
243
|
+
accountSubType: string | null;
|
|
244
|
+
currencyList: AccountCurrencyUTA[];
|
|
245
|
+
}[];
|
|
246
|
+
}
|
|
247
|
+
export interface GetSubAccountResponseUTA {
|
|
248
|
+
ts: number;
|
|
249
|
+
userList: SubAccountUserUTA[];
|
|
250
|
+
}
|
|
251
|
+
export interface GetTransferQuotasResponseUTA {
|
|
252
|
+
currency: string;
|
|
253
|
+
transferable: string;
|
|
254
|
+
accountType: string;
|
|
255
|
+
}
|
|
256
|
+
export interface FlexTransferResponseUTA {
|
|
257
|
+
orderId: string;
|
|
258
|
+
clientOid: string;
|
|
259
|
+
}
|
|
260
|
+
export interface SubAccountTransferPermissionUTA {
|
|
261
|
+
subUid: string;
|
|
262
|
+
subToSub: boolean;
|
|
263
|
+
}
|
|
264
|
+
export interface GetAccountModeResponseUTA {
|
|
265
|
+
selfAccountMode: 'CLASSIC' | 'UNIFIED';
|
|
266
|
+
unifiedSubAccount: number[];
|
|
267
|
+
classicSubAccount: number[];
|
|
268
|
+
}
|
|
269
|
+
export interface FeeRateItemUTA {
|
|
270
|
+
symbol: string;
|
|
271
|
+
takerFeeRate: string;
|
|
272
|
+
makerFeeRate: string;
|
|
273
|
+
}
|
|
274
|
+
export interface GetFeeRateResponseUTA {
|
|
275
|
+
tradeType: string;
|
|
276
|
+
list: FeeRateItemUTA[];
|
|
277
|
+
}
|
|
278
|
+
export interface AccountLedgerItemUTA {
|
|
279
|
+
accountType: 'FUNDING' | 'SPOT' | 'FUTURES' | 'CROSS' | 'ISOLATED' | 'UNIFIED';
|
|
280
|
+
id: string;
|
|
281
|
+
currency: string;
|
|
282
|
+
direction: 'IN' | 'OUT';
|
|
283
|
+
businessType: string;
|
|
284
|
+
amount: string;
|
|
285
|
+
balance: string;
|
|
286
|
+
fee: string;
|
|
287
|
+
tax: string;
|
|
288
|
+
remark: string;
|
|
289
|
+
/** Timestamp in nanoseconds (standardized as of 2026.01.12) */
|
|
290
|
+
ts: number;
|
|
291
|
+
}
|
|
292
|
+
export interface GetAccountLedgerResponseUTA {
|
|
293
|
+
lastId?: number;
|
|
294
|
+
items?: AccountLedgerItemUTA[];
|
|
295
|
+
}
|
|
296
|
+
export type GetAccountLedgerResponseClassicUTA = AccountLedgerItemUTA[];
|
|
297
|
+
export interface InterestHistoryItemUTA {
|
|
298
|
+
liability: string;
|
|
299
|
+
interest: string;
|
|
300
|
+
hourlyInterestRate: string;
|
|
301
|
+
currency: string;
|
|
302
|
+
ts: number;
|
|
303
|
+
interestFreeLiability: string;
|
|
304
|
+
}
|
|
305
|
+
export interface GetInterestHistoryResponseUTA {
|
|
306
|
+
items: InterestHistoryItemUTA[];
|
|
307
|
+
lastId: number;
|
|
308
|
+
}
|
|
309
|
+
export interface DepositAddressUTA {
|
|
310
|
+
address: string;
|
|
311
|
+
memo: string;
|
|
312
|
+
chainId: string;
|
|
313
|
+
to: 'MAIN' | 'TRADE';
|
|
314
|
+
currency: string;
|
|
315
|
+
contractAddress: string;
|
|
316
|
+
chainName: string;
|
|
317
|
+
expirationDate: string;
|
|
318
|
+
remark: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Order Response Types
|
|
322
|
+
*/
|
|
323
|
+
export interface PlaceOrderResponseUTA {
|
|
324
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
325
|
+
orderId: string;
|
|
326
|
+
clientOid: string;
|
|
327
|
+
/** Timestamp when system completes order request in nanoseconds. Classic mode not supported */
|
|
328
|
+
ts?: number;
|
|
329
|
+
/** Borrow amount. Unified mode not supported */
|
|
330
|
+
borrowSize?: string;
|
|
331
|
+
/** Loan order ID. Unified mode not supported */
|
|
332
|
+
loanApplyId?: string;
|
|
333
|
+
}
|
|
334
|
+
export interface BatchPlaceOrderItemResponseUTA {
|
|
335
|
+
orderId?: string;
|
|
336
|
+
clientOid?: string;
|
|
337
|
+
symbol?: string;
|
|
338
|
+
code?: string;
|
|
339
|
+
msg?: string;
|
|
340
|
+
}
|
|
341
|
+
export interface BatchPlaceOrderResponseUTA {
|
|
342
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
343
|
+
items: BatchPlaceOrderItemResponseUTA[];
|
|
344
|
+
}
|
|
345
|
+
export interface OrderDetailsUTA {
|
|
346
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
347
|
+
orderId: string;
|
|
348
|
+
clientOid: string;
|
|
349
|
+
/**
|
|
350
|
+
* Order status:
|
|
351
|
+
* - 0: notTriggered (conditional order, not triggered)
|
|
352
|
+
* - 1: triggered (conditional order, triggered but not live)
|
|
353
|
+
* - 2: live (not filled)
|
|
354
|
+
* - 3: filled (fully filled)
|
|
355
|
+
* - 4: partial filled (partially filled, still active)
|
|
356
|
+
* - 5: canceled (no fills, fully canceled)
|
|
357
|
+
* - 6: partial canceled (partially filled, remainder canceled)
|
|
358
|
+
* Changed from String to Number for UTA as of 2026.01.17
|
|
359
|
+
*/
|
|
360
|
+
status: number;
|
|
361
|
+
filledSize: string;
|
|
362
|
+
avgPrice: string;
|
|
363
|
+
fee: string;
|
|
364
|
+
feeCurrency: string;
|
|
365
|
+
tax: string;
|
|
366
|
+
tradeId: string;
|
|
367
|
+
symbol: string;
|
|
368
|
+
side: 'BUY' | 'SELL';
|
|
369
|
+
positionSide?: 'BOTH' | 'LONG' | 'SHORT';
|
|
370
|
+
orderType: 'LIMIT' | 'MARKET';
|
|
371
|
+
size: string;
|
|
372
|
+
sizeUnit: 'BASECCY' | 'QUOTECCY' | 'UNIT';
|
|
373
|
+
price: string;
|
|
374
|
+
leverage?: string;
|
|
375
|
+
reduceOnly?: boolean;
|
|
376
|
+
marginMode?: 'ISOLATED' | 'CROSS';
|
|
377
|
+
stp?: 'DC' | 'CO' | 'CN' | 'CB' | '';
|
|
378
|
+
/**
|
|
379
|
+
* Time in Force. Added 'RPI' as of 2025.01.02
|
|
380
|
+
*/
|
|
381
|
+
timeInForce: 'GTC' | 'IOC' | 'GTT' | 'FOK' | 'RPI';
|
|
382
|
+
cancelReason?: number;
|
|
383
|
+
cancelSize: string;
|
|
384
|
+
cancelAfter?: number;
|
|
385
|
+
triggerDirection?: 'UP' | 'DOWN';
|
|
386
|
+
triggerPrice?: string;
|
|
387
|
+
triggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
388
|
+
tpTriggerPrice?: string;
|
|
389
|
+
tpTriggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
390
|
+
tpOrderPrice?: string;
|
|
391
|
+
slTriggerPrice?: string;
|
|
392
|
+
slTriggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
393
|
+
slOrderPrice?: string;
|
|
394
|
+
postOnly?: boolean;
|
|
395
|
+
tags?: string;
|
|
396
|
+
triggerOrderId?: string;
|
|
397
|
+
/** Order creation time in nanoseconds (standardized as of 2026.01.12) */
|
|
398
|
+
orderTime: number;
|
|
399
|
+
/** Latest order update time in nanoseconds (standardized as of 2026.01.12) */
|
|
400
|
+
updatedTime: number;
|
|
401
|
+
}
|
|
402
|
+
export interface GetOpenOrderListResponseUTA {
|
|
403
|
+
pageNumber: number;
|
|
404
|
+
pageSize?: number;
|
|
405
|
+
totalNum?: number;
|
|
406
|
+
totalPage?: number;
|
|
407
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
408
|
+
items: OrderDetailsUTA[];
|
|
409
|
+
}
|
|
410
|
+
export interface GetOrderHistoryResponseUTA {
|
|
411
|
+
lastId: number;
|
|
412
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
413
|
+
items: OrderDetailsUTA[];
|
|
414
|
+
}
|
|
415
|
+
export interface TradeHistoryItemUTA {
|
|
416
|
+
tradeId: string;
|
|
417
|
+
orderId: string;
|
|
418
|
+
symbol: string;
|
|
419
|
+
side: 'BUY' | 'SELL';
|
|
420
|
+
positionSide?: 'BOTH' | 'LONG' | 'SHORT';
|
|
421
|
+
type: 'LIMIT' | 'MARKET';
|
|
422
|
+
price: string;
|
|
423
|
+
size: string;
|
|
424
|
+
sizeUnit: 'BASECCY' | 'QUOTECCY' | 'UNIT';
|
|
425
|
+
value: string;
|
|
426
|
+
feeRate: string;
|
|
427
|
+
fee: string;
|
|
428
|
+
feeCurrency: string;
|
|
429
|
+
tax: string;
|
|
430
|
+
liquidity: 'TAKER' | 'MAKER';
|
|
431
|
+
/** Execution time in nanoseconds (standardized as of 2026.01.12) */
|
|
432
|
+
executionTime: number;
|
|
433
|
+
/** Whether it is an RPI trade (added 2025.01.02, Futures only) */
|
|
434
|
+
isRpiTrade?: boolean;
|
|
435
|
+
}
|
|
436
|
+
export interface GetTradeHistoryResponseUTA {
|
|
437
|
+
lastId: number;
|
|
438
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
439
|
+
items: TradeHistoryItemUTA[];
|
|
440
|
+
}
|
|
441
|
+
export interface CancelOrderResponseUTA {
|
|
442
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
443
|
+
orderId?: string;
|
|
444
|
+
clientOid?: string;
|
|
445
|
+
/** Timestamp when system completes order cancellation request (nanoseconds). Only for unified accounts */
|
|
446
|
+
ts?: number;
|
|
447
|
+
}
|
|
448
|
+
export interface BatchCancelOrderItemResponseUTA {
|
|
449
|
+
code?: string;
|
|
450
|
+
msg?: string;
|
|
451
|
+
orderId?: string;
|
|
452
|
+
clientOid?: string;
|
|
453
|
+
/** Timestamp when system completes order cancellation request (nanoseconds). Not supported for classic accounts */
|
|
454
|
+
ts?: number;
|
|
455
|
+
}
|
|
456
|
+
export interface BatchCancelOrdersResponseUTA {
|
|
457
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
458
|
+
items: BatchCancelOrderItemResponseUTA[];
|
|
459
|
+
}
|
|
460
|
+
export interface DCPResponseUTA {
|
|
461
|
+
tradeType: 'SPOT' | 'FUTURES' | 'MARGIN';
|
|
462
|
+
symbol: string[];
|
|
463
|
+
systemTime: number;
|
|
464
|
+
triggerTime: number;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Position Response Types
|
|
468
|
+
*/
|
|
469
|
+
export interface PositionUTA {
|
|
470
|
+
id: string;
|
|
471
|
+
symbol: string;
|
|
472
|
+
marginMode: 'CROSS' | 'ISOLATED';
|
|
473
|
+
size: string;
|
|
474
|
+
entryPrice: string;
|
|
475
|
+
positionValue: string;
|
|
476
|
+
markPrice: string;
|
|
477
|
+
leverage: string;
|
|
478
|
+
unrealizedPnL: string;
|
|
479
|
+
realizedPnL: string;
|
|
480
|
+
initialMargin: string;
|
|
481
|
+
mmr: string;
|
|
482
|
+
maintenanceMargin: string;
|
|
483
|
+
/** Timestamp when position was first opened (nanoseconds, standardized as of 2026.01.12) */
|
|
484
|
+
creationTime: number;
|
|
485
|
+
}
|
|
486
|
+
export interface PositionHistoryItemUTA {
|
|
487
|
+
closeId: string;
|
|
488
|
+
symbol: string;
|
|
489
|
+
marginMode: 'CROSS' | 'ISOLATED';
|
|
490
|
+
side: 'LONG' | 'SHORT';
|
|
491
|
+
entryPrice: string;
|
|
492
|
+
closePrice: string;
|
|
493
|
+
avgClosePrice: string;
|
|
494
|
+
maxSize: string;
|
|
495
|
+
leverage: string;
|
|
496
|
+
realizedPnL: string;
|
|
497
|
+
fee: string;
|
|
498
|
+
tax: string;
|
|
499
|
+
fundingFee: string;
|
|
500
|
+
/** Position opening timestamp (nanoseconds, standardized as of 2026.01.12) */
|
|
501
|
+
creationTime: number;
|
|
502
|
+
/** Position closing timestamp (nanoseconds, standardized as of 2026.01.12) */
|
|
503
|
+
closingTime: number;
|
|
504
|
+
}
|
|
505
|
+
export interface GetPositionsHistoryResponseUTA {
|
|
506
|
+
items: PositionHistoryItemUTA[];
|
|
507
|
+
lastId?: number;
|
|
508
|
+
}
|
|
509
|
+
export interface PositionTierUTA {
|
|
510
|
+
symbol: string;
|
|
511
|
+
tier: number;
|
|
512
|
+
maxSize: string;
|
|
513
|
+
minSize: string;
|
|
514
|
+
maxLeverage: string;
|
|
515
|
+
initialMarginRate: string;
|
|
516
|
+
maintainMarginRate: string;
|
|
517
|
+
}
|