From bcae564eb8f2c9ed08d8bf03564e13343cee9e2d Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 3 Mar 2023 12:22:29 +0800 Subject: [PATCH] release 5.40.0 --- README.md | 21 +++- api/apis.ts | 3 + api/futuresApi.ts | 121 +++++++++++++++++++++ api/marginApi.ts | 4 +- api/rebateApi.ts | 173 ++++++++++++++++++++++++++++++ api/spotApi.ts | 103 +++++++++++++++++- docs/AgencyCommission.md | 13 +++ docs/AgencyCommissionHistory.md | 10 ++ docs/AgencyTransaction.md | 16 +++ docs/AgencyTransactionHistory.md | 10 ++ docs/BatchOrder.md | 6 +- docs/Contract.md | 2 + docs/CrossMarginAccount.md | 1 + docs/CrossMarginAccountBook.md | 4 +- docs/CrossMarginCurrency.md | 2 +- docs/FundingBookItem.md | 2 +- docs/FuturesAccount.md | 2 +- docs/FuturesApi.md | 108 +++++++++++++++++++ docs/FuturesAutoDeleverage.md | 17 +++ docs/FuturesCandlestick.md | 1 + docs/LedgerRecord.md | 1 + docs/Loan.md | 2 +- docs/MarginApi.md | 4 +- docs/Order.md | 7 +- docs/OrderPatch.md | 9 ++ docs/RebateApi.md | 123 +++++++++++++++++++++ docs/SpotApi.md | 102 +++++++++++++++++- docs/SpotFee.md | 16 +++ docs/SubAccount.md | 1 + model/agencyCommission.ts | 76 +++++++++++++ model/agencyCommissionHistory.ts | 51 +++++++++ model/agencyTransaction.ts | 103 ++++++++++++++++++ model/agencyTransactionHistory.ts | 51 +++++++++ model/batchOrder.ts | 5 +- model/contract.ts | 18 ++++ model/crossMarginAccount.ts | 9 ++ model/crossMarginAccountBook.ts | 3 +- model/crossMarginCurrency.ts | 2 +- model/fundingBookItem.ts | 2 +- model/futuresAccount.ts | 2 +- model/futuresAutoDeleverage.ts | 112 +++++++++++++++++++ model/futuresCandlestick.ts | 9 ++ model/ledgerRecord.ts | 9 ++ model/loan.ts | 2 +- model/models.ts | 21 ++++ model/order.ts | 15 ++- model/orderPatch.ts | 43 ++++++++ model/spotFee.ts | 103 ++++++++++++++++++ model/subAccount.ts | 9 ++ package-lock.json | 76 ++++++------- package.json | 2 +- 51 files changed, 1538 insertions(+), 69 deletions(-) create mode 100644 api/rebateApi.ts create mode 100644 docs/AgencyCommission.md create mode 100644 docs/AgencyCommissionHistory.md create mode 100644 docs/AgencyTransaction.md create mode 100644 docs/AgencyTransactionHistory.md create mode 100644 docs/FuturesAutoDeleverage.md create mode 100644 docs/OrderPatch.md create mode 100644 docs/RebateApi.md create mode 100644 docs/SpotFee.md create mode 100644 model/agencyCommission.ts create mode 100644 model/agencyCommissionHistory.ts create mode 100644 model/agencyTransaction.ts create mode 100644 model/agencyTransactionHistory.ts create mode 100644 model/futuresAutoDeleverage.ts create mode 100644 model/orderPatch.ts create mode 100644 model/spotFee.ts diff --git a/README.md b/README.md index e908e36..6f6bdcf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## gate-api@5.34.0 +## gate-api@5.40.0 TypeScript NodeJS client for gate-api. @@ -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) @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) @@ -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) @@ -347,6 +358,7 @@ 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) @@ -354,6 +366,7 @@ Class | Method | HTTP request | Description - [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) diff --git a/api/apis.ts b/api/apis.ts index 6502c2a..a591c44 100644 --- a/api/apis.ts +++ b/api/apis.ts @@ -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'; @@ -24,6 +26,7 @@ export const APIS = [ FuturesApi, MarginApi, OptionsApi, + RebateApi, SpotApi, SubAccountApi, WalletApi, diff --git a/api/futuresApi.ts b/api/futuresApi.ts index 57678dd..0ab98c0 100644 --- a/api/futuresApi.ts +++ b/api/futuresApi.ts @@ -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'; @@ -1857,6 +1858,71 @@ export class FuturesApi { return this.client.request>(config, 'Array', 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 }> { + const localVarPath = + this.client.basePath + + '/futures/{settle}/my_trades_timerange'.replace('{' + 'settle' + '}', encodeURIComponent(String(settle))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: 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>(config, 'Array', authSettings); + } + /** * * @summary List position close history @@ -1977,6 +2043,61 @@ export class FuturesApi { return this.client.request>(config, 'Array', 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 }> { + const localVarPath = + this.client.basePath + + '/futures/{settle}/auto_deleverages'.replace('{' + 'settle' + '}', encodeURIComponent(String(settle))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: 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>(config, 'Array', 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 diff --git a/api/marginApi.ts b/api/marginApi.ts index dc345b3..aa0a901 100644 --- a/api/marginApi.ts +++ b/api/marginApi.ts @@ -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( diff --git a/api/rebateApi.ts b/api/rebateApi.ts new file mode 100644 index 0000000..7449349 --- /dev/null +++ b/api/rebateApi.ts @@ -0,0 +1,173 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* tslint:disable:no-unused-locals */ +import { AgencyCommissionHistory } from '../model/agencyCommissionHistory'; +import { AgencyTransactionHistory } from '../model/agencyTransactionHistory'; +import { ObjectSerializer } from '../model/models'; +import { ApiClient } from './apiClient'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export class RebateApi { + protected client: ApiClient; + + constructor(client?: ApiClient) { + if (client) { + this.client = client; + } else { + this.client = new ApiClient(); + } + } + + /** + * Record time range cannot exceed 30 days + * @summary The broker obtains the transaction history of the recommended user + * @param opts Optional parameters + * @param opts.currencyPair Specify the currency pair, if not specified, return all currency pairs + * @param opts.userId User ID. If not specified, all user records will be returned + * @param opts.from Time range beginning, default to 7 days before current time + * @param opts.to Time range ending, default to current time + * @param opts.limit Maximum number of records to be returned in a single list + * @param opts.offset List offset, starting from 0 + */ + public async agencyTransactionHistory(opts: { + currencyPair?: string; + userId?: string; + from?: number; + to?: number; + limit?: number; + offset?: number; + }): Promise<{ response: AxiosResponse; body: Array }> { + const localVarPath = this.client.basePath + '/rebate/agency/transaction_history'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: 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(','); + } + + opts = opts || {}; + if (opts.currencyPair !== undefined) { + localVarQueryParameters['currency_pair'] = ObjectSerializer.serialize(opts.currencyPair, 'string'); + } + + if (opts.userId !== undefined) { + localVarQueryParameters['user_id'] = ObjectSerializer.serialize(opts.userId, '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>( + config, + 'Array', + authSettings, + ); + } + + /** + * Record time range cannot exceed 30 days + * @summary The broker obtains the commission history of the recommended user + * @param opts Optional parameters + * @param opts.currency Filter by currency. Return all currency records if not specified + * @param opts.userId User ID. If not specified, all user records will be returned + * @param opts.from Time range beginning, default to 7 days before current time + * @param opts.to Time range ending, default to current time + * @param opts.limit Maximum number of records to be returned in a single list + * @param opts.offset List offset, starting from 0 + */ + public async agencyCommissionsHistory(opts: { + currency?: string; + userId?: string; + from?: number; + to?: number; + limit?: number; + offset?: number; + }): Promise<{ response: AxiosResponse; body: Array }> { + const localVarPath = this.client.basePath + '/rebate/agency/commission_history'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: 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(','); + } + + opts = opts || {}; + if (opts.currency !== undefined) { + localVarQueryParameters['currency'] = ObjectSerializer.serialize(opts.currency, 'string'); + } + + if (opts.userId !== undefined) { + localVarQueryParameters['user_id'] = ObjectSerializer.serialize(opts.userId, '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>( + config, + 'Array', + authSettings, + ); + } +} diff --git a/api/spotApi.ts b/api/spotApi.ts index 6fc9aec..3dd85a8 100644 --- a/api/spotApi.ts +++ b/api/spotApi.ts @@ -20,7 +20,9 @@ import { LiquidateOrder } from '../model/liquidateOrder'; import { OpenOrders } from '../model/openOrders'; import { Order } from '../model/order'; import { OrderBook } from '../model/orderBook'; +import { OrderPatch } from '../model/orderPatch'; import { SpotAccount } from '../model/spotAccount'; +import { SpotFee } from '../model/spotFee'; import { SpotPriceTriggeredOrder } from '../model/spotPriceTriggeredOrder'; import { SystemTime } from '../model/systemTime'; import { Ticker } from '../model/ticker'; @@ -138,7 +140,7 @@ export class SpotApi { /** * - * @summary Get details of a specifc order + * @summary Get details of a specifc currency pair * @param currencyPair Currency pair */ public async getCurrencyPair(currencyPair: string): Promise<{ response: AxiosResponse; body: CurrencyPair }> { @@ -443,6 +445,43 @@ export class SpotApi { return this.client.request(config, 'TradeFee', authSettings); } + /** + * + * @summary Query a batch of user trading fee rates + * @param currencyPairs A request can only query up to 50 currency pairs + */ + public async getBatchSpotFee( + currencyPairs: string, + ): Promise<{ response: AxiosResponse; body: { [key: string]: SpotFee } }> { + const localVarPath = this.client.basePath + '/spot/batch_fee'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: 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 'currencyPairs' is not null or undefined + if (currencyPairs === null || currencyPairs === undefined) { + throw new Error('Required parameter currencyPairs was null or undefined when calling getBatchSpotFee.'); + } + + localVarQueryParameters['currency_pairs'] = ObjectSerializer.serialize(currencyPairs, 'string'); + + const config: AxiosRequestConfig = { + method: 'GET', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request<{ [key: string]: SpotFee }>(config, '{ [key: string]: SpotFee; }', authSettings); + } + /** * * @summary List spot accounts @@ -909,6 +948,68 @@ export class SpotApi { return this.client.request(config, 'Order', authSettings); } + /** + * By default, the orders of spot and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: only modifying the amount does not affect the priority. If the price is modified, the priority will be adjusted to the last of the new price. Note: If the modified amount is less than the fill amount, the order will be cancelled. + * @summary Amend an order + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. + * @param currencyPair Currency pair + * @param orderPatch + * @param opts Optional parameters + * @param opts.account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only + */ + public async amendOrder( + orderId: string, + currencyPair: string, + orderPatch: OrderPatch, + opts: { account?: string }, + ): Promise<{ response: AxiosResponse; body: Order }> { + const localVarPath = + this.client.basePath + + '/spot/orders/{order_id}'.replace('{' + 'order_id' + '}', encodeURIComponent(String(orderId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: 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 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling amendOrder.'); + } + + // verify required parameter 'currencyPair' is not null or undefined + if (currencyPair === null || currencyPair === undefined) { + throw new Error('Required parameter currencyPair was null or undefined when calling amendOrder.'); + } + + // verify required parameter 'orderPatch' is not null or undefined + if (orderPatch === null || orderPatch === undefined) { + throw new Error('Required parameter orderPatch was null or undefined when calling amendOrder.'); + } + + opts = opts || {}; + localVarQueryParameters['currency_pair'] = ObjectSerializer.serialize(currencyPair, 'string'); + + if (opts.account !== undefined) { + localVarQueryParameters['account'] = ObjectSerializer.serialize(opts.account, 'string'); + } + + const config: AxiosRequestConfig = { + method: 'PATCH', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(orderPatch, 'OrderPatch'), + }; + + const authSettings = ['apiv4']; + return this.client.request(config, 'Order', authSettings); + } + /** * Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range. If you don\'t specify `from` and/or `to` parameters, only the last 7 days of data will be retured. The range of `from` and `to` is not alloed to exceed 30 days. Time range parameters are handled as order finish time. * @summary List personal trading history diff --git a/docs/AgencyCommission.md b/docs/AgencyCommission.md new file mode 100644 index 0000000..b1532cb --- /dev/null +++ b/docs/AgencyCommission.md @@ -0,0 +1,13 @@ +# AgencyCommission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commissionTime** | **number** | Commission Time. (unix timestamp) | [optional] [default to undefined] +**userId** | **number** | User ID | [optional] [default to undefined] +**groupName** | **string** | Group name | [optional] [default to undefined] +**commissionAmount** | **string** | Commission Amount | [optional] [default to undefined] +**commissionAsset** | **string** | Commission Asset | [optional] [default to undefined] +**source** | **string** | Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate | [optional] [default to undefined] + diff --git a/docs/AgencyCommissionHistory.md b/docs/AgencyCommissionHistory.md new file mode 100644 index 0000000..2a671d8 --- /dev/null +++ b/docs/AgencyCommissionHistory.md @@ -0,0 +1,10 @@ +# AgencyCommissionHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currencyPair** | **string** | Currency pair | [optional] [default to undefined] +**total** | **number** | Total | [optional] [default to undefined] +**list** | [**Array<AgencyCommission>**](AgencyCommission.md) | List of comission history | [optional] [default to undefined] + diff --git a/docs/AgencyTransaction.md b/docs/AgencyTransaction.md new file mode 100644 index 0000000..2045a21 --- /dev/null +++ b/docs/AgencyTransaction.md @@ -0,0 +1,16 @@ +# AgencyTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactionTime** | **number** | Transaction Time. (unix timestamp) | [optional] [default to undefined] +**userId** | **number** | User ID | [optional] [default to undefined] +**groupName** | **string** | Group name | [optional] [default to undefined] +**fee** | **string** | Fee | [optional] [default to undefined] +**feeAsset** | **string** | Fee currency | [optional] [default to undefined] +**currencyPair** | **string** | Currency pair | [optional] [default to undefined] +**amount** | **string** | Commission Amount | [optional] [default to undefined] +**amountAsset** | **string** | Commission Asset | [optional] [default to undefined] +**source** | **string** | Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate | [optional] [default to undefined] + diff --git a/docs/AgencyTransactionHistory.md b/docs/AgencyTransactionHistory.md new file mode 100644 index 0000000..b9e3acc --- /dev/null +++ b/docs/AgencyTransactionHistory.md @@ -0,0 +1,10 @@ +# AgencyTransactionHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currencyPair** | **string** | Currency pair | [optional] [default to undefined] +**total** | **number** | Total | [optional] [default to undefined] +**list** | [**Array<AgencyTransaction>**](AgencyTransaction.md) | List of transaction history | [optional] [default to undefined] + diff --git a/docs/BatchOrder.md b/docs/BatchOrder.md index f8f0a95..fe03b47 100644 --- a/docs/BatchOrder.md +++ b/docs/BatchOrder.md @@ -15,13 +15,13 @@ Name | Type | Description | Notes **updateTimeMs** | **number** | Last modification time of order (in milliseconds) | [optional] [readonly] [default to undefined] **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] [default to undefined] **currencyPair** | **string** | Currency pair | [optional] [default to undefined] -**type** | **string** | Order type. limit - limit order | [optional] [default to 'limit'] +**type** | **string** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **string** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional] [default to 'spot'] **side** | **string** | Order side | [optional] [default to undefined] **amount** | **string** | Trade amount | [optional] [default to undefined] **price** | **string** | Order price | [optional] [default to undefined] **timeInForce** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] -**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] [default to undefined] +**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. | [optional] [default to undefined] **autoBorrow** | **boolean** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] [default to undefined] **autoRepay** | **boolean** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] [default to undefined] **left** | **string** | Amount left to fill | [optional] [readonly] [default to undefined] @@ -48,6 +48,8 @@ Name | Type | Description | Notes * `Limit` (value: `'limit'`) +* `Market` (value: `'market'`) + ## Enum: BatchOrder.Account diff --git a/docs/Contract.md b/docs/Contract.md index 717e9c9..226554d 100644 --- a/docs/Contract.md +++ b/docs/Contract.md @@ -36,6 +36,8 @@ Name | Type | Description | Notes **configChangeTime** | **number** | Last changed time of configuration | [optional] [default to undefined] **inDelisting** | **boolean** | Contract is delisting | [optional] [default to undefined] **ordersLimit** | **number** | Maximum number of open orders | [optional] [default to undefined] +**enableBonus** | **boolean** | Whether bouns is enabled | [optional] [default to undefined] +**enableCredit** | **boolean** | Whether portfolio margin account is enabled | [optional] [default to undefined] ## Enum: Contract.Type diff --git a/docs/CrossMarginAccount.md b/docs/CrossMarginAccount.md index 382502d..05366ff 100644 --- a/docs/CrossMarginAccount.md +++ b/docs/CrossMarginAccount.md @@ -17,4 +17,5 @@ Name | Type | Description | Notes **totalInitialMarginRate** | **string** | Total initial margin rate | [optional] [default to undefined] **totalMaintenanceMarginRate** | **string** | Total maintenance margin rate | [optional] [default to undefined] **totalAvailableMargin** | **string** | Total available margin | [optional] [default to undefined] +**portfolioMarginTotal** | **string** | Total amount of the portfolio margin account | [optional] [default to undefined] diff --git a/docs/CrossMarginAccountBook.md b/docs/CrossMarginAccountBook.md index dba41f6..67c01c4 100644 --- a/docs/CrossMarginAccountBook.md +++ b/docs/CrossMarginAccountBook.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **currency** | **string** | Currency changed | [optional] [default to undefined] **change** | **string** | Amount changed. Positive value means transferring in, while negative out | [optional] [default to undefined] **balance** | **string** | Balance after change | [optional] [default to undefined] -**type** | **string** | Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type | [optional] [default to undefined] +**type** | **string** | Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - interest: interest - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type | [optional] [default to undefined] ## Enum: CrossMarginAccountBook.Type @@ -21,6 +21,8 @@ Name | Type | Description | Notes * `Borrow` (value: `'borrow'`) +* `Interest` (value: `'interest'`) + * `NewOrder` (value: `'new_order'`) * `OrderFill` (value: `'order_fill'`) diff --git a/docs/CrossMarginCurrency.md b/docs/CrossMarginCurrency.md index dbc2994..fa17899 100644 --- a/docs/CrossMarginCurrency.md +++ b/docs/CrossMarginCurrency.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Currency name | [optional] [default to undefined] -**rate** | **string** | Loan rate | [optional] [default to undefined] +**rate** | **string** | Minimum lending rate (hourly rate) | [optional] [default to undefined] **prec** | **string** | Currency precision | [optional] [default to undefined] **discount** | **string** | Currency value discount, which is used in total value calculation | [optional] [default to undefined] **minBorrowAmount** | **string** | Minimum currency borrow amount. Unit is currency itself | [optional] [default to undefined] diff --git a/docs/FundingBookItem.md b/docs/FundingBookItem.md index e2072a7..445461b 100644 --- a/docs/FundingBookItem.md +++ b/docs/FundingBookItem.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**rate** | **string** | Loan rate | [optional] [default to undefined] +**rate** | **string** | Loan rate (daily rate) | [optional] [default to undefined] **amount** | **string** | Borrowable amount | [optional] [default to undefined] **days** | **number** | The number of days till the loan repayment\'s dateline | [optional] [default to undefined] diff --git a/docs/FuturesAccount.md b/docs/FuturesAccount.md index cd09d1c..b708a17 100644 --- a/docs/FuturesAccount.md +++ b/docs/FuturesAccount.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **unrealisedPnl** | **string** | Unrealized PNL | [optional] [default to undefined] **positionMargin** | **string** | Position margin | [optional] [default to undefined] **orderMargin** | **string** | Order margin of unfinished orders | [optional] [default to undefined] -**available** | **string** | The available balance for transferring or trading | [optional] [default to undefined] +**available** | **string** | The available balance for transferring or trading(including bonus. Bonus can\'t be be withdrawn. The transfer amount needs to deduct the bonus) | [optional] [default to undefined] **point** | **string** | POINT amount | [optional] [default to undefined] **currency** | **string** | Settle currency | [optional] [default to undefined] **inDualMode** | **boolean** | Whether dual mode is enabled | [optional] [default to undefined] diff --git a/docs/FuturesApi.md b/docs/FuturesApi.md index 3c88dfd..284a81e 100644 --- a/docs/FuturesApi.md +++ b/docs/FuturesApi.md @@ -36,8 +36,10 @@ Method | HTTP request | Description [**amendFuturesOrder**](FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order [**cancelFuturesOrder**](FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order [**getMyTrades**](FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | List personal trading history +[**getMyTradesWithTimeRange**](FuturesApi.md#getMyTradesWithTimeRange) | **GET** /futures/{settle}/my_trades_timerange | List personal trading history by time range [**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history [**listLiquidates**](FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | List liquidation history +[**listAutoDeleverages**](FuturesApi.md#listAutoDeleverages) | **GET** /futures/{settle}/auto_deleverages | List Auto-Deleveraging History [**countdownCancelAllFutures**](FuturesApi.md#countdownCancelAllFutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders [**listPriceTriggeredOrders**](FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/{settle}/price_orders | List all auto orders [**createPriceTriggeredOrder**](FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order @@ -1596,6 +1598,61 @@ Promise<{ response: AxiosResponse; body: Array; }> [MyFuturesTra - **Content-Type**: Not defined - **Accept**: application/json +## getMyTradesWithTimeRange + +> Promise<{ response: http.IncomingMessage; body: Array; }> getMyTradesWithTimeRange(settle, opts) + +List personal trading history by time range + +### Example + +```typescript +const GateApi = require('gate-api'); +const client = new GateApi.ApiClient(); +// uncomment the next line to change base path +// client.basePath = "https://some-other-host" +// Configure Gate APIv4 key authentication: +client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); + +const api = new GateApi.FuturesApi(client); +const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const opts = { + 'contract': "BTC_USDT", // string | Futures contract, return related data only if specified + 'from': 1547706332, // number | Start timestamp + 'to': 1547706332, // number | End timestamp + 'limit': 100, // number | Maximum number of records to be returned in a single list + 'offset': 0 // number | List offset, starting from 0 +}; +api.getMyTradesWithTimeRange(settle, opts) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **Settle**| Settle currency | [default to undefined] + **contract** | **string**| Futures contract, return related data only if specified | [optional] [default to undefined] + **from** | **number**| Start timestamp | [optional] [default to undefined] + **to** | **number**| End timestamp | [optional] [default to undefined] + **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **number**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [MyFuturesTrade](MyFuturesTrade.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## listPositionClose > Promise<{ response: http.IncomingMessage; body: Array; }> listPositionClose(settle, opts) @@ -1702,6 +1759,57 @@ Promise<{ response: AxiosResponse; body: Array; }> [FuturesLiq - **Content-Type**: Not defined - **Accept**: application/json +## listAutoDeleverages + +> Promise<{ response: http.IncomingMessage; body: Array; }> listAutoDeleverages(settle, opts) + +List Auto-Deleveraging History + +### Example + +```typescript +const GateApi = require('gate-api'); +const client = new GateApi.ApiClient(); +// uncomment the next line to change base path +// client.basePath = "https://some-other-host" +// Configure Gate APIv4 key authentication: +client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); + +const api = new GateApi.FuturesApi(client); +const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const opts = { + 'contract': "BTC_USDT", // string | Futures contract, return related data only if specified + 'limit': 100, // number | Maximum number of records to be returned in a single list + 'at': 0 // number | Specify an auto-deleveraging timestamp +}; +api.listAutoDeleverages(settle, opts) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **Settle**| Settle currency | [default to undefined] + **contract** | **string**| Futures contract, return related data only if specified | [optional] [default to undefined] + **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **at** | **number**| Specify an auto-deleveraging timestamp | [optional] [default to 0] + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [FuturesAutoDeleverage](FuturesAutoDeleverage.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## countdownCancelAllFutures > Promise<{ response: http.IncomingMessage; body: TriggerTime; }> countdownCancelAllFutures(settle, countdownCancelAllFuturesTask) diff --git a/docs/FuturesAutoDeleverage.md b/docs/FuturesAutoDeleverage.md new file mode 100644 index 0000000..126d0bc --- /dev/null +++ b/docs/FuturesAutoDeleverage.md @@ -0,0 +1,17 @@ +# FuturesAutoDeleverage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **number** | Automatic deleveraging time | [optional] [readonly] [default to undefined] +**user** | **number** | User ID | [optional] [readonly] [default to undefined] +**orderId** | **number** | Order ID. Order IDs before 2023-02-20 are null | [optional] [readonly] [default to undefined] +**contract** | **string** | Futures contract | [optional] [readonly] [default to undefined] +**leverage** | **string** | Position leverage | [optional] [readonly] [default to undefined] +**crossLeverageLimit** | **string** | Cross margin leverage(valid only when `leverage` is 0) | [optional] [readonly] [default to undefined] +**entryPrice** | **string** | Average entry price | [optional] [readonly] [default to undefined] +**fillPrice** | **string** | Average fill price | [optional] [readonly] [default to undefined] +**tradeSize** | **number** | Trading size | [optional] [readonly] [default to undefined] +**positionSize** | **number** | Positions after auto-deleveraging | [optional] [readonly] [default to undefined] + diff --git a/docs/FuturesCandlestick.md b/docs/FuturesCandlestick.md index 2480dfa..40ad51d 100644 --- a/docs/FuturesCandlestick.md +++ b/docs/FuturesCandlestick.md @@ -10,4 +10,5 @@ Name | Type | Description | Notes **h** | **string** | Highest price (quote currency) | [optional] [default to undefined] **l** | **string** | Lowest price (quote currency) | [optional] [default to undefined] **o** | **string** | Open price (quote currency) | [optional] [default to undefined] +**sum** | **string** | Trading volume (unit: Quote currency) | [optional] [default to undefined] diff --git a/docs/LedgerRecord.md b/docs/LedgerRecord.md index 6c13eb0..49aca07 100644 --- a/docs/LedgerRecord.md +++ b/docs/LedgerRecord.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Record ID | [optional] [readonly] [default to undefined] **txid** | **string** | Hash record of the withdrawal | [optional] [readonly] [default to undefined] +**withdrawOrderId** | **string** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] [default to undefined] **timestamp** | **string** | Operation time | [optional] [readonly] [default to undefined] **amount** | **string** | Currency amount | [default to undefined] **currency** | **string** | Currency name | [default to undefined] diff --git a/docs/Loan.md b/docs/Loan.md index 334ef9b..3f239e5 100644 --- a/docs/Loan.md +++ b/docs/Loan.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **status** | **string** | Loan status open - not fully loaned loaned - all loaned out for lending loan; loaned in for borrowing side finished - loan is finished, either being all repaid or cancelled by the lender auto_repaid - automatically repaid by the system | [optional] [readonly] [default to undefined] **side** | **string** | Loan side | [default to undefined] **currency** | **string** | Loan currency | [default to undefined] -**rate** | **string** | Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional] [default to undefined] +**rate** | **string** | Loan rate. Only rates in [0.0001, 0.01] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional] [default to undefined] **amount** | **string** | Loan amount | [default to undefined] **days** | **number** | Loan days. Only 10 is supported for now | [optional] [default to undefined] **autoRenew** | **boolean** | Whether to auto renew the loan upon expiration | [optional] [default to undefined] diff --git a/docs/MarginApi.md b/docs/MarginApi.md index 10575bc..bbce7bc 100644 --- a/docs/MarginApi.md +++ b/docs/MarginApi.md @@ -33,7 +33,7 @@ Method | HTTP request | Description [**createCrossMarginLoan**](MarginApi.md#createCrossMarginLoan) | **POST** /margin/cross/loans | Create a cross margin borrow loan [**getCrossMarginLoan**](MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail [**listCrossMarginRepayments**](MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments -[**repayCrossMarginLoan**](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 +[**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Cross margin repayments [**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency [**getCrossMarginBorrowable**](MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency @@ -1373,6 +1373,8 @@ Promise<{ response: AxiosResponse; body: Array; }> [CrossM > Promise<{ response: http.IncomingMessage; body: Array; }> repayCrossMarginLoan(crossMarginRepayRequest) +Cross margin 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 ### Example diff --git a/docs/Order.md b/docs/Order.md index 262234f..6f3a106 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -5,25 +5,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Order ID | [optional] [readonly] [default to undefined] -**text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] [default to undefined] +**text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional] [default to undefined] **createTime** | **string** | Creation time of order | [optional] [readonly] [default to undefined] **updateTime** | **string** | Last modification time of order | [optional] [readonly] [default to undefined] **createTimeMs** | **number** | Creation time of order (in milliseconds) | [optional] [readonly] [default to undefined] **updateTimeMs** | **number** | Last modification time of order (in milliseconds) | [optional] [readonly] [default to undefined] **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] [default to undefined] **currencyPair** | **string** | Currency pair | [default to undefined] -**type** | **string** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] +**type** | **string** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **string** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account. Portfolio margin account must set to `cross-margin` | [optional] [default to 'spot'] **side** | **string** | Order side | [default to undefined] **amount** | **string** | When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` | [default to undefined] **price** | **string** | Price can\'t be empty when `type`= `limit` | [optional] [default to undefined] **timeInForce** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none Only `ioc` and `fok` are supported when `type`=`market` | [optional] [default to 'gtc'] -**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] [default to undefined] +**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. | [optional] [default to undefined] **autoBorrow** | **boolean** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] [default to undefined] **autoRepay** | **boolean** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] [default to undefined] **left** | **string** | Amount left to fill | [optional] [readonly] [default to undefined] **fillPrice** | **string** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly] [default to undefined] **filledTotal** | **string** | Total filled in quote currency | [optional] [readonly] [default to undefined] +**avgDealPrice** | **string** | Average fill price | [optional] [readonly] [default to undefined] **fee** | **string** | Fee deducted | [optional] [readonly] [default to undefined] **feeCurrency** | **string** | Fee currency unit | [optional] [readonly] [default to undefined] **pointFee** | **string** | Points used to deduct fee | [optional] [readonly] [default to undefined] diff --git a/docs/OrderPatch.md b/docs/OrderPatch.md new file mode 100644 index 0000000..70d2e64 --- /dev/null +++ b/docs/OrderPatch.md @@ -0,0 +1,9 @@ +# OrderPatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **string** | New order amount. `amount` and `price` must specify one of them | [optional] [default to undefined] +**price** | **string** | New order price. `amount` and `Price` must specify one of them\" | [optional] [default to undefined] + diff --git a/docs/RebateApi.md b/docs/RebateApi.md new file mode 100644 index 0000000..35a0c73 --- /dev/null +++ b/docs/RebateApi.md @@ -0,0 +1,123 @@ +# RebateApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**agencyTransactionHistory**](RebateApi.md#agencyTransactionHistory) | **GET** /rebate/agency/transaction_history | The broker obtains the transaction history of the recommended user +[**agencyCommissionsHistory**](RebateApi.md#agencyCommissionsHistory) | **GET** /rebate/agency/commission_history | The broker obtains the commission history of the recommended user + + +## agencyTransactionHistory + +> Promise<{ response: http.IncomingMessage; body: Array; }> agencyTransactionHistory(opts) + +The broker obtains the transaction history of the recommended user + +Record time range cannot exceed 30 days + +### Example + +```typescript +const GateApi = require('gate-api'); +const client = new GateApi.ApiClient(); +// uncomment the next line to change base path +// client.basePath = "https://some-other-host" +// Configure Gate APIv4 key authentication: +client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); + +const api = new GateApi.RebateApi(client); +const opts = { + 'currencyPair': "BTC_USDT", // string | Specify the currency pair, if not specified, return all currency pairs + 'userId': "10003", // string | User ID. If not specified, all user records will be returned + 'from': 1602120000, // number | Time range beginning, default to 7 days before current time + 'to': 1602123600, // number | Time range ending, default to current time + 'limit': 100, // number | Maximum number of records to be returned in a single list + 'offset': 0 // number | List offset, starting from 0 +}; +api.agencyTransactionHistory(opts) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currencyPair** | **string**| Specify the currency pair, if not specified, return all currency pairs | [optional] [default to undefined] + **userId** | **string**| User ID. If not specified, all user records will be returned | [optional] [default to undefined] + **from** | **number**| Time range beginning, default to 7 days before current time | [optional] [default to undefined] + **to** | **number**| Time range ending, default to current time | [optional] [default to undefined] + **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **number**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [AgencyTransactionHistory](AgencyTransactionHistory.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +## agencyCommissionsHistory + +> Promise<{ response: http.IncomingMessage; body: Array; }> agencyCommissionsHistory(opts) + +The broker obtains the commission history of the recommended user + +Record time range cannot exceed 30 days + +### Example + +```typescript +const GateApi = require('gate-api'); +const client = new GateApi.ApiClient(); +// uncomment the next line to change base path +// client.basePath = "https://some-other-host" +// Configure Gate APIv4 key authentication: +client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); + +const api = new GateApi.RebateApi(client); +const opts = { + 'currency': "BTC", // string | Filter by currency. Return all currency records if not specified + 'userId': "10003", // string | User ID. If not specified, all user records will be returned + 'from': 1602120000, // number | Time range beginning, default to 7 days before current time + 'to': 1602123600, // number | Time range ending, default to current time + 'limit': 100, // number | Maximum number of records to be returned in a single list + 'offset': 0 // number | List offset, starting from 0 +}; +api.agencyCommissionsHistory(opts) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Filter by currency. Return all currency records if not specified | [optional] [default to undefined] + **userId** | **string**| User ID. If not specified, all user records will be returned | [optional] [default to undefined] + **from** | **number**| Time range beginning, default to 7 days before current time | [optional] [default to undefined] + **to** | **number**| Time range ending, default to current time | [optional] [default to undefined] + **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **number**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [AgencyCommissionHistory](AgencyCommissionHistory.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json diff --git a/docs/SpotApi.md b/docs/SpotApi.md index 8a6c758..27a704d 100644 --- a/docs/SpotApi.md +++ b/docs/SpotApi.md @@ -7,12 +7,13 @@ Method | HTTP request | Description [**listCurrencies**](SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies\' details [**getCurrency**](SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency [**listCurrencyPairs**](SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported -[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order +[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair [**listTickers**](SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information [**listOrderBook**](SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book [**listTrades**](SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades [**listCandlesticks**](SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks [**getFee**](SpotApi.md#getFee) | **GET** /spot/fee | Query user trading fee rates +[**getBatchSpotFee**](SpotApi.md#getBatchSpotFee) | **GET** /spot/batch_fee | Query a batch of user trading fee rates [**listSpotAccounts**](SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts [**createBatchOrders**](SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Create a batch of orders [**listAllOpenOrders**](SpotApi.md#listAllOpenOrders) | **GET** /spot/open_orders | List all open orders @@ -23,6 +24,7 @@ Method | HTTP request | Description [**cancelBatchOrders**](SpotApi.md#cancelBatchOrders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list [**getOrder**](SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Get a single order [**cancelOrder**](SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order +[**amendOrder**](SpotApi.md#amendOrder) | **PATCH** /spot/orders/{order_id} | Amend an order [**listMyTrades**](SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history [**getSystemTime**](SpotApi.md#getSystemTime) | **GET** /spot/time | Get server current time [**countdownCancelAllSpot**](SpotApi.md#countdownCancelAllSpot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders @@ -154,7 +156,7 @@ No authorization required > Promise<{ response: http.IncomingMessage; body: CurrencyPair; }> getCurrencyPair(currencyPair) -Get details of a specifc order +Get details of a specifc currency pair ### Example @@ -446,6 +448,49 @@ Promise<{ response: AxiosResponse; body: TradeFee; }> [TradeFee](TradeFee.md) - **Content-Type**: Not defined - **Accept**: application/json +## getBatchSpotFee + +> Promise<{ response: http.IncomingMessage; body: { [key: string]: SpotFee; }; }> getBatchSpotFee(currencyPairs) + +Query a batch of user trading fee rates + +### Example + +```typescript +const GateApi = require('gate-api'); +const client = new GateApi.ApiClient(); +// uncomment the next line to change base path +// client.basePath = "https://some-other-host" +// Configure Gate APIv4 key authentication: +client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); + +const api = new GateApi.SpotApi(client); +const currencyPairs = "BTC_USDT,ETH_USDT"; // string | A request can only query up to 50 currency pairs +api.getBatchSpotFee(currencyPairs) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currencyPairs** | **string**| A request can only query up to 50 currency pairs | [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body: { [key: string]: SpotFee; }; }> [SpotFee](SpotFee.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## listSpotAccounts > Promise<{ response: http.IncomingMessage; body: Array; }> listSpotAccounts(opts) @@ -936,6 +981,59 @@ Promise<{ response: AxiosResponse; body: Order; }> [Order](Order.md) - **Content-Type**: Not defined - **Accept**: application/json +## amendOrder + +> Promise<{ response: http.IncomingMessage; body: Order; }> amendOrder(orderId, currencyPair, orderPatch, opts) + +Amend an order + +By default, the orders of spot and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: only modifying the amount does not affect the priority. If the price is modified, the priority will be adjusted to the last of the new price. Note: If the modified amount is less than the fill amount, the order will be cancelled. + +### Example + +```typescript +const GateApi = require('gate-api'); +const client = new GateApi.ApiClient(); +// uncomment the next line to change base path +// client.basePath = "https://some-other-host" +// Configure Gate APIv4 key authentication: +client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); + +const api = new GateApi.SpotApi(client); +const orderId = "12345"; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. +const currencyPair = "BTC_USDT"; // string | Currency pair +const orderPatch = new OrderPatch(); // OrderPatch | +const opts = { + 'account': "cross_margin" // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only +}; +api.amendOrder(orderId, currencyPair, orderPatch, opts) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. | [default to undefined] + **currencyPair** | **string**| Currency pair | [default to undefined] + **orderPatch** | [**OrderPatch**](OrderPatch.md)| | + **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body: Order; }> [Order](Order.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## listMyTrades > Promise<{ response: http.IncomingMessage; body: Array; }> listMyTrades(opts) diff --git a/docs/SpotFee.md b/docs/SpotFee.md new file mode 100644 index 0000000..9249d6b --- /dev/null +++ b/docs/SpotFee.md @@ -0,0 +1,16 @@ +# SpotFee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userId** | **number** | User ID | [optional] [default to undefined] +**takerFee** | **string** | taker fee rate | [optional] [default to undefined] +**makerFee** | **string** | maker fee rate | [optional] [default to undefined] +**gtDiscount** | **boolean** | If GT deduction is enabled | [optional] [default to undefined] +**gtTakerFee** | **string** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] [default to undefined] +**gtMakerFee** | **string** | Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] [default to undefined] +**loanFee** | **string** | Loan fee rate of margin lending | [optional] [default to undefined] +**pointType** | **string** | Point type. 0 - Initial version. 1 - new version since 202009 | [optional] [default to undefined] +**currencyPair** | **string** | Currency pair | [optional] [default to undefined] + diff --git a/docs/SubAccount.md b/docs/SubAccount.md index eb27ec5..d676c32 100644 --- a/docs/SubAccount.md +++ b/docs/SubAccount.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **password** | **string** | The sub-account\'s password. (Default: the same as main account\'s password) | [optional] [default to undefined] **email** | **string** | The sub-account\'s email address. (Default: the same as main account\'s email address) | [optional] [default to undefined] **state** | **number** | State: 1-normal, 2-locked\" | [optional] [readonly] [default to undefined] +**type** | **number** | Type: 1-Sub-account | [optional] [default to undefined] **userId** | **number** | The user id of the sub-account | [optional] [readonly] [default to undefined] **createTime** | **number** | Created time | [optional] [readonly] [default to undefined] diff --git a/model/agencyCommission.ts b/model/agencyCommission.ts new file mode 100644 index 0000000..580793e --- /dev/null +++ b/model/agencyCommission.ts @@ -0,0 +1,76 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class AgencyCommission { + /** + * Commission Time. (unix timestamp) + */ + 'commissionTime'?: number; + /** + * User ID + */ + 'userId'?: number; + /** + * Group name + */ + 'groupName'?: string; + /** + * Commission Amount + */ + 'commissionAmount'?: string; + /** + * Commission Asset + */ + 'commissionAsset'?: string; + /** + * Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate + */ + 'source'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'commissionTime', + baseName: 'commission_time', + type: 'number', + }, + { + name: 'userId', + baseName: 'user_id', + type: 'number', + }, + { + name: 'groupName', + baseName: 'group_name', + type: 'string', + }, + { + name: 'commissionAmount', + baseName: 'commission_amount', + type: 'string', + }, + { + name: 'commissionAsset', + baseName: 'commission_asset', + type: 'string', + }, + { + name: 'source', + baseName: 'source', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return AgencyCommission.attributeTypeMap; + } +} diff --git a/model/agencyCommissionHistory.ts b/model/agencyCommissionHistory.ts new file mode 100644 index 0000000..083d02b --- /dev/null +++ b/model/agencyCommissionHistory.ts @@ -0,0 +1,51 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AgencyCommission } from './agencyCommission'; + +export class AgencyCommissionHistory { + /** + * Currency pair + */ + 'currencyPair'?: string; + /** + * Total + */ + 'total'?: number; + /** + * List of comission history + */ + 'list'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'currencyPair', + baseName: 'currency_pair', + type: 'string', + }, + { + name: 'total', + baseName: 'total', + type: 'number', + }, + { + name: 'list', + baseName: 'list', + type: 'Array', + }, + ]; + + static getAttributeTypeMap() { + return AgencyCommissionHistory.attributeTypeMap; + } +} diff --git a/model/agencyTransaction.ts b/model/agencyTransaction.ts new file mode 100644 index 0000000..0feae31 --- /dev/null +++ b/model/agencyTransaction.ts @@ -0,0 +1,103 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class AgencyTransaction { + /** + * Transaction Time. (unix timestamp) + */ + 'transactionTime'?: number; + /** + * User ID + */ + 'userId'?: number; + /** + * Group name + */ + 'groupName'?: string; + /** + * Fee + */ + 'fee'?: string; + /** + * Fee currency + */ + 'feeAsset'?: string; + /** + * Currency pair + */ + 'currencyPair'?: string; + /** + * Commission Amount + */ + 'amount'?: string; + /** + * Commission Asset + */ + 'amountAsset'?: string; + /** + * Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate + */ + 'source'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'transactionTime', + baseName: 'transaction_time', + type: 'number', + }, + { + name: 'userId', + baseName: 'user_id', + type: 'number', + }, + { + name: 'groupName', + baseName: 'group_name', + type: 'string', + }, + { + name: 'fee', + baseName: 'fee', + type: 'string', + }, + { + name: 'feeAsset', + baseName: 'fee_asset', + type: 'string', + }, + { + name: 'currencyPair', + baseName: 'currency_pair', + type: 'string', + }, + { + name: 'amount', + baseName: 'amount', + type: 'string', + }, + { + name: 'amountAsset', + baseName: 'amount_asset', + type: 'string', + }, + { + name: 'source', + baseName: 'source', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return AgencyTransaction.attributeTypeMap; + } +} diff --git a/model/agencyTransactionHistory.ts b/model/agencyTransactionHistory.ts new file mode 100644 index 0000000..7de9370 --- /dev/null +++ b/model/agencyTransactionHistory.ts @@ -0,0 +1,51 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AgencyTransaction } from './agencyTransaction'; + +export class AgencyTransactionHistory { + /** + * Currency pair + */ + 'currencyPair'?: string; + /** + * Total + */ + 'total'?: number; + /** + * List of transaction history + */ + 'list'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'currencyPair', + baseName: 'currency_pair', + type: 'string', + }, + { + name: 'total', + baseName: 'total', + type: 'number', + }, + { + name: 'list', + baseName: 'list', + type: 'Array', + }, + ]; + + static getAttributeTypeMap() { + return AgencyTransactionHistory.attributeTypeMap; + } +} diff --git a/model/batchOrder.ts b/model/batchOrder.ts index 415c30d..719b9f5 100644 --- a/model/batchOrder.ts +++ b/model/batchOrder.ts @@ -58,7 +58,7 @@ export class BatchOrder { */ 'currencyPair'?: string; /** - * Order type. limit - limit order + * Order Type - limit : Limit Order - market : Market Order */ 'type'?: BatchOrder.Type; /** @@ -82,7 +82,7 @@ export class BatchOrder { */ 'timeInForce'?: BatchOrder.TimeInForce; /** - * Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely + * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. */ 'iceberg'?: string; /** @@ -302,6 +302,7 @@ export namespace BatchOrder { } export enum Type { Limit = 'limit', + Market = 'market', } export enum Account { Spot = 'spot', diff --git a/model/contract.ts b/model/contract.ts index c5907d6..29014bc 100644 --- a/model/contract.ts +++ b/model/contract.ts @@ -141,6 +141,14 @@ export class Contract { * Maximum number of open orders */ 'ordersLimit'?: number; + /** + * Whether bouns is enabled + */ + 'enableBonus'?: boolean; + /** + * Whether portfolio margin account is enabled + */ + 'enableCredit'?: boolean; static discriminator: string | undefined = undefined; @@ -305,6 +313,16 @@ export class Contract { baseName: 'orders_limit', type: 'number', }, + { + name: 'enableBonus', + baseName: 'enable_bonus', + type: 'boolean', + }, + { + name: 'enableCredit', + baseName: 'enable_credit', + type: 'boolean', + }, ]; static getAttributeTypeMap() { diff --git a/model/crossMarginAccount.ts b/model/crossMarginAccount.ts index a629e91..3f52106 100644 --- a/model/crossMarginAccount.ts +++ b/model/crossMarginAccount.ts @@ -61,6 +61,10 @@ export class CrossMarginAccount { * Total available margin */ 'totalAvailableMargin'?: string; + /** + * Total amount of the portfolio margin account + */ + 'portfolioMarginTotal'?: string; static discriminator: string | undefined = undefined; @@ -130,6 +134,11 @@ export class CrossMarginAccount { baseName: 'total_available_margin', type: 'string', }, + { + name: 'portfolioMarginTotal', + baseName: 'portfolio_margin_total', + type: 'string', + }, ]; static getAttributeTypeMap() { diff --git a/model/crossMarginAccountBook.ts b/model/crossMarginAccountBook.ts index 56e3283..01f9952 100644 --- a/model/crossMarginAccountBook.ts +++ b/model/crossMarginAccountBook.ts @@ -31,7 +31,7 @@ export class CrossMarginAccountBook { */ 'balance'?: string; /** - * Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type + * Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - interest: interest - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type */ 'type'?: CrossMarginAccountBook.Type; @@ -81,6 +81,7 @@ export namespace CrossMarginAccountBook { Out = 'out', Repay = 'repay', Borrow = 'borrow', + Interest = 'interest', NewOrder = 'new_order', OrderFill = 'order_fill', ReferralFee = 'referral_fee', diff --git a/model/crossMarginCurrency.ts b/model/crossMarginCurrency.ts index 2b818b8..65594cf 100644 --- a/model/crossMarginCurrency.ts +++ b/model/crossMarginCurrency.ts @@ -15,7 +15,7 @@ export class CrossMarginCurrency { */ 'name'?: string; /** - * Loan rate + * Minimum lending rate (hourly rate) */ 'rate'?: string; /** diff --git a/model/fundingBookItem.ts b/model/fundingBookItem.ts index 173557e..a940f29 100644 --- a/model/fundingBookItem.ts +++ b/model/fundingBookItem.ts @@ -11,7 +11,7 @@ export class FundingBookItem { /** - * Loan rate + * Loan rate (daily rate) */ 'rate'?: string; /** diff --git a/model/futuresAccount.ts b/model/futuresAccount.ts index 7b205b4..b551f08 100644 --- a/model/futuresAccount.ts +++ b/model/futuresAccount.ts @@ -29,7 +29,7 @@ export class FuturesAccount { */ 'orderMargin'?: string; /** - * The available balance for transferring or trading + * The available balance for transferring or trading(including bonus. Bonus can\'t be be withdrawn. The transfer amount needs to deduct the bonus) */ 'available'?: string; /** diff --git a/model/futuresAutoDeleverage.ts b/model/futuresAutoDeleverage.ts new file mode 100644 index 0000000..543d77f --- /dev/null +++ b/model/futuresAutoDeleverage.ts @@ -0,0 +1,112 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class FuturesAutoDeleverage { + /** + * Automatic deleveraging time + */ + 'time'?: number; + /** + * User ID + */ + 'user'?: number; + /** + * Order ID. Order IDs before 2023-02-20 are null + */ + 'orderId'?: number; + /** + * Futures contract + */ + 'contract'?: string; + /** + * Position leverage + */ + 'leverage'?: string; + /** + * Cross margin leverage(valid only when `leverage` is 0) + */ + 'crossLeverageLimit'?: string; + /** + * Average entry price + */ + 'entryPrice'?: string; + /** + * Average fill price + */ + 'fillPrice'?: string; + /** + * Trading size + */ + 'tradeSize'?: number; + /** + * Positions after auto-deleveraging + */ + 'positionSize'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'time', + baseName: 'time', + type: 'number', + }, + { + name: 'user', + baseName: 'user', + type: 'number', + }, + { + name: 'orderId', + baseName: 'order_id', + type: 'number', + }, + { + name: 'contract', + baseName: 'contract', + type: 'string', + }, + { + name: 'leverage', + baseName: 'leverage', + type: 'string', + }, + { + name: 'crossLeverageLimit', + baseName: 'cross_leverage_limit', + type: 'string', + }, + { + name: 'entryPrice', + baseName: 'entry_price', + type: 'string', + }, + { + name: 'fillPrice', + baseName: 'fill_price', + type: 'string', + }, + { + name: 'tradeSize', + baseName: 'trade_size', + type: 'number', + }, + { + name: 'positionSize', + baseName: 'position_size', + type: 'number', + }, + ]; + + static getAttributeTypeMap() { + return FuturesAutoDeleverage.attributeTypeMap; + } +} diff --git a/model/futuresCandlestick.ts b/model/futuresCandlestick.ts index 34549ef..e797cec 100644 --- a/model/futuresCandlestick.ts +++ b/model/futuresCandlestick.ts @@ -37,6 +37,10 @@ export class FuturesCandlestick { * Open price (quote currency) */ 'o'?: string; + /** + * Trading volume (unit: Quote currency) + */ + 'sum'?: string; static discriminator: string | undefined = undefined; @@ -71,6 +75,11 @@ export class FuturesCandlestick { baseName: 'o', type: 'string', }, + { + name: 'sum', + baseName: 'sum', + type: 'string', + }, ]; static getAttributeTypeMap() { diff --git a/model/ledgerRecord.ts b/model/ledgerRecord.ts index 1068775..bbe8550 100644 --- a/model/ledgerRecord.ts +++ b/model/ledgerRecord.ts @@ -18,6 +18,10 @@ export class LedgerRecord { * Hash record of the withdrawal */ 'txid'?: string; + /** + * Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + */ + 'withdrawOrderId'?: string; /** * Operation time */ @@ -64,6 +68,11 @@ export class LedgerRecord { baseName: 'txid', type: 'string', }, + { + name: 'withdrawOrderId', + baseName: 'withdraw_order_id', + type: 'string', + }, { name: 'timestamp', baseName: 'timestamp', diff --git a/model/loan.ts b/model/loan.ts index 291daf9..9b6278e 100644 --- a/model/loan.ts +++ b/model/loan.ts @@ -38,7 +38,7 @@ export class Loan { */ 'currency': string; /** - * Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set + * Loan rate. Only rates in [0.0001, 0.01] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set */ 'rate'?: string; /** diff --git a/model/models.ts b/model/models.ts index e221df1..321176e 100644 --- a/model/models.ts +++ b/model/models.ts @@ -1,4 +1,8 @@ export * from './accountBalance'; +export * from './agencyCommission'; +export * from './agencyCommissionHistory'; +export * from './agencyTransaction'; +export * from './agencyTransactionHistory'; export * from './apiV4KeyPerm'; export * from './autoRepaySetting'; export * from './batchFuturesOrder'; @@ -34,6 +38,7 @@ export * from './fundingRateRecord'; export * from './futuresAccount'; export * from './futuresAccountBook'; export * from './futuresAccountHistory'; +export * from './futuresAutoDeleverage'; export * from './futuresCandlestick'; export * from './futuresIndexConstituents'; export * from './futuresInitialOrder'; @@ -79,6 +84,7 @@ export * from './optionsUnderlying'; export * from './optionsUnderlyingTicker'; export * from './order'; export * from './orderBook'; +export * from './orderPatch'; export * from './position'; export * from './positionClose'; export * from './positionCloseOrder'; @@ -86,6 +92,7 @@ export * from './repayRequest'; export * from './repayment'; export * from './savedAddress'; export * from './spotAccount'; +export * from './spotFee'; export * from './spotPricePutOrder'; export * from './spotPriceTrigger'; export * from './spotPriceTriggeredOrder'; @@ -115,6 +122,10 @@ import crypto = require('crypto'); import { URL } from 'url'; import { AccountBalance } from './accountBalance'; +import { AgencyCommission } from './agencyCommission'; +import { AgencyCommissionHistory } from './agencyCommissionHistory'; +import { AgencyTransaction } from './agencyTransaction'; +import { AgencyTransactionHistory } from './agencyTransactionHistory'; import { ApiV4KeyPerm } from './apiV4KeyPerm'; import { AutoRepaySetting } from './autoRepaySetting'; import { BatchFuturesOrder } from './batchFuturesOrder'; @@ -150,6 +161,7 @@ import { FundingRateRecord } from './fundingRateRecord'; import { FuturesAccount } from './futuresAccount'; import { FuturesAccountBook } from './futuresAccountBook'; import { FuturesAccountHistory } from './futuresAccountHistory'; +import { FuturesAutoDeleverage } from './futuresAutoDeleverage'; import { FuturesCandlestick } from './futuresCandlestick'; import { FuturesIndexConstituents } from './futuresIndexConstituents'; import { FuturesInitialOrder } from './futuresInitialOrder'; @@ -195,6 +207,7 @@ import { OptionsUnderlying } from './optionsUnderlying'; import { OptionsUnderlyingTicker } from './optionsUnderlyingTicker'; import { Order } from './order'; import { OrderBook } from './orderBook'; +import { OrderPatch } from './orderPatch'; import { Position } from './position'; import { PositionClose } from './positionClose'; import { PositionCloseOrder } from './positionCloseOrder'; @@ -202,6 +215,7 @@ import { RepayRequest } from './repayRequest'; import { Repayment } from './repayment'; import { SavedAddress } from './savedAddress'; import { SpotAccount } from './spotAccount'; +import { SpotFee } from './spotFee'; import { SpotPricePutOrder } from './spotPricePutOrder'; import { SpotPriceTrigger } from './spotPriceTrigger'; import { SpotPriceTriggeredOrder } from './spotPriceTriggeredOrder'; @@ -295,6 +309,10 @@ const enumsMap: { [index: string]: any } = { const typeMap: { [index: string]: any } = { AccountBalance: AccountBalance, + AgencyCommission: AgencyCommission, + AgencyCommissionHistory: AgencyCommissionHistory, + AgencyTransaction: AgencyTransaction, + AgencyTransactionHistory: AgencyTransactionHistory, ApiV4KeyPerm: ApiV4KeyPerm, AutoRepaySetting: AutoRepaySetting, BatchFuturesOrder: BatchFuturesOrder, @@ -330,6 +348,7 @@ const typeMap: { [index: string]: any } = { FuturesAccount: FuturesAccount, FuturesAccountBook: FuturesAccountBook, FuturesAccountHistory: FuturesAccountHistory, + FuturesAutoDeleverage: FuturesAutoDeleverage, FuturesCandlestick: FuturesCandlestick, FuturesIndexConstituents: FuturesIndexConstituents, FuturesInitialOrder: FuturesInitialOrder, @@ -375,6 +394,7 @@ const typeMap: { [index: string]: any } = { OptionsUnderlyingTicker: OptionsUnderlyingTicker, Order: Order, OrderBook: OrderBook, + OrderPatch: OrderPatch, Position: Position, PositionClose: PositionClose, PositionCloseOrder: PositionCloseOrder, @@ -382,6 +402,7 @@ const typeMap: { [index: string]: any } = { Repayment: Repayment, SavedAddress: SavedAddress, SpotAccount: SpotAccount, + SpotFee: SpotFee, SpotPricePutOrder: SpotPricePutOrder, SpotPriceTrigger: SpotPriceTrigger, SpotPriceTriggeredOrder: SpotPriceTriggeredOrder, diff --git a/model/order.ts b/model/order.ts index f3a0126..534bc10 100644 --- a/model/order.ts +++ b/model/order.ts @@ -18,7 +18,7 @@ export class Order { */ 'id'?: string; /** - * User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 */ 'text'?: string; /** @@ -46,7 +46,7 @@ export class Order { */ 'currencyPair': string; /** - * Order Type - limit : Limit Order - market : Market Order + * Order Type - limit : Limit Order - market : Market Order */ 'type'?: Order.Type; /** @@ -70,7 +70,7 @@ export class Order { */ 'timeInForce'?: Order.TimeInForce; /** - * Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely + * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. */ 'iceberg'?: string; /** @@ -93,6 +93,10 @@ export class Order { * Total filled in quote currency */ 'filledTotal'?: string; + /** + * Average fill price + */ + 'avgDealPrice'?: string; /** * Fee deducted */ @@ -233,6 +237,11 @@ export class Order { baseName: 'filled_total', type: 'string', }, + { + name: 'avgDealPrice', + baseName: 'avg_deal_price', + type: 'string', + }, { name: 'fee', baseName: 'fee', diff --git a/model/orderPatch.ts b/model/orderPatch.ts new file mode 100644 index 0000000..f2b2521 --- /dev/null +++ b/model/orderPatch.ts @@ -0,0 +1,43 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Spot order details + */ +export class OrderPatch { + /** + * New order amount. `amount` and `price` must specify one of them + */ + 'amount'?: string; + /** + * New order price. `amount` and `Price` must specify one of them\" + */ + 'price'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'amount', + baseName: 'amount', + type: 'string', + }, + { + name: 'price', + baseName: 'price', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return OrderPatch.attributeTypeMap; + } +} diff --git a/model/spotFee.ts b/model/spotFee.ts new file mode 100644 index 0000000..fadeb14 --- /dev/null +++ b/model/spotFee.ts @@ -0,0 +1,103 @@ +/** + * Gate API v4 + * Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user\'s behalf. + * + * Contact: support@mail.gate.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class SpotFee { + /** + * User ID + */ + 'userId'?: number; + /** + * taker fee rate + */ + 'takerFee'?: string; + /** + * maker fee rate + */ + 'makerFee'?: string; + /** + * If GT deduction is enabled + */ + 'gtDiscount'?: boolean; + /** + * Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled + */ + 'gtTakerFee'?: string; + /** + * Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled + */ + 'gtMakerFee'?: string; + /** + * Loan fee rate of margin lending + */ + 'loanFee'?: string; + /** + * Point type. 0 - Initial version. 1 - new version since 202009 + */ + 'pointType'?: string; + /** + * Currency pair + */ + 'currencyPair'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'userId', + baseName: 'user_id', + type: 'number', + }, + { + name: 'takerFee', + baseName: 'taker_fee', + type: 'string', + }, + { + name: 'makerFee', + baseName: 'maker_fee', + type: 'string', + }, + { + name: 'gtDiscount', + baseName: 'gt_discount', + type: 'boolean', + }, + { + name: 'gtTakerFee', + baseName: 'gt_taker_fee', + type: 'string', + }, + { + name: 'gtMakerFee', + baseName: 'gt_maker_fee', + type: 'string', + }, + { + name: 'loanFee', + baseName: 'loan_fee', + type: 'string', + }, + { + name: 'pointType', + baseName: 'point_type', + type: 'string', + }, + { + name: 'currencyPair', + baseName: 'currency_pair', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return SpotFee.attributeTypeMap; + } +} diff --git a/model/subAccount.ts b/model/subAccount.ts index 0ba7d8b..53a2f39 100644 --- a/model/subAccount.ts +++ b/model/subAccount.ts @@ -30,6 +30,10 @@ export class SubAccount { * State: 1-normal, 2-locked\" */ 'state'?: number; + /** + * Type: 1-Sub-account + */ + 'type'?: number; /** * The user id of the sub-account */ @@ -67,6 +71,11 @@ export class SubAccount { baseName: 'state', type: 'number', }, + { + name: 'type', + baseName: 'type', + type: 'number', + }, { name: 'userId', baseName: 'user_id', diff --git a/package-lock.json b/package-lock.json index 8d8bf6b..6363eba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gate-api", - "version": "5.34.0", + "version": "5.40.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gate-api", - "version": "5.34.0", + "version": "5.40.0", "license": "Unlicense", "dependencies": { "@types/node": "^8.10.48", @@ -1025,9 +1025,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -1212,9 +1212,9 @@ } }, "node_modules/globals": { - "version": "13.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", - "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1493,9 +1493,9 @@ } }, "node_modules/minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1609,9 +1609,9 @@ } }, "node_modules/prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -1654,9 +1654,9 @@ } }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true, "engines": { "node": ">=6" @@ -1888,9 +1888,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", - "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -2819,9 +2819,9 @@ "dev": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -2960,9 +2960,9 @@ } }, "globals": { - "version": "13.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", - "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -3177,9 +3177,9 @@ } }, "minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, "mkdirp": { @@ -3266,9 +3266,9 @@ "dev": true }, "prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true }, "prettier-linter-helpers": { @@ -3293,9 +3293,9 @@ "dev": true }, "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true }, "regenerator-runtime": { @@ -3461,9 +3461,9 @@ }, "dependencies": { "ajv": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", - "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", diff --git a/package.json b/package.json index 976e84d..af15252 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gate-api", - "version": "5.34.0", + "version": "5.40.0", "description": "NodeJS client for gate-api", "repository": "gateio/gateapi-nodejs", "main": "dist/api.js",