kucoin-api 2.5.1 → 2.5.2
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 -0
- package/dist/cjs/UnifiedAPIClient.d.ts +39 -3
- package/dist/cjs/UnifiedAPIClient.js +54 -1
- package/dist/cjs/UnifiedAPIClient.js.map +1 -1
- package/dist/cjs/types/request/uta-types.d.ts +60 -8
- package/dist/cjs/types/response/uta-types.d.ts +68 -8
- package/dist/mjs/UnifiedAPIClient.d.ts +39 -3
- package/dist/mjs/UnifiedAPIClient.js +54 -1
- package/dist/mjs/UnifiedAPIClient.js.map +1 -1
- package/dist/mjs/types/request/uta-types.d.ts +60 -8
- package/dist/mjs/types/response/uta-types.d.ts +68 -8
- package/llms.txt +7902 -7560
- package/package.json +1 -1
|
@@ -30,6 +30,13 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
30
30
|
getCurrency(params) {
|
|
31
31
|
return this.get('api/ua/v1/market/currency', params);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Get Third-Party Custody Currencies
|
|
35
|
+
* Query settlement currencies supported by third-party (OES) custodian institutions.
|
|
36
|
+
*/
|
|
37
|
+
getThirdPartyCustodyCurrencies(params) {
|
|
38
|
+
return this.get('api/ua/v1/oes/currency', params);
|
|
39
|
+
}
|
|
33
40
|
/**
|
|
34
41
|
* Get Symbol
|
|
35
42
|
* Request a list of available currency pairs for trading via this endpoint.
|
|
@@ -86,6 +93,13 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
86
93
|
getCrossMarginConfig() {
|
|
87
94
|
return this.get('api/ua/v1/market/cross-config');
|
|
88
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Get Borrowable Currencies
|
|
98
|
+
* List of borrowable currencies (UTA / public).
|
|
99
|
+
*/
|
|
100
|
+
getBorrowableCurrencies() {
|
|
101
|
+
return this.get('api/ua/v1/market/borrowable-currency');
|
|
102
|
+
}
|
|
89
103
|
/**
|
|
90
104
|
* Get Service Status
|
|
91
105
|
* Get the service status.
|
|
@@ -192,6 +206,13 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
192
206
|
getInterestHistory(params) {
|
|
193
207
|
return this.getPrivate('api/ua/v1/account/interest-history', params);
|
|
194
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Get Borrowing Rates and Limits
|
|
211
|
+
* Hourly/daily rates and borrow limits (UTA).
|
|
212
|
+
*/
|
|
213
|
+
getBorrowingRatesAndLimits(params) {
|
|
214
|
+
return this.getPrivate('api/ua/v1/account/interest-limits', params);
|
|
215
|
+
}
|
|
195
216
|
/**
|
|
196
217
|
* Modify Leverage (UTA)
|
|
197
218
|
* This interface supports modify leverage of the specified symbol.
|
|
@@ -199,6 +220,20 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
199
220
|
modifyLeverage(params) {
|
|
200
221
|
return this.postPrivate('api/ua/v1/unified/account/modify-leverage', params);
|
|
201
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Modify Leverage Margin Cross (UTA)
|
|
225
|
+
* Update leverage for a currency in UTA cross margin.
|
|
226
|
+
*/
|
|
227
|
+
modifyMarginCrossLeverage(params, accountMode = 'unified') {
|
|
228
|
+
return this.postPrivate(`api/ua/v1/${accountMode}/account/modify-leverage-margin-cross`, params);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Get Leverage (UTA)
|
|
232
|
+
* Query leverage for MARGIN (currency) or FUTURES (symbol).
|
|
233
|
+
*/
|
|
234
|
+
getLeverage(params) {
|
|
235
|
+
return this.getPrivate('api/ua/v1/unified/account/leverage', params);
|
|
236
|
+
}
|
|
202
237
|
/**
|
|
203
238
|
* Get Deposit Address
|
|
204
239
|
* Return a deposit address; when both currency and chain are provided,
|
|
@@ -208,6 +243,13 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
208
243
|
getDepositAddress(params) {
|
|
209
244
|
return this.getPrivate('api/ua/v1/asset/deposit/address', params);
|
|
210
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* Get Third-Party Custody Account Currency Limits
|
|
248
|
+
* OES remaining custody quota per custodian and settlement currency.
|
|
249
|
+
*/
|
|
250
|
+
getThirdPartyCustodyQuota(params) {
|
|
251
|
+
return this.getPrivate('api/ua/v1/oes/custody-quota', params);
|
|
252
|
+
}
|
|
211
253
|
/**
|
|
212
254
|
*
|
|
213
255
|
* REST - Unified Trading Account - Orders
|
|
@@ -219,13 +261,16 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
219
261
|
* Supports RPI (Retail Price Improvement) orders for Futures as of 2025.01.02.
|
|
220
262
|
* Note: timeInForce supports 'RPI' value for Futures only (Phase 1).
|
|
221
263
|
* Note: For Classic mode, tradeType is required in query param.
|
|
222
|
-
* Note: For Unified mode, tradeType
|
|
264
|
+
* Note: For Unified mode, tradeType is sent in the request body (incl. MARGIN as of 2026.04.19).
|
|
223
265
|
*/
|
|
224
266
|
placeOrder(params, accountMode = 'unified') {
|
|
225
267
|
const { tradeType, ...bodyParams } = params;
|
|
226
268
|
const url = accountMode === 'classic'
|
|
227
269
|
? `api/ua/v1/${accountMode}/order/place?tradeType=${tradeType}`
|
|
228
270
|
: `api/ua/v1/${accountMode}/order/place`;
|
|
271
|
+
if (accountMode === 'unified') {
|
|
272
|
+
return this.postPrivate(url, { ...bodyParams, tradeType });
|
|
273
|
+
}
|
|
229
274
|
return this.postPrivate(url, bodyParams);
|
|
230
275
|
}
|
|
231
276
|
/**
|
|
@@ -336,6 +381,7 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
336
381
|
* Get Position List (UTA)
|
|
337
382
|
* Get the position details of all open positions.
|
|
338
383
|
* Note: creationTime standardized to nanoseconds as of 2026.01.12.
|
|
384
|
+
* Note: pageNumber, pageSize query params and liquidationPrice in each position (as of 2026.04.09).
|
|
339
385
|
*/
|
|
340
386
|
getPositionList(params) {
|
|
341
387
|
return this.getPrivate('api/ua/v1/unified/position/open-list', params);
|
|
@@ -350,6 +396,13 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
350
396
|
getPositionsHistory(params) {
|
|
351
397
|
return this.getPrivate('api/ua/v1/position/history', params);
|
|
352
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* Get Private Funding Fee History
|
|
401
|
+
* Settled funding fee records for the current account.
|
|
402
|
+
*/
|
|
403
|
+
getPrivateFundingFeeHistory(params) {
|
|
404
|
+
return this.getPrivate('api/ua/v1/position/funding-history', params);
|
|
405
|
+
}
|
|
353
406
|
/**
|
|
354
407
|
* Get Account Position Tiers
|
|
355
408
|
* Request account position tiers (risk limit) info.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnifiedAPIClient.js","sourceRoot":"","sources":["../../src/UnifiedAPIClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAkB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"UnifiedAPIClient.js","sourceRoot":"","sources":["../../src/UnifiedAPIClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAkB,MAAM,uBAAuB,CAAC;AA2F9E;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,cAAc;IAClD,aAAa;QACX,OAAO,qBAAqB,CAAC,qBAAqB,CAAC;IACrD,CAAC;IAED;;;;OAIG;IAEH;;;;OAIG;IACH,gBAAgB,CACd,MAAmC;QAEnC,OAAO,IAAI,CAAC,GAAG,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,WAAW,CACT,MAA8B;QAE9B,OAAO,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACH,8BAA8B,CAC5B,MAAiD;QAEj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AAS;QAE9C,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,WAAW,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC5E,CAAC;CACF"}
|
|
@@ -113,10 +113,27 @@ export interface GetInterestHistoryRequestUTA {
|
|
|
113
113
|
page?: number;
|
|
114
114
|
size?: number;
|
|
115
115
|
}
|
|
116
|
+
export interface GetBorrowingRatesAndLimitsRequestUTA {
|
|
117
|
+
currency: string;
|
|
118
|
+
}
|
|
116
119
|
export interface ModifyLeverageRequestUTA {
|
|
117
120
|
symbol: string;
|
|
118
121
|
leverage: string;
|
|
119
122
|
}
|
|
123
|
+
/** UTA cross margin only — path includes accountMode (typically unified) */
|
|
124
|
+
export interface ModifyMarginCrossLeverageRequestUTA {
|
|
125
|
+
leverage: string;
|
|
126
|
+
/** Cross margin currency (e.g. BTC) */
|
|
127
|
+
currency?: string;
|
|
128
|
+
}
|
|
129
|
+
export interface GetLeverageRequestUTA {
|
|
130
|
+
tradeType: 'MARGIN' | 'FUTURES';
|
|
131
|
+
marginMode: 'CROSS' | 'ISOLATED';
|
|
132
|
+
/** Required for MARGIN when not returning all; optional => all for MARGIN */
|
|
133
|
+
currency?: string;
|
|
134
|
+
/** Required for FUTURES when not returning all; optional => all for FUTURES */
|
|
135
|
+
symbol?: string;
|
|
136
|
+
}
|
|
120
137
|
export interface GetDepositAddressRequestUTA {
|
|
121
138
|
currency: string;
|
|
122
139
|
chain?: string;
|
|
@@ -125,7 +142,7 @@ export interface GetDepositAddressRequestUTA {
|
|
|
125
142
|
* Order Endpoints
|
|
126
143
|
*/
|
|
127
144
|
export interface PlaceOrderRequestUTA {
|
|
128
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
145
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
129
146
|
clientOid?: string;
|
|
130
147
|
symbol: string;
|
|
131
148
|
side: 'BUY' | 'SELL';
|
|
@@ -161,17 +178,17 @@ export interface PlaceOrderRequestUTA {
|
|
|
161
178
|
slTriggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
162
179
|
}
|
|
163
180
|
export interface BatchPlaceOrderRequestUTA {
|
|
164
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
181
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
165
182
|
orderList: Omit<PlaceOrderRequestUTA, 'tradeType'>[];
|
|
166
183
|
}
|
|
167
184
|
export interface GetOrderDetailsRequestUTA {
|
|
168
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
185
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
169
186
|
symbol: string;
|
|
170
187
|
orderId?: string;
|
|
171
188
|
clientOid?: string;
|
|
172
189
|
}
|
|
173
190
|
export interface GetOpenOrderListRequestUTA {
|
|
174
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
191
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
175
192
|
symbol?: string;
|
|
176
193
|
orderFilter?: 'NORMAL' | 'CONDITION';
|
|
177
194
|
startAt?: number;
|
|
@@ -180,7 +197,7 @@ export interface GetOpenOrderListRequestUTA {
|
|
|
180
197
|
pageSize?: number;
|
|
181
198
|
}
|
|
182
199
|
export interface GetOrderHistoryRequestUTA {
|
|
183
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
200
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
184
201
|
symbol?: string;
|
|
185
202
|
side?: 'BUY' | 'SELL';
|
|
186
203
|
orderFilter?: 'NORMAL' | 'CONDITION';
|
|
@@ -190,7 +207,7 @@ export interface GetOrderHistoryRequestUTA {
|
|
|
190
207
|
pageSize?: number;
|
|
191
208
|
}
|
|
192
209
|
export interface GetTradeHistoryRequestUTA {
|
|
193
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
210
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
194
211
|
symbol?: string;
|
|
195
212
|
orderId?: string;
|
|
196
213
|
side?: 'BUY' | 'SELL';
|
|
@@ -201,7 +218,7 @@ export interface GetTradeHistoryRequestUTA {
|
|
|
201
218
|
pageSize?: number;
|
|
202
219
|
}
|
|
203
220
|
export interface CancelOrderRequestUTA {
|
|
204
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
221
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
205
222
|
symbol: string;
|
|
206
223
|
orderId?: string;
|
|
207
224
|
clientOid?: string;
|
|
@@ -212,7 +229,7 @@ export interface CancelOrderItemRequestUTA {
|
|
|
212
229
|
clientOid?: string;
|
|
213
230
|
}
|
|
214
231
|
export interface BatchCancelOrdersRequestUTA {
|
|
215
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
232
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
216
233
|
cancelOrderList: CancelOrderItemRequestUTA[];
|
|
217
234
|
}
|
|
218
235
|
/** Batch cancel orders by symbol (POST /order/cancel-all) */
|
|
@@ -235,6 +252,33 @@ export interface GetDCPRequestUTA {
|
|
|
235
252
|
*/
|
|
236
253
|
export interface GetPositionListRequestUTA {
|
|
237
254
|
symbol?: string;
|
|
255
|
+
pageNumber?: number;
|
|
256
|
+
pageSize?: number;
|
|
257
|
+
}
|
|
258
|
+
/** Third-party custody (OES) custodian codes */
|
|
259
|
+
export type ThirdPartyCustodyCustodianUTA = 'BITGO_SG' | 'BITGO_SD' | 'CACTUS' | 'CEFFU';
|
|
260
|
+
/**
|
|
261
|
+
* Get Third-Party Custody Currencies (public)
|
|
262
|
+
* Settlement currencies supported per custodian.
|
|
263
|
+
*/
|
|
264
|
+
export interface GetThirdPartyCustodyCurrenciesRequestUTA {
|
|
265
|
+
/** If omitted, returns all custodian rows */
|
|
266
|
+
custodian?: ThirdPartyCustodyCustodianUTA;
|
|
267
|
+
/** If omitted, all currencies for the selected custodian(s) */
|
|
268
|
+
currency?: string;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Get Third-Party Custody Account Currency Limits (private)
|
|
272
|
+
* Remaining OES custody quota per custodian/currency.
|
|
273
|
+
*/
|
|
274
|
+
export interface GetThirdPartyCustodyQuotaRequestUTA {
|
|
275
|
+
/**
|
|
276
|
+
* If sub-account API key is used, this parameter is ignored; only the
|
|
277
|
+
* custodian bound to the sub-account is returned (per API docs).
|
|
278
|
+
*/
|
|
279
|
+
custodian?: ThirdPartyCustodyCustodianUTA;
|
|
280
|
+
/** If omitted, limits for all currencies under the custodian */
|
|
281
|
+
currency?: string;
|
|
238
282
|
}
|
|
239
283
|
export interface GetPositionsHistoryRequestUTA {
|
|
240
284
|
symbol?: string;
|
|
@@ -243,6 +287,14 @@ export interface GetPositionsHistoryRequestUTA {
|
|
|
243
287
|
lastId?: number;
|
|
244
288
|
pageSize?: number;
|
|
245
289
|
}
|
|
290
|
+
/** Settled funding fee history (private) */
|
|
291
|
+
export interface GetPrivateFundingFeeHistoryRequestUTA {
|
|
292
|
+
symbol?: string;
|
|
293
|
+
startAt?: number;
|
|
294
|
+
endAt?: number;
|
|
295
|
+
lastId?: number;
|
|
296
|
+
pageSize?: number;
|
|
297
|
+
}
|
|
246
298
|
export interface GetAccountPositionTiersRequestUTA {
|
|
247
299
|
symbol: string;
|
|
248
300
|
tradeType?: 'FUTURES' | 'MARGIN';
|
|
@@ -174,6 +174,12 @@ export interface GetCurrentFundingRateResponseUTA {
|
|
|
174
174
|
fundingTime: number;
|
|
175
175
|
fundingRateCap: number;
|
|
176
176
|
fundingRateFloor: number;
|
|
177
|
+
/** Current funding settlement interval (ms); as of 2026.04.19 */
|
|
178
|
+
currentGranularity: number;
|
|
179
|
+
/** New interval after change (ms); as of 2026.04.19 */
|
|
180
|
+
newGranularity: number;
|
|
181
|
+
/** When newGranularity takes effect (ms); as of 2026.04.19 */
|
|
182
|
+
newGranularityStartTime: number;
|
|
177
183
|
}
|
|
178
184
|
export interface FundingRateHistoryItemUTA {
|
|
179
185
|
fundingRate: number;
|
|
@@ -183,6 +189,43 @@ export interface GetHistoryFundingRateResponseUTA {
|
|
|
183
189
|
symbol: string;
|
|
184
190
|
list: FundingRateHistoryItemUTA[];
|
|
185
191
|
}
|
|
192
|
+
export interface ModifyMarginCrossLeverageResponseUTA {
|
|
193
|
+
currency?: string;
|
|
194
|
+
leverage?: string;
|
|
195
|
+
}
|
|
196
|
+
/** One row from Get Leverage (UTA) — margin uses currency, futures uses symbol */
|
|
197
|
+
export interface GetLeverageItemUTA {
|
|
198
|
+
leverage: string;
|
|
199
|
+
marginMode: string;
|
|
200
|
+
currency?: string;
|
|
201
|
+
symbol?: string;
|
|
202
|
+
}
|
|
203
|
+
export interface PrivateFundingFeeHistoryItemUTA {
|
|
204
|
+
symbol: string;
|
|
205
|
+
marginMode: 'CROSS' | 'ISOLATED';
|
|
206
|
+
fundingRate: string;
|
|
207
|
+
markPrice: string;
|
|
208
|
+
size: string;
|
|
209
|
+
positionValue: string;
|
|
210
|
+
fundingFee: string;
|
|
211
|
+
settleCurrency: string;
|
|
212
|
+
settlementTime: number;
|
|
213
|
+
}
|
|
214
|
+
export interface GetPrivateFundingFeeHistoryResponseUTA {
|
|
215
|
+
lastId: number;
|
|
216
|
+
items: PrivateFundingFeeHistoryItemUTA[];
|
|
217
|
+
}
|
|
218
|
+
export interface GetBorrowingRatesAndLimitsResponseUTA {
|
|
219
|
+
currentRateHourly: string;
|
|
220
|
+
currentRateDaily: string;
|
|
221
|
+
borrowLimitTotal: string;
|
|
222
|
+
borrowLimitTotalHold: string;
|
|
223
|
+
borrowLimitHold: string;
|
|
224
|
+
interestFreeBorrowLimit: string;
|
|
225
|
+
}
|
|
226
|
+
export interface BorrowableCurrencyUTA {
|
|
227
|
+
currency: string;
|
|
228
|
+
}
|
|
186
229
|
export interface GetCrossMarginConfigResponseUTA {
|
|
187
230
|
maxLeverage: number;
|
|
188
231
|
alertRiskRatio: string;
|
|
@@ -203,6 +246,8 @@ export interface AccountCurrencyUTA {
|
|
|
203
246
|
available: string;
|
|
204
247
|
balance: string;
|
|
205
248
|
equity: string;
|
|
249
|
+
/** Potential borrow reserved by open orders (UTA; as of 2026.04.19) */
|
|
250
|
+
potentialBorrow?: string;
|
|
206
251
|
liability?: string;
|
|
207
252
|
totalCrossMargin?: string;
|
|
208
253
|
crossPosMargin?: string;
|
|
@@ -321,7 +366,7 @@ export interface DepositAddressUTA {
|
|
|
321
366
|
* Order Response Types
|
|
322
367
|
*/
|
|
323
368
|
export interface PlaceOrderResponseUTA {
|
|
324
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
369
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
325
370
|
orderId: string;
|
|
326
371
|
clientOid: string;
|
|
327
372
|
/** Timestamp when system completes order request in nanoseconds. Classic mode not supported */
|
|
@@ -339,11 +384,11 @@ export interface BatchPlaceOrderItemResponseUTA {
|
|
|
339
384
|
msg?: string;
|
|
340
385
|
}
|
|
341
386
|
export interface BatchPlaceOrderResponseUTA {
|
|
342
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
387
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
343
388
|
items: BatchPlaceOrderItemResponseUTA[];
|
|
344
389
|
}
|
|
345
390
|
export interface OrderDetailsUTA {
|
|
346
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
391
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
347
392
|
orderId: string;
|
|
348
393
|
clientOid: string;
|
|
349
394
|
/**
|
|
@@ -404,12 +449,12 @@ export interface GetOpenOrderListResponseUTA {
|
|
|
404
449
|
pageSize?: number;
|
|
405
450
|
totalNum?: number;
|
|
406
451
|
totalPage?: number;
|
|
407
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
452
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
408
453
|
items: OrderDetailsUTA[];
|
|
409
454
|
}
|
|
410
455
|
export interface GetOrderHistoryResponseUTA {
|
|
411
456
|
lastId: number;
|
|
412
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
457
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
413
458
|
items: OrderDetailsUTA[];
|
|
414
459
|
}
|
|
415
460
|
export interface TradeHistoryItemUTA {
|
|
@@ -435,11 +480,11 @@ export interface TradeHistoryItemUTA {
|
|
|
435
480
|
}
|
|
436
481
|
export interface GetTradeHistoryResponseUTA {
|
|
437
482
|
lastId: number;
|
|
438
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
483
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
439
484
|
items: TradeHistoryItemUTA[];
|
|
440
485
|
}
|
|
441
486
|
export interface CancelOrderResponseUTA {
|
|
442
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
487
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
443
488
|
orderId?: string;
|
|
444
489
|
clientOid?: string;
|
|
445
490
|
/** Timestamp when system completes order cancellation request (nanoseconds). Only for unified accounts */
|
|
@@ -454,7 +499,7 @@ export interface BatchCancelOrderItemResponseUTA {
|
|
|
454
499
|
ts?: number;
|
|
455
500
|
}
|
|
456
501
|
export interface BatchCancelOrdersResponseUTA {
|
|
457
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
502
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
458
503
|
items: BatchCancelOrderItemResponseUTA[];
|
|
459
504
|
}
|
|
460
505
|
/** Batch cancel by symbol - Classic response (orderId list) */
|
|
@@ -499,6 +544,8 @@ export interface PositionUTA {
|
|
|
499
544
|
maintenanceMargin: string;
|
|
500
545
|
/** Timestamp when position was first opened (nanoseconds, standardized as of 2026.01.12) */
|
|
501
546
|
creationTime: number;
|
|
547
|
+
/** Estimated liquidation price (as of 2026.04.09) */
|
|
548
|
+
liquidationPrice: string;
|
|
502
549
|
}
|
|
503
550
|
export interface PositionHistoryItemUTA {
|
|
504
551
|
closeId: string;
|
|
@@ -523,6 +570,19 @@ export interface GetPositionsHistoryResponseUTA {
|
|
|
523
570
|
items: PositionHistoryItemUTA[];
|
|
524
571
|
lastId?: number;
|
|
525
572
|
}
|
|
573
|
+
/** Row from Get Third-Party Custody Currencies */
|
|
574
|
+
export interface ThirdPartyCustodyCurrencyUTA {
|
|
575
|
+
custodian: string;
|
|
576
|
+
currency: string;
|
|
577
|
+
precision: number;
|
|
578
|
+
}
|
|
579
|
+
/** Row from Get Third-Party Custody Account Currency Limits */
|
|
580
|
+
export interface ThirdPartyCustodyQuotaUTA {
|
|
581
|
+
custodian: string;
|
|
582
|
+
currency: string;
|
|
583
|
+
/** Remaining custodial quota (shared across custodian sub-accounts under master) */
|
|
584
|
+
custodyQuota: string;
|
|
585
|
+
}
|
|
526
586
|
export interface PositionTierUTA {
|
|
527
587
|
symbol: string;
|
|
528
588
|
tier: number;
|