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 CHANGED
@@ -45,6 +45,7 @@ Updated & performant JavaScript & Node.js SDK for the KuCoin REST APIs and WebSo
45
45
  - Heavy automated end-to-end testing with real API calls.
46
46
  - Proxy support via axios integration.
47
47
  - Active community support & collaboration in telegram: [Node.js Algo Traders](https://t.me/nodetraders).
48
+ - QuickStart Guide: [Kucoin JavaScript QuickStart Guide](https://siebly.io/sdk/kucoin/javascript)
48
49
 
49
50
  ## Table of Contents
50
51
 
@@ -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 { BatchCancelOrdersBySymbolRequestUTA, BatchCancelOrdersRequestUTA, 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, ModifyLeverageRequestUTA, ModifyMarginCrossLeverageRequestUTA, PlaceOrderRequestUTA, SetAccountModeRequestUTA, SetDCPRequestUTA, SetSubAccountTransferPermissionRequestUTA } 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 { BatchCancelOrdersBySymbolResponseUTA, BatchCancelOrdersResponseUTA, 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, ModifyMarginCrossLeverageResponseUTA, OrderDetailsUTA, PlaceOrderResponseUTA, PositionTierUTA, PositionUTA, SubAccountTransferPermissionUTA, ThirdPartyCustodyCurrencyUTA, ThirdPartyCustodyQuotaUTA } 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.
@@ -147,11 +157,26 @@ export declare class UnifiedAPIClient extends BaseRestClient {
147
157
  * Request the interest records via this endpoint.
148
158
  */
149
159
  getInterestHistory(params: GetInterestHistoryRequestUTA): Promise<APISuccessResponse<GetInterestHistoryResponseUTA>>;
160
+ /**
161
+ * Get Borrowing Rates and Limits
162
+ * Hourly/daily rates and borrow limits (UTA).
163
+ */
164
+ getBorrowingRatesAndLimits(params: GetBorrowingRatesAndLimitsRequestUTA): Promise<APISuccessResponse<GetBorrowingRatesAndLimitsResponseUTA>>;
150
165
  /**
151
166
  * Modify Leverage (UTA)
152
167
  * This interface supports modify leverage of the specified symbol.
153
168
  */
154
169
  modifyLeverage(params: ModifyLeverageRequestUTA): Promise<APISuccessResponse<null>>;
170
+ /**
171
+ * Modify Leverage Margin Cross (UTA)
172
+ * Update leverage for a currency in UTA cross margin.
173
+ */
174
+ modifyMarginCrossLeverage(params: ModifyMarginCrossLeverageRequestUTA, accountMode?: 'unified'): Promise<APISuccessResponse<ModifyMarginCrossLeverageResponseUTA>>;
175
+ /**
176
+ * Get Leverage (UTA)
177
+ * Query leverage for MARGIN (currency) or FUTURES (symbol).
178
+ */
179
+ getLeverage(params: GetLeverageRequestUTA): Promise<APISuccessResponse<GetLeverageItemUTA[]>>;
155
180
  /**
156
181
  * Get Deposit Address
157
182
  * Return a deposit address; when both currency and chain are provided,
@@ -159,6 +184,11 @@ export declare class UnifiedAPIClient extends BaseRestClient {
159
184
  * URL unified to GET /api/ua/v1/asset/deposit/address as of 2026.01.17.
160
185
  */
161
186
  getDepositAddress(params: GetDepositAddressRequestUTA): Promise<APISuccessResponse<DepositAddressUTA[]>>;
187
+ /**
188
+ * Get Third-Party Custody Account Currency Limits
189
+ * OES remaining custody quota per custodian and settlement currency.
190
+ */
191
+ getThirdPartyCustodyQuota(params?: GetThirdPartyCustodyQuotaRequestUTA): Promise<APISuccessResponse<ThirdPartyCustodyQuotaUTA[]>>;
162
192
  /**
163
193
  *
164
194
  * REST - Unified Trading Account - Orders
@@ -170,7 +200,7 @@ export declare class UnifiedAPIClient extends BaseRestClient {
170
200
  * Supports RPI (Retail Price Improvement) orders for Futures as of 2025.01.02.
171
201
  * Note: timeInForce supports 'RPI' value for Futures only (Phase 1).
172
202
  * Note: For Classic mode, tradeType is required in query param.
173
- * Note: For Unified mode, tradeType should not be in query param.
203
+ * Note: For Unified mode, tradeType is sent in the request body (incl. MARGIN as of 2026.04.19).
174
204
  */
175
205
  placeOrder(params: PlaceOrderRequestUTA, accountMode?: 'classic' | 'unified'): Promise<APISuccessResponse<PlaceOrderResponseUTA>>;
176
206
  /**
@@ -252,6 +282,7 @@ export declare class UnifiedAPIClient extends BaseRestClient {
252
282
  * Get Position List (UTA)
253
283
  * Get the position details of all open positions.
254
284
  * Note: creationTime standardized to nanoseconds as of 2026.01.12.
285
+ * Note: pageNumber, pageSize query params and liquidationPrice in each position (as of 2026.04.09).
255
286
  */
256
287
  getPositionList(params?: GetPositionListRequestUTA): Promise<APISuccessResponse<PositionUTA[]>>;
257
288
  /**
@@ -262,6 +293,11 @@ export declare class UnifiedAPIClient extends BaseRestClient {
262
293
  * Note: creationTime and closingTime standardized to nanoseconds as of 2026.01.12.
263
294
  */
264
295
  getPositionsHistory(params?: GetPositionsHistoryRequestUTA): Promise<APISuccessResponse<GetPositionsHistoryResponseUTA>>;
296
+ /**
297
+ * Get Private Funding Fee History
298
+ * Settled funding fee records for the current account.
299
+ */
300
+ getPrivateFundingFeeHistory(params?: GetPrivateFundingFeeHistoryRequestUTA): Promise<APISuccessResponse<GetPrivateFundingFeeHistoryResponseUTA>>;
265
301
  /**
266
302
  * Get Account Position Tiers
267
303
  * Request account position tiers (risk limit) info.
@@ -33,6 +33,13 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
33
33
  getCurrency(params) {
34
34
  return this.get('api/ua/v1/market/currency', params);
35
35
  }
36
+ /**
37
+ * Get Third-Party Custody Currencies
38
+ * Query settlement currencies supported by third-party (OES) custodian institutions.
39
+ */
40
+ getThirdPartyCustodyCurrencies(params) {
41
+ return this.get('api/ua/v1/oes/currency', params);
42
+ }
36
43
  /**
37
44
  * Get Symbol
38
45
  * Request a list of available currency pairs for trading via this endpoint.
@@ -89,6 +96,13 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
89
96
  getCrossMarginConfig() {
90
97
  return this.get('api/ua/v1/market/cross-config');
91
98
  }
99
+ /**
100
+ * Get Borrowable Currencies
101
+ * List of borrowable currencies (UTA / public).
102
+ */
103
+ getBorrowableCurrencies() {
104
+ return this.get('api/ua/v1/market/borrowable-currency');
105
+ }
92
106
  /**
93
107
  * Get Service Status
94
108
  * Get the service status.
@@ -195,6 +209,13 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
195
209
  getInterestHistory(params) {
196
210
  return this.getPrivate('api/ua/v1/account/interest-history', params);
197
211
  }
212
+ /**
213
+ * Get Borrowing Rates and Limits
214
+ * Hourly/daily rates and borrow limits (UTA).
215
+ */
216
+ getBorrowingRatesAndLimits(params) {
217
+ return this.getPrivate('api/ua/v1/account/interest-limits', params);
218
+ }
198
219
  /**
199
220
  * Modify Leverage (UTA)
200
221
  * This interface supports modify leverage of the specified symbol.
@@ -202,6 +223,20 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
202
223
  modifyLeverage(params) {
203
224
  return this.postPrivate('api/ua/v1/unified/account/modify-leverage', params);
204
225
  }
226
+ /**
227
+ * Modify Leverage Margin Cross (UTA)
228
+ * Update leverage for a currency in UTA cross margin.
229
+ */
230
+ modifyMarginCrossLeverage(params, accountMode = 'unified') {
231
+ return this.postPrivate(`api/ua/v1/${accountMode}/account/modify-leverage-margin-cross`, params);
232
+ }
233
+ /**
234
+ * Get Leverage (UTA)
235
+ * Query leverage for MARGIN (currency) or FUTURES (symbol).
236
+ */
237
+ getLeverage(params) {
238
+ return this.getPrivate('api/ua/v1/unified/account/leverage', params);
239
+ }
205
240
  /**
206
241
  * Get Deposit Address
207
242
  * Return a deposit address; when both currency and chain are provided,
@@ -211,6 +246,13 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
211
246
  getDepositAddress(params) {
212
247
  return this.getPrivate('api/ua/v1/asset/deposit/address', params);
213
248
  }
249
+ /**
250
+ * Get Third-Party Custody Account Currency Limits
251
+ * OES remaining custody quota per custodian and settlement currency.
252
+ */
253
+ getThirdPartyCustodyQuota(params) {
254
+ return this.getPrivate('api/ua/v1/oes/custody-quota', params);
255
+ }
214
256
  /**
215
257
  *
216
258
  * REST - Unified Trading Account - Orders
@@ -222,13 +264,16 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
222
264
  * Supports RPI (Retail Price Improvement) orders for Futures as of 2025.01.02.
223
265
  * Note: timeInForce supports 'RPI' value for Futures only (Phase 1).
224
266
  * Note: For Classic mode, tradeType is required in query param.
225
- * Note: For Unified mode, tradeType should not be in query param.
267
+ * Note: For Unified mode, tradeType is sent in the request body (incl. MARGIN as of 2026.04.19).
226
268
  */
227
269
  placeOrder(params, accountMode = 'unified') {
228
270
  const { tradeType, ...bodyParams } = params;
229
271
  const url = accountMode === 'classic'
230
272
  ? `api/ua/v1/${accountMode}/order/place?tradeType=${tradeType}`
231
273
  : `api/ua/v1/${accountMode}/order/place`;
274
+ if (accountMode === 'unified') {
275
+ return this.postPrivate(url, { ...bodyParams, tradeType });
276
+ }
232
277
  return this.postPrivate(url, bodyParams);
233
278
  }
234
279
  /**
@@ -339,6 +384,7 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
339
384
  * Get Position List (UTA)
340
385
  * Get the position details of all open positions.
341
386
  * Note: creationTime standardized to nanoseconds as of 2026.01.12.
387
+ * Note: pageNumber, pageSize query params and liquidationPrice in each position (as of 2026.04.09).
342
388
  */
343
389
  getPositionList(params) {
344
390
  return this.getPrivate('api/ua/v1/unified/position/open-list', params);
@@ -353,6 +399,13 @@ class UnifiedAPIClient extends BaseRestClient_js_1.BaseRestClient {
353
399
  getPositionsHistory(params) {
354
400
  return this.getPrivate('api/ua/v1/position/history', params);
355
401
  }
402
+ /**
403
+ * Get Private Funding Fee History
404
+ * Settled funding fee records for the current account.
405
+ */
406
+ getPrivateFundingFeeHistory(params) {
407
+ return this.getPrivate('api/ua/v1/position/funding-history', params);
408
+ }
356
409
  /**
357
410
  * Get Account Position Tiers
358
411
  * Request account position tiers (risk limit) info.
@@ -1 +1 @@
1
- {"version":3,"file":"UnifiedAPIClient.js","sourceRoot":"","sources":["../../src/UnifiedAPIClient.ts"],"names":[],"mappings":";;;AAAA,+DAAyD;AACzD,2DAA8E;AA8E9E;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,kCAAc;IAClD,aAAa;QACX,OAAO,uCAAqB,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,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C,CAAC,aAAa,WAAW,iCAAiC,MAAM,CAAC,SAAS,EAAE;YAC7E,CAAC,CAAC,aAAa,WAAW,qBAAqB,CAAC;QACpD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,yBAAyB,CACvB,MAA2C;QAE3C,OAAO,IAAI,CAAC,WAAW,CAAC,oCAAoC,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CACJ,MAAwB;QAExB,OAAO,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,MAAwB;QAExB,OAAO,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IAEH;;;;;OAKG;IACH,eAAe,CACb,MAAkC;QAElC,OAAO,IAAI,CAAC,UAAU,CAAC,sCAAsC,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;OAMG;IACH,mBAAmB,CACjB,MAAsC;QAEtC,OAAO,IAAI,CAAC,UAAU,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;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;AAvjBD,4CAujBC"}
@@ -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;
@@ -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 { BatchCancelOrdersBySymbolRequestUTA, BatchCancelOrdersRequestUTA, 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, ModifyLeverageRequestUTA, ModifyMarginCrossLeverageRequestUTA, PlaceOrderRequestUTA, SetAccountModeRequestUTA, SetDCPRequestUTA, SetSubAccountTransferPermissionRequestUTA } 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 { BatchCancelOrdersBySymbolResponseUTA, BatchCancelOrdersResponseUTA, 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, ModifyMarginCrossLeverageResponseUTA, OrderDetailsUTA, PlaceOrderResponseUTA, PositionTierUTA, PositionUTA, SubAccountTransferPermissionUTA, ThirdPartyCustodyCurrencyUTA, ThirdPartyCustodyQuotaUTA } 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.
@@ -147,11 +157,26 @@ export declare class UnifiedAPIClient extends BaseRestClient {
147
157
  * Request the interest records via this endpoint.
148
158
  */
149
159
  getInterestHistory(params: GetInterestHistoryRequestUTA): Promise<APISuccessResponse<GetInterestHistoryResponseUTA>>;
160
+ /**
161
+ * Get Borrowing Rates and Limits
162
+ * Hourly/daily rates and borrow limits (UTA).
163
+ */
164
+ getBorrowingRatesAndLimits(params: GetBorrowingRatesAndLimitsRequestUTA): Promise<APISuccessResponse<GetBorrowingRatesAndLimitsResponseUTA>>;
150
165
  /**
151
166
  * Modify Leverage (UTA)
152
167
  * This interface supports modify leverage of the specified symbol.
153
168
  */
154
169
  modifyLeverage(params: ModifyLeverageRequestUTA): Promise<APISuccessResponse<null>>;
170
+ /**
171
+ * Modify Leverage Margin Cross (UTA)
172
+ * Update leverage for a currency in UTA cross margin.
173
+ */
174
+ modifyMarginCrossLeverage(params: ModifyMarginCrossLeverageRequestUTA, accountMode?: 'unified'): Promise<APISuccessResponse<ModifyMarginCrossLeverageResponseUTA>>;
175
+ /**
176
+ * Get Leverage (UTA)
177
+ * Query leverage for MARGIN (currency) or FUTURES (symbol).
178
+ */
179
+ getLeverage(params: GetLeverageRequestUTA): Promise<APISuccessResponse<GetLeverageItemUTA[]>>;
155
180
  /**
156
181
  * Get Deposit Address
157
182
  * Return a deposit address; when both currency and chain are provided,
@@ -159,6 +184,11 @@ export declare class UnifiedAPIClient extends BaseRestClient {
159
184
  * URL unified to GET /api/ua/v1/asset/deposit/address as of 2026.01.17.
160
185
  */
161
186
  getDepositAddress(params: GetDepositAddressRequestUTA): Promise<APISuccessResponse<DepositAddressUTA[]>>;
187
+ /**
188
+ * Get Third-Party Custody Account Currency Limits
189
+ * OES remaining custody quota per custodian and settlement currency.
190
+ */
191
+ getThirdPartyCustodyQuota(params?: GetThirdPartyCustodyQuotaRequestUTA): Promise<APISuccessResponse<ThirdPartyCustodyQuotaUTA[]>>;
162
192
  /**
163
193
  *
164
194
  * REST - Unified Trading Account - Orders
@@ -170,7 +200,7 @@ export declare class UnifiedAPIClient extends BaseRestClient {
170
200
  * Supports RPI (Retail Price Improvement) orders for Futures as of 2025.01.02.
171
201
  * Note: timeInForce supports 'RPI' value for Futures only (Phase 1).
172
202
  * Note: For Classic mode, tradeType is required in query param.
173
- * Note: For Unified mode, tradeType should not be in query param.
203
+ * Note: For Unified mode, tradeType is sent in the request body (incl. MARGIN as of 2026.04.19).
174
204
  */
175
205
  placeOrder(params: PlaceOrderRequestUTA, accountMode?: 'classic' | 'unified'): Promise<APISuccessResponse<PlaceOrderResponseUTA>>;
176
206
  /**
@@ -252,6 +282,7 @@ export declare class UnifiedAPIClient extends BaseRestClient {
252
282
  * Get Position List (UTA)
253
283
  * Get the position details of all open positions.
254
284
  * Note: creationTime standardized to nanoseconds as of 2026.01.12.
285
+ * Note: pageNumber, pageSize query params and liquidationPrice in each position (as of 2026.04.09).
255
286
  */
256
287
  getPositionList(params?: GetPositionListRequestUTA): Promise<APISuccessResponse<PositionUTA[]>>;
257
288
  /**
@@ -262,6 +293,11 @@ export declare class UnifiedAPIClient extends BaseRestClient {
262
293
  * Note: creationTime and closingTime standardized to nanoseconds as of 2026.01.12.
263
294
  */
264
295
  getPositionsHistory(params?: GetPositionsHistoryRequestUTA): Promise<APISuccessResponse<GetPositionsHistoryResponseUTA>>;
296
+ /**
297
+ * Get Private Funding Fee History
298
+ * Settled funding fee records for the current account.
299
+ */
300
+ getPrivateFundingFeeHistory(params?: GetPrivateFundingFeeHistoryRequestUTA): Promise<APISuccessResponse<GetPrivateFundingFeeHistoryResponseUTA>>;
265
301
  /**
266
302
  * Get Account Position Tiers
267
303
  * Request account position tiers (risk limit) info.