Skip to content

Commit

Permalink
release 5.40.0
Browse files Browse the repository at this point in the history
  • Loading branch information
revilwang committed Mar 3, 2023
1 parent eed01d4 commit bcae564
Show file tree
Hide file tree
Showing 51 changed files with 1,538 additions and 69 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## gate-api@5.34.0
## gate-api@5.40.0

TypeScript NodeJS client for gate-api.

Expand All @@ -8,7 +8,7 @@ APIv4 provides spot, margin and futures trading operations. There are public API

This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 4.34.0
- API version: 4.40.0
- Package version:
- Build package: org.openapitools.codegen.languages.TypeScriptNodeClientCodegen
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
Expand Down Expand Up @@ -143,8 +143,10 @@ Class | Method | HTTP request | Description
*FuturesApi* | [**amendFuturesOrder**](docs/FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order
*FuturesApi* | [**cancelFuturesOrder**](docs/FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order
*FuturesApi* | [**getMyTrades**](docs/FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | List personal trading history
*FuturesApi* | [**getMyTradesWithTimeRange**](docs/FuturesApi.md#getMyTradesWithTimeRange) | **GET** /futures/{settle}/my_trades_timerange | List personal trading history by time range
*FuturesApi* | [**listPositionClose**](docs/FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history
*FuturesApi* | [**listLiquidates**](docs/FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | List liquidation history
*FuturesApi* | [**listAutoDeleverages**](docs/FuturesApi.md#listAutoDeleverages) | **GET** /futures/{settle}/auto_deleverages | List Auto-Deleveraging History
*FuturesApi* | [**countdownCancelAllFutures**](docs/FuturesApi.md#countdownCancelAllFutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders
*FuturesApi* | [**listPriceTriggeredOrders**](docs/FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/{settle}/price_orders | List all auto orders
*FuturesApi* | [**createPriceTriggeredOrder**](docs/FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order
Expand Down Expand Up @@ -180,7 +182,7 @@ Class | Method | HTTP request | Description
*MarginApi* | [**createCrossMarginLoan**](docs/MarginApi.md#createCrossMarginLoan) | **POST** /margin/cross/loans | Create a cross margin borrow loan
*MarginApi* | [**getCrossMarginLoan**](docs/MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail
*MarginApi* | [**listCrossMarginRepayments**](docs/MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments
*MarginApi* | [**repayCrossMarginLoan**](docs/MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first
*MarginApi* | [**repayCrossMarginLoan**](docs/MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Cross margin repayments
*MarginApi* | [**getCrossMarginTransferable**](docs/MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency
*MarginApi* | [**getCrossMarginBorrowable**](docs/MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency
*OptionsApi* | [**listOptionsUnderlyings**](docs/OptionsApi.md#listOptionsUnderlyings) | **GET** /options/underlyings | List all underlyings
Expand All @@ -207,15 +209,18 @@ Class | Method | HTTP request | Description
*OptionsApi* | [**getOptionsOrder**](docs/OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Get a single order
*OptionsApi* | [**cancelOptionsOrder**](docs/OptionsApi.md#cancelOptionsOrder) | **DELETE** /options/orders/{order_id} | Cancel a single order
*OptionsApi* | [**listMyOptionsTrades**](docs/OptionsApi.md#listMyOptionsTrades) | **GET** /options/my_trades | List personal trading history
*RebateApi* | [**agencyTransactionHistory**](docs/RebateApi.md#agencyTransactionHistory) | **GET** /rebate/agency/transaction_history | The broker obtains the transaction history of the recommended user
*RebateApi* | [**agencyCommissionsHistory**](docs/RebateApi.md#agencyCommissionsHistory) | **GET** /rebate/agency/commission_history | The broker obtains the commission history of the recommended user
*SpotApi* | [**listCurrencies**](docs/SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies\' details
*SpotApi* | [**getCurrency**](docs/SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency
*SpotApi* | [**listCurrencyPairs**](docs/SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported
*SpotApi* | [**getCurrencyPair**](docs/SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order
*SpotApi* | [**getCurrencyPair**](docs/SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair
*SpotApi* | [**listTickers**](docs/SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information
*SpotApi* | [**listOrderBook**](docs/SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book
*SpotApi* | [**listTrades**](docs/SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades
*SpotApi* | [**listCandlesticks**](docs/SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks
*SpotApi* | [**getFee**](docs/SpotApi.md#getFee) | **GET** /spot/fee | Query user trading fee rates
*SpotApi* | [**getBatchSpotFee**](docs/SpotApi.md#getBatchSpotFee) | **GET** /spot/batch_fee | Query a batch of user trading fee rates
*SpotApi* | [**listSpotAccounts**](docs/SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts
*SpotApi* | [**createBatchOrders**](docs/SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Create a batch of orders
*SpotApi* | [**listAllOpenOrders**](docs/SpotApi.md#listAllOpenOrders) | **GET** /spot/open_orders | List all open orders
Expand All @@ -226,6 +231,7 @@ Class | Method | HTTP request | Description
*SpotApi* | [**cancelBatchOrders**](docs/SpotApi.md#cancelBatchOrders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list
*SpotApi* | [**getOrder**](docs/SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Get a single order
*SpotApi* | [**cancelOrder**](docs/SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order
*SpotApi* | [**amendOrder**](docs/SpotApi.md#amendOrder) | **PATCH** /spot/orders/{order_id} | Amend an order
*SpotApi* | [**listMyTrades**](docs/SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history
*SpotApi* | [**getSystemTime**](docs/SpotApi.md#getSystemTime) | **GET** /spot/time | Get server current time
*SpotApi* | [**countdownCancelAllSpot**](docs/SpotApi.md#countdownCancelAllSpot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders
Expand Down Expand Up @@ -267,6 +273,10 @@ Class | Method | HTTP request | Description
## Documentation for Models

- [AccountBalance](docs/AccountBalance.md)
- [AgencyCommission](docs/AgencyCommission.md)
- [AgencyCommissionHistory](docs/AgencyCommissionHistory.md)
- [AgencyTransaction](docs/AgencyTransaction.md)
- [AgencyTransactionHistory](docs/AgencyTransactionHistory.md)
- [ApiV4KeyPerm](docs/ApiV4KeyPerm.md)
- [AutoRepaySetting](docs/AutoRepaySetting.md)
- [BatchFuturesOrder](docs/BatchFuturesOrder.md)
Expand Down Expand Up @@ -302,6 +312,7 @@ Class | Method | HTTP request | Description
- [FuturesAccount](docs/FuturesAccount.md)
- [FuturesAccountBook](docs/FuturesAccountBook.md)
- [FuturesAccountHistory](docs/FuturesAccountHistory.md)
- [FuturesAutoDeleverage](docs/FuturesAutoDeleverage.md)
- [FuturesCandlestick](docs/FuturesCandlestick.md)
- [FuturesIndexConstituents](docs/FuturesIndexConstituents.md)
- [FuturesInitialOrder](docs/FuturesInitialOrder.md)
Expand Down Expand Up @@ -347,13 +358,15 @@ Class | Method | HTTP request | Description
- [OptionsUnderlyingTicker](docs/OptionsUnderlyingTicker.md)
- [Order](docs/Order.md)
- [OrderBook](docs/OrderBook.md)
- [OrderPatch](docs/OrderPatch.md)
- [Position](docs/Position.md)
- [PositionClose](docs/PositionClose.md)
- [PositionCloseOrder](docs/PositionCloseOrder.md)
- [RepayRequest](docs/RepayRequest.md)
- [Repayment](docs/Repayment.md)
- [SavedAddress](docs/SavedAddress.md)
- [SpotAccount](docs/SpotAccount.md)
- [SpotFee](docs/SpotFee.md)
- [SpotPricePutOrder](docs/SpotPricePutOrder.md)
- [SpotPriceTrigger](docs/SpotPriceTrigger.md)
- [SpotPriceTriggeredOrder](docs/SpotPriceTriggeredOrder.md)
Expand Down
3 changes: 3 additions & 0 deletions api/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export * from './marginApi';
import { MarginApi } from './marginApi';
export * from './optionsApi';
import { OptionsApi } from './optionsApi';
export * from './rebateApi';
import { RebateApi } from './rebateApi';
export * from './spotApi';
import { SpotApi } from './spotApi';
export * from './subAccountApi';
Expand All @@ -24,6 +26,7 @@ export const APIS = [
FuturesApi,
MarginApi,
OptionsApi,
RebateApi,
SpotApi,
SubAccountApi,
WalletApi,
Expand Down
121 changes: 121 additions & 0 deletions api/futuresApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CountdownCancelAllFuturesTask } from '../model/countdownCancelAllFuture
import { FundingRateRecord } from '../model/fundingRateRecord';
import { FuturesAccount } from '../model/futuresAccount';
import { FuturesAccountBook } from '../model/futuresAccountBook';
import { FuturesAutoDeleverage } from '../model/futuresAutoDeleverage';
import { FuturesCandlestick } from '../model/futuresCandlestick';
import { FuturesIndexConstituents } from '../model/futuresIndexConstituents';
import { FuturesLiquidate } from '../model/futuresLiquidate';
Expand Down Expand Up @@ -1857,6 +1858,71 @@ export class FuturesApi {
return this.client.request<Array<MyFuturesTrade>>(config, 'Array<MyFuturesTrade>', authSettings);
}

/**
*
* @summary List personal trading history by time range
* @param settle Settle currency
* @param opts Optional parameters
* @param opts.contract Futures contract, return related data only if specified
* @param opts.from Start timestamp
* @param opts.to End timestamp
* @param opts.limit Maximum number of records to be returned in a single list
* @param opts.offset List offset, starting from 0
*/
public async getMyTradesWithTimeRange(
settle: 'btc' | 'usdt' | 'usd',
opts: { contract?: string; from?: number; to?: number; limit?: number; offset?: number },
): Promise<{ response: AxiosResponse; body: Array<MyFuturesTrade> }> {
const localVarPath =
this.client.basePath +
'/futures/{settle}/my_trades_timerange'.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 getMyTradesWithTimeRange.');
}

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

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

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

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 = ['apiv4'];
return this.client.request<Array<MyFuturesTrade>>(config, 'Array<MyFuturesTrade>', authSettings);
}

/**
*
* @summary List position close history
Expand Down Expand Up @@ -1977,6 +2043,61 @@ export class FuturesApi {
return this.client.request<Array<FuturesLiquidate>>(config, 'Array<FuturesLiquidate>', authSettings);
}

/**
*
* @summary List Auto-Deleveraging History
* @param settle Settle currency
* @param opts Optional parameters
* @param opts.contract Futures contract, return related data only if specified
* @param opts.limit Maximum number of records to be returned in a single list
* @param opts.at Specify an auto-deleveraging timestamp
*/
public async listAutoDeleverages(
settle: 'btc' | 'usdt' | 'usd',
opts: { contract?: string; limit?: number; at?: number },
): Promise<{ response: AxiosResponse; body: Array<FuturesAutoDeleverage> }> {
const localVarPath =
this.client.basePath +
'/futures/{settle}/auto_deleverages'.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 listAutoDeleverages.');
}

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.at !== undefined) {
localVarQueryParameters['at'] = ObjectSerializer.serialize(opts.at, 'number');
}

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

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

/**
* When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled.
* @summary Countdown cancel orders
Expand Down
4 changes: 2 additions & 2 deletions api/marginApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1325,8 +1325,8 @@ export class MarginApi {
}

/**
*
* @summary When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first
* When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first
* @summary Cross margin repayments
* @param crossMarginRepayRequest
*/
public async repayCrossMarginLoan(
Expand Down
Loading

0 comments on commit bcae564

Please sign in to comment.