kucoin-api 2.5.1 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/BrokerClient.d.ts +23 -2
- package/dist/cjs/BrokerClient.js +23 -0
- package/dist/cjs/BrokerClient.js.map +1 -1
- package/dist/cjs/FuturesClient.d.ts +1 -0
- package/dist/cjs/FuturesClient.js +1 -0
- package/dist/cjs/FuturesClient.js.map +1 -1
- package/dist/cjs/SpotClient.d.ts +1 -0
- package/dist/cjs/SpotClient.js +1 -0
- package/dist/cjs/SpotClient.js.map +1 -1
- package/dist/cjs/UnifiedAPIClient.d.ts +93 -4
- package/dist/cjs/UnifiedAPIClient.js +124 -2
- package/dist/cjs/UnifiedAPIClient.js.map +1 -1
- package/dist/cjs/types/request/broker.types.d.ts +32 -1
- package/dist/cjs/types/request/uta-types.d.ts +103 -8
- package/dist/cjs/types/response/broker.types.d.ts +15 -1
- package/dist/cjs/types/response/futures.types.d.ts +1 -1
- package/dist/cjs/types/response/uta-types.d.ts +150 -10
- package/dist/mjs/BrokerClient.d.ts +23 -2
- package/dist/mjs/BrokerClient.js +23 -0
- package/dist/mjs/BrokerClient.js.map +1 -1
- package/dist/mjs/FuturesClient.d.ts +1 -0
- package/dist/mjs/FuturesClient.js +1 -0
- package/dist/mjs/FuturesClient.js.map +1 -1
- package/dist/mjs/SpotClient.d.ts +1 -0
- package/dist/mjs/SpotClient.js +1 -0
- package/dist/mjs/SpotClient.js.map +1 -1
- package/dist/mjs/UnifiedAPIClient.d.ts +93 -4
- package/dist/mjs/UnifiedAPIClient.js +124 -2
- package/dist/mjs/UnifiedAPIClient.js.map +1 -1
- package/dist/mjs/types/request/broker.types.d.ts +32 -1
- package/dist/mjs/types/request/uta-types.d.ts +103 -8
- package/dist/mjs/types/response/broker.types.d.ts +15 -1
- package/dist/mjs/types/response/futures.types.d.ts +1 -1
- package/dist/mjs/types/response/uta-types.d.ts +150 -10
- package/llms.txt +11030 -10418
- package/package.json +2 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseRestClient } from './lib/BaseRestClient.js';
|
|
2
2
|
import { RestClientType } from './lib/requestUtils.js';
|
|
3
|
-
import { BatchCancelOrdersBySymbolRequestUTA, BatchCancelOrdersRequestUTA, BatchPlaceOrderRequestUTA, CancelOrderRequestUTA, FlexTransferRequestUTA, GetAccountLedgerRequestUTA, GetAccountPositionTiersRequestUTA, GetAnnouncementsRequestUTA, GetClassicAccountRequestUTA, GetCurrencyRequestUTA, GetCurrentFundingRateRequestUTA, GetDCPRequestUTA, GetDepositAddressRequestUTA, GetFeeRateRequestUTA, GetHistoryFundingRateRequestUTA, GetInterestHistoryRequestUTA, GetKlinesRequestUTA, GetOpenOrderListRequestUTA, GetOrderBookRequestUTA, GetOrderDetailsRequestUTA, GetOrderHistoryRequestUTA, GetPositionListRequestUTA, GetPositionsHistoryRequestUTA, GetServiceStatusRequestUTA, GetSubAccountRequestUTA, GetSymbolRequestUTA, GetTickerRequestUTA, GetTradeHistoryRequestUTA, GetTradesRequestUTA, GetTransferQuotasRequestUTA, ModifyLeverageRequestUTA, PlaceOrderRequestUTA, SetAccountModeRequestUTA, SetDCPRequestUTA, SetSubAccountTransferPermissionRequestUTA } from './types/request/uta-types.js';
|
|
3
|
+
import { AddSubAccountApiRequestUTA, AddSubAccountRequestUTA, BatchCancelOrdersBySymbolRequestUTA, BatchCancelOrdersRequestUTA, BatchModifyMarginModeRequestUTA, BatchPlaceOrderRequestUTA, CancelOrderRequestUTA, FlexTransferRequestUTA, GetAccountLedgerRequestUTA, GetAccountPositionTiersRequestUTA, GetAnnouncementsRequestUTA, GetBorrowingRatesAndLimitsRequestUTA, GetClassicAccountRequestUTA, GetCurrencyRequestUTA, GetCurrentFundingRateRequestUTA, GetDCPRequestUTA, GetDepositAddressRequestUTA, GetFeeRateRequestUTA, GetHistoryFundingRateRequestUTA, GetInterestHistoryRequestUTA, GetKlinesRequestUTA, GetLeverageRequestUTA, GetOpenOrderListRequestUTA, GetOrderBookRequestUTA, GetOrderDetailsRequestUTA, GetOrderHistoryRequestUTA, GetPositionListRequestUTA, GetPositionsHistoryRequestUTA, GetPrivateFundingFeeHistoryRequestUTA, GetServiceStatusRequestUTA, GetSubAccountRequestUTA, GetSymbolRequestUTA, GetThirdPartyCustodyCurrenciesRequestUTA, GetThirdPartyCustodyQuotaRequestUTA, GetTickerRequestUTA, GetTradeHistoryRequestUTA, GetTradesRequestUTA, GetTransferQuotasRequestUTA, GetWithdrawalQuotasRequestUTA, ModifyIsolatedFuturesMarginRequestUTA, ModifyLeverageRequestUTA, ModifyMarginCrossLeverageRequestUTA, PlaceOrderRequestUTA, SetAccountModeRequestUTA, SetDCPRequestUTA, SetSubAccountTransferPermissionRequestUTA, SubmitWithdrawRequestUTA } from './types/request/uta-types.js';
|
|
4
4
|
import { APISuccessResponse } from './types/response/shared.types.js';
|
|
5
|
-
import { BatchCancelOrdersBySymbolResponseUTA, BatchCancelOrdersResponseUTA, BatchPlaceOrderResponseUTA, CancelOrderResponseUTA, DCPResponseUTA, DepositAddressUTA, FlexTransferResponseUTA, GetAccountLedgerResponseClassicUTA, GetAccountLedgerResponseUTA, GetAccountModeResponseUTA, GetAccountOverviewResponseUTA, GetAnnouncementsResponseUTA, GetClassicAccountResponseUTA, GetCrossMarginConfigResponseUTA, GetCurrencyResponseUTA, GetCurrentFundingRateResponseUTA, GetFeeRateResponseUTA, GetHistoryFundingRateResponseUTA, GetInterestHistoryResponseUTA, GetKlinesResponseUTA, GetOpenOrderListResponseUTA, GetOrderBookResponseUTA, GetOrderHistoryResponseUTA, GetPositionsHistoryResponseUTA, GetServiceStatusResponseUTA, GetSubAccountResponseUTA, GetSymbolResponseUTA, GetTickerResponseUTA, GetTradeHistoryResponseUTA, GetTradesResponseUTA, GetTransferQuotasResponseUTA, OrderDetailsUTA, PlaceOrderResponseUTA, PositionTierUTA, PositionUTA, SubAccountTransferPermissionUTA } from './types/response/uta-types.js';
|
|
5
|
+
import { AddSubAccountApiResponseUTA, AddSubAccountResponseUTA, ApiKeyInfoUTA, BatchCancelOrdersBySymbolResponseUTA, BatchCancelOrdersResponseUTA, BatchModifyMarginModeResponseUTA, BatchPlaceOrderResponseUTA, BorrowableCurrencyUTA, CancelOrderResponseUTA, DCPResponseUTA, DepositAddressUTA, FlexTransferResponseUTA, GetAccountLedgerResponseClassicUTA, GetAccountLedgerResponseUTA, GetAccountModeResponseUTA, GetAccountOverviewResponseUTA, GetAnnouncementsResponseUTA, GetBorrowingRatesAndLimitsResponseUTA, GetClassicAccountResponseUTA, GetCrossMarginConfigResponseUTA, GetCurrencyResponseUTA, GetCurrentFundingRateResponseUTA, GetFeeRateResponseUTA, GetHistoryFundingRateResponseUTA, GetInterestHistoryResponseUTA, GetKlinesResponseUTA, GetLeverageItemUTA, GetOpenOrderListResponseUTA, GetOrderBookResponseUTA, GetOrderHistoryResponseUTA, GetPositionsHistoryResponseUTA, GetPrivateFundingFeeHistoryResponseUTA, GetServiceStatusResponseUTA, GetSubAccountResponseUTA, GetSymbolResponseUTA, GetTickerResponseUTA, GetTradeHistoryResponseUTA, GetTradesResponseUTA, GetTransferQuotasResponseUTA, KYCRegionUTA, ModifyIsolatedFuturesMarginResponseUTA, ModifyMarginCrossLeverageResponseUTA, OrderDetailsUTA, PlaceOrderResponseUTA, PositionTierUTA, PositionUTA, SubAccountTransferPermissionUTA, SubmitWithdrawResponseUTA, ThirdPartyCustodyCurrencyUTA, ThirdPartyCustodyQuotaUTA, WithdrawalQuotasUTA } from './types/response/uta-types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Unified Trading Account Client
|
|
8
8
|
*
|
|
@@ -27,6 +27,11 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
27
27
|
* Request the currency details of a specified currency via this endpoint.
|
|
28
28
|
*/
|
|
29
29
|
getCurrency(params?: GetCurrencyRequestUTA): Promise<APISuccessResponse<GetCurrencyResponseUTA>>;
|
|
30
|
+
/**
|
|
31
|
+
* Get Third-Party Custody Currencies
|
|
32
|
+
* Query settlement currencies supported by third-party (OES) custodian institutions.
|
|
33
|
+
*/
|
|
34
|
+
getThirdPartyCustodyCurrencies(params?: GetThirdPartyCustodyCurrenciesRequestUTA): Promise<APISuccessResponse<ThirdPartyCustodyCurrencyUTA[]>>;
|
|
30
35
|
/**
|
|
31
36
|
* Get Symbol
|
|
32
37
|
* Request a list of available currency pairs for trading via this endpoint.
|
|
@@ -67,6 +72,11 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
67
72
|
* Request the configure info of the 'spot cross margin' via this endpoint.
|
|
68
73
|
*/
|
|
69
74
|
getCrossMarginConfig(): Promise<APISuccessResponse<GetCrossMarginConfigResponseUTA>>;
|
|
75
|
+
/**
|
|
76
|
+
* Get Borrowable Currencies
|
|
77
|
+
* List of borrowable currencies (UTA / public).
|
|
78
|
+
*/
|
|
79
|
+
getBorrowableCurrencies(): Promise<APISuccessResponse<BorrowableCurrencyUTA[]>>;
|
|
70
80
|
/**
|
|
71
81
|
* Get Service Status
|
|
72
82
|
* Get the service status.
|
|
@@ -102,6 +112,7 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
102
112
|
* Get Transfer Quotas
|
|
103
113
|
* This endpoint returns the transferable balance of a specified account.
|
|
104
114
|
* Note: AccountType enum value changed from TRADING to SPOT as of 2026.01.17.
|
|
115
|
+
* Note: UNIFIED accountType supported as of latest UTA update.
|
|
105
116
|
*/
|
|
106
117
|
getTransferQuotas(params: GetTransferQuotasRequestUTA): Promise<APISuccessResponse<GetTransferQuotasResponseUTA>>;
|
|
107
118
|
/**
|
|
@@ -140,6 +151,7 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
140
151
|
* Note: direction values unified to uppercase IN/OUT as of 2026.01.17.
|
|
141
152
|
* Note: For Futures - id changed from Number to String, balance/amount changed from Number to String as of 2026.01.17.
|
|
142
153
|
* Note: ts standardized to nanoseconds as of 2026.01.12.
|
|
154
|
+
* Note: amount is always returned as a positive number as of 2026.04.28; use direction (IN/OUT) to determine flow.
|
|
143
155
|
*/
|
|
144
156
|
getAccountLedger(params: GetAccountLedgerRequestUTA): Promise<APISuccessResponse<GetAccountLedgerResponseUTA | GetAccountLedgerResponseClassicUTA>>;
|
|
145
157
|
/**
|
|
@@ -147,11 +159,26 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
147
159
|
* Request the interest records via this endpoint.
|
|
148
160
|
*/
|
|
149
161
|
getInterestHistory(params: GetInterestHistoryRequestUTA): Promise<APISuccessResponse<GetInterestHistoryResponseUTA>>;
|
|
162
|
+
/**
|
|
163
|
+
* Get Borrowing Rates and Limits
|
|
164
|
+
* Hourly/daily rates and borrow limits (UTA).
|
|
165
|
+
*/
|
|
166
|
+
getBorrowingRatesAndLimits(params: GetBorrowingRatesAndLimitsRequestUTA): Promise<APISuccessResponse<GetBorrowingRatesAndLimitsResponseUTA>>;
|
|
150
167
|
/**
|
|
151
168
|
* Modify Leverage (UTA)
|
|
152
169
|
* This interface supports modify leverage of the specified symbol.
|
|
153
170
|
*/
|
|
154
171
|
modifyLeverage(params: ModifyLeverageRequestUTA): Promise<APISuccessResponse<null>>;
|
|
172
|
+
/**
|
|
173
|
+
* Modify Leverage Margin Cross (UTA)
|
|
174
|
+
* Update leverage for a currency in UTA cross margin.
|
|
175
|
+
*/
|
|
176
|
+
modifyMarginCrossLeverage(params: ModifyMarginCrossLeverageRequestUTA, accountMode?: 'unified'): Promise<APISuccessResponse<ModifyMarginCrossLeverageResponseUTA>>;
|
|
177
|
+
/**
|
|
178
|
+
* Get Leverage (UTA)
|
|
179
|
+
* Query leverage for MARGIN (currency) or FUTURES (symbol).
|
|
180
|
+
*/
|
|
181
|
+
getLeverage(params: GetLeverageRequestUTA): Promise<APISuccessResponse<GetLeverageItemUTA[]>>;
|
|
155
182
|
/**
|
|
156
183
|
* Get Deposit Address
|
|
157
184
|
* Return a deposit address; when both currency and chain are provided,
|
|
@@ -159,6 +186,49 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
159
186
|
* URL unified to GET /api/ua/v1/asset/deposit/address as of 2026.01.17.
|
|
160
187
|
*/
|
|
161
188
|
getDepositAddress(params: GetDepositAddressRequestUTA): Promise<APISuccessResponse<DepositAddressUTA[]>>;
|
|
189
|
+
/**
|
|
190
|
+
* Get API Key Info (UTA)
|
|
191
|
+
* Get the API key information for the key used to call this endpoint.
|
|
192
|
+
* Works for both master and sub user API keys. Added 2026.05.15.
|
|
193
|
+
*/
|
|
194
|
+
getApiKeyInfo(): Promise<APISuccessResponse<ApiKeyInfoUTA>>;
|
|
195
|
+
/**
|
|
196
|
+
* Get KYC Regions (UTA)
|
|
197
|
+
* Obtain the list of KYC regions. Added 2026.05.15.
|
|
198
|
+
*/
|
|
199
|
+
getKYCRegions(): Promise<APISuccessResponse<KYCRegionUTA[]>>;
|
|
200
|
+
/**
|
|
201
|
+
* Add Sub-Account (UTA)
|
|
202
|
+
* Create a sub-account. Added 2026.05.15.
|
|
203
|
+
*/
|
|
204
|
+
addSubAccount(params: AddSubAccountRequestUTA): Promise<APISuccessResponse<AddSubAccountResponseUTA>>;
|
|
205
|
+
/**
|
|
206
|
+
* Add Sub-Account API (UTA)
|
|
207
|
+
* Create an API key for a sub-account. Added 2026.05.15.
|
|
208
|
+
*/
|
|
209
|
+
addSubAccountApi(params: AddSubAccountApiRequestUTA): Promise<APISuccessResponse<AddSubAccountApiResponseUTA>>;
|
|
210
|
+
/**
|
|
211
|
+
* Get Withdrawal Quotas (UTA)
|
|
212
|
+
* Obtain withdrawal quota information for a currency. Added 2026.05.15.
|
|
213
|
+
*/
|
|
214
|
+
getWithdrawalQuotas(params: GetWithdrawalQuotasRequestUTA): Promise<APISuccessResponse<WithdrawalQuotasUTA>>;
|
|
215
|
+
/**
|
|
216
|
+
* Withdraw (UTA)
|
|
217
|
+
* Withdraw the specified currency. Added 2026.05.15.
|
|
218
|
+
*/
|
|
219
|
+
submitWithdraw(params: SubmitWithdrawRequestUTA): Promise<APISuccessResponse<SubmitWithdrawResponseUTA>>;
|
|
220
|
+
/**
|
|
221
|
+
* Cancel Withdrawal (UTA)
|
|
222
|
+
* Cancel a withdrawal request in PROCESSING status. Added 2026.05.15.
|
|
223
|
+
*/
|
|
224
|
+
cancelWithdrawal(params?: {
|
|
225
|
+
withdrawalId?: string;
|
|
226
|
+
}): Promise<APISuccessResponse<string | null>>;
|
|
227
|
+
/**
|
|
228
|
+
* Get Third-Party Custody Account Currency Limits
|
|
229
|
+
* OES remaining custody quota per custodian and settlement currency.
|
|
230
|
+
*/
|
|
231
|
+
getThirdPartyCustodyQuota(params?: GetThirdPartyCustodyQuotaRequestUTA): Promise<APISuccessResponse<ThirdPartyCustodyQuotaUTA[]>>;
|
|
162
232
|
/**
|
|
163
233
|
*
|
|
164
234
|
* REST - Unified Trading Account - Orders
|
|
@@ -170,7 +240,8 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
170
240
|
* Supports RPI (Retail Price Improvement) orders for Futures as of 2025.01.02.
|
|
171
241
|
* Note: timeInForce supports 'RPI' value for Futures only (Phase 1).
|
|
172
242
|
* Note: For Classic mode, tradeType is required in query param.
|
|
173
|
-
* Note: For Unified mode, tradeType
|
|
243
|
+
* Note: For Unified mode, tradeType is sent in the request body (incl. MARGIN as of 2026.04.19).
|
|
244
|
+
* Note: closeOrder supported for closing futures position by symbol.
|
|
174
245
|
*/
|
|
175
246
|
placeOrder(params: PlaceOrderRequestUTA, accountMode?: 'classic' | 'unified'): Promise<APISuccessResponse<PlaceOrderResponseUTA>>;
|
|
176
247
|
/**
|
|
@@ -226,7 +297,7 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
226
297
|
batchCancelOrders(params: BatchCancelOrdersRequestUTA, accountMode?: 'classic' | 'unified'): Promise<APISuccessResponse<BatchCancelOrdersResponseUTA>>;
|
|
227
298
|
/**
|
|
228
299
|
* Batch Cancel Orders By Symbol
|
|
229
|
-
* Cancels orders in batch by symbol. UTA only. Supports SPOT (non-margin) and
|
|
300
|
+
* Cancels orders in batch by symbol. UTA only. Supports SPOT (non-margin), FUTURES, and MARGIN (Spot-Margin as of 2026.05.15).
|
|
230
301
|
*/
|
|
231
302
|
batchCancelOrdersBySymbol(params: BatchCancelOrdersBySymbolRequestUTA): Promise<APISuccessResponse<BatchCancelOrdersBySymbolResponseUTA>>;
|
|
232
303
|
/**
|
|
@@ -252,8 +323,21 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
252
323
|
* Get Position List (UTA)
|
|
253
324
|
* Get the position details of all open positions.
|
|
254
325
|
* Note: creationTime standardized to nanoseconds as of 2026.01.12.
|
|
326
|
+
* Note: pageNumber, pageSize query params and liquidationPrice in each position (as of 2026.04.09).
|
|
327
|
+
* Note: adlPercentage added 2026.05.15.
|
|
328
|
+
* Note: positionMargin and riskRatio added in latest UTA update.
|
|
255
329
|
*/
|
|
256
330
|
getPositionList(params?: GetPositionListRequestUTA): Promise<APISuccessResponse<PositionUTA[]>>;
|
|
331
|
+
/**
|
|
332
|
+
* Batch Modify Margin Mode (UTA)
|
|
333
|
+
* Batch modify the margin mode for futures positions.
|
|
334
|
+
*/
|
|
335
|
+
batchModifyMarginMode(params: BatchModifyMarginModeRequestUTA): Promise<APISuccessResponse<BatchModifyMarginModeResponseUTA>>;
|
|
336
|
+
/**
|
|
337
|
+
* Modify Isolated Futures Margin (UTA)
|
|
338
|
+
* Extract or add margin for an isolated futures position.
|
|
339
|
+
*/
|
|
340
|
+
modifyIsolatedFuturesMargin(params: ModifyIsolatedFuturesMarginRequestUTA): Promise<APISuccessResponse<ModifyIsolatedFuturesMarginResponseUTA>>;
|
|
257
341
|
/**
|
|
258
342
|
* Get Positions History (UTA)
|
|
259
343
|
* Query position history information records.
|
|
@@ -262,6 +346,11 @@ export declare class UnifiedAPIClient extends BaseRestClient {
|
|
|
262
346
|
* Note: creationTime and closingTime standardized to nanoseconds as of 2026.01.12.
|
|
263
347
|
*/
|
|
264
348
|
getPositionsHistory(params?: GetPositionsHistoryRequestUTA): Promise<APISuccessResponse<GetPositionsHistoryResponseUTA>>;
|
|
349
|
+
/**
|
|
350
|
+
* Get Private Funding Fee History
|
|
351
|
+
* Settled funding fee records for the current account.
|
|
352
|
+
*/
|
|
353
|
+
getPrivateFundingFeeHistory(params?: GetPrivateFundingFeeHistoryRequestUTA): Promise<APISuccessResponse<GetPrivateFundingFeeHistoryResponseUTA>>;
|
|
265
354
|
/**
|
|
266
355
|
* Get Account Position Tiers
|
|
267
356
|
* Request account position tiers (risk limit) info.
|
|
@@ -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.
|
|
@@ -131,6 +145,7 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
131
145
|
* Get Transfer Quotas
|
|
132
146
|
* This endpoint returns the transferable balance of a specified account.
|
|
133
147
|
* Note: AccountType enum value changed from TRADING to SPOT as of 2026.01.17.
|
|
148
|
+
* Note: UNIFIED accountType supported as of latest UTA update.
|
|
134
149
|
*/
|
|
135
150
|
getTransferQuotas(params) {
|
|
136
151
|
return this.getPrivate('api/ua/v1/account/transfer-quota', params);
|
|
@@ -181,6 +196,7 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
181
196
|
* Note: direction values unified to uppercase IN/OUT as of 2026.01.17.
|
|
182
197
|
* Note: For Futures - id changed from Number to String, balance/amount changed from Number to String as of 2026.01.17.
|
|
183
198
|
* Note: ts standardized to nanoseconds as of 2026.01.12.
|
|
199
|
+
* Note: amount is always returned as a positive number as of 2026.04.28; use direction (IN/OUT) to determine flow.
|
|
184
200
|
*/
|
|
185
201
|
getAccountLedger(params) {
|
|
186
202
|
return this.getPrivate('api/ua/v1/account/ledger', params);
|
|
@@ -192,6 +208,13 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
192
208
|
getInterestHistory(params) {
|
|
193
209
|
return this.getPrivate('api/ua/v1/account/interest-history', params);
|
|
194
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Get Borrowing Rates and Limits
|
|
213
|
+
* Hourly/daily rates and borrow limits (UTA).
|
|
214
|
+
*/
|
|
215
|
+
getBorrowingRatesAndLimits(params) {
|
|
216
|
+
return this.getPrivate('api/ua/v1/account/interest-limits', params);
|
|
217
|
+
}
|
|
195
218
|
/**
|
|
196
219
|
* Modify Leverage (UTA)
|
|
197
220
|
* This interface supports modify leverage of the specified symbol.
|
|
@@ -199,6 +222,20 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
199
222
|
modifyLeverage(params) {
|
|
200
223
|
return this.postPrivate('api/ua/v1/unified/account/modify-leverage', params);
|
|
201
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Modify Leverage Margin Cross (UTA)
|
|
227
|
+
* Update leverage for a currency in UTA cross margin.
|
|
228
|
+
*/
|
|
229
|
+
modifyMarginCrossLeverage(params, accountMode = 'unified') {
|
|
230
|
+
return this.postPrivate(`api/ua/v1/${accountMode}/account/modify-leverage-margin-cross`, params);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Get Leverage (UTA)
|
|
234
|
+
* Query leverage for MARGIN (currency) or FUTURES (symbol).
|
|
235
|
+
*/
|
|
236
|
+
getLeverage(params) {
|
|
237
|
+
return this.getPrivate('api/ua/v1/unified/account/leverage', params);
|
|
238
|
+
}
|
|
202
239
|
/**
|
|
203
240
|
* Get Deposit Address
|
|
204
241
|
* Return a deposit address; when both currency and chain are provided,
|
|
@@ -208,6 +245,63 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
208
245
|
getDepositAddress(params) {
|
|
209
246
|
return this.getPrivate('api/ua/v1/asset/deposit/address', params);
|
|
210
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Get API Key Info (UTA)
|
|
250
|
+
* Get the API key information for the key used to call this endpoint.
|
|
251
|
+
* Works for both master and sub user API keys. Added 2026.05.15.
|
|
252
|
+
*/
|
|
253
|
+
getApiKeyInfo() {
|
|
254
|
+
return this.getPrivate('api/ua/v1/user/api-key');
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Get KYC Regions (UTA)
|
|
258
|
+
* Obtain the list of KYC regions. Added 2026.05.15.
|
|
259
|
+
*/
|
|
260
|
+
getKYCRegions() {
|
|
261
|
+
return this.get('api/ua/v1/user/kyc-region');
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Add Sub-Account (UTA)
|
|
265
|
+
* Create a sub-account. Added 2026.05.15.
|
|
266
|
+
*/
|
|
267
|
+
addSubAccount(params) {
|
|
268
|
+
return this.postPrivate('api/ua/v1/user/sub/create-sub-account', params);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Add Sub-Account API (UTA)
|
|
272
|
+
* Create an API key for a sub-account. Added 2026.05.15.
|
|
273
|
+
*/
|
|
274
|
+
addSubAccountApi(params) {
|
|
275
|
+
return this.postPrivate('api/ua/v1/user/create-sub-api-key', params);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Get Withdrawal Quotas (UTA)
|
|
279
|
+
* Obtain withdrawal quota information for a currency. Added 2026.05.15.
|
|
280
|
+
*/
|
|
281
|
+
getWithdrawalQuotas(params) {
|
|
282
|
+
return this.getPrivate('api/ua/v1/withdrawals/quotas', params);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Withdraw (UTA)
|
|
286
|
+
* Withdraw the specified currency. Added 2026.05.15.
|
|
287
|
+
*/
|
|
288
|
+
submitWithdraw(params) {
|
|
289
|
+
return this.postPrivate('api/ua/v1/withdrawal', params);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Cancel Withdrawal (UTA)
|
|
293
|
+
* Cancel a withdrawal request in PROCESSING status. Added 2026.05.15.
|
|
294
|
+
*/
|
|
295
|
+
cancelWithdrawal(params) {
|
|
296
|
+
return this.deletePrivate('api/ua/v1/withdrawal', params);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Get Third-Party Custody Account Currency Limits
|
|
300
|
+
* OES remaining custody quota per custodian and settlement currency.
|
|
301
|
+
*/
|
|
302
|
+
getThirdPartyCustodyQuota(params) {
|
|
303
|
+
return this.getPrivate('api/ua/v1/oes/custody-quota', params);
|
|
304
|
+
}
|
|
211
305
|
/**
|
|
212
306
|
*
|
|
213
307
|
* REST - Unified Trading Account - Orders
|
|
@@ -219,13 +313,17 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
219
313
|
* Supports RPI (Retail Price Improvement) orders for Futures as of 2025.01.02.
|
|
220
314
|
* Note: timeInForce supports 'RPI' value for Futures only (Phase 1).
|
|
221
315
|
* Note: For Classic mode, tradeType is required in query param.
|
|
222
|
-
* Note: For Unified mode, tradeType
|
|
316
|
+
* Note: For Unified mode, tradeType is sent in the request body (incl. MARGIN as of 2026.04.19).
|
|
317
|
+
* Note: closeOrder supported for closing futures position by symbol.
|
|
223
318
|
*/
|
|
224
319
|
placeOrder(params, accountMode = 'unified') {
|
|
225
320
|
const { tradeType, ...bodyParams } = params;
|
|
226
321
|
const url = accountMode === 'classic'
|
|
227
322
|
? `api/ua/v1/${accountMode}/order/place?tradeType=${tradeType}`
|
|
228
323
|
: `api/ua/v1/${accountMode}/order/place`;
|
|
324
|
+
if (accountMode === 'unified') {
|
|
325
|
+
return this.postPrivate(url, { ...bodyParams, tradeType });
|
|
326
|
+
}
|
|
229
327
|
return this.postPrivate(url, bodyParams);
|
|
230
328
|
}
|
|
231
329
|
/**
|
|
@@ -304,7 +402,7 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
304
402
|
}
|
|
305
403
|
/**
|
|
306
404
|
* Batch Cancel Orders By Symbol
|
|
307
|
-
* Cancels orders in batch by symbol. UTA only. Supports SPOT (non-margin) and
|
|
405
|
+
* Cancels orders in batch by symbol. UTA only. Supports SPOT (non-margin), FUTURES, and MARGIN (Spot-Margin as of 2026.05.15).
|
|
308
406
|
*/
|
|
309
407
|
batchCancelOrdersBySymbol(params) {
|
|
310
408
|
return this.postPrivate('api/ua/v1/unified/order/cancel-all', params);
|
|
@@ -336,10 +434,27 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
336
434
|
* Get Position List (UTA)
|
|
337
435
|
* Get the position details of all open positions.
|
|
338
436
|
* Note: creationTime standardized to nanoseconds as of 2026.01.12.
|
|
437
|
+
* Note: pageNumber, pageSize query params and liquidationPrice in each position (as of 2026.04.09).
|
|
438
|
+
* Note: adlPercentage added 2026.05.15.
|
|
439
|
+
* Note: positionMargin and riskRatio added in latest UTA update.
|
|
339
440
|
*/
|
|
340
441
|
getPositionList(params) {
|
|
341
442
|
return this.getPrivate('api/ua/v1/unified/position/open-list', params);
|
|
342
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Batch Modify Margin Mode (UTA)
|
|
446
|
+
* Batch modify the margin mode for futures positions.
|
|
447
|
+
*/
|
|
448
|
+
batchModifyMarginMode(params) {
|
|
449
|
+
return this.postPrivate('api/ua/v1/unified/position/margin-mode', params);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Modify Isolated Futures Margin (UTA)
|
|
453
|
+
* Extract or add margin for an isolated futures position.
|
|
454
|
+
*/
|
|
455
|
+
modifyIsolatedFuturesMargin(params) {
|
|
456
|
+
return this.postPrivate('api/ua/v1/unified/position/modify-margin', params);
|
|
457
|
+
}
|
|
343
458
|
/**
|
|
344
459
|
* Get Positions History (UTA)
|
|
345
460
|
* Query position history information records.
|
|
@@ -350,6 +465,13 @@ export class UnifiedAPIClient extends BaseRestClient {
|
|
|
350
465
|
getPositionsHistory(params) {
|
|
351
466
|
return this.getPrivate('api/ua/v1/position/history', params);
|
|
352
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Get Private Funding Fee History
|
|
470
|
+
* Settled funding fee records for the current account.
|
|
471
|
+
*/
|
|
472
|
+
getPrivateFundingFeeHistory(params) {
|
|
473
|
+
return this.getPrivate('api/ua/v1/position/funding-history', params);
|
|
474
|
+
}
|
|
353
475
|
/**
|
|
354
476
|
* Get Account Position Tiers
|
|
355
477
|
* 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;AAyG9E;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,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AAC;IAED;;;OAGG;IACH,2BAA2B,CACzB,MAA8C;QAE9C,OAAO,IAAI,CAAC,UAAU,CAAC,oCAAoC,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CACrB,MAAyC,EACzC,cAAqC,SAAS;QAE9C,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,WAAW,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC5E,CAAC;CACF"}
|
|
@@ -44,9 +44,40 @@ export interface BrokerTransferRequest {
|
|
|
44
44
|
}
|
|
45
45
|
export interface GetBrokerDepositListRequest {
|
|
46
46
|
currency?: string;
|
|
47
|
-
status?: 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
47
|
+
status?: 'PROCESSING' | 'SUCCESS' | 'FAILURE' | 'PRE_SUCCESS' | 'WAIT_TRM_MGT' | 'TRM_MGT_REJECTED' | 'ROLLBACKING' | 'ROLLBACK' | 'WAIT_RISK_MGT' | 'RISK_MGT_REJECTED';
|
|
48
48
|
hash?: string;
|
|
49
49
|
startTimestamp?: number;
|
|
50
50
|
endTimestamp?: number;
|
|
51
51
|
limit?: number;
|
|
52
52
|
}
|
|
53
|
+
export interface FastApiWithdrawValidationFactor {
|
|
54
|
+
factorType: string;
|
|
55
|
+
factorValue: string;
|
|
56
|
+
}
|
|
57
|
+
export interface FastApiWithdrawValidation {
|
|
58
|
+
factors: FastApiWithdrawValidationFactor[];
|
|
59
|
+
transactionId: string;
|
|
60
|
+
}
|
|
61
|
+
export interface FastApiWithdrawApplyRequest {
|
|
62
|
+
address: string;
|
|
63
|
+
amount: number;
|
|
64
|
+
currency: string;
|
|
65
|
+
memo: string;
|
|
66
|
+
remark: string;
|
|
67
|
+
chain?: string;
|
|
68
|
+
feeDeductType?: 'EXTERNAL' | 'INTERNAL';
|
|
69
|
+
isInner?: boolean;
|
|
70
|
+
wallet?: string;
|
|
71
|
+
withdrawType?: 'ADDRESS' | 'MAIL' | 'PHONE' | 'UID';
|
|
72
|
+
validation?: FastApiWithdrawValidation;
|
|
73
|
+
tin?: string;
|
|
74
|
+
country?: string;
|
|
75
|
+
lastName?: string;
|
|
76
|
+
firstName?: string;
|
|
77
|
+
identityNo?: string;
|
|
78
|
+
companyName?: string;
|
|
79
|
+
identityType?: string;
|
|
80
|
+
receiverType?: 'COMPANY' | 'INDIVIDUAL';
|
|
81
|
+
questionnaire?: string;
|
|
82
|
+
reasonOfTransfer?: string;
|
|
83
|
+
}
|
|
@@ -113,19 +113,65 @@ 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;
|
|
123
140
|
}
|
|
141
|
+
export interface GetWithdrawalQuotasRequestUTA {
|
|
142
|
+
currency: string;
|
|
143
|
+
chainId?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface SubmitWithdrawRequestUTA {
|
|
146
|
+
currency: string;
|
|
147
|
+
toAddress: string;
|
|
148
|
+
amount: string;
|
|
149
|
+
withdrawType: 'ADDRESS' | 'UID' | 'MAIL' | 'PHONE';
|
|
150
|
+
chainId?: string;
|
|
151
|
+
memo?: string;
|
|
152
|
+
isInner?: boolean;
|
|
153
|
+
remark?: string;
|
|
154
|
+
feeDeductType?: 'INTERNAL' | 'EXTERNAL';
|
|
155
|
+
}
|
|
156
|
+
export interface AddSubAccountRequestUTA {
|
|
157
|
+
password: string;
|
|
158
|
+
subName: string;
|
|
159
|
+
access: 'Spot' | 'Futures' | 'Margin' | string;
|
|
160
|
+
remarks?: string;
|
|
161
|
+
}
|
|
162
|
+
export interface AddSubAccountApiRequestUTA {
|
|
163
|
+
subName: string;
|
|
164
|
+
passphrase: string;
|
|
165
|
+
remark: string;
|
|
166
|
+
permission?: string;
|
|
167
|
+
ipWhitelist?: string;
|
|
168
|
+
expire?: '-1' | '30' | '90' | '180' | '360';
|
|
169
|
+
}
|
|
124
170
|
/**
|
|
125
171
|
* Order Endpoints
|
|
126
172
|
*/
|
|
127
173
|
export interface PlaceOrderRequestUTA {
|
|
128
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
174
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
129
175
|
clientOid?: string;
|
|
130
176
|
symbol: string;
|
|
131
177
|
side: 'BUY' | 'SELL';
|
|
@@ -159,19 +205,21 @@ export interface PlaceOrderRequestUTA {
|
|
|
159
205
|
tpTriggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
160
206
|
slTriggerPrice?: string;
|
|
161
207
|
slTriggerPriceType?: 'TP' | 'IP' | 'MP';
|
|
208
|
+
/** Close position for symbol; ignores side/size and cancels pending close orders. Default false */
|
|
209
|
+
closeOrder?: boolean;
|
|
162
210
|
}
|
|
163
211
|
export interface BatchPlaceOrderRequestUTA {
|
|
164
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
212
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
165
213
|
orderList: Omit<PlaceOrderRequestUTA, 'tradeType'>[];
|
|
166
214
|
}
|
|
167
215
|
export interface GetOrderDetailsRequestUTA {
|
|
168
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
216
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
169
217
|
symbol: string;
|
|
170
218
|
orderId?: string;
|
|
171
219
|
clientOid?: string;
|
|
172
220
|
}
|
|
173
221
|
export interface GetOpenOrderListRequestUTA {
|
|
174
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
222
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
175
223
|
symbol?: string;
|
|
176
224
|
orderFilter?: 'NORMAL' | 'CONDITION';
|
|
177
225
|
startAt?: number;
|
|
@@ -180,7 +228,7 @@ export interface GetOpenOrderListRequestUTA {
|
|
|
180
228
|
pageSize?: number;
|
|
181
229
|
}
|
|
182
230
|
export interface GetOrderHistoryRequestUTA {
|
|
183
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
231
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
184
232
|
symbol?: string;
|
|
185
233
|
side?: 'BUY' | 'SELL';
|
|
186
234
|
orderFilter?: 'NORMAL' | 'CONDITION';
|
|
@@ -190,7 +238,7 @@ export interface GetOrderHistoryRequestUTA {
|
|
|
190
238
|
pageSize?: number;
|
|
191
239
|
}
|
|
192
240
|
export interface GetTradeHistoryRequestUTA {
|
|
193
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
241
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
194
242
|
symbol?: string;
|
|
195
243
|
orderId?: string;
|
|
196
244
|
side?: 'BUY' | 'SELL';
|
|
@@ -201,7 +249,7 @@ export interface GetTradeHistoryRequestUTA {
|
|
|
201
249
|
pageSize?: number;
|
|
202
250
|
}
|
|
203
251
|
export interface CancelOrderRequestUTA {
|
|
204
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
252
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
205
253
|
symbol: string;
|
|
206
254
|
orderId?: string;
|
|
207
255
|
clientOid?: string;
|
|
@@ -212,7 +260,7 @@ export interface CancelOrderItemRequestUTA {
|
|
|
212
260
|
clientOid?: string;
|
|
213
261
|
}
|
|
214
262
|
export interface BatchCancelOrdersRequestUTA {
|
|
215
|
-
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS';
|
|
263
|
+
tradeType: 'SPOT' | 'FUTURES' | 'ISOLATED' | 'CROSS' | 'MARGIN';
|
|
216
264
|
cancelOrderList: CancelOrderItemRequestUTA[];
|
|
217
265
|
}
|
|
218
266
|
/** Batch cancel orders by symbol (POST /order/cancel-all) */
|
|
@@ -235,6 +283,45 @@ export interface GetDCPRequestUTA {
|
|
|
235
283
|
*/
|
|
236
284
|
export interface GetPositionListRequestUTA {
|
|
237
285
|
symbol?: string;
|
|
286
|
+
pageNumber?: number;
|
|
287
|
+
pageSize?: number;
|
|
288
|
+
}
|
|
289
|
+
export interface BatchModifyMarginModeRequestUTA {
|
|
290
|
+
/** Trading pair symbol(s), comma-separated for batch */
|
|
291
|
+
symbol: string;
|
|
292
|
+
marginMode: 'CROSS' | 'ISOLATED';
|
|
293
|
+
}
|
|
294
|
+
export interface ModifyIsolatedFuturesMarginRequestUTA {
|
|
295
|
+
type: 'DEPOSIT' | 'WITHDRAW';
|
|
296
|
+
amount: string;
|
|
297
|
+
symbol: string;
|
|
298
|
+
tradeType: 'FUTURES' | 'MARGIN';
|
|
299
|
+
positionSide?: 'LONG' | 'SHORT' | 'BOTH';
|
|
300
|
+
}
|
|
301
|
+
/** Third-party custody (OES) custodian codes */
|
|
302
|
+
export type ThirdPartyCustodyCustodianUTA = 'BITGO_SG' | 'BITGO_SD' | 'CACTUS' | 'CEFFU';
|
|
303
|
+
/**
|
|
304
|
+
* Get Third-Party Custody Currencies (public)
|
|
305
|
+
* Settlement currencies supported per custodian.
|
|
306
|
+
*/
|
|
307
|
+
export interface GetThirdPartyCustodyCurrenciesRequestUTA {
|
|
308
|
+
/** If omitted, returns all custodian rows */
|
|
309
|
+
custodian?: ThirdPartyCustodyCustodianUTA;
|
|
310
|
+
/** If omitted, all currencies for the selected custodian(s) */
|
|
311
|
+
currency?: string;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Get Third-Party Custody Account Currency Limits (private)
|
|
315
|
+
* Remaining OES custody quota per custodian/currency.
|
|
316
|
+
*/
|
|
317
|
+
export interface GetThirdPartyCustodyQuotaRequestUTA {
|
|
318
|
+
/**
|
|
319
|
+
* If sub-account API key is used, this parameter is ignored; only the
|
|
320
|
+
* custodian bound to the sub-account is returned (per API docs).
|
|
321
|
+
*/
|
|
322
|
+
custodian?: ThirdPartyCustodyCustodianUTA;
|
|
323
|
+
/** If omitted, limits for all currencies under the custodian */
|
|
324
|
+
currency?: string;
|
|
238
325
|
}
|
|
239
326
|
export interface GetPositionsHistoryRequestUTA {
|
|
240
327
|
symbol?: string;
|
|
@@ -243,6 +330,14 @@ export interface GetPositionsHistoryRequestUTA {
|
|
|
243
330
|
lastId?: number;
|
|
244
331
|
pageSize?: number;
|
|
245
332
|
}
|
|
333
|
+
/** Settled funding fee history (private) */
|
|
334
|
+
export interface GetPrivateFundingFeeHistoryRequestUTA {
|
|
335
|
+
symbol?: string;
|
|
336
|
+
startAt?: number;
|
|
337
|
+
endAt?: number;
|
|
338
|
+
lastId?: number;
|
|
339
|
+
pageSize?: number;
|
|
340
|
+
}
|
|
246
341
|
export interface GetAccountPositionTiersRequestUTA {
|
|
247
342
|
symbol: string;
|
|
248
343
|
tradeType?: 'FUTURES' | 'MARGIN';
|