From eed01d4852d6fa057a368d7508c2c66d17d558c1 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Sat, 3 Dec 2022 15:36:04 +0800 Subject: [PATCH] release 5.34.0 --- README.md | 44 ++- api/apis.ts | 14 +- api/deliveryApi.ts | 48 +-- api/futuresApi.ts | 211 ++++++++++-- api/optionsApi.ts | 45 +-- api/spotApi.ts | 74 +++- api/subAccountApi.ts | 398 ++++++++++++++++++++++ api/walletApi.ts | 52 ++- docs/ApiV4KeyPerm.md | 24 ++ docs/BatchFuturesOrder.md | 77 +++++ docs/CountdownCancelAllFuturesTask.md | 9 + docs/CountdownCancelAllSpotTask.md | 9 + docs/DeliveryApi.md | 50 +-- docs/FuturesAccount.md | 2 +- docs/FuturesApi.md | 178 +++++++++- docs/FuturesCandlestick.md | 10 +- docs/FuturesOrder.md | 4 +- docs/FuturesOrderAmendment.md | 2 +- docs/FuturesOrderBookItem.md | 2 +- docs/FuturesPremiumIndex.md | 12 + docs/FuturesTicker.md | 2 + docs/FuturesTrade.md | 2 +- docs/LedgerRecord.md | 4 +- docs/OptionsAccountBook.md | 4 +- docs/OptionsApi.md | 84 ++--- docs/OptionsCandlestick.md | 13 + docs/OptionsContract.md | 8 +- docs/OptionsMySettlements.md | 12 +- docs/OptionsMyTrade.md | 6 +- docs/OptionsOrder.md | 5 +- docs/OptionsPosition.md | 10 +- docs/OptionsPositionClose.md | 2 +- docs/OptionsPositionCloseOrder.md | 10 + docs/OptionsSettlement.md | 10 +- docs/OptionsTicker.md | 6 +- docs/OptionsUnderlying.md | 2 +- docs/OptionsUnderlyingTicker.md | 2 +- docs/Order.md | 12 +- docs/SpotApi.md | 72 +++- docs/SubAccount.md | 14 + docs/SubAccountApi.md | 453 +++++++++++++++++++++++++ docs/SubAccountKey.md | 15 + docs/SubAccountToSubAccount.md | 32 ++ docs/TriggerTime.md | 8 + docs/WalletApi.md | 68 +++- model/apiV4KeyPerm.ts | 51 +++ model/batchFuturesOrder.ts | 286 ++++++++++++++++ model/contract.ts | 2 +- model/countdownCancelAllFuturesTask.ts | 43 +++ model/countdownCancelAllSpotTask.ts | 43 +++ model/futuresAccount.ts | 2 +- model/futuresCandlestick.ts | 10 +- model/futuresOrder.ts | 3 +- model/futuresOrderAmendment.ts | 2 +- model/futuresOrderBookItem.ts | 2 +- model/futuresPremiumIndex.ts | 70 ++++ model/futuresTicker.ts | 18 + model/futuresTrade.ts | 2 +- model/ledgerRecord.ts | 2 +- model/models.ts | 40 +++ model/optionsAccountBook.ts | 4 +- model/optionsCandlestick.ts | 79 +++++ model/optionsContract.ts | 10 +- model/optionsMySettlements.ts | 12 +- model/optionsMyTrade.ts | 6 +- model/optionsOrder.ts | 13 +- model/optionsPosition.ts | 16 +- model/optionsPositionClose.ts | 2 +- model/optionsPositionCloseOrder.ts | 52 +++ model/optionsSettlement.ts | 10 +- model/optionsTicker.ts | 6 +- model/optionsUnderlying.ts | 2 +- model/optionsUnderlyingTicker.ts | 2 +- model/order.ts | 29 +- model/subAccount.ts | 85 +++++ model/subAccountKey.ts | 93 +++++ model/subAccountToSubAccount.ts | 98 ++++++ model/triggerTime.ts | 31 ++ package-lock.json | 151 ++++----- package.json | 2 +- 80 files changed, 3006 insertions(+), 394 deletions(-) create mode 100644 api/subAccountApi.ts create mode 100644 docs/ApiV4KeyPerm.md create mode 100644 docs/BatchFuturesOrder.md create mode 100644 docs/CountdownCancelAllFuturesTask.md create mode 100644 docs/CountdownCancelAllSpotTask.md create mode 100644 docs/FuturesPremiumIndex.md create mode 100644 docs/OptionsCandlestick.md create mode 100644 docs/OptionsPositionCloseOrder.md create mode 100644 docs/SubAccount.md create mode 100644 docs/SubAccountApi.md create mode 100644 docs/SubAccountKey.md create mode 100644 docs/SubAccountToSubAccount.md create mode 100644 docs/TriggerTime.md create mode 100644 model/apiV4KeyPerm.ts create mode 100644 model/batchFuturesOrder.ts create mode 100644 model/countdownCancelAllFuturesTask.ts create mode 100644 model/countdownCancelAllSpotTask.ts create mode 100644 model/futuresPremiumIndex.ts create mode 100644 model/optionsCandlestick.ts create mode 100644 model/optionsPositionCloseOrder.ts create mode 100644 model/subAccount.ts create mode 100644 model/subAccountKey.ts create mode 100644 model/subAccountToSubAccount.ts create mode 100644 model/triggerTime.ts diff --git a/README.md b/README.md index e80bc1f..e908e36 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## gate-api@5.26.0 +## gate-api@5.34.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.26.0 +- API version: 4.34.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) @@ -66,7 +66,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency api.listDeliveryContracts(settle) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -104,7 +104,7 @@ Class | Method | HTTP request | Description *DeliveryApi* | [**listPriceTriggeredDeliveryOrders**](docs/DeliveryApi.md#listPriceTriggeredDeliveryOrders) | **GET** /delivery/{settle}/price_orders | List all auto orders *DeliveryApi* | [**createPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#createPriceTriggeredDeliveryOrder) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order *DeliveryApi* | [**cancelPriceTriggeredDeliveryOrderList**](docs/DeliveryApi.md#cancelPriceTriggeredDeliveryOrderList) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders -*DeliveryApi* | [**getPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order +*DeliveryApi* | [**getPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order *DeliveryApi* | [**cancelPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order *FlashSwapApi* | [**listFlashSwapCurrencies**](docs/FlashSwapApi.md#listFlashSwapCurrencies) | **GET** /flash_swap/currencies | List all supported currencies in flash swap *FlashSwapApi* | [**listFlashSwapOrders**](docs/FlashSwapApi.md#listFlashSwapOrders) | **GET** /flash_swap/orders | List all flash swap orders @@ -116,6 +116,7 @@ Class | Method | HTTP request | Description *FuturesApi* | [**listFuturesOrderBook**](docs/FuturesApi.md#listFuturesOrderBook) | **GET** /futures/{settle}/order_book | Futures order book *FuturesApi* | [**listFuturesTrades**](docs/FuturesApi.md#listFuturesTrades) | **GET** /futures/{settle}/trades | Futures trading history *FuturesApi* | [**listFuturesCandlesticks**](docs/FuturesApi.md#listFuturesCandlesticks) | **GET** /futures/{settle}/candlesticks | Get futures candlesticks +*FuturesApi* | [**listFuturesPremiumIndex**](docs/FuturesApi.md#listFuturesPremiumIndex) | **GET** /futures/{settle}/premium_index | Premium Index K-Line *FuturesApi* | [**listFuturesTickers**](docs/FuturesApi.md#listFuturesTickers) | **GET** /futures/{settle}/tickers | List futures tickers *FuturesApi* | [**listFuturesFundingRateHistory**](docs/FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Funding rate history *FuturesApi* | [**listFuturesInsuranceLedger**](docs/FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures insurance balance history @@ -137,16 +138,18 @@ Class | Method | HTTP request | Description *FuturesApi* | [**listFuturesOrders**](docs/FuturesApi.md#listFuturesOrders) | **GET** /futures/{settle}/orders | List futures orders *FuturesApi* | [**createFuturesOrder**](docs/FuturesApi.md#createFuturesOrder) | **POST** /futures/{settle}/orders | Create a futures order *FuturesApi* | [**cancelFuturesOrders**](docs/FuturesApi.md#cancelFuturesOrders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched +*FuturesApi* | [**createBatchFuturesOrder**](docs/FuturesApi.md#createBatchFuturesOrder) | **POST** /futures/{settle}/batch_orders | Create a batch of futures orders *FuturesApi* | [**getFuturesOrder**](docs/FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order *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* | [**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* | [**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 *FuturesApi* | [**cancelPriceTriggeredOrderList**](docs/FuturesApi.md#cancelPriceTriggeredOrderList) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders -*FuturesApi* | [**getPriceTriggeredOrder**](docs/FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order +*FuturesApi* | [**getPriceTriggeredOrder**](docs/FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a price-triggered order *FuturesApi* | [**cancelPriceTriggeredOrder**](docs/FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order *MarginApi* | [**listMarginCurrencyPairs**](docs/MarginApi.md#listMarginCurrencyPairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading *MarginApi* | [**getMarginCurrencyPair**](docs/MarginApi.md#getMarginCurrencyPair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair @@ -187,10 +190,10 @@ Class | Method | HTTP request | Description *OptionsApi* | [**listOptionsSettlements**](docs/OptionsApi.md#listOptionsSettlements) | **GET** /options/settlements | List settlement history *OptionsApi* | [**getOptionsSettlement**](docs/OptionsApi.md#getOptionsSettlement) | **GET** /options/settlements/{contract} | Get specified contract\'s settlement *OptionsApi* | [**listMyOptionsSettlements**](docs/OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | List my options settlements -*OptionsApi* | [**listOptionsOrderBook**](docs/OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Futures order book +*OptionsApi* | [**listOptionsOrderBook**](docs/OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Options order book *OptionsApi* | [**listOptionsTickers**](docs/OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | List tickers of options contracts *OptionsApi* | [**listOptionsUnderlyingTickers**](docs/OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker -*OptionsApi* | [**listOptionsCandlesticks**](docs/OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get futures candlesticks +*OptionsApi* | [**listOptionsCandlesticks**](docs/OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get options candlesticks *OptionsApi* | [**listOptionsUnderlyingCandlesticks**](docs/OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying *OptionsApi* | [**listOptionsTrades**](docs/OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Options trade history *OptionsApi* | [**listOptionsAccount**](docs/OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | List options account @@ -198,7 +201,7 @@ Class | Method | HTTP request | Description *OptionsApi* | [**listOptionsPositions**](docs/OptionsApi.md#listOptionsPositions) | **GET** /options/positions | List user\'s positions of specified underlying *OptionsApi* | [**getOptionsPosition**](docs/OptionsApi.md#getOptionsPosition) | **GET** /options/positions/{contract} | Get specified contract position *OptionsApi* | [**listOptionsPositionClose**](docs/OptionsApi.md#listOptionsPositionClose) | **GET** /options/position_close | List user\'s liquidation history of specified underlying -*OptionsApi* | [**listOptionsOrders**](docs/OptionsApi.md#listOptionsOrders) | **GET** /options/orders | List futures orders +*OptionsApi* | [**listOptionsOrders**](docs/OptionsApi.md#listOptionsOrders) | **GET** /options/orders | List options orders *OptionsApi* | [**createOptionsOrder**](docs/OptionsApi.md#createOptionsOrder) | **POST** /options/orders | Create an options order *OptionsApi* | [**cancelOptionsOrders**](docs/OptionsApi.md#cancelOptionsOrders) | **DELETE** /options/orders | Cancel all `open` orders matched *OptionsApi* | [**getOptionsOrder**](docs/OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Get a single order @@ -225,11 +228,22 @@ Class | Method | HTTP request | Description *SpotApi* | [**cancelOrder**](docs/SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single 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 *SpotApi* | [**listSpotPriceTriggeredOrders**](docs/SpotApi.md#listSpotPriceTriggeredOrders) | **GET** /spot/price_orders | Retrieve running auto order list *SpotApi* | [**createSpotPriceTriggeredOrder**](docs/SpotApi.md#createSpotPriceTriggeredOrder) | **POST** /spot/price_orders | Create a price-triggered order *SpotApi* | [**cancelSpotPriceTriggeredOrderList**](docs/SpotApi.md#cancelSpotPriceTriggeredOrderList) | **DELETE** /spot/price_orders | Cancel all open orders -*SpotApi* | [**getSpotPriceTriggeredOrder**](docs/SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Get a single order +*SpotApi* | [**getSpotPriceTriggeredOrder**](docs/SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Get a price-triggered order *SpotApi* | [**cancelSpotPriceTriggeredOrder**](docs/SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order +*SubAccountApi* | [**listSubAccounts**](docs/SubAccountApi.md#listSubAccounts) | **GET** /sub_accounts | List sub-accounts +*SubAccountApi* | [**createSubAccounts**](docs/SubAccountApi.md#createSubAccounts) | **POST** /sub_accounts | Create a new sub-account +*SubAccountApi* | [**getSubAccount**](docs/SubAccountApi.md#getSubAccount) | **GET** /sub_accounts/{user_id} | Get the sub-account +*SubAccountApi* | [**listSubAccountKeys**](docs/SubAccountApi.md#listSubAccountKeys) | **GET** /sub_accounts/{user_id}/keys | List all API Key of the sub-account +*SubAccountApi* | [**createSubAccountKeys**](docs/SubAccountApi.md#createSubAccountKeys) | **POST** /sub_accounts/{user_id}/keys | Create API Key of the sub-account +*SubAccountApi* | [**getSubAccountKey**](docs/SubAccountApi.md#getSubAccountKey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account +*SubAccountApi* | [**updateSubAccountKeys**](docs/SubAccountApi.md#updateSubAccountKeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account +*SubAccountApi* | [**deleteSubAccountKeys**](docs/SubAccountApi.md#deleteSubAccountKeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account +*SubAccountApi* | [**lockSubAccount**](docs/SubAccountApi.md#lockSubAccount) | **POST** /sub_accounts/{user_id}/lock | Lock the sub-account +*SubAccountApi* | [**unlockSubAccount**](docs/SubAccountApi.md#unlockSubAccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock the sub-account *WalletApi* | [**listCurrencyChains**](docs/WalletApi.md#listCurrencyChains) | **GET** /wallet/currency_chains | List chains supported for specified currency *WalletApi* | [**getDepositAddress**](docs/WalletApi.md#getDepositAddress) | **GET** /wallet/deposit_address | Generate currency deposit address *WalletApi* | [**listWithdrawals**](docs/WalletApi.md#listWithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records @@ -237,6 +251,7 @@ Class | Method | HTTP request | Description *WalletApi* | [**transfer**](docs/WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts *WalletApi* | [**listSubAccountTransfers**](docs/WalletApi.md#listSubAccountTransfers) | **GET** /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts *WalletApi* | [**transferWithSubAccount**](docs/WalletApi.md#transferWithSubAccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts +*WalletApi* | [**subAccountToSubAccount**](docs/WalletApi.md#subAccountToSubAccount) | **POST** /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account *WalletApi* | [**listWithdrawStatus**](docs/WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status *WalletApi* | [**listSubAccountBalances**](docs/WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances *WalletApi* | [**listSubAccountMarginBalances**](docs/WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts\' margin balances @@ -252,12 +267,16 @@ Class | Method | HTTP request | Description ## Documentation for Models - [AccountBalance](docs/AccountBalance.md) + - [ApiV4KeyPerm](docs/ApiV4KeyPerm.md) - [AutoRepaySetting](docs/AutoRepaySetting.md) + - [BatchFuturesOrder](docs/BatchFuturesOrder.md) - [BatchOrder](docs/BatchOrder.md) - [CancelOrder](docs/CancelOrder.md) - [CancelOrderResult](docs/CancelOrderResult.md) - [Contract](docs/Contract.md) - [ContractStat](docs/ContractStat.md) + - [CountdownCancelAllFuturesTask](docs/CountdownCancelAllFuturesTask.md) + - [CountdownCancelAllSpotTask](docs/CountdownCancelAllSpotTask.md) - [CrossMarginAccount](docs/CrossMarginAccount.md) - [CrossMarginAccountBook](docs/CrossMarginAccountBook.md) - [CrossMarginBalance](docs/CrossMarginBalance.md) @@ -291,6 +310,7 @@ Class | Method | HTTP request | Description - [FuturesOrderAmendment](docs/FuturesOrderAmendment.md) - [FuturesOrderBook](docs/FuturesOrderBook.md) - [FuturesOrderBookItem](docs/FuturesOrderBookItem.md) + - [FuturesPremiumIndex](docs/FuturesPremiumIndex.md) - [FuturesPriceTrigger](docs/FuturesPriceTrigger.md) - [FuturesPriceTriggeredOrder](docs/FuturesPriceTriggeredOrder.md) - [FuturesTicker](docs/FuturesTicker.md) @@ -313,12 +333,14 @@ Class | Method | HTTP request | Description - [OpenOrders](docs/OpenOrders.md) - [OptionsAccount](docs/OptionsAccount.md) - [OptionsAccountBook](docs/OptionsAccountBook.md) + - [OptionsCandlestick](docs/OptionsCandlestick.md) - [OptionsContract](docs/OptionsContract.md) - [OptionsMySettlements](docs/OptionsMySettlements.md) - [OptionsMyTrade](docs/OptionsMyTrade.md) - [OptionsOrder](docs/OptionsOrder.md) - [OptionsPosition](docs/OptionsPosition.md) - [OptionsPositionClose](docs/OptionsPositionClose.md) + - [OptionsPositionCloseOrder](docs/OptionsPositionCloseOrder.md) - [OptionsSettlement](docs/OptionsSettlement.md) - [OptionsTicker](docs/OptionsTicker.md) - [OptionsUnderlying](docs/OptionsUnderlying.md) @@ -335,10 +357,13 @@ Class | Method | HTTP request | Description - [SpotPricePutOrder](docs/SpotPricePutOrder.md) - [SpotPriceTrigger](docs/SpotPriceTrigger.md) - [SpotPriceTriggeredOrder](docs/SpotPriceTriggeredOrder.md) + - [SubAccount](docs/SubAccount.md) - [SubAccountBalance](docs/SubAccountBalance.md) - [SubAccountCrossMarginBalance](docs/SubAccountCrossMarginBalance.md) - [SubAccountFuturesBalance](docs/SubAccountFuturesBalance.md) + - [SubAccountKey](docs/SubAccountKey.md) - [SubAccountMarginBalance](docs/SubAccountMarginBalance.md) + - [SubAccountToSubAccount](docs/SubAccountToSubAccount.md) - [SubAccountTransfer](docs/SubAccountTransfer.md) - [SubCrossMarginAccount](docs/SubCrossMarginAccount.md) - [SystemTime](docs/SystemTime.md) @@ -349,6 +374,7 @@ Class | Method | HTTP request | Description - [TransactionID](docs/TransactionID.md) - [Transfer](docs/Transfer.md) - [TriggerOrderResponse](docs/TriggerOrderResponse.md) + - [TriggerTime](docs/TriggerTime.md) - [WithdrawStatus](docs/WithdrawStatus.md) diff --git a/api/apis.ts b/api/apis.ts index f40a927..6502c2a 100644 --- a/api/apis.ts +++ b/api/apis.ts @@ -11,9 +11,21 @@ export * from './optionsApi'; import { OptionsApi } from './optionsApi'; export * from './spotApi'; import { SpotApi } from './spotApi'; +export * from './subAccountApi'; +import { SubAccountApi } from './subAccountApi'; export * from './walletApi'; import { WalletApi } from './walletApi'; export * from './withdrawalApi'; import { WithdrawalApi } from './withdrawalApi'; -export const APIS = [DeliveryApi, FlashSwapApi, FuturesApi, MarginApi, OptionsApi, SpotApi, WalletApi, WithdrawalApi]; +export const APIS = [ + DeliveryApi, + FlashSwapApi, + FuturesApi, + MarginApi, + OptionsApi, + SpotApi, + SubAccountApi, + WalletApi, + WithdrawalApi, +]; diff --git a/api/deliveryApi.ts b/api/deliveryApi.ts index 5bd53cd..ecaebed 100644 --- a/api/deliveryApi.ts +++ b/api/deliveryApi.ts @@ -51,7 +51,7 @@ export class DeliveryApi { * @param settle Settle currency */ public async listDeliveryContracts( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + @@ -89,7 +89,7 @@ export class DeliveryApi { * @param contract Futures contract */ public async getDeliveryContract( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, ): Promise<{ response: AxiosResponse; body: DeliveryContract }> { const localVarPath = @@ -139,7 +139,7 @@ export class DeliveryApi { * @param opts.withId Whether the order book update ID will be returned. This ID increases by 1 on every order book update */ public async listDeliveryOrderBook( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, opts: { interval?: '0' | '0.1' | '0.01'; limit?: number; withId?: boolean }, ): Promise<{ response: AxiosResponse; body: FuturesOrderBook }> { @@ -204,7 +204,7 @@ export class DeliveryApi { * @param opts.to Specify end time in Unix seconds, default to current time */ public async listDeliveryTrades( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, opts: { limit?: number; lastId?: string; from?: number; to?: number }, ): Promise<{ response: AxiosResponse; body: Array }> { @@ -273,7 +273,7 @@ export class DeliveryApi { * @param opts.interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 */ public async listDeliveryCandlesticks( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, opts: { from?: number; @@ -362,7 +362,7 @@ export class DeliveryApi { * @param opts.contract Futures contract */ public async listDeliveryTickers( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', opts: { contract?: string }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = @@ -407,7 +407,7 @@ export class DeliveryApi { * @param opts.limit Maximum number of records to be returned in a single list */ public async listDeliveryInsuranceLedger( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', opts: { limit?: number }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = @@ -452,7 +452,7 @@ export class DeliveryApi { * @param settle Settle currency */ public async listDeliveryAccounts( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', ): Promise<{ response: AxiosResponse; body: FuturesAccount }> { const localVarPath = this.client.basePath + @@ -494,7 +494,7 @@ export class DeliveryApi { * @param opts.type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate */ public async listDeliveryAccountBook( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', opts: { limit?: number; from?: number; @@ -557,7 +557,7 @@ export class DeliveryApi { * @param settle Settle currency */ public async listDeliveryPositions( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + @@ -595,7 +595,7 @@ export class DeliveryApi { * @param contract Futures contract */ public async getDeliveryPosition( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, ): Promise<{ response: AxiosResponse; body: Position }> { const localVarPath = @@ -642,7 +642,7 @@ export class DeliveryApi { * @param change Margin change. Use positive number to increase margin, negative number otherwise. */ public async updateDeliveryPositionMargin( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, change: string, ): Promise<{ response: AxiosResponse; body: Position }> { @@ -703,7 +703,7 @@ export class DeliveryApi { * @param leverage New position leverage */ public async updateDeliveryPositionLeverage( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, leverage: string, ): Promise<{ response: AxiosResponse; body: Position }> { @@ -764,7 +764,7 @@ export class DeliveryApi { * @param riskLimit New position risk limit */ public async updateDeliveryPositionRiskLimit( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, riskLimit: string, ): Promise<{ response: AxiosResponse; body: Position }> { @@ -830,7 +830,7 @@ export class DeliveryApi { * @param opts.countTotal Whether to return total number matched. Default to 0(no return) */ public async listDeliveryOrders( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', status: 'open' | 'finished', opts: { contract?: string; limit?: number; offset?: number; lastId?: string; countTotal?: 0 | 1 }, ): Promise<{ response: AxiosResponse; body: Array }> { @@ -898,7 +898,7 @@ export class DeliveryApi { * @param futuresOrder */ public async createDeliveryOrder( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', futuresOrder: FuturesOrder, ): Promise<{ response: AxiosResponse; body: FuturesOrder }> { const localVarPath = @@ -945,7 +945,7 @@ export class DeliveryApi { * @param opts.side All bids or asks. Both included if not specified */ public async cancelDeliveryOrders( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', contract: string, opts: { side?: 'ask' | 'bid' }, ): Promise<{ response: AxiosResponse; body: Array }> { @@ -997,7 +997,7 @@ export class DeliveryApi { * @param orderId Retrieve the data of the order with the specified ID */ public async getDeliveryOrder( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', orderId: string, ): Promise<{ response: AxiosResponse; body: FuturesOrder }> { const localVarPath = @@ -1043,7 +1043,7 @@ export class DeliveryApi { * @param orderId Retrieve the data of the order with the specified ID */ public async cancelDeliveryOrder( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', orderId: string, ): Promise<{ response: AxiosResponse; body: FuturesOrder }> { const localVarPath = @@ -1095,7 +1095,7 @@ export class DeliveryApi { * @param opts.countTotal Whether to return total number matched. Default to 0(no return) */ public async getMyDeliveryTrades( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', opts: { contract?: string; order?: number; @@ -1168,7 +1168,7 @@ export class DeliveryApi { * @param opts.limit Maximum number of records to be returned in a single list */ public async listDeliveryPositionClose( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', opts: { contract?: string; limit?: number }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = @@ -1219,7 +1219,7 @@ export class DeliveryApi { * @param opts.at Specify a liquidation timestamp */ public async listDeliveryLiquidates( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', opts: { contract?: string; limit?: number; at?: number }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = @@ -1274,7 +1274,7 @@ export class DeliveryApi { * @param opts.at Specify a settlement timestamp */ public async listDeliverySettlements( - settle: 'btc' | 'usdt' | 'usd', + settle: 'usdt' | 'btc', opts: { contract?: string; limit?: number; at?: number }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = @@ -1496,7 +1496,7 @@ export class DeliveryApi { /** * - * @summary Get a single order + * @summary Get a price-triggered order * @param settle Settle currency * @param orderId Retrieve the data of the order with the specified ID */ diff --git a/api/futuresApi.ts b/api/futuresApi.ts index 039f84f..57678dd 100644 --- a/api/futuresApi.ts +++ b/api/futuresApi.ts @@ -10,8 +10,10 @@ */ /* tslint:disable:no-unused-locals */ +import { BatchFuturesOrder } from '../model/batchFuturesOrder'; import { Contract } from '../model/contract'; import { ContractStat } from '../model/contractStat'; +import { CountdownCancelAllFuturesTask } from '../model/countdownCancelAllFuturesTask'; import { FundingRateRecord } from '../model/fundingRateRecord'; import { FuturesAccount } from '../model/futuresAccount'; import { FuturesAccountBook } from '../model/futuresAccountBook'; @@ -21,6 +23,7 @@ import { FuturesLiquidate } from '../model/futuresLiquidate'; import { FuturesOrder } from '../model/futuresOrder'; import { FuturesOrderAmendment } from '../model/futuresOrderAmendment'; import { FuturesOrderBook } from '../model/futuresOrderBook'; +import { FuturesPremiumIndex } from '../model/futuresPremiumIndex'; import { FuturesPriceTriggeredOrder } from '../model/futuresPriceTriggeredOrder'; import { FuturesTicker } from '../model/futuresTicker'; import { FuturesTrade } from '../model/futuresTrade'; @@ -29,6 +32,7 @@ import { MyFuturesTrade } from '../model/myFuturesTrade'; import { Position } from '../model/position'; import { PositionClose } from '../model/positionClose'; import { TriggerOrderResponse } from '../model/triggerOrderResponse'; +import { TriggerTime } from '../model/triggerTime'; import { ObjectSerializer } from '../model/models'; import { ApiClient } from './apiClient'; import { AxiosRequestConfig, AxiosResponse } from 'axios'; @@ -202,6 +206,7 @@ export class FuturesApi { * @param contract Futures contract * @param opts Optional parameters * @param opts.limit Maximum number of records to be returned in a single list + * @param opts.offset List offset, starting from 0 * @param opts.lastId Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range * @param opts.from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. * @param opts.to Specify end time in Unix seconds, default to current time @@ -209,7 +214,7 @@ export class FuturesApi { public async listFuturesTrades( settle: 'btc' | 'usdt' | 'usd', contract: string, - opts: { limit?: number; lastId?: string; from?: number; to?: number }, + opts: { limit?: number; offset?: number; lastId?: string; from?: number; to?: number }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + @@ -241,6 +246,10 @@ export class FuturesApi { localVarQueryParameters['limit'] = ObjectSerializer.serialize(opts.limit, 'number'); } + if (opts.offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(opts.offset, 'number'); + } + if (opts.lastId !== undefined) { localVarQueryParameters['last_id'] = ObjectSerializer.serialize(opts.lastId, 'string'); } @@ -357,6 +366,83 @@ export class FuturesApi { return this.client.request>(config, 'Array', authSettings); } + /** + * Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval + * @summary Premium Index K-Line + * @param settle Settle currency + * @param contract Futures contract + * @param opts Optional parameters + * @param opts.from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified + * @param opts.to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time + * @param opts.limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. + * @param opts.interval Interval time between data points + */ + public async listFuturesPremiumIndex( + settle: 'btc' | 'usdt' | 'usd', + contract: string, + opts: { + from?: number; + to?: number; + limit?: number; + interval?: '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '6h' | '8h' | '1d' | '7d' | '30d'; + }, + ): Promise<{ response: AxiosResponse; body: Array }> { + const localVarPath = + this.client.basePath + + '/futures/{settle}/premium_index'.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 listFuturesPremiumIndex.'); + } + + // verify required parameter 'contract' is not null or undefined + if (contract === null || contract === undefined) { + throw new Error('Required parameter contract was null or undefined when calling listFuturesPremiumIndex.'); + } + + opts = opts || {}; + localVarQueryParameters['contract'] = ObjectSerializer.serialize(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.interval !== undefined) { + localVarQueryParameters['interval'] = ObjectSerializer.serialize( + opts.interval, + "'1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '6h' | '8h' | '1d' | '7d' | '30d'", + ); + } + + const config: AxiosRequestConfig = { + method: 'GET', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = []; + return this.client.request>(config, 'Array', authSettings); + } + /** * * @summary List futures tickers @@ -1349,13 +1435,12 @@ export class FuturesApi { * @param opts.limit Maximum number of records to be returned in a single list * @param opts.offset List offset, starting from 0 * @param opts.lastId Specify list staring point using the `id` of last record in previous list-query results - * @param opts.countTotal Whether to return total number matched. Default to 0(no return) */ public async listFuturesOrders( settle: 'btc' | 'usdt' | 'usd', contract: string, status: 'open' | 'finished', - opts: { limit?: number; offset?: number; lastId?: string; countTotal?: 0 | 1 }, + opts: { limit?: number; offset?: number; lastId?: string }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + @@ -1402,10 +1487,6 @@ export class FuturesApi { localVarQueryParameters['last_id'] = ObjectSerializer.serialize(opts.lastId, 'string'); } - if (opts.countTotal !== undefined) { - localVarQueryParameters['count_total'] = ObjectSerializer.serialize(opts.countTotal, '0 | 1'); - } - const config: AxiosRequestConfig = { method: 'GET', params: localVarQueryParameters, @@ -1516,11 +1597,58 @@ export class FuturesApi { return this.client.request>(config, 'Array', authSettings); } + /** + * - Up to 10 orders per request - If any of the order\'s parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually + * @summary Create a batch of futures orders + * @param settle Settle currency + * @param futuresOrder + */ + public async createBatchFuturesOrder( + settle: 'btc' | 'usdt' | 'usd', + futuresOrder: Array, + ): Promise<{ response: AxiosResponse; body: Array }> { + const localVarPath = + this.client.basePath + + '/futures/{settle}/batch_orders'.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 createBatchFuturesOrder.'); + } + + // verify required parameter 'futuresOrder' is not null or undefined + if (futuresOrder === null || futuresOrder === undefined) { + throw new Error( + 'Required parameter futuresOrder was null or undefined when calling createBatchFuturesOrder.', + ); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(futuresOrder, 'Array'), + }; + + const authSettings = ['apiv4']; + return this.client.request>(config, 'Array', authSettings); + } + /** * Zero-filled order cannot be retrieved 10 minutes after order cancellation * @summary Get a single order * @param settle Settle currency - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. + * @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 60 seconds after the end of the order. After that, only order ID is accepted. */ public async getFuturesOrder( settle: 'btc' | 'usdt' | 'usd', @@ -1566,7 +1694,7 @@ export class FuturesApi { * * @summary Amend an order * @param settle Settle currency - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. + * @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 60 seconds after the end of the order. After that, only order ID is accepted. * @param futuresOrderAmendment */ public async amendFuturesOrder( @@ -1622,7 +1750,7 @@ export class FuturesApi { * * @summary Cancel a single order * @param settle Settle currency - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. + * @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 60 seconds after the end of the order. After that, only order ID is accepted. */ public async cancelFuturesOrder( settle: 'btc' | 'usdt' | 'usd', @@ -1674,18 +1802,10 @@ export class FuturesApi { * @param opts.limit Maximum number of records to be returned in a single list * @param opts.offset List offset, starting from 0 * @param opts.lastId Specify list staring point using the `id` of last record in previous list-query results - * @param opts.countTotal Whether to return total number matched. Default to 0(no return) */ public async getMyTrades( settle: 'btc' | 'usdt' | 'usd', - opts: { - contract?: string; - order?: number; - limit?: number; - offset?: number; - lastId?: string; - countTotal?: 0 | 1; - }, + opts: { contract?: string; order?: number; limit?: number; offset?: number; lastId?: string }, ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + @@ -1726,10 +1846,6 @@ export class FuturesApi { localVarQueryParameters['last_id'] = ObjectSerializer.serialize(opts.lastId, 'string'); } - if (opts.countTotal !== undefined) { - localVarQueryParameters['count_total'] = ObjectSerializer.serialize(opts.countTotal, '0 | 1'); - } - const config: AxiosRequestConfig = { method: 'GET', params: localVarQueryParameters, @@ -1861,6 +1977,53 @@ export class FuturesApi { 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 + * @param settle Settle currency + * @param countdownCancelAllFuturesTask + */ + public async countdownCancelAllFutures( + settle: 'btc' | 'usdt' | 'usd', + countdownCancelAllFuturesTask: CountdownCancelAllFuturesTask, + ): Promise<{ response: AxiosResponse; body: TriggerTime }> { + const localVarPath = + this.client.basePath + + '/futures/{settle}/countdown_cancel_all'.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 countdownCancelAllFutures.'); + } + + // verify required parameter 'countdownCancelAllFuturesTask' is not null or undefined + if (countdownCancelAllFuturesTask === null || countdownCancelAllFuturesTask === undefined) { + throw new Error( + 'Required parameter countdownCancelAllFuturesTask was null or undefined when calling countdownCancelAllFutures.', + ); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(countdownCancelAllFuturesTask, 'CountdownCancelAllFuturesTask'), + }; + + const authSettings = ['apiv4']; + return this.client.request(config, 'TriggerTime', authSettings); + } + /** * * @summary List all auto orders @@ -2032,7 +2195,7 @@ export class FuturesApi { /** * - * @summary Get a single order + * @summary Get a price-triggered order * @param settle Settle currency * @param orderId Retrieve the data of the order with the specified ID */ diff --git a/api/optionsApi.ts b/api/optionsApi.ts index e1b9118..28e98ae 100644 --- a/api/optionsApi.ts +++ b/api/optionsApi.ts @@ -15,6 +15,7 @@ import { FuturesOrderBook } from '../model/futuresOrderBook'; import { FuturesTrade } from '../model/futuresTrade'; import { OptionsAccount } from '../model/optionsAccount'; import { OptionsAccountBook } from '../model/optionsAccountBook'; +import { OptionsCandlestick } from '../model/optionsCandlestick'; import { OptionsContract } from '../model/optionsContract'; import { OptionsMySettlements } from '../model/optionsMySettlements'; import { OptionsMyTrade } from '../model/optionsMyTrade'; @@ -74,7 +75,7 @@ export class OptionsApi { /** * * @summary List all expiration times - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) */ public async listOptionsExpirations(underlying: string): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + '/options/expirations'; @@ -109,7 +110,7 @@ export class OptionsApi { /** * * @summary List all the contracts with specified underlying and expiration time - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) * @param opts Optional parameters * @param opts.expiration Unix timestamp of the expiration time */ @@ -189,7 +190,7 @@ export class OptionsApi { /** * * @summary List settlement history - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) * @param opts Optional parameters * @param opts.limit Maximum number of records to be returned in a single list * @param opts.offset List offset, starting from 0 @@ -250,7 +251,7 @@ export class OptionsApi { * * @summary Get specified contract\'s settlement * @param contract - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) * @param at */ public async getOptionsSettlement( @@ -304,9 +305,9 @@ export class OptionsApi { /** * * @summary List my options settlements - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) * @param opts Optional parameters - * @param opts.contract Contract name + * @param opts.contract Options contract name * @param opts.limit Maximum number of records to be returned in a single list * @param opts.offset List offset, starting from 0 * @param opts.from Start timestamp @@ -370,8 +371,8 @@ export class OptionsApi { /** * Bids will be sorted by price from high to low, while asks sorted reversely - * @summary Futures order book - * @param contract Futures contract + * @summary Options order book + * @param contract Options contract name * @param opts Optional parameters * @param opts.interval Order depth. 0 means no aggregation is applied. default to 0 * @param opts.limit Maximum number of order depth data in asks or bids @@ -426,7 +427,7 @@ export class OptionsApi { /** * * @summary List tickers of options contracts - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) */ public async listOptionsTickers( underlying: string, @@ -504,8 +505,8 @@ export class OptionsApi { /** * - * @summary Get futures candlesticks - * @param contract Futures contract + * @summary Get options candlesticks + * @param contract Options contract name * @param opts Optional parameters * @param opts.limit Maximum number of records to be returned in a single list * @param opts.from Start timestamp @@ -515,7 +516,7 @@ export class OptionsApi { public async listOptionsCandlesticks( contract: string, opts: { limit?: number; from?: number; to?: number; interval?: '1m' | '5m' | '15m' | '30m' | '1h' }, - ): Promise<{ response: AxiosResponse; body: Array }> { + ): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + '/options/candlesticks'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); @@ -562,13 +563,13 @@ export class OptionsApi { }; const authSettings = []; - return this.client.request>(config, 'Array', authSettings); + return this.client.request>(config, 'Array', authSettings); } /** * * @summary Mark price candlesticks of an underlying - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) * @param opts Optional parameters * @param opts.limit Maximum number of records to be returned in a single list * @param opts.from Start timestamp @@ -634,7 +635,7 @@ export class OptionsApi { * * @summary Options trade history * @param opts Optional parameters - * @param opts.contract Contract name + * @param opts.contract Options contract name * @param opts.type `C` is call, while `P` is put * @param opts.limit Maximum number of records to be returned in a single list * @param opts.offset List offset, starting from 0 @@ -860,9 +861,9 @@ export class OptionsApi { /** * * @summary List user\'s liquidation history of specified underlying - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) * @param opts Optional parameters - * @param opts.contract Contract name + * @param opts.contract Options contract name */ public async listOptionsPositionClose( underlying: string, @@ -906,10 +907,10 @@ export class OptionsApi { /** * - * @summary List futures orders + * @summary List options orders * @param status Only list the orders with this status * @param opts Optional parameters - * @param opts.contract Contract name + * @param opts.contract Options contract name * @param opts.underlying Underlying * @param opts.limit Maximum number of records to be returned in a single list * @param opts.offset List offset, starting from 0 @@ -1014,7 +1015,7 @@ export class OptionsApi { * * @summary Cancel all `open` orders matched * @param opts Optional parameters - * @param opts.contract Contract name + * @param opts.contract Options contract name * @param opts.underlying Underlying * @param opts.side All bids or asks. Both included if not specified */ @@ -1131,9 +1132,9 @@ export class OptionsApi { /** * * @summary List personal trading history - * @param underlying Underlying + * @param underlying Underlying (Obtained by listing underlying endpoint) * @param opts Optional parameters - * @param opts.contract Contract name + * @param opts.contract Options contract name * @param opts.limit Maximum number of records to be returned in a single list * @param opts.offset List offset, starting from 0 * @param opts.from Start timestamp diff --git a/api/spotApi.ts b/api/spotApi.ts index f324ac1..6fc9aec 100644 --- a/api/spotApi.ts +++ b/api/spotApi.ts @@ -13,6 +13,7 @@ import { BatchOrder } from '../model/batchOrder'; import { CancelOrder } from '../model/cancelOrder'; import { CancelOrderResult } from '../model/cancelOrderResult'; +import { CountdownCancelAllSpotTask } from '../model/countdownCancelAllSpotTask'; import { Currency } from '../model/currency'; import { CurrencyPair } from '../model/currencyPair'; import { LiquidateOrder } from '../model/liquidateOrder'; @@ -26,6 +27,7 @@ import { Ticker } from '../model/ticker'; import { Trade } from '../model/trade'; import { TradeFee } from '../model/tradeFee'; import { TriggerOrderResponse } from '../model/triggerOrderResponse'; +import { TriggerTime } from '../model/triggerTime'; import { ObjectSerializer } from '../model/models'; import { ApiClient } from './apiClient'; import { AxiosRequestConfig, AxiosResponse } from 'axios'; @@ -274,7 +276,7 @@ export class SpotApi { * @summary Retrieve market trades * @param currencyPair Currency pair * @param opts Optional parameters - * @param opts.limit Maximum number of records to be returned in a single list + * @param opts.limit Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 * @param opts.lastId Specify list staring point using the `id` of last record in previous list-query results * @param opts.reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. * @param opts.from Start timestamp of the query @@ -802,7 +804,7 @@ export class SpotApi { /** * Spot and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin. * @summary Get a single order - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. + * @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 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 @@ -856,7 +858,7 @@ export class SpotApi { /** * Spot and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin * @summary Cancel a single order - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. + * @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 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 @@ -908,10 +910,10 @@ export class SpotApi { } /** - * 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 Time range parameters are handled as order finish time. + * 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 - * @param currencyPair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. * @param opts Optional parameters + * @param opts.currencyPair Retrieve results with specified currency pair * @param opts.limit Maximum number of records to be returned in a single list * @param opts.page Page number * @param opts.orderId Filter trades with specified order ID. `currency_pair` is also required if this field is present @@ -919,10 +921,15 @@ export class SpotApi { * @param opts.from Start timestamp of the query * @param opts.to Time range ending, default to current time */ - public async listMyTrades( - currencyPair: string, - opts: { limit?: number; page?: number; orderId?: string; account?: string; from?: number; to?: number }, - ): Promise<{ response: AxiosResponse; body: Array }> { + public async listMyTrades(opts: { + currencyPair?: string; + limit?: number; + page?: number; + orderId?: string; + account?: string; + from?: number; + to?: number; + }): Promise<{ response: AxiosResponse; body: Array }> { const localVarPath = this.client.basePath + '/spot/my_trades'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); @@ -934,13 +941,10 @@ export class SpotApi { localVarHeaderParams.Accept = produces.join(','); } - // 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 listMyTrades.'); - } - opts = opts || {}; - localVarQueryParameters['currency_pair'] = ObjectSerializer.serialize(currencyPair, 'string'); + if (opts.currencyPair !== undefined) { + localVarQueryParameters['currency_pair'] = ObjectSerializer.serialize(opts.currencyPair, 'string'); + } if (opts.limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(opts.limit, 'number'); @@ -1004,6 +1008,44 @@ export class SpotApi { return this.client.request(config, 'SystemTime', 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 + * @param countdownCancelAllSpotTask + */ + public async countdownCancelAllSpot( + countdownCancelAllSpotTask: CountdownCancelAllSpotTask, + ): Promise<{ response: AxiosResponse; body: TriggerTime }> { + const localVarPath = this.client.basePath + '/spot/countdown_cancel_all'; + 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 'countdownCancelAllSpotTask' is not null or undefined + if (countdownCancelAllSpotTask === null || countdownCancelAllSpotTask === undefined) { + throw new Error( + 'Required parameter countdownCancelAllSpotTask was null or undefined when calling countdownCancelAllSpot.', + ); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(countdownCancelAllSpotTask, 'CountdownCancelAllSpotTask'), + }; + + const authSettings = ['apiv4']; + return this.client.request(config, 'TriggerTime', authSettings); + } + /** * * @summary Retrieve running auto order list @@ -1162,7 +1204,7 @@ export class SpotApi { /** * - * @summary Get a single order + * @summary Get a price-triggered order * @param orderId Retrieve the data of the order with the specified ID */ public async getSpotPriceTriggeredOrder( diff --git a/api/subAccountApi.ts b/api/subAccountApi.ts new file mode 100644 index 0000000..52a53bd --- /dev/null +++ b/api/subAccountApi.ts @@ -0,0 +1,398 @@ +/** + * 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 { SubAccount } from '../model/subAccount'; +import { SubAccountKey } from '../model/subAccountKey'; +import { ObjectSerializer } from '../model/models'; +import { ApiClient } from './apiClient'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export class SubAccountApi { + protected client: ApiClient; + + constructor(client?: ApiClient) { + if (client) { + this.client = client; + } else { + this.client = new ApiClient(); + } + } + + /** + * + * @summary List sub-accounts + */ + public async listSubAccounts(): Promise<{ response: AxiosResponse; body: Array }> { + const localVarPath = this.client.basePath + '/sub_accounts'; + 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(','); + } + + const config: AxiosRequestConfig = { + method: 'GET', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request>(config, 'Array', authSettings); + } + + /** + * + * @summary Create a new sub-account + * @param subAccount + */ + public async createSubAccounts(subAccount: SubAccount): Promise<{ response: AxiosResponse; body: SubAccount }> { + const localVarPath = this.client.basePath + '/sub_accounts'; + 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 'subAccount' is not null or undefined + if (subAccount === null || subAccount === undefined) { + throw new Error('Required parameter subAccount was null or undefined when calling createSubAccounts.'); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(subAccount, 'SubAccount'), + }; + + const authSettings = ['apiv4']; + return this.client.request(config, 'SubAccount', authSettings); + } + + /** + * + * @summary Get the sub-account + * @param userId Sub-account user id + */ + public async getSubAccount(userId: number): Promise<{ response: AxiosResponse; body: SubAccount }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}'.replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))); + 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 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling getSubAccount.'); + } + + const config: AxiosRequestConfig = { + method: 'GET', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request(config, 'SubAccount', authSettings); + } + + /** + * + * @summary List all API Key of the sub-account + * @param userId Sub-account user id + */ + public async listSubAccountKeys(userId: number): Promise<{ response: AxiosResponse; body: Array }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}/keys'.replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))); + 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 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling listSubAccountKeys.'); + } + + const config: AxiosRequestConfig = { + method: 'GET', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request>(config, 'Array', authSettings); + } + + /** + * + * @summary Create API Key of the sub-account + * @param userId Sub-account user id + * @param subAccountKey + */ + public async createSubAccountKeys( + userId: number, + subAccountKey: SubAccountKey, + ): Promise<{ response: AxiosResponse; body: Array }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}/keys'.replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))); + 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 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling createSubAccountKeys.'); + } + + // verify required parameter 'subAccountKey' is not null or undefined + if (subAccountKey === null || subAccountKey === undefined) { + throw new Error( + 'Required parameter subAccountKey was null or undefined when calling createSubAccountKeys.', + ); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(subAccountKey, 'SubAccountKey'), + }; + + const authSettings = ['apiv4']; + return this.client.request>(config, 'Array', authSettings); + } + + /** + * + * @summary Get the API Key of the sub-account + * @param userId Sub-account user id + * @param key The API Key of the sub-account + */ + public async getSubAccountKey( + userId: number, + key: string, + ): Promise<{ response: AxiosResponse; body: SubAccountKey }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}/keys/{key}' + .replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))) + .replace('{' + 'key' + '}', encodeURIComponent(String(key))); + 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 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling getSubAccountKey.'); + } + + // verify required parameter 'key' is not null or undefined + if (key === null || key === undefined) { + throw new Error('Required parameter key was null or undefined when calling getSubAccountKey.'); + } + + const config: AxiosRequestConfig = { + method: 'GET', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request(config, 'SubAccountKey', authSettings); + } + + /** + * + * @summary Update API key of the sub-account + * @param userId Sub-account user id + * @param key The API Key of the sub-account + * @param subAccountKey + */ + public async updateSubAccountKeys( + userId: number, + key: string, + subAccountKey: SubAccountKey, + ): Promise<{ response: AxiosResponse; body?: any }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}/keys/{key}' + .replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))) + .replace('{' + 'key' + '}', encodeURIComponent(String(key))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); + + // verify required parameter 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling updateSubAccountKeys.'); + } + + // verify required parameter 'key' is not null or undefined + if (key === null || key === undefined) { + throw new Error('Required parameter key was null or undefined when calling updateSubAccountKeys.'); + } + + // verify required parameter 'subAccountKey' is not null or undefined + if (subAccountKey === null || subAccountKey === undefined) { + throw new Error( + 'Required parameter subAccountKey was null or undefined when calling updateSubAccountKeys.', + ); + } + + const config: AxiosRequestConfig = { + method: 'PUT', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(subAccountKey, 'SubAccountKey'), + }; + + const authSettings = ['apiv4']; + return this.client.request(config, '', authSettings); + } + + /** + * + * @summary Delete API key of the sub-account + * @param userId Sub-account user id + * @param key The API Key of the sub-account + */ + public async deleteSubAccountKeys(userId: number, key: string): Promise<{ response: AxiosResponse; body?: any }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}/keys/{key}' + .replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))) + .replace('{' + 'key' + '}', encodeURIComponent(String(key))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); + + // verify required parameter 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling deleteSubAccountKeys.'); + } + + // verify required parameter 'key' is not null or undefined + if (key === null || key === undefined) { + throw new Error('Required parameter key was null or undefined when calling deleteSubAccountKeys.'); + } + + const config: AxiosRequestConfig = { + method: 'DELETE', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request(config, '', authSettings); + } + + /** + * + * @summary Lock the sub-account + * @param userId The user id of the sub-account + */ + public async lockSubAccount(userId: number): Promise<{ response: AxiosResponse; body?: any }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}/lock'.replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); + + // verify required parameter 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling lockSubAccount.'); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request(config, '', authSettings); + } + + /** + * + * @summary Unlock the sub-account + * @param userId The user id of the sub-account + */ + public async unlockSubAccount(userId: number): Promise<{ response: AxiosResponse; body?: any }> { + const localVarPath = + this.client.basePath + + '/sub_accounts/{user_id}/unlock'.replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); + + // verify required parameter 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new Error('Required parameter userId was null or undefined when calling unlockSubAccount.'); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + }; + + const authSettings = ['apiv4']; + return this.client.request(config, '', authSettings); + } +} diff --git a/api/walletApi.ts b/api/walletApi.ts index 3e3fbb1..8a8114c 100644 --- a/api/walletApi.ts +++ b/api/walletApi.ts @@ -18,6 +18,7 @@ import { SubAccountBalance } from '../model/subAccountBalance'; import { SubAccountCrossMarginBalance } from '../model/subAccountCrossMarginBalance'; import { SubAccountFuturesBalance } from '../model/subAccountFuturesBalance'; import { SubAccountMarginBalance } from '../model/subAccountMarginBalance'; +import { SubAccountToSubAccount } from '../model/subAccountToSubAccount'; import { SubAccountTransfer } from '../model/subAccountTransfer'; import { TotalBalance } from '../model/totalBalance'; import { TradeFee } from '../model/tradeFee'; @@ -273,7 +274,7 @@ export class WalletApi { * Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved * @summary Retrieve transfer records between main and sub accounts * @param opts Optional parameters - * @param opts.subUid Sub account user ID. Return records related to all sub accounts if not specified + * @param opts.subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts * @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 @@ -360,6 +361,37 @@ export class WalletApi { return this.client.request(config, '', authSettings); } + /** + * + * @summary Sub-account transfers to sub-account + * @param subAccountToSubAccount + */ + public async subAccountToSubAccount( + subAccountToSubAccount: SubAccountToSubAccount, + ): Promise<{ response: AxiosResponse; body?: any }> { + const localVarPath = this.client.basePath + '/wallet/sub_account_to_sub_account'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); + + // verify required parameter 'subAccountToSubAccount' is not null or undefined + if (subAccountToSubAccount === null || subAccountToSubAccount === undefined) { + throw new Error( + 'Required parameter subAccountToSubAccount was null or undefined when calling subAccountToSubAccount.', + ); + } + + const config: AxiosRequestConfig = { + method: 'POST', + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + data: ObjectSerializer.serialize(subAccountToSubAccount, 'SubAccountToSubAccount'), + }; + + const authSettings = ['apiv4']; + return this.client.request(config, '', authSettings); + } + /** * * @summary Retrieve withdrawal status @@ -400,7 +432,7 @@ export class WalletApi { * * @summary Retrieve sub account balances * @param opts Optional parameters - * @param opts.subUid Sub account user ID. Return records related to all sub accounts if not specified + * @param opts.subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts */ public async listSubAccountBalances(opts: { subUid?: string; @@ -436,7 +468,7 @@ export class WalletApi { * * @summary Query sub accounts\' margin balances * @param opts Optional parameters - * @param opts.subUid Sub account user ID. Return records related to all sub accounts if not specified + * @param opts.subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts */ public async listSubAccountMarginBalances(opts: { subUid?: string; @@ -476,7 +508,7 @@ export class WalletApi { * * @summary Query sub accounts\' futures account balances * @param opts Optional parameters - * @param opts.subUid Sub account user ID. Return records related to all sub accounts if not specified + * @param opts.subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts * @param opts.settle Query only balances of specified settle currency */ public async listSubAccountFuturesBalances(opts: { @@ -522,7 +554,7 @@ export class WalletApi { * * @summary Query subaccount\'s cross_margin account info * @param opts Optional parameters - * @param opts.subUid Sub account user ID. Return records related to all sub accounts if not specified + * @param opts.subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts */ public async listSubAccountCrossMarginBalances(opts: { subUid?: string; @@ -613,8 +645,12 @@ export class WalletApi { * @summary Retrieve personal trading fee * @param opts Optional parameters * @param opts.currencyPair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs + * @param opts.settle Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. */ - public async getTradeFee(opts: { currencyPair?: string }): Promise<{ response: AxiosResponse; body: TradeFee }> { + public async getTradeFee(opts: { + currencyPair?: string; + settle?: 'BTC' | 'USDT' | 'USD'; + }): Promise<{ response: AxiosResponse; body: TradeFee }> { const localVarPath = this.client.basePath + '/wallet/fee'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.client.defaultHeaders); @@ -631,6 +667,10 @@ export class WalletApi { localVarQueryParameters['currency_pair'] = ObjectSerializer.serialize(opts.currencyPair, 'string'); } + if (opts.settle !== undefined) { + localVarQueryParameters['settle'] = ObjectSerializer.serialize(opts.settle, "'BTC' | 'USDT' | 'USD'"); + } + const config: AxiosRequestConfig = { method: 'GET', params: localVarQueryParameters, diff --git a/docs/ApiV4KeyPerm.md b/docs/ApiV4KeyPerm.md new file mode 100644 index 0000000..cbcdd17 --- /dev/null +++ b/docs/ApiV4KeyPerm.md @@ -0,0 +1,24 @@ +# ApiV4KeyPerm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options | [optional] [default to undefined] +**readOnly** | **boolean** | read only | [optional] [default to undefined] + +## Enum: ApiV4KeyPerm.Name + +* `Wallet` (value: `'wallet'`) + +* `Spot` (value: `'spot'`) + +* `Futures` (value: `'futures'`) + +* `Delivery` (value: `'delivery'`) + +* `Earn` (value: `'earn'`) + +* `Options` (value: `'options'`) + + diff --git a/docs/BatchFuturesOrder.md b/docs/BatchFuturesOrder.md new file mode 100644 index 0000000..91a5841 --- /dev/null +++ b/docs/BatchFuturesOrder.md @@ -0,0 +1,77 @@ +# BatchFuturesOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**succeeded** | **boolean** | Whether the batch of orders succeeded | [optional] [default to undefined] +**label** | **string** | Error label, only exists if execution fails | [optional] [default to undefined] +**detail** | **string** | Error detail, only present if execution failed and details need to be given | [optional] [default to undefined] +**id** | **number** | Futures order ID | [optional] [readonly] [default to undefined] +**user** | **number** | User ID | [optional] [readonly] [default to undefined] +**createTime** | **number** | Creation time of order | [optional] [readonly] [default to undefined] +**finishTime** | **number** | Order finished time. Not returned if order is open | [optional] [readonly] [default to undefined] +**finishAs** | **string** | How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close | [optional] [readonly] [default to undefined] +**status** | **string** | Order status - `open`: waiting to be traded - `finished`: finished | [optional] [readonly] [default to undefined] +**contract** | **string** | Futures contract | [optional] [default to undefined] +**size** | **number** | Order size. Specify positive number to make a bid, and negative number to ask | [optional] [default to undefined] +**iceberg** | **number** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional] [default to undefined] +**price** | **string** | Order price. 0 for market order with `tif` set as `ioc` | [optional] [default to undefined] +**close** | **boolean** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to undefined] +**isClose** | **boolean** | Is the order to close position | [optional] [readonly] [default to undefined] +**reduceOnly** | **boolean** | Set as `true` to be reduce-only order | [optional] [default to undefined] +**isReduceOnly** | **boolean** | Is the order reduce-only | [optional] [readonly] [default to undefined] +**isLiq** | **boolean** | Is the order for liquidation | [optional] [readonly] [default to undefined] +**tif** | **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'] +**left** | **number** | Size left to be traded | [optional] [readonly] [default to undefined] +**fillPrice** | **string** | Fill price of the order | [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(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] [default to undefined] +**tkfr** | **string** | Taker fee | [optional] [readonly] [default to undefined] +**mkfr** | **string** | Maker fee | [optional] [readonly] [default to undefined] +**refu** | **number** | Reference user ID | [optional] [readonly] [default to undefined] +**autoSize** | **string** | Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 | [optional] [default to undefined] + +## Enum: BatchFuturesOrder.FinishAs + +* `Filled` (value: `'filled'`) + +* `Cancelled` (value: `'cancelled'`) + +* `Liquidated` (value: `'liquidated'`) + +* `Ioc` (value: `'ioc'`) + +* `AutoDeleveraged` (value: `'auto_deleveraged'`) + +* `ReduceOnly` (value: `'reduce_only'`) + +* `PositionClosed` (value: `'position_closed'`) + +* `ReduceOut` (value: `'reduce_out'`) + + +## Enum: BatchFuturesOrder.Status + +* `Open` (value: `'open'`) + +* `Finished` (value: `'finished'`) + + +## Enum: BatchFuturesOrder.Tif + +* `Gtc` (value: `'gtc'`) + +* `Ioc` (value: `'ioc'`) + +* `Poc` (value: `'poc'`) + +* `Fok` (value: `'fok'`) + + +## Enum: BatchFuturesOrder.AutoSize + +* `Long` (value: `'close_long'`) + +* `Short` (value: `'close_short'`) + + diff --git a/docs/CountdownCancelAllFuturesTask.md b/docs/CountdownCancelAllFuturesTask.md new file mode 100644 index 0000000..1d76f59 --- /dev/null +++ b/docs/CountdownCancelAllFuturesTask.md @@ -0,0 +1,9 @@ +# CountdownCancelAllFuturesTask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeout** | **number** | Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown | [default to undefined] +**contract** | **string** | Futures contract | [optional] [default to undefined] + diff --git a/docs/CountdownCancelAllSpotTask.md b/docs/CountdownCancelAllSpotTask.md new file mode 100644 index 0000000..3c7bb00 --- /dev/null +++ b/docs/CountdownCancelAllSpotTask.md @@ -0,0 +1,9 @@ +# CountdownCancelAllSpotTask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeout** | **number** | Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown | [default to undefined] +**currencyPair** | **string** | Currency pair | [optional] [default to undefined] + diff --git a/docs/DeliveryApi.md b/docs/DeliveryApi.md index 951715b..8916daf 100644 --- a/docs/DeliveryApi.md +++ b/docs/DeliveryApi.md @@ -30,7 +30,7 @@ Method | HTTP request | Description [**listPriceTriggeredDeliveryOrders**](DeliveryApi.md#listPriceTriggeredDeliveryOrders) | **GET** /delivery/{settle}/price_orders | List all auto orders [**createPriceTriggeredDeliveryOrder**](DeliveryApi.md#createPriceTriggeredDeliveryOrder) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order [**cancelPriceTriggeredDeliveryOrderList**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrderList) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders -[**getPriceTriggeredDeliveryOrder**](DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order +[**getPriceTriggeredDeliveryOrder**](DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order [**cancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order @@ -49,7 +49,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency api.listDeliveryContracts(settle) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -90,7 +90,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract api.getDeliveryContract(settle, contract) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -135,7 +135,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract const opts = { 'interval': '0', // '0' | '0.1' | '0.01' | Order depth. 0 means no aggregation is applied. default to 0 @@ -186,7 +186,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract const opts = { 'limit': 100, // number | Maximum number of records to be returned in a single list @@ -241,7 +241,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract const opts = { 'from': 1546905600, // number | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified @@ -294,7 +294,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const opts = { 'contract': "BTC_USDT_20200814" // string | Futures contract }; @@ -339,7 +339,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const opts = { 'limit': 100 // number | Maximum number of records to be returned in a single list }; @@ -386,7 +386,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency api.listDeliveryAccounts(settle) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -429,7 +429,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const opts = { 'limit': 100, // number | Maximum number of records to be returned in a single list 'from': 1547706332, // number | Start timestamp @@ -482,7 +482,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency api.listDeliveryPositions(settle) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -525,7 +525,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract api.getDeliveryPosition(settle, contract) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -570,7 +570,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract const change = "0.01"; // string | Margin change. Use positive number to increase margin, negative number otherwise. api.updateDeliveryPositionMargin(settle, contract, change) @@ -617,7 +617,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract const leverage = "10"; // string | New position leverage api.updateDeliveryPositionLeverage(settle, contract, leverage) @@ -664,7 +664,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract const riskLimit = "10"; // string | New position risk limit api.updateDeliveryPositionRiskLimit(settle, contract, riskLimit) @@ -713,7 +713,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const status = "open"; // 'open' | 'finished' | Only list the orders with this status const opts = { 'contract': "BTC_USDT_20200814", // string | Futures contract @@ -772,7 +772,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const futuresOrder = new FuturesOrder(); // FuturesOrder | api.createDeliveryOrder(settle, futuresOrder) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -819,7 +819,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const contract = "BTC_USDT_20200814"; // string | Futures contract const opts = { 'side': "ask" // 'ask' | 'bid' | All bids or asks. Both included if not specified @@ -870,7 +870,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const orderId = "12345"; // string | Retrieve the data of the order with the specified ID api.getDeliveryOrder(settle, orderId) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -915,7 +915,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const orderId = "12345"; // string | Retrieve the data of the order with the specified ID api.cancelDeliveryOrder(settle, orderId) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -960,7 +960,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const opts = { 'contract': "BTC_USDT_20200814", // string | Futures contract 'order': 12345, // number | Futures order ID, return related data only if specified @@ -1017,7 +1017,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const opts = { 'contract': "BTC_USDT_20200814", // string | Futures contract 'limit': 100 // number | Maximum number of records to be returned in a single list @@ -1066,7 +1066,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const opts = { 'contract': "BTC_USDT_20200814", // string | Futures contract 'limit': 100, // number | Maximum number of records to be returned in a single list @@ -1117,7 +1117,7 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.DeliveryApi(client); -const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const settle = "usdt"; // 'usdt' | 'btc' | Settle currency const opts = { 'contract': "BTC_USDT_20200814", // string | Futures contract 'limit': 100, // number | Maximum number of records to be returned in a single list @@ -1298,7 +1298,7 @@ Promise<{ response: AxiosResponse; body: Array; }> [ > Promise<{ response: http.IncomingMessage; body: FuturesPriceTriggeredOrder; }> getPriceTriggeredDeliveryOrder(settle, orderId) -Get a single order +Get a price-triggered order ### Example diff --git a/docs/FuturesAccount.md b/docs/FuturesAccount.md index 4bae4fc..cd09d1c 100644 --- a/docs/FuturesAccount.md +++ b/docs/FuturesAccount.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **string** | total = position_margin + order_margin + available | [optional] [default to undefined] +**total** | **string** | total is the balance after the user\'s accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) | [optional] [default to undefined] **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] diff --git a/docs/FuturesApi.md b/docs/FuturesApi.md index a4abdc7..3c88dfd 100644 --- a/docs/FuturesApi.md +++ b/docs/FuturesApi.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**listFuturesOrderBook**](FuturesApi.md#listFuturesOrderBook) | **GET** /futures/{settle}/order_book | Futures order book [**listFuturesTrades**](FuturesApi.md#listFuturesTrades) | **GET** /futures/{settle}/trades | Futures trading history [**listFuturesCandlesticks**](FuturesApi.md#listFuturesCandlesticks) | **GET** /futures/{settle}/candlesticks | Get futures candlesticks +[**listFuturesPremiumIndex**](FuturesApi.md#listFuturesPremiumIndex) | **GET** /futures/{settle}/premium_index | Premium Index K-Line [**listFuturesTickers**](FuturesApi.md#listFuturesTickers) | **GET** /futures/{settle}/tickers | List futures tickers [**listFuturesFundingRateHistory**](FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Funding rate history [**listFuturesInsuranceLedger**](FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures insurance balance history @@ -30,16 +31,18 @@ Method | HTTP request | Description [**listFuturesOrders**](FuturesApi.md#listFuturesOrders) | **GET** /futures/{settle}/orders | List futures orders [**createFuturesOrder**](FuturesApi.md#createFuturesOrder) | **POST** /futures/{settle}/orders | Create a futures order [**cancelFuturesOrders**](FuturesApi.md#cancelFuturesOrders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched +[**createBatchFuturesOrder**](FuturesApi.md#createBatchFuturesOrder) | **POST** /futures/{settle}/batch_orders | Create a batch of futures orders [**getFuturesOrder**](FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order [**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 [**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history [**listLiquidates**](FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | List liquidation 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 [**cancelPriceTriggeredOrderList**](FuturesApi.md#cancelPriceTriggeredOrderList) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders -[**getPriceTriggeredOrder**](FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order +[**getPriceTriggeredOrder**](FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a price-triggered order [**cancelPriceTriggeredOrder**](FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order @@ -199,6 +202,7 @@ const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency const contract = "BTC_USDT"; // string | Futures contract const opts = { 'limit': 100, // number | Maximum number of records to be returned in a single list + 'offset': 0, // number | List offset, starting from 0 'lastId': "12345", // string | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range 'from': 1546905600, // number | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. 'to': 1546935600 // number | Specify end time in Unix seconds, default to current time @@ -216,6 +220,7 @@ Name | Type | Description | Notes **settle** | **Settle**| Settle currency | [default to undefined] **contract** | **string**| Futures contract | [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] **lastId** | **string**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] [default to undefined] **from** | **number**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] [default to undefined] **to** | **number**| Specify end time in Unix seconds, default to current time | [optional] [default to undefined] @@ -288,6 +293,61 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +## listFuturesPremiumIndex + +> Promise<{ response: http.IncomingMessage; body: Array; }> listFuturesPremiumIndex(settle, contract, opts) + +Premium Index K-Line + +Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval + +### 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" + +const api = new GateApi.FuturesApi(client); +const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency +const contract = "BTC_USDT"; // string | Futures contract +const opts = { + 'from': 1546905600, // number | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified + 'to': 1546935600, // number | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time + 'limit': 100, // number | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. + 'interval': '5m' // '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '6h' | '8h' | '1d' | '7d' | '30d' | Interval time between data points +}; +api.listFuturesPremiumIndex(settle, contract, 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 | [default to undefined] + **from** | **number**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] [default to undefined] + **to** | **number**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] [default to undefined] + **limit** | **number**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] + **interval** | **Interval**| Interval time between data points | [optional] [default to '5m'] + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [FuturesPremiumIndex](FuturesPremiumIndex.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + ## listFuturesTickers > Promise<{ response: http.IncomingMessage; body: Array; }> listFuturesTickers(settle, opts) @@ -1165,8 +1225,7 @@ const status = "open"; // 'open' | 'finished' | Only list the orders with this s const opts = { 'limit': 100, // number | Maximum number of records to be returned in a single list 'offset': 0, // number | List offset, starting from 0 - 'lastId': "12345", // string | Specify list staring point using the `id` of last record in previous list-query results - 'countTotal': 0 // 0 | 1 | Whether to return total number matched. Default to 0(no return) + 'lastId': "12345" // string | Specify list staring point using the `id` of last record in previous list-query results }; api.listFuturesOrders(settle, contract, status, opts) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -1184,7 +1243,6 @@ Name | Type | Description | Notes **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] **lastId** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] [default to undefined] - **countTotal** | **CountTotal**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] ### Return type @@ -1297,6 +1355,53 @@ Promise<{ response: AxiosResponse; body: Array; }> [FuturesOrder]( - **Content-Type**: Not defined - **Accept**: application/json +## createBatchFuturesOrder + +> Promise<{ response: http.IncomingMessage; body: Array; }> createBatchFuturesOrder(settle, futuresOrder) + +Create a batch of futures orders + +- Up to 10 orders per request - If any of the order\'s parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually + +### 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 futuresOrder = [new FuturesOrder()]; // Array | +api.createBatchFuturesOrder(settle, futuresOrder) + .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] + **futuresOrder** | [**Array<FuturesOrder>**](FuturesOrder.md)| | + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [BatchFuturesOrder](BatchFuturesOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## getFuturesOrder > Promise<{ response: http.IncomingMessage; body: FuturesOrder; }> getFuturesOrder(settle, orderId) @@ -1317,7 +1422,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.FuturesApi(client); const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency -const orderId = "12345"; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +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 60 seconds after the end of the order. After that, only order ID is accepted. api.getFuturesOrder(settle, orderId) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -1329,7 +1434,7 @@ api.getFuturesOrder(settle, orderId) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **Settle**| Settle currency | [default to undefined] - **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | [default to undefined] + **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 60 seconds after the end of the order. After that, only order ID is accepted. | [default to undefined] ### Return type @@ -1362,7 +1467,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.FuturesApi(client); const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency -const orderId = "12345"; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +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 60 seconds after the end of the order. After that, only order ID is accepted. const futuresOrderAmendment = new FuturesOrderAmendment(); // FuturesOrderAmendment | api.amendFuturesOrder(settle, orderId, futuresOrderAmendment) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -1375,7 +1480,7 @@ api.amendFuturesOrder(settle, orderId, futuresOrderAmendment) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **Settle**| Settle currency | [default to undefined] - **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | [default to undefined] + **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 60 seconds after the end of the order. After that, only order ID is accepted. | [default to undefined] **futuresOrderAmendment** | [**FuturesOrderAmendment**](FuturesOrderAmendment.md)| | ### Return type @@ -1409,7 +1514,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.FuturesApi(client); const settle = "usdt"; // 'btc' | 'usdt' | 'usd' | Settle currency -const orderId = "12345"; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +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 60 seconds after the end of the order. After that, only order ID is accepted. api.cancelFuturesOrder(settle, orderId) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -1421,7 +1526,7 @@ api.cancelFuturesOrder(settle, orderId) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **Settle**| Settle currency | [default to undefined] - **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | [default to undefined] + **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 60 seconds after the end of the order. After that, only order ID is accepted. | [default to undefined] ### Return type @@ -1459,8 +1564,7 @@ const opts = { 'order': 12345, // number | Futures order ID, return related data only if specified 'limit': 100, // number | Maximum number of records to be returned in a single list 'offset': 0, // number | List offset, starting from 0 - 'lastId': "12345", // string | Specify list staring point using the `id` of last record in previous list-query results - 'countTotal': 0 // 0 | 1 | Whether to return total number matched. Default to 0(no return) + 'lastId': "12345" // string | Specify list staring point using the `id` of last record in previous list-query results }; api.getMyTrades(settle, opts) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -1478,7 +1582,6 @@ Name | Type | Description | Notes **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] **lastId** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] [default to undefined] - **countTotal** | **CountTotal**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] ### Return type @@ -1599,6 +1702,53 @@ Promise<{ response: AxiosResponse; body: Array; }> [FuturesLiq - **Content-Type**: Not defined - **Accept**: application/json +## countdownCancelAllFutures + +> Promise<{ response: http.IncomingMessage; body: TriggerTime; }> countdownCancelAllFutures(settle, countdownCancelAllFuturesTask) + +Countdown cancel orders + +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. + +### 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 countdownCancelAllFuturesTask = new CountdownCancelAllFuturesTask(); // CountdownCancelAllFuturesTask | +api.countdownCancelAllFutures(settle, countdownCancelAllFuturesTask) + .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] + **countdownCancelAllFuturesTask** | [**CountdownCancelAllFuturesTask**](CountdownCancelAllFuturesTask.md)| | + +### Return type + +Promise<{ response: AxiosResponse; body: TriggerTime; }> [TriggerTime](TriggerTime.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## listPriceTriggeredOrders > Promise<{ response: http.IncomingMessage; body: Array; }> listPriceTriggeredOrders(settle, status, opts) @@ -1746,7 +1896,7 @@ Promise<{ response: AxiosResponse; body: Array; }> [ > Promise<{ response: http.IncomingMessage; body: FuturesPriceTriggeredOrder; }> getPriceTriggeredOrder(settle, orderId) -Get a single order +Get a price-triggered order ### Example diff --git a/docs/FuturesCandlestick.md b/docs/FuturesCandlestick.md index 7230b14..2480dfa 100644 --- a/docs/FuturesCandlestick.md +++ b/docs/FuturesCandlestick.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **t** | **number** | Unix timestamp in seconds | [optional] [default to undefined] -**v** | **number** | size volume. Only returned if `contract` is not prefixed | [optional] [default to undefined] -**c** | **string** | Close price | [optional] [default to undefined] -**h** | **string** | Highest price | [optional] [default to undefined] -**l** | **string** | Lowest price | [optional] [default to undefined] -**o** | **string** | Open price | [optional] [default to undefined] +**v** | **number** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] [default to undefined] +**c** | **string** | Close price (quote currency) | [optional] [default to undefined] +**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] diff --git a/docs/FuturesOrder.md b/docs/FuturesOrder.md index 55b5bc0..461f556 100644 --- a/docs/FuturesOrder.md +++ b/docs/FuturesOrder.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **reduceOnly** | **boolean** | Set as `true` to be reduce-only order | [optional] [default to undefined] **isReduceOnly** | **boolean** | Is the order reduce-only | [optional] [readonly] [default to undefined] **isLiq** | **boolean** | Is the order for liquidation | [optional] [readonly] [default to undefined] -**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only | [optional] [default to 'gtc'] +**tif** | **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'] **left** | **number** | Size left to be traded | [optional] [readonly] [default to undefined] **fillPrice** | **string** | Fill price of the order | [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(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] [default to undefined] @@ -62,6 +62,8 @@ Name | Type | Description | Notes * `Poc` (value: `'poc'`) +* `Fok` (value: `'fok'`) + ## Enum: FuturesOrder.AutoSize diff --git a/docs/FuturesOrderAmendment.md b/docs/FuturesOrderAmendment.md index 16c173d..cef4ce8 100644 --- a/docs/FuturesOrderAmendment.md +++ b/docs/FuturesOrderAmendment.md @@ -5,5 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **size** | **number** | New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. | [optional] [default to undefined] -**price** | **string** | New order price. New price cannot take any orders | [optional] [default to undefined] +**price** | **string** | New order price. | [optional] [default to undefined] diff --git a/docs/FuturesOrderBookItem.md b/docs/FuturesOrderBookItem.md index 7855aad..e0f5662 100644 --- a/docs/FuturesOrderBookItem.md +++ b/docs/FuturesOrderBookItem.md @@ -4,6 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**p** | **string** | Price | [optional] [default to undefined] +**p** | **string** | Price (quote currency) | [optional] [default to undefined] **s** | **number** | Size | [optional] [default to undefined] diff --git a/docs/FuturesPremiumIndex.md b/docs/FuturesPremiumIndex.md new file mode 100644 index 0000000..57b9131 --- /dev/null +++ b/docs/FuturesPremiumIndex.md @@ -0,0 +1,12 @@ +# FuturesPremiumIndex + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **number** | Unix timestamp in seconds | [optional] [default to undefined] +**c** | **string** | Close price | [optional] [default to undefined] +**h** | **string** | Highest price | [optional] [default to undefined] +**l** | **string** | Lowest price` | [optional] [default to undefined] +**o** | **string** | Open price | [optional] [default to undefined] + diff --git a/docs/FuturesTicker.md b/docs/FuturesTicker.md index b089975..c671153 100644 --- a/docs/FuturesTicker.md +++ b/docs/FuturesTicker.md @@ -21,4 +21,6 @@ Name | Type | Description | Notes **fundingRateIndicative** | **string** | Indicative Funding rate in next period | [optional] [default to undefined] **indexPrice** | **string** | Index price | [optional] [default to undefined] **quantoBaseRate** | **string** | Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types | [optional] [default to undefined] +**basisRate** | **string** | Basis rate | [optional] [default to undefined] +**basisValue** | **string** | Basis value | [optional] [default to undefined] diff --git a/docs/FuturesTrade.md b/docs/FuturesTrade.md index da2b3de..7ed9121 100644 --- a/docs/FuturesTrade.md +++ b/docs/FuturesTrade.md @@ -9,5 +9,5 @@ Name | Type | Description | Notes **createTimeMs** | **number** | Trading time, with milliseconds set to 3 decimal places. | [optional] [default to undefined] **contract** | **string** | Futures contract | [optional] [default to undefined] **size** | **number** | Trading size | [optional] [default to undefined] -**price** | **string** | Trading price | [optional] [default to undefined] +**price** | **string** | Trading price (quote currency) | [optional] [default to undefined] diff --git a/docs/LedgerRecord.md b/docs/LedgerRecord.md index 5373b2a..6c13eb0 100644 --- a/docs/LedgerRecord.md +++ b/docs/LedgerRecord.md @@ -12,8 +12,8 @@ Name | Type | Description | Notes **address** | **string** | Withdrawal address. Required for withdrawals | [optional] [default to undefined] **memo** | **string** | Additional remarks with regards to the withdrawal | [optional] [default to undefined] **status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount | [optional] [readonly] [default to undefined] -**chain** | **string** | Name of the chain used in withdrawals | [optional] [default to undefined] -**fee** | **string** | Fee | [optional] [default to undefined] +**chain** | **string** | Name of the chain used in withdrawals | [default to undefined] +**fee** | **string** | Fee | [optional] [readonly] [default to undefined] ## Enum: LedgerRecord.Status diff --git a/docs/OptionsAccountBook.md b/docs/OptionsAccountBook.md index dd68a3c..8ae39fc 100644 --- a/docs/OptionsAccountBook.md +++ b/docs/OptionsAccountBook.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **number** | Change time | [optional] [default to undefined] -**change** | **string** | Amount changed | [optional] [default to undefined] -**balance** | **string** | Account total balance after change | [optional] [default to undefined] +**change** | **string** | Amount changed (USDT) | [optional] [default to undefined] +**balance** | **string** | Account total balance after change (USDT) | [optional] [default to undefined] **type** | **string** | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] [default to undefined] **text** | **string** | custom text | [optional] [default to undefined] diff --git a/docs/OptionsApi.md b/docs/OptionsApi.md index 34b91be..1be7e6e 100644 --- a/docs/OptionsApi.md +++ b/docs/OptionsApi.md @@ -11,10 +11,10 @@ Method | HTTP request | Description [**listOptionsSettlements**](OptionsApi.md#listOptionsSettlements) | **GET** /options/settlements | List settlement history [**getOptionsSettlement**](OptionsApi.md#getOptionsSettlement) | **GET** /options/settlements/{contract} | Get specified contract\'s settlement [**listMyOptionsSettlements**](OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | List my options settlements -[**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Futures order book +[**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Options order book [**listOptionsTickers**](OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | List tickers of options contracts [**listOptionsUnderlyingTickers**](OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker -[**listOptionsCandlesticks**](OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get futures candlesticks +[**listOptionsCandlesticks**](OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get options candlesticks [**listOptionsUnderlyingCandlesticks**](OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying [**listOptionsTrades**](OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Options trade history [**listOptionsAccount**](OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | List options account @@ -22,7 +22,7 @@ Method | HTTP request | Description [**listOptionsPositions**](OptionsApi.md#listOptionsPositions) | **GET** /options/positions | List user\'s positions of specified underlying [**getOptionsPosition**](OptionsApi.md#getOptionsPosition) | **GET** /options/positions/{contract} | Get specified contract position [**listOptionsPositionClose**](OptionsApi.md#listOptionsPositionClose) | **GET** /options/position_close | List user\'s liquidation history of specified underlying -[**listOptionsOrders**](OptionsApi.md#listOptionsOrders) | **GET** /options/orders | List futures orders +[**listOptionsOrders**](OptionsApi.md#listOptionsOrders) | **GET** /options/orders | List options orders [**createOptionsOrder**](OptionsApi.md#createOptionsOrder) | **POST** /options/orders | Create an options order [**cancelOptionsOrders**](OptionsApi.md#cancelOptionsOrders) | **DELETE** /options/orders | Cancel all `open` orders matched [**getOptionsOrder**](OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Get a single order @@ -82,7 +82,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) api.listOptionsExpirations(underlying) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -93,7 +93,7 @@ api.listOptionsExpirations(underlying) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] ### Return type @@ -123,7 +123,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) const opts = { 'expiration': 1636588800 // number | Unix timestamp of the expiration time }; @@ -137,7 +137,7 @@ api.listOptionsContracts(underlying, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] **expiration** | **number**| Unix timestamp of the expiration time | [optional] [default to undefined] ### Return type @@ -209,7 +209,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) const opts = { 'limit': 100, // number | Maximum number of records to be returned in a single list 'offset': 0, // number | List offset, starting from 0 @@ -226,7 +226,7 @@ api.listOptionsSettlements(underlying, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [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] **from** | **number**| Start timestamp | [optional] [default to undefined] @@ -261,7 +261,7 @@ const client = new GateApi.ApiClient(); const api = new GateApi.OptionsApi(client); const contract = "BTC_USDT-20211130-65000-C"; // string | -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) const at = 56; // number | api.getOptionsSettlement(contract, underlying, at) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -274,7 +274,7 @@ api.getOptionsSettlement(contract, underlying, at) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **string**| | [default to undefined] - **underlying** | **string**| Underlying | [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] **at** | **number**| | [default to undefined] ### Return type @@ -307,9 +307,9 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) const opts = { - 'contract': "BTC_USDT-20210916-5000-C", // string | Contract name + 'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name 'limit': 100, // number | Maximum number of records to be returned in a single list 'offset': 0, // number | List offset, starting from 0 'from': 1547706332, // number | Start timestamp @@ -325,8 +325,8 @@ api.listMyOptionsSettlements(underlying, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] - **contract** | **string**| Contract name | [optional] [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] + **contract** | **string**| Options contract name | [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] **from** | **number**| Start timestamp | [optional] [default to undefined] @@ -349,7 +349,7 @@ Promise<{ response: AxiosResponse; body: Array; }> [Option > Promise<{ response: http.IncomingMessage; body: FuturesOrderBook; }> listOptionsOrderBook(contract, opts) -Futures order book +Options order book Bids will be sorted by price from high to low, while asks sorted reversely @@ -362,7 +362,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.OptionsApi(client); -const contract = "BTC_USDT"; // string | Futures contract +const contract = "BTC_USDT-20210916-5000-C"; // string | Options contract name const opts = { 'interval': '0', // '0' | '0.1' | '0.01' | Order depth. 0 means no aggregation is applied. default to 0 'limit': 10, // number | Maximum number of order depth data in asks or bids @@ -378,7 +378,7 @@ api.listOptionsOrderBook(contract, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Futures contract | [default to undefined] + **contract** | **string**| Options contract name | [default to undefined] **interval** | **Interval**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] **limit** | **number**| Maximum number of order depth data in asks or bids | [optional] [default to 10] **withId** | **boolean**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to undefined] @@ -411,7 +411,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) api.listOptionsTickers(underlying) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); @@ -422,7 +422,7 @@ api.listOptionsTickers(underlying) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] ### Return type @@ -480,9 +480,9 @@ No authorization required ## listOptionsCandlesticks -> Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsCandlesticks(contract, opts) +> Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsCandlesticks(contract, opts) -Get futures candlesticks +Get options candlesticks ### Example @@ -493,7 +493,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.OptionsApi(client); -const contract = "BTC_USDT"; // string | Futures contract +const contract = "BTC_USDT-20210916-5000-C"; // string | Options contract name const opts = { 'limit': 100, // number | Maximum number of records to be returned in a single list 'from': 1547706332, // number | Start timestamp @@ -510,7 +510,7 @@ api.listOptionsCandlesticks(contract, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Futures contract | [default to undefined] + **contract** | **string**| Options contract name | [default to undefined] **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] **from** | **number**| Start timestamp | [optional] [default to undefined] **to** | **number**| End timestamp | [optional] [default to undefined] @@ -518,7 +518,7 @@ Name | Type | Description | Notes ### Return type -Promise<{ response: AxiosResponse; body: Array; }> [FuturesCandlestick](FuturesCandlestick.md) +Promise<{ response: AxiosResponse; body: Array; }> [OptionsCandlestick](OptionsCandlestick.md) ### Authorization @@ -544,7 +544,7 @@ const client = new GateApi.ApiClient(); // client.basePath = "https://some-other-host" const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) const opts = { 'limit': 100, // number | Maximum number of records to be returned in a single list 'from': 1547706332, // number | Start timestamp @@ -561,7 +561,7 @@ api.listOptionsUnderlyingCandlesticks(underlying, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] **from** | **number**| Start timestamp | [optional] [default to undefined] **to** | **number**| End timestamp | [optional] [default to undefined] @@ -596,7 +596,7 @@ const client = new GateApi.ApiClient(); const api = new GateApi.OptionsApi(client); const opts = { - 'contract': "BTC_USDT-20210916-5000-C", // string | Contract name + 'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name 'type': "1546935600", // string | `C` is call, while `P` is put 'limit': 100, // number | Maximum number of records to be returned in a single list 'offset': 0, // number | List offset, starting from 0 @@ -613,7 +613,7 @@ api.listOptionsTrades(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Contract name | [optional] [default to undefined] + **contract** | **string**| Options contract name | [optional] [default to undefined] **type** | **string**| `C` is call, while `P` is put | [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] @@ -830,9 +830,9 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) const opts = { - 'contract': "BTC_USDT-20210916-5000-C" // string | Contract name + 'contract': "BTC_USDT-20210916-5000-C" // string | Options contract name }; api.listOptionsPositionClose(underlying, opts) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -844,8 +844,8 @@ api.listOptionsPositionClose(underlying, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] - **contract** | **string**| Contract name | [optional] [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] + **contract** | **string**| Options contract name | [optional] [default to undefined] ### Return type @@ -864,7 +864,7 @@ Promise<{ response: AxiosResponse; body: Array; }> [Option > Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsOrders(status, opts) -List futures orders +List options orders ### Example @@ -879,7 +879,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.OptionsApi(client); const status = "open"; // 'open' | 'finished' | Only list the orders with this status const opts = { - 'contract': "BTC_USDT-20210916-5000-C", // string | Contract name + 'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name 'underlying': "BTC_USDT", // string | Underlying 'limit': 100, // number | Maximum number of records to be returned in a single list 'offset': 0, // number | List offset, starting from 0 @@ -897,7 +897,7 @@ api.listOptionsOrders(status, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **Status**| Only list the orders with this status | [default to undefined] - **contract** | **string**| Contract name | [optional] [default to undefined] + **contract** | **string**| Options contract name | [optional] [default to undefined] **underlying** | **string**| Underlying | [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] @@ -978,7 +978,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.OptionsApi(client); const opts = { - 'contract': "BTC_USDT-20210916-5000-C", // string | Contract name + 'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name 'underlying': "BTC_USDT", // string | Underlying 'side': "ask" // 'ask' | 'bid' | All bids or asks. Both included if not specified }; @@ -992,7 +992,7 @@ api.cancelOptionsOrders(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Contract name | [optional] [default to undefined] + **contract** | **string**| Options contract name | [optional] [default to undefined] **underlying** | **string**| Underlying | [optional] [default to undefined] **side** | **Side**| All bids or asks. Both included if not specified | [optional] [default to undefined] @@ -1112,9 +1112,9 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.OptionsApi(client); -const underlying = "BTC_USDT"; // string | Underlying +const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint) const opts = { - 'contract': "BTC_USDT-20210916-5000-C", // string | Contract name + 'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name 'limit': 100, // number | Maximum number of records to be returned in a single list 'offset': 0, // number | List offset, starting from 0 'from': 1547706332, // number | Start timestamp @@ -1130,8 +1130,8 @@ api.listMyOptionsTrades(underlying, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | [default to undefined] - **contract** | **string**| Contract name | [optional] [default to undefined] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | [default to undefined] + **contract** | **string**| Options contract name | [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] **from** | **number**| Start timestamp | [optional] [default to undefined] diff --git a/docs/OptionsCandlestick.md b/docs/OptionsCandlestick.md new file mode 100644 index 0000000..63c3bee --- /dev/null +++ b/docs/OptionsCandlestick.md @@ -0,0 +1,13 @@ +# OptionsCandlestick + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **number** | Unix timestamp in seconds | [optional] [default to undefined] +**v** | **number** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] [default to undefined] +**c** | **string** | Close price (quote currency, unit: underlying corresponding option price) | [optional] [default to undefined] +**h** | **string** | Highest price (quote currency, unit: underlying corresponding option price) | [optional] [default to undefined] +**l** | **string** | Lowest price (quote currency, unit: underlying corresponding option price) | [optional] [default to undefined] +**o** | **string** | Open price (quote currency, unit: underlying corresponding option price) | [optional] [default to undefined] + diff --git a/docs/OptionsContract.md b/docs/OptionsContract.md index 5f105fd..fd4a273 100644 --- a/docs/OptionsContract.md +++ b/docs/OptionsContract.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Futures contract | [optional] [default to undefined] +**name** | **string** | Options contract name | [optional] [default to undefined] **tag** | **string** | tag | [optional] [default to undefined] **createTime** | **number** | Creation time | [optional] [default to undefined] **expirationTime** | **number** | Expiration time | [optional] [default to undefined] **isCall** | **boolean** | `true` means call options, while `false` is put options | [optional] [default to undefined] **multiplier** | **string** | Multiplier used in converting from invoicing to settlement currency | [optional] [default to undefined] **underlying** | **string** | Underlying | [optional] [default to undefined] -**underlyingPrice** | **string** | Underlying price | [optional] [default to undefined] +**underlyingPrice** | **string** | Underlying price (quote currency) | [optional] [default to undefined] **lastPrice** | **string** | Last trading price | [optional] [default to undefined] -**markPrice** | **string** | Current mark price | [optional] [default to undefined] -**indexPrice** | **string** | Current index price | [optional] [default to undefined] +**markPrice** | **string** | Current mark price (quote currency) | [optional] [default to undefined] +**indexPrice** | **string** | Current index price (quote currency) | [optional] [default to undefined] **makerFeeRate** | **string** | Maker fee rate, where negative means rebate | [optional] [default to undefined] **takerFeeRate** | **string** | Taker fee rate | [optional] [default to undefined] **orderPriceRound** | **string** | Minimum order price increment | [optional] [default to undefined] diff --git a/docs/OptionsMySettlements.md b/docs/OptionsMySettlements.md index f747866..a273827 100644 --- a/docs/OptionsMySettlements.md +++ b/docs/OptionsMySettlements.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **number** | Settlement time | [optional] [default to undefined] **underlying** | **string** | Underlying | [optional] [default to undefined] -**contract** | **string** | Futures contract | [optional] [default to undefined] -**strikePrice** | **string** | Strike price | [optional] [default to undefined] -**settlePrice** | **string** | settlement price | [optional] [default to undefined] +**contract** | **string** | Options contract name | [optional] [default to undefined] +**strikePrice** | **string** | Strike price (quote currency) | [optional] [default to undefined] +**settlePrice** | **string** | Settlement price (quote currency) | [optional] [default to undefined] **size** | **number** | Size | [optional] [default to undefined] -**settleProfit** | **string** | Settlement profit | [optional] [default to undefined] -**fee** | **string** | Fee | [optional] [default to undefined] -**realisedPnl** | **string** | The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. | [optional] [default to undefined] +**settleProfit** | **string** | Settlement profit (quote currency) | [optional] [default to undefined] +**fee** | **string** | Fee (quote currency) | [optional] [default to undefined] +**realisedPnl** | **string** | The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (quote currency) | [optional] [default to undefined] diff --git a/docs/OptionsMyTrade.md b/docs/OptionsMyTrade.md index 265b9e8..53b3902 100644 --- a/docs/OptionsMyTrade.md +++ b/docs/OptionsMyTrade.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **number** | Trade ID | [optional] [default to undefined] **createTime** | **number** | Trading time | [optional] [default to undefined] -**contract** | **string** | Futures contract | [optional] [default to undefined] +**contract** | **string** | Options contract name | [optional] [default to undefined] **orderId** | **number** | Order ID related | [optional] [default to undefined] **size** | **number** | Trading size | [optional] [default to undefined] -**price** | **string** | Trading price | [optional] [default to undefined] -**underlyingPrice** | **string** | Underlying price | [optional] [default to undefined] +**price** | **string** | Trading price (quote currency) | [optional] [default to undefined] +**underlyingPrice** | **string** | Underlying price (quote currency) | [optional] [default to undefined] **role** | **string** | Trade role. Available values are `taker` and `maker` | [optional] [default to undefined] ## Enum: OptionsMyTrade.Role diff --git a/docs/OptionsOrder.md b/docs/OptionsOrder.md index de6a531..5daa960 100644 --- a/docs/OptionsOrder.md +++ b/docs/OptionsOrder.md @@ -13,19 +13,20 @@ Name | Type | Description | Notes **contract** | **string** | Contract name | [default to undefined] **size** | **number** | Order size. Specify positive number to make a bid, and negative number to ask | [default to undefined] **iceberg** | **number** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional] [default to undefined] -**price** | **string** | Order price. 0 for market order with `tif` set as `ioc` | [optional] [default to undefined] +**price** | **string** | Order price. 0 for market order with `tif` set as `ioc` (USDT) | [optional] [default to undefined] **close** | **boolean** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to undefined] **isClose** | **boolean** | Is the order to close position | [optional] [readonly] [default to undefined] **reduceOnly** | **boolean** | Set as `true` to be reduce-only order | [optional] [default to undefined] **isReduceOnly** | **boolean** | Is the order reduce-only | [optional] [readonly] [default to undefined] **isLiq** | **boolean** | Is the order for liquidation | [optional] [readonly] [default to undefined] -**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only | [optional] [default to 'gtc'] +**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc'] **left** | **number** | Size left to be traded | [optional] [readonly] [default to undefined] **fillPrice** | **string** | Fill price of the order | [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(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] [default to undefined] **tkfr** | **string** | Taker fee | [optional] [readonly] [default to undefined] **mkfr** | **string** | Maker fee | [optional] [readonly] [default to undefined] **refu** | **number** | Reference user ID | [optional] [readonly] [default to undefined] +**refr** | **string** | Referrer rebate | [optional] [readonly] [default to undefined] ## Enum: OptionsOrder.FinishAs diff --git a/docs/OptionsPosition.md b/docs/OptionsPosition.md index b667989..605ca53 100644 --- a/docs/OptionsPosition.md +++ b/docs/OptionsPosition.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user** | **number** | User ID | [optional] [readonly] [default to undefined] -**contract** | **string** | Futures contract | [optional] [readonly] [default to undefined] -**size** | **number** | Position size | [optional] [readonly] [default to undefined] -**entryPrice** | **string** | Entry price | [optional] [readonly] [default to undefined] -**markPrice** | **string** | Current mark price | [optional] [readonly] [default to undefined] +**contract** | **string** | Options contract name | [optional] [readonly] [default to undefined] +**size** | **number** | Position size (contract size) | [optional] [readonly] [default to undefined] +**entryPrice** | **string** | Entry size (quote currency) | [optional] [readonly] [default to undefined] +**markPrice** | **string** | Current mark price (quote currency) | [optional] [readonly] [default to undefined] **realisedPnl** | **string** | Realized PNL | [optional] [readonly] [default to undefined] **unrealisedPnl** | **string** | Unrealized PNL | [optional] [readonly] [default to undefined] **pendingOrders** | **number** | Current open orders | [optional] [readonly] [default to undefined] -**closeOrder** | [**PositionCloseOrder**](PositionCloseOrder.md) | | [optional] [default to undefined] +**closeOrder** | [**OptionsPositionCloseOrder**](OptionsPositionCloseOrder.md) | | [optional] [default to undefined] diff --git a/docs/OptionsPositionClose.md b/docs/OptionsPositionClose.md index 5d63115..d4941ac 100644 --- a/docs/OptionsPositionClose.md +++ b/docs/OptionsPositionClose.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **number** | Position close time | [optional] [readonly] [default to undefined] -**contract** | **string** | Futures contract | [optional] [readonly] [default to undefined] +**contract** | **string** | Options contract name | [optional] [readonly] [default to undefined] **side** | **string** | Position side, long or short | [optional] [readonly] [default to undefined] **pnl** | **string** | PNL | [optional] [readonly] [default to undefined] **text** | **string** | Text of close order | [optional] [readonly] [default to undefined] diff --git a/docs/OptionsPositionCloseOrder.md b/docs/OptionsPositionCloseOrder.md new file mode 100644 index 0000000..6289e4e --- /dev/null +++ b/docs/OptionsPositionCloseOrder.md @@ -0,0 +1,10 @@ +# OptionsPositionCloseOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **number** | Close order ID | [optional] [default to undefined] +**price** | **string** | Close order price (quote currency) | [optional] [default to undefined] +**isLiq** | **boolean** | Is the close order from liquidation | [optional] [default to undefined] + diff --git a/docs/OptionsSettlement.md b/docs/OptionsSettlement.md index 1c7833a..1eee8ba 100644 --- a/docs/OptionsSettlement.md +++ b/docs/OptionsSettlement.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **number** | Last changed time of configuration | [optional] [default to undefined] -**contract** | **string** | Contract name | [optional] [default to undefined] -**profit** | **string** | Settlement profit per size | [optional] [default to undefined] -**fee** | **string** | Settlement fee per size | [optional] [default to undefined] -**strikePrice** | **string** | Strike price | [optional] [default to undefined] -**settlePrice** | **string** | settlement price | [optional] [default to undefined] +**contract** | **string** | Options contract name | [optional] [default to undefined] +**profit** | **string** | Settlement profit per size (quote currency) | [optional] [default to undefined] +**fee** | **string** | Settlement fee per size (quote currency) | [optional] [default to undefined] +**strikePrice** | **string** | Strike price (quote currency) | [optional] [default to undefined] +**settlePrice** | **string** | Settlement price (quote currency) | [optional] [default to undefined] diff --git a/docs/OptionsTicker.md b/docs/OptionsTicker.md index c20a05d..405ee8d 100644 --- a/docs/OptionsTicker.md +++ b/docs/OptionsTicker.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Options contract name | [optional] [default to undefined] -**lastPrice** | **string** | Last trading price | [optional] [default to undefined] -**markPrice** | **string** | Current mark price | [optional] [default to undefined] -**indexPrice** | **string** | Current index price | [optional] [default to undefined] +**lastPrice** | **string** | Last trading price (quote currency) | [optional] [default to undefined] +**markPrice** | **string** | Current mark price (quote currency) | [optional] [default to undefined] +**indexPrice** | **string** | Current index price (quote currency) | [optional] [default to undefined] **ask1Size** | **number** | Best ask size | [optional] [default to undefined] **ask1Price** | **string** | Best ask price | [optional] [default to undefined] **bid1Size** | **number** | Best bid size | [optional] [default to undefined] diff --git a/docs/OptionsUnderlying.md b/docs/OptionsUnderlying.md index dd7b2bf..4b1be98 100644 --- a/docs/OptionsUnderlying.md +++ b/docs/OptionsUnderlying.md @@ -5,5 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Underlying name | [optional] [default to undefined] -**indexPrice** | **string** | Spot index price | [optional] [default to undefined] +**indexPrice** | **string** | Spot index price (quote currency) | [optional] [default to undefined] diff --git a/docs/OptionsUnderlyingTicker.md b/docs/OptionsUnderlyingTicker.md index a6e86c0..c48066f 100644 --- a/docs/OptionsUnderlyingTicker.md +++ b/docs/OptionsUnderlyingTicker.md @@ -6,5 +6,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tradePut** | **number** | Total put options trades amount in last 24h | [optional] [default to undefined] **tradeCall** | **number** | Total call options trades amount in last 24h | [optional] [default to undefined] -**indexPrice** | **string** | Index price | [optional] [default to undefined] +**indexPrice** | **string** | Index price (quote currency) | [optional] [default to undefined] diff --git a/docs/Order.md b/docs/Order.md index 960cd27..262234f 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -12,12 +12,12 @@ 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 | [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. Portfolio margin account must set to `cross-margin` | [optional] [default to 'spot'] **side** | **string** | Order side | [default to undefined] -**amount** | **string** | Trade amount | [default to undefined] -**price** | **string** | Order price | [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'] +**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] **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] @@ -28,6 +28,8 @@ Name | Type | Description | Notes **feeCurrency** | **string** | Fee currency unit | [optional] [readonly] [default to undefined] **pointFee** | **string** | Points used to deduct fee | [optional] [readonly] [default to undefined] **gtFee** | **string** | GT used to deduct fee | [optional] [readonly] [default to undefined] +**gtMakerFee** | **string** | GT used to deduct maker fee | [optional] [readonly] [default to undefined] +**gtTakerFee** | **string** | GT used to deduct taker fee | [optional] [readonly] [default to undefined] **gtDiscount** | **boolean** | Whether GT fee discount is used | [optional] [readonly] [default to undefined] **rebatedFee** | **string** | Rebated fee | [optional] [readonly] [default to undefined] **rebatedFeeCurrency** | **string** | Rebated fee currency unit | [optional] [readonly] [default to undefined] @@ -45,6 +47,8 @@ Name | Type | Description | Notes * `Limit` (value: `'limit'`) +* `Market` (value: `'market'`) + ## Enum: Order.Account diff --git a/docs/SpotApi.md b/docs/SpotApi.md index 3373709..8a6c758 100644 --- a/docs/SpotApi.md +++ b/docs/SpotApi.md @@ -25,10 +25,11 @@ Method | HTTP request | Description [**cancelOrder**](SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single 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 [**listSpotPriceTriggeredOrders**](SpotApi.md#listSpotPriceTriggeredOrders) | **GET** /spot/price_orders | Retrieve running auto order list [**createSpotPriceTriggeredOrder**](SpotApi.md#createSpotPriceTriggeredOrder) | **POST** /spot/price_orders | Create a price-triggered order [**cancelSpotPriceTriggeredOrderList**](SpotApi.md#cancelSpotPriceTriggeredOrderList) | **DELETE** /spot/price_orders | Cancel all open orders -[**getSpotPriceTriggeredOrder**](SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Get a single order +[**getSpotPriceTriggeredOrder**](SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Get a price-triggered order [**cancelSpotPriceTriggeredOrder**](SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order @@ -307,7 +308,7 @@ const client = new GateApi.ApiClient(); const api = new GateApi.SpotApi(client); const currencyPair = "BTC_USDT"; // string | Currency pair const opts = { - 'limit': 100, // number | Maximum number of records to be returned in a single list + 'limit': 100, // number | Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 'lastId': "12345", // string | Specify list staring point using the `id` of last record in previous list-query results 'reverse': true, // boolean | Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. 'from': 1627706330, // number | Start timestamp of the query @@ -325,7 +326,7 @@ api.listTrades(currencyPair, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currencyPair** | **string**| Currency pair | [default to undefined] - **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **limit** | **number**| Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 | [optional] [default to 100] **lastId** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] [default to undefined] **reverse** | **boolean**| Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to undefined] **from** | **number**| Start timestamp of the query | [optional] [default to undefined] @@ -852,7 +853,7 @@ const client = new GateApi.ApiClient(); 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 are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +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 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 @@ -867,7 +868,7 @@ api.getOrder(orderId, currencyPair, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | [default to undefined] + **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] **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] @@ -903,7 +904,7 @@ const client = new GateApi.ApiClient(); 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 are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +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 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 @@ -918,7 +919,7 @@ api.cancelOrder(orderId, currencyPair, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | [default to undefined] + **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] **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] @@ -937,11 +938,11 @@ Promise<{ response: AxiosResponse; body: Order; }> [Order](Order.md) ## listMyTrades -> Promise<{ response: http.IncomingMessage; body: Array; }> listMyTrades(currencyPair, opts) +> Promise<{ response: http.IncomingMessage; body: Array; }> listMyTrades(opts) List personal trading history -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 Time range parameters are handled as order finish time. +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. ### Example @@ -954,8 +955,8 @@ const client = new GateApi.ApiClient(); client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.SpotApi(client); -const currencyPair = "BTC_USDT"; // string | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. const opts = { + 'currencyPair': "BTC_USDT", // string | Retrieve results with specified currency pair 'limit': 100, // number | Maximum number of records to be returned in a single list 'page': 1, // number | Page number 'orderId': "12345", // string | Filter trades with specified order ID. `currency_pair` is also required if this field is present @@ -963,7 +964,7 @@ const opts = { 'from': 1627706330, // number | Start timestamp of the query 'to': 1635329650 // number | Time range ending, default to current time }; -api.listMyTrades(currencyPair, opts) +api.listMyTrades(opts) .then(value => console.log('API called successfully. Returned data: ', value.body), error => console.error(error)); ``` @@ -973,7 +974,7 @@ api.listMyTrades(currencyPair, opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currencyPair** | **string**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | [default to undefined] + **currencyPair** | **string**| Retrieve results with specified currency pair | [optional] [default to undefined] **limit** | **number**| Maximum number of records to be returned in a single list | [optional] [default to 100] **page** | **number**| Page number | [optional] [default to 1] **orderId** | **string**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional] [default to undefined] @@ -1031,6 +1032,51 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +## countdownCancelAllSpot + +> Promise<{ response: http.IncomingMessage; body: TriggerTime; }> countdownCancelAllSpot(countdownCancelAllSpotTask) + +Countdown cancel orders + +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. + +### 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 countdownCancelAllSpotTask = new CountdownCancelAllSpotTask(); // CountdownCancelAllSpotTask | +api.countdownCancelAllSpot(countdownCancelAllSpotTask) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **countdownCancelAllSpotTask** | [**CountdownCancelAllSpotTask**](CountdownCancelAllSpotTask.md)| | + +### Return type + +Promise<{ response: AxiosResponse; body: TriggerTime; }> [TriggerTime](TriggerTime.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + ## listSpotPriceTriggeredOrders > Promise<{ response: http.IncomingMessage; body: Array; }> listSpotPriceTriggeredOrders(status, opts) @@ -1178,7 +1224,7 @@ Promise<{ response: AxiosResponse; body: Array; }> [Spo > Promise<{ response: http.IncomingMessage; body: SpotPriceTriggeredOrder; }> getSpotPriceTriggeredOrder(orderId) -Get a single order +Get a price-triggered order ### Example diff --git a/docs/SubAccount.md b/docs/SubAccount.md new file mode 100644 index 0000000..eb27ec5 --- /dev/null +++ b/docs/SubAccount.md @@ -0,0 +1,14 @@ +# SubAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**remark** | **string** | custom text | [optional] [default to undefined] +**loginName** | **string** | Sub-account login name: Only letters, numbers and underscores are supported, and cannot contain other illegal characters | [default to undefined] +**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] +**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/docs/SubAccountApi.md b/docs/SubAccountApi.md new file mode 100644 index 0000000..51cf212 --- /dev/null +++ b/docs/SubAccountApi.md @@ -0,0 +1,453 @@ +# SubAccountApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**listSubAccounts**](SubAccountApi.md#listSubAccounts) | **GET** /sub_accounts | List sub-accounts +[**createSubAccounts**](SubAccountApi.md#createSubAccounts) | **POST** /sub_accounts | Create a new sub-account +[**getSubAccount**](SubAccountApi.md#getSubAccount) | **GET** /sub_accounts/{user_id} | Get the sub-account +[**listSubAccountKeys**](SubAccountApi.md#listSubAccountKeys) | **GET** /sub_accounts/{user_id}/keys | List all API Key of the sub-account +[**createSubAccountKeys**](SubAccountApi.md#createSubAccountKeys) | **POST** /sub_accounts/{user_id}/keys | Create API Key of the sub-account +[**getSubAccountKey**](SubAccountApi.md#getSubAccountKey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account +[**updateSubAccountKeys**](SubAccountApi.md#updateSubAccountKeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account +[**deleteSubAccountKeys**](SubAccountApi.md#deleteSubAccountKeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account +[**lockSubAccount**](SubAccountApi.md#lockSubAccount) | **POST** /sub_accounts/{user_id}/lock | Lock the sub-account +[**unlockSubAccount**](SubAccountApi.md#unlockSubAccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock the sub-account + + +## listSubAccounts + +> Promise<{ response: http.IncomingMessage; body: Array; }> listSubAccounts() + +List sub-accounts + +### 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.SubAccountApi(client); +api.listSubAccounts() + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [SubAccount](SubAccount.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +## createSubAccounts + +> Promise<{ response: http.IncomingMessage; body: SubAccount; }> createSubAccounts(subAccount) + +Create a new sub-account + +### 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.SubAccountApi(client); +const subAccount = new SubAccount(); // SubAccount | +api.createSubAccounts(subAccount) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subAccount** | [**SubAccount**](SubAccount.md)| | + +### Return type + +Promise<{ response: AxiosResponse; body: SubAccount; }> [SubAccount](SubAccount.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +## getSubAccount + +> Promise<{ response: http.IncomingMessage; body: SubAccount; }> getSubAccount(userId) + +Get the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | Sub-account user id +api.getSubAccount(userId) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| Sub-account user id | [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body: SubAccount; }> [SubAccount](SubAccount.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +## listSubAccountKeys + +> Promise<{ response: http.IncomingMessage; body: Array; }> listSubAccountKeys(userId) + +List all API Key of the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | Sub-account user id +api.listSubAccountKeys(userId) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| Sub-account user id | [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [SubAccountKey](SubAccountKey.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +## createSubAccountKeys + +> Promise<{ response: http.IncomingMessage; body: Array; }> createSubAccountKeys(userId, subAccountKey) + +Create API Key of the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | Sub-account user id +const subAccountKey = new SubAccountKey(); // SubAccountKey | +api.createSubAccountKeys(userId, subAccountKey) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| Sub-account user id | [default to undefined] + **subAccountKey** | [**SubAccountKey**](SubAccountKey.md)| | + +### Return type + +Promise<{ response: AxiosResponse; body: Array; }> [SubAccountKey](SubAccountKey.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +## getSubAccountKey + +> Promise<{ response: http.IncomingMessage; body: SubAccountKey; }> getSubAccountKey(userId, key) + +Get the API Key of the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | Sub-account user id +const key = "key_example"; // string | The API Key of the sub-account +api.getSubAccountKey(userId, key) + .then(value => console.log('API called successfully. Returned data: ', value.body), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| Sub-account user id | [default to undefined] + **key** | **string**| The API Key of the sub-account | [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body: SubAccountKey; }> [SubAccountKey](SubAccountKey.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +## updateSubAccountKeys + +> Promise<{ response: http.IncomingMessage; body?: any; }> updateSubAccountKeys(userId, key, subAccountKey) + +Update API key of the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | Sub-account user id +const key = "key_example"; // string | The API Key of the sub-account +const subAccountKey = new SubAccountKey(); // SubAccountKey | +api.updateSubAccountKeys(userId, key, subAccountKey) + .then(value => console.log('API called successfully.'), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| Sub-account user id | [default to undefined] + **key** | **string**| The API Key of the sub-account | [default to undefined] + **subAccountKey** | [**SubAccountKey**](SubAccountKey.md)| | + +### Return type + +Promise<{ response: AxiosResponse; body?: any; }> + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +## deleteSubAccountKeys + +> Promise<{ response: http.IncomingMessage; body?: any; }> deleteSubAccountKeys(userId, key) + +Delete API key of the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | Sub-account user id +const key = "key_example"; // string | The API Key of the sub-account +api.deleteSubAccountKeys(userId, key) + .then(value => console.log('API called successfully.'), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| Sub-account user id | [default to undefined] + **key** | **string**| The API Key of the sub-account | [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body?: any; }> + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +## lockSubAccount + +> Promise<{ response: http.IncomingMessage; body?: any; }> lockSubAccount(userId) + +Lock the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | The user id of the sub-account +api.lockSubAccount(userId) + .then(value => console.log('API called successfully.'), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| The user id of the sub-account | [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body?: any; }> + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +## unlockSubAccount + +> Promise<{ response: http.IncomingMessage; body?: any; }> unlockSubAccount(userId) + +Unlock the sub-account + +### 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.SubAccountApi(client); +const userId = 56; // number | The user id of the sub-account +api.unlockSubAccount(userId) + .then(value => console.log('API called successfully.'), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| The user id of the sub-account | [default to undefined] + +### Return type + +Promise<{ response: AxiosResponse; body?: any; }> + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/docs/SubAccountKey.md b/docs/SubAccountKey.md new file mode 100644 index 0000000..d02429a --- /dev/null +++ b/docs/SubAccountKey.md @@ -0,0 +1,15 @@ +# SubAccountKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userId** | **string** | User ID | [optional] [readonly] [default to undefined] +**name** | **string** | API key name | [optional] [default to undefined] +**perms** | [**Array<ApiV4KeyPerm>**](ApiV4KeyPerm.md) | | [optional] [default to undefined] +**ipWhitelist** | **Array<string>** | ip white list (list will be removed if no value is passed) | [optional] [default to undefined] +**key** | **string** | API Key | [optional] [readonly] [default to undefined] +**state** | **number** | State 1 - normal 2 - locked 3 - frozen | [optional] [readonly] [default to undefined] +**createdAt** | **string** | Creation time | [optional] [readonly] [default to undefined] +**updatedAt** | **string** | Last update time | [optional] [readonly] [default to undefined] + diff --git a/docs/SubAccountToSubAccount.md b/docs/SubAccountToSubAccount.md new file mode 100644 index 0000000..121e737 --- /dev/null +++ b/docs/SubAccountToSubAccount.md @@ -0,0 +1,32 @@ +# SubAccountToSubAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Transfer currency name | [default to undefined] +**subAccountType** | **string** | Transfer from the account. (deprecate, use `sub_account_from_type` and `sub_account_to_type` instead) | [optional] [default to undefined] +**subAccountFrom** | **string** | Transfer from the user id of the sub-account | [default to undefined] +**subAccountFromType** | **string** | Transfer from the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account | [default to undefined] +**subAccountTo** | **string** | Transfer to the user id of the sub-account | [default to undefined] +**subAccountToType** | **string** | Transfer to the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account | [default to undefined] +**amount** | **string** | Transfer amount | [default to undefined] + +## Enum: SubAccountToSubAccount.SubAccountFromType + +* `Spot` (value: `'spot'`) + +* `Futures` (value: `'futures'`) + +* `CrossMargin` (value: `'cross_margin'`) + + +## Enum: SubAccountToSubAccount.SubAccountToType + +* `Spot` (value: `'spot'`) + +* `Futures` (value: `'futures'`) + +* `CrossMargin` (value: `'cross_margin'`) + + diff --git a/docs/TriggerTime.md b/docs/TriggerTime.md new file mode 100644 index 0000000..f4a7417 --- /dev/null +++ b/docs/TriggerTime.md @@ -0,0 +1,8 @@ +# TriggerTime + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triggerTime** | **number** | Timestamp of the end of the countdown, in milliseconds | [optional] [default to undefined] + diff --git a/docs/WalletApi.md b/docs/WalletApi.md index 4c76278..73178b0 100644 --- a/docs/WalletApi.md +++ b/docs/WalletApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**transfer**](WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts [**listSubAccountTransfers**](WalletApi.md#listSubAccountTransfers) | **GET** /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts [**transferWithSubAccount**](WalletApi.md#transferWithSubAccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts +[**subAccountToSubAccount**](WalletApi.md#subAccountToSubAccount) | **POST** /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account [**listWithdrawStatus**](WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status [**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances [**listSubAccountMarginBalances**](WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts\' margin balances @@ -280,7 +281,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.WalletApi(client); const opts = { - 'subUid': "10003", // string | Sub account user ID. Return records related to all sub accounts if not specified + 'subUid': "10003", // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts '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 @@ -296,7 +297,7 @@ api.listSubAccountTransfers(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] [default to undefined] + **subUid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [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] @@ -360,6 +361,49 @@ Promise<{ response: AxiosResponse; body?: any; }> - **Content-Type**: application/json - **Accept**: Not defined +## subAccountToSubAccount + +> Promise<{ response: http.IncomingMessage; body?: any; }> subAccountToSubAccount(subAccountToSubAccount) + +Sub-account transfers to sub-account + +### 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.WalletApi(client); +const subAccountToSubAccount = new SubAccountToSubAccount(); // SubAccountToSubAccount | +api.subAccountToSubAccount(subAccountToSubAccount) + .then(value => console.log('API called successfully.'), + error => console.error(error)); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subAccountToSubAccount** | [**SubAccountToSubAccount**](SubAccountToSubAccount.md)| | + +### Return type + +Promise<{ response: AxiosResponse; body?: any; }> + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + ## listWithdrawStatus > Promise<{ response: http.IncomingMessage; body: Array; }> listWithdrawStatus(opts) @@ -423,7 +467,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.WalletApi(client); const opts = { - 'subUid': "10003" // string | Sub account user ID. Return records related to all sub accounts if not specified + 'subUid': "10003" // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts }; api.listSubAccountBalances(opts) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -435,7 +479,7 @@ api.listSubAccountBalances(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] [default to undefined] + **subUid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] [default to undefined] ### Return type @@ -468,7 +512,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.WalletApi(client); const opts = { - 'subUid': "10003" // string | Sub account user ID. Return records related to all sub accounts if not specified + 'subUid': "10003" // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts }; api.listSubAccountMarginBalances(opts) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -480,7 +524,7 @@ api.listSubAccountMarginBalances(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] [default to undefined] + **subUid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] [default to undefined] ### Return type @@ -513,7 +557,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.WalletApi(client); const opts = { - 'subUid': "10003", // string | Sub account user ID. Return records related to all sub accounts if not specified + 'subUid': "10003", // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts 'settle': "usdt" // string | Query only balances of specified settle currency }; api.listSubAccountFuturesBalances(opts) @@ -526,7 +570,7 @@ api.listSubAccountFuturesBalances(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] [default to undefined] + **subUid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] [default to undefined] **settle** | **string**| Query only balances of specified settle currency | [optional] [default to undefined] ### Return type @@ -560,7 +604,7 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.WalletApi(client); const opts = { - 'subUid': "10003" // string | Sub account user ID. Return records related to all sub accounts if not specified + 'subUid': "10003" // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts }; api.listSubAccountCrossMarginBalances(opts) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -572,7 +616,7 @@ api.listSubAccountCrossMarginBalances(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] [default to undefined] + **subUid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] [default to undefined] ### Return type @@ -654,7 +698,8 @@ client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); const api = new GateApi.WalletApi(client); const opts = { - 'currencyPair': "BTC_USDT" // string | Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs + 'currencyPair': "BTC_USDT", // string | Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs + 'settle': "BTC" // 'BTC' | 'USDT' | 'USD' | Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. }; api.getTradeFee(opts) .then(value => console.log('API called successfully. Returned data: ', value.body), @@ -667,6 +712,7 @@ api.getTradeFee(opts) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currencyPair** | **string**| Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs | [optional] [default to undefined] + **settle** | **Settle**| Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. | [optional] [default to undefined] ### Return type diff --git a/model/apiV4KeyPerm.ts b/model/apiV4KeyPerm.ts new file mode 100644 index 0000000..e71dc9c --- /dev/null +++ b/model/apiV4KeyPerm.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. + */ + +export class ApiV4KeyPerm { + /** + * Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options + */ + 'name'?: ApiV4KeyPerm.Name; + /** + * read only + */ + 'readOnly'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'name', + baseName: 'name', + type: 'ApiV4KeyPerm.Name', + }, + { + name: 'readOnly', + baseName: 'read_only', + type: 'boolean', + }, + ]; + + static getAttributeTypeMap() { + return ApiV4KeyPerm.attributeTypeMap; + } +} + +export namespace ApiV4KeyPerm { + export enum Name { + Wallet = 'wallet', + Spot = 'spot', + Futures = 'futures', + Delivery = 'delivery', + Earn = 'earn', + Options = 'options', + } +} diff --git a/model/batchFuturesOrder.ts b/model/batchFuturesOrder.ts new file mode 100644 index 0000000..dee52d7 --- /dev/null +++ b/model/batchFuturesOrder.ts @@ -0,0 +1,286 @@ +/** + * 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. + */ + +/** + * Futures order details + */ +export class BatchFuturesOrder { + /** + * Whether the batch of orders succeeded + */ + 'succeeded'?: boolean; + /** + * Error label, only exists if execution fails + */ + 'label'?: string; + /** + * Error detail, only present if execution failed and details need to be given + */ + 'detail'?: string; + /** + * Futures order ID + */ + 'id'?: number; + /** + * User ID + */ + 'user'?: number; + /** + * Creation time of order + */ + 'createTime'?: number; + /** + * Order finished time. Not returned if order is open + */ + 'finishTime'?: number; + /** + * How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close + */ + 'finishAs'?: BatchFuturesOrder.FinishAs; + /** + * Order status - `open`: waiting to be traded - `finished`: finished + */ + 'status'?: BatchFuturesOrder.Status; + /** + * Futures contract + */ + 'contract'?: string; + /** + * Order size. Specify positive number to make a bid, and negative number to ask + */ + 'size'?: number; + /** + * Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size + */ + 'iceberg'?: number; + /** + * Order price. 0 for market order with `tif` set as `ioc` + */ + 'price'?: string; + /** + * Set as `true` to close the position, with `size` set to 0 + */ + 'close'?: boolean; + /** + * Is the order to close position + */ + 'isClose'?: boolean; + /** + * Set as `true` to be reduce-only order + */ + 'reduceOnly'?: boolean; + /** + * Is the order reduce-only + */ + 'isReduceOnly'?: boolean; + /** + * Is the order for liquidation + */ + 'isLiq'?: boolean; + /** + * 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 + */ + 'tif'?: BatchFuturesOrder.Tif; + /** + * Size left to be traded + */ + 'left'?: number; + /** + * Fill price of the order + */ + 'fillPrice'?: 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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance + */ + 'text'?: string; + /** + * Taker fee + */ + 'tkfr'?: string; + /** + * Maker fee + */ + 'mkfr'?: string; + /** + * Reference user ID + */ + 'refu'?: number; + /** + * Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 + */ + 'autoSize'?: BatchFuturesOrder.AutoSize; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'succeeded', + baseName: 'succeeded', + type: 'boolean', + }, + { + name: 'label', + baseName: 'label', + type: 'string', + }, + { + name: 'detail', + baseName: 'detail', + type: 'string', + }, + { + name: 'id', + baseName: 'id', + type: 'number', + }, + { + name: 'user', + baseName: 'user', + type: 'number', + }, + { + name: 'createTime', + baseName: 'create_time', + type: 'number', + }, + { + name: 'finishTime', + baseName: 'finish_time', + type: 'number', + }, + { + name: 'finishAs', + baseName: 'finish_as', + type: 'BatchFuturesOrder.FinishAs', + }, + { + name: 'status', + baseName: 'status', + type: 'BatchFuturesOrder.Status', + }, + { + name: 'contract', + baseName: 'contract', + type: 'string', + }, + { + name: 'size', + baseName: 'size', + type: 'number', + }, + { + name: 'iceberg', + baseName: 'iceberg', + type: 'number', + }, + { + name: 'price', + baseName: 'price', + type: 'string', + }, + { + name: 'close', + baseName: 'close', + type: 'boolean', + }, + { + name: 'isClose', + baseName: 'is_close', + type: 'boolean', + }, + { + name: 'reduceOnly', + baseName: 'reduce_only', + type: 'boolean', + }, + { + name: 'isReduceOnly', + baseName: 'is_reduce_only', + type: 'boolean', + }, + { + name: 'isLiq', + baseName: 'is_liq', + type: 'boolean', + }, + { + name: 'tif', + baseName: 'tif', + type: 'BatchFuturesOrder.Tif', + }, + { + name: 'left', + baseName: 'left', + type: 'number', + }, + { + name: 'fillPrice', + baseName: 'fill_price', + type: 'string', + }, + { + name: 'text', + baseName: 'text', + type: 'string', + }, + { + name: 'tkfr', + baseName: 'tkfr', + type: 'string', + }, + { + name: 'mkfr', + baseName: 'mkfr', + type: 'string', + }, + { + name: 'refu', + baseName: 'refu', + type: 'number', + }, + { + name: 'autoSize', + baseName: 'auto_size', + type: 'BatchFuturesOrder.AutoSize', + }, + ]; + + static getAttributeTypeMap() { + return BatchFuturesOrder.attributeTypeMap; + } +} + +export namespace BatchFuturesOrder { + export enum FinishAs { + Filled = 'filled', + Cancelled = 'cancelled', + Liquidated = 'liquidated', + Ioc = 'ioc', + AutoDeleveraged = 'auto_deleveraged', + ReduceOnly = 'reduce_only', + PositionClosed = 'position_closed', + ReduceOut = 'reduce_out', + } + export enum Status { + Open = 'open', + Finished = 'finished', + } + export enum Tif { + Gtc = 'gtc', + Ioc = 'ioc', + Poc = 'poc', + Fok = 'fok', + } + export enum AutoSize { + Long = 'close_long', + Short = 'close_short', + } +} diff --git a/model/contract.ts b/model/contract.ts index 44d18bb..c5907d6 100644 --- a/model/contract.ts +++ b/model/contract.ts @@ -10,7 +10,7 @@ */ /** - * Contract detail. USD value per contract: - USDT settled contracts: `quanto_multiplier x token price` - BTC settled contracts:`quanto_multiplier x BTC price x token price` + * Futures contract details */ export class Contract { /** diff --git a/model/countdownCancelAllFuturesTask.ts b/model/countdownCancelAllFuturesTask.ts new file mode 100644 index 0000000..1cafadd --- /dev/null +++ b/model/countdownCancelAllFuturesTask.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. + */ + +/** + * Countdown cancel task detail + */ +export class CountdownCancelAllFuturesTask { + /** + * Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown + */ + 'timeout': number; + /** + * Futures contract + */ + 'contract'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'timeout', + baseName: 'timeout', + type: 'number', + }, + { + name: 'contract', + baseName: 'contract', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return CountdownCancelAllFuturesTask.attributeTypeMap; + } +} diff --git a/model/countdownCancelAllSpotTask.ts b/model/countdownCancelAllSpotTask.ts new file mode 100644 index 0000000..7756f07 --- /dev/null +++ b/model/countdownCancelAllSpotTask.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. + */ + +/** + * Countdown cancel task detail + */ +export class CountdownCancelAllSpotTask { + /** + * Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown + */ + 'timeout': number; + /** + * Currency pair + */ + 'currencyPair'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'timeout', + baseName: 'timeout', + type: 'number', + }, + { + name: 'currencyPair', + baseName: 'currency_pair', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return CountdownCancelAllSpotTask.attributeTypeMap; + } +} diff --git a/model/futuresAccount.ts b/model/futuresAccount.ts index 8c83014..7b205b4 100644 --- a/model/futuresAccount.ts +++ b/model/futuresAccount.ts @@ -13,7 +13,7 @@ import { FuturesAccountHistory } from './futuresAccountHistory'; export class FuturesAccount { /** - * total = position_margin + order_margin + available + * total is the balance after the user\'s accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) */ 'total'?: string; /** diff --git a/model/futuresCandlestick.ts b/model/futuresCandlestick.ts index 56ceefd..34549ef 100644 --- a/model/futuresCandlestick.ts +++ b/model/futuresCandlestick.ts @@ -18,23 +18,23 @@ export class FuturesCandlestick { */ 't'?: number; /** - * size volume. Only returned if `contract` is not prefixed + * size volume (contract size). Only returned if `contract` is not prefixed */ 'v'?: number; /** - * Close price + * Close price (quote currency) */ 'c'?: string; /** - * Highest price + * Highest price (quote currency) */ 'h'?: string; /** - * Lowest price + * Lowest price (quote currency) */ 'l'?: string; /** - * Open price + * Open price (quote currency) */ 'o'?: string; diff --git a/model/futuresOrder.ts b/model/futuresOrder.ts index 4ebc6d7..a79f998 100644 --- a/model/futuresOrder.ts +++ b/model/futuresOrder.ts @@ -74,7 +74,7 @@ export class FuturesOrder { */ 'isLiq'?: boolean; /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only + * 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 */ 'tif'?: FuturesOrder.Tif; /** @@ -250,6 +250,7 @@ export namespace FuturesOrder { Gtc = 'gtc', Ioc = 'ioc', Poc = 'poc', + Fok = 'fok', } export enum AutoSize { Long = 'close_long', diff --git a/model/futuresOrderAmendment.ts b/model/futuresOrderAmendment.ts index 1d60c62..249a328 100644 --- a/model/futuresOrderAmendment.ts +++ b/model/futuresOrderAmendment.ts @@ -15,7 +15,7 @@ export class FuturesOrderAmendment { */ 'size'?: number; /** - * New order price. New price cannot take any orders + * New order price. */ 'price'?: string; diff --git a/model/futuresOrderBookItem.ts b/model/futuresOrderBookItem.ts index c1617f4..9ef742b 100644 --- a/model/futuresOrderBookItem.ts +++ b/model/futuresOrderBookItem.ts @@ -11,7 +11,7 @@ export class FuturesOrderBookItem { /** - * Price + * Price (quote currency) */ 'p'?: string; /** diff --git a/model/futuresPremiumIndex.ts b/model/futuresPremiumIndex.ts new file mode 100644 index 0000000..aef8f60 --- /dev/null +++ b/model/futuresPremiumIndex.ts @@ -0,0 +1,70 @@ +/** + * 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. + */ + +/** + * data point in every timestamp + */ +export class FuturesPremiumIndex { + /** + * Unix timestamp in seconds + */ + 't'?: number; + /** + * Close price + */ + 'c'?: string; + /** + * Highest price + */ + 'h'?: string; + /** + * Lowest price` + */ + 'l'?: string; + /** + * Open price + */ + 'o'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 't', + baseName: 't', + type: 'number', + }, + { + name: 'c', + baseName: 'c', + type: 'string', + }, + { + name: 'h', + baseName: 'h', + type: 'string', + }, + { + name: 'l', + baseName: 'l', + type: 'string', + }, + { + name: 'o', + baseName: 'o', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return FuturesPremiumIndex.attributeTypeMap; + } +} diff --git a/model/futuresTicker.ts b/model/futuresTicker.ts index 784c254..c6c33c4 100644 --- a/model/futuresTicker.ts +++ b/model/futuresTicker.ts @@ -78,6 +78,14 @@ export class FuturesTicker { * Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types */ 'quantoBaseRate'?: string; + /** + * Basis rate + */ + 'basisRate'?: string; + /** + * Basis value + */ + 'basisValue'?: string; static discriminator: string | undefined = undefined; @@ -167,6 +175,16 @@ export class FuturesTicker { baseName: 'quanto_base_rate', type: 'string', }, + { + name: 'basisRate', + baseName: 'basis_rate', + type: 'string', + }, + { + name: 'basisValue', + baseName: 'basis_value', + type: 'string', + }, ]; static getAttributeTypeMap() { diff --git a/model/futuresTrade.ts b/model/futuresTrade.ts index 2f46787..563f0d4 100644 --- a/model/futuresTrade.ts +++ b/model/futuresTrade.ts @@ -31,7 +31,7 @@ export class FuturesTrade { */ 'size'?: number; /** - * Trading price + * Trading price (quote currency) */ 'price'?: string; diff --git a/model/ledgerRecord.ts b/model/ledgerRecord.ts index 4eb30d5..1068775 100644 --- a/model/ledgerRecord.ts +++ b/model/ledgerRecord.ts @@ -45,7 +45,7 @@ export class LedgerRecord { /** * Name of the chain used in withdrawals */ - 'chain'?: string; + 'chain': string; /** * Fee */ diff --git a/model/models.ts b/model/models.ts index 840bf2e..e221df1 100644 --- a/model/models.ts +++ b/model/models.ts @@ -1,10 +1,14 @@ export * from './accountBalance'; +export * from './apiV4KeyPerm'; export * from './autoRepaySetting'; +export * from './batchFuturesOrder'; export * from './batchOrder'; export * from './cancelOrder'; export * from './cancelOrderResult'; export * from './contract'; export * from './contractStat'; +export * from './countdownCancelAllFuturesTask'; +export * from './countdownCancelAllSpotTask'; export * from './crossMarginAccount'; export * from './crossMarginAccountBook'; export * from './crossMarginBalance'; @@ -38,6 +42,7 @@ export * from './futuresOrder'; export * from './futuresOrderAmendment'; export * from './futuresOrderBook'; export * from './futuresOrderBookItem'; +export * from './futuresPremiumIndex'; export * from './futuresPriceTrigger'; export * from './futuresPriceTriggeredOrder'; export * from './futuresTicker'; @@ -60,12 +65,14 @@ export * from './myFuturesTrade'; export * from './openOrders'; export * from './optionsAccount'; export * from './optionsAccountBook'; +export * from './optionsCandlestick'; export * from './optionsContract'; export * from './optionsMySettlements'; export * from './optionsMyTrade'; export * from './optionsOrder'; export * from './optionsPosition'; export * from './optionsPositionClose'; +export * from './optionsPositionCloseOrder'; export * from './optionsSettlement'; export * from './optionsTicker'; export * from './optionsUnderlying'; @@ -82,10 +89,13 @@ export * from './spotAccount'; export * from './spotPricePutOrder'; export * from './spotPriceTrigger'; export * from './spotPriceTriggeredOrder'; +export * from './subAccount'; export * from './subAccountBalance'; export * from './subAccountCrossMarginBalance'; export * from './subAccountFuturesBalance'; +export * from './subAccountKey'; export * from './subAccountMarginBalance'; +export * from './subAccountToSubAccount'; export * from './subAccountTransfer'; export * from './subCrossMarginAccount'; export * from './systemTime'; @@ -96,6 +106,7 @@ export * from './tradeFee'; export * from './transactionID'; export * from './transfer'; export * from './triggerOrderResponse'; +export * from './triggerTime'; export * from './withdrawStatus'; import { AxiosRequestConfig } from 'axios'; @@ -104,12 +115,16 @@ import crypto = require('crypto'); import { URL } from 'url'; import { AccountBalance } from './accountBalance'; +import { ApiV4KeyPerm } from './apiV4KeyPerm'; import { AutoRepaySetting } from './autoRepaySetting'; +import { BatchFuturesOrder } from './batchFuturesOrder'; import { BatchOrder } from './batchOrder'; import { CancelOrder } from './cancelOrder'; import { CancelOrderResult } from './cancelOrderResult'; import { Contract } from './contract'; import { ContractStat } from './contractStat'; +import { CountdownCancelAllFuturesTask } from './countdownCancelAllFuturesTask'; +import { CountdownCancelAllSpotTask } from './countdownCancelAllSpotTask'; import { CrossMarginAccount } from './crossMarginAccount'; import { CrossMarginAccountBook } from './crossMarginAccountBook'; import { CrossMarginBalance } from './crossMarginBalance'; @@ -143,6 +158,7 @@ import { FuturesOrder } from './futuresOrder'; import { FuturesOrderAmendment } from './futuresOrderAmendment'; import { FuturesOrderBook } from './futuresOrderBook'; import { FuturesOrderBookItem } from './futuresOrderBookItem'; +import { FuturesPremiumIndex } from './futuresPremiumIndex'; import { FuturesPriceTrigger } from './futuresPriceTrigger'; import { FuturesPriceTriggeredOrder } from './futuresPriceTriggeredOrder'; import { FuturesTicker } from './futuresTicker'; @@ -165,12 +181,14 @@ import { MyFuturesTrade } from './myFuturesTrade'; import { OpenOrders } from './openOrders'; import { OptionsAccount } from './optionsAccount'; import { OptionsAccountBook } from './optionsAccountBook'; +import { OptionsCandlestick } from './optionsCandlestick'; import { OptionsContract } from './optionsContract'; import { OptionsMySettlements } from './optionsMySettlements'; import { OptionsMyTrade } from './optionsMyTrade'; import { OptionsOrder } from './optionsOrder'; import { OptionsPosition } from './optionsPosition'; import { OptionsPositionClose } from './optionsPositionClose'; +import { OptionsPositionCloseOrder } from './optionsPositionCloseOrder'; import { OptionsSettlement } from './optionsSettlement'; import { OptionsTicker } from './optionsTicker'; import { OptionsUnderlying } from './optionsUnderlying'; @@ -187,10 +205,13 @@ import { SpotAccount } from './spotAccount'; import { SpotPricePutOrder } from './spotPricePutOrder'; import { SpotPriceTrigger } from './spotPriceTrigger'; import { SpotPriceTriggeredOrder } from './spotPriceTriggeredOrder'; +import { SubAccount } from './subAccount'; import { SubAccountBalance } from './subAccountBalance'; import { SubAccountCrossMarginBalance } from './subAccountCrossMarginBalance'; import { SubAccountFuturesBalance } from './subAccountFuturesBalance'; +import { SubAccountKey } from './subAccountKey'; import { SubAccountMarginBalance } from './subAccountMarginBalance'; +import { SubAccountToSubAccount } from './subAccountToSubAccount'; import { SubAccountTransfer } from './subAccountTransfer'; import { SubCrossMarginAccount } from './subCrossMarginAccount'; import { SystemTime } from './systemTime'; @@ -201,6 +222,7 @@ import { TradeFee } from './tradeFee'; import { TransactionID } from './transactionID'; import { Transfer } from './transfer'; import { TriggerOrderResponse } from './triggerOrderResponse'; +import { TriggerTime } from './triggerTime'; import { WithdrawStatus } from './withdrawStatus'; /* tslint:disable:no-unused-variable */ @@ -208,7 +230,12 @@ const primitives = ['string', 'boolean', 'double', 'integer', 'long', 'float', ' const enumsMap: { [index: string]: any } = { 'AccountBalance.Currency': AccountBalance.Currency, + 'ApiV4KeyPerm.Name': ApiV4KeyPerm.Name, 'AutoRepaySetting.Status': AutoRepaySetting.Status, + 'BatchFuturesOrder.FinishAs': BatchFuturesOrder.FinishAs, + 'BatchFuturesOrder.Status': BatchFuturesOrder.Status, + 'BatchFuturesOrder.Tif': BatchFuturesOrder.Tif, + 'BatchFuturesOrder.AutoSize': BatchFuturesOrder.AutoSize, 'BatchOrder.Status': BatchOrder.Status, 'BatchOrder.Type': BatchOrder.Type, 'BatchOrder.Account': BatchOrder.Account, @@ -256,6 +283,8 @@ const enumsMap: { [index: string]: any } = { 'SpotPricePutOrder.Account': SpotPricePutOrder.Account, 'SpotPricePutOrder.TimeInForce': SpotPricePutOrder.TimeInForce, 'SpotPriceTrigger.Rule': SpotPriceTrigger.Rule, + 'SubAccountToSubAccount.SubAccountFromType': SubAccountToSubAccount.SubAccountFromType, + 'SubAccountToSubAccount.SubAccountToType': SubAccountToSubAccount.SubAccountToType, 'SubAccountTransfer.Direction': SubAccountTransfer.Direction, 'SubAccountTransfer.SubAccountType': SubAccountTransfer.SubAccountType, 'Trade.Side': Trade.Side, @@ -266,12 +295,16 @@ const enumsMap: { [index: string]: any } = { const typeMap: { [index: string]: any } = { AccountBalance: AccountBalance, + ApiV4KeyPerm: ApiV4KeyPerm, AutoRepaySetting: AutoRepaySetting, + BatchFuturesOrder: BatchFuturesOrder, BatchOrder: BatchOrder, CancelOrder: CancelOrder, CancelOrderResult: CancelOrderResult, Contract: Contract, ContractStat: ContractStat, + CountdownCancelAllFuturesTask: CountdownCancelAllFuturesTask, + CountdownCancelAllSpotTask: CountdownCancelAllSpotTask, CrossMarginAccount: CrossMarginAccount, CrossMarginAccountBook: CrossMarginAccountBook, CrossMarginBalance: CrossMarginBalance, @@ -305,6 +338,7 @@ const typeMap: { [index: string]: any } = { FuturesOrderAmendment: FuturesOrderAmendment, FuturesOrderBook: FuturesOrderBook, FuturesOrderBookItem: FuturesOrderBookItem, + FuturesPremiumIndex: FuturesPremiumIndex, FuturesPriceTrigger: FuturesPriceTrigger, FuturesPriceTriggeredOrder: FuturesPriceTriggeredOrder, FuturesTicker: FuturesTicker, @@ -327,12 +361,14 @@ const typeMap: { [index: string]: any } = { OpenOrders: OpenOrders, OptionsAccount: OptionsAccount, OptionsAccountBook: OptionsAccountBook, + OptionsCandlestick: OptionsCandlestick, OptionsContract: OptionsContract, OptionsMySettlements: OptionsMySettlements, OptionsMyTrade: OptionsMyTrade, OptionsOrder: OptionsOrder, OptionsPosition: OptionsPosition, OptionsPositionClose: OptionsPositionClose, + OptionsPositionCloseOrder: OptionsPositionCloseOrder, OptionsSettlement: OptionsSettlement, OptionsTicker: OptionsTicker, OptionsUnderlying: OptionsUnderlying, @@ -349,10 +385,13 @@ const typeMap: { [index: string]: any } = { SpotPricePutOrder: SpotPricePutOrder, SpotPriceTrigger: SpotPriceTrigger, SpotPriceTriggeredOrder: SpotPriceTriggeredOrder, + SubAccount: SubAccount, SubAccountBalance: SubAccountBalance, SubAccountCrossMarginBalance: SubAccountCrossMarginBalance, SubAccountFuturesBalance: SubAccountFuturesBalance, + SubAccountKey: SubAccountKey, SubAccountMarginBalance: SubAccountMarginBalance, + SubAccountToSubAccount: SubAccountToSubAccount, SubAccountTransfer: SubAccountTransfer, SubCrossMarginAccount: SubCrossMarginAccount, SystemTime: SystemTime, @@ -363,6 +402,7 @@ const typeMap: { [index: string]: any } = { TransactionID: TransactionID, Transfer: Transfer, TriggerOrderResponse: TriggerOrderResponse, + TriggerTime: TriggerTime, WithdrawStatus: WithdrawStatus, }; diff --git a/model/optionsAccountBook.ts b/model/optionsAccountBook.ts index 7089b00..0815f2a 100644 --- a/model/optionsAccountBook.ts +++ b/model/optionsAccountBook.ts @@ -15,11 +15,11 @@ export class OptionsAccountBook { */ 'time'?: number; /** - * Amount changed + * Amount changed (USDT) */ 'change'?: string; /** - * Account total balance after change + * Account total balance after change (USDT) */ 'balance'?: string; /** diff --git a/model/optionsCandlestick.ts b/model/optionsCandlestick.ts new file mode 100644 index 0000000..81d5663 --- /dev/null +++ b/model/optionsCandlestick.ts @@ -0,0 +1,79 @@ +/** + * 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. + */ + +/** + * data point in every timestamp + */ +export class OptionsCandlestick { + /** + * Unix timestamp in seconds + */ + 't'?: number; + /** + * size volume (contract size). Only returned if `contract` is not prefixed + */ + 'v'?: number; + /** + * Close price (quote currency, unit: underlying corresponding option price) + */ + 'c'?: string; + /** + * Highest price (quote currency, unit: underlying corresponding option price) + */ + 'h'?: string; + /** + * Lowest price (quote currency, unit: underlying corresponding option price) + */ + 'l'?: string; + /** + * Open price (quote currency, unit: underlying corresponding option price) + */ + 'o'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 't', + baseName: 't', + type: 'number', + }, + { + name: 'v', + baseName: 'v', + type: 'number', + }, + { + name: 'c', + baseName: 'c', + type: 'string', + }, + { + name: 'h', + baseName: 'h', + type: 'string', + }, + { + name: 'l', + baseName: 'l', + type: 'string', + }, + { + name: 'o', + baseName: 'o', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return OptionsCandlestick.attributeTypeMap; + } +} diff --git a/model/optionsContract.ts b/model/optionsContract.ts index 21b3cad..62f5346 100644 --- a/model/optionsContract.ts +++ b/model/optionsContract.ts @@ -10,11 +10,11 @@ */ /** - * Futures contract details + * Options contract detail */ export class OptionsContract { /** - * Futures contract + * Options contract name */ 'name'?: string; /** @@ -42,7 +42,7 @@ export class OptionsContract { */ 'underlying'?: string; /** - * Underlying price + * Underlying price (quote currency) */ 'underlyingPrice'?: string; /** @@ -50,11 +50,11 @@ export class OptionsContract { */ 'lastPrice'?: string; /** - * Current mark price + * Current mark price (quote currency) */ 'markPrice'?: string; /** - * Current index price + * Current index price (quote currency) */ 'indexPrice'?: string; /** diff --git a/model/optionsMySettlements.ts b/model/optionsMySettlements.ts index d8bcf15..8df1215 100644 --- a/model/optionsMySettlements.ts +++ b/model/optionsMySettlements.ts @@ -19,15 +19,15 @@ export class OptionsMySettlements { */ 'underlying'?: string; /** - * Futures contract + * Options contract name */ 'contract'?: string; /** - * Strike price + * Strike price (quote currency) */ 'strikePrice'?: string; /** - * settlement price + * Settlement price (quote currency) */ 'settlePrice'?: string; /** @@ -35,15 +35,15 @@ export class OptionsMySettlements { */ 'size'?: number; /** - * Settlement profit + * Settlement profit (quote currency) */ 'settleProfit'?: string; /** - * Fee + * Fee (quote currency) */ 'fee'?: string; /** - * The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. + * The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (quote currency) */ 'realisedPnl'?: string; diff --git a/model/optionsMyTrade.ts b/model/optionsMyTrade.ts index b758a0a..f7461af 100644 --- a/model/optionsMyTrade.ts +++ b/model/optionsMyTrade.ts @@ -19,7 +19,7 @@ export class OptionsMyTrade { */ 'createTime'?: number; /** - * Futures contract + * Options contract name */ 'contract'?: string; /** @@ -31,11 +31,11 @@ export class OptionsMyTrade { */ 'size'?: number; /** - * Trading price + * Trading price (quote currency) */ 'price'?: string; /** - * Underlying price + * Underlying price (quote currency) */ 'underlyingPrice'?: string; /** diff --git a/model/optionsOrder.ts b/model/optionsOrder.ts index fdd9fd3..25fbaa9 100644 --- a/model/optionsOrder.ts +++ b/model/optionsOrder.ts @@ -50,7 +50,7 @@ export class OptionsOrder { */ 'iceberg'?: number; /** - * Order price. 0 for market order with `tif` set as `ioc` + * Order price. 0 for market order with `tif` set as `ioc` (USDT) */ 'price'?: string; /** @@ -74,7 +74,7 @@ export class OptionsOrder { */ 'isLiq'?: boolean; /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only + * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee */ 'tif'?: OptionsOrder.Tif; /** @@ -101,6 +101,10 @@ export class OptionsOrder { * Reference user ID */ 'refu'?: number; + /** + * Referrer rebate + */ + 'refr'?: string; static discriminator: string | undefined = undefined; @@ -215,6 +219,11 @@ export class OptionsOrder { baseName: 'refu', type: 'number', }, + { + name: 'refr', + baseName: 'refr', + type: 'string', + }, ]; static getAttributeTypeMap() { diff --git a/model/optionsPosition.ts b/model/optionsPosition.ts index 49919d0..ecf761e 100644 --- a/model/optionsPosition.ts +++ b/model/optionsPosition.ts @@ -9,10 +9,10 @@ * Do not edit the class manually. */ -import { PositionCloseOrder } from './positionCloseOrder'; +import { OptionsPositionCloseOrder } from './optionsPositionCloseOrder'; /** - * Futures position details + * Options position information */ export class OptionsPosition { /** @@ -20,19 +20,19 @@ export class OptionsPosition { */ 'user'?: number; /** - * Futures contract + * Options contract name */ 'contract'?: string; /** - * Position size + * Position size (contract size) */ 'size'?: number; /** - * Entry price + * Entry size (quote currency) */ 'entryPrice'?: string; /** - * Current mark price + * Current mark price (quote currency) */ 'markPrice'?: string; /** @@ -47,7 +47,7 @@ export class OptionsPosition { * Current open orders */ 'pendingOrders'?: number; - 'closeOrder'?: PositionCloseOrder | null; + 'closeOrder'?: OptionsPositionCloseOrder | null; static discriminator: string | undefined = undefined; @@ -95,7 +95,7 @@ export class OptionsPosition { { name: 'closeOrder', baseName: 'close_order', - type: 'PositionCloseOrder', + type: 'OptionsPositionCloseOrder', }, ]; diff --git a/model/optionsPositionClose.ts b/model/optionsPositionClose.ts index 0602e99..587aa73 100644 --- a/model/optionsPositionClose.ts +++ b/model/optionsPositionClose.ts @@ -15,7 +15,7 @@ export class OptionsPositionClose { */ 'time'?: number; /** - * Futures contract + * Options contract name */ 'contract'?: string; /** diff --git a/model/optionsPositionCloseOrder.ts b/model/optionsPositionCloseOrder.ts new file mode 100644 index 0000000..14da25f --- /dev/null +++ b/model/optionsPositionCloseOrder.ts @@ -0,0 +1,52 @@ +/** + * 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. + */ + +/** + * Current close order if any, or `null` + */ +export class OptionsPositionCloseOrder { + /** + * Close order ID + */ + 'id'?: number; + /** + * Close order price (quote currency) + */ + 'price'?: string; + /** + * Is the close order from liquidation + */ + 'isLiq'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'id', + baseName: 'id', + type: 'number', + }, + { + name: 'price', + baseName: 'price', + type: 'string', + }, + { + name: 'isLiq', + baseName: 'is_liq', + type: 'boolean', + }, + ]; + + static getAttributeTypeMap() { + return OptionsPositionCloseOrder.attributeTypeMap; + } +} diff --git a/model/optionsSettlement.ts b/model/optionsSettlement.ts index 332a01d..806cba9 100644 --- a/model/optionsSettlement.ts +++ b/model/optionsSettlement.ts @@ -15,23 +15,23 @@ export class OptionsSettlement { */ 'time'?: number; /** - * Contract name + * Options contract name */ 'contract'?: string; /** - * Settlement profit per size + * Settlement profit per size (quote currency) */ 'profit'?: string; /** - * Settlement fee per size + * Settlement fee per size (quote currency) */ 'fee'?: string; /** - * Strike price + * Strike price (quote currency) */ 'strikePrice'?: string; /** - * settlement price + * Settlement price (quote currency) */ 'settlePrice'?: string; diff --git a/model/optionsTicker.ts b/model/optionsTicker.ts index 2887408..af2c7cb 100644 --- a/model/optionsTicker.ts +++ b/model/optionsTicker.ts @@ -18,15 +18,15 @@ export class OptionsTicker { */ 'name'?: string; /** - * Last trading price + * Last trading price (quote currency) */ 'lastPrice'?: string; /** - * Current mark price + * Current mark price (quote currency) */ 'markPrice'?: string; /** - * Current index price + * Current index price (quote currency) */ 'indexPrice'?: string; /** diff --git a/model/optionsUnderlying.ts b/model/optionsUnderlying.ts index 8f3c1ad..3814d1d 100644 --- a/model/optionsUnderlying.ts +++ b/model/optionsUnderlying.ts @@ -15,7 +15,7 @@ export class OptionsUnderlying { */ 'name'?: string; /** - * Spot index price + * Spot index price (quote currency) */ 'indexPrice'?: string; diff --git a/model/optionsUnderlyingTicker.ts b/model/optionsUnderlyingTicker.ts index 3389996..17a818d 100644 --- a/model/optionsUnderlyingTicker.ts +++ b/model/optionsUnderlyingTicker.ts @@ -22,7 +22,7 @@ export class OptionsUnderlyingTicker { */ 'tradeCall'?: number; /** - * Index price + * Index price (quote currency) */ 'indexPrice'?: string; diff --git a/model/order.ts b/model/order.ts index 6e6cf4f..f3a0126 100644 --- a/model/order.ts +++ b/model/order.ts @@ -46,7 +46,7 @@ export class Order { */ 'currencyPair': string; /** - * Order type. limit - limit order + * Order Type - limit : Limit Order - market : Market Order */ 'type'?: Order.Type; /** @@ -58,15 +58,15 @@ export class Order { */ 'side': Order.Side; /** - * Trade amount + * 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` */ 'amount': string; /** - * Order price + * Price can\'t be empty when `type`= `limit` */ - 'price': string; + 'price'?: 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 + * 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` */ 'timeInForce'?: Order.TimeInForce; /** @@ -109,6 +109,14 @@ export class Order { * GT used to deduct fee */ 'gtFee'?: string; + /** + * GT used to deduct maker fee + */ + 'gtMakerFee'?: string; + /** + * GT used to deduct taker fee + */ + 'gtTakerFee'?: string; /** * Whether GT fee discount is used */ @@ -245,6 +253,16 @@ export class Order { baseName: 'gt_fee', type: 'string', }, + { + name: 'gtMakerFee', + baseName: 'gt_maker_fee', + type: 'string', + }, + { + name: 'gtTakerFee', + baseName: 'gt_taker_fee', + type: 'string', + }, { name: 'gtDiscount', baseName: 'gt_discount', @@ -275,6 +293,7 @@ export namespace Order { } export enum Type { Limit = 'limit', + Market = 'market', } export enum Account { Spot = 'spot', diff --git a/model/subAccount.ts b/model/subAccount.ts new file mode 100644 index 0000000..0ba7d8b --- /dev/null +++ b/model/subAccount.ts @@ -0,0 +1,85 @@ +/** + * 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 SubAccount { + /** + * custom text + */ + 'remark'?: string; + /** + * Sub-account login name: Only letters, numbers and underscores are supported, and cannot contain other illegal characters + */ + 'loginName': string; + /** + * The sub-account\'s password. (Default: the same as main account\'s password) + */ + 'password'?: string; + /** + * The sub-account\'s email address. (Default: the same as main account\'s email address) + */ + 'email'?: string; + /** + * State: 1-normal, 2-locked\" + */ + 'state'?: number; + /** + * The user id of the sub-account + */ + 'userId'?: number; + /** + * Created time + */ + 'createTime'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'remark', + baseName: 'remark', + type: 'string', + }, + { + name: 'loginName', + baseName: 'login_name', + type: 'string', + }, + { + name: 'password', + baseName: 'password', + type: 'string', + }, + { + name: 'email', + baseName: 'email', + type: 'string', + }, + { + name: 'state', + baseName: 'state', + type: 'number', + }, + { + name: 'userId', + baseName: 'user_id', + type: 'number', + }, + { + name: 'createTime', + baseName: 'create_time', + type: 'number', + }, + ]; + + static getAttributeTypeMap() { + return SubAccount.attributeTypeMap; + } +} diff --git a/model/subAccountKey.ts b/model/subAccountKey.ts new file mode 100644 index 0000000..e56336c --- /dev/null +++ b/model/subAccountKey.ts @@ -0,0 +1,93 @@ +/** + * 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 { ApiV4KeyPerm } from './apiV4KeyPerm'; + +export class SubAccountKey { + /** + * User ID + */ + 'userId'?: string; + /** + * API key name + */ + 'name'?: string; + 'perms'?: Array; + /** + * ip white list (list will be removed if no value is passed) + */ + 'ipWhitelist'?: Array; + /** + * API Key + */ + 'key'?: string; + /** + * State 1 - normal 2 - locked 3 - frozen + */ + 'state'?: number; + /** + * Creation time + */ + 'createdAt'?: string; + /** + * Last update time + */ + 'updatedAt'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'userId', + baseName: 'user_id', + type: 'string', + }, + { + name: 'name', + baseName: 'name', + type: 'string', + }, + { + name: 'perms', + baseName: 'perms', + type: 'Array', + }, + { + name: 'ipWhitelist', + baseName: 'ip_whitelist', + type: 'Array', + }, + { + name: 'key', + baseName: 'key', + type: 'string', + }, + { + name: 'state', + baseName: 'state', + type: 'number', + }, + { + name: 'createdAt', + baseName: 'created_at', + type: 'string', + }, + { + name: 'updatedAt', + baseName: 'updated_at', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return SubAccountKey.attributeTypeMap; + } +} diff --git a/model/subAccountToSubAccount.ts b/model/subAccountToSubAccount.ts new file mode 100644 index 0000000..2edddc8 --- /dev/null +++ b/model/subAccountToSubAccount.ts @@ -0,0 +1,98 @@ +/** + * 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 SubAccountToSubAccount { + /** + * Transfer currency name + */ + 'currency': string; + /** + * Transfer from the account. (deprecate, use `sub_account_from_type` and `sub_account_to_type` instead) + */ + 'subAccountType'?: string; + /** + * Transfer from the user id of the sub-account + */ + 'subAccountFrom': string; + /** + * Transfer from the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account + */ + 'subAccountFromType': SubAccountToSubAccount.SubAccountFromType; + /** + * Transfer to the user id of the sub-account + */ + 'subAccountTo': string; + /** + * Transfer to the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account + */ + 'subAccountToType': SubAccountToSubAccount.SubAccountToType; + /** + * Transfer amount + */ + 'amount': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'currency', + baseName: 'currency', + type: 'string', + }, + { + name: 'subAccountType', + baseName: 'sub_account_type', + type: 'string', + }, + { + name: 'subAccountFrom', + baseName: 'sub_account_from', + type: 'string', + }, + { + name: 'subAccountFromType', + baseName: 'sub_account_from_type', + type: 'SubAccountToSubAccount.SubAccountFromType', + }, + { + name: 'subAccountTo', + baseName: 'sub_account_to', + type: 'string', + }, + { + name: 'subAccountToType', + baseName: 'sub_account_to_type', + type: 'SubAccountToSubAccount.SubAccountToType', + }, + { + name: 'amount', + baseName: 'amount', + type: 'string', + }, + ]; + + static getAttributeTypeMap() { + return SubAccountToSubAccount.attributeTypeMap; + } +} + +export namespace SubAccountToSubAccount { + export enum SubAccountFromType { + Spot = 'spot', + Futures = 'futures', + CrossMargin = 'cross_margin', + } + export enum SubAccountToType { + Spot = 'spot', + Futures = 'futures', + CrossMargin = 'cross_margin', + } +} diff --git a/model/triggerTime.ts b/model/triggerTime.ts new file mode 100644 index 0000000..56a3937 --- /dev/null +++ b/model/triggerTime.ts @@ -0,0 +1,31 @@ +/** + * 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 TriggerTime { + /** + * Timestamp of the end of the countdown, in milliseconds + */ + 'triggerTime'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ name: string; baseName: string; type: string }> = [ + { + name: 'triggerTime', + baseName: 'triggerTime', + type: 'number', + }, + ]; + + static getAttributeTypeMap() { + return TriggerTime.attributeTypeMap; + } +} diff --git a/package-lock.json b/package-lock.json index 214db53..8d8bf6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gate-api", - "version": "5.26.0", + "version": "5.34.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gate-api", - "version": "5.26.0", + "version": "5.34.0", "license": "Unlicense", "dependencies": { "@types/node": "^8.10.48", @@ -33,9 +33,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -754,13 +754,10 @@ "dev": true }, "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "node_modules/core-js": { "version": "2.6.12", @@ -1137,15 +1134,15 @@ } }, "node_modules/flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "funding": [ { "type": "individual", @@ -1215,9 +1212,9 @@ } }, "node_modules/globals": { - "version": "13.16.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", - "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", + "version": "13.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", + "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1496,10 +1493,13 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mkdirp": { "version": "0.5.6", @@ -1609,9 +1609,9 @@ } }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -1735,16 +1735,10 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1878,9 +1872,9 @@ } }, "node_modules/table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", "dev": true, "dependencies": { "ajv": "^8.0.1", @@ -1894,9 +1888,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -2060,9 +2054,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true }, "@babel/highlight": { @@ -2632,13 +2626,10 @@ "dev": true }, "convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "core-js": { "version": "2.6.12", @@ -2917,15 +2908,15 @@ } }, "flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, "follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" }, "fs.realpath": { "version": "1.0.0", @@ -2969,9 +2960,9 @@ } }, "globals": { - "version": "13.16.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", - "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", + "version": "13.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", + "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -3186,9 +3177,9 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true }, "mkdirp": { @@ -3275,9 +3266,9 @@ "dev": true }, "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", "dev": true }, "prettier-linter-helpers": { @@ -3359,16 +3350,10 @@ "glob": "^7.1.3" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -3463,9 +3448,9 @@ } }, "table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", "dev": true, "requires": { "ajv": "^8.0.1", @@ -3476,9 +3461,9 @@ }, "dependencies": { "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", diff --git a/package.json b/package.json index 24006fc..976e84d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gate-api", - "version": "5.26.0", + "version": "5.34.0", "description": "NodeJS client for gate-api", "repository": "gateio/gateapi-nodejs", "main": "dist/api.js",