@@ -35,6 +35,7 @@ import { FuturesPriceTriggeredOrder } from '../model/futuresPriceTriggeredOrder'
3535import { FuturesRiskLimitTier } from '../model/futuresRiskLimitTier' ;
3636import { FuturesTicker } from '../model/futuresTicker' ;
3737import { FuturesTrade } from '../model/futuresTrade' ;
38+ import { InlineObject } from '../model/inlineObject' ;
3839import { InsuranceRecord } from '../model/insuranceRecord' ;
3940import { MyFuturesTrade } from '../model/myFuturesTrade' ;
4041import { MyFuturesTradeTimeRange } from '../model/myFuturesTradeTimeRange' ;
@@ -309,7 +310,12 @@ export class FuturesApi {
309310 public async listFuturesCandlesticks (
310311 settle : 'btc' | 'usdt' ,
311312 contract : string ,
312- opts : { from ?: number ; to ?: number ; limit ?: number ; interval ?: string } ,
313+ opts : {
314+ from ?: number ;
315+ to ?: number ;
316+ limit ?: number ;
317+ interval ?: '10s' | '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '8h' | '1d' | '7d' ;
318+ } ,
313319 ) : Promise < { response : AxiosResponse ; body : Array < FuturesCandlestick > } > {
314320 const localVarPath =
315321 this . client . basePath +
@@ -350,7 +356,10 @@ export class FuturesApi {
350356 }
351357
352358 if ( opts . interval !== undefined ) {
353- localVarQueryParameters [ 'interval' ] = ObjectSerializer . serialize ( opts . interval , 'string' ) ;
359+ localVarQueryParameters [ 'interval' ] = ObjectSerializer . serialize (
360+ opts . interval ,
361+ "'10s' | '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '8h' | '1d' | '7d'" ,
362+ ) ;
354363 }
355364
356365 const config : AxiosRequestConfig = {
@@ -378,7 +387,12 @@ export class FuturesApi {
378387 public async listFuturesPremiumIndex (
379388 settle : 'btc' | 'usdt' ,
380389 contract : string ,
381- opts : { from ?: number ; to ?: number ; limit ?: number ; interval ?: string } ,
390+ opts : {
391+ from ?: number ;
392+ to ?: number ;
393+ limit ?: number ;
394+ interval ?: '10s' | '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '8h' | '1d' | '7d' ;
395+ } ,
382396 ) : Promise < { response : AxiosResponse ; body : Array < FuturesPremiumIndex > } > {
383397 const localVarPath =
384398 this . client . basePath +
@@ -419,7 +433,10 @@ export class FuturesApi {
419433 }
420434
421435 if ( opts . interval !== undefined ) {
422- localVarQueryParameters [ 'interval' ] = ObjectSerializer . serialize ( opts . interval , 'string' ) ;
436+ localVarQueryParameters [ 'interval' ] = ObjectSerializer . serialize (
437+ opts . interval ,
438+ "'10s' | '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '8h' | '1d' | '7d'" ,
439+ ) ;
423440 }
424441
425442 const config : AxiosRequestConfig = {
@@ -1192,6 +1209,58 @@ export class FuturesApi {
11921209 return this . client . request < Position > ( config , 'Position' , authSettings ) ;
11931210 }
11941211
1212+ /**
1213+ *
1214+ * @summary 双仓模式下切换全逐仓模式
1215+ * @param settle Settle currency.
1216+ * @param inlineObject
1217+ */
1218+ public async updateDualCompPositionCrossMode (
1219+ settle : 'btc' | 'usdt' ,
1220+ inlineObject : InlineObject ,
1221+ ) : Promise < { response : AxiosResponse ; body : Array < Position > } > {
1222+ const localVarPath =
1223+ this . client . basePath +
1224+ '/futures/{settle}/dual_comp/positions/cross_mode' . replace (
1225+ '{' + 'settle' + '}' ,
1226+ encodeURIComponent ( String ( settle ) ) ,
1227+ ) ;
1228+ let localVarQueryParameters : any = { } ;
1229+ let localVarHeaderParams : any = ( < any > Object ) . assign ( { } , this . client . defaultHeaders ) ;
1230+ const produces = [ 'application/json' ] ;
1231+ // give precedence to 'application/json'
1232+ if ( produces . indexOf ( 'application/json' ) >= 0 ) {
1233+ localVarHeaderParams . Accept = 'application/json' ;
1234+ } else {
1235+ localVarHeaderParams . Accept = produces . join ( ',' ) ;
1236+ }
1237+
1238+ // verify required parameter 'settle' is not null or undefined
1239+ if ( settle === null || settle === undefined ) {
1240+ throw new Error (
1241+ 'Required parameter settle was null or undefined when calling updateDualCompPositionCrossMode.' ,
1242+ ) ;
1243+ }
1244+
1245+ // verify required parameter 'inlineObject' is not null or undefined
1246+ if ( inlineObject === null || inlineObject === undefined ) {
1247+ throw new Error (
1248+ 'Required parameter inlineObject was null or undefined when calling updateDualCompPositionCrossMode.' ,
1249+ ) ;
1250+ }
1251+
1252+ const config : AxiosRequestConfig = {
1253+ method : 'POST' ,
1254+ params : localVarQueryParameters ,
1255+ headers : localVarHeaderParams ,
1256+ url : localVarPath ,
1257+ data : ObjectSerializer . serialize ( inlineObject , 'InlineObject' ) ,
1258+ } ;
1259+
1260+ const authSettings = [ 'apiv4' ] ;
1261+ return this . client . request < Array < Position > > ( config , 'Array<Position>' , authSettings ) ;
1262+ }
1263+
11951264 /**
11961265 *
11971266 * @summary Update position risk limit.
@@ -2238,11 +2307,14 @@ export class FuturesApi {
22382307 * @param opts Optional parameters
22392308 * @param opts.contract Futures contract, return related data only if specified.
22402309 * @param opts.limit Maximum number of records to be returned in a single list.
2310+ * @param opts.offset List offset, starting from 0.
2311+ * @param opts.from Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
2312+ * @param opts.to Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
22412313 * @param opts.at Specify a liquidation timestamp.
22422314 */
22432315 public async listLiquidates (
22442316 settle : 'btc' | 'usdt' ,
2245- opts : { contract ?: string ; limit ?: number ; at ?: number } ,
2317+ opts : { contract ?: string ; limit ?: number ; offset ?: number ; from ?: number ; to ?: number ; at ?: number } ,
22462318 ) : Promise < { response : AxiosResponse ; body : Array < FuturesLiquidate > } > {
22472319 const localVarPath =
22482320 this . client . basePath +
@@ -2271,6 +2343,18 @@ export class FuturesApi {
22712343 localVarQueryParameters [ 'limit' ] = ObjectSerializer . serialize ( opts . limit , 'number' ) ;
22722344 }
22732345
2346+ if ( opts . offset !== undefined ) {
2347+ localVarQueryParameters [ 'offset' ] = ObjectSerializer . serialize ( opts . offset , 'number' ) ;
2348+ }
2349+
2350+ if ( opts . from !== undefined ) {
2351+ localVarQueryParameters [ 'from' ] = ObjectSerializer . serialize ( opts . from , 'number' ) ;
2352+ }
2353+
2354+ if ( opts . to !== undefined ) {
2355+ localVarQueryParameters [ 'to' ] = ObjectSerializer . serialize ( opts . to , 'number' ) ;
2356+ }
2357+
22742358 if ( opts . at !== undefined ) {
22752359 localVarQueryParameters [ 'at' ] = ObjectSerializer . serialize ( opts . at , 'number' ) ;
22762360 }
@@ -2293,11 +2377,14 @@ export class FuturesApi {
22932377 * @param opts Optional parameters
22942378 * @param opts.contract Futures contract, return related data only if specified.
22952379 * @param opts.limit Maximum number of records to be returned in a single list.
2380+ * @param opts.offset List offset, starting from 0.
2381+ * @param opts.from Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
2382+ * @param opts.to Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
22962383 * @param opts.at Specify an auto-deleveraging timestamp.
22972384 */
22982385 public async listAutoDeleverages (
22992386 settle : 'btc' | 'usdt' ,
2300- opts : { contract ?: string ; limit ?: number ; at ?: number } ,
2387+ opts : { contract ?: string ; limit ?: number ; offset ?: number ; from ?: number ; to ?: number ; at ?: number } ,
23012388 ) : Promise < { response : AxiosResponse ; body : Array < FuturesAutoDeleverage > } > {
23022389 const localVarPath =
23032390 this . client . basePath +
@@ -2326,6 +2413,18 @@ export class FuturesApi {
23262413 localVarQueryParameters [ 'limit' ] = ObjectSerializer . serialize ( opts . limit , 'number' ) ;
23272414 }
23282415
2416+ if ( opts . offset !== undefined ) {
2417+ localVarQueryParameters [ 'offset' ] = ObjectSerializer . serialize ( opts . offset , 'number' ) ;
2418+ }
2419+
2420+ if ( opts . from !== undefined ) {
2421+ localVarQueryParameters [ 'from' ] = ObjectSerializer . serialize ( opts . from , 'number' ) ;
2422+ }
2423+
2424+ if ( opts . to !== undefined ) {
2425+ localVarQueryParameters [ 'to' ] = ObjectSerializer . serialize ( opts . to , 'number' ) ;
2426+ }
2427+
23292428 if ( opts . at !== undefined ) {
23302429 localVarQueryParameters [ 'at' ] = ObjectSerializer . serialize ( opts . at , 'number' ) ;
23312430 }
0 commit comments