Skip to content

Commit

Permalink
release 5.90.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Revil-BE committed Jan 23, 2025
1 parent 07604de commit 89f6001
Show file tree
Hide file tree
Showing 290 changed files with 13,200 additions and 2,412 deletions.
172 changes: 135 additions & 37 deletions README.md

Large diffs are not rendered by default.

97 changes: 91 additions & 6 deletions api/accountApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

/* tslint:disable:no-unused-locals */
import { AccountDetail } from '../model/accountDetail';
import { AccountRateLimit } from '../model/accountRateLimit';
import { InlineObject1 } from '../model/inlineObject1';
import { InlineResponse2001 } from '../model/inlineResponse2001';
import { StpGroup } from '../model/stpGroup';
import { StpGroupUser } from '../model/stpGroupUser';
import { ObjectSerializer } from '../model/models';
Expand Down Expand Up @@ -59,6 +62,33 @@ export class AccountApi {
return this.client.request<AccountDetail>(config, 'AccountDetail', authSettings);
}

/**
*
* @summary 获取用户成交比率限频信息
*/
public async getAccountRateLimit(): Promise<{ response: AxiosResponse; body: Array<AccountRateLimit> }> {
const localVarPath = this.client.basePath + '/account/rate_limit';
const localVarQueryParameters: any = {};
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}

const config: AxiosRequestConfig = {
method: 'GET',
params: localVarQueryParameters,
headers: localVarHeaderParams,
url: localVarPath,
};

const authSettings = ['apiv4'];
return this.client.request<Array<AccountRateLimit>>(config, 'Array<AccountRateLimit>', authSettings);
}

/**
* Retrieve the list of STP groups created by the main account user only
* @summary List STP Groups
Expand Down Expand Up @@ -211,11 +241,11 @@ export class AccountApi {
* - Only the main account that created this STP group is allowed to delete users from the STP user group - Deletion is limited to accounts under the current main account; cross-account deletion is not permitted
* @summary Delete the user in the STP group
* @param stpId STP Group ID
* @param requestBody User ID
* @param userId STP user ID, multiple can be separated by commas
*/
public async deleteSTPGroupUsers(
stpId: number,
requestBody: Array<number>,
userId: number,
): Promise<{ response: AxiosResponse; body: Array<StpGroupUser> }> {
const localVarPath =
this.client.basePath +
Expand All @@ -235,20 +265,75 @@ export class AccountApi {
throw new Error('Required parameter stpId was null or undefined when calling deleteSTPGroupUsers.');
}

// verify required parameter 'requestBody' is not null or undefined
if (requestBody === null || requestBody === undefined) {
throw new Error('Required parameter requestBody was null or undefined when calling deleteSTPGroupUsers.');
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling deleteSTPGroupUsers.');
}

localVarQueryParameters['user_id'] = ObjectSerializer.serialize(userId, 'number');

const config: AxiosRequestConfig = {
method: 'DELETE',
params: localVarQueryParameters,
headers: localVarHeaderParams,
url: localVarPath,
data: ObjectSerializer.serialize(requestBody, 'Array<number>'),
};

const authSettings = ['apiv4'];
return this.client.request<Array<StpGroupUser>>(config, 'Array<StpGroupUser>', authSettings);
}

/**
* 查询当前帐户的GT抵扣配置
* @summary 查询GT抵扣配置
*/
public async getDebitFee(): Promise<{ response: AxiosResponse; body: InlineResponse2001 }> {
const localVarPath = this.client.basePath + '/account/debit_fee';
const localVarQueryParameters: any = {};
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}

const config: AxiosRequestConfig = {
method: 'GET',
params: localVarQueryParameters,
headers: localVarHeaderParams,
url: localVarPath,
};

const authSettings = ['apiv4'];
return this.client.request<InlineResponse2001>(config, 'InlineResponse2001', authSettings);
}

/**
* 开启或关闭当前帐户的GT抵扣
* @summary 设定GT抵扣
* @param inlineObject1
*/
public async setDebitFee(inlineObject1: InlineObject1): Promise<{ response: AxiosResponse; body?: any }> {
const localVarPath = this.client.basePath + '/account/debit_fee';
const localVarQueryParameters: any = {};
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);

// verify required parameter 'inlineObject1' is not null or undefined
if (inlineObject1 === null || inlineObject1 === undefined) {
throw new Error('Required parameter inlineObject1 was null or undefined when calling setDebitFee.');
}

const config: AxiosRequestConfig = {
method: 'POST',
params: localVarQueryParameters,
headers: localVarHeaderParams,
url: localVarPath,
data: ObjectSerializer.serialize(inlineObject1, 'InlineObject1'),
};

const authSettings = ['apiv4'];
return this.client.request<any>(config, '', authSettings);
}
}
13 changes: 13 additions & 0 deletions api/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { Authentication, GateApiV4Auth, HttpBasicAuth, HttpBearerAuth, OAuth, ObjectSerializer } from '../model/models';

import JSONBig from 'json-bigint';
import globalAxios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';

export class ApiClient {
Expand All @@ -24,6 +26,17 @@ export class ApiClient {

constructor(basePath?: string, protected axiosInstance: AxiosInstance = globalAxios) {
this._basePath = basePath || this._basePath;

this.axiosInstance.defaults.transformResponse = [
(data) => {
try {
return JSONBig.parse(data);
} catch (error) {
console.error('Failed to parse JSON:', error);
return data;
}
},
];
}

set basePath(basePath: string) {
Expand Down
3 changes: 3 additions & 0 deletions api/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export * from './marginApi';
import { MarginApi } from './marginApi';
export * from './marginUniApi';
import { MarginUniApi } from './marginUniApi';
export * from './multiCollateralLoanApi';
import { MultiCollateralLoanApi } from './multiCollateralLoanApi';
export * from './optionsApi';
import { OptionsApi } from './optionsApi';
export * from './rebateApi';
Expand All @@ -42,6 +44,7 @@ export const APIS = [
FuturesApi,
MarginApi,
MarginUniApi,
MultiCollateralLoanApi,
OptionsApi,
RebateApi,
SpotApi,
Expand Down
56 changes: 56 additions & 0 deletions api/deliveryApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { DeliveryContract } from '../model/deliveryContract';
import { DeliverySettlement } from '../model/deliverySettlement';
import { FuturesAccount } from '../model/futuresAccount';
import { FuturesAccountBook } from '../model/futuresAccountBook';
import { FuturesLimitRiskTiers } from '../model/futuresLimitRiskTiers';
import { FuturesLiquidate } from '../model/futuresLiquidate';
import { FuturesOrder } from '../model/futuresOrder';
import { FuturesOrderBook } from '../model/futuresOrderBook';
Expand Down Expand Up @@ -1315,6 +1316,61 @@ export class DeliveryApi {
return this.client.request<Array<DeliverySettlement>>(config, 'Array<DeliverySettlement>', authSettings);
}

/**
* contract 参数不传,默认查询前 100 个市场的风险限额,limit 和 offset 对应市场维度的分页查询,不对应返回数组的长度,仅当 contract 参数为空时生效
* @summary List risk limit tiers
* @param settle Settle currency
* @param opts Optional parameters
* @param opts.contract Futures contract
* @param opts.limit Maximum number of records to be returned in a single list
* @param opts.offset List offset, starting from 0
*/
public async listDeliveryRiskLimitTiers(
settle: 'usdt',
opts: { contract?: string; limit?: number; offset?: number },
): Promise<{ response: AxiosResponse; body: Array<FuturesLimitRiskTiers> }> {
const localVarPath =
this.client.basePath +
'/delivery/{settle}/risk_limit_tiers'.replace('{' + 'settle' + '}', encodeURIComponent(String(settle)));
const localVarQueryParameters: any = {};
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}

// verify required parameter 'settle' is not null or undefined
if (settle === null || settle === undefined) {
throw new Error('Required parameter settle was null or undefined when calling listDeliveryRiskLimitTiers.');
}

opts = opts || {};
if (opts.contract !== undefined) {
localVarQueryParameters['contract'] = ObjectSerializer.serialize(opts.contract, 'string');
}

if (opts.limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(opts.limit, 'number');
}

if (opts.offset !== undefined) {
localVarQueryParameters['offset'] = ObjectSerializer.serialize(opts.offset, 'number');
}

const config: AxiosRequestConfig = {
method: 'GET',
params: localVarQueryParameters,
headers: localVarHeaderParams,
url: localVarPath,
};

const authSettings = [];
return this.client.request<Array<FuturesLimitRiskTiers>>(config, 'Array<FuturesLimitRiskTiers>', authSettings);
}

/**
*
* @summary List all auto orders
Expand Down
Loading

0 comments on commit 89f6001

Please sign in to comment.