44 AccountBorrowCollateralLimitV5 ,
55 AccountCoinBalanceV5 ,
66 AccountInfoV5 ,
7+ AccountInstrumentInfoResponseV5 ,
78 AccountMarginModeV5 ,
89 AccountOrderV5 ,
910 AccountTypeV5 ,
@@ -22,6 +23,7 @@ import {
2223 APIResponseV3 ,
2324 APIResponseV3WithTime ,
2425 AssetInfoV5 ,
26+ AvailableAmountToRepayV5 ,
2527 BatchAmendOrderParamsV5 ,
2628 BatchAmendOrderResultV5 ,
2729 BatchCancelOrderParamsV5 ,
@@ -59,6 +61,7 @@ import {
5961 CoinExchangeRecordV5 ,
6062 CoinGreeksV5 ,
6163 CoinInfoV5 ,
64+ CoinStateV5 ,
6265 CollateralAdjustmentHistoryV5 ,
6366 CollateralDataV5 ,
6467 CollateralInfoV5 ,
@@ -83,6 +86,7 @@ import {
8386 CreateSupplyOrderFixedParamsV5 ,
8487 CreateSupplyOrderFixedV5 ,
8588 CryptoLoanPositionV5 ,
89+ CurrencyPositionTiersV5 ,
8690 CursorListV5 ,
8791 CursorRowsV5 ,
8892 DCPInfoV5 ,
@@ -91,9 +95,11 @@ import {
9195 DeliveryRecordV5 ,
9296 DepositAddressChainV5 ,
9397 DepositRecordV5 ,
98+ EarnHourlyYieldHistoryV5 ,
9499 EarnOrderHistoryV5 ,
95100 EarnPositionV5 ,
96101 EarnProductV5 ,
102+ EarnYieldHistoryV5 ,
97103 ExchangeBrokerAccountInfoV5 ,
98104 ExchangeBrokerEarningResultV5 ,
99105 ExchangeBrokerSubAccountDepositRecordV5 ,
@@ -105,11 +111,14 @@ import {
105111 FundingRateHistoryResponseV5 ,
106112 GetAccountCoinBalanceParamsV5 ,
107113 GetAccountHistoricOrdersParamsV5 ,
114+ GetAccountInstrumentsInfoParamsV5 ,
108115 GetAccountOrdersParamsV5 ,
109116 GetADLAlertParamsV5 ,
117+ GetAffiliateUserListParamsV5 ,
110118 GetAllCoinsBalanceParamsV5 ,
111119 GetAllowedDepositCoinInfoParamsV5 ,
112120 GetAssetInfoParamsV5 ,
121+ GetAvailableAmountToRepayParamsV5 ,
113122 GetBorrowableCoinsParamsV5 ,
114123 GetBorrowContractInfoFixedParamsV5 ,
115124 GetBorrowHistoryFlexibleParamsV5 ,
@@ -122,15 +131,18 @@ import {
122131 GetClosedOptionsPositionsParamsV5 ,
123132 GetClosedPnLParamsV5 ,
124133 GetCoinExchangeRecordParamsV5 ,
134+ GetCoinStateParamsV5 ,
125135 GetCollateralAdjustmentHistoryParamsV5 ,
126136 GetCollateralCoinsParamsV5 ,
127137 GetCompletedLoanOrderHistoryParamsV5 ,
128138 GetConvertHistoryParamsV5 ,
129139 GetDeliveryPriceParamsV5 ,
130140 GetDeliveryRecordParamsV5 ,
131141 GetDepositRecordParamsV5 ,
142+ GetEarnHourlyYieldHistoryParamsV5 ,
132143 GetEarnOrderHistoryParamsV5 ,
133144 GetEarnPositionParamsV5 ,
145+ GetEarnYieldHistoryParamsV5 ,
134146 GetExchangeBrokerEarningsParamsV5 ,
135147 GetExecutionListParamsV5 ,
136148 GetFeeGroupStructureParamsV5 ,
@@ -147,6 +159,7 @@ import {
147159 GetLoanLTVAdjustmentHistoryParamsV5 ,
148160 GetLongShortRatioParamsV5 ,
149161 GetMarkPriceKlineParamsV5 ,
162+ GetMaxBorrowableAmountParamsV5 ,
150163 GetMaxCollateralAmountParamsV5 ,
151164 GetMovePositionHistoryParamsV5 ,
152165 GetOngoingFlexibleLoansParamsV5 ,
@@ -160,6 +173,7 @@ import {
160173 GetP2POrdersParamsV5 ,
161174 GetP2PPendingOrdersParamsV5 ,
162175 GetP2PPersonalAdsParamsV5 ,
176+ GetPositionTiersParamsV5 ,
163177 GetPremiumIndexPriceKlineParamsV5 ,
164178 GetPreUpgradeClosedPnlParamsV5 ,
165179 GetPreUpgradeOptionDeliveryRecordParamsV5 ,
@@ -197,6 +211,7 @@ import {
197211 GetUnpaidLoanOrdersParamsV5 ,
198212 GetVIPMarginDataParamsV5 ,
199213 GetWalletBalanceParamsV5 ,
214+ GetWithdrawalAddressListParamsV5 ,
200215 GetWithdrawalRecordsParamsV5 ,
201216 HistoricalVolatilityV5 ,
202217 IndexPriceComponentsResponseV5 ,
@@ -207,7 +222,14 @@ import {
207222 IssueVoucherParamsV5 ,
208223 LoanLTVAdjustmentHistoryV5 ,
209224 LongShortRatioV5 ,
225+ ManualBorrowParamsV5 ,
226+ ManualBorrowResultV5 ,
227+ ManualRepayParamsV5 ,
228+ ManualRepayResultV5 ,
229+ ManualRepayWithoutConversionParamsV5 ,
230+ ManualRepayWithoutConversionResultV5 ,
210231 MarkP2POrderAsPaidParamsV5 ,
232+ MaxBorrowableAmountV5 ,
211233 MMPModifyParamsV5 ,
212234 MMPStateV5 ,
213235 MovePositionHistoryV5 ,
@@ -267,6 +289,7 @@ import {
267289 SetLimitPriceActionParamsV5 ,
268290 SetRiskLimitParamsV5 ,
269291 SetRiskLimitResultV5 ,
292+ SetSpotMarginLeverageParamsV5 ,
270293 SettlementRecordV5 ,
271294 SetTPSLModeParamsV5 ,
272295 SetTradingStopParamsV5 ,
@@ -306,6 +329,7 @@ import {
306329 VIPMarginDataV5 ,
307330 WalletBalanceV5 ,
308331 WithdrawableAmountV5 ,
332+ WithdrawalAddressV5 ,
309333 WithdrawalRecordV5 ,
310334 WithdrawParamsV5 ,
311335} from './types' ;
@@ -1444,6 +1468,20 @@ export class RestClientV5 extends BaseRestClient {
14441468 return this . getPrivate ( '/v5/account/withdrawal' , params ) ;
14451469 }
14461470
1471+ /**
1472+ * Get Account Instruments Info
1473+ * Query for the instrument specification of online trading pairs that available to users.
1474+ *
1475+ * Covers: SPOT / USDT contract / USDC contract / Inverse contract
1476+ *
1477+ * Includes RPI permission information (isPublicRpi, myRpiPermission)
1478+ */
1479+ getAccountInstrumentsInfo < C extends 'spot' | 'linear' | 'inverse' > (
1480+ params : GetAccountInstrumentsInfoParamsV5 & { category : C } ,
1481+ ) : Promise < APIResponseV3WithTime < AccountInstrumentInfoResponseV5 < C > > > {
1482+ return this . getPrivate ( '/v5/account/instruments-info' , params ) ;
1483+ }
1484+
14471485 /**
14481486 * Upgrade to unified account.
14491487 *
@@ -1480,6 +1518,23 @@ export class RestClientV5 extends BaseRestClient {
14801518 return this . postPrivate ( '/v5/account/quick-repayment' , params ) ;
14811519 }
14821520
1521+ /**
1522+ * Manual Repay
1523+ *
1524+ * If neither coin nor amount is passed, then repay all the liabilities.
1525+ * If coin is passed and amount is not, the coin will be repaid in full.
1526+ *
1527+ * When repaying, the system will first use the spot available balance of the debt currency.
1528+ * If that's not enough, the remaining amount will be repaid by converting other assets.
1529+ *
1530+ * Repayment is prohibited between 04:00 and 05:30 per hour.
1531+ */
1532+ manualRepay (
1533+ params ?: ManualRepayParamsV5 ,
1534+ ) : Promise < APIResponseV3WithTime < ManualRepayResultV5 > > {
1535+ return this . postPrivate ( '/v5/account/repay' , params ) ;
1536+ }
1537+
14831538 /**
14841539 * You can decide whether the assets in the Unified account needs to be collateral coins.
14851540 */
@@ -2012,6 +2067,21 @@ export class RestClientV5 extends BaseRestClient {
20122067 return this . getPrivate ( '/v5/asset/withdraw/query-record' , params ) ;
20132068 }
20142069
2070+ /**
2071+ * Get Withdrawal Address List
2072+ * Query the withdrawal addresses in the address book.
2073+ *
2074+ * TIP: The API key for querying this endpoint must have withdrawal permissions.
2075+ */
2076+ getWithdrawalAddressList ( params ?: GetWithdrawalAddressListParamsV5 ) : Promise <
2077+ APIResponseV3WithTime < {
2078+ rows : WithdrawalAddressV5 [ ] ;
2079+ nextPageCursor : string ;
2080+ } >
2081+ > {
2082+ return this . getPrivate ( '/v5/asset/withdraw/query-address' , params ) ;
2083+ }
2084+
20152085 /**
20162086 * Get Exchange Entity List.
20172087 *
@@ -2291,7 +2361,7 @@ export class RestClientV5 extends BaseRestClient {
22912361 * - Use master UID only
22922362 * - The api key can only have "Affiliate" permission
22932363 */
2294- getAffiliateUserList ( params ?: { size ?: number ; cursor ?: string } ) : Promise <
2364+ getAffiliateUserList ( params ?: GetAffiliateUserListParamsV5 ) : Promise <
22952365 APIResponseV3WithTime < {
22962366 list : AffiliateUserListItemV5 [ ] ;
22972367 nextPageCursor : string ;
@@ -2377,13 +2447,22 @@ export class RestClientV5 extends BaseRestClient {
23772447 }
23782448
23792449 /**
2380- * Set the user's maximum leverage in spot cross margin.
2381- * CAUTION: Your account needs to enable spot margin first; i.e., you must have finished the quiz on web / app.
2450+ * @deprecated Use setSpotMarginLeverageV2 instead, which uses an object parameter instead. This method will be replaced by setSpotMarginLeverageV2 in a future release.
23822451 */
23832452 setSpotMarginLeverage ( leverage : string ) : Promise < APIResponseV3WithTime < { } > > {
23842453 return this . postPrivate ( '/v5/spot-margin-trade/set-leverage' , { leverage } ) ;
23852454 }
23862455
2456+ /**
2457+ * Set the user's maximum leverage in spot cross margin.
2458+ * CAUTION: Your account needs to enable spot margin first; i.e., you must have finished the quiz on web / app.
2459+ */
2460+ setSpotMarginLeverageV2 (
2461+ params : SetSpotMarginLeverageParamsV5 ,
2462+ ) : Promise < APIResponseV3WithTime < { } > > {
2463+ return this . postPrivate ( '/v5/spot-margin-trade/set-leverage' , params ) ;
2464+ }
2465+
23872466 /**
23882467 * Query the Spot margin status and leverage of Unified account.
23892468 *
@@ -2393,6 +2472,70 @@ export class RestClientV5 extends BaseRestClient {
23932472 return this . getPrivate ( '/v5/spot-margin-trade/state' ) ;
23942473 }
23952474
2475+ /**
2476+ * Manual borrow for UTA
2477+ */
2478+ manualBorrow (
2479+ params : ManualBorrowParamsV5 ,
2480+ ) : Promise < APIResponseV3WithTime < ManualBorrowResultV5 > > {
2481+ return this . postPrivate ( '/v5/account/borrow' , params ) ;
2482+ }
2483+
2484+ /**
2485+ * Get max borrowable amount
2486+ */
2487+ getMaxBorrowableAmount (
2488+ params : GetMaxBorrowableAmountParamsV5 ,
2489+ ) : Promise < APIResponseV3WithTime < MaxBorrowableAmountV5 > > {
2490+ return this . getPrivate ( '/v5/spot-margin-trade/max-borrowable' , params ) ;
2491+ }
2492+
2493+ /**
2494+ * Get loan position risk information (position tiers)
2495+ */
2496+ getPositionTiers ( params ?: GetPositionTiersParamsV5 ) : Promise <
2497+ APIResponseV3WithTime < {
2498+ list : CurrencyPositionTiersV5 [ ] ;
2499+ } >
2500+ > {
2501+ return this . getPrivate ( '/v5/spot-margin-trade/position-tiers' , params ) ;
2502+ }
2503+
2504+ /**
2505+ * Get currency leverage information (coin state)
2506+ */
2507+ getCoinState ( params ?: GetCoinStateParamsV5 ) : Promise <
2508+ APIResponseV3WithTime < {
2509+ list : CoinStateV5 [ ] ;
2510+ } >
2511+ > {
2512+ return this . getPrivate ( '/v5/spot-margin-trade/coinstate' , params ) ;
2513+ }
2514+
2515+ /**
2516+ * Get available amount to repay
2517+ */
2518+ getAvailableAmountToRepay (
2519+ params : GetAvailableAmountToRepayParamsV5 ,
2520+ ) : Promise < APIResponseV3WithTime < AvailableAmountToRepayV5 > > {
2521+ return this . getPrivate (
2522+ '/v5/spot-margin-trade/repayment-available-amount' ,
2523+ params ,
2524+ ) ;
2525+ }
2526+
2527+ /**
2528+ * Manual repay without asset conversion
2529+ *
2530+ * IMPORTANT: Repayment is prohibited between 04:00 and 05:30 per hour.
2531+ * When repaying, system will only use the spot available balance of the debt currency.
2532+ */
2533+ manualRepayWithoutConversion (
2534+ params : ManualRepayWithoutConversionParamsV5 ,
2535+ ) : Promise < APIResponseV3WithTime < ManualRepayWithoutConversionResultV5 > > {
2536+ return this . postPrivate ( '/v5/account/no-convert-repay' , params ) ;
2537+ }
2538+
23962539 /**
23972540 *
23982541 ****** Spot Margin Trade APIs (Normal)
@@ -3357,12 +3500,15 @@ export class RestClientV5 extends BaseRestClient {
33573500 *
33583501 * INFO: API key needs "Earn" permission
33593502 *
3360- * Note: Either orderId or orderLinkId is required. If both are passed,
3361- * make sure they're matched, otherwise returning empty result
3503+ * Note:
3504+ * - For category = OnChain, either orderId or orderLinkId is required
3505+ * - If both are passed, make sure they're matched, otherwise returning empty result
3506+ * - Supports batch query with productId, startTime, endTime, limit, cursor
33623507 */
33633508 getEarnOrderHistory ( params : GetEarnOrderHistoryParamsV5 ) : Promise <
33643509 APIResponseV3WithTime < {
33653510 list : EarnOrderHistoryV5 [ ] ;
3511+ nextPageCursor : string ;
33663512 } >
33673513 > {
33683514 return this . getPrivate ( '/v5/earn/order' , params ) ;
@@ -3383,6 +3529,34 @@ export class RestClientV5 extends BaseRestClient {
33833529 return this . getPrivate ( '/v5/earn/position' , params ) ;
33843530 }
33853531
3532+ /**
3533+ * Get Yield History
3534+ *
3535+ * INFO: API key needs "Earn" permission
3536+ */
3537+ getEarnYieldHistory ( params : GetEarnYieldHistoryParamsV5 ) : Promise <
3538+ APIResponseV3WithTime < {
3539+ yield : EarnYieldHistoryV5 [ ] ;
3540+ nextPageCursor : string ;
3541+ } >
3542+ > {
3543+ return this . getPrivate ( '/v5/earn/yield' , params ) ;
3544+ }
3545+
3546+ /**
3547+ * Get Hourly Yield History
3548+ *
3549+ * INFO: API key needs "Earn" permission
3550+ */
3551+ getEarnHourlyYieldHistory ( params : GetEarnHourlyYieldHistoryParamsV5 ) : Promise <
3552+ APIResponseV3WithTime < {
3553+ list : EarnHourlyYieldHistoryV5 [ ] ;
3554+ nextPageCursor : string ;
3555+ } >
3556+ > {
3557+ return this . getPrivate ( '/v5/earn/hourly-yield' , params ) ;
3558+ }
3559+
33863560 /**
33873561 *
33883562 ****** RFQ APIs
0 commit comments