@@ -252,6 +252,17 @@ import {
252252 Announcement ,
253253} from './types' ;
254254import { ASSET_BILL_TYPE } from './constants' ;
255+ import {
256+ AccruedInterestItem ,
257+ AccruedInterestRequest ,
258+ AdjustCollateralRequest ,
259+ CollateralAssetsResponse ,
260+ LoanHistoryItem ,
261+ LoanHistoryRequest ,
262+ LoanInfo ,
263+ MaxLoanRequest ,
264+ MaxLoanResponse ,
265+ } from './types/rest/response/private-flexible-loan' ;
255266
256267export class RestClient extends BaseRestClient {
257268 /**
@@ -498,12 +509,14 @@ export class RestClient extends BaseRestClient {
498509 getMaxLoan (
499510 instId : string ,
500511 mgnMode : MarginMode ,
501- mgnCcy ?: string
512+ mgnCcy ?: string ,
513+ ccy ?: string
502514 ) : Promise < AccountMaxLoan [ ] > {
503515 return this . getPrivate ( '/api/v5/account/max-loan' , {
504516 instId,
505517 mgnMode,
506518 mgnCcy,
519+ ccy,
507520 } ) ;
508521 }
509522
@@ -814,6 +827,26 @@ export class RestClient extends BaseRestClient {
814827 return this . postPrivate ( '/api/v5/account/set-auto-loan' , params ) ;
815828 }
816829
830+ presetAccountLevelSwitch ( params : {
831+ acctLv : '2' | '3' | '4' ;
832+ lever ?: string ;
833+ riskOffsetType ?: '1' | '2' | '3' | '4' ;
834+ } ) : Promise < any [ ] > {
835+ return this . postPrivate (
836+ '/api/v5/account/account-level-switch-preset' ,
837+ params
838+ ) ;
839+ }
840+
841+ getAccountSwitchPrecheck ( params : {
842+ acctLv : '1' | '2' | '3' | '4' ;
843+ } ) : Promise < any [ ] > {
844+ return this . getPrivate (
845+ '/api/v5/account/set-account-switch-precheck' ,
846+ params
847+ ) ;
848+ }
849+
817850 setAccountMode ( params : {
818851 acctLv : AccountLevel ;
819852 } ) : Promise < AccountModeResult [ ] > {
@@ -2869,7 +2902,10 @@ export class RestClient extends BaseRestClient {
28692902 }
28702903
28712904 amendLendingOrder ( params : LendingOrder ) : Promise < any [ ] > {
2872- return this . postPrivate ( '/api/v5/finance/fixed-loan/lending-order' , params ) ;
2905+ return this . postPrivate (
2906+ '/api/v5/finance/fixed-loan/amend-lending-order' ,
2907+ params
2908+ ) ;
28732909 }
28742910
28752911 getLendingOrders ( params : GetLendingOrderListRequest ) : Promise < any [ ] > {
@@ -2886,6 +2922,56 @@ export class RestClient extends BaseRestClient {
28862922 ) ;
28872923 }
28882924
2925+ /**
2926+ *
2927+ * Financial product - Flexible loan endpoints
2928+ *
2929+ */
2930+
2931+ getBorrowableCurrencies ( ) : Promise <
2932+ {
2933+ borrowCcy : string ;
2934+ } [ ]
2935+ > {
2936+ return this . get ( '/api/v5/finance/flexible-loan/borrow-currencies' ) ;
2937+ }
2938+
2939+ getCollateralAssets ( params ?: {
2940+ ccy ?: string ;
2941+ } ) : Promise < CollateralAssetsResponse [ ] > {
2942+ return this . get ( '/api/v5/finance/flexible-loan/collateral-assets' , params ) ;
2943+ }
2944+
2945+ getMaxLoanAmount ( params : MaxLoanRequest ) : Promise < MaxLoanResponse [ ] > {
2946+ return this . postPrivate ( '/api/v5/finance/flexible-loan/max-loan' , params ) ;
2947+ }
2948+
2949+ adjustCollateral ( params : AdjustCollateralRequest ) : Promise < [ ] > {
2950+ return this . postPrivate (
2951+ '/api/v5/finance/flexible-loan/adjust-collateral' ,
2952+ params
2953+ ) ;
2954+ }
2955+
2956+ getLoanInfo ( ) : Promise < LoanInfo [ ] > {
2957+ return this . getPrivate ( '/api/v5/finance/flexible-loan/loan-info' ) ;
2958+ }
2959+ getLoanHistory ( params ?: LoanHistoryRequest ) : Promise < LoanHistoryItem [ ] > {
2960+ return this . getPrivate (
2961+ '/api/v5/finance/flexible-loan/loan-history' ,
2962+ params
2963+ ) ;
2964+ }
2965+
2966+ getAccruedInterest (
2967+ params ?: AccruedInterestRequest
2968+ ) : Promise < AccruedInterestItem [ ] > {
2969+ return this . getPrivate (
2970+ '/api/v5/finance/flexible-loan/interest-accrued' ,
2971+ params
2972+ ) ;
2973+ }
2974+
28892975 /**
28902976 *
28912977 * Affiliate endpoints
0 commit comments