diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml
new file mode 100644
index 0000000..b3e9e04
--- /dev/null
+++ b/.github/workflows/maven-publish.yml
@@ -0,0 +1,48 @@
+# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
+# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
+
+name: Maven Package
+
+on:
+ push:
+ tags:
+ - '*'
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 11
+ uses: actions/setup-java@v4
+ with:
+ java-version: '11'
+ distribution: 'temurin'
+ server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
+ settings-path: ${{ github.workspace }} # location for the settings.xml file
+
+ - name: Build with Maven
+ run: mvn -B package -DskipTests --file pom.xml --settings settings.xml
+
+ - name: Set up Apache Maven Central
+ uses: actions/setup-java@v4
+ with: # running setup-java again overwrites the settings.xml
+ distribution: 'temurin'
+ java-version: '11'
+ server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
+ server-username: MAVEN_CENTRAL_USERNAME # env variable for username in deploy
+ server-password: MAVEN_CENTRAL_PASSWORD # env variable for token in deploy
+ gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
+
+ - name: Publish to Apache Maven Central
+ run: mvn deploy
+ env:
+ MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
+ MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
+ MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
diff --git a/README.md b/README.md
index cdec15d..6f1c3fc 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,14 @@
# gate-api
-Gate API v4
+Gate API
-- API version: 4.22.2
-- SDK version: 6.22.2
+- API version: v4.105.8
+- SDK version: 7.1.8
-Welcome to Gate.io API
+Welcome to Gate API
+APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
-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.
-
- For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
+ For more information, please visit [https://www.gate.com/page/contacts](https://www.gate.com/page/contacts)
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
@@ -45,20 +44,6 @@ Building the API client library requires:
## Installation
-To install the API client library to your local Maven repository, simply execute:
-
-```shell
-mvn clean install
-```
-
-To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
-
-```shell
-mvn clean deploy
-```
-
-Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
-
### Maven users
Add this dependency to your project's POM:
@@ -67,7 +52,7 @@ Add this dependency to your project's POM:
io.gate
gate-api
- 6.22.2
+ 7.1.8
compile
```
@@ -77,7 +62,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:
```groovy
-compile "io.gate:gate-api:6.22.2"
+compile "io.gate:gate-api:7.1.8"
```
### Others
@@ -90,9 +75,23 @@ mvn clean package
Then manually install the following JARs:
-* `target/gate-api-6.22.2.jar`
+* `target/gate-api-7.1.8.jar`
* `target/lib/*.jar`
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn clean install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn clean deploy
+```
+
+Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
+
## Getting Started
Please follow the [installation](#installation) instruction and execute the following Java code:
@@ -104,24 +103,27 @@ import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.DeliveryApi;
+import io.gate.gateapi.api.AccountApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
- DeliveryApi apiInstance = new DeliveryApi(defaultClient);
- String settle = "usdt"; // String | Settle currency
+ AccountApi apiInstance = new AccountApi(defaultClient);
try {
- List result = apiInstance.listDeliveryContracts(settle);
+ AccountDetail result = apiInstance.getAccountDetail();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling DeliveryApi#listDeliveryContracts");
+ System.err.println("Exception when calling AccountApi#getAccountDetail");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -138,211 +140,546 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
-*DeliveryApi* | [**listDeliveryContracts**](docs/DeliveryApi.md#listDeliveryContracts) | **GET** /delivery/{settle}/contracts | List all futures contracts
-*DeliveryApi* | [**getDeliveryContract**](docs/DeliveryApi.md#getDeliveryContract) | **GET** /delivery/{settle}/contracts/{contract} | Get a single contract
-*DeliveryApi* | [**listDeliveryOrderBook**](docs/DeliveryApi.md#listDeliveryOrderBook) | **GET** /delivery/{settle}/order_book | Futures order book
-*DeliveryApi* | [**listDeliveryTrades**](docs/DeliveryApi.md#listDeliveryTrades) | **GET** /delivery/{settle}/trades | Futures trading history
-*DeliveryApi* | [**listDeliveryCandlesticks**](docs/DeliveryApi.md#listDeliveryCandlesticks) | **GET** /delivery/{settle}/candlesticks | Get futures candlesticks
-*DeliveryApi* | [**listDeliveryTickers**](docs/DeliveryApi.md#listDeliveryTickers) | **GET** /delivery/{settle}/tickers | List futures tickers
-*DeliveryApi* | [**listDeliveryInsuranceLedger**](docs/DeliveryApi.md#listDeliveryInsuranceLedger) | **GET** /delivery/{settle}/insurance | Futures insurance balance history
-*DeliveryApi* | [**listDeliveryAccounts**](docs/DeliveryApi.md#listDeliveryAccounts) | **GET** /delivery/{settle}/accounts | Query futures account
-*DeliveryApi* | [**listDeliveryAccountBook**](docs/DeliveryApi.md#listDeliveryAccountBook) | **GET** /delivery/{settle}/account_book | Query account book
-*DeliveryApi* | [**listDeliveryPositions**](docs/DeliveryApi.md#listDeliveryPositions) | **GET** /delivery/{settle}/positions | List all positions of a user
-*DeliveryApi* | [**getDeliveryPosition**](docs/DeliveryApi.md#getDeliveryPosition) | **GET** /delivery/{settle}/positions/{contract} | Get single position
+*AccountApi* | [**getAccountDetail**](docs/AccountApi.md#getAccountDetail) | **GET** /account/detail | Retrieve user account information
+*AccountApi* | [**getAccountRateLimit**](docs/AccountApi.md#getAccountRateLimit) | **GET** /account/rate_limit | Get user transaction rate limit information
+*AccountApi* | [**listSTPGroups**](docs/AccountApi.md#listSTPGroups) | **GET** /account/stp_groups | Query STP user groups created by the user
+*AccountApi* | [**createSTPGroup**](docs/AccountApi.md#createSTPGroup) | **POST** /account/stp_groups | Create STP user group
+*AccountApi* | [**listSTPGroupsUsers**](docs/AccountApi.md#listSTPGroupsUsers) | **GET** /account/stp_groups/{stp_id}/users | Query users in the STP user group
+*AccountApi* | [**addSTPGroupUsers**](docs/AccountApi.md#addSTPGroupUsers) | **POST** /account/stp_groups/{stp_id}/users | Add users to the STP user group
+*AccountApi* | [**deleteSTPGroupUsers**](docs/AccountApi.md#deleteSTPGroupUsers) | **DELETE** /account/stp_groups/{stp_id}/users | Delete users from the STP user group
+*AccountApi* | [**getDebitFee**](docs/AccountApi.md#getDebitFee) | **GET** /account/debit_fee | Query GT fee deduction configuration
+*AccountApi* | [**setDebitFee**](docs/AccountApi.md#setDebitFee) | **POST** /account/debit_fee | Configure GT fee deduction
+*CollateralLoanApi* | [**listCollateralLoanOrders**](docs/CollateralLoanApi.md#listCollateralLoanOrders) | **GET** /loan/collateral/orders | Query collateral loan order list
+*CollateralLoanApi* | [**createCollateralLoan**](docs/CollateralLoanApi.md#createCollateralLoan) | **POST** /loan/collateral/orders | Place collateral loan order
+*CollateralLoanApi* | [**getCollateralLoanOrderDetail**](docs/CollateralLoanApi.md#getCollateralLoanOrderDetail) | **GET** /loan/collateral/orders/{order_id} | Query single order details
+*CollateralLoanApi* | [**repayCollateralLoan**](docs/CollateralLoanApi.md#repayCollateralLoan) | **POST** /loan/collateral/repay | Collateral loan repayment
+*CollateralLoanApi* | [**listRepayRecords**](docs/CollateralLoanApi.md#listRepayRecords) | **GET** /loan/collateral/repay_records | Query collateral loan repayment records
+*CollateralLoanApi* | [**listCollateralRecords**](docs/CollateralLoanApi.md#listCollateralRecords) | **GET** /loan/collateral/collaterals | Query collateral adjustment records
+*CollateralLoanApi* | [**operateCollateral**](docs/CollateralLoanApi.md#operateCollateral) | **POST** /loan/collateral/collaterals | Increase or redeem collateral
+*CollateralLoanApi* | [**getUserTotalAmount**](docs/CollateralLoanApi.md#getUserTotalAmount) | **GET** /loan/collateral/total_amount | Query user's total borrowing and collateral amount
+*CollateralLoanApi* | [**getUserLtvInfo**](docs/CollateralLoanApi.md#getUserLtvInfo) | **GET** /loan/collateral/ltv | Query user's collateralization ratio and remaining borrowable currencies
+*CollateralLoanApi* | [**listCollateralCurrencies**](docs/CollateralLoanApi.md#listCollateralCurrencies) | **GET** /loan/collateral/currencies | Query supported borrowing and collateral currencies
+*DeliveryApi* | [**listDeliveryContracts**](docs/DeliveryApi.md#listDeliveryContracts) | **GET** /delivery/{settle}/contracts | Query all futures contracts
+*DeliveryApi* | [**getDeliveryContract**](docs/DeliveryApi.md#getDeliveryContract) | **GET** /delivery/{settle}/contracts/{contract} | Query single contract information
+*DeliveryApi* | [**listDeliveryOrderBook**](docs/DeliveryApi.md#listDeliveryOrderBook) | **GET** /delivery/{settle}/order_book | Query futures market depth information
+*DeliveryApi* | [**listDeliveryTrades**](docs/DeliveryApi.md#listDeliveryTrades) | **GET** /delivery/{settle}/trades | Futures market transaction records
+*DeliveryApi* | [**listDeliveryCandlesticks**](docs/DeliveryApi.md#listDeliveryCandlesticks) | **GET** /delivery/{settle}/candlesticks | Futures market K-line chart
+*DeliveryApi* | [**listDeliveryTickers**](docs/DeliveryApi.md#listDeliveryTickers) | **GET** /delivery/{settle}/tickers | Get all futures trading statistics
+*DeliveryApi* | [**listDeliveryInsuranceLedger**](docs/DeliveryApi.md#listDeliveryInsuranceLedger) | **GET** /delivery/{settle}/insurance | Futures market insurance fund history
+*DeliveryApi* | [**listDeliveryAccounts**](docs/DeliveryApi.md#listDeliveryAccounts) | **GET** /delivery/{settle}/accounts | Get futures account
+*DeliveryApi* | [**listDeliveryAccountBook**](docs/DeliveryApi.md#listDeliveryAccountBook) | **GET** /delivery/{settle}/account_book | Query futures account change history
+*DeliveryApi* | [**listDeliveryPositions**](docs/DeliveryApi.md#listDeliveryPositions) | **GET** /delivery/{settle}/positions | Get user position list
+*DeliveryApi* | [**getDeliveryPosition**](docs/DeliveryApi.md#getDeliveryPosition) | **GET** /delivery/{settle}/positions/{contract} | Get single position information
*DeliveryApi* | [**updateDeliveryPositionMargin**](docs/DeliveryApi.md#updateDeliveryPositionMargin) | **POST** /delivery/{settle}/positions/{contract}/margin | Update position margin
*DeliveryApi* | [**updateDeliveryPositionLeverage**](docs/DeliveryApi.md#updateDeliveryPositionLeverage) | **POST** /delivery/{settle}/positions/{contract}/leverage | Update position leverage
*DeliveryApi* | [**updateDeliveryPositionRiskLimit**](docs/DeliveryApi.md#updateDeliveryPositionRiskLimit) | **POST** /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit
-*DeliveryApi* | [**listDeliveryOrders**](docs/DeliveryApi.md#listDeliveryOrders) | **GET** /delivery/{settle}/orders | List futures orders
-*DeliveryApi* | [**createDeliveryOrder**](docs/DeliveryApi.md#createDeliveryOrder) | **POST** /delivery/{settle}/orders | Create a futures order
-*DeliveryApi* | [**cancelDeliveryOrders**](docs/DeliveryApi.md#cancelDeliveryOrders) | **DELETE** /delivery/{settle}/orders | Cancel all `open` orders matched
-*DeliveryApi* | [**getDeliveryOrder**](docs/DeliveryApi.md#getDeliveryOrder) | **GET** /delivery/{settle}/orders/{order_id} | Get a single order
-*DeliveryApi* | [**cancelDeliveryOrder**](docs/DeliveryApi.md#cancelDeliveryOrder) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel a single order
-*DeliveryApi* | [**getMyDeliveryTrades**](docs/DeliveryApi.md#getMyDeliveryTrades) | **GET** /delivery/{settle}/my_trades | List personal trading history
-*DeliveryApi* | [**listDeliveryPositionClose**](docs/DeliveryApi.md#listDeliveryPositionClose) | **GET** /delivery/{settle}/position_close | List position close history
-*DeliveryApi* | [**listDeliveryLiquidates**](docs/DeliveryApi.md#listDeliveryLiquidates) | **GET** /delivery/{settle}/liquidates | List liquidation history
-*DeliveryApi* | [**listDeliverySettlements**](docs/DeliveryApi.md#listDeliverySettlements) | **GET** /delivery/{settle}/settlements | List settlement history
-*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* | [**cancelPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order
-*FuturesApi* | [**listFuturesContracts**](docs/FuturesApi.md#listFuturesContracts) | **GET** /futures/{settle}/contracts | List all futures contracts
-*FuturesApi* | [**getFuturesContract**](docs/FuturesApi.md#getFuturesContract) | **GET** /futures/{settle}/contracts/{contract} | Get a single contract
-*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* | [**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
-*FuturesApi* | [**listContractStats**](docs/FuturesApi.md#listContractStats) | **GET** /futures/{settle}/contract_stats | Futures stats
-*FuturesApi* | [**listLiquidatedOrders**](docs/FuturesApi.md#listLiquidatedOrders) | **GET** /futures/{settle}/liq_orders | Retrieve liquidation history
-*FuturesApi* | [**listFuturesAccounts**](docs/FuturesApi.md#listFuturesAccounts) | **GET** /futures/{settle}/accounts | Query futures account
-*FuturesApi* | [**listFuturesAccountBook**](docs/FuturesApi.md#listFuturesAccountBook) | **GET** /futures/{settle}/account_book | Query account book
-*FuturesApi* | [**listPositions**](docs/FuturesApi.md#listPositions) | **GET** /futures/{settle}/positions | List all positions of a user
-*FuturesApi* | [**getPosition**](docs/FuturesApi.md#getPosition) | **GET** /futures/{settle}/positions/{contract} | Get single position
+*DeliveryApi* | [**listDeliveryOrders**](docs/DeliveryApi.md#listDeliveryOrders) | **GET** /delivery/{settle}/orders | Query futures order list
+*DeliveryApi* | [**createDeliveryOrder**](docs/DeliveryApi.md#createDeliveryOrder) | **POST** /delivery/{settle}/orders | Place futures order
+*DeliveryApi* | [**cancelDeliveryOrders**](docs/DeliveryApi.md#cancelDeliveryOrders) | **DELETE** /delivery/{settle}/orders | Cancel all orders with 'open' status
+*DeliveryApi* | [**getDeliveryOrder**](docs/DeliveryApi.md#getDeliveryOrder) | **GET** /delivery/{settle}/orders/{order_id} | Query single order details
+*DeliveryApi* | [**cancelDeliveryOrder**](docs/DeliveryApi.md#cancelDeliveryOrder) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel single order
+*DeliveryApi* | [**getMyDeliveryTrades**](docs/DeliveryApi.md#getMyDeliveryTrades) | **GET** /delivery/{settle}/my_trades | Query personal trading records
+*DeliveryApi* | [**listDeliveryPositionClose**](docs/DeliveryApi.md#listDeliveryPositionClose) | **GET** /delivery/{settle}/position_close | Query position close history
+*DeliveryApi* | [**listDeliveryLiquidates**](docs/DeliveryApi.md#listDeliveryLiquidates) | **GET** /delivery/{settle}/liquidates | Query liquidation history
+*DeliveryApi* | [**listDeliverySettlements**](docs/DeliveryApi.md#listDeliverySettlements) | **GET** /delivery/{settle}/settlements | Query settlement records
+*DeliveryApi* | [**listDeliveryRiskLimitTiers**](docs/DeliveryApi.md#listDeliveryRiskLimitTiers) | **GET** /delivery/{settle}/risk_limit_tiers | Query risk limit tiers
+*DeliveryApi* | [**listPriceTriggeredDeliveryOrders**](docs/DeliveryApi.md#listPriceTriggeredDeliveryOrders) | **GET** /delivery/{settle}/price_orders | Query auto order list
+*DeliveryApi* | [**createPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#createPriceTriggeredDeliveryOrder) | **POST** /delivery/{settle}/price_orders | Create price-triggered order
+*DeliveryApi* | [**cancelPriceTriggeredDeliveryOrderList**](docs/DeliveryApi.md#cancelPriceTriggeredDeliveryOrderList) | **DELETE** /delivery/{settle}/price_orders | Cancel all auto orders
+*DeliveryApi* | [**getPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Query single auto order details
+*DeliveryApi* | [**cancelPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel single auto order
+*EarnApi* | [**swapETH2**](docs/EarnApi.md#swapETH2) | **POST** /earn/staking/eth2/swap | ETH2 swap
+*EarnApi* | [**rateListETH2**](docs/EarnApi.md#rateListETH2) | **GET** /earn/staking/eth2/rate_records | ETH2 historical return rate query
+*EarnApi* | [**listDualInvestmentPlans**](docs/EarnApi.md#listDualInvestmentPlans) | **GET** /earn/dual/investment_plan | Dual Investment product list
+*EarnApi* | [**listDualOrders**](docs/EarnApi.md#listDualOrders) | **GET** /earn/dual/orders | Dual Investment order list
+*EarnApi* | [**placeDualOrder**](docs/EarnApi.md#placeDualOrder) | **POST** /earn/dual/orders | Place Dual Investment order
+*EarnApi* | [**listStructuredProducts**](docs/EarnApi.md#listStructuredProducts) | **GET** /earn/structured/products | Structured Product List
+*EarnApi* | [**listStructuredOrders**](docs/EarnApi.md#listStructuredOrders) | **GET** /earn/structured/orders | Structured Product Order List
+*EarnApi* | [**placeStructuredOrder**](docs/EarnApi.md#placeStructuredOrder) | **POST** /earn/structured/orders | Place Structured Product Order
+*EarnApi* | [**findCoin**](docs/EarnApi.md#findCoin) | **GET** /earn/staking/coins | Staking coins
+*EarnApi* | [**swapStakingCoin**](docs/EarnApi.md#swapStakingCoin) | **POST** /earn/staking/swap | On-chain token swap for earned coins
+*EarnUniApi* | [**listUniCurrencies**](docs/EarnUniApi.md#listUniCurrencies) | **GET** /earn/uni/currencies | Query lending currency list
+*EarnUniApi* | [**getUniCurrency**](docs/EarnUniApi.md#getUniCurrency) | **GET** /earn/uni/currencies/{currency} | Query single lending currency details
+*EarnUniApi* | [**listUserUniLends**](docs/EarnUniApi.md#listUserUniLends) | **GET** /earn/uni/lends | Query user's lending order list
+*EarnUniApi* | [**createUniLend**](docs/EarnUniApi.md#createUniLend) | **POST** /earn/uni/lends | Create lending or redemption
+*EarnUniApi* | [**changeUniLend**](docs/EarnUniApi.md#changeUniLend) | **PATCH** /earn/uni/lends | Amend user lending information
+*EarnUniApi* | [**listUniLendRecords**](docs/EarnUniApi.md#listUniLendRecords) | **GET** /earn/uni/lend_records | Query lending transaction records
+*EarnUniApi* | [**getUniInterest**](docs/EarnUniApi.md#getUniInterest) | **GET** /earn/uni/interests/{currency} | Query user's total interest income for specified currency
+*EarnUniApi* | [**listUniInterestRecords**](docs/EarnUniApi.md#listUniInterestRecords) | **GET** /earn/uni/interest_records | Query user dividend records
+*EarnUniApi* | [**getUniInterestStatus**](docs/EarnUniApi.md#getUniInterestStatus) | **GET** /earn/uni/interest_status/{currency} | Query currency interest compounding status
+*EarnUniApi* | [**listUniChart**](docs/EarnUniApi.md#listUniChart) | **GET** /earn/uni/chart | UniLoan currency annualized trend chart
+*EarnUniApi* | [**listUniRate**](docs/EarnUniApi.md#listUniRate) | **GET** /earn/uni/rate | Currency estimated annualized interest rate
+*FlashSwapApi* | [**listFlashSwapCurrencyPair**](docs/FlashSwapApi.md#listFlashSwapCurrencyPair) | **GET** /flash_swap/currency_pairs | List All Supported Currency Pairs In Flash Swap
+*FlashSwapApi* | [**listFlashSwapOrders**](docs/FlashSwapApi.md#listFlashSwapOrders) | **GET** /flash_swap/orders | Query flash swap order list
+*FlashSwapApi* | [**createFlashSwapOrder**](docs/FlashSwapApi.md#createFlashSwapOrder) | **POST** /flash_swap/orders | Create a flash swap order
+*FlashSwapApi* | [**getFlashSwapOrder**](docs/FlashSwapApi.md#getFlashSwapOrder) | **GET** /flash_swap/orders/{order_id} | Query single flash swap order
+*FlashSwapApi* | [**previewFlashSwapOrder**](docs/FlashSwapApi.md#previewFlashSwapOrder) | **POST** /flash_swap/orders/preview | Flash swap order preview
+*FuturesApi* | [**listFuturesContracts**](docs/FuturesApi.md#listFuturesContracts) | **GET** /futures/{settle}/contracts | Query all futures contracts
+*FuturesApi* | [**getFuturesContract**](docs/FuturesApi.md#getFuturesContract) | **GET** /futures/{settle}/contracts/{contract} | Query single contract information
+*FuturesApi* | [**listFuturesOrderBook**](docs/FuturesApi.md#listFuturesOrderBook) | **GET** /futures/{settle}/order_book | Query futures market depth information
+*FuturesApi* | [**listFuturesTrades**](docs/FuturesApi.md#listFuturesTrades) | **GET** /futures/{settle}/trades | Futures market transaction records
+*FuturesApi* | [**listFuturesCandlesticks**](docs/FuturesApi.md#listFuturesCandlesticks) | **GET** /futures/{settle}/candlesticks | Futures market K-line chart
+*FuturesApi* | [**listFuturesPremiumIndex**](docs/FuturesApi.md#listFuturesPremiumIndex) | **GET** /futures/{settle}/premium_index | Premium Index K-line chart
+*FuturesApi* | [**listFuturesTickers**](docs/FuturesApi.md#listFuturesTickers) | **GET** /futures/{settle}/tickers | Get all futures trading statistics
+*FuturesApi* | [**listFuturesFundingRateHistory**](docs/FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Futures market historical funding rate
+*FuturesApi* | [**listFuturesInsuranceLedger**](docs/FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures market insurance fund history
+*FuturesApi* | [**listContractStats**](docs/FuturesApi.md#listContractStats) | **GET** /futures/{settle}/contract_stats | Futures statistics
+*FuturesApi* | [**getIndexConstituents**](docs/FuturesApi.md#getIndexConstituents) | **GET** /futures/{settle}/index_constituents/{index} | Query index constituents
+*FuturesApi* | [**listLiquidatedOrders**](docs/FuturesApi.md#listLiquidatedOrders) | **GET** /futures/{settle}/liq_orders | Query liquidation order history
+*FuturesApi* | [**listFuturesRiskLimitTiers**](docs/FuturesApi.md#listFuturesRiskLimitTiers) | **GET** /futures/{settle}/risk_limit_tiers | Query risk limit tiers
+*FuturesApi* | [**listFuturesAccounts**](docs/FuturesApi.md#listFuturesAccounts) | **GET** /futures/{settle}/accounts | Get futures account
+*FuturesApi* | [**listFuturesAccountBook**](docs/FuturesApi.md#listFuturesAccountBook) | **GET** /futures/{settle}/account_book | Query futures account change history
+*FuturesApi* | [**listPositions**](docs/FuturesApi.md#listPositions) | **GET** /futures/{settle}/positions | Get user position list
+*FuturesApi* | [**getPosition**](docs/FuturesApi.md#getPosition) | **GET** /futures/{settle}/positions/{contract} | Get single position information
*FuturesApi* | [**updatePositionMargin**](docs/FuturesApi.md#updatePositionMargin) | **POST** /futures/{settle}/positions/{contract}/margin | Update position margin
*FuturesApi* | [**updatePositionLeverage**](docs/FuturesApi.md#updatePositionLeverage) | **POST** /futures/{settle}/positions/{contract}/leverage | Update position leverage
+*FuturesApi* | [**updatePositionCrossMode**](docs/FuturesApi.md#updatePositionCrossMode) | **POST** /futures/{settle}/positions/cross_mode | Switch Position Margin Mode
+*FuturesApi* | [**updateDualCompPositionCrossMode**](docs/FuturesApi.md#updateDualCompPositionCrossMode) | **POST** /futures/{settle}/dual_comp/positions/cross_mode | Switch Between Cross and Isolated Margin Modes Under Hedge Mode
*FuturesApi* | [**updatePositionRiskLimit**](docs/FuturesApi.md#updatePositionRiskLimit) | **POST** /futures/{settle}/positions/{contract}/risk_limit | Update position risk limit
-*FuturesApi* | [**setDualMode**](docs/FuturesApi.md#setDualMode) | **POST** /futures/{settle}/dual_mode | Enable or disable dual mode
-*FuturesApi* | [**getDualModePosition**](docs/FuturesApi.md#getDualModePosition) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Retrieve position detail in dual mode
+*FuturesApi* | [**setDualMode**](docs/FuturesApi.md#setDualMode) | **POST** /futures/{settle}/dual_mode | Set position mode
+*FuturesApi* | [**getDualModePosition**](docs/FuturesApi.md#getDualModePosition) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Get position information in dual mode
*FuturesApi* | [**updateDualModePositionMargin**](docs/FuturesApi.md#updateDualModePositionMargin) | **POST** /futures/{settle}/dual_comp/positions/{contract}/margin | Update position margin in dual mode
*FuturesApi* | [**updateDualModePositionLeverage**](docs/FuturesApi.md#updateDualModePositionLeverage) | **POST** /futures/{settle}/dual_comp/positions/{contract}/leverage | Update position leverage in dual mode
*FuturesApi* | [**updateDualModePositionRiskLimit**](docs/FuturesApi.md#updateDualModePositionRiskLimit) | **POST** /futures/{settle}/dual_comp/positions/{contract}/risk_limit | Update position risk limit in dual mode
-*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* | [**getFuturesOrder**](docs/FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single 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* | [**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* | [**cancelPriceTriggeredOrder**](docs/FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single 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
-*MarginApi* | [**listFundingBook**](docs/MarginApi.md#listFundingBook) | **GET** /margin/funding_book | Order book of lending loans
+*FuturesApi* | [**listFuturesOrders**](docs/FuturesApi.md#listFuturesOrders) | **GET** /futures/{settle}/orders | Query futures order list
+*FuturesApi* | [**createFuturesOrder**](docs/FuturesApi.md#createFuturesOrder) | **POST** /futures/{settle}/orders | Place futures order
+*FuturesApi* | [**cancelFuturesOrders**](docs/FuturesApi.md#cancelFuturesOrders) | **DELETE** /futures/{settle}/orders | Cancel all orders with 'open' status
+*FuturesApi* | [**getOrdersWithTimeRange**](docs/FuturesApi.md#getOrdersWithTimeRange) | **GET** /futures/{settle}/orders_timerange | Query futures order list by time range
+*FuturesApi* | [**createBatchFuturesOrder**](docs/FuturesApi.md#createBatchFuturesOrder) | **POST** /futures/{settle}/batch_orders | Place batch futures orders
+*FuturesApi* | [**getFuturesOrder**](docs/FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Query single order details
+*FuturesApi* | [**amendFuturesOrder**](docs/FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend single order
+*FuturesApi* | [**cancelFuturesOrder**](docs/FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel single order
+*FuturesApi* | [**getMyTrades**](docs/FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | Query personal trading records
+*FuturesApi* | [**getMyTradesWithTimeRange**](docs/FuturesApi.md#getMyTradesWithTimeRange) | **GET** /futures/{settle}/my_trades_timerange | Query personal trading records by time range
+*FuturesApi* | [**listPositionClose**](docs/FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | Query position close history
+*FuturesApi* | [**listLiquidates**](docs/FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | Query liquidation history
+*FuturesApi* | [**listAutoDeleverages**](docs/FuturesApi.md#listAutoDeleverages) | **GET** /futures/{settle}/auto_deleverages | Query ADL auto-deleveraging order information
+*FuturesApi* | [**countdownCancelAllFutures**](docs/FuturesApi.md#countdownCancelAllFutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders
+*FuturesApi* | [**getFuturesFee**](docs/FuturesApi.md#getFuturesFee) | **GET** /futures/{settle}/fee | Query futures market trading fee rates
+*FuturesApi* | [**cancelBatchFutureOrders**](docs/FuturesApi.md#cancelBatchFutureOrders) | **POST** /futures/{settle}/batch_cancel_orders | Cancel batch orders by specified ID list
+*FuturesApi* | [**amendBatchFutureOrders**](docs/FuturesApi.md#amendBatchFutureOrders) | **POST** /futures/{settle}/batch_amend_orders | Batch modify orders by specified IDs
+*FuturesApi* | [**getFuturesRiskLimitTable**](docs/FuturesApi.md#getFuturesRiskLimitTable) | **GET** /futures/{settle}/risk_limit_table | Query risk limit table by table_id
+*FuturesApi* | [**listPriceTriggeredOrders**](docs/FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/{settle}/price_orders | Query auto order list
+*FuturesApi* | [**createPriceTriggeredOrder**](docs/FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/{settle}/price_orders | Create price-triggered order
+*FuturesApi* | [**cancelPriceTriggeredOrderList**](docs/FuturesApi.md#cancelPriceTriggeredOrderList) | **DELETE** /futures/{settle}/price_orders | Cancel all auto orders
+*FuturesApi* | [**getPriceTriggeredOrder**](docs/FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Query single auto order details
+*FuturesApi* | [**cancelPriceTriggeredOrder**](docs/FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel single auto order
*MarginApi* | [**listMarginAccounts**](docs/MarginApi.md#listMarginAccounts) | **GET** /margin/accounts | Margin account list
-*MarginApi* | [**listMarginAccountBook**](docs/MarginApi.md#listMarginAccountBook) | **GET** /margin/account_book | List margin account balance change history
+*MarginApi* | [**listMarginAccountBook**](docs/MarginApi.md#listMarginAccountBook) | **GET** /margin/account_book | Query margin account balance change history
*MarginApi* | [**listFundingAccounts**](docs/MarginApi.md#listFundingAccounts) | **GET** /margin/funding_accounts | Funding account list
-*MarginApi* | [**listLoans**](docs/MarginApi.md#listLoans) | **GET** /margin/loans | List all loans
-*MarginApi* | [**createLoan**](docs/MarginApi.md#createLoan) | **POST** /margin/loans | Lend or borrow
-*MarginApi* | [**mergeLoans**](docs/MarginApi.md#mergeLoans) | **POST** /margin/merged_loans | Merge multiple lending loans
-*MarginApi* | [**getLoan**](docs/MarginApi.md#getLoan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail
-*MarginApi* | [**cancelLoan**](docs/MarginApi.md#cancelLoan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan
-*MarginApi* | [**updateLoan**](docs/MarginApi.md#updateLoan) | **PATCH** /margin/loans/{loan_id} | Modify a loan
-*MarginApi* | [**listLoanRepayments**](docs/MarginApi.md#listLoanRepayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records
-*MarginApi* | [**repayLoan**](docs/MarginApi.md#repayLoan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan
-*MarginApi* | [**listLoanRecords**](docs/MarginApi.md#listLoanRecords) | **GET** /margin/loan_records | List repayment records of a specific loan
-*MarginApi* | [**getLoanRecord**](docs/MarginApi.md#getLoanRecord) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record
-*MarginApi* | [**updateLoanRecord**](docs/MarginApi.md#updateLoanRecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record
-*MarginApi* | [**getAutoRepayStatus**](docs/MarginApi.md#getAutoRepayStatus) | **GET** /margin/auto_repay | Retrieve user auto repayment setting
-*MarginApi* | [**setAutoRepay**](docs/MarginApi.md#setAutoRepay) | **POST** /margin/auto_repay | Update user's auto repayment setting
-*MarginApi* | [**getMarginTransferable**](docs/MarginApi.md#getMarginTransferable) | **GET** /margin/transferable | Get the max transferable amount for a specific margin currency
-*MarginApi* | [**getMarginBorrowable**](docs/MarginApi.md#getMarginBorrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency
-*MarginApi* | [**listCrossMarginCurrencies**](docs/MarginApi.md#listCrossMarginCurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin.
-*MarginApi* | [**getCrossMarginCurrency**](docs/MarginApi.md#getCrossMarginCurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin
-*MarginApi* | [**getCrossMarginAccount**](docs/MarginApi.md#getCrossMarginAccount) | **GET** /margin/cross/accounts | Retrieve cross margin account
-*MarginApi* | [**listCrossMarginAccountBook**](docs/MarginApi.md#listCrossMarginAccountBook) | **GET** /margin/cross/account_book | Retrieve cross margin account change history
-*MarginApi* | [**listCrossMarginLoans**](docs/MarginApi.md#listCrossMarginLoans) | **GET** /margin/cross/loans | List cross margin borrow history
-*MarginApi* | [**createCrossMarginLoan**](docs/MarginApi.md#createCrossMarginLoan) | **POST** /margin/cross/loans | Create a cross margin borrow loan
-*MarginApi* | [**getCrossMarginLoan**](docs/MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail
-*MarginApi* | [**listCrossMarginRepayments**](docs/MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments
-*MarginApi* | [**repayCrossMarginLoan**](docs/MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Repay cross margin loan
-*MarginApi* | [**getCrossMarginTransferable**](docs/MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency
-*MarginApi* | [**getCrossMarginBorrowable**](docs/MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency
-*SpotApi* | [**listCurrencies**](docs/SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies' details
-*SpotApi* | [**getCurrency**](docs/SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency
-*SpotApi* | [**listCurrencyPairs**](docs/SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported
-*SpotApi* | [**getCurrencyPair**](docs/SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order
-*SpotApi* | [**listTickers**](docs/SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information
-*SpotApi* | [**listOrderBook**](docs/SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book
-*SpotApi* | [**listTrades**](docs/SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades
-*SpotApi* | [**listCandlesticks**](docs/SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks
-*SpotApi* | [**getFee**](docs/SpotApi.md#getFee) | **GET** /spot/fee | Query user trading fee rates
-*SpotApi* | [**listSpotAccounts**](docs/SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts
-*SpotApi* | [**createBatchOrders**](docs/SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Create a batch of orders
+*MarginApi* | [**getAutoRepayStatus**](docs/MarginApi.md#getAutoRepayStatus) | **GET** /margin/auto_repay | Query user auto repayment settings
+*MarginApi* | [**setAutoRepay**](docs/MarginApi.md#setAutoRepay) | **POST** /margin/auto_repay | Update user auto repayment settings
+*MarginApi* | [**getMarginTransferable**](docs/MarginApi.md#getMarginTransferable) | **GET** /margin/transferable | Get maximum transferable amount for isolated margin
+*MarginApi* | [**getUserMarginTier**](docs/MarginApi.md#getUserMarginTier) | **GET** /margin/user/loan_margin_tiers | Query user's own leverage lending tiers in current market
+*MarginApi* | [**getMarketMarginTier**](docs/MarginApi.md#getMarketMarginTier) | **GET** /margin/loan_margin_tiers | Query current market leverage lending tiers
+*MarginApi* | [**setUserMarketLeverage**](docs/MarginApi.md#setUserMarketLeverage) | **POST** /margin/leverage/user_market_setting | Set user market leverage multiplier
+*MarginApi* | [**listMarginUserAccount**](docs/MarginApi.md#listMarginUserAccount) | **GET** /margin/user/account | Query user's isolated margin account list
+*MarginApi* | [**listCrossMarginLoans**](docs/MarginApi.md#listCrossMarginLoans) | **GET** /margin/cross/loans | Query cross margin borrow history (deprecated)
+*MarginApi* | [**listCrossMarginRepayments**](docs/MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments. (deprecated)
+*MarginUniApi* | [**listUniCurrencyPairs**](docs/MarginUniApi.md#listUniCurrencyPairs) | **GET** /margin/uni/currency_pairs | List lending markets
+*MarginUniApi* | [**getUniCurrencyPair**](docs/MarginUniApi.md#getUniCurrencyPair) | **GET** /margin/uni/currency_pairs/{currency_pair} | Get lending market details
+*MarginUniApi* | [**getMarginUniEstimateRate**](docs/MarginUniApi.md#getMarginUniEstimateRate) | **GET** /margin/uni/estimate_rate | Estimate interest rate for isolated margin currencies
+*MarginUniApi* | [**listUniLoans**](docs/MarginUniApi.md#listUniLoans) | **GET** /margin/uni/loans | Query loans
+*MarginUniApi* | [**createUniLoan**](docs/MarginUniApi.md#createUniLoan) | **POST** /margin/uni/loans | Borrow or repay
+*MarginUniApi* | [**listUniLoanRecords**](docs/MarginUniApi.md#listUniLoanRecords) | **GET** /margin/uni/loan_records | Query loan records
+*MarginUniApi* | [**listUniLoanInterestRecords**](docs/MarginUniApi.md#listUniLoanInterestRecords) | **GET** /margin/uni/interest_records | Query interest deduction records
+*MarginUniApi* | [**getUniBorrowable**](docs/MarginUniApi.md#getUniBorrowable) | **GET** /margin/uni/borrowable | Query maximum borrowable amount by currency
+*MultiCollateralLoanApi* | [**listMultiCollateralOrders**](docs/MultiCollateralLoanApi.md#listMultiCollateralOrders) | **GET** /loan/multi_collateral/orders | Query multi-currency collateral order list
+*MultiCollateralLoanApi* | [**createMultiCollateral**](docs/MultiCollateralLoanApi.md#createMultiCollateral) | **POST** /loan/multi_collateral/orders | Place multi-currency collateral order
+*MultiCollateralLoanApi* | [**getMultiCollateralOrderDetail**](docs/MultiCollateralLoanApi.md#getMultiCollateralOrderDetail) | **GET** /loan/multi_collateral/orders/{order_id} | Query order details
+*MultiCollateralLoanApi* | [**listMultiRepayRecords**](docs/MultiCollateralLoanApi.md#listMultiRepayRecords) | **GET** /loan/multi_collateral/repay | Query multi-currency collateral repayment records
+*MultiCollateralLoanApi* | [**repayMultiCollateralLoan**](docs/MultiCollateralLoanApi.md#repayMultiCollateralLoan) | **POST** /loan/multi_collateral/repay | Multi-currency collateral repayment
+*MultiCollateralLoanApi* | [**listMultiCollateralRecords**](docs/MultiCollateralLoanApi.md#listMultiCollateralRecords) | **GET** /loan/multi_collateral/mortgage | Query collateral adjustment records
+*MultiCollateralLoanApi* | [**operateMultiCollateral**](docs/MultiCollateralLoanApi.md#operateMultiCollateral) | **POST** /loan/multi_collateral/mortgage | Add or withdraw collateral
+*MultiCollateralLoanApi* | [**listUserCurrencyQuota**](docs/MultiCollateralLoanApi.md#listUserCurrencyQuota) | **GET** /loan/multi_collateral/currency_quota | Query user's collateral and borrowing currency quota information
+*MultiCollateralLoanApi* | [**listMultiCollateralCurrencies**](docs/MultiCollateralLoanApi.md#listMultiCollateralCurrencies) | **GET** /loan/multi_collateral/currencies | Query supported borrowing and collateral currencies for multi-currency collateral
+*MultiCollateralLoanApi* | [**getMultiCollateralLtv**](docs/MultiCollateralLoanApi.md#getMultiCollateralLtv) | **GET** /loan/multi_collateral/ltv | Query collateralization ratio information
+*MultiCollateralLoanApi* | [**getMultiCollateralFixRate**](docs/MultiCollateralLoanApi.md#getMultiCollateralFixRate) | **GET** /loan/multi_collateral/fixed_rate | Query currency's 7-day and 30-day fixed interest rates
+*MultiCollateralLoanApi* | [**getMultiCollateralCurrentRate**](docs/MultiCollateralLoanApi.md#getMultiCollateralCurrentRate) | **GET** /loan/multi_collateral/current_rate | Query currency's current interest rate
+*OptionsApi* | [**listOptionsUnderlyings**](docs/OptionsApi.md#listOptionsUnderlyings) | **GET** /options/underlyings | List all underlying assets
+*OptionsApi* | [**listOptionsExpirations**](docs/OptionsApi.md#listOptionsExpirations) | **GET** /options/expirations | List all expiration dates
+*OptionsApi* | [**listOptionsContracts**](docs/OptionsApi.md#listOptionsContracts) | **GET** /options/contracts | List all contracts for specified underlying and expiration date
+*OptionsApi* | [**getOptionsContract**](docs/OptionsApi.md#getOptionsContract) | **GET** /options/contracts/{contract} | Query specified contract details
+*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 settlement information
+*OptionsApi* | [**listMyOptionsSettlements**](docs/OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | Query personal settlement records
+*OptionsApi* | [**listOptionsOrderBook**](docs/OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Query options contract order book
+*OptionsApi* | [**listOptionsTickers**](docs/OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | Query options market ticker information
+*OptionsApi* | [**listOptionsUnderlyingTickers**](docs/OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Query underlying ticker information
+*OptionsApi* | [**listOptionsCandlesticks**](docs/OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Options contract market candlestick chart
+*OptionsApi* | [**listOptionsUnderlyingCandlesticks**](docs/OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Underlying index price candlestick chart
+*OptionsApi* | [**listOptionsTrades**](docs/OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Market trade records
+*OptionsApi* | [**listOptionsAccount**](docs/OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | Query account information
+*OptionsApi* | [**listOptionsAccountBook**](docs/OptionsApi.md#listOptionsAccountBook) | **GET** /options/account_book | Query account change history
+*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 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 orders with 'open' status
+*OptionsApi* | [**getOptionsOrder**](docs/OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Query single order details
+*OptionsApi* | [**cancelOptionsOrder**](docs/OptionsApi.md#cancelOptionsOrder) | **DELETE** /options/orders/{order_id} | Cancel single order
+*OptionsApi* | [**countdownCancelAllOptions**](docs/OptionsApi.md#countdownCancelAllOptions) | **POST** /options/countdown_cancel_all | Countdown cancel orders
+*OptionsApi* | [**listMyOptionsTrades**](docs/OptionsApi.md#listMyOptionsTrades) | **GET** /options/my_trades | Query personal trading records
+*OptionsApi* | [**getOptionsMMP**](docs/OptionsApi.md#getOptionsMMP) | **GET** /options/mmp | MMP Query.
+*OptionsApi* | [**setOptionsMMP**](docs/OptionsApi.md#setOptionsMMP) | **POST** /options/mmp | MMP Settings
+*OptionsApi* | [**resetOptionsMMP**](docs/OptionsApi.md#resetOptionsMMP) | **POST** /options/mmp/reset | MMP Reset
+*RebateApi* | [**agencyTransactionHistory**](docs/RebateApi.md#agencyTransactionHistory) | **GET** /rebate/agency/transaction_history | Broker obtains transaction history of recommended users
+*RebateApi* | [**agencyCommissionsHistory**](docs/RebateApi.md#agencyCommissionsHistory) | **GET** /rebate/agency/commission_history | Broker obtains rebate history of recommended users
+*RebateApi* | [**partnerTransactionHistory**](docs/RebateApi.md#partnerTransactionHistory) | **GET** /rebate/partner/transaction_history | Partner obtains transaction history of recommended users
+*RebateApi* | [**partnerCommissionsHistory**](docs/RebateApi.md#partnerCommissionsHistory) | **GET** /rebate/partner/commission_history | Partner obtains rebate records of recommended users
+*RebateApi* | [**partnerSubList**](docs/RebateApi.md#partnerSubList) | **GET** /rebate/partner/sub_list | Partner subordinate list
+*RebateApi* | [**rebateBrokerCommissionHistory**](docs/RebateApi.md#rebateBrokerCommissionHistory) | **GET** /rebate/broker/commission_history | Broker obtains user's rebate records
+*RebateApi* | [**rebateBrokerTransactionHistory**](docs/RebateApi.md#rebateBrokerTransactionHistory) | **GET** /rebate/broker/transaction_history | Broker obtains user's trading history
+*RebateApi* | [**rebateUserInfo**](docs/RebateApi.md#rebateUserInfo) | **GET** /rebate/user/info | User obtains rebate information
+*RebateApi* | [**userSubRelation**](docs/RebateApi.md#userSubRelation) | **GET** /rebate/user/sub_relation | User subordinate relationship
+*SpotApi* | [**listCurrencies**](docs/SpotApi.md#listCurrencies) | **GET** /spot/currencies | Query all currency information
+*SpotApi* | [**getCurrency**](docs/SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Query single currency information
+*SpotApi* | [**listCurrencyPairs**](docs/SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | Query all supported currency pairs
+*SpotApi* | [**getCurrencyPair**](docs/SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Query single currency pair details
+*SpotApi* | [**listTickers**](docs/SpotApi.md#listTickers) | **GET** /spot/tickers | Get currency pair ticker information
+*SpotApi* | [**listOrderBook**](docs/SpotApi.md#listOrderBook) | **GET** /spot/order_book | Get market depth information
+*SpotApi* | [**listTrades**](docs/SpotApi.md#listTrades) | **GET** /spot/trades | Query market transaction records
+*SpotApi* | [**listCandlesticks**](docs/SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market K-line chart
+*SpotApi* | [**getFee**](docs/SpotApi.md#getFee) | **GET** /spot/fee | Query account fee rates
+*SpotApi* | [**getBatchSpotFee**](docs/SpotApi.md#getBatchSpotFee) | **GET** /spot/batch_fee | Batch query account fee rates
+*SpotApi* | [**listSpotAccounts**](docs/SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot trading accounts
+*SpotApi* | [**listSpotAccountBook**](docs/SpotApi.md#listSpotAccountBook) | **GET** /spot/account_book | Query spot account transaction history
+*SpotApi* | [**createBatchOrders**](docs/SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Batch place orders
*SpotApi* | [**listAllOpenOrders**](docs/SpotApi.md#listAllOpenOrders) | **GET** /spot/open_orders | List all open orders
+*SpotApi* | [**createCrossLiquidateOrder**](docs/SpotApi.md#createCrossLiquidateOrder) | **POST** /spot/cross_liquidate_orders | Close position when cross-currency is disabled
*SpotApi* | [**listOrders**](docs/SpotApi.md#listOrders) | **GET** /spot/orders | List orders
*SpotApi* | [**createOrder**](docs/SpotApi.md#createOrder) | **POST** /spot/orders | Create an order
*SpotApi* | [**cancelOrders**](docs/SpotApi.md#cancelOrders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair
-*SpotApi* | [**cancelBatchOrders**](docs/SpotApi.md#cancelBatchOrders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list
-*SpotApi* | [**getOrder**](docs/SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Get a single order
-*SpotApi* | [**cancelOrder**](docs/SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order
-*SpotApi* | [**listMyTrades**](docs/SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history
-*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* | [**cancelSpotPriceTriggeredOrder**](docs/SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order
+*SpotApi* | [**cancelBatchOrders**](docs/SpotApi.md#cancelBatchOrders) | **POST** /spot/cancel_batch_orders | Cancel batch orders by specified ID list
+*SpotApi* | [**getOrder**](docs/SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Query single order details
+*SpotApi* | [**cancelOrder**](docs/SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel single order
+*SpotApi* | [**amendOrder**](docs/SpotApi.md#amendOrder) | **PATCH** /spot/orders/{order_id} | Amend single order
+*SpotApi* | [**listMyTrades**](docs/SpotApi.md#listMyTrades) | **GET** /spot/my_trades | Query personal trading records
+*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* | [**amendBatchOrders**](docs/SpotApi.md#amendBatchOrders) | **POST** /spot/amend_batch_orders | Batch modification of orders
+*SpotApi* | [**getSpotInsuranceHistory**](docs/SpotApi.md#getSpotInsuranceHistory) | **GET** /spot/insurance_history | Query spot insurance fund historical data
+*SpotApi* | [**listSpotPriceTriggeredOrders**](docs/SpotApi.md#listSpotPriceTriggeredOrders) | **GET** /spot/price_orders | Query running auto order list
+*SpotApi* | [**createSpotPriceTriggeredOrder**](docs/SpotApi.md#createSpotPriceTriggeredOrder) | **POST** /spot/price_orders | Create price-triggered order
+*SpotApi* | [**cancelSpotPriceTriggeredOrderList**](docs/SpotApi.md#cancelSpotPriceTriggeredOrderList) | **DELETE** /spot/price_orders | Cancel all auto orders
+*SpotApi* | [**getSpotPriceTriggeredOrder**](docs/SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Query single auto order details
+*SpotApi* | [**cancelSpotPriceTriggeredOrder**](docs/SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | Cancel single auto 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 sub-account
+*SubAccountApi* | [**listSubAccountKeys**](docs/SubAccountApi.md#listSubAccountKeys) | **GET** /sub_accounts/{user_id}/keys | List all API key pairs of the sub-account
+*SubAccountApi* | [**createSubAccountKeys**](docs/SubAccountApi.md#createSubAccountKeys) | **POST** /sub_accounts/{user_id}/keys | Create new sub-account API key pair
+*SubAccountApi* | [**getSubAccountKey**](docs/SubAccountApi.md#getSubAccountKey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get specific API key pair of the sub-account
+*SubAccountApi* | [**updateSubAccountKeys**](docs/SubAccountApi.md#updateSubAccountKeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update sub-account API key pair
+*SubAccountApi* | [**deleteSubAccountKeys**](docs/SubAccountApi.md#deleteSubAccountKeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete sub-account API key pair
+*SubAccountApi* | [**lockSubAccount**](docs/SubAccountApi.md#lockSubAccount) | **POST** /sub_accounts/{user_id}/lock | Lock sub-account
+*SubAccountApi* | [**unlockSubAccount**](docs/SubAccountApi.md#unlockSubAccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock sub-account
+*SubAccountApi* | [**listUnifiedMode**](docs/SubAccountApi.md#listUnifiedMode) | **GET** /sub_accounts/unified_mode | Get sub-account mode
+*UnifiedApi* | [**listUnifiedAccounts**](docs/UnifiedApi.md#listUnifiedAccounts) | **GET** /unified/accounts | Get unified account information
+*UnifiedApi* | [**getUnifiedBorrowable**](docs/UnifiedApi.md#getUnifiedBorrowable) | **GET** /unified/borrowable | Query maximum borrowable amount for unified account
+*UnifiedApi* | [**getUnifiedTransferable**](docs/UnifiedApi.md#getUnifiedTransferable) | **GET** /unified/transferable | Query maximum transferable amount for unified account
+*UnifiedApi* | [**getUnifiedTransferables**](docs/UnifiedApi.md#getUnifiedTransferables) | **GET** /unified/transferables | Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
+*UnifiedApi* | [**getUnifiedBorrowableList**](docs/UnifiedApi.md#getUnifiedBorrowableList) | **GET** /unified/batch_borrowable | Batch query unified account maximum borrowable amount
+*UnifiedApi* | [**listUnifiedLoans**](docs/UnifiedApi.md#listUnifiedLoans) | **GET** /unified/loans | Query loans
+*UnifiedApi* | [**createUnifiedLoan**](docs/UnifiedApi.md#createUnifiedLoan) | **POST** /unified/loans | Borrow or repay
+*UnifiedApi* | [**listUnifiedLoanRecords**](docs/UnifiedApi.md#listUnifiedLoanRecords) | **GET** /unified/loan_records | Query loan records
+*UnifiedApi* | [**listUnifiedLoanInterestRecords**](docs/UnifiedApi.md#listUnifiedLoanInterestRecords) | **GET** /unified/interest_records | Query interest deduction records
+*UnifiedApi* | [**getUnifiedRiskUnits**](docs/UnifiedApi.md#getUnifiedRiskUnits) | **GET** /unified/risk_units | Get user risk unit details
+*UnifiedApi* | [**getUnifiedMode**](docs/UnifiedApi.md#getUnifiedMode) | **GET** /unified/unified_mode | Query mode of the unified account
+*UnifiedApi* | [**setUnifiedMode**](docs/UnifiedApi.md#setUnifiedMode) | **PUT** /unified/unified_mode | Set unified account mode
+*UnifiedApi* | [**getUnifiedEstimateRate**](docs/UnifiedApi.md#getUnifiedEstimateRate) | **GET** /unified/estimate_rate | Query unified account estimated interest rate
+*UnifiedApi* | [**listCurrencyDiscountTiers**](docs/UnifiedApi.md#listCurrencyDiscountTiers) | **GET** /unified/currency_discount_tiers | Query unified account tiered
+*UnifiedApi* | [**listLoanMarginTiers**](docs/UnifiedApi.md#listLoanMarginTiers) | **GET** /unified/loan_margin_tiers | Query unified account tiered loan margin
+*UnifiedApi* | [**calculatePortfolioMargin**](docs/UnifiedApi.md#calculatePortfolioMargin) | **POST** /unified/portfolio_calculator | Portfolio margin calculator
+*UnifiedApi* | [**getUserLeverageCurrencyConfig**](docs/UnifiedApi.md#getUserLeverageCurrencyConfig) | **GET** /unified/leverage/user_currency_config | Maximum and minimum currency leverage that can be set
+*UnifiedApi* | [**getUserLeverageCurrencySetting**](docs/UnifiedApi.md#getUserLeverageCurrencySetting) | **GET** /unified/leverage/user_currency_setting | Get user currency leverage
+*UnifiedApi* | [**setUserLeverageCurrencySetting**](docs/UnifiedApi.md#setUserLeverageCurrencySetting) | **POST** /unified/leverage/user_currency_setting | Set loan currency leverage
+*UnifiedApi* | [**listUnifiedCurrencies**](docs/UnifiedApi.md#listUnifiedCurrencies) | **GET** /unified/currencies | List of loan currencies supported by unified account
+*UnifiedApi* | [**getHistoryLoanRate**](docs/UnifiedApi.md#getHistoryLoanRate) | **GET** /unified/history_loan_rate | Get historical lending rates
+*UnifiedApi* | [**setUnifiedCollateral**](docs/UnifiedApi.md#setUnifiedCollateral) | **POST** /unified/collateral_currencies | Set collateral currency
+*WalletApi* | [**listCurrencyChains**](docs/WalletApi.md#listCurrencyChains) | **GET** /wallet/currency_chains | Query 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
-*WalletApi* | [**listDeposits**](docs/WalletApi.md#listDeposits) | **GET** /wallet/deposits | Retrieve deposit records
+*WalletApi* | [**listWithdrawals**](docs/WalletApi.md#listWithdrawals) | **GET** /wallet/withdrawals | Get withdrawal records
+*WalletApi* | [**listDeposits**](docs/WalletApi.md#listDeposits) | **GET** /wallet/deposits | Get deposit records
*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* | [**listSubAccountTransfers**](docs/WalletApi.md#listSubAccountTransfers) | **GET** /wallet/sub_account_transfers | Get 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* | [**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* | [**getTradeFee**](docs/WalletApi.md#getTradeFee) | **GET** /wallet/fee | Retrieve personal trading fee
-*WalletApi* | [**getTotalBalance**](docs/WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Retrieve user's total balances
+*WalletApi* | [**subAccountToSubAccount**](docs/WalletApi.md#subAccountToSubAccount) | **POST** /wallet/sub_account_to_sub_account | Transfer between sub-accounts
+*WalletApi* | [**getTransferOrderStatus**](docs/WalletApi.md#getTransferOrderStatus) | **GET** /wallet/order_status | Transfer status query
+*WalletApi* | [**listWithdrawStatus**](docs/WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Query withdrawal status
+*WalletApi* | [**listSubAccountBalances**](docs/WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Query sub-account balance information
+*WalletApi* | [**listSubAccountMarginBalances**](docs/WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub-account isolated margin account balance information
+*WalletApi* | [**listSubAccountFuturesBalances**](docs/WalletApi.md#listSubAccountFuturesBalances) | **GET** /wallet/sub_account_futures_balances | Query sub-account perpetual futures account balance information
+*WalletApi* | [**listSubAccountCrossMarginBalances**](docs/WalletApi.md#listSubAccountCrossMarginBalances) | **GET** /wallet/sub_account_cross_margin_balances | Query sub-account cross margin account balance information
+*WalletApi* | [**listSavedAddress**](docs/WalletApi.md#listSavedAddress) | **GET** /wallet/saved_address | Query withdrawal address whitelist
+*WalletApi* | [**getTradeFee**](docs/WalletApi.md#getTradeFee) | **GET** /wallet/fee | Query personal trading fees
+*WalletApi* | [**getTotalBalance**](docs/WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Query personal account totals
+*WalletApi* | [**listSmallBalance**](docs/WalletApi.md#listSmallBalance) | **GET** /wallet/small_balance | Get list of convertible small balance currencies
+*WalletApi* | [**convertSmallBalance**](docs/WalletApi.md#convertSmallBalance) | **POST** /wallet/small_balance | Convert small balance currency
+*WalletApi* | [**listSmallBalanceHistory**](docs/WalletApi.md#listSmallBalanceHistory) | **GET** /wallet/small_balance_history | Get convertible small balance currency history
+*WalletApi* | [**listPushOrders**](docs/WalletApi.md#listPushOrders) | **GET** /wallet/push | Get UID transfer history
*WithdrawalApi* | [**withdraw**](docs/WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw
+*WithdrawalApi* | [**withdrawPushOrder**](docs/WithdrawalApi.md#withdrawPushOrder) | **POST** /withdrawals/push | UID transfer
*WithdrawalApi* | [**cancelWithdrawal**](docs/WithdrawalApi.md#cancelWithdrawal) | **DELETE** /withdrawals/{withdrawal_id} | Cancel withdrawal with specified ID
## Documentation for Models
- [AccountBalance](docs/AccountBalance.md)
+ - [AccountDetail](docs/AccountDetail.md)
+ - [AccountDetailKey](docs/AccountDetailKey.md)
+ - [AccountRateLimit](docs/AccountRateLimit.md)
+ - [AgencyCommission](docs/AgencyCommission.md)
+ - [AgencyCommissionHistory](docs/AgencyCommissionHistory.md)
+ - [AgencyTransaction](docs/AgencyTransaction.md)
+ - [AgencyTransactionHistory](docs/AgencyTransactionHistory.md)
- [AutoRepaySetting](docs/AutoRepaySetting.md)
+ - [BatchAmendItem](docs/BatchAmendItem.md)
+ - [BatchAmendOrderReq](docs/BatchAmendOrderReq.md)
+ - [BatchFuturesOrder](docs/BatchFuturesOrder.md)
- [BatchOrder](docs/BatchOrder.md)
- - [CancelOrder](docs/CancelOrder.md)
+ - [BorrowCurrencyInfo](docs/BorrowCurrencyInfo.md)
+ - [BrokerCommission](docs/BrokerCommission.md)
+ - [BrokerCommission1](docs/BrokerCommission1.md)
+ - [BrokerCommissionSubBrokerInfo](docs/BrokerCommissionSubBrokerInfo.md)
+ - [BrokerTransaction](docs/BrokerTransaction.md)
+ - [BrokerTransaction1](docs/BrokerTransaction1.md)
+ - [CancelBatchOrder](docs/CancelBatchOrder.md)
- [CancelOrderResult](docs/CancelOrderResult.md)
+ - [CollateralAdjust](docs/CollateralAdjust.md)
+ - [CollateralAdjustRes](docs/CollateralAdjustRes.md)
+ - [CollateralAlign](docs/CollateralAlign.md)
+ - [CollateralCurrency](docs/CollateralCurrency.md)
+ - [CollateralCurrencyInfo](docs/CollateralCurrencyInfo.md)
+ - [CollateralCurrencyRes](docs/CollateralCurrencyRes.md)
+ - [CollateralCurrentRate](docs/CollateralCurrentRate.md)
+ - [CollateralFixRate](docs/CollateralFixRate.md)
+ - [CollateralLoanCurrency](docs/CollateralLoanCurrency.md)
+ - [CollateralLtv](docs/CollateralLtv.md)
+ - [CollateralOrder](docs/CollateralOrder.md)
+ - [CollateralRecord](docs/CollateralRecord.md)
- [Contract](docs/Contract.md)
- [ContractStat](docs/ContractStat.md)
- - [CrossMarginAccount](docs/CrossMarginAccount.md)
- - [CrossMarginAccountBook](docs/CrossMarginAccountBook.md)
+ - [ConvertSmallBalance](docs/ConvertSmallBalance.md)
+ - [CountdownCancelAllFuturesTask](docs/CountdownCancelAllFuturesTask.md)
+ - [CountdownCancelAllOptionsTask](docs/CountdownCancelAllOptionsTask.md)
+ - [CountdownCancelAllSpotTask](docs/CountdownCancelAllSpotTask.md)
+ - [CreateCollateralOrder](docs/CreateCollateralOrder.md)
+ - [CreateMultiCollateralOrder](docs/CreateMultiCollateralOrder.md)
+ - [CreateUniLend](docs/CreateUniLend.md)
+ - [CreateUniLoan](docs/CreateUniLoan.md)
- [CrossMarginBalance](docs/CrossMarginBalance.md)
- - [CrossMarginBorrowable](docs/CrossMarginBorrowable.md)
- - [CrossMarginCurrency](docs/CrossMarginCurrency.md)
- [CrossMarginLoan](docs/CrossMarginLoan.md)
- - [CrossMarginRepayRequest](docs/CrossMarginRepayRequest.md)
- [CrossMarginRepayment](docs/CrossMarginRepayment.md)
- - [CrossMarginTransferable](docs/CrossMarginTransferable.md)
- [Currency](docs/Currency.md)
+ - [CurrencyChain](docs/CurrencyChain.md)
- [CurrencyPair](docs/CurrencyPair.md)
+ - [CurrencyQuota](docs/CurrencyQuota.md)
+ - [DebitFee](docs/DebitFee.md)
+ - [DeliveryCandlestick](docs/DeliveryCandlestick.md)
- [DeliveryContract](docs/DeliveryContract.md)
- [DeliverySettlement](docs/DeliverySettlement.md)
+ - [DeliveryTicker](docs/DeliveryTicker.md)
- [DepositAddress](docs/DepositAddress.md)
+ - [DepositRecord](docs/DepositRecord.md)
+ - [DualGetOrders](docs/DualGetOrders.md)
+ - [DualGetPlans](docs/DualGetPlans.md)
+ - [Eth2RateList](docs/Eth2RateList.md)
+ - [Eth2Swap](docs/Eth2Swap.md)
+ - [FindCoin](docs/FindCoin.md)
+ - [FlashSwapCurrencyPair](docs/FlashSwapCurrencyPair.md)
+ - [FlashSwapOrder](docs/FlashSwapOrder.md)
+ - [FlashSwapOrderPreview](docs/FlashSwapOrderPreview.md)
+ - [FlashSwapOrderRequest](docs/FlashSwapOrderRequest.md)
+ - [FlashSwapPreviewRequest](docs/FlashSwapPreviewRequest.md)
- [FundingAccount](docs/FundingAccount.md)
- - [FundingBookItem](docs/FundingBookItem.md)
- [FundingRateRecord](docs/FundingRateRecord.md)
+ - [FutureCancelOrderResult](docs/FutureCancelOrderResult.md)
- [FuturesAccount](docs/FuturesAccount.md)
- [FuturesAccountBook](docs/FuturesAccountBook.md)
+ - [FuturesAccountHistory](docs/FuturesAccountHistory.md)
+ - [FuturesAutoDeleverage](docs/FuturesAutoDeleverage.md)
+ - [FuturesBatchAmendOrderRequest](docs/FuturesBatchAmendOrderRequest.md)
- [FuturesCandlestick](docs/FuturesCandlestick.md)
+ - [FuturesFee](docs/FuturesFee.md)
+ - [FuturesIndexConstituents](docs/FuturesIndexConstituents.md)
- [FuturesInitialOrder](docs/FuturesInitialOrder.md)
+ - [FuturesLimitRiskTiers](docs/FuturesLimitRiskTiers.md)
+ - [FuturesLiqOrder](docs/FuturesLiqOrder.md)
- [FuturesLiquidate](docs/FuturesLiquidate.md)
- [FuturesOrder](docs/FuturesOrder.md)
+ - [FuturesOrderAmendment](docs/FuturesOrderAmendment.md)
- [FuturesOrderBook](docs/FuturesOrderBook.md)
- [FuturesOrderBookItem](docs/FuturesOrderBookItem.md)
+ - [FuturesPositionCrossMode](docs/FuturesPositionCrossMode.md)
+ - [FuturesPremiumIndex](docs/FuturesPremiumIndex.md)
- [FuturesPriceTrigger](docs/FuturesPriceTrigger.md)
- [FuturesPriceTriggeredOrder](docs/FuturesPriceTriggeredOrder.md)
+ - [FuturesRiskLimitTier](docs/FuturesRiskLimitTier.md)
- [FuturesTicker](docs/FuturesTicker.md)
- [FuturesTrade](docs/FuturesTrade.md)
+ - [IndexConstituent](docs/IndexConstituent.md)
+ - [InlineObject](docs/InlineObject.md)
+ - [InlineResponse200](docs/InlineResponse200.md)
+ - [InlineResponse2001](docs/InlineResponse2001.md)
- [InsuranceRecord](docs/InsuranceRecord.md)
- [LedgerRecord](docs/LedgerRecord.md)
- - [Loan](docs/Loan.md)
- - [LoanPatch](docs/LoanPatch.md)
- - [LoanRecord](docs/LoanRecord.md)
+ - [LiquidateOrder](docs/LiquidateOrder.md)
- [MarginAccount](docs/MarginAccount.md)
- [MarginAccountBook](docs/MarginAccountBook.md)
- [MarginAccountCurrency](docs/MarginAccountCurrency.md)
- - [MarginBorrowable](docs/MarginBorrowable.md)
- - [MarginCurrencyPair](docs/MarginCurrencyPair.md)
+ - [MarginLeverageTier](docs/MarginLeverageTier.md)
+ - [MarginMarketLeverage](docs/MarginMarketLeverage.md)
+ - [MarginTiers](docs/MarginTiers.md)
- [MarginTransferable](docs/MarginTransferable.md)
+ - [MaxUniBorrowable](docs/MaxUniBorrowable.md)
+ - [MockFuturesOrder](docs/MockFuturesOrder.md)
+ - [MockFuturesPosition](docs/MockFuturesPosition.md)
+ - [MockMarginResult](docs/MockMarginResult.md)
+ - [MockOptionsOrder](docs/MockOptionsOrder.md)
+ - [MockOptionsPosition](docs/MockOptionsPosition.md)
+ - [MockRiskUnit](docs/MockRiskUnit.md)
+ - [MockSpotBalance](docs/MockSpotBalance.md)
+ - [MockSpotOrder](docs/MockSpotOrder.md)
- [MultiChainAddressItem](docs/MultiChainAddressItem.md)
+ - [MultiCollateralCurrency](docs/MultiCollateralCurrency.md)
+ - [MultiCollateralItem](docs/MultiCollateralItem.md)
+ - [MultiCollateralOrder](docs/MultiCollateralOrder.md)
+ - [MultiCollateralRecord](docs/MultiCollateralRecord.md)
+ - [MultiCollateralRecordCurrency](docs/MultiCollateralRecordCurrency.md)
+ - [MultiLoanItem](docs/MultiLoanItem.md)
+ - [MultiLoanRepayItem](docs/MultiLoanRepayItem.md)
+ - [MultiRepayRecord](docs/MultiRepayRecord.md)
+ - [MultiRepayResp](docs/MultiRepayResp.md)
- [MyFuturesTrade](docs/MyFuturesTrade.md)
+ - [MyFuturesTradeTimeRange](docs/MyFuturesTradeTimeRange.md)
- [OpenOrders](docs/OpenOrders.md)
+ - [OptionsAccount](docs/OptionsAccount.md)
+ - [OptionsAccountBook](docs/OptionsAccountBook.md)
+ - [OptionsCandlestick](docs/OptionsCandlestick.md)
+ - [OptionsContract](docs/OptionsContract.md)
+ - [OptionsMMP](docs/OptionsMMP.md)
+ - [OptionsMMPReset](docs/OptionsMMPReset.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)
+ - [OptionsUnderlyingTicker](docs/OptionsUnderlyingTicker.md)
- [Order](docs/Order.md)
- [OrderBook](docs/OrderBook.md)
+ - [OrderCancel](docs/OrderCancel.md)
+ - [OrderPatch](docs/OrderPatch.md)
+ - [OrderResp](docs/OrderResp.md)
+ - [PartnerCommissionHistory](docs/PartnerCommissionHistory.md)
+ - [PartnerSub](docs/PartnerSub.md)
+ - [PartnerSubList](docs/PartnerSubList.md)
+ - [PartnerTransactionHistory](docs/PartnerTransactionHistory.md)
+ - [PatchUniLend](docs/PatchUniLend.md)
+ - [PlaceDualInvestmentOrder](docs/PlaceDualInvestmentOrder.md)
- [Position](docs/Position.md)
- [PositionClose](docs/PositionClose.md)
- [PositionCloseOrder](docs/PositionCloseOrder.md)
- - [RepayRequest](docs/RepayRequest.md)
- - [Repayment](docs/Repayment.md)
+ - [ProfitLossRange](docs/ProfitLossRange.md)
+ - [RebateUserInfo](docs/RebateUserInfo.md)
+ - [RepayCurrencyRes](docs/RepayCurrencyRes.md)
+ - [RepayLoan](docs/RepayLoan.md)
+ - [RepayMultiLoan](docs/RepayMultiLoan.md)
+ - [RepayRecord](docs/RepayRecord.md)
+ - [RepayRecordCurrency](docs/RepayRecordCurrency.md)
+ - [RepayRecordLeftInterest](docs/RepayRecordLeftInterest.md)
+ - [RepayRecordRepaidCurrency](docs/RepayRecordRepaidCurrency.md)
+ - [RepayRecordTotalInterest](docs/RepayRecordTotalInterest.md)
+ - [RepayResp](docs/RepayResp.md)
+ - [RiskUnits](docs/RiskUnits.md)
+ - [SavedAddress](docs/SavedAddress.md)
+ - [SmallBalance](docs/SmallBalance.md)
+ - [SmallBalanceHistory](docs/SmallBalanceHistory.md)
- [SpotAccount](docs/SpotAccount.md)
+ - [SpotAccountBook](docs/SpotAccountBook.md)
+ - [SpotCurrencyChain](docs/SpotCurrencyChain.md)
+ - [SpotFee](docs/SpotFee.md)
+ - [SpotInsuranceHistory](docs/SpotInsuranceHistory.md)
- [SpotPricePutOrder](docs/SpotPricePutOrder.md)
- [SpotPriceTrigger](docs/SpotPriceTrigger.md)
- [SpotPriceTriggeredOrder](docs/SpotPriceTriggeredOrder.md)
+ - [StpGroup](docs/StpGroup.md)
+ - [StpGroupUser](docs/StpGroupUser.md)
+ - [StructuredBuy](docs/StructuredBuy.md)
+ - [StructuredGetProjectList](docs/StructuredGetProjectList.md)
+ - [StructuredOrderList](docs/StructuredOrderList.md)
+ - [SubAccount](docs/SubAccount.md)
- [SubAccountBalance](docs/SubAccountBalance.md)
+ - [SubAccountCrossMarginBalance](docs/SubAccountCrossMarginBalance.md)
+ - [SubAccountFuturesBalance](docs/SubAccountFuturesBalance.md)
+ - [SubAccountKey](docs/SubAccountKey.md)
+ - [SubAccountKeyPerms](docs/SubAccountKeyPerms.md)
+ - [SubAccountMarginBalance](docs/SubAccountMarginBalance.md)
+ - [SubAccountToSubAccount](docs/SubAccountToSubAccount.md)
- [SubAccountTransfer](docs/SubAccountTransfer.md)
+ - [SubAccountTransferRecordItem](docs/SubAccountTransferRecordItem.md)
+ - [SubCrossMarginAccount](docs/SubCrossMarginAccount.md)
+ - [SubUserMode](docs/SubUserMode.md)
+ - [SwapCoin](docs/SwapCoin.md)
+ - [SwapCoinStruct](docs/SwapCoinStruct.md)
+ - [SystemTime](docs/SystemTime.md)
- [Ticker](docs/Ticker.md)
- [TotalBalance](docs/TotalBalance.md)
- [Trade](docs/Trade.md)
- [TradeFee](docs/TradeFee.md)
+ - [TransactionID](docs/TransactionID.md)
- [Transfer](docs/Transfer.md)
+ - [TransferOrderStatus](docs/TransferOrderStatus.md)
+ - [TransferablesResult](docs/TransferablesResult.md)
- [TriggerOrderResponse](docs/TriggerOrderResponse.md)
+ - [TriggerTime](docs/TriggerTime.md)
+ - [UidPushOrder](docs/UidPushOrder.md)
+ - [UidPushWithdrawal](docs/UidPushWithdrawal.md)
+ - [UidPushWithdrawalResp](docs/UidPushWithdrawalResp.md)
+ - [UniCurrency](docs/UniCurrency.md)
+ - [UniCurrencyInterest](docs/UniCurrencyInterest.md)
+ - [UniCurrencyPair](docs/UniCurrencyPair.md)
+ - [UniInterestRecord](docs/UniInterestRecord.md)
+ - [UniLend](docs/UniLend.md)
+ - [UniLendInterest](docs/UniLendInterest.md)
+ - [UniLendRecord](docs/UniLendRecord.md)
+ - [UniLoan](docs/UniLoan.md)
+ - [UniLoanInterestRecord](docs/UniLoanInterestRecord.md)
+ - [UniLoanRecord](docs/UniLoanRecord.md)
+ - [UnifiedAccount](docs/UnifiedAccount.md)
+ - [UnifiedBalance](docs/UnifiedBalance.md)
+ - [UnifiedBorrowable](docs/UnifiedBorrowable.md)
+ - [UnifiedBorrowable1](docs/UnifiedBorrowable1.md)
+ - [UnifiedCollateralReq](docs/UnifiedCollateralReq.md)
+ - [UnifiedCollateralRes](docs/UnifiedCollateralRes.md)
+ - [UnifiedCurrency](docs/UnifiedCurrency.md)
+ - [UnifiedDiscount](docs/UnifiedDiscount.md)
+ - [UnifiedDiscountTiers](docs/UnifiedDiscountTiers.md)
+ - [UnifiedHistoryLoanRate](docs/UnifiedHistoryLoanRate.md)
+ - [UnifiedHistoryLoanRateRates](docs/UnifiedHistoryLoanRateRates.md)
+ - [UnifiedLeverageConfig](docs/UnifiedLeverageConfig.md)
+ - [UnifiedLeverageSetting](docs/UnifiedLeverageSetting.md)
+ - [UnifiedLoan](docs/UnifiedLoan.md)
+ - [UnifiedLoanRecord](docs/UnifiedLoanRecord.md)
+ - [UnifiedLoanResult](docs/UnifiedLoanResult.md)
+ - [UnifiedMarginTiers](docs/UnifiedMarginTiers.md)
+ - [UnifiedModeSet](docs/UnifiedModeSet.md)
+ - [UnifiedPortfolioInput](docs/UnifiedPortfolioInput.md)
+ - [UnifiedPortfolioOutput](docs/UnifiedPortfolioOutput.md)
+ - [UnifiedRiskUnits](docs/UnifiedRiskUnits.md)
+ - [UnifiedSettings](docs/UnifiedSettings.md)
+ - [UnifiedTransferable](docs/UnifiedTransferable.md)
+ - [UserLtvInfo](docs/UserLtvInfo.md)
+ - [UserSub](docs/UserSub.md)
+ - [UserSubRelation](docs/UserSubRelation.md)
+ - [UserTotalAmount](docs/UserTotalAmount.md)
- [WithdrawStatus](docs/WithdrawStatus.md)
+ - [WithdrawalRecord](docs/WithdrawalRecord.md)
## Documentation for Authorization
@@ -359,5 +696,5 @@ It's recommended to create an instance of `ApiClient` per thread in a multi-thre
## Author
-support@mail.gate.io
+support@mail.gate.com
diff --git a/build.gradle b/build.gradle
index 9c628d4..06a0965 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'eclipse'
apply plugin: 'java'
group = 'io.gate'
-version = '6.22.2'
+version = '7.1.8'
buildscript {
repositories {
@@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') {
dependencies {
compile "com.google.code.findbugs:jsr305:3.0.2"
- compile 'com.squareup.okhttp3:okhttp:3.14.7'
- compile 'com.squareup.okhttp3:logging-interceptor:3.14.7'
- compile 'com.google.code.gson:gson:2.8.6'
+ compile 'com.squareup.okhttp3:okhttp:4.9.3'
+ compile 'com.squareup.okhttp3:logging-interceptor:4.9.3'
+ compile 'com.google.code.gson:gson:2.10'
compile 'io.gsonfire:gson-fire:1.8.4'
compile 'commons-codec:commons-codec:1.14'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
diff --git a/build.sbt b/build.sbt
index 7ad7b40..d90345d 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,16 +2,16 @@ lazy val root = (project in file(".")).
settings(
organization := "io.gate",
name := "gate-api",
- version := "6.22.2",
+ version := "7.1.8",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
- "com.squareup.okhttp3" % "okhttp" % "3.14.7",
- "com.squareup.okhttp3" % "logging-interceptor" % "3.14.7",
- "com.google.code.gson" % "gson" % "2.8.6",
+ "com.squareup.okhttp3" % "okhttp" % "4.9.3",
+ "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3",
+ "com.google.code.gson" % "gson" % "2.10",
"org.apache.commons" % "commons-lang3" % "3.10",
"commons-codec" % "commons-codec" % "1.14",
"io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
diff --git a/docs/AccountApi.md b/docs/AccountApi.md
new file mode 100644
index 0000000..348ae04
--- /dev/null
+++ b/docs/AccountApi.md
@@ -0,0 +1,636 @@
+# AccountApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**getAccountDetail**](AccountApi.md#getAccountDetail) | **GET** /account/detail | Retrieve user account information
+[**getAccountRateLimit**](AccountApi.md#getAccountRateLimit) | **GET** /account/rate_limit | Get user transaction rate limit information
+[**listSTPGroups**](AccountApi.md#listSTPGroups) | **GET** /account/stp_groups | Query STP user groups created by the user
+[**createSTPGroup**](AccountApi.md#createSTPGroup) | **POST** /account/stp_groups | Create STP user group
+[**listSTPGroupsUsers**](AccountApi.md#listSTPGroupsUsers) | **GET** /account/stp_groups/{stp_id}/users | Query users in the STP user group
+[**addSTPGroupUsers**](AccountApi.md#addSTPGroupUsers) | **POST** /account/stp_groups/{stp_id}/users | Add users to the STP user group
+[**deleteSTPGroupUsers**](AccountApi.md#deleteSTPGroupUsers) | **DELETE** /account/stp_groups/{stp_id}/users | Delete users from the STP user group
+[**getDebitFee**](AccountApi.md#getDebitFee) | **GET** /account/debit_fee | Query GT fee deduction configuration
+[**setDebitFee**](AccountApi.md#setDebitFee) | **POST** /account/debit_fee | Configure GT fee deduction
+
+
+
+# **getAccountDetail**
+> AccountDetail getAccountDetail()
+
+Retrieve user account information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ try {
+ AccountDetail result = apiInstance.getAccountDetail();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#getAccountDetail");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**AccountDetail**](AccountDetail.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **getAccountRateLimit**
+> List<AccountRateLimit> getAccountRateLimit()
+
+Get user transaction rate limit information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ try {
+ List result = apiInstance.getAccountRateLimit();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#getAccountRateLimit");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<AccountRateLimit>**](AccountRateLimit.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **listSTPGroups**
+> List<StpGroup> listSTPGroups().name(name).execute();
+
+Query STP user groups created by the user
+
+Only query STP user groups created by the current main account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ String name = "group"; // String | Fuzzy search by name
+ try {
+ List result = apiInstance.listSTPGroups()
+ .name(name)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#listSTPGroups");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **name** | **String**| Fuzzy search by name | [optional]
+
+### Return type
+
+[**List<StpGroup>**](StpGroup.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **createSTPGroup**
+> StpGroup createSTPGroup(stpGroup)
+
+Create STP user group
+
+Only the main account is allowed to create a new STP user group
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ StpGroup stpGroup = new StpGroup(); // StpGroup |
+ try {
+ StpGroup result = apiInstance.createSTPGroup(stpGroup);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#createSTPGroup");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **stpGroup** | [**StpGroup**](StpGroup.md)| |
+
+### Return type
+
+[**StpGroup**](StpGroup.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | User added successfully, returning current users in the STP group | - |
+
+
+# **listSTPGroupsUsers**
+> List<StpGroupUser> listSTPGroupsUsers(stpId)
+
+Query users in the STP user group
+
+Only the main account that created this STP group can query the account ID list in the current STP group
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ Long stpId = 1L; // Long | STP Group ID
+ try {
+ List result = apiInstance.listSTPGroupsUsers(stpId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#listSTPGroupsUsers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **stpId** | **Long**| STP Group ID |
+
+### Return type
+
+[**List<StpGroupUser>**](StpGroupUser.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **addSTPGroupUsers**
+> List<StpGroupUser> addSTPGroupUsers(stpId, requestBody)
+
+Add users to the STP user group
+
+- Only the main account that created this STP group can add users to the STP user group - Only accounts under the current main account are allowed, cross-main account is not permitted
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ Long stpId = 1L; // Long | STP Group ID
+ List requestBody = Arrays.asList(); // List | User ID
+ try {
+ List result = apiInstance.addSTPGroupUsers(stpId, requestBody);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#addSTPGroupUsers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **stpId** | **Long**| STP Group ID |
+ **requestBody** | [**List<Long>**](Long.md)| User ID |
+
+### Return type
+
+[**List<StpGroupUser>**](StpGroupUser.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | User added successfully, returning current users in the STP group | - |
+
+
+# **deleteSTPGroupUsers**
+> List<StpGroupUser> deleteSTPGroupUsers(stpId, userId)
+
+Delete users from the STP user group
+
+- Only the main account that created this STP group is allowed to delete users from the STP user group - Deletion is limited to accounts under the current main account; cross-account deletion is not permitted
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ Long stpId = 1L; // Long | STP Group ID
+ Long userId = 1L; // Long | STP user IDs, multiple IDs can be separated by commas
+ try {
+ List result = apiInstance.deleteSTPGroupUsers(stpId, userId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#deleteSTPGroupUsers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **stpId** | **Long**| STP Group ID |
+ **userId** | **Long**| STP user IDs, multiple IDs can be separated by commas |
+
+### Return type
+
+[**List<StpGroupUser>**](StpGroupUser.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Users deleted successfully, returns current users in the STP group | - |
+
+
+# **getDebitFee**
+> DebitFee getDebitFee()
+
+Query GT fee deduction configuration
+
+Query the GT fee deduction configuration for the current account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ try {
+ DebitFee result = apiInstance.getDebitFee();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#getDebitFee");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**DebitFee**](DebitFee.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+
+# **setDebitFee**
+> setDebitFee(debitFee)
+
+Configure GT fee deduction
+
+Enable or disable GT fee deduction for the current account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.AccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ AccountApi apiInstance = new AccountApi(defaultClient);
+ DebitFee debitFee = new DebitFee(); // DebitFee |
+ try {
+ apiInstance.setDebitFee(debitFee);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AccountApi#setDebitFee");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **debitFee** | [**DebitFee**](DebitFee.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
diff --git a/docs/AccountBalance.md b/docs/AccountBalance.md
index 64b9fdf..1bb2651 100644
--- a/docs/AccountBalance.md
+++ b/docs/AccountBalance.md
@@ -9,6 +9,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **String** | Account total balance amount | [optional]
**currency** | [**CurrencyEnum**](#CurrencyEnum) | Currency | [optional]
+**unrealisedPnl** | **String** | Unrealised_pnl, this field will only appear in futures, options, delivery, and total accounts | [optional]
+**borrowed** | **String** | Total borrowed amount, this field will only appear in margin and cross_margin accounts | [optional]
## Enum: CurrencyEnum
diff --git a/docs/AccountDetail.md b/docs/AccountDetail.md
new file mode 100644
index 0000000..d8ab381
--- /dev/null
+++ b/docs/AccountDetail.md
@@ -0,0 +1,16 @@
+
+# AccountDetail
+
+Account details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ipWhitelist** | **List<String>** | IP Whitelist | [optional]
+**currencyPairs** | **List<String>** | Trading pair whitelist | [optional]
+**userId** | **Long** | User ID | [optional]
+**tier** | **Long** | User VIP level | [optional]
+**key** | [**AccountDetailKey**](AccountDetailKey.md) | | [optional]
+**copyTradingRole** | **Integer** | User role: 0 - Normal user, 1 - Copy trading leader, 2 - Follower, 3 - Both leader and follower | [optional]
+
diff --git a/docs/AccountDetailKey.md b/docs/AccountDetailKey.md
new file mode 100644
index 0000000..57978ca
--- /dev/null
+++ b/docs/AccountDetailKey.md
@@ -0,0 +1,11 @@
+
+# AccountDetailKey
+
+API Key details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mode** | **Integer** | Mode: 1 - Classic mode, 2 - Legacy unified mode | [optional]
+
diff --git a/docs/AccountRateLimit.md b/docs/AccountRateLimit.md
new file mode 100644
index 0000000..747a17c
--- /dev/null
+++ b/docs/AccountRateLimit.md
@@ -0,0 +1,12 @@
+
+# AccountRateLimit
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tier** | **String** | Frequency limit level (For detailed frequency limit rules, see [Transaction ratio frequency limit](#rate-limit-based-on-fill-ratio)) | [optional]
+**ratio** | **String** | Fill rate | [optional]
+**mainRatio** | **String** | Total fill ratio of main account | [optional]
+**updatedAt** | **String** | Update time | [optional]
+
diff --git a/docs/AgencyCommission.md b/docs/AgencyCommission.md
new file mode 100644
index 0000000..beaf7e5
--- /dev/null
+++ b/docs/AgencyCommission.md
@@ -0,0 +1,14 @@
+
+# AgencyCommission
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**commissionTime** | **Long** | Commission time (Unix timestamp in seconds) | [optional]
+**userId** | **Long** | User ID | [optional]
+**groupName** | **String** | Group name | [optional]
+**commissionAmount** | **String** | Transaction amount | [optional]
+**commissionAsset** | **String** | Commission Asset | [optional]
+**source** | **String** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional]
+
diff --git a/docs/AgencyCommissionHistory.md b/docs/AgencyCommissionHistory.md
new file mode 100644
index 0000000..d74cc13
--- /dev/null
+++ b/docs/AgencyCommissionHistory.md
@@ -0,0 +1,11 @@
+
+# AgencyCommissionHistory
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPair** | **String** | Currency pair | [optional]
+**total** | **Long** | Total | [optional]
+**list** | [**List<AgencyCommission>**](AgencyCommission.md) | List of commission history | [optional]
+
diff --git a/docs/AgencyTransaction.md b/docs/AgencyTransaction.md
new file mode 100644
index 0000000..4483e3f
--- /dev/null
+++ b/docs/AgencyTransaction.md
@@ -0,0 +1,17 @@
+
+# AgencyTransaction
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**transactionTime** | **Long** | Transaction Time. (unix timestamp) | [optional]
+**userId** | **Long** | User ID | [optional]
+**groupName** | **String** | Group name | [optional]
+**fee** | **String** | Fee | [optional]
+**feeAsset** | **String** | Fee currency | [optional]
+**currencyPair** | **String** | Currency pair | [optional]
+**amount** | **String** | Transaction amount | [optional]
+**amountAsset** | **String** | Commission Asset | [optional]
+**source** | **String** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional]
+
diff --git a/docs/AgencyTransactionHistory.md b/docs/AgencyTransactionHistory.md
new file mode 100644
index 0000000..2a78460
--- /dev/null
+++ b/docs/AgencyTransactionHistory.md
@@ -0,0 +1,11 @@
+
+# AgencyTransactionHistory
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPair** | **String** | Currency pair | [optional]
+**total** | **Long** | Total | [optional]
+**list** | [**List<AgencyTransaction>**](AgencyTransaction.md) | List of transaction history | [optional]
+
diff --git a/docs/AutoRepaySetting.md b/docs/AutoRepaySetting.md
index 176b917..cbcdb65 100644
--- a/docs/AutoRepaySetting.md
+++ b/docs/AutoRepaySetting.md
@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**status** | [**StatusEnum**](#StatusEnum) | Auto repayment status. `on` - enabled, `off` - disabled | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | Auto repayment status: `on` - enabled, `off` - disabled | [optional]
## Enum: StatusEnum
diff --git a/docs/BatchAmendItem.md b/docs/BatchAmendItem.md
new file mode 100644
index 0000000..e37ee0d
--- /dev/null
+++ b/docs/BatchAmendItem.md
@@ -0,0 +1,17 @@
+
+# BatchAmendItem
+
+Order information that needs to be modified
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **String** | The order ID returned upon successful creation or the custom ID specified by the user during creation (i.e., the 'text' field) |
+**currencyPair** | **String** | Currency pair |
+**account** | **String** | Default spot, unified account and warehouse-by-store leverage account | [optional]
+**amount** | **String** | Trading Quantity. Only one of `amount` or `price` can be specified | [optional]
+**price** | **String** | Trading Price. Only one of `amount` or `price` can be specified | [optional]
+**amendText** | **String** | Custom info during order amendment | [optional]
+**actionMode** | **String** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional]
+
diff --git a/docs/BatchAmendOrderReq.md b/docs/BatchAmendOrderReq.md
new file mode 100644
index 0000000..b4a5a3b
--- /dev/null
+++ b/docs/BatchAmendOrderReq.md
@@ -0,0 +1,15 @@
+
+# BatchAmendOrderReq
+
+Modify contract order parameters
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order id, order_id and text must contain at least one | [optional]
+**text** | **String** | User-defined order text, at least one of order_id and text must be passed | [optional]
+**size** | **Long** | New order size, including filled size. - If less than or equal to the filled quantity, the order will be cancelled. - The new order side must be identical to the original one. - Close order size cannot be modified. - For reduce-only orders, increasing the size may cancel other reduce-only orders. - If the price is not modified, decreasing the size will not affect the depth queue, while increasing the size will place it at the end of the current price level. | [optional]
+**price** | **String** | New order price | [optional]
+**amendText** | **String** | Custom info during order amendment | [optional]
+
diff --git a/docs/BatchFuturesOrder.md b/docs/BatchFuturesOrder.md
new file mode 100644
index 0000000..5ed54b4
--- /dev/null
+++ b/docs/BatchFuturesOrder.md
@@ -0,0 +1,84 @@
+
+# BatchFuturesOrder
+
+Futures order details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**succeeded** | **Boolean** | Request execution result | [optional]
+**label** | **String** | Error label, only exists if execution fails | [optional]
+**detail** | **String** | Error detail, only present if execution failed and details need to be given | [optional]
+**id** | **Long** | Futures order ID | [optional] [readonly]
+**user** | **Integer** | User ID | [optional] [readonly]
+**createTime** | **Double** | Creation time of order | [optional] [readonly]
+**finishTime** | **Double** | Order finished time. Not returned if order is open | [optional] [readonly]
+**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | 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 the position was closed - reduce_out: only reduce positions by excluding hard-to-fill orders - stp: cancelled because self trade prevention | [optional] [readonly]
+**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: Pending - `finished`: Completed | [optional] [readonly]
+**contract** | **String** | Futures contract | [optional]
+**size** | **Long** | Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. | [optional]
+**iceberg** | **Long** | Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. | [optional]
+**price** | **String** | Order price. Price of 0 with `tif` set to `ioc` represents a market order. | [optional]
+**close** | **Boolean** | Set as `true` to close the position, with `size` set to 0 | [optional]
+**isClose** | **Boolean** | Is the order to close position | [optional] [readonly]
+**reduceOnly** | **Boolean** | Set as `true` to be reduce-only order | [optional]
+**isReduceOnly** | **Boolean** | Is the order reduce-only | [optional] [readonly]
+**isLiq** | **Boolean** | Is the order for liquidation | [optional] [readonly]
+**tif** | [**TifEnum**](#TifEnum) | 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]
+**left** | **Long** | Unfilled quantity | [optional] [readonly]
+**fillPrice** | **String** | Fill price | [optional] [readonly]
+**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]
+**tkfr** | **String** | Taker fee | [optional] [readonly]
+**mkfr** | **String** | Maker fee | [optional] [readonly]
+**refu** | **Integer** | Referrer user ID | [optional] [readonly]
+**autoSize** | [**AutoSizeEnum**](#AutoSizeEnum) | 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]
+**stpAct** | [**StpActEnum**](#StpActEnum) | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional]
+**stpId** | **Integer** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly]
+
+## Enum: FinishAsEnum
+
+Name | Value
+---- | -----
+FILLED | "filled"
+CANCELLED | "cancelled"
+LIQUIDATED | "liquidated"
+IOC | "ioc"
+AUTO_DELEVERAGED | "auto_deleveraged"
+REDUCE_ONLY | "reduce_only"
+POSITION_CLOSED | "position_closed"
+REDUCE_OUT | "reduce_out"
+STP | "stp"
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+OPEN | "open"
+FINISHED | "finished"
+
+## Enum: TifEnum
+
+Name | Value
+---- | -----
+GTC | "gtc"
+IOC | "ioc"
+POC | "poc"
+FOK | "fok"
+
+## Enum: AutoSizeEnum
+
+Name | Value
+---- | -----
+LONG | "close_long"
+SHORT | "close_short"
+
+## Enum: StpActEnum
+
+Name | Value
+---- | -----
+CO | "co"
+CN | "cn"
+CB | "cb"
+MINUS | "-"
+
diff --git a/docs/BatchOrder.md b/docs/BatchOrder.md
index d7af95c..36702e2 100644
--- a/docs/BatchOrder.md
+++ b/docs/BatchOrder.md
@@ -7,8 +7,10 @@ Batch order details
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**text** | **String** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional]
-**succeeded** | **Boolean** | Whether the batch of orders succeeded | [optional]
+**orderId** | **String** | Order ID | [optional]
+**amendText** | **String** | The custom data that the user remarked when amending the order | [optional]
+**text** | **String** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional]
+**succeeded** | **Boolean** | Request execution result | [optional]
**label** | **String** | Error label, if any, otherwise an empty string | [optional]
**message** | **String** | Detailed error message, if any, otherwise an empty string | [optional]
**id** | **String** | Order ID | [optional] [readonly]
@@ -18,25 +20,30 @@ Name | Type | Description | Notes
**updateTimeMs** | **Long** | Last modification time of order (in milliseconds) | [optional] [readonly]
**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly]
**currencyPair** | **String** | Currency pair | [optional]
-**type** | [**TypeEnum**](#TypeEnum) | Order type. limit - limit order | [optional]
-**account** | [**AccountEnum**](#AccountEnum) | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional]
-**side** | [**SideEnum**](#SideEnum) | Order side | [optional]
+**type** | [**TypeEnum**](#TypeEnum) | Order Type - limit : Limit Order - market : Market Order | [optional]
+**account** | [**AccountEnum**](#AccountEnum) | Account type, spot - spot account, margin - leveraged account, unified - unified account | [optional]
+**side** | [**SideEnum**](#SideEnum) | Buy or sell order | [optional]
**amount** | **String** | Trade amount | [optional]
**price** | **String** | Order price | [optional]
-**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional]
-**iceberg** | **String** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional]
-**autoBorrow** | **Boolean** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional]
-**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]
+**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | 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]
+**iceberg** | **String** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported | [optional]
+**autoBorrow** | **Boolean** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough | [optional]
+**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` can be both set to true in one order | [optional]
**left** | **String** | Amount left to fill | [optional] [readonly]
+**filledAmount** | **String** | Amount filled | [optional] [readonly]
**fillPrice** | **String** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly]
**filledTotal** | **String** | Total filled in quote currency | [optional] [readonly]
+**avgDealPrice** | **String** | Average fill price | [optional] [readonly]
**fee** | **String** | Fee deducted | [optional] [readonly]
**feeCurrency** | **String** | Fee currency unit | [optional] [readonly]
**pointFee** | **String** | Points used to deduct fee | [optional] [readonly]
**gtFee** | **String** | GT used to deduct fee | [optional] [readonly]
-**gtDiscount** | **Boolean** | Whether GT fee discount is used | [optional] [readonly]
+**gtDiscount** | **Boolean** | Whether GT fee deduction is enabled | [optional] [readonly]
**rebatedFee** | **String** | Rebated fee | [optional] [readonly]
**rebatedFeeCurrency** | **String** | Rebated fee currency unit | [optional] [readonly]
+**stpId** | **Integer** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly]
+**stpAct** | [**StpActEnum**](#StpActEnum) | Self-Trading Prevention Action. Users can use this field to set self-trade prevetion strategies 1. After users join the `STP Group`, he can pass `stp_act` to limit the user's self-trade prevetion strategy. If `stp_act` is not passed, the default is `cn` strategy。 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter。 3. If the user did not use 'stp_act' when placing the order, 'stp_act' will return '-' - cn: Cancel newest, Cancel new orders and keep old ones - co: Cancel oldest, new ones - cb: Cancel both, Both old and new orders will be cancelled | [optional]
+**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | How the order was finished. - open: processing - filled: filled totally - cancelled: manually cancelled - ioc: time in force is `IOC`, finish immediately - stp: cancelled because self trade prevention | [optional] [readonly]
## Enum: StatusEnum
@@ -51,6 +58,7 @@ CANCELLED | "cancelled"
Name | Value
---- | -----
LIMIT | "limit"
+MARKET | "market"
## Enum: AccountEnum
@@ -59,6 +67,7 @@ Name | Value
SPOT | "spot"
MARGIN | "margin"
CROSS_MARGIN | "cross_margin"
+UNIFIED | "unified"
## Enum: SideEnum
@@ -74,4 +83,24 @@ Name | Value
GTC | "gtc"
IOC | "ioc"
POC | "poc"
+FOK | "fok"
+
+## Enum: StpActEnum
+
+Name | Value
+---- | -----
+CN | "cn"
+CO | "co"
+CB | "cb"
+MINUS | "-"
+
+## Enum: FinishAsEnum
+
+Name | Value
+---- | -----
+OPEN | "open"
+FILLED | "filled"
+CANCELLED | "cancelled"
+IOC | "ioc"
+STP | "stp"
diff --git a/docs/BorrowCurrencyInfo.md b/docs/BorrowCurrencyInfo.md
new file mode 100644
index 0000000..7fe459d
--- /dev/null
+++ b/docs/BorrowCurrencyInfo.md
@@ -0,0 +1,13 @@
+
+# BorrowCurrencyInfo
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**leftRepayPrincipal** | **String** | Outstanding principal | [optional]
+**leftRepayInterest** | **String** | Outstanding interest | [optional]
+**leftRepayUsdt** | **String** | Remaining total outstanding value converted to USDT | [optional]
+
diff --git a/docs/BrokerCommission.md b/docs/BrokerCommission.md
new file mode 100644
index 0000000..7a88b21
--- /dev/null
+++ b/docs/BrokerCommission.md
@@ -0,0 +1,10 @@
+
+# BrokerCommission
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**total** | **Long** | Total | [optional]
+**list** | [**List<BrokerCommission1>**](BrokerCommission1.md) | List of commission history | [optional]
+
diff --git a/docs/BrokerCommission1.md b/docs/BrokerCommission1.md
new file mode 100644
index 0000000..761aa6b
--- /dev/null
+++ b/docs/BrokerCommission1.md
@@ -0,0 +1,19 @@
+
+# BrokerCommission1
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**commissionTime** | **Long** | Commission time (Unix timestamp in seconds) | [optional]
+**userId** | **Long** | User ID | [optional]
+**groupName** | **String** | Group name | [optional]
+**amount** | **String** | The amount of commission rebates | [optional]
+**fee** | **String** | Fee | [optional]
+**feeAsset** | **String** | Fee currency | [optional]
+**rebateFee** | **String** | The income from rebates, converted to USDT | [optional]
+**source** | **String** | Commission transaction type: Spot, Futures, Options, Alpha | [optional]
+**currencyPair** | **String** | Currency pair | [optional]
+**subBrokerInfo** | [**BrokerCommissionSubBrokerInfo**](BrokerCommissionSubBrokerInfo.md) | | [optional]
+**alphaContractAddr** | **String** | Alpha contract address | [optional]
+
diff --git a/docs/BrokerCommissionSubBrokerInfo.md b/docs/BrokerCommissionSubBrokerInfo.md
new file mode 100644
index 0000000..9c71f9c
--- /dev/null
+++ b/docs/BrokerCommissionSubBrokerInfo.md
@@ -0,0 +1,14 @@
+
+# BrokerCommissionSubBrokerInfo
+
+Sub-broker information
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | Sub-broker user ID | [optional]
+**originalCommissionRate** | **String** | Sub-broker original commission rate | [optional]
+**relativeCommissionRate** | **String** | Sub-broker relative commission rate | [optional]
+**commissionRate** | **String** | Sub-broker actual commission rate | [optional]
+
diff --git a/docs/BrokerTransaction.md b/docs/BrokerTransaction.md
new file mode 100644
index 0000000..3dafae9
--- /dev/null
+++ b/docs/BrokerTransaction.md
@@ -0,0 +1,10 @@
+
+# BrokerTransaction
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**total** | **Long** | Total | [optional]
+**list** | [**List<BrokerTransaction1>**](BrokerTransaction1.md) | List of transaction history | [optional]
+
diff --git a/docs/BrokerTransaction1.md b/docs/BrokerTransaction1.md
new file mode 100644
index 0000000..627d8ce
--- /dev/null
+++ b/docs/BrokerTransaction1.md
@@ -0,0 +1,18 @@
+
+# BrokerTransaction1
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**transactionTime** | **Long** | Transaction Time. (unix timestamp) | [optional]
+**userId** | **Long** | User ID | [optional]
+**groupName** | **String** | Group name | [optional]
+**fee** | **String** | Fee amount (USDT) | [optional]
+**currencyPair** | **String** | Currency pair | [optional]
+**amount** | **String** | Transaction amount | [optional]
+**feeAsset** | **String** | Fee currency | [optional]
+**source** | **String** | Commission transaction type: Spot, Futures, Options, Alpha | [optional]
+**subBrokerInfo** | [**BrokerCommissionSubBrokerInfo**](BrokerCommissionSubBrokerInfo.md) | | [optional]
+**alphaContractAddr** | **String** | Alpha contract address | [optional]
+
diff --git a/docs/CancelBatchOrder.md b/docs/CancelBatchOrder.md
new file mode 100644
index 0000000..be6fb13
--- /dev/null
+++ b/docs/CancelBatchOrder.md
@@ -0,0 +1,14 @@
+
+# CancelBatchOrder
+
+Info of order to be cancelled
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPair** | **String** | Order currency pair |
+**id** | **String** | Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation |
+**account** | **String** | If the canceled order is a unified account apikey, this field must be specified and set to `unified` | [optional]
+**actionMode** | **String** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional]
+
diff --git a/docs/CancelOrder.md b/docs/CancelOrder.md
deleted file mode 100644
index 36442a3..0000000
--- a/docs/CancelOrder.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-# CancelOrder
-
-Info of order to be cancelled
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**currencyPair** | **String** | Order currency pair |
-**id** | **String** | Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation |
-**account** | **String** | If cancelled order is cross margin order, this field must be set and can only be `cross_margin` | [optional]
-
diff --git a/docs/CancelOrderResult.md b/docs/CancelOrderResult.md
index cbeff61..2e4c268 100644
--- a/docs/CancelOrderResult.md
+++ b/docs/CancelOrderResult.md
@@ -9,8 +9,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currencyPair** | **String** | Order currency pair | [optional]
**id** | **String** | Order ID | [optional]
+**text** | **String** | Custom order information | [optional]
**succeeded** | **Boolean** | Whether cancellation succeeded | [optional]
**label** | **String** | Error label when failed to cancel the order; emtpy if succeeded | [optional]
-**message** | **String** | Error message when failed to cancel the order; empty if succeeded | [optional]
-**account** | **String** | Empty by default. If cancelled order is cross margin order, this field is set to `cross_margin` | [optional]
+**message** | **String** | Error description when cancellation fails, empty if successful | [optional]
+**account** | **String** | Default is empty (deprecated) | [optional]
diff --git a/docs/CollateralAdjust.md b/docs/CollateralAdjust.md
new file mode 100644
index 0000000..3f7aecf
--- /dev/null
+++ b/docs/CollateralAdjust.md
@@ -0,0 +1,11 @@
+
+# CollateralAdjust
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID |
+**type** | **String** | Operation type: append - add collateral, redeem - withdraw collateral |
+**collaterals** | [**List<CollateralCurrency>**](CollateralCurrency.md) | Collateral currency list | [optional]
+
diff --git a/docs/CollateralAdjustRes.md b/docs/CollateralAdjustRes.md
new file mode 100644
index 0000000..f26810d
--- /dev/null
+++ b/docs/CollateralAdjustRes.md
@@ -0,0 +1,12 @@
+
+# CollateralAdjustRes
+
+Multi-collateral adjustment result
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+**collateralCurrencies** | [**List<CollateralCurrencyRes>**](CollateralCurrencyRes.md) | Collateral currency information | [optional]
+
diff --git a/docs/CollateralAlign.md b/docs/CollateralAlign.md
new file mode 100644
index 0000000..022b44b
--- /dev/null
+++ b/docs/CollateralAlign.md
@@ -0,0 +1,12 @@
+
+# CollateralAlign
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID |
+**collateralCurrency** | **String** | Collateral currency |
+**collateralAmount** | **String** | Collateral amount |
+**type** | **String** | Operation type: append - add collateral, redeem - withdraw collateral |
+
diff --git a/docs/CollateralCurrency.md b/docs/CollateralCurrency.md
new file mode 100644
index 0000000..a05a724
--- /dev/null
+++ b/docs/CollateralCurrency.md
@@ -0,0 +1,10 @@
+
+# CollateralCurrency
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**amount** | **String** | Size | [optional]
+
diff --git a/docs/CollateralCurrencyInfo.md b/docs/CollateralCurrencyInfo.md
new file mode 100644
index 0000000..2c87685
--- /dev/null
+++ b/docs/CollateralCurrencyInfo.md
@@ -0,0 +1,12 @@
+
+# CollateralCurrencyInfo
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**leftCollateral** | **String** | Remaining collateral amount | [optional]
+**leftCollateralUsdt** | **String** | Remaining collateral value converted to USDT | [optional]
+
diff --git a/docs/CollateralCurrencyRes.md b/docs/CollateralCurrencyRes.md
new file mode 100644
index 0000000..d0bad83
--- /dev/null
+++ b/docs/CollateralCurrencyRes.md
@@ -0,0 +1,13 @@
+
+# CollateralCurrencyRes
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**succeeded** | **Boolean** | Update success status | [optional]
+**label** | **String** | Error identifier for failed operations; empty when successful | [optional]
+**message** | **String** | Error description for failed operations; empty when successful | [optional]
+**currency** | **String** | Currency | [optional]
+**amount** | **String** | Successfully operated collateral quantity; 0 if operation fails | [optional]
+
diff --git a/docs/CollateralCurrentRate.md b/docs/CollateralCurrentRate.md
new file mode 100644
index 0000000..3594c07
--- /dev/null
+++ b/docs/CollateralCurrentRate.md
@@ -0,0 +1,12 @@
+
+# CollateralCurrentRate
+
+Multi-collateral current interest rate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**currentRate** | **String** | Currency current interest rate | [optional]
+
diff --git a/docs/CollateralFixRate.md b/docs/CollateralFixRate.md
new file mode 100644
index 0000000..1d725e3
--- /dev/null
+++ b/docs/CollateralFixRate.md
@@ -0,0 +1,14 @@
+
+# CollateralFixRate
+
+Multi-collateral fixed interest rate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**rate7d** | **String** | Fixed interest rate for 7-day lending period | [optional]
+**rate30d** | **String** | Fixed interest rate for 30-day lending period | [optional]
+**updateTime** | **Long** | Update time, timestamp in seconds | [optional]
+
diff --git a/docs/CollateralLoanApi.md b/docs/CollateralLoanApi.md
new file mode 100644
index 0000000..881aa73
--- /dev/null
+++ b/docs/CollateralLoanApi.md
@@ -0,0 +1,740 @@
+# CollateralLoanApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**listCollateralLoanOrders**](CollateralLoanApi.md#listCollateralLoanOrders) | **GET** /loan/collateral/orders | Query collateral loan order list
+[**createCollateralLoan**](CollateralLoanApi.md#createCollateralLoan) | **POST** /loan/collateral/orders | Place collateral loan order
+[**getCollateralLoanOrderDetail**](CollateralLoanApi.md#getCollateralLoanOrderDetail) | **GET** /loan/collateral/orders/{order_id} | Query single order details
+[**repayCollateralLoan**](CollateralLoanApi.md#repayCollateralLoan) | **POST** /loan/collateral/repay | Collateral loan repayment
+[**listRepayRecords**](CollateralLoanApi.md#listRepayRecords) | **GET** /loan/collateral/repay_records | Query collateral loan repayment records
+[**listCollateralRecords**](CollateralLoanApi.md#listCollateralRecords) | **GET** /loan/collateral/collaterals | Query collateral adjustment records
+[**operateCollateral**](CollateralLoanApi.md#operateCollateral) | **POST** /loan/collateral/collaterals | Increase or redeem collateral
+[**getUserTotalAmount**](CollateralLoanApi.md#getUserTotalAmount) | **GET** /loan/collateral/total_amount | Query user's total borrowing and collateral amount
+[**getUserLtvInfo**](CollateralLoanApi.md#getUserLtvInfo) | **GET** /loan/collateral/ltv | Query user's collateralization ratio and remaining borrowable currencies
+[**listCollateralCurrencies**](CollateralLoanApi.md#listCollateralCurrencies) | **GET** /loan/collateral/currencies | Query supported borrowing and collateral currencies
+
+
+
+# **listCollateralLoanOrders**
+> List<CollateralOrder> listCollateralLoanOrders().page(page).limit(limit).collateralCurrency(collateralCurrency).borrowCurrency(borrowCurrency).execute();
+
+Query collateral loan order list
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ String collateralCurrency = "BTC"; // String | Collateral currency
+ String borrowCurrency = "USDT"; // String | Borrowed currency
+ try {
+ List result = apiInstance.listCollateralLoanOrders()
+ .page(page)
+ .limit(limit)
+ .collateralCurrency(collateralCurrency)
+ .borrowCurrency(borrowCurrency)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#listCollateralLoanOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **collateralCurrency** | **String**| Collateral currency | [optional]
+ **borrowCurrency** | **String**| Borrowed currency | [optional]
+
+### Return type
+
+[**List<CollateralOrder>**](CollateralOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **createCollateralLoan**
+> OrderResp createCollateralLoan(createCollateralOrder)
+
+Place collateral loan order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ CreateCollateralOrder createCollateralOrder = new CreateCollateralOrder(); // CreateCollateralOrder |
+ try {
+ OrderResp result = apiInstance.createCollateralLoan(createCollateralOrder);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#createCollateralLoan");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **createCollateralOrder** | [**CreateCollateralOrder**](CreateCollateralOrder.md)| |
+
+### Return type
+
+[**OrderResp**](OrderResp.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order placed successfully | - |
+
+
+# **getCollateralLoanOrderDetail**
+> CollateralOrder getCollateralLoanOrderDetail(orderId)
+
+Query single order details
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ Long orderId = 100001L; // Long | Order ID returned when order is successfully created
+ try {
+ CollateralOrder result = apiInstance.getCollateralLoanOrderDetail(orderId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#getCollateralLoanOrderDetail");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| Order ID returned when order is successfully created |
+
+### Return type
+
+[**CollateralOrder**](CollateralOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order details queried successfully | - |
+
+
+# **repayCollateralLoan**
+> RepayResp repayCollateralLoan(repayLoan)
+
+Collateral loan repayment
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ RepayLoan repayLoan = new RepayLoan(); // RepayLoan |
+ try {
+ RepayResp result = apiInstance.repayCollateralLoan(repayLoan);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#repayCollateralLoan");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **repayLoan** | [**RepayLoan**](RepayLoan.md)| |
+
+### Return type
+
+[**RepayResp**](RepayResp.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Operation successful | - |
+
+
+# **listRepayRecords**
+> List<RepayRecord> listRepayRecords(source).borrowCurrency(borrowCurrency).collateralCurrency(collateralCurrency).page(page).limit(limit).from(from).to(to).execute();
+
+Query collateral loan repayment records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ String source = "repay"; // String | Operation type: repay - Regular repayment, liquidate - Liquidation
+ String borrowCurrency = "USDT"; // String | Borrowed currency
+ String collateralCurrency = "BTC"; // String | Collateral currency
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Long from = 1609459200L; // Long | Start timestamp for the query
+ Long to = 1609459200L; // Long | End timestamp for the query, defaults to current time if not specified
+ try {
+ List result = apiInstance.listRepayRecords(source)
+ .borrowCurrency(borrowCurrency)
+ .collateralCurrency(collateralCurrency)
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#listRepayRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **source** | **String**| Operation type: repay - Regular repayment, liquidate - Liquidation |
+ **borrowCurrency** | **String**| Borrowed currency | [optional]
+ **collateralCurrency** | **String**| Collateral currency | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+
+### Return type
+
+[**List<RepayRecord>**](RepayRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listCollateralRecords**
+> List<CollateralRecord> listCollateralRecords().page(page).limit(limit).from(from).to(to).borrowCurrency(borrowCurrency).collateralCurrency(collateralCurrency).execute();
+
+Query collateral adjustment records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Long from = 1609459200L; // Long | Start timestamp for the query
+ Long to = 1609459200L; // Long | End timestamp for the query, defaults to current time if not specified
+ String borrowCurrency = "USDT"; // String | Borrowed currency
+ String collateralCurrency = "BTC"; // String | Collateral currency
+ try {
+ List result = apiInstance.listCollateralRecords()
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .borrowCurrency(borrowCurrency)
+ .collateralCurrency(collateralCurrency)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#listCollateralRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **borrowCurrency** | **String**| Borrowed currency | [optional]
+ **collateralCurrency** | **String**| Collateral currency | [optional]
+
+### Return type
+
+[**List<CollateralRecord>**](CollateralRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **operateCollateral**
+> operateCollateral(collateralAlign)
+
+Increase or redeem collateral
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ CollateralAlign collateralAlign = new CollateralAlign(); // CollateralAlign |
+ try {
+ apiInstance.operateCollateral(collateralAlign);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#operateCollateral");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **collateralAlign** | [**CollateralAlign**](CollateralAlign.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Operation successful | - |
+
+
+# **getUserTotalAmount**
+> UserTotalAmount getUserTotalAmount()
+
+Query user's total borrowing and collateral amount
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ try {
+ UserTotalAmount result = apiInstance.getUserTotalAmount();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#getUserTotalAmount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**UserTotalAmount**](UserTotalAmount.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUserLtvInfo**
+> UserLtvInfo getUserLtvInfo(collateralCurrency, borrowCurrency)
+
+Query user's collateralization ratio and remaining borrowable currencies
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ String collateralCurrency = "BTC"; // String | Collateral currency
+ String borrowCurrency = "USDT"; // String | Borrowed currency
+ try {
+ UserLtvInfo result = apiInstance.getUserLtvInfo(collateralCurrency, borrowCurrency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#getUserLtvInfo");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **collateralCurrency** | **String**| Collateral currency |
+ **borrowCurrency** | **String**| Borrowed currency |
+
+### Return type
+
+[**UserLtvInfo**](UserLtvInfo.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listCollateralCurrencies**
+> List<CollateralLoanCurrency> listCollateralCurrencies().loanCurrency(loanCurrency).execute();
+
+Query supported borrowing and collateral currencies
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.CollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient);
+ String loanCurrency = "BTC"; // String | Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency
+ try {
+ List result = apiInstance.listCollateralCurrencies()
+ .loanCurrency(loanCurrency)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CollateralLoanApi#listCollateralCurrencies");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **loanCurrency** | **String**| Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency | [optional]
+
+### Return type
+
+[**List<CollateralLoanCurrency>**](CollateralLoanCurrency.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
diff --git a/docs/CollateralLoanCurrency.md b/docs/CollateralLoanCurrency.md
new file mode 100644
index 0000000..92bdf8a
--- /dev/null
+++ b/docs/CollateralLoanCurrency.md
@@ -0,0 +1,12 @@
+
+# CollateralLoanCurrency
+
+Supported borrowing and collateral currencies
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**loanCurrency** | **String** | Borrowed currency | [optional]
+**collateralCurrency** | **List<String>** | List of supported collateral currencies | [optional]
+
diff --git a/docs/CollateralLtv.md b/docs/CollateralLtv.md
new file mode 100644
index 0000000..7d6af97
--- /dev/null
+++ b/docs/CollateralLtv.md
@@ -0,0 +1,13 @@
+
+# CollateralLtv
+
+Multi-collateral ratio
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**initLtv** | **String** | Initial collateralization rate | [optional]
+**alertLtv** | **String** | Warning collateralization rate | [optional]
+**liquidateLtv** | **String** | Liquidation collateralization rate | [optional]
+
diff --git a/docs/CollateralOrder.md b/docs/CollateralOrder.md
new file mode 100644
index 0000000..19cb8bd
--- /dev/null
+++ b/docs/CollateralOrder.md
@@ -0,0 +1,26 @@
+
+# CollateralOrder
+
+Collateral order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+**collateralCurrency** | **String** | Collateral currency | [optional]
+**collateralAmount** | **String** | Collateral amount | [optional]
+**borrowCurrency** | **String** | Borrowed currency | [optional]
+**borrowAmount** | **String** | Borrowed amount | [optional]
+**repaidAmount** | **String** | Repaid amount | [optional]
+**repaidPrincipal** | **String** | Repaid principal | [optional]
+**repaidInterest** | **String** | Repaid interest | [optional]
+**initLtv** | **String** | Initial collateralization rate | [optional]
+**currentLtv** | **String** | Current collateralization rate | [optional]
+**liquidateLtv** | **String** | Liquidation collateralization rate | [optional]
+**status** | **String** | Order status: - initial: Initial state after placing the order - collateral_deducted: Collateral deduction successful - collateral_returning: Loan failed - Collateral return pending - lent: Loan successful - repaying: Repayment in progress - liquidating: Liquidation in progress - finished: Order completed - closed_liquidated: Liquidation and repayment completed | [optional]
+**borrowTime** | **Long** | Borrowing time, timestamp in seconds | [optional]
+**leftRepayTotal** | **String** | Outstanding principal and interest (outstanding principal + outstanding interest) | [optional]
+**leftRepayPrincipal** | **String** | Outstanding principal | [optional]
+**leftRepayInterest** | **String** | Outstanding interest | [optional]
+
diff --git a/docs/CollateralRecord.md b/docs/CollateralRecord.md
new file mode 100644
index 0000000..da9834c
--- /dev/null
+++ b/docs/CollateralRecord.md
@@ -0,0 +1,20 @@
+
+# CollateralRecord
+
+Collateral record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+**recordId** | **Long** | Collateral record ID | [optional]
+**borrowCurrency** | **String** | Borrowed currency | [optional]
+**borrowAmount** | **String** | Borrowed amount | [optional]
+**collateralCurrency** | **String** | Collateral currency | [optional]
+**beforeCollateral** | **String** | Collateral amount before adjustment | [optional]
+**afterCollateral** | **String** | Collateral amount after adjustment | [optional]
+**beforeLtv** | **String** | Collateral ratio before adjustment | [optional]
+**afterLtv** | **String** | Collateral ratio after adjustment | [optional]
+**operateTime** | **Long** | Operation time, timestamp in seconds | [optional]
+
diff --git a/docs/Contract.md b/docs/Contract.md
index 20aff2c..2b2b400 100644
--- a/docs/Contract.md
+++ b/docs/Contract.md
@@ -1,44 +1,52 @@
# Contract
-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
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | Futures contract | [optional]
-**type** | [**TypeEnum**](#TypeEnum) | Futures contract type | [optional]
+**type** | [**TypeEnum**](#TypeEnum) | Contract type: inverse - inverse contract, direct - direct contract | [optional]
**quantoMultiplier** | **String** | Multiplier used in converting from invoicing to settlement currency | [optional]
**leverageMin** | **String** | Minimum leverage | [optional]
**leverageMax** | **String** | Maximum leverage | [optional]
**maintenanceRate** | **String** | Maintenance rate of margin | [optional]
-**markType** | [**MarkTypeEnum**](#MarkTypeEnum) | Mark price type, internal - based on internal trading, index - based on external index price | [optional]
+**markType** | [**MarkTypeEnum**](#MarkTypeEnum) | Mark price type: internal - internal trading price, index - external index price | [optional]
**markPrice** | **String** | Current mark price | [optional]
**indexPrice** | **String** | Current index price | [optional]
**lastPrice** | **String** | Last trading price | [optional]
-**makerFeeRate** | **String** | Maker fee rate, where negative means rebate | [optional]
+**makerFeeRate** | **String** | Maker fee rate, negative values indicate rebates | [optional]
**takerFeeRate** | **String** | Taker fee rate | [optional]
**orderPriceRound** | **String** | Minimum order price increment | [optional]
**markPriceRound** | **String** | Minimum mark price increment | [optional]
**fundingRate** | **String** | Current funding rate | [optional]
**fundingInterval** | **Integer** | Funding application interval, unit in seconds | [optional]
**fundingNextApply** | **Double** | Next funding time | [optional]
-**riskLimitBase** | **String** | Risk limit base | [optional]
-**riskLimitStep** | **String** | Step of adjusting risk limit | [optional]
-**riskLimitMax** | **String** | Maximum risk limit the contract allowed | [optional]
-**orderSizeMin** | **Long** | Minimum order size the contract allowed | [optional]
-**orderSizeMax** | **Long** | Maximum order size the contract allowed | [optional]
-**orderPriceDeviate** | **String** | deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional]
-**refDiscountRate** | **String** | Referral fee rate discount | [optional]
-**refRebateRate** | **String** | Referrer commission rate | [optional]
-**orderbookId** | **Long** | Current orderbook ID | [optional]
+**riskLimitBase** | **String** | Base risk limit (deprecated) | [optional]
+**riskLimitStep** | **String** | Risk limit adjustment step (deprecated) | [optional]
+**riskLimitMax** | **String** | Maximum risk limit allowed by the contract (deprecated). It is recommended to use /futures/{settle}/risk_limit_tiers to query risk limits | [optional]
+**orderSizeMin** | **Long** | Minimum order size allowed by the contract | [optional]
+**orderSizeMax** | **Long** | Maximum order size allowed by the contract | [optional]
+**orderPriceDeviate** | **String** | Maximum allowed deviation between order price and current mark price. The order price `order_price` must satisfy the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional]
+**refDiscountRate** | **String** | Trading fee discount for referred users | [optional]
+**refRebateRate** | **String** | Commission rate for referrers | [optional]
+**orderbookId** | **Long** | Orderbook update ID | [optional]
**tradeId** | **Long** | Current trade ID | [optional]
-**tradeSize** | **Long** | Historical accumulated trade size | [optional]
+**tradeSize** | **Long** | Historical cumulative trading volume | [optional]
**positionSize** | **Long** | Current total long position size | [optional]
-**configChangeTime** | **Double** | Last changed time of configuration | [optional]
-**inDelisting** | **Boolean** | Contract is delisting | [optional]
-**ordersLimit** | **Integer** | Maximum number of open orders | [optional]
+**configChangeTime** | **Double** | Last configuration update time | [optional]
+**inDelisting** | **Boolean** | `in_delisting=true` and position_size>0 indicates the contract is in delisting transition period `in_delisting=true` and position_size=0 indicates the contract is delisted | [optional]
+**ordersLimit** | **Integer** | Maximum number of pending orders | [optional]
+**enableBonus** | **Boolean** | Whether bonus is enabled | [optional]
+**enableCredit** | **Boolean** | Whether portfolio margin account is enabled | [optional]
+**createTime** | **Double** | Created time of the contract | [optional]
+**fundingCapRatio** | **String** | The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio | [optional]
+**status** | **String** | Contract status types include: prelaunch (pre-launch), trading (active), delisting (delisting), delisted (delisted), circuit_breaker (circuit breaker) | [optional]
+**launchTime** | **Long** | Contract expiry timestamp | [optional]
+**delistingTime** | **Long** | Timestamp when contract enters reduce-only state | [optional]
+**delistedTime** | **Long** | Contract delisting time | [optional]
## Enum: TypeEnum
diff --git a/docs/ContractStat.md b/docs/ContractStat.md
index d8552a1..8bb0eb6 100644
--- a/docs/ContractStat.md
+++ b/docs/ContractStat.md
@@ -6,16 +6,17 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **Long** | Stat timestamp | [optional]
-**lsrTaker** | [**BigDecimal**](BigDecimal.md) | Long/short account number ratio | [optional]
-**lsrAccount** | [**BigDecimal**](BigDecimal.md) | Long/short taker size ratio | [optional]
-**longLiqSize** | **Long** | Long liquidation size | [optional]
-**longLiqAmount** | **Double** | Long liquidation amount(base currency) | [optional]
-**longLiqUsd** | **Double** | Long liquidation volume(quote currency) | [optional]
-**shortLiqSize** | **Long** | Short liquidation size | [optional]
-**shortLiqAmount** | **Double** | Short liquidation amount(base currency) | [optional]
-**shortLiqUsd** | **Double** | Short liquidation volume(quote currency) | [optional]
-**openInterest** | **Long** | Open interest size | [optional]
-**openInterestUsd** | **Double** | Open interest volume(quote currency) | [optional]
+**lsrTaker** | [**BigDecimal**](BigDecimal.md) | Long/short taker ratio | [optional]
+**lsrAccount** | [**BigDecimal**](BigDecimal.md) | Long/short position user ratio | [optional]
+**longLiqSize** | **Long** | Long liquidation size (contracts) | [optional]
+**longLiqAmount** | **Double** | Long liquidation amount (base currency) | [optional]
+**longLiqUsd** | **Double** | Long liquidation volume (quote currency) | [optional]
+**shortLiqSize** | **Long** | Short liquidation size (contracts) | [optional]
+**shortLiqAmount** | **Double** | Short liquidation amount (base currency) | [optional]
+**shortLiqUsd** | **Double** | Short liquidation volume (quote currency) | [optional]
+**openInterest** | **Long** | Total open interest size (contracts) | [optional]
+**openInterestUsd** | **Double** | Total open interest volume (quote currency) | [optional]
**topLsrAccount** | **Double** | Top trader long/short account ratio | [optional]
**topLsrSize** | **Double** | Top trader long/short position ratio | [optional]
+**markPrice** | **Double** | Mark price | [optional]
diff --git a/docs/ConvertSmallBalance.md b/docs/ConvertSmallBalance.md
new file mode 100644
index 0000000..b661716
--- /dev/null
+++ b/docs/ConvertSmallBalance.md
@@ -0,0 +1,12 @@
+
+# ConvertSmallBalance
+
+Small Balance Conversion
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **List<String>** | Currency to be converted | [optional]
+**isAll** | **Boolean** | Whether to convert all | [optional]
+
diff --git a/docs/CountdownCancelAllFuturesTask.md b/docs/CountdownCancelAllFuturesTask.md
new file mode 100644
index 0000000..cf945ef
--- /dev/null
+++ b/docs/CountdownCancelAllFuturesTask.md
@@ -0,0 +1,12 @@
+
+# CountdownCancelAllFuturesTask
+
+Countdown cancel task details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**timeout** | **Integer** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown |
+**contract** | **String** | Futures contract | [optional]
+
diff --git a/docs/CountdownCancelAllOptionsTask.md b/docs/CountdownCancelAllOptionsTask.md
new file mode 100644
index 0000000..58afd19
--- /dev/null
+++ b/docs/CountdownCancelAllOptionsTask.md
@@ -0,0 +1,13 @@
+
+# CountdownCancelAllOptionsTask
+
+Countdown cancel task details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**timeout** | **Integer** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown |
+**contract** | **String** | Options contract name | [optional]
+**underlying** | **String** | Underlying | [optional]
+
diff --git a/docs/CountdownCancelAllSpotTask.md b/docs/CountdownCancelAllSpotTask.md
new file mode 100644
index 0000000..8b8ffc2
--- /dev/null
+++ b/docs/CountdownCancelAllSpotTask.md
@@ -0,0 +1,12 @@
+
+# CountdownCancelAllSpotTask
+
+Countdown cancel task details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**timeout** | **Integer** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown |
+**currencyPair** | **String** | Currency pair | [optional]
+
diff --git a/docs/CreateCollateralOrder.md b/docs/CreateCollateralOrder.md
new file mode 100644
index 0000000..9d28efe
--- /dev/null
+++ b/docs/CreateCollateralOrder.md
@@ -0,0 +1,12 @@
+
+# CreateCollateralOrder
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**collateralAmount** | **String** | Collateral amount |
+**collateralCurrency** | **String** | Collateral currency |
+**borrowAmount** | **String** | Borrowed amount |
+**borrowCurrency** | **String** | Borrowed currency |
+
diff --git a/docs/CreateMultiCollateralOrder.md b/docs/CreateMultiCollateralOrder.md
new file mode 100644
index 0000000..73b75d2
--- /dev/null
+++ b/docs/CreateMultiCollateralOrder.md
@@ -0,0 +1,17 @@
+
+# CreateMultiCollateralOrder
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **String** | Order ID | [optional]
+**orderType** | **String** | current - current rate, fixed - fixed rate, defaults to current if not specified | [optional]
+**fixedType** | **String** | Fixed interest rate lending period: 7d - 7 days, 30d - 30 days. Required for fixed rate | [optional]
+**fixedRate** | **String** | Fixed interest rate, required for fixed rate | [optional]
+**autoRenew** | **Boolean** | Fixed interest rate, auto-renewal | [optional]
+**autoRepay** | **Boolean** | Fixed interest rate, auto-repayment | [optional]
+**borrowCurrency** | **String** | Borrowed currency |
+**borrowAmount** | **String** | Borrowed amount |
+**collateralCurrencies** | [**List<CollateralCurrency>**](CollateralCurrency.md) | Collateral currency and amount | [optional]
+
diff --git a/docs/CreateUniLend.md b/docs/CreateUniLend.md
new file mode 100644
index 0000000..af2ee4a
--- /dev/null
+++ b/docs/CreateUniLend.md
@@ -0,0 +1,21 @@
+
+# CreateUniLend
+
+Create lending or redemption
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name |
+**amount** | **String** | Amount to deposit into lending pool |
+**type** | [**TypeEnum**](#TypeEnum) | Operation type: lend - Lend, redeem - Redeem |
+**minRate** | **String** | Minimum interest rate. If set too high, lending may fail and no interest will be earned. Required for lending operations. | [optional]
+
+## Enum: TypeEnum
+
+Name | Value
+---- | -----
+LEND | "lend"
+REDEEM | "redeem"
+
diff --git a/docs/CreateUniLoan.md b/docs/CreateUniLoan.md
new file mode 100644
index 0000000..350308f
--- /dev/null
+++ b/docs/CreateUniLoan.md
@@ -0,0 +1,22 @@
+
+# CreateUniLoan
+
+Borrow or repay
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency |
+**type** | [**TypeEnum**](#TypeEnum) | Type: `borrow` - borrow, `repay` - repay |
+**amount** | **String** | Borrow or repayment amount |
+**repaidAll** | **Boolean** | Full repayment. For repayment operations only. When `true`, overrides `amount` and repays the full amount | [optional]
+**currencyPair** | **String** | Currency pair |
+
+## Enum: TypeEnum
+
+Name | Value
+---- | -----
+BORROW | "borrow"
+REPAY | "repay"
+
diff --git a/docs/CrossMarginAccount.md b/docs/CrossMarginAccount.md
deleted file mode 100644
index 16c6a5f..0000000
--- a/docs/CrossMarginAccount.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-# CrossMarginAccount
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**userId** | **Long** | User ID | [optional]
-**locked** | **Boolean** | Whether account is locked | [optional]
-**balances** | [**Map<String, CrossMarginBalance>**](CrossMarginBalance.md) | | [optional]
-**total** | **String** | Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` | [optional]
-**borrowed** | **String** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional]
-**interest** | **String** | Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional]
-**risk** | **String** | Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional]
-
diff --git a/docs/CrossMarginAccountBook.md b/docs/CrossMarginAccountBook.md
deleted file mode 100644
index 4c4e572..0000000
--- a/docs/CrossMarginAccountBook.md
+++ /dev/null
@@ -1,28 +0,0 @@
-
-# CrossMarginAccountBook
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **String** | Balance change record ID | [optional]
-**time** | **Long** | The timestamp of the change (in milliseconds) | [optional]
-**currency** | **String** | Currency changed | [optional]
-**change** | **String** | Amount changed. Positive value means transferring in, while negative out | [optional]
-**balance** | **String** | Balance after change | [optional]
-**type** | [**TypeEnum**](#TypeEnum) | Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type | [optional]
-
-## Enum: TypeEnum
-
-Name | Value
----- | -----
-IN | "in"
-OUT | "out"
-REPAY | "repay"
-BORROW | "borrow"
-NEW_ORDER | "new_order"
-ORDER_FILL | "order_fill"
-REFERRAL_FEE | "referral_fee"
-ORDER_FEE | "order_fee"
-UNKNOWN | "unknown"
-
diff --git a/docs/CrossMarginBalance.md b/docs/CrossMarginBalance.md
index 806732e..347d99a 100644
--- a/docs/CrossMarginBalance.md
+++ b/docs/CrossMarginBalance.md
@@ -5,8 +5,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**available** | **String** | Available amount | [optional]
-**freeze** | **String** | Locked amount | [optional]
-**borrowed** | **String** | Borrowed amount | [optional]
-**interest** | **String** | Unpaid interests | [optional]
+**available** | **String** | Available balance | [optional]
+**freeze** | **String** | Locked balance | [optional]
+**borrowed** | **String** | Borrowed balance | [optional]
+**interest** | **String** | Unpaid interest | [optional]
diff --git a/docs/CrossMarginCurrency.md b/docs/CrossMarginCurrency.md
deleted file mode 100644
index 77fdbd7..0000000
--- a/docs/CrossMarginCurrency.md
+++ /dev/null
@@ -1,16 +0,0 @@
-
-# CrossMarginCurrency
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **String** | Currency name | [optional]
-**rate** | **String** | Loan rate | [optional]
-**prec** | **String** | Currency precision | [optional]
-**discount** | **String** | Currency value discount, which is used in total value calculation | [optional]
-**minBorrowAmount** | **String** | Minimum currency borrow amount. Unit is currency itself | [optional]
-**userMaxBorrowAmount** | **String** | Maximum borrow value allowed per user, in USDT | [optional]
-**totalMaxBorrowAmount** | **String** | Maximum borrow value allowed for this currency, in USDT | [optional]
-**price** | **String** | Price change between this currency and USDT | [optional]
-
diff --git a/docs/CrossMarginLoan.md b/docs/CrossMarginLoan.md
index e7484f3..3572614 100644
--- a/docs/CrossMarginLoan.md
+++ b/docs/CrossMarginLoan.md
@@ -5,16 +5,16 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **String** | Borrow loan ID | [optional] [readonly]
+**id** | **String** | Loan record ID | [optional] [readonly]
**createTime** | **Long** | Creation timestamp, in milliseconds | [optional] [readonly]
**updateTime** | **Long** | Update timestamp, in milliseconds | [optional] [readonly]
**currency** | **String** | Currency name |
**amount** | **String** | Borrowed amount |
**text** | **String** | User defined custom ID | [optional]
-**status** | [**StatusEnum**](#StatusEnum) | Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete | [optional] [readonly]
+**status** | [**StatusEnum**](#StatusEnum) | Deprecated. Currently, all statuses have been set to 2. Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete | [optional] [readonly]
**repaid** | **String** | Repaid amount | [optional] [readonly]
**repaidInterest** | **String** | Repaid interest | [optional] [readonly]
-**unpaidInterest** | **String** | Outstanding interest yet to be paid | [optional] [readonly]
+**unpaidInterest** | **String** | Unpaid interest | [optional] [readonly]
## Enum: StatusEnum
diff --git a/docs/CrossMarginRepayRequest.md b/docs/CrossMarginRepayRequest.md
deleted file mode 100644
index 2e847b3..0000000
--- a/docs/CrossMarginRepayRequest.md
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# CrossMarginRepayRequest
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**currency** | **String** | Repayment currency |
-**amount** | **String** | Repayment amount |
-
diff --git a/docs/CrossMarginRepayment.md b/docs/CrossMarginRepayment.md
index f9c3396..04c92f9 100644
--- a/docs/CrossMarginRepayment.md
+++ b/docs/CrossMarginRepayment.md
@@ -7,8 +7,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | Loan record ID | [optional]
**createTime** | **Long** | Repayment time | [optional]
-**loanId** | **String** | Borrow loan ID | [optional]
+**loanId** | **String** | Loan record ID | [optional]
**currency** | **String** | Currency name | [optional]
**principal** | **String** | Repaid principal | [optional]
**interest** | **String** | Repaid interest | [optional]
+**repaymentType** | **String** | Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment after cancellation | [optional] [readonly]
diff --git a/docs/Currency.md b/docs/Currency.md
index b045778..0f1d258 100644
--- a/docs/Currency.md
+++ b/docs/Currency.md
@@ -5,10 +5,14 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**currency** | **String** | Currency name | [optional]
+**currency** | **String** | Currency symbol | [optional]
+**name** | **String** | Currency name | [optional]
**delisted** | **Boolean** | Whether currency is de-listed | [optional]
-**withdrawDisabled** | **Boolean** | Whether currency's withdrawal is disabled | [optional]
-**withdrawDelayed** | **Boolean** | Whether currency's withdrawal is delayed | [optional]
-**depositDisabled** | **Boolean** | Whether currency's deposit is disabled | [optional]
+**withdrawDisabled** | **Boolean** | Whether currency's withdrawal is disabled (deprecated) | [optional]
+**withdrawDelayed** | **Boolean** | Whether currency's withdrawal is delayed (deprecated) | [optional]
+**depositDisabled** | **Boolean** | Whether currency's deposit is disabled (deprecated) | [optional]
**tradeDisabled** | **Boolean** | Whether currency's trading is disabled | [optional]
+**fixedRate** | **String** | Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies | [optional]
+**chain** | **String** | The main chain corresponding to the coin | [optional]
+**chains** | [**List<SpotCurrencyChain>**](SpotCurrencyChain.md) | All links corresponding to coins | [optional]
diff --git a/docs/CurrencyChain.md b/docs/CurrencyChain.md
new file mode 100644
index 0000000..ff36e70
--- /dev/null
+++ b/docs/CurrencyChain.md
@@ -0,0 +1,16 @@
+
+# CurrencyChain
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**chain** | **String** | Chain name | [optional]
+**nameCn** | **String** | Chain name in Chinese | [optional]
+**nameEn** | **String** | Chain name in English | [optional]
+**contractAddress** | **String** | Smart contract address for the currency; if no address is available, it will be an empty string | [optional]
+**isDisabled** | **Integer** | If it is disabled. 0 means NOT being disabled | [optional]
+**isDepositDisabled** | **Integer** | Is deposit disabled. 0 means not disabled | [optional]
+**isWithdrawDisabled** | **Integer** | Is withdrawal disabled. 0 means not disabled | [optional]
+**decimal** | **String** | Withdrawal precision | [optional]
+
diff --git a/docs/CurrencyPair.md b/docs/CurrencyPair.md
index 1191e1f..1295908 100644
--- a/docs/CurrencyPair.md
+++ b/docs/CurrencyPair.md
@@ -9,15 +9,23 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | Currency pair | [optional]
**base** | **String** | Base currency | [optional]
+**baseName** | **String** | Base currency name | [optional]
**quote** | **String** | Quote currency | [optional]
-**fee** | **String** | Trading fee | [optional]
+**quoteName** | **String** | Quote currency name | [optional]
+**fee** | **String** | Trading fee rate | [optional]
**minBaseAmount** | **String** | Minimum amount of base currency to trade, `null` means no limit | [optional]
**minQuoteAmount** | **String** | Minimum amount of quote currency to trade, `null` means no limit | [optional]
+**maxBaseAmount** | **String** | Maximum amount of base currency to trade, `null` means no limit | [optional]
+**maxQuoteAmount** | **String** | Maximum amount of quote currency to trade, `null` means no limit | [optional]
**amountPrecision** | **Integer** | Amount scale | [optional]
**precision** | **Integer** | Price scale | [optional]
-**tradeStatus** | [**TradeStatusEnum**](#TradeStatusEnum) | How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold | [optional]
+**tradeStatus** | [**TradeStatusEnum**](#TradeStatusEnum) | Trading status - untradable: cannot be traded - buyable: can be bought - sellable: can be sold - tradable: can be bought and sold | [optional]
**sellStart** | **Long** | Sell start unix timestamp in seconds | [optional]
**buyStart** | **Long** | Buy start unix timestamp in seconds | [optional]
+**delistingTime** | **Long** | Expected time to remove the shelves, Unix timestamp in seconds | [optional]
+**type** | **String** | Trading pair type, normal: normal, premarket: pre-market | [optional]
+**tradeUrl** | **String** | Transaction link | [optional]
+**stTag** | **Boolean** | Whether the trading pair is in ST risk assessment, false - No, true - Yes | [optional]
## Enum: TradeStatusEnum
diff --git a/docs/CurrencyQuota.md b/docs/CurrencyQuota.md
new file mode 100644
index 0000000..93926c2
--- /dev/null
+++ b/docs/CurrencyQuota.md
@@ -0,0 +1,15 @@
+
+# CurrencyQuota
+
+Currency Quota
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**minQuota** | **String** | Minimum borrowing/collateral limit for the currency | [optional]
+**leftQuota** | **String** | Remaining borrowing/collateral quota for the currency | [optional]
+**leftQuoteUsdt** | **String** | Remaining currency limit converted to USDT | [optional]
+
diff --git a/docs/DebitFee.md b/docs/DebitFee.md
new file mode 100644
index 0000000..1a736a8
--- /dev/null
+++ b/docs/DebitFee.md
@@ -0,0 +1,9 @@
+
+# DebitFee
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enabled** | **Boolean** | Whether GT fee deduction is enabled |
+
diff --git a/docs/DeliveryApi.md b/docs/DeliveryApi.md
index f4e9e50..21bb9c4 100644
--- a/docs/DeliveryApi.md
+++ b/docs/DeliveryApi.md
@@ -4,41 +4,42 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
Method | HTTP request | Description
------------- | ------------- | -------------
-[**listDeliveryContracts**](DeliveryApi.md#listDeliveryContracts) | **GET** /delivery/{settle}/contracts | List all futures contracts
-[**getDeliveryContract**](DeliveryApi.md#getDeliveryContract) | **GET** /delivery/{settle}/contracts/{contract} | Get a single contract
-[**listDeliveryOrderBook**](DeliveryApi.md#listDeliveryOrderBook) | **GET** /delivery/{settle}/order_book | Futures order book
-[**listDeliveryTrades**](DeliveryApi.md#listDeliveryTrades) | **GET** /delivery/{settle}/trades | Futures trading history
-[**listDeliveryCandlesticks**](DeliveryApi.md#listDeliveryCandlesticks) | **GET** /delivery/{settle}/candlesticks | Get futures candlesticks
-[**listDeliveryTickers**](DeliveryApi.md#listDeliveryTickers) | **GET** /delivery/{settle}/tickers | List futures tickers
-[**listDeliveryInsuranceLedger**](DeliveryApi.md#listDeliveryInsuranceLedger) | **GET** /delivery/{settle}/insurance | Futures insurance balance history
-[**listDeliveryAccounts**](DeliveryApi.md#listDeliveryAccounts) | **GET** /delivery/{settle}/accounts | Query futures account
-[**listDeliveryAccountBook**](DeliveryApi.md#listDeliveryAccountBook) | **GET** /delivery/{settle}/account_book | Query account book
-[**listDeliveryPositions**](DeliveryApi.md#listDeliveryPositions) | **GET** /delivery/{settle}/positions | List all positions of a user
-[**getDeliveryPosition**](DeliveryApi.md#getDeliveryPosition) | **GET** /delivery/{settle}/positions/{contract} | Get single position
+[**listDeliveryContracts**](DeliveryApi.md#listDeliveryContracts) | **GET** /delivery/{settle}/contracts | Query all futures contracts
+[**getDeliveryContract**](DeliveryApi.md#getDeliveryContract) | **GET** /delivery/{settle}/contracts/{contract} | Query single contract information
+[**listDeliveryOrderBook**](DeliveryApi.md#listDeliveryOrderBook) | **GET** /delivery/{settle}/order_book | Query futures market depth information
+[**listDeliveryTrades**](DeliveryApi.md#listDeliveryTrades) | **GET** /delivery/{settle}/trades | Futures market transaction records
+[**listDeliveryCandlesticks**](DeliveryApi.md#listDeliveryCandlesticks) | **GET** /delivery/{settle}/candlesticks | Futures market K-line chart
+[**listDeliveryTickers**](DeliveryApi.md#listDeliveryTickers) | **GET** /delivery/{settle}/tickers | Get all futures trading statistics
+[**listDeliveryInsuranceLedger**](DeliveryApi.md#listDeliveryInsuranceLedger) | **GET** /delivery/{settle}/insurance | Futures market insurance fund history
+[**listDeliveryAccounts**](DeliveryApi.md#listDeliveryAccounts) | **GET** /delivery/{settle}/accounts | Get futures account
+[**listDeliveryAccountBook**](DeliveryApi.md#listDeliveryAccountBook) | **GET** /delivery/{settle}/account_book | Query futures account change history
+[**listDeliveryPositions**](DeliveryApi.md#listDeliveryPositions) | **GET** /delivery/{settle}/positions | Get user position list
+[**getDeliveryPosition**](DeliveryApi.md#getDeliveryPosition) | **GET** /delivery/{settle}/positions/{contract} | Get single position information
[**updateDeliveryPositionMargin**](DeliveryApi.md#updateDeliveryPositionMargin) | **POST** /delivery/{settle}/positions/{contract}/margin | Update position margin
[**updateDeliveryPositionLeverage**](DeliveryApi.md#updateDeliveryPositionLeverage) | **POST** /delivery/{settle}/positions/{contract}/leverage | Update position leverage
[**updateDeliveryPositionRiskLimit**](DeliveryApi.md#updateDeliveryPositionRiskLimit) | **POST** /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit
-[**listDeliveryOrders**](DeliveryApi.md#listDeliveryOrders) | **GET** /delivery/{settle}/orders | List futures orders
-[**createDeliveryOrder**](DeliveryApi.md#createDeliveryOrder) | **POST** /delivery/{settle}/orders | Create a futures order
-[**cancelDeliveryOrders**](DeliveryApi.md#cancelDeliveryOrders) | **DELETE** /delivery/{settle}/orders | Cancel all `open` orders matched
-[**getDeliveryOrder**](DeliveryApi.md#getDeliveryOrder) | **GET** /delivery/{settle}/orders/{order_id} | Get a single order
-[**cancelDeliveryOrder**](DeliveryApi.md#cancelDeliveryOrder) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel a single order
-[**getMyDeliveryTrades**](DeliveryApi.md#getMyDeliveryTrades) | **GET** /delivery/{settle}/my_trades | List personal trading history
-[**listDeliveryPositionClose**](DeliveryApi.md#listDeliveryPositionClose) | **GET** /delivery/{settle}/position_close | List position close history
-[**listDeliveryLiquidates**](DeliveryApi.md#listDeliveryLiquidates) | **GET** /delivery/{settle}/liquidates | List liquidation history
-[**listDeliverySettlements**](DeliveryApi.md#listDeliverySettlements) | **GET** /delivery/{settle}/settlements | List settlement history
-[**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
-[**cancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order
+[**listDeliveryOrders**](DeliveryApi.md#listDeliveryOrders) | **GET** /delivery/{settle}/orders | Query futures order list
+[**createDeliveryOrder**](DeliveryApi.md#createDeliveryOrder) | **POST** /delivery/{settle}/orders | Place futures order
+[**cancelDeliveryOrders**](DeliveryApi.md#cancelDeliveryOrders) | **DELETE** /delivery/{settle}/orders | Cancel all orders with 'open' status
+[**getDeliveryOrder**](DeliveryApi.md#getDeliveryOrder) | **GET** /delivery/{settle}/orders/{order_id} | Query single order details
+[**cancelDeliveryOrder**](DeliveryApi.md#cancelDeliveryOrder) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel single order
+[**getMyDeliveryTrades**](DeliveryApi.md#getMyDeliveryTrades) | **GET** /delivery/{settle}/my_trades | Query personal trading records
+[**listDeliveryPositionClose**](DeliveryApi.md#listDeliveryPositionClose) | **GET** /delivery/{settle}/position_close | Query position close history
+[**listDeliveryLiquidates**](DeliveryApi.md#listDeliveryLiquidates) | **GET** /delivery/{settle}/liquidates | Query liquidation history
+[**listDeliverySettlements**](DeliveryApi.md#listDeliverySettlements) | **GET** /delivery/{settle}/settlements | Query settlement records
+[**listDeliveryRiskLimitTiers**](DeliveryApi.md#listDeliveryRiskLimitTiers) | **GET** /delivery/{settle}/risk_limit_tiers | Query risk limit tiers
+[**listPriceTriggeredDeliveryOrders**](DeliveryApi.md#listPriceTriggeredDeliveryOrders) | **GET** /delivery/{settle}/price_orders | Query auto order list
+[**createPriceTriggeredDeliveryOrder**](DeliveryApi.md#createPriceTriggeredDeliveryOrder) | **POST** /delivery/{settle}/price_orders | Create price-triggered order
+[**cancelPriceTriggeredDeliveryOrderList**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrderList) | **DELETE** /delivery/{settle}/price_orders | Cancel all auto orders
+[**getPriceTriggeredDeliveryOrder**](DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Query single auto order details
+[**cancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel single auto order
# **listDeliveryContracts**
> List<DeliveryContract> listDeliveryContracts(settle)
-List all futures contracts
+Query all futures contracts
### Example
@@ -78,7 +79,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
### Return type
@@ -96,13 +97,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **getDeliveryContract**
> DeliveryContract getDeliveryContract(settle, contract)
-Get a single contract
+Query single contract information
### Example
@@ -143,7 +144,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
### Return type
@@ -168,7 +169,7 @@ No authorization required
# **listDeliveryOrderBook**
> FuturesOrderBook listDeliveryOrderBook(settle, contract).interval(interval).limit(limit).withId(withId).execute();
-Futures order book
+Query futures market depth information
Bids will be sorted by price from high to low, while asks sorted reversely
@@ -191,9 +192,9 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
- String interval = "0"; // String | Order depth. 0 means no aggregation is applied. default to 0
- Integer limit = 10; // Integer | Maximum number of order depth data in asks or bids
- Boolean withId = false; // Boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update
+ String interval = "0"; // String | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified
+ Integer limit = 10; // Integer | Number of depth levels
+ Boolean withId = false; // Boolean | Whether to return depth update ID. This ID increments by 1 each time depth changes
try {
FuturesOrderBook result = apiInstance.listDeliveryOrderBook(settle, contract)
.interval(interval)
@@ -218,11 +219,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
- **interval** | **String**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to 0] [enum: 0, 0.1, 0.01]
- **limit** | **Integer**| 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 false]
+ **interval** | **String**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to 0] [enum: 0, 0.1, 0.01]
+ **limit** | **Integer**| Number of depth levels | [optional] [default to 10]
+ **withId** | **Boolean**| Whether to return depth update ID. This ID increments by 1 each time depth changes | [optional] [default to false]
### Return type
@@ -240,13 +241,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Order book retrieved | - |
+**200** | Depth query successful | - |
# **listDeliveryTrades**
> List<FuturesTrade> listDeliveryTrades(settle, contract).limit(limit).lastId(lastId).from(from).to(to).execute();
-Futures trading history
+Futures market transaction records
### Example
@@ -267,10 +268,10 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- String 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
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ String lastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang
Long from = 1546905600L; // Long | 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.
- Long to = 1546935600L; // Long | Specify end time in Unix seconds, default to current time
+ Long to = 1546935600L; // Long | Specify end time in Unix seconds, default to current time.
try {
List result = apiInstance.listDeliveryTrades(settle, contract)
.limit(limit)
@@ -296,12 +297,12 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **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]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **lastId** | **String**| Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang | [optional]
**from** | **Long**| 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]
- **to** | **Long**| Specify end time in Unix seconds, default to current time | [optional]
+ **to** | **Long**| Specify end time in Unix seconds, default to current time. | [optional]
### Return type
@@ -319,13 +320,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listDeliveryCandlesticks**
-> List<FuturesCandlestick> listDeliveryCandlesticks(settle, contract).from(from).to(to).limit(limit).interval(interval).execute();
+> List<DeliveryCandlestick> listDeliveryCandlesticks(settle, contract).from(from).to(to).limit(limit).interval(interval).execute();
-Get futures candlesticks
+Futures market K-line chart
Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval`
@@ -349,11 +350,11 @@ public class Example {
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Long from = 1546905600L; // Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
- Long to = 1546935600L; // Long | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
- Integer limit = 100; // Integer | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
- String interval = "5m"; // String | Interval time between data points
+ Long to = 1546935600L; // Long | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision
+ Integer limit = 100; // Integer | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
+ String interval = "5m"; // String | Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time
try {
- List result = apiInstance.listDeliveryCandlesticks(settle, contract)
+ List result = apiInstance.listDeliveryCandlesticks(settle, contract)
.from(from)
.to(to)
.limit(limit)
@@ -377,16 +378,16 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
**from** | **Long**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional]
- **to** | **Long**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional]
- **limit** | **Integer**| 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** | **String**| Interval time between data points | [optional] [default to 5m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d]
+ **to** | **Long**| Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision | [optional]
+ **limit** | **Integer**| Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100]
+ **interval** | **String**| Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time | [optional] [default to 5m] [enum: 10s, 30s, 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 7d, 1w, 30d]
### Return type
-[**List<FuturesCandlestick>**](FuturesCandlestick.md)
+[**List<DeliveryCandlestick>**](DeliveryCandlestick.md)
### Authorization
@@ -400,13 +401,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listDeliveryTickers**
-> List<FuturesTicker> listDeliveryTickers(settle).contract(contract).execute();
+> List<DeliveryTicker> listDeliveryTickers(settle).contract(contract).execute();
-List futures tickers
+Get all futures trading statistics
### Example
@@ -428,7 +429,7 @@ public class Example {
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
try {
- List result = apiInstance.listDeliveryTickers(settle)
+ List result = apiInstance.listDeliveryTickers(settle)
.contract(contract)
.execute();
System.out.println(result);
@@ -449,12 +450,12 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract | [optional]
### Return type
-[**List<FuturesTicker>**](FuturesTicker.md)
+[**List<DeliveryTicker>**](DeliveryTicker.md)
### Authorization
@@ -468,13 +469,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listDeliveryInsuranceLedger**
> List<InsuranceRecord> listDeliveryInsuranceLedger(settle).limit(limit).execute();
-Futures insurance balance history
+Futures market insurance fund history
### Example
@@ -494,7 +495,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
try {
List result = apiInstance.listDeliveryInsuranceLedger(settle)
.limit(limit)
@@ -517,8 +518,8 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **settle** | **String**| Settle currency | [enum: usdt]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
### Return type
@@ -536,13 +537,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listDeliveryAccounts**
> FuturesAccount listDeliveryAccounts(settle)
-Query futures account
+Get futures account
### Example
@@ -586,7 +587,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
### Return type
@@ -604,13 +605,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listDeliveryAccountBook**
> List<FuturesAccountBook> listDeliveryAccountBook(settle).limit(limit).from(from).to(to).type(type).execute();
-Query account book
+Query futures account change history
### Example
@@ -634,10 +635,10 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Long from = 1547706332L; // Long | Start timestamp
- Long to = 1547706332L; // Long | End timestamp
- String type = "dnw"; // String | 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
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ String type = "dnw"; // String | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates
try {
List result = apiInstance.listDeliveryAccountBook(settle)
.limit(limit)
@@ -663,11 +664,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **from** | **Long**| Start timestamp | [optional]
- **to** | **Long**| End timestamp | [optional]
- **type** | **String**| 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 | [optional] [enum: dnw, pnl, fee, refr, fund, point_dnw, point_fee, point_refr]
+ **settle** | **String**| Settle currency | [enum: usdt]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **type** | **String**| Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates | [optional] [enum: dnw, pnl, fee, refr, fund, point_dnw, point_fee, point_refr]
### Return type
@@ -685,13 +686,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listDeliveryPositions**
> List<Position> listDeliveryPositions(settle)
-List all positions of a user
+Get user position list
### Example
@@ -735,7 +736,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
### Return type
@@ -753,13 +754,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **getDeliveryPosition**
> Position getDeliveryPosition(settle, contract)
-Get single position
+Get single position information
### Example
@@ -804,7 +805,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
### Return type
@@ -854,7 +855,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
- String change = "0.01"; // String | Margin change. Use positive number to increase margin, negative number otherwise.
+ String change = "0.01"; // String | Margin change amount, positive number increases, negative number decreases
try {
Position result = apiInstance.updateDeliveryPositionMargin(settle, contract, change);
System.out.println(result);
@@ -875,9 +876,9 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
- **change** | **String**| Margin change. Use positive number to increase margin, negative number otherwise. |
+ **change** | **String**| Margin change amount, positive number increases, negative number decreases |
### Return type
@@ -947,7 +948,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
**leverage** | **String**| New position leverage |
@@ -1019,7 +1020,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
**riskLimit** | **String**| New position risk limit |
@@ -1045,9 +1046,9 @@ Name | Type | Description | Notes
# **listDeliveryOrders**
> List<FuturesOrder> listDeliveryOrders(settle, status).contract(contract).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
-List futures orders
+Query futures order list
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Zero-fill orders cannot be retrieved 10 minutes after order cancellation
### Example
@@ -1071,12 +1072,12 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String status = "open"; // String | Only list the orders with this status
+ String status = "open"; // String | Query order list based on status
String contract = "BTC_USDT_20200814"; // String | Futures contract
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
- String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
- Integer countTotal = 0; // Integer | Whether to return total number matched. Default to 0(no return)
+ String lastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used
+ Integer countTotal = 0; // Integer | Whether to return total number matched, defaults to 0 (no return)
try {
List result = apiInstance.listDeliveryOrders(settle, status)
.contract(contract)
@@ -1103,13 +1104,13 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
- **status** | **String**| Only list the orders with this status | [enum: open, finished]
+ **settle** | **String**| Settle currency | [enum: usdt]
+ **status** | **String**| Query order list based on status | [enum: open, finished]
**contract** | **String**| Futures contract | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| 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]
- **countTotal** | **Integer**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] [enum: 0, 1]
+ **lastId** | **String**| Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional]
+ **countTotal** | **Integer**| Whether to return total number matched, defaults to 0 (no return) | [optional] [default to 0] [enum: 0, 1]
### Return type
@@ -1127,15 +1128,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
|
+**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
* X-Pagination-Total - Total number matched, only returned if `count_total` is set to 1
|
# **createDeliveryOrder**
> FuturesOrder createDeliveryOrder(settle, futuresOrder)
-Create a futures order
+Place futures order
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Zero-fill orders cannot be retrieved 10 minutes after order cancellation
### Example
@@ -1180,7 +1181,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**futuresOrder** | [**FuturesOrder**](FuturesOrder.md)| |
### Return type
@@ -1205,9 +1206,9 @@ Name | Type | Description | Notes
# **cancelDeliveryOrders**
> List<FuturesOrder> cancelDeliveryOrders(settle, contract, side)
-Cancel all `open` orders matched
+Cancel all orders with 'open' status
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Zero-fill orders cannot be retrieved 10 minutes after order cancellation
### Example
@@ -1232,7 +1233,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
- String side = "ask"; // String | All bids or asks. Both included if not specified
+ String side = "ask"; // String | Specify all bids or all asks, both included if not specified
try {
List result = apiInstance.cancelDeliveryOrders(settle, contract, side);
System.out.println(result);
@@ -1253,9 +1254,9 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract |
- **side** | **String**| All bids or asks. Both included if not specified | [optional] [enum: ask, bid]
+ **side** | **String**| Specify all bids or all asks, both included if not specified | [optional] [enum: ask, bid]
### Return type
@@ -1273,15 +1274,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | All orders matched cancelled | - |
+**200** | Batch cancellation successful | - |
# **getDeliveryOrder**
> FuturesOrder getDeliveryOrder(settle, orderId)
-Get a single order
+Query single order details
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Zero-fill orders cannot be retrieved 10 minutes after order cancellation
### Example
@@ -1305,7 +1306,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String orderId = "12345"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "12345"; // String | ID returned when order is successfully created
try {
FuturesOrder result = apiInstance.getDeliveryOrder(settle, orderId);
System.out.println(result);
@@ -1326,8 +1327,8 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **settle** | **String**| Settle currency | [enum: usdt]
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -1351,7 +1352,7 @@ Name | Type | Description | Notes
# **cancelDeliveryOrder**
> FuturesOrder cancelDeliveryOrder(settle, orderId)
-Cancel a single order
+Cancel single order
### Example
@@ -1375,7 +1376,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String orderId = "12345"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "12345"; // String | ID returned when order is successfully created
try {
FuturesOrder result = apiInstance.cancelDeliveryOrder(settle, orderId);
System.out.println(result);
@@ -1396,8 +1397,8 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **settle** | **String**| Settle currency | [enum: usdt]
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -1421,7 +1422,7 @@ Name | Type | Description | Notes
# **getMyDeliveryTrades**
> List<MyFuturesTrade> getMyDeliveryTrades(settle).contract(contract).order(order).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
-List personal trading history
+Query personal trading records
### Example
@@ -1447,10 +1448,10 @@ public class Example {
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Long order = 12345L; // Long | Futures order ID, return related data only if specified
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
- String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
- Integer countTotal = 0; // Integer | Whether to return total number matched. Default to 0(no return)
+ String lastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used
+ Integer countTotal = 0; // Integer | Whether to return total number matched, defaults to 0 (no return)
try {
List result = apiInstance.getMyDeliveryTrades(settle)
.contract(contract)
@@ -1478,13 +1479,13 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract | [optional]
**order** | **Long**| Futures order ID, return related data only if specified | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| 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]
- **countTotal** | **Integer**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] [enum: 0, 1]
+ **lastId** | **String**| Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional]
+ **countTotal** | **Integer**| Whether to return total number matched, defaults to 0 (no return) | [optional] [default to 0] [enum: 0, 1]
### Return type
@@ -1502,13 +1503,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
|
+**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
* X-Pagination-Total - Total number matched, only returned if `count_total` is set to 1
|
# **listDeliveryPositionClose**
> List<PositionClose> listDeliveryPositionClose(settle).contract(contract).limit(limit).execute();
-List position close history
+Query position close history
### Example
@@ -1533,7 +1534,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
try {
List result = apiInstance.listDeliveryPositionClose(settle)
.contract(contract)
@@ -1557,9 +1558,9 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
### Return type
@@ -1577,13 +1578,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listDeliveryLiquidates**
> List<FuturesLiquidate> listDeliveryLiquidates(settle).contract(contract).limit(limit).at(at).execute();
-List liquidation history
+Query liquidation history
### Example
@@ -1608,8 +1609,8 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Integer at = 0; // Integer | Specify a liquidation timestamp
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer at = 0; // Integer | Specify liquidation timestamp
try {
List result = apiInstance.listDeliveryLiquidates(settle)
.contract(contract)
@@ -1634,10 +1635,10 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **at** | **Integer**| Specify a liquidation timestamp | [optional] [default to 0]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **at** | **Integer**| Specify liquidation timestamp | [optional] [default to 0]
### Return type
@@ -1655,13 +1656,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listDeliverySettlements**
> List<DeliverySettlement> listDeliverySettlements(settle).contract(contract).limit(limit).at(at).execute();
-List settlement history
+Query settlement records
### Example
@@ -1686,8 +1687,8 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Integer at = 0; // Integer | Specify a settlement timestamp
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer at = 0; // Integer | Specify settlement timestamp
try {
List result = apiInstance.listDeliverySettlements(settle)
.contract(contract)
@@ -1712,10 +1713,10 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **settle** | **String**| Settle currency | [enum: usdt]
**contract** | **String**| Futures contract | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **at** | **Integer**| Specify a settlement timestamp | [optional] [default to 0]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **at** | **Integer**| Specify settlement timestamp | [optional] [default to 0]
### Return type
@@ -1733,13 +1734,89 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
+
+
+# **listDeliveryRiskLimitTiers**
+> List<FuturesLimitRiskTiers> listDeliveryRiskLimitTiers(settle).contract(contract).limit(limit).offset(offset).execute();
+
+Query risk limit tiers
+
+When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.DeliveryApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ DeliveryApi apiInstance = new DeliveryApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT_20200814"; // String | Futures contract
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ try {
+ List result = apiInstance.listDeliveryRiskLimitTiers(settle)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DeliveryApi#listDeliveryRiskLimitTiers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: usdt]
+ **contract** | **String**| Futures contract | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+
+### Return type
+
+[**List<FuturesLimitRiskTiers>**](FuturesLimitRiskTiers.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
# **listPriceTriggeredDeliveryOrders**
> List<FuturesPriceTriggeredOrder> listPriceTriggeredDeliveryOrders(settle, status).contract(contract).limit(limit).offset(offset).execute();
-List all auto orders
+Query auto order list
### Example
@@ -1763,9 +1840,9 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String status = "status_example"; // String | Only list the orders with this status
+ String status = "status_example"; // String | Query order list based on status
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
try {
List result = apiInstance.listPriceTriggeredDeliveryOrders(settle, status)
@@ -1792,9 +1869,9 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: usdt]
- **status** | **String**| Only list the orders with this status | [enum: open, finished]
+ **status** | **String**| Query order list based on status | [enum: open, finished]
**contract** | **String**| Futures contract, return related data only if specified | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
@@ -1813,13 +1890,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **createPriceTriggeredDeliveryOrder**
> TriggerOrderResponse createPriceTriggeredDeliveryOrder(settle, futuresPriceTriggeredOrder)
-Create a price-triggered order
+Create price-triggered order
### Example
@@ -1883,13 +1960,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**201** | Order created | - |
+**201** | Order created successfully | - |
# **cancelPriceTriggeredDeliveryOrderList**
> List<FuturesPriceTriggeredOrder> cancelPriceTriggeredDeliveryOrderList(settle, contract)
-Cancel all open orders
+Cancel all auto orders
### Example
@@ -1953,13 +2030,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Batch cancellation request accepted. Query order status by listing orders | - |
+**200** | Batch cancellation request accepted and processed, success determined by order list | - |
# **getPriceTriggeredDeliveryOrder**
> FuturesPriceTriggeredOrder getPriceTriggeredDeliveryOrder(settle, orderId)
-Get a single order
+Query single auto order details
### Example
@@ -1983,7 +2060,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "orderId_example"; // String | ID returned when order is successfully created
try {
FuturesPriceTriggeredOrder result = apiInstance.getPriceTriggeredDeliveryOrder(settle, orderId);
System.out.println(result);
@@ -2005,7 +2082,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: usdt]
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -2023,13 +2100,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Auto order detail | - |
+**200** | Auto order details | - |
# **cancelPriceTriggeredDeliveryOrder**
> FuturesPriceTriggeredOrder cancelPriceTriggeredDeliveryOrder(settle, orderId)
-Cancel a single order
+Cancel single auto order
### Example
@@ -2053,7 +2130,7 @@ public class Example {
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "orderId_example"; // String | ID returned when order is successfully created
try {
FuturesPriceTriggeredOrder result = apiInstance.cancelPriceTriggeredDeliveryOrder(settle, orderId);
System.out.println(result);
@@ -2075,7 +2152,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: usdt]
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -2093,5 +2170,5 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Auto order detail | - |
+**200** | Auto order details | - |
diff --git a/docs/DeliveryCandlestick.md b/docs/DeliveryCandlestick.md
new file mode 100644
index 0000000..9544efc
--- /dev/null
+++ b/docs/DeliveryCandlestick.md
@@ -0,0 +1,16 @@
+
+# DeliveryCandlestick
+
+data point in every timestamp
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**t** | **Double** | Unix timestamp in seconds | [optional]
+**v** | **Long** | size volume (contract size). Only returned if `contract` is not prefixed | [optional]
+**c** | **String** | Close price (quote currency) | [optional]
+**h** | **String** | Highest price (quote currency) | [optional]
+**l** | **String** | Lowest price (quote currency) | [optional]
+**o** | **String** | Open price (quote currency) | [optional]
+
diff --git a/docs/DeliveryContract.md b/docs/DeliveryContract.md
index e61232d..de254b3 100644
--- a/docs/DeliveryContract.md
+++ b/docs/DeliveryContract.md
@@ -10,16 +10,16 @@ Name | Type | Description | Notes
**name** | **String** | Futures contract | [optional]
**underlying** | **String** | Underlying | [optional]
**cycle** | [**CycleEnum**](#CycleEnum) | Cycle type, e.g. WEEKLY, QUARTERLY | [optional]
-**type** | [**TypeEnum**](#TypeEnum) | Futures contract type | [optional]
+**type** | [**TypeEnum**](#TypeEnum) | Contract type: inverse - inverse contract, direct - direct contract | [optional]
**quantoMultiplier** | **String** | Multiplier used in converting from invoicing to settlement currency | [optional]
**leverageMin** | **String** | Minimum leverage | [optional]
**leverageMax** | **String** | Maximum leverage | [optional]
**maintenanceRate** | **String** | Maintenance rate of margin | [optional]
-**markType** | [**MarkTypeEnum**](#MarkTypeEnum) | Mark price type, internal - based on internal trading, index - based on external index price | [optional]
+**markType** | [**MarkTypeEnum**](#MarkTypeEnum) | Mark price type: internal - internal trading price, index - external index price | [optional]
**markPrice** | **String** | Current mark price | [optional]
**indexPrice** | **String** | Current index price | [optional]
**lastPrice** | **String** | Last trading price | [optional]
-**makerFeeRate** | **String** | Maker fee rate, where negative means rebate | [optional]
+**makerFeeRate** | **String** | Maker fee rate, negative values indicate rebates | [optional]
**takerFeeRate** | **String** | Taker fee rate | [optional]
**orderPriceRound** | **String** | Minimum order price increment | [optional]
**markPriceRound** | **String** | Minimum mark price increment | [optional]
@@ -33,18 +33,18 @@ Name | Type | Description | Notes
**riskLimitBase** | **String** | Risk limit base | [optional]
**riskLimitStep** | **String** | Step of adjusting risk limit | [optional]
**riskLimitMax** | **String** | Maximum risk limit the contract allowed | [optional]
-**orderSizeMin** | **Long** | Minimum order size the contract allowed | [optional]
-**orderSizeMax** | **Long** | Maximum order size the contract allowed | [optional]
-**orderPriceDeviate** | **String** | deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional]
-**refDiscountRate** | **String** | Referral fee rate discount | [optional]
-**refRebateRate** | **String** | Referrer commission rate | [optional]
-**orderbookId** | **Long** | Current orderbook ID | [optional]
+**orderSizeMin** | **Long** | Minimum order size allowed by the contract | [optional]
+**orderSizeMax** | **Long** | Maximum order size allowed by the contract | [optional]
+**orderPriceDeviate** | **String** | Maximum allowed deviation between order price and current mark price. The order price `order_price` must satisfy the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional]
+**refDiscountRate** | **String** | Trading fee discount for referred users | [optional]
+**refRebateRate** | **String** | Commission rate for referrers | [optional]
+**orderbookId** | **Long** | Orderbook update ID | [optional]
**tradeId** | **Long** | Current trade ID | [optional]
-**tradeSize** | **Long** | Historical accumulated trade size | [optional]
+**tradeSize** | **Long** | Historical cumulative trading volume | [optional]
**positionSize** | **Long** | Current total long position size | [optional]
-**configChangeTime** | **Double** | Last changed time of configuration | [optional]
+**configChangeTime** | **Double** | Last configuration update time | [optional]
**inDelisting** | **Boolean** | Contract is delisting | [optional]
-**ordersLimit** | **Integer** | Maximum number of open orders | [optional]
+**ordersLimit** | **Integer** | Maximum number of pending orders | [optional]
## Enum: CycleEnum
diff --git a/docs/DeliveryTicker.md b/docs/DeliveryTicker.md
new file mode 100644
index 0000000..ef83368
--- /dev/null
+++ b/docs/DeliveryTicker.md
@@ -0,0 +1,31 @@
+
+# DeliveryTicker
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contract** | **String** | Futures contract | [optional]
+**last** | **String** | Last trading price | [optional]
+**changePercentage** | **String** | Price change percentage. Negative values indicate price decrease, e.g. -7.45 | [optional]
+**totalSize** | **String** | Contract total size | [optional]
+**low24h** | **String** | 24-hour lowest price | [optional]
+**high24h** | **String** | 24-hour highest price | [optional]
+**volume24h** | **String** | 24-hour trading volume | [optional]
+**volume24hBtc** | **String** | 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional]
+**volume24hUsd** | **String** | 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional]
+**volume24hBase** | **String** | 24-hour trading volume in base currency | [optional]
+**volume24hQuote** | **String** | 24-hour trading volume in quote currency | [optional]
+**volume24hSettle** | **String** | 24-hour trading volume in settle currency | [optional]
+**markPrice** | **String** | Recent mark price | [optional]
+**fundingRate** | **String** | Funding rate | [optional]
+**fundingRateIndicative** | **String** | Indicative Funding rate in next period. (deprecated. use `funding_rate`) | [optional]
+**indexPrice** | **String** | Index price | [optional]
+**quantoBaseRate** | **String** | Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types | [optional]
+**basisRate** | **String** | Basis rate | [optional]
+**basisValue** | **String** | Basis value | [optional]
+**lowestAsk** | **String** | Recent lowest ask | [optional]
+**lowestSize** | **String** | The latest seller's lowest price order quantity | [optional]
+**highestBid** | **String** | Recent highest bid | [optional]
+**highestSize** | **String** | The latest buyer's highest price order volume | [optional]
+
diff --git a/docs/DepositRecord.md b/docs/DepositRecord.md
new file mode 100644
index 0000000..77e8e6f
--- /dev/null
+++ b/docs/DepositRecord.md
@@ -0,0 +1,18 @@
+
+# DepositRecord
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **String** | Record ID | [optional] [readonly]
+**txid** | **String** | Hash record of the withdrawal | [optional] [readonly]
+**withdrawOrderId** | **String** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional]
+**timestamp** | **String** | Operation time | [optional] [readonly]
+**amount** | **String** | Token amount |
+**currency** | **String** | Currency name |
+**address** | **String** | Withdrawal address. Required for withdrawals | [optional]
+**memo** | **String** | Additional remarks with regards to the withdrawal | [optional]
+**status** | **String** | Trading Status - REVIEW: Recharge review (compliance review) - PEND: Processing - DONE: Waiting for funds to be unlocked - INVALID: Invalid data - TRACK: Track the number of confirmations, waiting to add funds to the user (spot) - BLOCKED: Rejected Recharge - DEP_CREDITED: Recharge to account, withdrawal is not unlocked | [optional] [readonly]
+**chain** | **String** | Name of the chain used in withdrawals |
+
diff --git a/docs/DualGetOrders.md b/docs/DualGetOrders.md
new file mode 100644
index 0000000..79966da
--- /dev/null
+++ b/docs/DualGetOrders.md
@@ -0,0 +1,25 @@
+
+# DualGetOrders
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Integer** | Order ID | [optional]
+**planId** | **Integer** | Product ID | [optional]
+**copies** | **String** | Units | [optional]
+**investAmount** | **String** | Investment Quantity | [optional]
+**settlementAmount** | **String** | Settlement Quantity | [optional]
+**createTime** | **Integer** | Created time | [optional]
+**completeTime** | **Integer** | Completed Time | [optional]
+**status** | **String** | Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed | [optional]
+**investCurrency** | **String** | Investment Token | [optional]
+**exerciseCurrency** | **String** | Strike Token | [optional]
+**exercisePrice** | **String** | Strike price | [optional]
+**settlementPrice** | **String** | Settlement price | [optional]
+**settlementCurrency** | **String** | Settlement currency | [optional]
+**apyDisplay** | **String** | Annual Yield | [optional]
+**apySettlement** | **String** | Settlement Annual Yield | [optional]
+**deliveryTime** | **Integer** | Settlement time | [optional]
+**text** | **String** | Custom order information | [optional]
+
diff --git a/docs/DualGetPlans.md b/docs/DualGetPlans.md
new file mode 100644
index 0000000..0fa8521
--- /dev/null
+++ b/docs/DualGetPlans.md
@@ -0,0 +1,21 @@
+
+# DualGetPlans
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Integer** | Product ID | [optional]
+**instrumentName** | **String** | Product Name | [optional]
+**investCurrency** | **String** | Investment Token | [optional]
+**exerciseCurrency** | **String** | Strike Token | [optional]
+**exercisePrice** | **Double** | Strike price | [optional]
+**deliveryTime** | **Integer** | Settlement time | [optional]
+**minCopies** | **Integer** | Minimum Units | [optional]
+**maxCopies** | **Integer** | Maximum Units | [optional]
+**perValue** | **String** | Value Per Unit | [optional]
+**apyDisplay** | **String** | Annual Yield | [optional]
+**startTime** | **Integer** | Start Time | [optional]
+**endTime** | **Integer** | End time | [optional]
+**status** | **String** | Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended | [optional]
+
diff --git a/docs/EarnApi.md b/docs/EarnApi.md
new file mode 100644
index 0000000..78e2408
--- /dev/null
+++ b/docs/EarnApi.md
@@ -0,0 +1,719 @@
+# EarnApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**swapETH2**](EarnApi.md#swapETH2) | **POST** /earn/staking/eth2/swap | ETH2 swap
+[**rateListETH2**](EarnApi.md#rateListETH2) | **GET** /earn/staking/eth2/rate_records | ETH2 historical return rate query
+[**listDualInvestmentPlans**](EarnApi.md#listDualInvestmentPlans) | **GET** /earn/dual/investment_plan | Dual Investment product list
+[**listDualOrders**](EarnApi.md#listDualOrders) | **GET** /earn/dual/orders | Dual Investment order list
+[**placeDualOrder**](EarnApi.md#placeDualOrder) | **POST** /earn/dual/orders | Place Dual Investment order
+[**listStructuredProducts**](EarnApi.md#listStructuredProducts) | **GET** /earn/structured/products | Structured Product List
+[**listStructuredOrders**](EarnApi.md#listStructuredOrders) | **GET** /earn/structured/orders | Structured Product Order List
+[**placeStructuredOrder**](EarnApi.md#placeStructuredOrder) | **POST** /earn/structured/orders | Place Structured Product Order
+[**findCoin**](EarnApi.md#findCoin) | **GET** /earn/staking/coins | Staking coins
+[**swapStakingCoin**](EarnApi.md#swapStakingCoin) | **POST** /earn/staking/swap | On-chain token swap for earned coins
+
+
+
+# **swapETH2**
+> swapETH2(eth2Swap)
+
+ETH2 swap
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ Eth2Swap eth2Swap = new Eth2Swap(); // Eth2Swap |
+ try {
+ apiInstance.swapETH2(eth2Swap);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#swapETH2");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **eth2Swap** | [**Eth2Swap**](Eth2Swap.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Swap successful | - |
+
+
+# **rateListETH2**
+> List<Eth2RateList> rateListETH2()
+
+ETH2 historical return rate query
+
+Query ETH earnings rate records for the last 31 days
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ try {
+ List result = apiInstance.rateListETH2();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#rateListETH2");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<Eth2RateList>**](Eth2RateList.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **listDualInvestmentPlans**
+> List<DualGetPlans> listDualInvestmentPlans().planId(planId).execute();
+
+Dual Investment product list
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ Long planId = 1L; // Long | Financial project ID
+ try {
+ List result = apiInstance.listDualInvestmentPlans()
+ .planId(planId)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#listDualInvestmentPlans");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **planId** | **Long**| Financial project ID | [optional]
+
+### Return type
+
+[**List<DualGetPlans>**](DualGetPlans.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **listDualOrders**
+> List<DualGetOrders> listDualOrders().from(from).to(to).page(page).limit(limit).execute();
+
+Dual Investment order list
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ Long from = 1740727000L; // Long | Start settlement time
+ Long to = 1740729000L; // Long | End settlement time
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ try {
+ List result = apiInstance.listDualOrders()
+ .from(from)
+ .to(to)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#listDualOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **from** | **Long**| Start settlement time | [optional]
+ **to** | **Long**| End settlement time | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+
+### Return type
+
+[**List<DualGetOrders>**](DualGetOrders.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **placeDualOrder**
+> placeDualOrder(placeDualInvestmentOrder)
+
+Place Dual Investment order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ PlaceDualInvestmentOrder placeDualInvestmentOrder = new PlaceDualInvestmentOrder(); // PlaceDualInvestmentOrder |
+ try {
+ apiInstance.placeDualOrder(placeDualInvestmentOrder);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#placeDualOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **placeDualInvestmentOrder** | [**PlaceDualInvestmentOrder**](PlaceDualInvestmentOrder.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order placed successfully | - |
+
+
+# **listStructuredProducts**
+> List<StructuredGetProjectList> listStructuredProducts(status).type(type).page(page).limit(limit).execute();
+
+Structured Product List
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ String status = "in_process"; // String | Status (Default empty to query all) `in_process`-In progress `will_begin`-Not started `wait_settlement`-Pending settlement `done`-Completed
+ String type = "BullishSharkFin"; // String | Product Type (Default empty to query all) `SharkFin2.0`-Shark Fin `BullishSharkFin`-Bullish Treasure `BearishSharkFin`-Bearish Treasure `DoubleNoTouch`-Volatility Treasure `RangeAccrual`-Range Smart Yield `SnowBall`-Snowball
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ try {
+ List result = apiInstance.listStructuredProducts(status)
+ .type(type)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#listStructuredProducts");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | **String**| Status (Default empty to query all) `in_process`-In progress `will_begin`-Not started `wait_settlement`-Pending settlement `done`-Completed |
+ **type** | **String**| Product Type (Default empty to query all) `SharkFin2.0`-Shark Fin `BullishSharkFin`-Bullish Treasure `BearishSharkFin`-Bearish Treasure `DoubleNoTouch`-Volatility Treasure `RangeAccrual`-Range Smart Yield `SnowBall`-Snowball | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+
+### Return type
+
+[**List<StructuredGetProjectList>**](StructuredGetProjectList.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **listStructuredOrders**
+> List<StructuredOrderList> listStructuredOrders().from(from).to(to).page(page).limit(limit).execute();
+
+Structured Product Order List
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ try {
+ List result = apiInstance.listStructuredOrders()
+ .from(from)
+ .to(to)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#listStructuredOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+
+### Return type
+
+[**List<StructuredOrderList>**](StructuredOrderList.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **placeStructuredOrder**
+> placeStructuredOrder(structuredBuy)
+
+Place Structured Product Order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ StructuredBuy structuredBuy = new StructuredBuy(); // StructuredBuy |
+ try {
+ apiInstance.placeStructuredOrder(structuredBuy);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#placeStructuredOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **structuredBuy** | [**StructuredBuy**](StructuredBuy.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order placed successfully | - |
+
+
+# **findCoin**
+> Object findCoin(findCoin)
+
+Staking coins
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ FindCoin findCoin = new FindCoin(); // FindCoin |
+ try {
+ Object result = apiInstance.findCoin(findCoin);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#findCoin");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **findCoin** | [**FindCoin**](FindCoin.md)| |
+
+### Return type
+
+**Object**
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **swapStakingCoin**
+> SwapCoinStruct swapStakingCoin(swapCoin)
+
+On-chain token swap for earned coins
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnApi apiInstance = new EarnApi(defaultClient);
+ SwapCoin swapCoin = new SwapCoin(); // SwapCoin |
+ try {
+ SwapCoinStruct result = apiInstance.swapStakingCoin(swapCoin);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnApi#swapStakingCoin");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **swapCoin** | [**SwapCoin**](SwapCoin.md)| |
+
+### Return type
+
+[**SwapCoinStruct**](SwapCoinStruct.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Swap successful | - |
+
diff --git a/docs/EarnUniApi.md b/docs/EarnUniApi.md
new file mode 100644
index 0000000..769e34c
--- /dev/null
+++ b/docs/EarnUniApi.md
@@ -0,0 +1,800 @@
+# EarnUniApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**listUniCurrencies**](EarnUniApi.md#listUniCurrencies) | **GET** /earn/uni/currencies | Query lending currency list
+[**getUniCurrency**](EarnUniApi.md#getUniCurrency) | **GET** /earn/uni/currencies/{currency} | Query single lending currency details
+[**listUserUniLends**](EarnUniApi.md#listUserUniLends) | **GET** /earn/uni/lends | Query user's lending order list
+[**createUniLend**](EarnUniApi.md#createUniLend) | **POST** /earn/uni/lends | Create lending or redemption
+[**changeUniLend**](EarnUniApi.md#changeUniLend) | **PATCH** /earn/uni/lends | Amend user lending information
+[**listUniLendRecords**](EarnUniApi.md#listUniLendRecords) | **GET** /earn/uni/lend_records | Query lending transaction records
+[**getUniInterest**](EarnUniApi.md#getUniInterest) | **GET** /earn/uni/interests/{currency} | Query user's total interest income for specified currency
+[**listUniInterestRecords**](EarnUniApi.md#listUniInterestRecords) | **GET** /earn/uni/interest_records | Query user dividend records
+[**getUniInterestStatus**](EarnUniApi.md#getUniInterestStatus) | **GET** /earn/uni/interest_status/{currency} | Query currency interest compounding status
+[**listUniChart**](EarnUniApi.md#listUniChart) | **GET** /earn/uni/chart | UniLoan currency annualized trend chart
+[**listUniRate**](EarnUniApi.md#listUniRate) | **GET** /earn/uni/rate | Currency estimated annualized interest rate
+
+
+
+# **listUniCurrencies**
+> List<UniCurrency> listUniCurrencies()
+
+Query lending currency list
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ try {
+ List result = apiInstance.listUniCurrencies();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#listUniCurrencies");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<UniCurrency>**](UniCurrency.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUniCurrency**
+> UniCurrency getUniCurrency(currency)
+
+Query single lending currency details
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ String currency = "btc"; // String | Currency
+ try {
+ UniCurrency result = apiInstance.getUniCurrency(currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#getUniCurrency");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency |
+
+### Return type
+
+[**UniCurrency**](UniCurrency.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listUserUniLends**
+> List<UniLend> listUserUniLends().currency(currency).page(page).limit(limit).execute();
+
+Query user's lending order list
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ try {
+ List result = apiInstance.listUserUniLends()
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#listUserUniLends");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+
+### Return type
+
+[**List<UniLend>**](UniLend.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **createUniLend**
+> createUniLend(createUniLend)
+
+Create lending or redemption
+
+Lending: When lending, a minimum lending rate must be set. After successful lending is determined on an hourly basis, earnings will be calculated based on the determined rate. Earnings for each hour will be settled at the top of the hour. If lending fails due to an excessively high interest rate, no interest will be earned for that hour. If funds are redeemed before the hourly for that hour. Priority: Under the same interest rate, wealth management products created or modified earlier will be prioritized for lending. Redemption: For funds that failed to be lent, redemption will be credited immediately. For funds successfully lent, they are entitled to the earnings for that hour, and redemption will be credited in the next hourly interval. Note: The two minutes before and after the hourly mark are the settlement period, during which lending and redemption are prohibited.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ CreateUniLend createUniLend = new CreateUniLend(); // CreateUniLend |
+ try {
+ apiInstance.createUniLend(createUniLend);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#createUniLend");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **createUniLend** | [**CreateUniLend**](CreateUniLend.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Operation successful | - |
+
+
+# **changeUniLend**
+> changeUniLend(patchUniLend)
+
+Amend user lending information
+
+Currently only supports amending minimum interest rate (hourly)
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ PatchUniLend patchUniLend = new PatchUniLend(); // PatchUniLend |
+ try {
+ apiInstance.changeUniLend(patchUniLend);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#changeUniLend");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **patchUniLend** | [**PatchUniLend**](PatchUniLend.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Updated successfully | - |
+
+
+# **listUniLendRecords**
+> List<UniLendRecord> listUniLendRecords().currency(currency).page(page).limit(limit).from(from).to(to).type(type).execute();
+
+Query lending transaction records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ String type = "lend"; // String | Operation type: lend - Lend, redeem - Redeem
+ try {
+ List result = apiInstance.listUniLendRecords()
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .type(type)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#listUniLendRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **type** | **String**| Operation type: lend - Lend, redeem - Redeem | [optional] [enum: lend, redeem]
+
+### Return type
+
+[**List<UniLendRecord>**](UniLendRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUniInterest**
+> UniLendInterest getUniInterest(currency)
+
+Query user's total interest income for specified currency
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ String currency = "btc"; // String | Currency
+ try {
+ UniLendInterest result = apiInstance.getUniInterest(currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#getUniInterest");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency |
+
+### Return type
+
+[**UniLendInterest**](UniLendInterest.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listUniInterestRecords**
+> List<UniInterestRecord> listUniInterestRecords().currency(currency).page(page).limit(limit).from(from).to(to).execute();
+
+Query user dividend records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ try {
+ List result = apiInstance.listUniInterestRecords()
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#listUniInterestRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+
+### Return type
+
+[**List<UniInterestRecord>**](UniInterestRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUniInterestStatus**
+> UniCurrencyInterest getUniInterestStatus(currency)
+
+Query currency interest compounding status
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ String currency = "btc"; // String | Currency
+ try {
+ UniCurrencyInterest result = apiInstance.getUniInterestStatus(currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#getUniInterestStatus");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency |
+
+### Return type
+
+[**UniCurrencyInterest**](UniCurrencyInterest.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listUniChart**
+> List<InlineResponse200> listUniChart(from, to, asset)
+
+UniLoan currency annualized trend chart
+
+Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ Long from = 1719763200L; // Long | Start timestamp in seconds, maximum span 30 days
+ Long to = 1722441600L; // Long | End timestamp in seconds, maximum span 30 days
+ String asset = "BTC"; // String | Currency name
+ try {
+ List result = apiInstance.listUniChart(from, to, asset);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#listUniChart");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **from** | **Long**| Start timestamp in seconds, maximum span 30 days |
+ **to** | **Long**| End timestamp in seconds, maximum span 30 days |
+ **asset** | **String**| Currency name |
+
+### Return type
+
+[**List<InlineResponse200>**](InlineResponse200.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - |
+
+
+# **listUniRate**
+> List<InlineResponse2001> listUniRate()
+
+Currency estimated annualized interest rate
+
+Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.EarnUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ EarnUniApi apiInstance = new EarnUniApi(defaultClient);
+ try {
+ List result = apiInstance.listUniRate();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling EarnUniApi#listUniRate");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<InlineResponse2001>**](InlineResponse2001.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - |
+
diff --git a/docs/Eth2RateList.md b/docs/Eth2RateList.md
new file mode 100644
index 0000000..0dbf7cc
--- /dev/null
+++ b/docs/Eth2RateList.md
@@ -0,0 +1,11 @@
+
+# Eth2RateList
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**dateTime** | **Long** | Date Timestamp | [optional]
+**date** | **String** | Date | [optional]
+**rate** | **String** | Percentage Rate | [optional]
+
diff --git a/docs/Eth2Swap.md b/docs/Eth2Swap.md
new file mode 100644
index 0000000..a1a8eed
--- /dev/null
+++ b/docs/Eth2Swap.md
@@ -0,0 +1,12 @@
+
+# Eth2Swap
+
+ETH2 Mining
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**side** | **String** | 1-Forward Swap (ETH -> ETH2), 2-Reverse Swap (ETH2 -> ETH) |
+**amount** | **String** | Swap Amount |
+
diff --git a/docs/FindCoin.md b/docs/FindCoin.md
new file mode 100644
index 0000000..65b8e44
--- /dev/null
+++ b/docs/FindCoin.md
@@ -0,0 +1,9 @@
+
+# FindCoin
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**cointype** | **String** | Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. | [optional]
+
diff --git a/docs/FlashSwapApi.md b/docs/FlashSwapApi.md
new file mode 100644
index 0000000..5cd0034
--- /dev/null
+++ b/docs/FlashSwapApi.md
@@ -0,0 +1,378 @@
+# FlashSwapApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**listFlashSwapCurrencyPair**](FlashSwapApi.md#listFlashSwapCurrencyPair) | **GET** /flash_swap/currency_pairs | List All Supported Currency Pairs In Flash Swap
+[**listFlashSwapOrders**](FlashSwapApi.md#listFlashSwapOrders) | **GET** /flash_swap/orders | Query flash swap order list
+[**createFlashSwapOrder**](FlashSwapApi.md#createFlashSwapOrder) | **POST** /flash_swap/orders | Create a flash swap order
+[**getFlashSwapOrder**](FlashSwapApi.md#getFlashSwapOrder) | **GET** /flash_swap/orders/{order_id} | Query single flash swap order
+[**previewFlashSwapOrder**](FlashSwapApi.md#previewFlashSwapOrder) | **POST** /flash_swap/orders/preview | Flash swap order preview
+
+
+
+# **listFlashSwapCurrencyPair**
+> List<FlashSwapCurrencyPair> listFlashSwapCurrencyPair().currency(currency).page(page).limit(limit).execute();
+
+List All Supported Currency Pairs In Flash Swap
+
+`BTC_GT` represents selling BTC and buying GT. The limits for each currency may vary across different currency pairs. It is not necessary that two currencies that can be swapped instantaneously can be exchanged with each other. For example, it is possible to sell BTC and buy GT, but it does not necessarily mean that GT can be sold to buy BTC.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FlashSwapApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ FlashSwapApi apiInstance = new FlashSwapApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 1000; // Integer | Maximum number of items returned. Default: 1000, minimum: 1, maximum: 1000
+ try {
+ List result = apiInstance.listFlashSwapCurrencyPair()
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FlashSwapApi#listFlashSwapCurrencyPair");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 1000, minimum: 1, maximum: 1000 | [optional] [default to 1000]
+
+### Return type
+
+[**List<FlashSwapCurrencyPair>**](FlashSwapCurrencyPair.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listFlashSwapOrders**
+> List<FlashSwapOrder> listFlashSwapOrders().status(status).sellCurrency(sellCurrency).buyCurrency(buyCurrency).reverse(reverse).limit(limit).page(page).execute();
+
+Query flash swap order list
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FlashSwapApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FlashSwapApi apiInstance = new FlashSwapApi(defaultClient);
+ Integer status = 1; // Integer | Flash swap order status `1` - success `2` - failed
+ String sellCurrency = "BTC"; // String | Asset name to sell - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies
+ String buyCurrency = "BTC"; // String | Asset name to buy - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies
+ Boolean reverse = true; // Boolean | Sort by ID in ascending or descending order, default `true` - `true`: ID descending order (most recent data first) - `false`: ID ascending order (oldest data first)
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer page = 1; // Integer | Page number
+ try {
+ List result = apiInstance.listFlashSwapOrders()
+ .status(status)
+ .sellCurrency(sellCurrency)
+ .buyCurrency(buyCurrency)
+ .reverse(reverse)
+ .limit(limit)
+ .page(page)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FlashSwapApi#listFlashSwapOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | **Integer**| Flash swap order status `1` - success `2` - failed | [optional]
+ **sellCurrency** | **String**| Asset name to sell - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies | [optional]
+ **buyCurrency** | **String**| Asset name to buy - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies | [optional]
+ **reverse** | **Boolean**| Sort by ID in ascending or descending order, default `true` - `true`: ID descending order (most recent data first) - `false`: ID ascending order (oldest data first) | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+
+### Return type
+
+[**List<FlashSwapOrder>**](FlashSwapOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **createFlashSwapOrder**
+> FlashSwapOrder createFlashSwapOrder(flashSwapOrderRequest)
+
+Create a flash swap order
+
+Initiate a flash swap preview in advance because order creation requires a preview result
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FlashSwapApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FlashSwapApi apiInstance = new FlashSwapApi(defaultClient);
+ FlashSwapOrderRequest flashSwapOrderRequest = new FlashSwapOrderRequest(); // FlashSwapOrderRequest |
+ try {
+ FlashSwapOrder result = apiInstance.createFlashSwapOrder(flashSwapOrderRequest);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FlashSwapApi#createFlashSwapOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **flashSwapOrderRequest** | [**FlashSwapOrderRequest**](FlashSwapOrderRequest.md)| |
+
+### Return type
+
+[**FlashSwapOrder**](FlashSwapOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**201** | Flash swap order created successfully | - |
+
+
+# **getFlashSwapOrder**
+> FlashSwapOrder getFlashSwapOrder(orderId)
+
+Query single flash swap order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FlashSwapApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FlashSwapApi apiInstance = new FlashSwapApi(defaultClient);
+ Integer orderId = 1; // Integer | Flash swap order ID
+ try {
+ FlashSwapOrder result = apiInstance.getFlashSwapOrder(orderId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FlashSwapApi#getFlashSwapOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Integer**| Flash swap order ID |
+
+### Return type
+
+[**FlashSwapOrder**](FlashSwapOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **previewFlashSwapOrder**
+> FlashSwapOrderPreview previewFlashSwapOrder(flashSwapPreviewRequest)
+
+Flash swap order preview
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FlashSwapApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FlashSwapApi apiInstance = new FlashSwapApi(defaultClient);
+ FlashSwapPreviewRequest flashSwapPreviewRequest = new FlashSwapPreviewRequest(); // FlashSwapPreviewRequest |
+ try {
+ FlashSwapOrderPreview result = apiInstance.previewFlashSwapOrder(flashSwapPreviewRequest);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FlashSwapApi#previewFlashSwapOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **flashSwapPreviewRequest** | [**FlashSwapPreviewRequest**](FlashSwapPreviewRequest.md)| |
+
+### Return type
+
+[**FlashSwapOrderPreview**](FlashSwapOrderPreview.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Flash swap order preview successful | - |
+
diff --git a/docs/FlashSwapCurrencyPair.md b/docs/FlashSwapCurrencyPair.md
new file mode 100644
index 0000000..2ad2f0a
--- /dev/null
+++ b/docs/FlashSwapCurrencyPair.md
@@ -0,0 +1,17 @@
+
+# FlashSwapCurrencyPair
+
+List all supported currencies in flash swap
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPair** | **String** | Currency pair, `BTC_USDT` represents selling `BTC` and buying `USDT` | [optional] [readonly]
+**sellCurrency** | **String** | Currency to sell | [optional] [readonly]
+**buyCurrency** | **String** | Currency to buy | [optional] [readonly]
+**sellMinAmount** | **String** | Minimum sell quantity | [optional] [readonly]
+**sellMaxAmount** | **String** | Maximum sell quantity | [optional] [readonly]
+**buyMinAmount** | **String** | Minimum buy quantity | [optional] [readonly]
+**buyMaxAmount** | **String** | Maximum buy quantity | [optional] [readonly]
+
diff --git a/docs/FlashSwapOrder.md b/docs/FlashSwapOrder.md
new file mode 100644
index 0000000..fcf1cd3
--- /dev/null
+++ b/docs/FlashSwapOrder.md
@@ -0,0 +1,19 @@
+
+# FlashSwapOrder
+
+Flash swap order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | Flash swap order ID | [optional] [readonly]
+**createTime** | **Long** | Creation time of order (in milliseconds) | [optional] [readonly]
+**userId** | **Long** | User ID | [optional] [readonly]
+**sellCurrency** | **String** | Currency to sell | [optional] [readonly]
+**sellAmount** | **String** | Amount to sell | [optional] [readonly]
+**buyCurrency** | **String** | Currency to buy | [optional] [readonly]
+**buyAmount** | **String** | Amount to buy | [optional] [readonly]
+**price** | **String** | Price | [optional] [readonly]
+**status** | **Integer** | Flash swap order status `1` - success `2` - failure | [optional] [readonly]
+
diff --git a/docs/FlashSwapOrderPreview.md b/docs/FlashSwapOrderPreview.md
new file mode 100644
index 0000000..b25622d
--- /dev/null
+++ b/docs/FlashSwapOrderPreview.md
@@ -0,0 +1,16 @@
+
+# FlashSwapOrderPreview
+
+Flash swap order preview
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**previewId** | **String** | Preview result ID | [optional]
+**sellCurrency** | **String** | Name of the sold asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain | [optional]
+**sellAmount** | **String** | Amount to sell | [optional]
+**buyCurrency** | **String** | Name of the purchased asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain | [optional]
+**buyAmount** | **String** | Amount to buy | [optional]
+**price** | **String** | Price | [optional]
+
diff --git a/docs/FlashSwapOrderRequest.md b/docs/FlashSwapOrderRequest.md
new file mode 100644
index 0000000..100b504
--- /dev/null
+++ b/docs/FlashSwapOrderRequest.md
@@ -0,0 +1,15 @@
+
+# FlashSwapOrderRequest
+
+Parameters of flash swap order creation
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**previewId** | **String** | Preview result ID |
+**sellCurrency** | **String** | Name of the asset to be sold, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap |
+**sellAmount** | **String** | Amount to sell (based on the preview result) |
+**buyCurrency** | **String** | Name of the asset to be bought, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap |
+**buyAmount** | **String** | Amount to buy (based on the preview result) |
+
diff --git a/docs/FlashSwapPreviewRequest.md b/docs/FlashSwapPreviewRequest.md
new file mode 100644
index 0000000..0819b9c
--- /dev/null
+++ b/docs/FlashSwapPreviewRequest.md
@@ -0,0 +1,14 @@
+
+# FlashSwapPreviewRequest
+
+Parameters of flash swap order creation
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**sellCurrency** | **String** | The name of the asset being sold, as obtained from the \"GET /flash_swap/currency_pairs\" API, which retrieves a list of supported flash swap currency pairs |
+**sellAmount** | **String** | Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` | [optional]
+**buyCurrency** | **String** | The name of the asset being purchased, as obtained from the \"GET /flash_swap/currency_pairs\" API, which provides a list of supported flash swap currency pairs |
+**buyAmount** | **String** | Amount to buy. It is required to choose one parameter between `sell_amount` and `buy_amount` | [optional]
+
diff --git a/docs/FundingBookItem.md b/docs/FundingBookItem.md
deleted file mode 100644
index 01a82bc..0000000
--- a/docs/FundingBookItem.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-# FundingBookItem
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**rate** | **String** | Loan rate | [optional]
-**amount** | **String** | Borrowable amount | [optional]
-**days** | **Integer** | The number of days till the loan repayment's dateline | [optional]
-
diff --git a/docs/FutureCancelOrderResult.md b/docs/FutureCancelOrderResult.md
new file mode 100644
index 0000000..78b53f0
--- /dev/null
+++ b/docs/FutureCancelOrderResult.md
@@ -0,0 +1,14 @@
+
+# FutureCancelOrderResult
+
+Order cancellation result
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **String** | Order ID | [optional]
+**userId** | **Long** | User ID | [optional]
+**succeeded** | **Boolean** | Whether cancellation succeeded | [optional]
+**message** | **String** | Error description when cancellation fails, empty if successful | [optional]
+
diff --git a/docs/FuturesAccount.md b/docs/FuturesAccount.md
index 1eb07f4..0ff4e6d 100644
--- a/docs/FuturesAccount.md
+++ b/docs/FuturesAccount.md
@@ -5,12 +5,31 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**total** | **String** | Total assets, total = position_margin + order_margin + available | [optional]
+**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]
**unrealisedPnl** | **String** | Unrealized PNL | [optional]
**positionMargin** | **String** | Position margin | [optional]
**orderMargin** | **String** | Order margin of unfinished orders | [optional]
-**available** | **String** | Available balance to transfer out or trade | [optional]
-**point** | **String** | POINT amount | [optional]
-**currency** | **String** | Settle currency | [optional]
+**available** | **String** | Available balance for transferring or trading (including bonus. Bonus cannot be withdrawn, so transfer amount needs to deduct bonus) | [optional]
+**point** | **String** | Point card amount | [optional]
+**currency** | **String** | Settlement currency | [optional]
**inDualMode** | **Boolean** | Whether dual mode is enabled | [optional]
+**positionMode** | **String** | Position mode: single - one-way, dual - dual-side, split - sub-positions (in_dual_mode is deprecated) | [optional]
+**enableCredit** | **Boolean** | Whether portfolio margin account mode is enabled | [optional]
+**positionInitialMargin** | **String** | Initial margin occupied by positions, applicable to unified account mode | [optional]
+**maintenanceMargin** | **String** | Maintenance margin occupied by positions, applicable to new classic account margin mode and unified account mode | [optional]
+**bonus** | **String** | Bonus | [optional]
+**enableEvolvedClassic** | **Boolean** | Classic account margin mode, true-new mode, false-old mode | [optional]
+**crossOrderMargin** | **String** | Cross margin order margin, applicable to new classic account margin mode | [optional]
+**crossInitialMargin** | **String** | Cross margin initial margin, applicable to new classic account margin mode | [optional]
+**crossMaintenanceMargin** | **String** | Cross margin maintenance margin, applicable to new classic account margin mode | [optional]
+**crossUnrealisedPnl** | **String** | Cross margin unrealized P&L, applicable to new classic account margin mode | [optional]
+**crossAvailable** | **String** | Cross margin available balance, applicable to new classic account margin mode | [optional]
+**crossMarginBalance** | **String** | Cross margin balance, applicable to new classic account margin mode | [optional]
+**crossMmr** | **String** | Cross margin maintenance margin rate, applicable to new classic account margin mode | [optional]
+**crossImr** | **String** | Cross margin initial margin rate, applicable to new classic account margin mode | [optional]
+**isolatedPositionMargin** | **String** | Isolated position margin, applicable to new classic account margin mode | [optional]
+**enableNewDualMode** | **Boolean** | Whether to open a new two-way position mode | [optional]
+**marginMode** | **Integer** | Margin mode, 0-classic margin mode, 1-cross-currency margin mode, 2-combined margin mode | [optional]
+**enableTieredMm** | **Boolean** | Whether to enable tiered maintenance margin calculation | [optional]
+**history** | [**FuturesAccountHistory**](FuturesAccountHistory.md) | | [optional]
diff --git a/docs/FuturesAccountBook.md b/docs/FuturesAccountBook.md
index 8ddd254..46191b9 100644
--- a/docs/FuturesAccountBook.md
+++ b/docs/FuturesAccountBook.md
@@ -8,8 +8,11 @@ Name | Type | Description | Notes
**time** | **Double** | Change time | [optional]
**change** | **String** | Change amount | [optional]
**balance** | **String** | Balance after change | [optional]
-**type** | [**TypeEnum**](#TypeEnum) | 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 | [optional]
+**type** | [**TypeEnum**](#TypeEnum) | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction | [optional]
**text** | **String** | Comment | [optional]
+**contract** | **String** | Futures contract, the field is only available for data after 2023-10-30 | [optional]
+**tradeId** | **String** | trade id | [optional]
+**id** | **String** | Account change record ID | [optional]
## Enum: TypeEnum
@@ -23,4 +26,5 @@ FUND | "fund"
POINT_DNW | "point_dnw"
POINT_FEE | "point_fee"
POINT_REFR | "point_refr"
+BONUS_OFFSET | "bonus_offset"
diff --git a/docs/FuturesAccountHistory.md b/docs/FuturesAccountHistory.md
new file mode 100644
index 0000000..67b7e58
--- /dev/null
+++ b/docs/FuturesAccountHistory.md
@@ -0,0 +1,20 @@
+
+# FuturesAccountHistory
+
+Statistical data
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**dnw** | **String** | total amount of deposit and withdraw | [optional]
+**pnl** | **String** | total amount of trading profit and loss | [optional]
+**fee** | **String** | total amount of fee | [optional]
+**refr** | **String** | total amount of referrer rebates | [optional]
+**fund** | **String** | total amount of funding costs | [optional]
+**pointDnw** | **String** | total amount of point deposit and withdraw | [optional]
+**pointFee** | **String** | total amount of point fee | [optional]
+**pointRefr** | **String** | total amount of referrer rebates of point fee | [optional]
+**bonusDnw** | **String** | total amount of perpetual contract bonus transfer | [optional]
+**bonusOffset** | **String** | total amount of perpetual contract bonus deduction | [optional]
+
diff --git a/docs/FuturesApi.md b/docs/FuturesApi.md
index e763eea..3495c30 100644
--- a/docs/FuturesApi.md
+++ b/docs/FuturesApi.md
@@ -4,48 +4,63 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
Method | HTTP request | Description
------------- | ------------- | -------------
-[**listFuturesContracts**](FuturesApi.md#listFuturesContracts) | **GET** /futures/{settle}/contracts | List all futures contracts
-[**getFuturesContract**](FuturesApi.md#getFuturesContract) | **GET** /futures/{settle}/contracts/{contract} | Get a single contract
-[**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
-[**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
-[**listContractStats**](FuturesApi.md#listContractStats) | **GET** /futures/{settle}/contract_stats | Futures stats
-[**listLiquidatedOrders**](FuturesApi.md#listLiquidatedOrders) | **GET** /futures/{settle}/liq_orders | Retrieve liquidation history
-[**listFuturesAccounts**](FuturesApi.md#listFuturesAccounts) | **GET** /futures/{settle}/accounts | Query futures account
-[**listFuturesAccountBook**](FuturesApi.md#listFuturesAccountBook) | **GET** /futures/{settle}/account_book | Query account book
-[**listPositions**](FuturesApi.md#listPositions) | **GET** /futures/{settle}/positions | List all positions of a user
-[**getPosition**](FuturesApi.md#getPosition) | **GET** /futures/{settle}/positions/{contract} | Get single position
+[**listFuturesContracts**](FuturesApi.md#listFuturesContracts) | **GET** /futures/{settle}/contracts | Query all futures contracts
+[**getFuturesContract**](FuturesApi.md#getFuturesContract) | **GET** /futures/{settle}/contracts/{contract} | Query single contract information
+[**listFuturesOrderBook**](FuturesApi.md#listFuturesOrderBook) | **GET** /futures/{settle}/order_book | Query futures market depth information
+[**listFuturesTrades**](FuturesApi.md#listFuturesTrades) | **GET** /futures/{settle}/trades | Futures market transaction records
+[**listFuturesCandlesticks**](FuturesApi.md#listFuturesCandlesticks) | **GET** /futures/{settle}/candlesticks | Futures market K-line chart
+[**listFuturesPremiumIndex**](FuturesApi.md#listFuturesPremiumIndex) | **GET** /futures/{settle}/premium_index | Premium Index K-line chart
+[**listFuturesTickers**](FuturesApi.md#listFuturesTickers) | **GET** /futures/{settle}/tickers | Get all futures trading statistics
+[**listFuturesFundingRateHistory**](FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Futures market historical funding rate
+[**listFuturesInsuranceLedger**](FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures market insurance fund history
+[**listContractStats**](FuturesApi.md#listContractStats) | **GET** /futures/{settle}/contract_stats | Futures statistics
+[**getIndexConstituents**](FuturesApi.md#getIndexConstituents) | **GET** /futures/{settle}/index_constituents/{index} | Query index constituents
+[**listLiquidatedOrders**](FuturesApi.md#listLiquidatedOrders) | **GET** /futures/{settle}/liq_orders | Query liquidation order history
+[**listFuturesRiskLimitTiers**](FuturesApi.md#listFuturesRiskLimitTiers) | **GET** /futures/{settle}/risk_limit_tiers | Query risk limit tiers
+[**listFuturesAccounts**](FuturesApi.md#listFuturesAccounts) | **GET** /futures/{settle}/accounts | Get futures account
+[**listFuturesAccountBook**](FuturesApi.md#listFuturesAccountBook) | **GET** /futures/{settle}/account_book | Query futures account change history
+[**listPositions**](FuturesApi.md#listPositions) | **GET** /futures/{settle}/positions | Get user position list
+[**getPosition**](FuturesApi.md#getPosition) | **GET** /futures/{settle}/positions/{contract} | Get single position information
[**updatePositionMargin**](FuturesApi.md#updatePositionMargin) | **POST** /futures/{settle}/positions/{contract}/margin | Update position margin
[**updatePositionLeverage**](FuturesApi.md#updatePositionLeverage) | **POST** /futures/{settle}/positions/{contract}/leverage | Update position leverage
+[**updatePositionCrossMode**](FuturesApi.md#updatePositionCrossMode) | **POST** /futures/{settle}/positions/cross_mode | Switch Position Margin Mode
+[**updateDualCompPositionCrossMode**](FuturesApi.md#updateDualCompPositionCrossMode) | **POST** /futures/{settle}/dual_comp/positions/cross_mode | Switch Between Cross and Isolated Margin Modes Under Hedge Mode
[**updatePositionRiskLimit**](FuturesApi.md#updatePositionRiskLimit) | **POST** /futures/{settle}/positions/{contract}/risk_limit | Update position risk limit
-[**setDualMode**](FuturesApi.md#setDualMode) | **POST** /futures/{settle}/dual_mode | Enable or disable dual mode
-[**getDualModePosition**](FuturesApi.md#getDualModePosition) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Retrieve position detail in dual mode
+[**setDualMode**](FuturesApi.md#setDualMode) | **POST** /futures/{settle}/dual_mode | Set position mode
+[**getDualModePosition**](FuturesApi.md#getDualModePosition) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Get position information in dual mode
[**updateDualModePositionMargin**](FuturesApi.md#updateDualModePositionMargin) | **POST** /futures/{settle}/dual_comp/positions/{contract}/margin | Update position margin in dual mode
[**updateDualModePositionLeverage**](FuturesApi.md#updateDualModePositionLeverage) | **POST** /futures/{settle}/dual_comp/positions/{contract}/leverage | Update position leverage in dual mode
[**updateDualModePositionRiskLimit**](FuturesApi.md#updateDualModePositionRiskLimit) | **POST** /futures/{settle}/dual_comp/positions/{contract}/risk_limit | Update position risk limit in dual mode
-[**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
-[**getFuturesOrder**](FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single 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
-[**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
-[**cancelPriceTriggeredOrder**](FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single order
+[**listFuturesOrders**](FuturesApi.md#listFuturesOrders) | **GET** /futures/{settle}/orders | Query futures order list
+[**createFuturesOrder**](FuturesApi.md#createFuturesOrder) | **POST** /futures/{settle}/orders | Place futures order
+[**cancelFuturesOrders**](FuturesApi.md#cancelFuturesOrders) | **DELETE** /futures/{settle}/orders | Cancel all orders with 'open' status
+[**getOrdersWithTimeRange**](FuturesApi.md#getOrdersWithTimeRange) | **GET** /futures/{settle}/orders_timerange | Query futures order list by time range
+[**createBatchFuturesOrder**](FuturesApi.md#createBatchFuturesOrder) | **POST** /futures/{settle}/batch_orders | Place batch futures orders
+[**getFuturesOrder**](FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Query single order details
+[**amendFuturesOrder**](FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend single order
+[**cancelFuturesOrder**](FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel single order
+[**getMyTrades**](FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | Query personal trading records
+[**getMyTradesWithTimeRange**](FuturesApi.md#getMyTradesWithTimeRange) | **GET** /futures/{settle}/my_trades_timerange | Query personal trading records by time range
+[**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | Query position close history
+[**listLiquidates**](FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | Query liquidation history
+[**listAutoDeleverages**](FuturesApi.md#listAutoDeleverages) | **GET** /futures/{settle}/auto_deleverages | Query ADL auto-deleveraging order information
+[**countdownCancelAllFutures**](FuturesApi.md#countdownCancelAllFutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders
+[**getFuturesFee**](FuturesApi.md#getFuturesFee) | **GET** /futures/{settle}/fee | Query futures market trading fee rates
+[**cancelBatchFutureOrders**](FuturesApi.md#cancelBatchFutureOrders) | **POST** /futures/{settle}/batch_cancel_orders | Cancel batch orders by specified ID list
+[**amendBatchFutureOrders**](FuturesApi.md#amendBatchFutureOrders) | **POST** /futures/{settle}/batch_amend_orders | Batch modify orders by specified IDs
+[**getFuturesRiskLimitTable**](FuturesApi.md#getFuturesRiskLimitTable) | **GET** /futures/{settle}/risk_limit_table | Query risk limit table by table_id
+[**listPriceTriggeredOrders**](FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/{settle}/price_orders | Query auto order list
+[**createPriceTriggeredOrder**](FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/{settle}/price_orders | Create price-triggered order
+[**cancelPriceTriggeredOrderList**](FuturesApi.md#cancelPriceTriggeredOrderList) | **DELETE** /futures/{settle}/price_orders | Cancel all auto orders
+[**getPriceTriggeredOrder**](FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Query single auto order details
+[**cancelPriceTriggeredOrder**](FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel single auto order
# **listFuturesContracts**
-> List<Contract> listFuturesContracts(settle)
+> List<Contract> listFuturesContracts(settle).limit(limit).offset(offset).execute();
-List all futures contracts
+Query all futures contracts
### Example
@@ -65,8 +80,13 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
try {
- List result = apiInstance.listFuturesContracts(settle);
+ List result = apiInstance.listFuturesContracts(settle)
+ .limit(limit)
+ .offset(offset)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
@@ -86,6 +106,8 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
@@ -103,13 +125,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **getFuturesContract**
> Contract getFuturesContract(settle, contract)
-Get a single contract
+Query single contract information
### Example
@@ -175,7 +197,7 @@ No authorization required
# **listFuturesOrderBook**
> FuturesOrderBook listFuturesOrderBook(settle, contract).interval(interval).limit(limit).withId(withId).execute();
-Futures order book
+Query futures market depth information
Bids will be sorted by price from high to low, while asks sorted reversely
@@ -198,9 +220,9 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
- String interval = "0"; // String | Order depth. 0 means no aggregation is applied. default to 0
- Integer limit = 10; // Integer | Maximum number of order depth data in asks or bids
- Boolean withId = false; // Boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update
+ String interval = "\"0\""; // String | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified
+ Integer limit = 10; // Integer | Number of depth levels
+ Boolean withId = false; // Boolean | Whether to return depth update ID. This ID increments by 1 each time depth changes
try {
FuturesOrderBook result = apiInstance.listFuturesOrderBook(settle, contract)
.interval(interval)
@@ -227,9 +249,9 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract |
- **interval** | **String**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to 0] [enum: 0, 0.1, 0.01]
- **limit** | **Integer**| 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 false]
+ **interval** | **String**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to "0"]
+ **limit** | **Integer**| Number of depth levels | [optional] [default to 10]
+ **withId** | **Boolean**| Whether to return depth update ID. This ID increments by 1 each time depth changes | [optional] [default to false]
### Return type
@@ -247,13 +269,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Order book retrieved | - |
+**200** | Depth query successful | - |
# **listFuturesTrades**
-> List<FuturesTrade> listFuturesTrades(settle, contract).limit(limit).lastId(lastId).from(from).to(to).execute();
+> List<FuturesTrade> listFuturesTrades(settle, contract).limit(limit).offset(offset).lastId(lastId).from(from).to(to).execute();
-Futures trading history
+Futures market transaction records
### Example
@@ -274,13 +296,15 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
String 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
Long from = 1546905600L; // Long | 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.
- Long to = 1546935600L; // Long | Specify end time in Unix seconds, default to current time
+ Long to = 1546935600L; // Long | Specify end time in Unix seconds, default to current time.
try {
List result = apiInstance.listFuturesTrades(settle, contract)
.limit(limit)
+ .offset(offset)
.lastId(lastId)
.from(from)
.to(to)
@@ -305,10 +329,11 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract |
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| 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]
**from** | **Long**| 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]
- **to** | **Long**| Specify end time in Unix seconds, default to current time | [optional]
+ **to** | **Long**| Specify end time in Unix seconds, default to current time. | [optional]
### Return type
@@ -326,13 +351,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listFuturesCandlesticks**
-> List<FuturesCandlestick> listFuturesCandlesticks(settle, contract).from(from).to(to).limit(limit).interval(interval).execute();
+> List<FuturesCandlestick> listFuturesCandlesticks(settle, contract).from(from).to(to).limit(limit).interval(interval).timezone(timezone).execute();
-Get futures candlesticks
+Futures market K-line chart
Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval`
@@ -356,15 +381,17 @@ public class Example {
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
Long from = 1546905600L; // Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
- Long to = 1546935600L; // Long | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
- Integer limit = 100; // Integer | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
- String interval = "5m"; // String | Interval time between data points
+ Long to = 1546935600L; // Long | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision
+ Integer limit = 100; // Integer | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
+ String interval = "5m"; // String | Interval time between data points. Note that `1w` means natural week(Mon-Sun), while `7d` means every 7d since unix 0. 30d represents a natural month, not 30 days
+ String timezone = "\"utc0\""; // String | Time zone: all/utc0/utc8, default utc0
try {
List result = apiInstance.listFuturesCandlesticks(settle, contract)
.from(from)
.to(to)
.limit(limit)
.interval(interval)
+ .timezone(timezone)
.execute();
System.out.println(result);
} catch (GateApiException e) {
@@ -387,9 +414,10 @@ Name | Type | Description | Notes
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract |
**from** | **Long**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional]
- **to** | **Long**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional]
- **limit** | **Integer**| 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** | **String**| Interval time between data points | [optional] [default to 5m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d]
+ **to** | **Long**| Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision | [optional]
+ **limit** | **Integer**| Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100]
+ **interval** | **String**| Interval time between data points. Note that `1w` means natural week(Mon-Sun), while `7d` means every 7d since unix 0. 30d represents a natural month, not 30 days | [optional] [default to 5m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d]
+ **timezone** | **String**| Time zone: all/utc0/utc8, default utc0 | [optional] [default to "utc0"]
### Return type
@@ -407,13 +435,94 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
+
+
+# **listFuturesPremiumIndex**
+> List<FuturesPremiumIndex> listFuturesPremiumIndex(settle, contract).from(from).to(to).limit(limit).interval(interval).execute();
+
+Premium Index K-line chart
+
+Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract
+ Long from = 1546905600L; // Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
+ Long to = 1546935600L; // Long | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision
+ Integer limit = 100; // Integer | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
+ String interval = "5m"; // String | Time interval between data points
+ try {
+ List result = apiInstance.listFuturesPremiumIndex(settle, contract)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .interval(interval)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#listFuturesPremiumIndex");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract |
+ **from** | **Long**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional]
+ **to** | **Long**| Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision | [optional]
+ **limit** | **Integer**| Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100]
+ **interval** | **String**| Time interval between data points | [optional] [default to 5m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d]
+
+### Return type
+
+[**List<FuturesPremiumIndex>**](FuturesPremiumIndex.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
# **listFuturesTickers**
> List<FuturesTicker> listFuturesTickers(settle).contract(contract).execute();
-List futures tickers
+Get all futures trading statistics
### Example
@@ -475,13 +584,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listFuturesFundingRateHistory**
-> List<FundingRateRecord> listFuturesFundingRateHistory(settle, contract).limit(limit).execute();
+> List<FundingRateRecord> listFuturesFundingRateHistory(settle, contract).limit(limit).from(from).to(to).execute();
-Funding rate history
+Futures market historical funding rate
### Example
@@ -502,10 +611,14 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
try {
List result = apiInstance.listFuturesFundingRateHistory(settle, contract)
.limit(limit)
+ .from(from)
+ .to(to)
.execute();
System.out.println(result);
} catch (GateApiException e) {
@@ -527,7 +640,9 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract |
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
### Return type
@@ -545,13 +660,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | History retrieved | - |
+**200** | History query successful | - |
# **listFuturesInsuranceLedger**
> List<InsuranceRecord> listFuturesInsuranceLedger(settle).limit(limit).execute();
-Futures insurance balance history
+Futures market insurance fund history
### Example
@@ -571,7 +686,7 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
try {
List result = apiInstance.listFuturesInsuranceLedger(settle)
.limit(limit)
@@ -595,7 +710,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
### Return type
@@ -613,13 +728,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listContractStats**
> List<ContractStat> listContractStats(settle, contract).from(from).interval(interval).limit(limit).execute();
-Futures stats
+Futures statistics
### Example
@@ -641,7 +756,7 @@ public class Example {
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
Long from = 1604561000L; // Long | Start timestamp
- String interval = "5m"; // String |
+ String interval = "\"5m\""; // String |
Integer limit = 30; // Integer |
try {
List result = apiInstance.listContractStats(settle, contract)
@@ -670,7 +785,7 @@ Name | Type | Description | Notes
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract |
**from** | **Long**| Start timestamp | [optional]
- **interval** | **String**| | [optional] [default to 5m] [enum: 5m, 15m, 30m, 1h, 4h, 1d]
+ **interval** | **String**| | [optional] [default to "5m"]
**limit** | **Integer**| | [optional] [default to 30]
### Return type
@@ -689,15 +804,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
-
-# **listLiquidatedOrders**
-> List<FuturesLiquidate> listLiquidatedOrders(settle).contract(contract).from(from).to(to).limit(limit).execute();
+
+# **getIndexConstituents**
+> FuturesIndexConstituents getIndexConstituents(settle, index)
-Retrieve liquidation history
-
-Interval between `from` and `to` cannot exceeds 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail.
+Query index constituents
### Example
@@ -717,23 +830,15 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
- Long from = 1547706332L; // Long | Start timestamp
- Long to = 1547706332L; // Long | End timestamp
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String index = "BTC_USDT"; // String | Index name
try {
- List result = apiInstance.listLiquidatedOrders(settle)
- .contract(contract)
- .from(from)
- .to(to)
- .limit(limit)
- .execute();
+ FuturesIndexConstituents result = apiInstance.getIndexConstituents(settle, index);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#listLiquidatedOrders");
+ System.err.println("Exception when calling FuturesApi#getIndexConstituents");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -747,14 +852,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract, return related data only if specified | [optional]
- **from** | **Long**| Start timestamp | [optional]
- **to** | **Long**| End timestamp | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **index** | **String**| Index name |
### Return type
-[**List<FuturesLiquidate>**](FuturesLiquidate.md)
+[**FuturesIndexConstituents**](FuturesIndexConstituents.md)
### Authorization
@@ -768,13 +870,15 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | Query successful | - |
-
-# **listFuturesAccounts**
-> FuturesAccount listFuturesAccounts(settle)
+
+# **listLiquidatedOrders**
+> List<FuturesLiqOrder> listLiquidatedOrders(settle).contract(contract).from(from).to(to).limit(limit).execute();
-Query futures account
+Query liquidation order history
+
+The time interval between from and to is maximum 3600. Some private fields are not returned by public interfaces, refer to field descriptions for details
### Example
@@ -784,7 +888,6 @@ import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
@@ -792,20 +895,26 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
try {
- FuturesAccount result = apiInstance.listFuturesAccounts(settle);
+ List result = apiInstance.listLiquidatedOrders(settle)
+ .contract(contract)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#listFuturesAccounts");
+ System.err.println("Exception when calling FuturesApi#listLiquidatedOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -819,14 +928,18 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
### Return type
-[**FuturesAccount**](FuturesAccount.md)
+[**List<FuturesLiqOrder>**](FuturesLiqOrder.md)
### Authorization
-[apiv4](../README.md#apiv4)
+No authorization required
### HTTP request headers
@@ -836,13 +949,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
-
-# **listFuturesAccountBook**
-> List<FuturesAccountBook> listFuturesAccountBook(settle).limit(limit).from(from).to(to).type(type).execute();
+
+# **listFuturesRiskLimitTiers**
+> List<FuturesLimitRiskTiers> listFuturesRiskLimitTiers(settle).contract(contract).limit(limit).offset(offset).execute();
-Query account book
+Query risk limit tiers
+
+When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty.
### Example
@@ -852,7 +967,6 @@ import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.FuturesApi;
@@ -860,29 +974,24 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Long from = 1547706332L; // Long | Start timestamp
- Long to = 1547706332L; // Long | End timestamp
- String type = "dnw"; // String | 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
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
try {
- List result = apiInstance.listFuturesAccountBook(settle)
+ List result = apiInstance.listFuturesRiskLimitTiers(settle)
+ .contract(contract)
.limit(limit)
- .from(from)
- .to(to)
- .type(type)
+ .offset(offset)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#listFuturesAccountBook");
+ System.err.println("Exception when calling FuturesApi#listFuturesRiskLimitTiers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -896,18 +1005,17 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **from** | **Long**| Start timestamp | [optional]
- **to** | **Long**| End timestamp | [optional]
- **type** | **String**| 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 | [optional] [enum: dnw, pnl, fee, refr, fund, point_dnw, point_fee, point_refr]
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
-[**List<FuturesAccountBook>**](FuturesAccountBook.md)
+[**List<FuturesLimitRiskTiers>**](FuturesLimitRiskTiers.md)
### Authorization
-[apiv4](../README.md#apiv4)
+No authorization required
### HTTP request headers
@@ -917,13 +1025,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | Query successful | - |
-
-# **listPositions**
-> List<Position> listPositions(settle)
+
+# **listFuturesAccounts**
+> FuturesAccount listFuturesAccounts(settle)
-List all positions of a user
+Get futures account
### Example
@@ -948,13 +1056,13 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
try {
- List result = apiInstance.listPositions(settle);
+ FuturesAccount result = apiInstance.listFuturesAccounts(settle);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#listPositions");
+ System.err.println("Exception when calling FuturesApi#listFuturesAccounts");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -971,7 +1079,7 @@ Name | Type | Description | Notes
### Return type
-[**List<Position>**](Position.md)
+[**FuturesAccount**](FuturesAccount.md)
### Authorization
@@ -985,13 +1093,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | Query successful | - |
-
-# **getPosition**
-> Position getPosition(settle, contract)
+
+# **listFuturesAccountBook**
+> List<FuturesAccountBook> listFuturesAccountBook(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).type(type).execute();
-Get single position
+Query futures account change history
+
+If the contract field is passed, only records containing this field after 2023-10-30 can be filtered.
### Example
@@ -1015,15 +1125,27 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ String type = "dnw"; // String | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction
try {
- Position result = apiInstance.getPosition(settle, contract);
+ List result = apiInstance.listFuturesAccountBook(settle)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .type(type)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#getPosition");
+ System.err.println("Exception when calling FuturesApi#listFuturesAccountBook");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1037,11 +1159,16 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **type** | **String**| Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction | [optional]
### Return type
-[**Position**](Position.md)
+[**List<FuturesAccountBook>**](FuturesAccountBook.md)
### Authorization
@@ -1055,13 +1182,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Position information | - |
+**200** | List retrieved successfully | - |
-
-# **updatePositionMargin**
-> Position updatePositionMargin(settle, contract, change)
+
+# **listPositions**
+> List<Position> listPositions(settle).holding(holding).limit(limit).offset(offset).execute();
-Update position margin
+Get user position list
### Example
@@ -1085,16 +1212,21 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
- String change = "0.01"; // String | Margin change. Use positive number to increase margin, negative number otherwise.
+ Boolean holding = true; // Boolean | Return only real positions - true, return all - false
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
try {
- Position result = apiInstance.updatePositionMargin(settle, contract, change);
+ List result = apiInstance.listPositions(settle)
+ .holding(holding)
+ .limit(limit)
+ .offset(offset)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#updatePositionMargin");
+ System.err.println("Exception when calling FuturesApi#listPositions");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1108,12 +1240,13 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
- **change** | **String**| Margin change. Use positive number to increase margin, negative number otherwise. |
+ **holding** | **Boolean**| Return only real positions - true, return all - false | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
-[**Position**](Position.md)
+[**List<Position>**](Position.md)
### Authorization
@@ -1127,13 +1260,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Position information | - |
+**200** | List retrieved successfully | - |
-
-# **updatePositionLeverage**
-> Position updatePositionLeverage(settle, contract, leverage, crossLeverageLimit)
+
+# **getPosition**
+> Position getPosition(settle, contract).execute();
-Update position leverage
+Get single position information
### Example
@@ -1158,16 +1291,15 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
- String leverage = "10"; // String | New position leverage
- String crossLeverageLimit = "10"; // String | Cross margin leverage(valid only when `leverage` is 0)
try {
- Position result = apiInstance.updatePositionLeverage(settle, contract, leverage, crossLeverageLimit);
+ Position result = apiInstance.getPosition(settle, contract)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#updatePositionLeverage");
+ System.err.println("Exception when calling FuturesApi#getPosition");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1182,8 +1314,6 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract |
- **leverage** | **String**| New position leverage |
- **crossLeverageLimit** | **String**| Cross margin leverage(valid only when `leverage` is 0) | [optional]
### Return type
@@ -1203,11 +1333,11 @@ Name | Type | Description | Notes
|-------------|-------------|------------------|
**200** | Position information | - |
-
-# **updatePositionRiskLimit**
-> Position updatePositionRiskLimit(settle, contract, riskLimit)
+
+# **updatePositionMargin**
+> Position updatePositionMargin(settle, contract, change)
-Update position risk limit
+Update position margin
### Example
@@ -1232,15 +1362,15 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
- String riskLimit = "10"; // String | New position risk limit
+ String change = "0.01"; // String | Margin change amount, positive number increases, negative number decreases
try {
- Position result = apiInstance.updatePositionRiskLimit(settle, contract, riskLimit);
+ Position result = apiInstance.updatePositionMargin(settle, contract, change);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#updatePositionRiskLimit");
+ System.err.println("Exception when calling FuturesApi#updatePositionMargin");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1255,7 +1385,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract |
- **riskLimit** | **String**| New position risk limit |
+ **change** | **String**| Margin change amount, positive number increases, negative number decreases |
### Return type
@@ -1275,13 +1405,11 @@ Name | Type | Description | Notes
|-------------|-------------|------------------|
**200** | Position information | - |
-
-# **setDualMode**
-> FuturesAccount setDualMode(settle, dualMode)
-
-Enable or disable dual mode
+
+# **updatePositionLeverage**
+> Position updatePositionLeverage(settle, contract, leverage, crossLeverageLimit, pid)
-Before setting dual mode, make sure all positions are closed and no orders are open
+Update position leverage
### Example
@@ -1305,15 +1433,18 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- Boolean dualMode = true; // Boolean | Whether to enable dual mode
+ String contract = "BTC_USDT"; // String | Futures contract
+ String leverage = "10"; // String | New position leverage
+ String crossLeverageLimit = "10"; // String | Cross margin leverage (valid only when `leverage` is 0)
+ Integer pid = 1; // Integer | Product ID
try {
- FuturesAccount result = apiInstance.setDualMode(settle, dualMode);
+ Position result = apiInstance.updatePositionLeverage(settle, contract, leverage, crossLeverageLimit, pid);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#setDualMode");
+ System.err.println("Exception when calling FuturesApi#updatePositionLeverage");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1327,11 +1458,14 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **dualMode** | **Boolean**| Whether to enable dual mode |
+ **contract** | **String**| Futures contract |
+ **leverage** | **String**| New position leverage |
+ **crossLeverageLimit** | **String**| Cross margin leverage (valid only when `leverage` is 0) | [optional]
+ **pid** | **Integer**| Product ID | [optional]
### Return type
-[**FuturesAccount**](FuturesAccount.md)
+[**Position**](Position.md)
### Authorization
@@ -1345,13 +1479,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Updated | - |
+**200** | Position information | - |
-
-# **getDualModePosition**
-> List<Position> getDualModePosition(settle, contract)
+
+# **updatePositionCrossMode**
+> Position updatePositionCrossMode(settle, futuresPositionCrossMode)
-Retrieve position detail in dual mode
+Switch Position Margin Mode
### Example
@@ -1375,15 +1509,15 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
+ FuturesPositionCrossMode futuresPositionCrossMode = new FuturesPositionCrossMode(); // FuturesPositionCrossMode |
try {
- List result = apiInstance.getDualModePosition(settle, contract);
+ Position result = apiInstance.updatePositionCrossMode(settle, futuresPositionCrossMode);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#getDualModePosition");
+ System.err.println("Exception when calling FuturesApi#updatePositionCrossMode");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1397,11 +1531,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
+ **futuresPositionCrossMode** | [**FuturesPositionCrossMode**](FuturesPositionCrossMode.md)| |
### Return type
-[**List<Position>**](Position.md)
+[**Position**](Position.md)
### Authorization
@@ -1409,19 +1543,19 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: Not defined
+ - **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Position information | - |
-
-# **updateDualModePositionMargin**
-> List<Position> updateDualModePositionMargin(settle, contract, change, dualSide)
+
+# **updateDualCompPositionCrossMode**
+> List<Position> updateDualCompPositionCrossMode(settle, inlineObject)
-Update position margin in dual mode
+Switch Between Cross and Isolated Margin Modes Under Hedge Mode
### Example
@@ -1445,17 +1579,15 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
- String change = "0.01"; // String | Margin change. Use positive number to increase margin, negative number otherwise.
- String dualSide = "dual_long"; // String | Long or short position
+ InlineObject inlineObject = new InlineObject(); // InlineObject |
try {
- List result = apiInstance.updateDualModePositionMargin(settle, contract, change, dualSide);
+ List result = apiInstance.updateDualCompPositionCrossMode(settle, inlineObject);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#updateDualModePositionMargin");
+ System.err.println("Exception when calling FuturesApi#updateDualCompPositionCrossMode");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1469,9 +1601,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
- **change** | **String**| Margin change. Use positive number to increase margin, negative number otherwise. |
- **dualSide** | **String**| Long or short position | [enum: dual_long, dual_short]
+ **inlineObject** | [**InlineObject**](InlineObject.md)| |
### Return type
@@ -1483,19 +1613,308 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: Not defined
+ - **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
-
-# **updateDualModePositionLeverage**
-> List<Position> updateDualModePositionLeverage(settle, contract, leverage)
+
+# **updatePositionRiskLimit**
+> Position updatePositionRiskLimit(settle, contract, riskLimit)
-Update position leverage in dual mode
+Update position risk limit
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract
+ String riskLimit = "1000000"; // String | New risk limit value
+ try {
+ Position result = apiInstance.updatePositionRiskLimit(settle, contract, riskLimit);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#updatePositionRiskLimit");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract |
+ **riskLimit** | **String**| New risk limit value |
+
+### Return type
+
+[**Position**](Position.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Position information | - |
+
+
+# **setDualMode**
+> FuturesAccount setDualMode(settle, dualMode)
+
+Set position mode
+
+The prerequisite for changing mode is that all positions have no holdings and no pending orders
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ Boolean dualMode = true; // Boolean | Whether to enable dual mode
+ try {
+ FuturesAccount result = apiInstance.setDualMode(settle, dualMode);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#setDualMode");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **dualMode** | **Boolean**| Whether to enable dual mode |
+
+### Return type
+
+[**FuturesAccount**](FuturesAccount.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Updated successfully | - |
+
+
+# **getDualModePosition**
+> List<Position> getDualModePosition(settle, contract).execute();
+
+Get position information in dual mode
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract
+ try {
+ List result = apiInstance.getDualModePosition(settle, contract)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#getDualModePosition");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract |
+
+### Return type
+
+[**List<Position>**](Position.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **updateDualModePositionMargin**
+> List<Position> updateDualModePositionMargin(settle, contract, change, dualSide)
+
+Update position margin in dual mode
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract
+ String change = "0.01"; // String | Margin change amount, positive number increases, negative number decreases
+ String dualSide = "dual_long"; // String | Long or short position
+ try {
+ List result = apiInstance.updateDualModePositionMargin(settle, contract, change, dualSide);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#updateDualModePositionMargin");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract |
+ **change** | **String**| Margin change amount, positive number increases, negative number decreases |
+ **dualSide** | **String**| Long or short position |
+
+### Return type
+
+[**List<Position>**](Position.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **updateDualModePositionLeverage**
+> List<Position> updateDualModePositionLeverage(settle, contract, leverage, crossLeverageLimit)
+
+Update position leverage in dual mode
### Example
@@ -1521,14 +1940,703 @@ public class Example {
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
String leverage = "10"; // String | New position leverage
+ String crossLeverageLimit = "10"; // String | Cross margin leverage (valid only when `leverage` is 0)
+ try {
+ List result = apiInstance.updateDualModePositionLeverage(settle, contract, leverage, crossLeverageLimit);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#updateDualModePositionLeverage");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract |
+ **leverage** | **String**| New position leverage |
+ **crossLeverageLimit** | **String**| Cross margin leverage (valid only when `leverage` is 0) | [optional]
+
+### Return type
+
+[**List<Position>**](Position.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **updateDualModePositionRiskLimit**
+> List<Position> updateDualModePositionRiskLimit(settle, contract, riskLimit)
+
+Update position risk limit in dual mode
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract
+ String riskLimit = "1000000"; // String | New risk limit value
+ try {
+ List result = apiInstance.updateDualModePositionRiskLimit(settle, contract, riskLimit);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#updateDualModePositionRiskLimit");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract |
+ **riskLimit** | **String**| New risk limit value |
+
+### Return type
+
+[**List<Position>**](Position.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listFuturesOrders**
+> List<FuturesOrder> listFuturesOrders(settle, status).contract(contract).limit(limit).offset(offset).lastId(lastId).execute();
+
+Query futures order list
+
+- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String status = "open"; // String | Query order list based on status
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ String lastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used
+ try {
+ List result = apiInstance.listFuturesOrders(settle, status)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .lastId(lastId)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#listFuturesOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **status** | **String**| Query order list based on status |
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **lastId** | **String**| Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional]
+
+### Return type
+
+[**List<FuturesOrder>**](FuturesOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
|
+
+
+# **createFuturesOrder**
+> FuturesOrder createFuturesOrder(settle, futuresOrder, xGateExptime)
+
+Place futures order
+
+- When placing an order, the number of contracts is specified `size`, not the number of coins. The number of coins corresponding to each contract is returned in the contract details interface `quanto_multiplier` - 0 The order that was completed cannot be obtained after 10 minutes of withdrawal, and the order will be mentioned that the order does not exist - Setting `reduce_only` to `true` can prevent the position from being penetrated when reducing the position - In single-position mode, if you need to close the position, you need to set `size` to 0 and `close` to `true` - In dual warehouse mode, - Reduce position: reduce_only=true, size is a positive number that indicates short position, negative number that indicates long position - Add number that indicates adding long positions, and negative numbers indicate adding short positions - Close position: size=0, set the direction of closing position according to auto_size, and set `reduce_only` to true at the same time - reduce_only: Make sure to only perform position reduction operations to prevent increased positions - Set `stp_act` to determine the use of a strategy that restricts user transactions. For detailed usage, refer to the body parameter `stp_act`
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ FuturesOrder futuresOrder = new FuturesOrder(); // FuturesOrder |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
+ try {
+ FuturesOrder result = apiInstance.createFuturesOrder(settle, futuresOrder, xGateExptime);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#createFuturesOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **futuresOrder** | [**FuturesOrder**](FuturesOrder.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
+
+### Return type
+
+[**FuturesOrder**](FuturesOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**201** | Order details | - |
+
+
+# **cancelFuturesOrders**
+> List<FuturesOrder> cancelFuturesOrders(settle, contract, xGateExptime, side, excludeReduceOnly, text)
+
+Cancel all orders with 'open' status
+
+Zero-fill orders cannot be retrieved 10 minutes after order cancellation
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
+ String side = "ask"; // String | Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders
+ Boolean excludeReduceOnly = false; // Boolean | Whether to exclude reduce-only orders
+ String text = "cancel by user"; // String | Remark for order cancellation
+ try {
+ List result = apiInstance.cancelFuturesOrders(settle, contract, xGateExptime, side, excludeReduceOnly, text);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#cancelFuturesOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
+ **side** | **String**| Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders | [optional]
+ **excludeReduceOnly** | **Boolean**| Whether to exclude reduce-only orders | [optional] [default to false]
+ **text** | **String**| Remark for order cancellation | [optional]
+
+### Return type
+
+[**List<FuturesOrder>**](FuturesOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Batch cancellation successful | - |
+
+
+# **getOrdersWithTimeRange**
+> List<FuturesOrder> getOrdersWithTimeRange(settle).contract(contract).from(from).to(to).limit(limit).offset(offset).execute();
+
+Query futures order list by time range
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ try {
+ List result = apiInstance.getOrdersWithTimeRange(settle)
+ .contract(contract)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .offset(offset)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#getOrdersWithTimeRange");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+
+### Return type
+
+[**List<FuturesOrder>**](FuturesOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
|
+
+
+# **createBatchFuturesOrder**
+> List<BatchFuturesOrder> createBatchFuturesOrder(settle, futuresOrder, xGateExptime)
+
+Place batch 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
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ List futuresOrder = Arrays.asList(); // List |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
+ try {
+ List result = apiInstance.createBatchFuturesOrder(settle, futuresOrder, xGateExptime);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#createBatchFuturesOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **futuresOrder** | [**List<FuturesOrder>**](FuturesOrder.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
+
+### Return type
+
+[**List<BatchFuturesOrder>**](BatchFuturesOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Request execution completed | - |
+
+
+# **getFuturesOrder**
+> FuturesOrder getFuturesOrder(settle, orderId)
+
+Query single order details
+
+- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String 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. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted.
+ try {
+ FuturesOrder result = apiInstance.getFuturesOrder(settle, orderId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#getFuturesOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **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. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. |
+
+### Return type
+
+[**FuturesOrder**](FuturesOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order details | - |
+
+
+# **amendFuturesOrder**
+> FuturesOrder amendFuturesOrder(settle, orderId, futuresOrderAmendment, xGateExptime)
+
+Amend single order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String 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. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted.
+ FuturesOrderAmendment futuresOrderAmendment = new FuturesOrderAmendment(); // FuturesOrderAmendment |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
+ try {
+ FuturesOrder result = apiInstance.amendFuturesOrder(settle, orderId, futuresOrderAmendment, xGateExptime);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#amendFuturesOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **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. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. |
+ **futuresOrderAmendment** | [**FuturesOrderAmendment**](FuturesOrderAmendment.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
+
+### Return type
+
+[**FuturesOrder**](FuturesOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order details | - |
+
+
+# **cancelFuturesOrder**
+> FuturesOrder cancelFuturesOrder(settle, orderId, xGateExptime)
+
+Cancel single order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String 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. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted.
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- List result = apiInstance.updateDualModePositionLeverage(settle, contract, leverage);
+ FuturesOrder result = apiInstance.cancelFuturesOrder(settle, orderId, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#updateDualModePositionLeverage");
+ System.err.println("Exception when calling FuturesApi#cancelFuturesOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1542,12 +2650,12 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
- **leverage** | **String**| New position leverage |
+ **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. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
-[**List<Position>**](Position.md)
+[**FuturesOrder**](FuturesOrder.md)
### Authorization
@@ -1561,13 +2669,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Order details | - |
-
-# **updateDualModePositionRiskLimit**
-> List<Position> updateDualModePositionRiskLimit(settle, contract, riskLimit)
+
+# **getMyTrades**
+> List<MyFuturesTrade> getMyTrades(settle).contract(contract).order(order).limit(limit).offset(offset).lastId(lastId).execute();
-Update position risk limit in dual mode
+Query personal trading records
+
+By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`.
### Example
@@ -1591,16 +2701,25 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
- String riskLimit = "10"; // String | New position risk limit
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Long order = 12345L; // Long | Futures order ID, return related data only if specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ String lastId = "12345"; // String | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'.
try {
- List result = apiInstance.updateDualModePositionRiskLimit(settle, contract, riskLimit);
+ List result = apiInstance.getMyTrades(settle)
+ .contract(contract)
+ .order(order)
+ .limit(limit)
+ .offset(offset)
+ .lastId(lastId)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#updateDualModePositionRiskLimit");
+ System.err.println("Exception when calling FuturesApi#getMyTrades");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1614,12 +2733,15 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
- **riskLimit** | **String**| New position risk limit |
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **order** | **Long**| Futures order ID, return related data only if specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| 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. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. | [optional]
### Return type
-[**List<Position>**](Position.md)
+[**List<MyFuturesTrade>**](MyFuturesTrade.md)
### Authorization
@@ -1633,15 +2755,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **listFuturesOrders**
-> List<FuturesOrder> listFuturesOrders(settle, contract, status).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
+**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
|
-List futures orders
+
+# **getMyTradesWithTimeRange**
+> List<MyFuturesTradeTimeRange> getMyTradesWithTimeRange(settle).contract(contract).from(from).to(to).limit(limit).offset(offset).role(role).execute();
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Query personal trading records by time range
### Example
@@ -1665,25 +2785,27 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
- String status = "open"; // String | Only list the orders with this status
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
- String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
- Integer countTotal = 0; // Integer | Whether to return total number matched. Default to 0(no return)
+ String role = "maker"; // String | Query role, maker or taker
try {
- List result = apiInstance.listFuturesOrders(settle, contract, status)
+ List result = apiInstance.getMyTradesWithTimeRange(settle)
+ .contract(contract)
+ .from(from)
+ .to(to)
.limit(limit)
.offset(offset)
- .lastId(lastId)
- .countTotal(countTotal)
+ .role(role)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#listFuturesOrders");
+ System.err.println("Exception when calling FuturesApi#getMyTradesWithTimeRange");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1697,16 +2819,16 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
- **status** | **String**| Only list the orders with this status | [enum: open, finished]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| 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]
- **countTotal** | **Integer**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] [enum: 0, 1]
+ **role** | **String**| Query role, maker or taker | [optional]
### Return type
-[**List<FuturesOrder>**](FuturesOrder.md)
+[**List<MyFuturesTradeTimeRange>**](MyFuturesTradeTimeRange.md)
### Authorization
@@ -1720,15 +2842,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
|
+**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
|
-
-# **createFuturesOrder**
-> FuturesOrder createFuturesOrder(settle, futuresOrder)
-
-Create a futures order
+
+# **listPositionClose**
+> List<PositionClose> listPositionClose(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).side(side).pnl(pnl).execute();
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Query position close history
### Example
@@ -1752,15 +2872,29 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- FuturesOrder futuresOrder = new FuturesOrder(); // FuturesOrder |
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ String side = "short"; // String | Query side. long or shot
+ String pnl = "profit"; // String | Query profit or loss
try {
- FuturesOrder result = apiInstance.createFuturesOrder(settle, futuresOrder);
+ List result = apiInstance.listPositionClose(settle)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .side(side)
+ .pnl(pnl)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#createFuturesOrder");
+ System.err.println("Exception when calling FuturesApi#listPositionClose");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1774,11 +2908,17 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **futuresOrder** | [**FuturesOrder**](FuturesOrder.md)| |
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **side** | **String**| Query side. long or shot | [optional]
+ **pnl** | **String**| Query profit or loss | [optional]
### Return type
-[**FuturesOrder**](FuturesOrder.md)
+[**List<PositionClose>**](PositionClose.md)
### Authorization
@@ -1786,21 +2926,19 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
+ - **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**201** | Order details | - |
-
-
-# **cancelFuturesOrders**
-> List<FuturesOrder> cancelFuturesOrders(settle, contract, side)
+**200** | List retrieved successfully | - |
-Cancel all `open` orders matched
+
+# **listLiquidates**
+> List<FuturesLiquidate> listLiquidates(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).at(at).execute();
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Query liquidation history
### Example
@@ -1824,16 +2962,27 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
- String side = "ask"; // String | All bids or asks. Both included if not specified
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ Integer at = 0; // Integer | Specify liquidation timestamp
try {
- List result = apiInstance.cancelFuturesOrders(settle, contract, side);
+ List result = apiInstance.listLiquidates(settle)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .at(at)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#cancelFuturesOrders");
+ System.err.println("Exception when calling FuturesApi#listLiquidates");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1847,12 +2996,16 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
- **side** | **String**| All bids or asks. Both included if not specified | [optional] [enum: ask, bid]
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **at** | **Integer**| Specify liquidation timestamp | [optional] [default to 0]
### Return type
-[**List<FuturesOrder>**](FuturesOrder.md)
+[**List<FuturesLiquidate>**](FuturesLiquidate.md)
### Authorization
@@ -1866,15 +3019,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | All orders matched cancelled | - |
-
-
-# **getFuturesOrder**
-> FuturesOrder getFuturesOrder(settle, orderId)
+**200** | List retrieved successfully | - |
-Get a single order
+
+# **listAutoDeleverages**
+> List<FuturesAutoDeleverage> listAutoDeleverages(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).at(at).execute();
-Zero-fill order cannot be retrieved for 60 seconds after cancellation
+Query ADL auto-deleveraging order information
### Example
@@ -1898,15 +3049,27 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String 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.
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ Integer at = 0; // Integer | Specify auto-deleveraging timestamp
try {
- FuturesOrder result = apiInstance.getFuturesOrder(settle, orderId);
+ List result = apiInstance.listAutoDeleverages(settle)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .at(at)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#getFuturesOrder");
+ System.err.println("Exception when calling FuturesApi#listAutoDeleverages");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1920,11 +3083,16 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **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. |
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **at** | **Integer**| Specify auto-deleveraging timestamp | [optional] [default to 0]
### Return type
-[**FuturesOrder**](FuturesOrder.md)
+[**List<FuturesAutoDeleverage>**](FuturesAutoDeleverage.md)
### Authorization
@@ -1938,13 +3106,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Order details | - |
+**200** | List retrieved successfully | - |
-
-# **cancelFuturesOrder**
-> FuturesOrder cancelFuturesOrder(settle, orderId)
+
+# **countdownCancelAllFutures**
+> TriggerTime countdownCancelAllFutures(settle, countdownCancelAllFuturesTask)
+
+Countdown cancel orders
-Cancel a single order
+Heartbeat detection for contract orders: When the user-set `timeout` time is reached, if neither the existing countdown is canceled nor a new countdown is set, the relevant contract orders will be automatically canceled. This API can be called repeatedly to or cancel the countdown. Usage example: Repeatedly call this API at 30-second intervals, setting the `timeout` to 30 (seconds) each time. If this API is not called again within 30 seconds, all open orders on your specified `market` will be automatically canceled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will terminate, and the automatic order cancellation function will be disabled.
### Example
@@ -1968,15 +3138,15 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String 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.
+ CountdownCancelAllFuturesTask countdownCancelAllFuturesTask = new CountdownCancelAllFuturesTask(); // CountdownCancelAllFuturesTask |
try {
- FuturesOrder result = apiInstance.cancelFuturesOrder(settle, orderId);
+ TriggerTime result = apiInstance.countdownCancelAllFutures(settle, countdownCancelAllFuturesTask);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#cancelFuturesOrder");
+ System.err.println("Exception when calling FuturesApi#countdownCancelAllFutures");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1990,11 +3160,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **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. |
+ **countdownCancelAllFuturesTask** | [**CountdownCancelAllFuturesTask**](CountdownCancelAllFuturesTask.md)| |
### Return type
-[**FuturesOrder**](FuturesOrder.md)
+[**TriggerTime**](TriggerTime.md)
### Authorization
@@ -2002,19 +3172,19 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: Not defined
+ - **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Order details | - |
+**200** | Countdown set successfully | - |
-
-# **getMyTrades**
-> List<MyFuturesTrade> getMyTrades(settle).contract(contract).order(order).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
+
+# **getFuturesFee**
+> Map<String, FuturesFee> getFuturesFee(settle).contract(contract).execute();
-List personal trading history
+Query futures market trading fee rates
### Example
@@ -2039,26 +3209,16 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
- Long order = 12345L; // Long | Futures order ID, return related data only if specified
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Integer offset = 0; // Integer | List offset, starting from 0
- String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
- Integer countTotal = 0; // Integer | Whether to return total number matched. Default to 0(no return)
try {
- List result = apiInstance.getMyTrades(settle)
+ Map result = apiInstance.getFuturesFee(settle)
.contract(contract)
- .order(order)
- .limit(limit)
- .offset(offset)
- .lastId(lastId)
- .countTotal(countTotal)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#getMyTrades");
+ System.err.println("Exception when calling FuturesApi#getFuturesFee");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -2073,15 +3233,10 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
**contract** | **String**| Futures contract, return related data only if specified | [optional]
- **order** | **Long**| Futures order ID, return related data only if specified | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **offset** | **Integer**| 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]
- **countTotal** | **Integer**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] [enum: 0, 1]
### Return type
-[**List<MyFuturesTrade>**](MyFuturesTrade.md)
+[**Map<String, FuturesFee>**](FuturesFee.md)
### Authorization
@@ -2095,13 +3250,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
|
+**200** | Query successful | - |
-
-# **listPositionClose**
-> List<PositionClose> listPositionClose(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).execute();
+
+# **cancelBatchFutureOrders**
+> List<FutureCancelOrderResult> cancelBatchFutureOrders(settle, requestBody, xGateExptime)
-List position close history
+Cancel batch orders by specified ID list
+
+Multiple different order IDs can be specified, maximum 20 records per request
### Example
@@ -2125,25 +3282,16 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Integer offset = 0; // Integer | List offset, starting from 0
- Long from = 1547706332L; // Long | Start timestamp
- Long to = 1547706332L; // Long | End timestamp
+ List requestBody = Arrays.asList(); // List |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- List result = apiInstance.listPositionClose(settle)
- .contract(contract)
- .limit(limit)
- .offset(offset)
- .from(from)
- .to(to)
- .execute();
+ List result = apiInstance.cancelBatchFutureOrders(settle, requestBody, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#listPositionClose");
+ System.err.println("Exception when calling FuturesApi#cancelBatchFutureOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -2157,15 +3305,12 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract, return related data only if specified | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
- **from** | **Long**| Start timestamp | [optional]
- **to** | **Long**| End timestamp | [optional]
+ **requestBody** | [**List<String>**](String.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
-[**List<PositionClose>**](PositionClose.md)
+[**List<FutureCancelOrderResult>**](FutureCancelOrderResult.md)
### Authorization
@@ -2173,19 +3318,21 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: Not defined
+ - **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | Order cancellation operation completed | - |
-
-# **listLiquidates**
-> List<FuturesLiquidate> listLiquidates(settle).contract(contract).limit(limit).at(at).execute();
+
+# **amendBatchFutureOrders**
+> List<BatchFuturesOrder> amendBatchFutureOrders(settle, batchAmendOrderReq, xGateExptime)
+
+Batch modify orders by specified IDs
-List liquidation history
+Multiple different order IDs can be specified, maximum 10 orders per request
### Example
@@ -2209,21 +3356,16 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Integer at = 0; // Integer | Specify a liquidation timestamp
+ List batchAmendOrderReq = Arrays.asList(); // List |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- List result = apiInstance.listLiquidates(settle)
- .contract(contract)
- .limit(limit)
- .at(at)
- .execute();
+ List result = apiInstance.amendBatchFutureOrders(settle, batchAmendOrderReq, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling FuturesApi#listLiquidates");
+ System.err.println("Exception when calling FuturesApi#amendBatchFutureOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -2237,18 +3379,85 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract, return related data only if specified | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **at** | **Integer**| Specify a liquidation timestamp | [optional] [default to 0]
+ **batchAmendOrderReq** | [**List<BatchAmendOrderReq>**](BatchAmendOrderReq.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
-[**List<FuturesLiquidate>**](FuturesLiquidate.md)
+[**List<BatchFuturesOrder>**](BatchFuturesOrder.md)
### Authorization
[apiv4](../README.md#apiv4)
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Request execution completed | - |
+
+
+# **getFuturesRiskLimitTable**
+> List<FuturesRiskLimitTier> getFuturesRiskLimitTable(settle, tableId)
+
+Query risk limit table by table_id
+
+Just pass table_id
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.FuturesApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ FuturesApi apiInstance = new FuturesApi(defaultClient);
+ String settle = "usdt"; // String | Settle currency
+ String tableId = "CYBER_USDT_20241122"; // String | Risk limit table ID
+ try {
+ List result = apiInstance.getFuturesRiskLimitTable(settle, tableId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FuturesApi#getFuturesRiskLimitTable");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **settle** | **String**| Settle currency | [enum: btc, usdt]
+ **tableId** | **String**| Risk limit table ID |
+
+### Return type
+
+[**List<FuturesRiskLimitTier>**](FuturesRiskLimitTier.md)
+
+### Authorization
+
+No authorization required
+
### HTTP request headers
- **Content-Type**: Not defined
@@ -2257,13 +3466,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | Query successful | - |
# **listPriceTriggeredOrders**
> List<FuturesPriceTriggeredOrder> listPriceTriggeredOrders(settle, status).contract(contract).limit(limit).offset(offset).execute();
-List all auto orders
+Query auto order list
### Example
@@ -2287,9 +3496,9 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String status = "status_example"; // String | Only list the orders with this status
+ String status = "status_example"; // String | Query order list based on status
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
try {
List result = apiInstance.listPriceTriggeredOrders(settle, status)
@@ -2316,9 +3525,9 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **status** | **String**| Only list the orders with this status | [enum: open, finished]
+ **status** | **String**| Query order list based on status | [enum: open, finished]
**contract** | **String**| Futures contract, return related data only if specified | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
@@ -2337,13 +3546,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **createPriceTriggeredOrder**
> TriggerOrderResponse createPriceTriggeredOrder(settle, futuresPriceTriggeredOrder)
-Create a price-triggered order
+Create price-triggered order
### Example
@@ -2407,13 +3616,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**201** | Order created | - |
+**201** | Order created successfully | - |
# **cancelPriceTriggeredOrderList**
> List<FuturesPriceTriggeredOrder> cancelPriceTriggeredOrderList(settle, contract)
-Cancel all open orders
+Cancel all auto orders
### Example
@@ -2437,7 +3646,7 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String contract = "BTC_USDT"; // String | Futures contract
+ String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
try {
List result = apiInstance.cancelPriceTriggeredOrderList(settle, contract);
System.out.println(result);
@@ -2459,7 +3668,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **contract** | **String**| Futures contract |
+ **contract** | **String**| Futures contract, return related data only if specified | [optional]
### Return type
@@ -2477,13 +3686,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Batch cancellation request accepted. Query order status by listing orders | - |
+**200** | Batch cancellation request accepted and processed, success determined by order list | - |
# **getPriceTriggeredOrder**
> FuturesPriceTriggeredOrder getPriceTriggeredOrder(settle, orderId)
-Get a single order
+Query single auto order details
### Example
@@ -2507,7 +3716,7 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "orderId_example"; // String | ID returned when order is successfully created
try {
FuturesPriceTriggeredOrder result = apiInstance.getPriceTriggeredOrder(settle, orderId);
System.out.println(result);
@@ -2529,7 +3738,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -2547,13 +3756,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Auto order detail | - |
+**200** | Auto order details | - |
# **cancelPriceTriggeredOrder**
> FuturesPriceTriggeredOrder cancelPriceTriggeredOrder(settle, orderId)
-Cancel a single order
+Cancel single auto order
### Example
@@ -2577,7 +3786,7 @@ public class Example {
FuturesApi apiInstance = new FuturesApi(defaultClient);
String settle = "usdt"; // String | Settle currency
- String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "orderId_example"; // String | ID returned when order is successfully created
try {
FuturesPriceTriggeredOrder result = apiInstance.cancelPriceTriggeredOrder(settle, orderId);
System.out.println(result);
@@ -2599,7 +3808,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**settle** | **String**| Settle currency | [enum: btc, usdt]
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -2617,5 +3826,5 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Auto order detail | - |
+**200** | Auto order details | - |
diff --git a/docs/FuturesAutoDeleverage.md b/docs/FuturesAutoDeleverage.md
new file mode 100644
index 0000000..30e8f27
--- /dev/null
+++ b/docs/FuturesAutoDeleverage.md
@@ -0,0 +1,18 @@
+
+# FuturesAutoDeleverage
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Long** | Automatic deleveraging time | [optional] [readonly]
+**user** | **Long** | User ID | [optional] [readonly]
+**orderId** | **Long** | Order ID. Order IDs before 2023-02-20 are null | [optional] [readonly]
+**contract** | **String** | Futures contract | [optional] [readonly]
+**leverage** | **String** | Position leverage | [optional] [readonly]
+**crossLeverageLimit** | **String** | Cross margin leverage (valid only when `leverage` is 0) | [optional] [readonly]
+**entryPrice** | **String** | Average entry price | [optional] [readonly]
+**fillPrice** | **String** | Average fill price | [optional] [readonly]
+**tradeSize** | **Long** | Trading size | [optional] [readonly]
+**positionSize** | **Long** | Positions after auto-deleveraging | [optional] [readonly]
+
diff --git a/docs/FuturesBatchAmendOrderRequest.md b/docs/FuturesBatchAmendOrderRequest.md
new file mode 100644
index 0000000..246fed6
--- /dev/null
+++ b/docs/FuturesBatchAmendOrderRequest.md
@@ -0,0 +1,15 @@
+
+# FuturesBatchAmendOrderRequest
+
+Modify contract order parameters
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order id, order_id and text must contain at least one | [optional]
+**text** | **String** | User-defined order text, at least one of order_id and text must be passed | [optional]
+**size** | **Long** | New order size, including filled size. - If less than or equal to the filled quantity, the order will be cancelled. - The new order side must be identical to the original one. - Close order size cannot be modified. - For reduce-only orders, increasing the size may cancel other reduce-only orders. - If the price is not modified, decreasing the size will not affect the depth queue, while increasing the size will place it at the end of the current price level. | [optional]
+**price** | **String** | New order price | [optional]
+**amendText** | **String** | Custom info during order amendment | [optional]
+
diff --git a/docs/FuturesCandlestick.md b/docs/FuturesCandlestick.md
index 910b21c..11ce407 100644
--- a/docs/FuturesCandlestick.md
+++ b/docs/FuturesCandlestick.md
@@ -8,9 +8,10 @@ data point in every timestamp
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**t** | **Double** | Unix timestamp in seconds | [optional]
-**v** | **Long** | size volume. Only returned if `contract` is not prefixed | [optional]
-**c** | **String** | Close price | [optional]
-**h** | **String** | Highest price | [optional]
-**l** | **String** | Lowest price | [optional]
-**o** | **String** | Open price | [optional]
+**v** | **Long** | size volume (contract size). Only returned if `contract` is not prefixed | [optional]
+**c** | **String** | Close price (quote currency) | [optional]
+**h** | **String** | Highest price (quote currency) | [optional]
+**l** | **String** | Lowest price (quote currency) | [optional]
+**o** | **String** | Open price (quote currency) | [optional]
+**sum** | **String** | Trading volume (unit: Quote currency) | [optional]
diff --git a/docs/FuturesFee.md b/docs/FuturesFee.md
new file mode 100644
index 0000000..c3b9cbd
--- /dev/null
+++ b/docs/FuturesFee.md
@@ -0,0 +1,12 @@
+
+# FuturesFee
+
+The returned result is a map type, where the key represents the market and taker and maker fee rates
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**takerFee** | **String** | Taker fee | [optional] [readonly]
+**makerFee** | **String** | maker fee | [optional] [readonly]
+
diff --git a/docs/FuturesIndexConstituents.md b/docs/FuturesIndexConstituents.md
new file mode 100644
index 0000000..506c53c
--- /dev/null
+++ b/docs/FuturesIndexConstituents.md
@@ -0,0 +1,10 @@
+
+# FuturesIndexConstituents
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**index** | **String** | Index name | [optional] [readonly]
+**constituents** | [**List<IndexConstituent>**](IndexConstituent.md) | Constituents | [optional] [readonly]
+
diff --git a/docs/FuturesInitialOrder.md b/docs/FuturesInitialOrder.md
index 2ec18f1..3c1f79d 100644
--- a/docs/FuturesInitialOrder.md
+++ b/docs/FuturesInitialOrder.md
@@ -6,12 +6,13 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**contract** | **String** | Futures contract |
-**size** | **Long** | Order size. Positive size means to buy, while negative one means to sell. Set to 0 to close the position | [optional]
+**size** | **Long** | Represents the number of contracts that need to be closed, full closing: size=0 Partial closing: plan-close-short-position size>0 Partial closing: plan-close-long-position size<0 | [optional]
**price** | **String** | Order price. Set to 0 to use market price |
-**close** | **Boolean** | Set to true if trying to close the position | [optional]
-**tif** | [**TifEnum**](#TifEnum) | Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled | [optional]
-**text** | **String** | How the order is created. Possible values are: web, api and app | [optional]
-**reduceOnly** | **Boolean** | Set to true to create a reduce-only order | [optional]
+**close** | **Boolean** | When all positions are closed in a single position mode, it must be set to true to perform the closing operation When partially closed positions in single-store mode/double-store mode, you can not set close, or close=false | [optional]
+**tif** | [**TifEnum**](#TifEnum) | Time in force strategy, default is gtc, market orders currently only support ioc mode - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled | [optional]
+**text** | **String** | The source of the order, including: - web: Web - api: API call - app: Mobile app | [optional]
+**reduceOnly** | **Boolean** | When set to true, perform automatic position reduction operation. Set to true to ensure that the order will not open a new position, and is only used to close or reduce positions | [optional]
+**autoSize** | **String** | Single position mode: auto_size is not required Dual position mode full closing (size=0): auto_size must be set, close_long for closing long positions, close_short for closing short positions Dual position mode partial closing (size≠0): auto_size is not required | [optional]
**isReduceOnly** | **Boolean** | Is the order reduce-only | [optional] [readonly]
**isClose** | **Boolean** | Is the order to close position | [optional] [readonly]
diff --git a/docs/FuturesLimitRiskTiers.md b/docs/FuturesLimitRiskTiers.md
new file mode 100644
index 0000000..9b69262
--- /dev/null
+++ b/docs/FuturesLimitRiskTiers.md
@@ -0,0 +1,17 @@
+
+# FuturesLimitRiskTiers
+
+Retrieve risk limit configurations for different tiers under a specified contract
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tier** | **Integer** | Tier | [optional]
+**riskLimit** | **String** | Position risk limit | [optional]
+**initialRate** | **String** | Initial margin rate | [optional]
+**maintenanceRate** | **String** | Maintenance margin rate | [optional]
+**leverageMax** | **String** | Maximum leverage | [optional]
+**contract** | **String** | Market, only visible when market pagination is requested | [optional]
+**deduction** | **String** | Maintenance margin quick calculation deduction amount | [optional]
+
diff --git a/docs/FuturesLiqOrder.md b/docs/FuturesLiqOrder.md
new file mode 100644
index 0000000..5b681bd
--- /dev/null
+++ b/docs/FuturesLiqOrder.md
@@ -0,0 +1,15 @@
+
+# FuturesLiqOrder
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Long** | Liquidation time | [optional] [readonly]
+**contract** | **String** | Futures contract | [optional] [readonly]
+**size** | **Long** | User position size | [optional] [readonly]
+**orderSize** | **Long** | Number of forced liquidation orders | [optional] [readonly]
+**orderPrice** | **String** | Liquidation order price | [optional] [readonly]
+**fillPrice** | **String** | Liquidation order average taker price | [optional] [readonly]
+**left** | **Long** | System liquidation order maker size | [optional] [readonly]
+
diff --git a/docs/FuturesLiquidate.md b/docs/FuturesLiquidate.md
index 4f6d8f0..82f4b49 100644
--- a/docs/FuturesLiquidate.md
+++ b/docs/FuturesLiquidate.md
@@ -7,13 +7,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **Long** | Liquidation time | [optional] [readonly]
**contract** | **String** | Futures contract | [optional] [readonly]
-**leverage** | **String** | Position leverage. Not returned in public endpoints. | [optional] [readonly]
+**leverage** | **String** | Position leverage. Not returned in public endpoints | [optional] [readonly]
**size** | **Long** | Position size | [optional] [readonly]
-**margin** | **String** | Position margin. Not returned in public endpoints. | [optional] [readonly]
-**entryPrice** | **String** | Average entry price. Not returned in public endpoints. | [optional] [readonly]
-**liqPrice** | **String** | Liquidation price. Not returned in public endpoints. | [optional] [readonly]
-**markPrice** | **String** | Mark price. Not returned in public endpoints. | [optional] [readonly]
-**orderId** | **Long** | Liquidation order ID. Not returned in public endpoints. | [optional] [readonly]
+**margin** | **String** | Position margin. Not returned in public endpoints | [optional] [readonly]
+**entryPrice** | **String** | Average entry price. Not returned in public endpoints | [optional] [readonly]
+**liqPrice** | **String** | Liquidation price. Not returned in public endpoints | [optional] [readonly]
+**markPrice** | **String** | Mark price. Not returned in public endpoints | [optional] [readonly]
+**orderId** | **Long** | Liquidation order ID. Not returned in public endpoints | [optional] [readonly]
**orderPrice** | **String** | Liquidation order price | [optional] [readonly]
**fillPrice** | **String** | Liquidation order average taker price | [optional] [readonly]
**left** | **Long** | Liquidation order maker size | [optional] [readonly]
diff --git a/docs/FuturesOrder.md b/docs/FuturesOrder.md
index fcd1d7e..7c451b2 100644
--- a/docs/FuturesOrder.md
+++ b/docs/FuturesOrder.md
@@ -10,26 +10,32 @@ Name | Type | Description | Notes
**id** | **Long** | Futures order ID | [optional] [readonly]
**user** | **Integer** | User ID | [optional] [readonly]
**createTime** | **Double** | Creation time of order | [optional] [readonly]
+**updateTime** | **Double** | OrderUpdateTime | [optional] [readonly]
**finishTime** | **Double** | Order finished time. Not returned if order is open | [optional] [readonly]
-**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | 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]
-**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: waiting to be traded - `finished`: finished | [optional] [readonly]
+**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | 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 the position was closed - reduce_out: only reduce positions by excluding hard-to-fill orders - stp: cancelled because self trade prevention | [optional] [readonly]
+**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: Pending - `finished`: Completed | [optional] [readonly]
**contract** | **String** | Futures contract |
-**size** | **Long** | Order size. Specify positive number to make a bid, and negative number to ask |
-**iceberg** | **Long** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional]
-**price** | **String** | Order price. 0 for market order with `tif` set as `ioc` | [optional]
+**size** | **Long** | Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. |
+**iceberg** | **Long** | Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. | [optional]
+**price** | **String** | Order price. Price of 0 with `tif` set to `ioc` represents a market order. | [optional]
**close** | **Boolean** | Set as `true` to close the position, with `size` set to 0 | [optional]
**isClose** | **Boolean** | Is the order to close position | [optional] [readonly]
**reduceOnly** | **Boolean** | Set as `true` to be reduce-only order | [optional]
**isReduceOnly** | **Boolean** | Is the order reduce-only | [optional] [readonly]
**isLiq** | **Boolean** | Is the order for liquidation | [optional] [readonly]
-**tif** | [**TifEnum**](#TifEnum) | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only | [optional]
-**left** | **Long** | Size left to be traded | [optional] [readonly]
-**fillPrice** | **String** | Fill price of the order | [optional] [readonly]
-**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]
+**tif** | [**TifEnum**](#TifEnum) | 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]
+**left** | **Long** | Unfilled quantity | [optional] [readonly]
+**fillPrice** | **String** | Fill price | [optional] [readonly]
+**text** | **String** | Custom order 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(.) In addition to user-defined information, the following are internal reserved fields that identify the order source: - web: Web - api: API call - app: Mobile app - auto_deleveraging: Automatic deleveraging - liquidation: Forced liquidation of positions under the old classic mode - liq-xxx: a. Forced liquidation of positions under the new classic mode, including isolated margin, one-way cross margin, and non-hedged positions under two-way cross margin. b. Forced liquidation of isolated positions under the unified account single-currency margin mode - hedge-liq-xxx: Forced liquidation of hedged positions under the new classic mode two-way cross margin, i.e., simultaneously closing long and short positions - pm_liquidate: Forced liquidation under unified account multi-currency margin mode - comb_margin_liquidate: Forced liquidation under unified account portfolio margin mode - scm_liquidate: Forced liquidation of positions under unified account single-currency margin mode - insurance: Insurance | [optional]
**tkfr** | **String** | Taker fee | [optional] [readonly]
**mkfr** | **String** | Maker fee | [optional] [readonly]
-**refu** | **Integer** | Reference user ID | [optional] [readonly]
+**refu** | **Integer** | Referrer user ID | [optional] [readonly]
**autoSize** | [**AutoSizeEnum**](#AutoSizeEnum) | 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]
+**stpId** | **Integer** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly]
+**stpAct** | [**StpActEnum**](#StpActEnum) | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional]
+**amendText** | **String** | The custom data that the user remarked when amending the order | [optional] [readonly]
+**limitVip** | **Long** | Counterparty user's VIP level for limit order fills. Current order will only match with orders whose VIP level is less than or equal to the specified level. Only 11~16 are supported; default is 0 | [optional]
+**pid** | **Long** | Position ID | [optional]
## Enum: FinishAsEnum
@@ -43,6 +49,7 @@ AUTO_DELEVERAGED | "auto_deleveraged"
REDUCE_ONLY | "reduce_only"
POSITION_CLOSED | "position_closed"
REDUCE_OUT | "reduce_out"
+STP | "stp"
## Enum: StatusEnum
@@ -58,6 +65,7 @@ Name | Value
GTC | "gtc"
IOC | "ioc"
POC | "poc"
+FOK | "fok"
## Enum: AutoSizeEnum
@@ -66,3 +74,12 @@ Name | Value
LONG | "close_long"
SHORT | "close_short"
+## Enum: StpActEnum
+
+Name | Value
+---- | -----
+CO | "co"
+CN | "cn"
+CB | "cb"
+MINUS | "-"
+
diff --git a/docs/FuturesOrderAmendment.md b/docs/FuturesOrderAmendment.md
new file mode 100644
index 0000000..8fb2998
--- /dev/null
+++ b/docs/FuturesOrderAmendment.md
@@ -0,0 +1,12 @@
+
+# FuturesOrderAmendment
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **Long** | 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]
+**price** | **String** | New order price | [optional]
+**amendText** | **String** | Custom info during order amendment | [optional]
+**text** | **String** | Internal users can modify information in the text field. | [optional]
+
diff --git a/docs/FuturesOrderBook.md b/docs/FuturesOrderBook.md
index 448950b..b208487 100644
--- a/docs/FuturesOrderBook.md
+++ b/docs/FuturesOrderBook.md
@@ -8,6 +8,6 @@ Name | Type | Description | Notes
**id** | **Long** | Order Book ID. Increases by 1 on every order book change. Set `with_id=true` to include this field in response | [optional]
**current** | **Double** | Response data generation timestamp | [optional]
**update** | **Double** | Order book changed timestamp | [optional]
-**asks** | [**List<FuturesOrderBookItem>**](FuturesOrderBookItem.md) | Asks order depth |
-**bids** | [**List<FuturesOrderBookItem>**](FuturesOrderBookItem.md) | Bids order depth |
+**asks** | [**List<FuturesOrderBookItem>**](FuturesOrderBookItem.md) | Ask Depth |
+**bids** | [**List<FuturesOrderBookItem>**](FuturesOrderBookItem.md) | Bid Depth |
diff --git a/docs/FuturesOrderBookItem.md b/docs/FuturesOrderBookItem.md
index dd27a8b..564bf77 100644
--- a/docs/FuturesOrderBookItem.md
+++ b/docs/FuturesOrderBookItem.md
@@ -5,6 +5,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**p** | **String** | Price | [optional]
+**p** | **String** | Price (quote currency) | [optional]
**s** | **Long** | Size | [optional]
diff --git a/docs/FuturesPositionCrossMode.md b/docs/FuturesPositionCrossMode.md
new file mode 100644
index 0000000..3c18231
--- /dev/null
+++ b/docs/FuturesPositionCrossMode.md
@@ -0,0 +1,10 @@
+
+# FuturesPositionCrossMode
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mode** | **String** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode |
+**contract** | **String** | Futures market |
+
diff --git a/docs/FuturesPremiumIndex.md b/docs/FuturesPremiumIndex.md
new file mode 100644
index 0000000..3ba1a47
--- /dev/null
+++ b/docs/FuturesPremiumIndex.md
@@ -0,0 +1,15 @@
+
+# FuturesPremiumIndex
+
+data point in every timestamp
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**t** | **Double** | Unix timestamp in seconds | [optional]
+**c** | **String** | Close price | [optional]
+**h** | **String** | Highest price | [optional]
+**l** | **String** | Lowest price | [optional]
+**o** | **String** | Open price | [optional]
+
diff --git a/docs/FuturesPriceTrigger.md b/docs/FuturesPriceTrigger.md
index f8d35f0..8471bf9 100644
--- a/docs/FuturesPriceTrigger.md
+++ b/docs/FuturesPriceTrigger.md
@@ -5,11 +5,11 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**strategyType** | [**StrategyTypeEnum**](#StrategyTypeEnum) | How the order will be triggered - `0`: by price, which means the order will be triggered if price condition is satisfied - `1`: by price gap, which means the order will be triggered if gap of recent two prices of specified `price_type` are satisfied. Only `0` is supported currently | [optional]
-**priceType** | [**PriceTypeEnum**](#PriceTypeEnum) | Price type. 0 - latest deal price, 1 - mark price, 2 - index price | [optional]
-**price** | **String** | Value of price on price triggered, or price gap on price gap triggered | [optional]
-**rule** | [**RuleEnum**](#RuleEnum) | Trigger condition type - `1`: calculated price based on `strategy_type` and `price_type` >= `price` - `2`: calculated price based on `strategy_type` and `price_type` <= `price` | [optional]
-**expiration** | **Integer** | How long (in seconds) to wait for the condition to be triggered before cancelling the order. | [optional]
+**strategyType** | [**StrategyTypeEnum**](#StrategyTypeEnum) | Trigger Strategy - 0: Price trigger, triggered when price meets conditions - 1: Price spread trigger, i.e. the difference between the latest price specified in `price_type` and the second-last price Currently only supports 0 (latest transaction price) | [optional]
+**priceType** | [**PriceTypeEnum**](#PriceTypeEnum) | Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price | [optional]
+**price** | **String** | Price value for price trigger, or spread value for spread trigger | [optional]
+**rule** | [**RuleEnum**](#RuleEnum) | Price Condition Type - 1: Trigger when the price calculated based on `strategy_type` and `price_type` is greater than or equal to `Trigger.Price`, while Trigger.Price must > last_price - 2: Trigger when the price calculated based on `strategy_type` and `price_type` is less than or equal to `Trigger.Price`, and Trigger.Price must < last_price | [optional]
+**expiration** | **Integer** | Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout | [optional]
## Enum: StrategyTypeEnum
diff --git a/docs/FuturesPriceTriggeredOrder.md b/docs/FuturesPriceTriggeredOrder.md
index 6efea9a..10b3fa9 100644
--- a/docs/FuturesPriceTriggeredOrder.md
+++ b/docs/FuturesPriceTriggeredOrder.md
@@ -1,7 +1,7 @@
# FuturesPriceTriggeredOrder
-Futures order details
+Futures price-triggered order details
## Properties
@@ -11,12 +11,14 @@ Name | Type | Description | Notes
**trigger** | [**FuturesPriceTrigger**](FuturesPriceTrigger.md) | |
**id** | **Long** | Auto order ID | [optional] [readonly]
**user** | **Integer** | User ID | [optional] [readonly]
-**createTime** | **Double** | Creation time | [optional] [readonly]
-**finishTime** | **Double** | Finished time | [optional] [readonly]
-**tradeId** | **Long** | ID of the newly created order on condition triggered | [optional] [readonly]
-**status** | [**StatusEnum**](#StatusEnum) | Order status. | [optional] [readonly]
-**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | How order is finished | [optional] [readonly]
-**reason** | **String** | Additional remarks on how the order was finished | [optional] [readonly]
+**createTime** | **Double** | Created time | [optional] [readonly]
+**finishTime** | **Double** | End time | [optional] [readonly]
+**tradeId** | **Long** | ID of the order created after trigger | [optional] [readonly]
+**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: Active - `finished`: Finished - `inactive`: Inactive, only applies to order take-profit/stop-loss - `invalid`: Invalid, only applies to order take-profit/stop-loss | [optional] [readonly]
+**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | Finish status: cancelled - Cancelled; succeeded - Succeeded; failed - Failed; expired - Expired | [optional] [readonly]
+**reason** | **String** | Additional description of how the order was completed | [optional] [readonly]
+**orderType** | **String** | Types of take-profit and stop-loss orders, including: - `close-long-order`: Order take-profit/stop-loss, close long position - `close-short-order`: Order take-profit/stop-loss, close short position - `close-long-position`: Position take-profit/stop-loss, used to close all long positions - `close-short-position`: Position take-profit/stop-loss, used to close all short positions - `plan-close-long-position`: Position plan take-profit/stop-loss, used to close all or partial long positions - `plan-close-short-position`: Position plan take-profit/stop-loss, used to close all or partial short positions The two types of order take-profit/stop-loss are read-only and cannot be passed in requests | [optional]
+**meOrderId** | **Long** | Corresponding order ID for order take-profit/stop-loss orders | [optional] [readonly]
## Enum: StatusEnum
@@ -24,6 +26,8 @@ Name | Value
---- | -----
OPEN | "open"
FINISHED | "finished"
+INACTIVE | "inactive"
+INVALID | "invalid"
## Enum: FinishAsEnum
diff --git a/docs/FuturesRiskLimitTier.md b/docs/FuturesRiskLimitTier.md
new file mode 100644
index 0000000..cc06201
--- /dev/null
+++ b/docs/FuturesRiskLimitTier.md
@@ -0,0 +1,16 @@
+
+# FuturesRiskLimitTier
+
+Information for each tier of the gradient risk limit table
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tier** | **Integer** | Tier | [optional]
+**riskLimit** | **String** | Position risk limit | [optional]
+**initialRate** | **String** | Initial margin rate | [optional]
+**maintenanceRate** | **String** | Maintenance margin rate | [optional]
+**leverageMax** | **String** | Maximum leverage | [optional]
+**deduction** | **String** | Maintenance margin quick calculation deduction amount | [optional]
+
diff --git a/docs/FuturesTicker.md b/docs/FuturesTicker.md
index 88ab558..0a0bab6 100644
--- a/docs/FuturesTicker.md
+++ b/docs/FuturesTicker.md
@@ -7,19 +7,28 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**contract** | **String** | Futures contract | [optional]
**last** | **String** | Last trading price | [optional]
-**changePercentage** | **String** | Change percentage. | [optional]
+**changePercentage** | **String** | Price change percentage. Negative values indicate price decrease, e.g. -7.45 | [optional]
**totalSize** | **String** | Contract total size | [optional]
-**low24h** | **String** | Lowest trading price in recent 24h | [optional]
-**high24h** | **String** | Highest trading price in recent 24h | [optional]
-**volume24h** | **String** | Trade size in recent 24h | [optional]
-**volume24hBtc** | **String** | Trade volumes in recent 24h in BTC(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional]
-**volume24hUsd** | **String** | Trade volumes in recent 24h in USD(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional]
-**volume24hBase** | **String** | Trade volume in recent 24h, in base currency | [optional]
-**volume24hQuote** | **String** | Trade volume in recent 24h, in quote currency | [optional]
-**volume24hSettle** | **String** | Trade volume in recent 24h, in settle currency | [optional]
+**low24h** | **String** | 24-hour lowest price | [optional]
+**high24h** | **String** | 24-hour highest price | [optional]
+**volume24h** | **String** | 24-hour trading volume | [optional]
+**volume24hBtc** | **String** | 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional]
+**volume24hUsd** | **String** | 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional]
+**volume24hBase** | **String** | 24-hour trading volume in base currency | [optional]
+**volume24hQuote** | **String** | 24-hour trading volume in quote currency | [optional]
+**volume24hSettle** | **String** | 24-hour trading volume in settle currency | [optional]
**markPrice** | **String** | Recent mark price | [optional]
**fundingRate** | **String** | Funding rate | [optional]
-**fundingRateIndicative** | **String** | Indicative Funding rate in next period | [optional]
+**fundingRateIndicative** | **String** | Indicative Funding rate in next period. (deprecated. use `funding_rate`) | [optional]
**indexPrice** | **String** | Index price | [optional]
**quantoBaseRate** | **String** | Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types | [optional]
+**lowestAsk** | **String** | Recent lowest ask | [optional]
+**lowestSize** | **String** | The latest seller's lowest price order quantity | [optional]
+**highestBid** | **String** | Recent highest bid | [optional]
+**highestSize** | **String** | The latest buyer's highest price order volume | [optional]
+**changeUtc0** | **String** | Percentage change at utc0. Negative values indicate a drop, e.g., -7.45% | [optional]
+**changeUtc8** | **String** | Percentage change at utc8. Negative values indicate a drop, e.g., -7.45% | [optional]
+**changePrice** | **String** | 24h change amount. Negative values indicate a drop, e.g., -7.45 | [optional]
+**changeUtc0Price** | **String** | Change amount at utc0. Negative values indicate a drop, e.g., -7.45 | [optional]
+**changeUtc8Price** | **String** | Change amount at utc8. Negative values indicate a drop, e.g., -7.45 | [optional]
diff --git a/docs/FuturesTrade.md b/docs/FuturesTrade.md
index d4821c5..01c91f6 100644
--- a/docs/FuturesTrade.md
+++ b/docs/FuturesTrade.md
@@ -5,10 +5,11 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **Long** | Trade ID | [optional]
-**createTime** | **Double** | Trading time | [optional]
-**createTimeMs** | **Double** | Trading time, with milliseconds set to 3 decimal places. | [optional]
+**id** | **Long** | Fill ID | [optional]
+**createTime** | **Double** | Fill Time | [optional]
+**createTimeMs** | **Double** | Trade time, with millisecond precision to 3 decimal places | [optional]
**contract** | **String** | Futures contract | [optional]
**size** | **Long** | Trading size | [optional]
-**price** | **String** | Trading price | [optional]
+**price** | **String** | Trade price (quote currency) | [optional]
+**isInternal** | **Boolean** | Whether it is an internal trade. Internal trade refers to the takeover of liquidation orders by the insurance fund and ADL users. Since it is not a normal matching on the market depth, the trade price may deviate from the market, and it will not be recorded in the K-line. If it is not an internal trade, this field will not be returned | [optional]
diff --git a/docs/IndexConstituent.md b/docs/IndexConstituent.md
new file mode 100644
index 0000000..0fb0098
--- /dev/null
+++ b/docs/IndexConstituent.md
@@ -0,0 +1,10 @@
+
+# IndexConstituent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**exchange** | **String** | Exchange | [optional]
+**symbols** | **List<String>** | Symbol list | [optional]
+
diff --git a/docs/InlineObject.md b/docs/InlineObject.md
new file mode 100644
index 0000000..3965959
--- /dev/null
+++ b/docs/InlineObject.md
@@ -0,0 +1,10 @@
+
+# InlineObject
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mode** | **String** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode |
+**contract** | **String** | Futures market |
+
diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md
new file mode 100644
index 0000000..7b56aaf
--- /dev/null
+++ b/docs/InlineResponse200.md
@@ -0,0 +1,10 @@
+
+# InlineResponse200
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Long** | | [optional]
+**value** | **String** | | [optional]
+
diff --git a/docs/InlineResponse2001.md b/docs/InlineResponse2001.md
new file mode 100644
index 0000000..8c8b01e
--- /dev/null
+++ b/docs/InlineResponse2001.md
@@ -0,0 +1,10 @@
+
+# InlineResponse2001
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | | [optional]
+**estRate** | **String** | Unconverted percentage | [optional]
+
diff --git a/docs/LedgerRecord.md b/docs/LedgerRecord.md
index 9ce1dca..9625498 100644
--- a/docs/LedgerRecord.md
+++ b/docs/LedgerRecord.md
@@ -7,23 +7,14 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | Record ID | [optional] [readonly]
**txid** | **String** | Hash record of the withdrawal | [optional] [readonly]
+**withdrawOrderId** | **String** | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried | [optional]
**timestamp** | **String** | Operation time | [optional] [readonly]
-**amount** | **String** | Currency amount |
+**amount** | **String** | Token amount |
**currency** | **String** | Currency name |
**address** | **String** | Withdrawal address. Required for withdrawals | [optional]
**memo** | **String** | Additional remarks with regards to the withdrawal | [optional]
-**status** | [**StatusEnum**](#StatusEnum) | 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 | [optional] [readonly]
-**chain** | **String** | Name of the chain used in withdrawals | [optional]
-
-## Enum: StatusEnum
-
-Name | Value
----- | -----
-DONE | "DONE"
-CANCEL | "CANCEL"
-REQUEST | "REQUEST"
-MANUAL | "MANUAL"
-BCODE | "BCODE"
-EXTPEND | "EXTPEND"
-FAIL | "FAIL"
+**withdrawId** | **String** | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled | [optional]
+**assetClass** | **String** | Withdrawal record currency type, empty by default. Supports users to query withdrawal records in main area and innovation area on demand. Valid values: SPOT, PILOT SPOT: Main area PILOT: Innovation area | [optional]
+**status** | **String** | Transaction status - DONE: Completed - CANCEL: Cancelled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: GateCode operation - EXTPEND: Sent, waiting for confirmation - FAIL: Failed on chain, waiting for confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: Pending manual review - REVIEW: Under review | [optional] [readonly]
+**chain** | **String** | Name of the chain used in withdrawals |
diff --git a/docs/LiquidateOrder.md b/docs/LiquidateOrder.md
new file mode 100644
index 0000000..cd32ef4
--- /dev/null
+++ b/docs/LiquidateOrder.md
@@ -0,0 +1,15 @@
+
+# LiquidateOrder
+
+Spot liquidation order details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**text** | **String** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional]
+**currencyPair** | **String** | Currency pair |
+**amount** | **String** | Trade amount |
+**price** | **String** | Order price |
+**actionMode** | **String** | Processing mode: Different fields are returned when placing an order based on action_mode. This field is only valid during the request and is not included in the response `ACK`: Asynchronous mode, only returns key order fields `RESULT`: No liquidation information `FULL`: Full mode (default) | [optional]
+
diff --git a/docs/Loan.md b/docs/Loan.md
deleted file mode 100644
index dbca68b..0000000
--- a/docs/Loan.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# Loan
-
-Margin loan details
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **String** | Loan ID | [optional] [readonly]
-**createTime** | **String** | Creation time | [optional] [readonly]
-**expireTime** | **String** | Repay time of the loan. No value will be returned for lending loan | [optional] [readonly]
-**status** | [**StatusEnum**](#StatusEnum) | Loan status open - not fully loaned loaned - all loaned out for lending loan; loaned in for borrowing side finished - loan is finished, either being all repaid or cancelled by the lender auto_repaid - automatically repaid by the system | [optional] [readonly]
-**side** | [**SideEnum**](#SideEnum) | Loan side |
-**currency** | **String** | Loan currency |
-**rate** | **String** | Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional]
-**amount** | **String** | Loan amount |
-**days** | **Integer** | Loan days. Only 10 is supported for now | [optional]
-**autoRenew** | **Boolean** | Whether to auto renew the loan upon expiration | [optional]
-**currencyPair** | **String** | Currency pair. Required if borrowing | [optional]
-**left** | **String** | Amount not lent out yet | [optional] [readonly]
-**repaid** | **String** | Repaid amount | [optional] [readonly]
-**paidInterest** | **String** | Repaid interest | [optional] [readonly]
-**unpaidInterest** | **String** | Outstanding interest yet to be paid | [optional] [readonly]
-**feeRate** | **String** | Loan fee rate | [optional]
-**origId** | **String** | Original loan ID of the loan if auto-renewed, otherwise equals to id | [optional]
-**text** | **String** | User defined custom ID | [optional]
-
-## Enum: StatusEnum
-
-Name | Value
----- | -----
-OPEN | "open"
-LOANED | "loaned"
-FINISHED | "finished"
-AUTO_REPAID | "auto_repaid"
-
-## Enum: SideEnum
-
-Name | Value
----- | -----
-LEND | "lend"
-BORROW | "borrow"
-
diff --git a/docs/LoanPatch.md b/docs/LoanPatch.md
deleted file mode 100644
index 6a1cb4d..0000000
--- a/docs/LoanPatch.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# LoanPatch
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**currency** | **String** | Loan currency |
-**side** | [**SideEnum**](#SideEnum) | Loan side. Possible values are `lend` and `borrow`. For `LoanRecord` patching, only `lend` is supported |
-**autoRenew** | **Boolean** | Auto renew |
-**currencyPair** | **String** | Currency pair. Required if borrowing | [optional]
-**loanId** | **String** | Loan ID. Required for `LoanRecord` patching | [optional]
-
-## Enum: SideEnum
-
-Name | Value
----- | -----
-LEND | "lend"
-BORROW | "borrow"
-
diff --git a/docs/LoanRecord.md b/docs/LoanRecord.md
deleted file mode 100644
index 18df173..0000000
--- a/docs/LoanRecord.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-# LoanRecord
-
-Margin loaned record details
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **String** | Loan record ID | [optional]
-**loanId** | **String** | Loan ID the record belongs to | [optional]
-**createTime** | **String** | Loan time | [optional]
-**expireTime** | **String** | Expiration time | [optional]
-**status** | [**StatusEnum**](#StatusEnum) | Loan record status | [optional]
-**borrowUserId** | **String** | Garbled user ID | [optional]
-**currency** | **String** | Loan currency | [optional]
-**rate** | **String** | Loan rate | [optional]
-**amount** | **String** | Loan amount | [optional]
-**days** | **Integer** | Loan days | [optional]
-**autoRenew** | **Boolean** | Whether the record will auto renew on expiration | [optional]
-**repaid** | **String** | Repaid amount | [optional]
-**paidInterest** | **String** | Repaid interest | [optional] [readonly]
-**unpaidInterest** | **String** | Outstanding interest yet to be paid | [optional] [readonly]
-
-## Enum: StatusEnum
-
-Name | Value
----- | -----
-LOANED | "loaned"
-FINISHED | "finished"
-
diff --git a/docs/MarginAccount.md b/docs/MarginAccount.md
index e84b42f..ce57b53 100644
--- a/docs/MarginAccount.md
+++ b/docs/MarginAccount.md
@@ -1,15 +1,18 @@
# MarginAccount
-Margin account detail. `base` refers to base currency, while `quotes to quote currency
+Margin account information for a trading pair. `base` corresponds to base currency account information, `quote` corresponds to quote currency account information
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currencyPair** | **String** | Currency pair | [optional]
-**locked** | **Boolean** | Whether account is locked | [optional]
-**risk** | **String** | Current risk rate of margin account | [optional]
+**accountType** | **String** | Account type: risk - risk rate account, mmr - maintenance margin rate account, inactive - market not activated | [optional]
+**leverage** | **String** | User's current market leverage multiplier | [optional]
+**locked** | **Boolean** | Whether the account is locked | [optional]
+**risk** | **String** | Current risk rate of the margin account (returned when the account is a risk rate account) | [optional]
+**mmr** | **String** | Leveraged Account Current Maintenance Margin Rate (returned when the Account is Account) | [optional]
**base** | [**MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional]
**quote** | [**MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional]
diff --git a/docs/MarginAccountBook.md b/docs/MarginAccountBook.md
index 446b1c4..094301c 100644
--- a/docs/MarginAccountBook.md
+++ b/docs/MarginAccountBook.md
@@ -6,10 +6,11 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | Balance change record ID | [optional]
-**time** | **String** | Balance changed timestamp | [optional]
+**time** | **String** | Account change timestamp | [optional]
**timeMs** | **Long** | The timestamp of the change (in milliseconds) | [optional]
**currency** | **String** | Currency changed | [optional]
-**currencyPair** | **String** | Account currency pair | [optional]
+**currencyPair** | **String** | Account trading pair | [optional]
**change** | **String** | Amount changed. Positive value means transferring in, while negative out | [optional]
**balance** | **String** | Balance after change | [optional]
+**type** | **String** | Account book type. Please refer to [account book type](#accountbook-type) for more detail | [optional]
diff --git a/docs/MarginAccountCurrency.md b/docs/MarginAccountCurrency.md
index 266de33..427e461 100644
--- a/docs/MarginAccountCurrency.md
+++ b/docs/MarginAccountCurrency.md
@@ -1,15 +1,15 @@
# MarginAccountCurrency
-Account currency details
+Currency account information
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currency** | **String** | Currency name | [optional]
-**available** | **String** | Amount suitable for margin trading. | [optional]
-**locked** | **String** | Locked amount, used in margin trading | [optional]
-**borrowed** | **String** | Borrowed amount | [optional]
-**interest** | **String** | Unpaid interests | [optional]
+**available** | **String** | Amount available for margin trading, available = margin + borrowed | [optional]
+**locked** | **String** | Frozen funds, such as amounts already placed in margin market for order trading | [optional]
+**borrowed** | **String** | Borrowed funds | [optional]
+**interest** | **String** | Unpaid interest | [optional]
diff --git a/docs/MarginApi.md b/docs/MarginApi.md
index b73b33e..2dc7496 100644
--- a/docs/MarginApi.md
+++ b/docs/MarginApi.md
@@ -4,227 +4,19 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
Method | HTTP request | Description
------------- | ------------- | -------------
-[**listMarginCurrencyPairs**](MarginApi.md#listMarginCurrencyPairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading
-[**getMarginCurrencyPair**](MarginApi.md#getMarginCurrencyPair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair
-[**listFundingBook**](MarginApi.md#listFundingBook) | **GET** /margin/funding_book | Order book of lending loans
[**listMarginAccounts**](MarginApi.md#listMarginAccounts) | **GET** /margin/accounts | Margin account list
-[**listMarginAccountBook**](MarginApi.md#listMarginAccountBook) | **GET** /margin/account_book | List margin account balance change history
+[**listMarginAccountBook**](MarginApi.md#listMarginAccountBook) | **GET** /margin/account_book | Query margin account balance change history
[**listFundingAccounts**](MarginApi.md#listFundingAccounts) | **GET** /margin/funding_accounts | Funding account list
-[**listLoans**](MarginApi.md#listLoans) | **GET** /margin/loans | List all loans
-[**createLoan**](MarginApi.md#createLoan) | **POST** /margin/loans | Lend or borrow
-[**mergeLoans**](MarginApi.md#mergeLoans) | **POST** /margin/merged_loans | Merge multiple lending loans
-[**getLoan**](MarginApi.md#getLoan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail
-[**cancelLoan**](MarginApi.md#cancelLoan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan
-[**updateLoan**](MarginApi.md#updateLoan) | **PATCH** /margin/loans/{loan_id} | Modify a loan
-[**listLoanRepayments**](MarginApi.md#listLoanRepayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records
-[**repayLoan**](MarginApi.md#repayLoan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan
-[**listLoanRecords**](MarginApi.md#listLoanRecords) | **GET** /margin/loan_records | List repayment records of a specific loan
-[**getLoanRecord**](MarginApi.md#getLoanRecord) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record
-[**updateLoanRecord**](MarginApi.md#updateLoanRecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record
-[**getAutoRepayStatus**](MarginApi.md#getAutoRepayStatus) | **GET** /margin/auto_repay | Retrieve user auto repayment setting
-[**setAutoRepay**](MarginApi.md#setAutoRepay) | **POST** /margin/auto_repay | Update user's auto repayment setting
-[**getMarginTransferable**](MarginApi.md#getMarginTransferable) | **GET** /margin/transferable | Get the max transferable amount for a specific margin currency
-[**getMarginBorrowable**](MarginApi.md#getMarginBorrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency
-[**listCrossMarginCurrencies**](MarginApi.md#listCrossMarginCurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin.
-[**getCrossMarginCurrency**](MarginApi.md#getCrossMarginCurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin
-[**getCrossMarginAccount**](MarginApi.md#getCrossMarginAccount) | **GET** /margin/cross/accounts | Retrieve cross margin account
-[**listCrossMarginAccountBook**](MarginApi.md#listCrossMarginAccountBook) | **GET** /margin/cross/account_book | Retrieve cross margin account change history
-[**listCrossMarginLoans**](MarginApi.md#listCrossMarginLoans) | **GET** /margin/cross/loans | List cross margin borrow history
-[**createCrossMarginLoan**](MarginApi.md#createCrossMarginLoan) | **POST** /margin/cross/loans | Create a cross margin borrow loan
-[**getCrossMarginLoan**](MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail
-[**listCrossMarginRepayments**](MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments
-[**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Repay cross margin loan
-[**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency
-[**getCrossMarginBorrowable**](MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency
-
-
-
-# **listMarginCurrencyPairs**
-> List<MarginCurrencyPair> listMarginCurrencyPairs()
-
-List all supported currency pairs supported in margin trading
+[**getAutoRepayStatus**](MarginApi.md#getAutoRepayStatus) | **GET** /margin/auto_repay | Query user auto repayment settings
+[**setAutoRepay**](MarginApi.md#setAutoRepay) | **POST** /margin/auto_repay | Update user auto repayment settings
+[**getMarginTransferable**](MarginApi.md#getMarginTransferable) | **GET** /margin/transferable | Get maximum transferable amount for isolated margin
+[**getUserMarginTier**](MarginApi.md#getUserMarginTier) | **GET** /margin/user/loan_margin_tiers | Query user's own leverage lending tiers in current market
+[**getMarketMarginTier**](MarginApi.md#getMarketMarginTier) | **GET** /margin/loan_margin_tiers | Query current market leverage lending tiers
+[**setUserMarketLeverage**](MarginApi.md#setUserMarketLeverage) | **POST** /margin/leverage/user_market_setting | Set user market leverage multiplier
+[**listMarginUserAccount**](MarginApi.md#listMarginUserAccount) | **GET** /margin/user/account | Query user's isolated margin account list
+[**listCrossMarginLoans**](MarginApi.md#listCrossMarginLoans) | **GET** /margin/cross/loans | Query cross margin borrow history (deprecated)
+[**listCrossMarginRepayments**](MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments. (deprecated)
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- try {
- List result = apiInstance.listMarginCurrencyPairs();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listMarginCurrencyPairs");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-[**List<MarginCurrencyPair>**](MarginCurrencyPair.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | List retrieved | - |
-
-
-# **getMarginCurrencyPair**
-> MarginCurrencyPair getMarginCurrencyPair(currencyPair)
-
-Query one single margin currency pair
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currencyPair = "BTC_USDT"; // String | Margin currency pair
- try {
- MarginCurrencyPair result = apiInstance.getMarginCurrencyPair(currencyPair);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getMarginCurrencyPair");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currencyPair** | **String**| Margin currency pair |
-
-### Return type
-
-[**MarginCurrencyPair**](MarginCurrencyPair.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **listFundingBook**
-> List<FundingBookItem> listFundingBook(currency)
-
-Order book of lending loans
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
- try {
- List result = apiInstance.listFundingBook(currency);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listFundingBook");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency |
-
-### Return type
-
-[**List<FundingBookItem>**](FundingBookItem.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Order book retrieved | - |
# **listMarginAccounts**
@@ -294,15 +86,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listMarginAccountBook**
-> List<MarginAccountBook> listMarginAccountBook().currency(currency).currencyPair(currencyPair).from(from).to(to).page(page).limit(limit).execute();
+> List<MarginAccountBook> listMarginAccountBook().currency(currency).currencyPair(currencyPair).type(type).from(from).to(to).page(page).limit(limit).execute();
-List margin account balance change history
+Query margin account balance change history
-Only transferals from and to margin account are provided for now. Time range allows 30 days at most
+Currently only provides transfer history to and from margin accounts. Query time range cannot exceed 30 days
### Example
@@ -325,16 +117,18 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "currency_example"; // String | List records related to specified currency only. If specified, `currency_pair` is also required.
- String currencyPair = "currencyPair_example"; // String | List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided
- Long from = 56L; // Long | Time range beginning, default to 7 days before current time
- Long to = 56L; // Long | Time range ending, default to current time
+ String currency = "currency_example"; // String | Query history for specified currency. If `currency` is specified, `currency_pair` must also be specified.
+ String currencyPair = "currencyPair_example"; // String | Specify margin account currency pair. Used in combination with `currency`. Ignored if `currency` is not specified
+ String type = "lend"; // String | Query by specified account change type. If not specified, all change types will be included.
+ Long from = 1627706330L; // Long | Start timestamp for the query
+ Long to = 1635329650L; // Long | End timestamp for the query, defaults to current time if not specified
Integer page = 1; // Integer | Page number
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
try {
List result = apiInstance.listMarginAccountBook()
.currency(currency)
.currencyPair(currencyPair)
+ .type(type)
.from(from)
.to(to)
.page(page)
@@ -358,12 +152,13 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| List records related to specified currency only. If specified, `currency_pair` is also required. | [optional]
- **currencyPair** | **String**| List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided | [optional]
- **from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
- **to** | **Long**| Time range ending, default to current time | [optional]
+ **currency** | **String**| Query history for specified currency. If `currency` is specified, `currency_pair` must also be specified. | [optional]
+ **currencyPair** | **String**| Specify margin account currency pair. Used in combination with `currency`. Ignored if `currency` is not specified | [optional]
+ **type** | **String**| Query by specified account change type. If not specified, all change types will be included. | [optional]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
**page** | **Integer**| Page number | [optional] [default to 1]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
### Return type
@@ -381,7 +176,7 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listFundingAccounts**
@@ -410,7 +205,7 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
+ String currency = "BTC"; // String | Query by specified currency name
try {
List result = apiInstance.listFundingAccounts()
.currency(currency)
@@ -433,7 +228,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency | [optional]
+ **currency** | **String**| Query by specified currency name | [optional]
### Return type
@@ -451,13 +246,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
-
-# **listLoans**
-> List<Loan> listLoans(status, side).currency(currency).currencyPair(currencyPair).sortBy(sortBy).reverseSort(reverseSort).page(page).limit(limit).execute();
+
+# **getAutoRepayStatus**
+> AutoRepaySetting getAutoRepayStatus()
-List all loans
+Query user auto repayment settings
### Example
@@ -480,29 +275,14 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String status = "open"; // String | Loan status
- String side = "lend"; // String | Lend or borrow
- String currency = "BTC"; // String | Retrieve data of the specified currency
- String currencyPair = "BTC_USDT"; // String | Currency pair
- String sortBy = "rate"; // String | Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time`
- Boolean reverseSort = false; // Boolean | Whether to sort in descending order. Default to `true`
- Integer page = 1; // Integer | Page number
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
try {
- List result = apiInstance.listLoans(status, side)
- .currency(currency)
- .currencyPair(currencyPair)
- .sortBy(sortBy)
- .reverseSort(reverseSort)
- .page(page)
- .limit(limit)
- .execute();
+ AutoRepaySetting result = apiInstance.getAutoRepayStatus();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listLoans");
+ System.err.println("Exception when calling MarginApi#getAutoRepayStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -512,21 +292,11 @@ public class Example {
```
### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **status** | **String**| Loan status | [enum: open, loaned, finished, auto_repaid]
- **side** | **String**| Lend or borrow | [enum: lend, borrow]
- **currency** | **String**| Retrieve data of the specified currency | [optional]
- **currencyPair** | **String**| Currency pair | [optional]
- **sortBy** | **String**| Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` | [optional] [enum: create_time, rate]
- **reverseSort** | **Boolean**| Whether to sort in descending order. Default to `true` | [optional]
- **page** | **Integer**| Page number | [optional] [default to 1]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+This endpoint does not need any parameter.
### Return type
-[**List<Loan>**](Loan.md)
+[**AutoRepaySetting**](AutoRepaySetting.md)
### Authorization
@@ -540,13 +310,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | User's current auto repayment settings | - |
-
-# **createLoan**
-> Loan createLoan(loan)
+
+# **setAutoRepay**
+> AutoRepaySetting setAutoRepay(status)
-Lend or borrow
+Update user auto repayment settings
### Example
@@ -569,15 +339,15 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- Loan loan = new Loan(); // Loan |
+ String status = "on"; // String | Whether to enable auto repayment: `on` - enabled, `off` - disabled
try {
- Loan result = apiInstance.createLoan(loan);
+ AutoRepaySetting result = apiInstance.setAutoRepay(status);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#createLoan");
+ System.err.println("Exception when calling MarginApi#setAutoRepay");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -590,11 +360,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **loan** | [**Loan**](Loan.md)| |
+ **status** | **String**| Whether to enable auto repayment: `on` - enabled, `off` - disabled |
### Return type
-[**Loan**](Loan.md)
+[**AutoRepaySetting**](AutoRepaySetting.md)
### Authorization
@@ -602,19 +372,19 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
+ - **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**201** | Loan created | - |
+**200** | User's current auto repayment settings | - |
-
-# **mergeLoans**
-> Loan mergeLoans(currency, ids)
+
+# **getMarginTransferable**
+> MarginTransferable getMarginTransferable(currency).currencyPair(currencyPair).execute();
-Merge multiple lending loans
+Get maximum transferable amount for isolated margin
### Example
@@ -637,16 +407,18 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
- String ids = "123,234,345"; // String | A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request
+ String currency = "BTC"; // String | Query by specified currency name
+ String currencyPair = "BTC_USDT"; // String | Currency pair
try {
- Loan result = apiInstance.mergeLoans(currency, ids);
+ MarginTransferable result = apiInstance.getMarginTransferable(currency)
+ .currencyPair(currencyPair)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#mergeLoans");
+ System.err.println("Exception when calling MarginApi#getMarginTransferable");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -659,12 +431,12 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency |
- **ids** | **String**| A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request |
+ **currency** | **String**| Query by specified currency name |
+ **currencyPair** | **String**| Currency pair | [optional]
### Return type
-[**Loan**](Loan.md)
+[**MarginTransferable**](MarginTransferable.md)
### Authorization
@@ -678,13 +450,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**201** | Loans merged | - |
+**200** | Query successful | - |
-
-# **getLoan**
-> Loan getLoan(loanId, side)
+
+# **getUserMarginTier**
+> List<MarginLeverageTier> getUserMarginTier(currencyPair)
-Retrieve one single loan detail
+Query user's own leverage lending tiers in current market
### Example
@@ -707,16 +479,15 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String loanId = "12345"; // String | Loan ID
- String side = "lend"; // String | Lend or borrow
+ String currencyPair = "BTC_USDT"; // String | Currency pair
try {
- Loan result = apiInstance.getLoan(loanId, side);
+ List result = apiInstance.getUserMarginTier(currencyPair);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getLoan");
+ System.err.println("Exception when calling MarginApi#getUserMarginTier");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -729,12 +500,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **loanId** | **String**| Loan ID |
- **side** | **String**| Lend or borrow | [enum: lend, borrow]
+ **currencyPair** | **String**| Currency pair |
### Return type
-[**Loan**](Loan.md)
+[**List<MarginLeverageTier>**](MarginLeverageTier.md)
### Authorization
@@ -748,15 +518,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | Query successful | - |
-
-# **cancelLoan**
-> Loan cancelLoan(loanId, currency)
+
+# **getMarketMarginTier**
+> List<MarginLeverageTier> getMarketMarginTier(currencyPair)
-Cancel lending loan
-
-Only lent loans can be cancelled
+Query current market leverage lending tiers
### Example
@@ -766,7 +534,6 @@ import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.MarginApi;
@@ -774,21 +541,17 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String loanId = "12345"; // String | Loan ID
- String currency = "BTC"; // String | Retrieve data of the specified currency
+ String currencyPair = "BTC_USDT"; // String | Currency pair
try {
- Loan result = apiInstance.cancelLoan(loanId, currency);
+ List result = apiInstance.getMarketMarginTier(currencyPair);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#cancelLoan");
+ System.err.println("Exception when calling MarginApi#getMarketMarginTier");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -801,16 +564,15 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **loanId** | **String**| Loan ID |
- **currency** | **String**| Retrieve data of the specified currency |
+ **currencyPair** | **String**| Currency pair |
### Return type
-[**Loan**](Loan.md)
+[**List<MarginLeverageTier>**](MarginLeverageTier.md)
### Authorization
-[apiv4](../README.md#apiv4)
+No authorization required
### HTTP request headers
@@ -820,15 +582,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Order cancelled | - |
+**200** | Query successful | - |
-
-# **updateLoan**
-> Loan updateLoan(loanId, loanPatch)
+
+# **setUserMarketLeverage**
+> setUserMarketLeverage(marginMarketLeverage)
-Modify a loan
-
-Only `auto_renew` modification is supported currently
+Set user market leverage multiplier
### Example
@@ -851,16 +611,14 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String loanId = "12345"; // String | Loan ID
- LoanPatch loanPatch = new LoanPatch(); // LoanPatch |
+ MarginMarketLeverage marginMarketLeverage = new MarginMarketLeverage(); // MarginMarketLeverage |
try {
- Loan result = apiInstance.updateLoan(loanId, loanPatch);
- System.out.println(result);
+ apiInstance.setUserMarketLeverage(marginMarketLeverage);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#updateLoan");
+ System.err.println("Exception when calling MarginApi#setUserMarketLeverage");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -873,12 +631,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **loanId** | **String**| Loan ID |
- **loanPatch** | [**LoanPatch**](LoanPatch.md)| |
+ **marginMarketLeverage** | [**MarginMarketLeverage**](MarginMarketLeverage.md)| |
### Return type
-[**Loan**](Loan.md)
+null (empty response body)
### Authorization
@@ -887,18 +644,20 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: application/json
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Updated | - |
+**204** | Set successfully | - |
+
+
+# **listMarginUserAccount**
+> List<MarginAccount> listMarginUserAccount().currencyPair(currencyPair).execute();
-
-# **listLoanRepayments**
-> List<Repayment> listLoanRepayments(loanId)
+Query user's isolated margin account list
-List loan repayment records
+Supports querying risk ratio isolated accounts and margin ratio isolated accounts
### Example
@@ -921,15 +680,17 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String loanId = "12345"; // String | Loan ID
+ String currencyPair = "BTC_USDT"; // String | Currency pair
try {
- List result = apiInstance.listLoanRepayments(loanId);
+ List result = apiInstance.listMarginUserAccount()
+ .currencyPair(currencyPair)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listLoanRepayments");
+ System.err.println("Exception when calling MarginApi#listMarginUserAccount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -942,11 +703,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **loanId** | **String**| Loan ID |
+ **currencyPair** | **String**| Currency pair | [optional]
### Return type
-[**List<Repayment>**](Repayment.md)
+[**List<MarginAccount>**](MarginAccount.md)
### Authorization
@@ -960,13 +721,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
+
+
+# **listCrossMarginLoans**
+> List<CrossMarginLoan> listCrossMarginLoans(status).currency(currency).limit(limit).offset(offset).reverse(reverse).execute();
-
-# **repayLoan**
-> Loan repayLoan(loanId, repayRequest)
+Query cross margin borrow history (deprecated)
-Repay a loan
+Sorted by creation time in descending order by default. Set `reverse=false` for ascending order
### Example
@@ -989,16 +752,24 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String loanId = "12345"; // String | Loan ID
- RepayRequest repayRequest = new RepayRequest(); // RepayRequest |
+ Integer status = 56; // Integer | Filter by status. Supported values are 2 and 3. (deprecated.)
+ String currency = "currency_example"; // String | Query by specified currency, includes all currencies if not specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Boolean reverse = true; // Boolean | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results
try {
- Loan result = apiInstance.repayLoan(loanId, repayRequest);
+ List result = apiInstance.listCrossMarginLoans(status)
+ .currency(currency)
+ .limit(limit)
+ .offset(offset)
+ .reverse(reverse)
+ .execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#repayLoan");
+ System.err.println("Exception when calling MarginApi#listCrossMarginLoans");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1011,12 +782,15 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **loanId** | **String**| Loan ID |
- **repayRequest** | [**RepayRequest**](RepayRequest.md)| |
+ **status** | **Integer**| Filter by status. Supported values are 2 and 3. (deprecated.) |
+ **currency** | **String**| Query by specified currency, includes all currencies if not specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **reverse** | **Boolean**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true]
### Return type
-[**Loan**](Loan.md)
+[**List<CrossMarginLoan>**](CrossMarginLoan.md)
### Authorization
@@ -1024,19 +798,21 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
+ - **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Loan repaid | - |
+**200** | Query successful | - |
+
+
+# **listCrossMarginRepayments**
+> List<CrossMarginRepayment> listCrossMarginRepayments().currency(currency).loanId(loanId).limit(limit).offset(offset).reverse(reverse).execute();
-
-# **listLoanRecords**
-> List<LoanRecord> listLoanRecords(loanId).status(status).page(page).limit(limit).execute();
+Retrieve cross margin repayments. (deprecated)
-List repayment records of a specific loan
+Sorted by creation time in descending order by default. Set `reverse=false` for ascending order
### Example
@@ -1059,22 +835,25 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
MarginApi apiInstance = new MarginApi(defaultClient);
- String loanId = "12345"; // String | Loan ID
- String status = "loaned"; // String | Loan record status
- Integer page = 1; // Integer | Page number
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String currency = "BTC"; // String |
+ String loanId = "12345"; // String |
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Boolean reverse = true; // Boolean | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results
try {
- List result = apiInstance.listLoanRecords(loanId)
- .status(status)
- .page(page)
+ List result = apiInstance.listCrossMarginRepayments()
+ .currency(currency)
+ .loanId(loanId)
.limit(limit)
+ .offset(offset)
+ .reverse(reverse)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listLoanRecords");
+ System.err.println("Exception when calling MarginApi#listCrossMarginRepayments");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -1087,1008 +866,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **loanId** | **String**| Loan ID |
- **status** | **String**| Loan record status | [optional] [enum: loaned, finished]
- **page** | **Integer**| Page number | [optional] [default to 1]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
-
-### Return type
-
-[**List<LoanRecord>**](LoanRecord.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | List retrieved | - |
-
-
-# **getLoanRecord**
-> LoanRecord getLoanRecord(loanRecordId, loanId)
-
-Get one single loan record
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String loanRecordId = "12345"; // String | Loan record ID
- String loanId = "12345"; // String | Loan ID
- try {
- LoanRecord result = apiInstance.getLoanRecord(loanRecordId, loanId);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getLoanRecord");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **loanRecordId** | **String**| Loan record ID |
- **loanId** | **String**| Loan ID |
-
-### Return type
-
-[**LoanRecord**](LoanRecord.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Detail retrieved | - |
-
-
-# **updateLoanRecord**
-> LoanRecord updateLoanRecord(loanRecordId, loanPatch)
-
-Modify a loan record
-
-Only `auto_renew` modification is supported currently
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String loanRecordId = "12345"; // String | Loan record ID
- LoanPatch loanPatch = new LoanPatch(); // LoanPatch |
- try {
- LoanRecord result = apiInstance.updateLoanRecord(loanRecordId, loanPatch);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#updateLoanRecord");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **loanRecordId** | **String**| Loan record ID |
- **loanPatch** | [**LoanPatch**](LoanPatch.md)| |
-
-### Return type
-
-[**LoanRecord**](LoanRecord.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Loan record updated | - |
-
-
-# **getAutoRepayStatus**
-> AutoRepaySetting getAutoRepayStatus()
-
-Retrieve user auto repayment setting
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- try {
- AutoRepaySetting result = apiInstance.getAutoRepayStatus();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getAutoRepayStatus");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-[**AutoRepaySetting**](AutoRepaySetting.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Current auto repayment setting | - |
-
-
-# **setAutoRepay**
-> AutoRepaySetting setAutoRepay(status)
-
-Update user's auto repayment setting
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String status = "on"; // String | New auto repayment status. `on` - enabled, `off` - disabled
- try {
- AutoRepaySetting result = apiInstance.setAutoRepay(status);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#setAutoRepay");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **status** | **String**| New auto repayment status. `on` - enabled, `off` - disabled |
-
-### Return type
-
-[**AutoRepaySetting**](AutoRepaySetting.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Current auto repayment setting | - |
-
-
-# **getMarginTransferable**
-> MarginTransferable getMarginTransferable(currency).currencyPair(currencyPair).execute();
-
-Get the max transferable amount for a specific margin currency
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
- String currencyPair = "BTC_USDT"; // String | Currency pair
- try {
- MarginTransferable result = apiInstance.getMarginTransferable(currency)
- .currencyPair(currencyPair)
- .execute();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getMarginTransferable");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency |
- **currencyPair** | **String**| Currency pair | [optional]
-
-### Return type
-
-[**MarginTransferable**](MarginTransferable.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **getMarginBorrowable**
-> MarginBorrowable getMarginBorrowable(currency).currencyPair(currencyPair).execute();
-
-Get the max borrowable amount for a specific margin currency
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
- String currencyPair = "BTC_USDT"; // String | Currency pair
- try {
- MarginBorrowable result = apiInstance.getMarginBorrowable(currency)
- .currencyPair(currencyPair)
- .execute();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getMarginBorrowable");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency |
- **currencyPair** | **String**| Currency pair | [optional]
-
-### Return type
-
-[**MarginBorrowable**](MarginBorrowable.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **listCrossMarginCurrencies**
-> List<CrossMarginCurrency> listCrossMarginCurrencies()
-
-Currencies supported by cross margin.
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- try {
- List result = apiInstance.listCrossMarginCurrencies();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listCrossMarginCurrencies");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-[**List<CrossMarginCurrency>**](CrossMarginCurrency.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | List retrieved | - |
-
-
-# **getCrossMarginCurrency**
-> CrossMarginCurrency getCrossMarginCurrency(currency)
-
-Retrieve detail of one single currency supported by cross margin
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Currency name
- try {
- CrossMarginCurrency result = apiInstance.getCrossMarginCurrency(currency);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getCrossMarginCurrency");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| Currency name |
-
-### Return type
-
-[**CrossMarginCurrency**](CrossMarginCurrency.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **getCrossMarginAccount**
-> CrossMarginAccount getCrossMarginAccount()
-
-Retrieve cross margin account
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- try {
- CrossMarginAccount result = apiInstance.getCrossMarginAccount();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getCrossMarginAccount");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-[**CrossMarginAccount**](CrossMarginAccount.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **listCrossMarginAccountBook**
-> List<CrossMarginAccountBook> listCrossMarginAccountBook().currency(currency).from(from).to(to).page(page).limit(limit).type(type).execute();
-
-Retrieve cross margin account change history
-
-Record time range cannot exceed 30 days
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "currency_example"; // String | Filter by currency
- Long from = 56L; // Long | Time range beginning, default to 7 days before current time
- Long to = 56L; // Long | Time range ending, default to current time
- Integer page = 1; // Integer | Page number
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- String type = "borrow"; // String | Only retrieve changes of the specified type. All types will be returned if not specified.
- try {
- List result = apiInstance.listCrossMarginAccountBook()
- .currency(currency)
- .from(from)
- .to(to)
- .page(page)
- .limit(limit)
- .type(type)
- .execute();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listCrossMarginAccountBook");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| Filter by currency | [optional]
- **from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
- **to** | **Long**| Time range ending, default to current time | [optional]
- **page** | **Integer**| Page number | [optional] [default to 1]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **type** | **String**| Only retrieve changes of the specified type. All types will be returned if not specified. | [optional]
-
-### Return type
-
-[**List<CrossMarginAccountBook>**](CrossMarginAccountBook.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | List retrieved | - |
-
-
-# **listCrossMarginLoans**
-> List<CrossMarginLoan> listCrossMarginLoans(status).currency(currency).limit(limit).offset(offset).reverse(reverse).execute();
-
-List cross margin borrow history
-
-Sort by creation time in descending order by default. Set `reverse=false` to return ascending results.
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- Integer status = 56; // Integer | Filter by status. Supported values are 2 and 3.
- String currency = "currency_example"; // String | Filter by currency
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Integer offset = 0; // Integer | List offset, starting from 0
- Boolean reverse = true; // Boolean | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results
- try {
- List result = apiInstance.listCrossMarginLoans(status)
- .currency(currency)
- .limit(limit)
- .offset(offset)
- .reverse(reverse)
- .execute();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listCrossMarginLoans");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **status** | **Integer**| Filter by status. Supported values are 2 and 3. |
- **currency** | **String**| Filter by currency | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
- **reverse** | **Boolean**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true]
-
-### Return type
-
-[**List<CrossMarginLoan>**](CrossMarginLoan.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **createCrossMarginLoan**
-> CrossMarginLoan createCrossMarginLoan(crossMarginLoan)
-
-Create a cross margin borrow loan
-
-Borrow amount cannot be less than currency minimum borrow amount
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- CrossMarginLoan crossMarginLoan = new CrossMarginLoan(); // CrossMarginLoan |
- try {
- CrossMarginLoan result = apiInstance.createCrossMarginLoan(crossMarginLoan);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#createCrossMarginLoan");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **crossMarginLoan** | [**CrossMarginLoan**](CrossMarginLoan.md)| |
-
-### Return type
-
-[**CrossMarginLoan**](CrossMarginLoan.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully borrowed | - |
-
-
-# **getCrossMarginLoan**
-> CrossMarginLoan getCrossMarginLoan(loanId)
-
-Retrieve single borrow loan detail
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String loanId = "12345"; // String | Borrow loan ID
- try {
- CrossMarginLoan result = apiInstance.getCrossMarginLoan(loanId);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getCrossMarginLoan");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **loanId** | **String**| Borrow loan ID |
-
-### Return type
-
-[**CrossMarginLoan**](CrossMarginLoan.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **listCrossMarginRepayments**
-> List<CrossMarginRepayment> listCrossMarginRepayments().currency(currency).loanId(loanId).limit(limit).offset(offset).reverse(reverse).execute();
-
-Retrieve cross margin repayments
-
-Sort by creation time in descending order by default. Set `reverse=false` to return ascending results.
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String |
- String loanId = "12345"; // String |
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- Integer offset = 0; // Integer | List offset, starting from 0
- Boolean reverse = true; // Boolean | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results
- try {
- List result = apiInstance.listCrossMarginRepayments()
- .currency(currency)
- .loanId(loanId)
- .limit(limit)
- .offset(offset)
- .reverse(reverse)
- .execute();
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#listCrossMarginRepayments");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| | [optional]
- **loanId** | **String**| | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
- **reverse** | **Boolean**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true]
+ **currency** | **String**| | [optional]
+ **loanId** | **String**| | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **reverse** | **Boolean**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true]
### Return type
@@ -2106,209 +888,5 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
-
-
-# **repayCrossMarginLoan**
-> List<CrossMarginLoan> repayCrossMarginLoan(crossMarginRepayRequest)
-
-Repay cross margin loan
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- CrossMarginRepayRequest crossMarginRepayRequest = new CrossMarginRepayRequest(); // CrossMarginRepayRequest |
- try {
- List result = apiInstance.repayCrossMarginLoan(crossMarginRepayRequest);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#repayCrossMarginLoan");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **crossMarginRepayRequest** | [**CrossMarginRepayRequest**](CrossMarginRepayRequest.md)| |
-
-### Return type
-
-[**List<CrossMarginLoan>**](CrossMarginLoan.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Loan repaid | - |
-
-
-# **getCrossMarginTransferable**
-> CrossMarginTransferable getCrossMarginTransferable(currency)
-
-Get the max transferable amount for a specific cross margin currency
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
- try {
- CrossMarginTransferable result = apiInstance.getCrossMarginTransferable(currency);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getCrossMarginTransferable");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency |
-
-### Return type
-
-[**CrossMarginTransferable**](CrossMarginTransferable.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
-
-
-# **getCrossMarginBorrowable**
-> CrossMarginBorrowable getCrossMarginBorrowable(currency)
-
-Get the max borrowable amount for a specific cross margin currency
-
-### Example
-
-```java
-// Import classes:
-import io.gate.gateapi.ApiClient;
-import io.gate.gateapi.ApiException;
-import io.gate.gateapi.Configuration;
-import io.gate.gateapi.GateApiException;
-import io.gate.gateapi.auth.*;
-import io.gate.gateapi.models.*;
-import io.gate.gateapi.api.MarginApi;
-
-public class Example {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
- defaultClient.setBasePath("https://api.gateio.ws/api/v4");
-
- // Configure APIv4 authorization: apiv4
- defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
-
- MarginApi apiInstance = new MarginApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
- try {
- CrossMarginBorrowable result = apiInstance.getCrossMarginBorrowable(currency);
- System.out.println(result);
- } catch (GateApiException e) {
- System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
- e.printStackTrace();
- } catch (ApiException e) {
- System.err.println("Exception when calling MarginApi#getCrossMarginBorrowable");
- System.err.println("Status code: " + e.getCode());
- System.err.println("Response headers: " + e.getResponseHeaders());
- e.printStackTrace();
- }
- }
-}
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency |
-
-### Return type
-
-[**CrossMarginBorrowable**](CrossMarginBorrowable.md)
-
-### Authorization
-
-[apiv4](../README.md#apiv4)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | List retrieved successfully | - |
diff --git a/docs/MarginCurrencyPair.md b/docs/MarginCurrencyPair.md
deleted file mode 100644
index cfe825a..0000000
--- a/docs/MarginCurrencyPair.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-# MarginCurrencyPair
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **String** | Currency pair | [optional]
-**base** | **String** | Base currency | [optional]
-**quote** | **String** | Quote currency | [optional]
-**leverage** | **Integer** | Leverage | [optional]
-**minBaseAmount** | **String** | Minimum base currency to loan, `null` means no limit | [optional]
-**minQuoteAmount** | **String** | Minimum quote currency to loan, `null` means no limit | [optional]
-**maxQuoteAmount** | **String** | Maximum borrowable amount for quote currency. Base currency limit is calculated by quote maximum and market price. `null` means no limit | [optional]
-
diff --git a/docs/MarginLeverageTier.md b/docs/MarginLeverageTier.md
new file mode 100644
index 0000000..c8fa212
--- /dev/null
+++ b/docs/MarginLeverageTier.md
@@ -0,0 +1,13 @@
+
+# MarginLeverageTier
+
+Market gradient information
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**upperLimit** | **String** | Maximum loan limit | [optional]
+**mmr** | **String** | Maintenance margin rate | [optional]
+**leverage** | **String** | Maximum leverage multiple | [optional]
+
diff --git a/docs/MarginMarketLeverage.md b/docs/MarginMarketLeverage.md
new file mode 100644
index 0000000..2dcd63d
--- /dev/null
+++ b/docs/MarginMarketLeverage.md
@@ -0,0 +1,12 @@
+
+# MarginMarketLeverage
+
+Market leverage settings
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPair** | **String** | Market | [optional]
+**leverage** | **String** | Position leverage |
+
diff --git a/docs/MarginTiers.md b/docs/MarginTiers.md
new file mode 100644
index 0000000..53d86e2
--- /dev/null
+++ b/docs/MarginTiers.md
@@ -0,0 +1,13 @@
+
+# MarginTiers
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tier** | **String** | Tier | [optional]
+**marginRate** | **String** | Discount | [optional]
+**lowerLimit** | **String** | Lower limit | [optional]
+**upperLimit** | **String** | Upper limit, \"\" indicates greater than (the last tier) | [optional]
+**leverage** | **String** | Position leverage | [optional]
+
diff --git a/docs/MarginUniApi.md b/docs/MarginUniApi.md
new file mode 100644
index 0000000..54e1d25
--- /dev/null
+++ b/docs/MarginUniApi.md
@@ -0,0 +1,593 @@
+# MarginUniApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**listUniCurrencyPairs**](MarginUniApi.md#listUniCurrencyPairs) | **GET** /margin/uni/currency_pairs | List lending markets
+[**getUniCurrencyPair**](MarginUniApi.md#getUniCurrencyPair) | **GET** /margin/uni/currency_pairs/{currency_pair} | Get lending market details
+[**getMarginUniEstimateRate**](MarginUniApi.md#getMarginUniEstimateRate) | **GET** /margin/uni/estimate_rate | Estimate interest rate for isolated margin currencies
+[**listUniLoans**](MarginUniApi.md#listUniLoans) | **GET** /margin/uni/loans | Query loans
+[**createUniLoan**](MarginUniApi.md#createUniLoan) | **POST** /margin/uni/loans | Borrow or repay
+[**listUniLoanRecords**](MarginUniApi.md#listUniLoanRecords) | **GET** /margin/uni/loan_records | Query loan records
+[**listUniLoanInterestRecords**](MarginUniApi.md#listUniLoanInterestRecords) | **GET** /margin/uni/interest_records | Query interest deduction records
+[**getUniBorrowable**](MarginUniApi.md#getUniBorrowable) | **GET** /margin/uni/borrowable | Query maximum borrowable amount by currency
+
+
+
+# **listUniCurrencyPairs**
+> List<UniCurrencyPair> listUniCurrencyPairs()
+
+List lending markets
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ try {
+ List result = apiInstance.listUniCurrencyPairs();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#listUniCurrencyPairs");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<UniCurrencyPair>**](UniCurrencyPair.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUniCurrencyPair**
+> UniCurrencyPair getUniCurrencyPair(currencyPair)
+
+Get lending market details
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ String currencyPair = "AE_USDT"; // String | Currency pair
+ try {
+ UniCurrencyPair result = apiInstance.getUniCurrencyPair(currencyPair);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#getUniCurrencyPair");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencyPair** | **String**| Currency pair |
+
+### Return type
+
+[**UniCurrencyPair**](UniCurrencyPair.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getMarginUniEstimateRate**
+> Map<String, String> getMarginUniEstimateRate(currencies)
+
+Estimate interest rate for isolated margin currencies
+
+Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ List currencies = Arrays.asList(); // List | Array of currency names to query, maximum 10
+ try {
+ Map result = apiInstance.getMarginUniEstimateRate(currencies);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#getMarginUniEstimateRate");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencies** | [**List<String>**](String.md)| Array of currency names to query, maximum 10 |
+
+### Return type
+
+**Map<String, String>**
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listUniLoans**
+> List<UniLoan> listUniLoans().currencyPair(currencyPair).currency(currency).page(page).limit(limit).execute();
+
+Query loans
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ String currencyPair = "BTC_USDT"; // String | Currency pair
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ try {
+ List result = apiInstance.listUniLoans()
+ .currencyPair(currencyPair)
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#listUniLoans");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencyPair** | **String**| Currency pair | [optional]
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+
+### Return type
+
+[**List<UniLoan>**](UniLoan.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **createUniLoan**
+> createUniLoan(createUniLoan)
+
+Borrow or repay
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ CreateUniLoan createUniLoan = new CreateUniLoan(); // CreateUniLoan |
+ try {
+ apiInstance.createUniLoan(createUniLoan);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#createUniLoan");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **createUniLoan** | [**CreateUniLoan**](CreateUniLoan.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Operation successful | - |
+
+
+# **listUniLoanRecords**
+> List<UniLoanRecord> listUniLoanRecords().type(type).currency(currency).currencyPair(currencyPair).page(page).limit(limit).execute();
+
+Query loan records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ String type = "type_example"; // String | Type: `borrow` - borrow, `repay` - repay
+ String currency = "BTC"; // String | Query by specified currency name
+ String currencyPair = "BTC_USDT"; // String | Currency pair
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ try {
+ List result = apiInstance.listUniLoanRecords()
+ .type(type)
+ .currency(currency)
+ .currencyPair(currencyPair)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#listUniLoanRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **type** | **String**| Type: `borrow` - borrow, `repay` - repay | [optional] [enum: borrow, repay]
+ **currency** | **String**| Query by specified currency name | [optional]
+ **currencyPair** | **String**| Currency pair | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+
+### Return type
+
+[**List<UniLoanRecord>**](UniLoanRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listUniLoanInterestRecords**
+> List<UniLoanInterestRecord> listUniLoanInterestRecords().currencyPair(currencyPair).currency(currency).page(page).limit(limit).from(from).to(to).execute();
+
+Query interest deduction records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ String currencyPair = "BTC_USDT"; // String | Currency pair
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ try {
+ List result = apiInstance.listUniLoanInterestRecords()
+ .currencyPair(currencyPair)
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#listUniLoanInterestRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencyPair** | **String**| Currency pair | [optional]
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+
+### Return type
+
+[**List<UniLoanInterestRecord>**](UniLoanInterestRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUniBorrowable**
+> MaxUniBorrowable getUniBorrowable(currency, currencyPair)
+
+Query maximum borrowable amount by currency
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MarginUniApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MarginUniApi apiInstance = new MarginUniApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ String currencyPair = "BTC_USDT"; // String | Currency pair
+ try {
+ MaxUniBorrowable result = apiInstance.getUniBorrowable(currency, currencyPair);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MarginUniApi#getUniBorrowable");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name |
+ **currencyPair** | **String**| Currency pair |
+
+### Return type
+
+[**MaxUniBorrowable**](MaxUniBorrowable.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
diff --git a/docs/MaxUniBorrowable.md b/docs/MaxUniBorrowable.md
new file mode 100644
index 0000000..22621c1
--- /dev/null
+++ b/docs/MaxUniBorrowable.md
@@ -0,0 +1,11 @@
+
+# MaxUniBorrowable
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [readonly]
+**currencyPair** | **String** | Currency pair | [optional] [readonly]
+**borrowable** | **String** | Maximum borrowable | [readonly]
+
diff --git a/docs/MockFuturesOrder.md b/docs/MockFuturesOrder.md
new file mode 100644
index 0000000..8860ed2
--- /dev/null
+++ b/docs/MockFuturesOrder.md
@@ -0,0 +1,13 @@
+
+# MockFuturesOrder
+
+Futures order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contract** | **String** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH |
+**size** | **String** | Contract quantity, representing the initial order quantity, not involved in actual settlement |
+**left** | **String** | Unfilled contract quantity, involved in actual calculation |
+
diff --git a/docs/MockFuturesPosition.md b/docs/MockFuturesPosition.md
new file mode 100644
index 0000000..733eff4
--- /dev/null
+++ b/docs/MockFuturesPosition.md
@@ -0,0 +1,12 @@
+
+# MockFuturesPosition
+
+Futures positions
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contract** | **String** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH |
+**size** | **String** | Position size, measured in contract quantity |
+
diff --git a/docs/MockMarginResult.md b/docs/MockMarginResult.md
new file mode 100644
index 0000000..2a01ae7
--- /dev/null
+++ b/docs/MockMarginResult.md
@@ -0,0 +1,17 @@
+
+# MockMarginResult
+
+Margin result
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **String** | Position combination type `original_position` - Original position `long_delta_original_position` - Positive delta + Original position `short_delta_original_position` - Negative delta + Original position | [optional]
+**profitLossRanges** | [**List<ProfitLossRange>**](ProfitLossRange.md) | Results of 33 stress scenarios for MR1 | [optional]
+**maxLoss** | [**ProfitLossRange**](.md) | 最大损失 | [optional]
+**mr1** | **String** | Stress testing | [optional]
+**mr2** | **String** | Basis spread risk | [optional]
+**mr3** | **String** | Volatility spread risk | [optional]
+**mr4** | **String** | Option short risk | [optional]
+
diff --git a/docs/MockOptionsOrder.md b/docs/MockOptionsOrder.md
new file mode 100644
index 0000000..41ff221
--- /dev/null
+++ b/docs/MockOptionsOrder.md
@@ -0,0 +1,13 @@
+
+# MockOptionsOrder
+
+Option orders
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**optionsName** | **String** | Option name, currently only supports USDT options for BTC and ETH |
+**size** | **String** | Initial order quantity, not involved in actual calculation |
+**left** | **String** | Unfilled contract quantity, involved in actual calculation |
+
diff --git a/docs/MockOptionsPosition.md b/docs/MockOptionsPosition.md
new file mode 100644
index 0000000..c0b8c66
--- /dev/null
+++ b/docs/MockOptionsPosition.md
@@ -0,0 +1,12 @@
+
+# MockOptionsPosition
+
+Options positions
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**optionsName** | **String** | Option name, currently only supports USDT options for BTC and ETH |
+**size** | **String** | Position size, measured in contract quantity |
+
diff --git a/docs/MockRiskUnit.md b/docs/MockRiskUnit.md
new file mode 100644
index 0000000..2080695
--- /dev/null
+++ b/docs/MockRiskUnit.md
@@ -0,0 +1,19 @@
+
+# MockRiskUnit
+
+Risk unit
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**symbol** | **String** | Risk unit name | [optional]
+**spotInUse** | **String** | Spot hedge usage | [optional]
+**maintainMargin** | **String** | Maintenance margin | [optional]
+**initialMargin** | **String** | Initial margin | [optional]
+**marginResult** | [**List<MockMarginResult>**](MockMarginResult.md) | Margin result | [optional]
+**delta** | **String** | Total Delta of risk unit | [optional]
+**gamma** | **String** | Total Gamma of risk unit | [optional]
+**theta** | **String** | Total Theta of risk unit | [optional]
+**vega** | **String** | Total Vega of risk unit | [optional]
+
diff --git a/docs/MockSpotBalance.md b/docs/MockSpotBalance.md
new file mode 100644
index 0000000..a1228c5
--- /dev/null
+++ b/docs/MockSpotBalance.md
@@ -0,0 +1,12 @@
+
+# MockSpotBalance
+
+Spot
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name |
+**equity** | **String** | Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions, which can be negative. Currently only supports BTC and ETH |
+
diff --git a/docs/MockSpotOrder.md b/docs/MockSpotOrder.md
new file mode 100644
index 0000000..df55fea
--- /dev/null
+++ b/docs/MockSpotOrder.md
@@ -0,0 +1,15 @@
+
+# MockSpotOrder
+
+Spot orders
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPairs** | **String** | Market |
+**orderPrice** | **String** | Price |
+**count** | **String** | Initial order quantity for spot trading pairs, not involved in actual calculation. Currently only supports BTC and ETH Currently only supports three currencies: BTC, ETH | [optional]
+**left** | **String** | Unfilled quantity, involved in actual calculation |
+**type** | **String** | Order type, sell - sell order, buy - buy order |
+
diff --git a/docs/MultiCollateralCurrency.md b/docs/MultiCollateralCurrency.md
new file mode 100644
index 0000000..b1e08bc
--- /dev/null
+++ b/docs/MultiCollateralCurrency.md
@@ -0,0 +1,12 @@
+
+# MultiCollateralCurrency
+
+Borrowing and collateral currencies supported for Multi-Collateral
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**loanCurrencies** | [**List<MultiLoanItem>**](MultiLoanItem.md) | List of supported borrowing currencies | [optional]
+**collateralCurrencies** | [**List<MultiCollateralItem>**](MultiCollateralItem.md) | List of supported collateral currencies | [optional]
+
diff --git a/docs/MultiCollateralItem.md b/docs/MultiCollateralItem.md
new file mode 100644
index 0000000..9bf8bf4
--- /dev/null
+++ b/docs/MultiCollateralItem.md
@@ -0,0 +1,11 @@
+
+# MultiCollateralItem
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**discount** | **String** | Discount | [optional]
+
diff --git a/docs/MultiCollateralLoanApi.md b/docs/MultiCollateralLoanApi.md
new file mode 100644
index 0000000..7724c39
--- /dev/null
+++ b/docs/MultiCollateralLoanApi.md
@@ -0,0 +1,859 @@
+# MultiCollateralLoanApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**listMultiCollateralOrders**](MultiCollateralLoanApi.md#listMultiCollateralOrders) | **GET** /loan/multi_collateral/orders | Query multi-currency collateral order list
+[**createMultiCollateral**](MultiCollateralLoanApi.md#createMultiCollateral) | **POST** /loan/multi_collateral/orders | Place multi-currency collateral order
+[**getMultiCollateralOrderDetail**](MultiCollateralLoanApi.md#getMultiCollateralOrderDetail) | **GET** /loan/multi_collateral/orders/{order_id} | Query order details
+[**listMultiRepayRecords**](MultiCollateralLoanApi.md#listMultiRepayRecords) | **GET** /loan/multi_collateral/repay | Query multi-currency collateral repayment records
+[**repayMultiCollateralLoan**](MultiCollateralLoanApi.md#repayMultiCollateralLoan) | **POST** /loan/multi_collateral/repay | Multi-currency collateral repayment
+[**listMultiCollateralRecords**](MultiCollateralLoanApi.md#listMultiCollateralRecords) | **GET** /loan/multi_collateral/mortgage | Query collateral adjustment records
+[**operateMultiCollateral**](MultiCollateralLoanApi.md#operateMultiCollateral) | **POST** /loan/multi_collateral/mortgage | Add or withdraw collateral
+[**listUserCurrencyQuota**](MultiCollateralLoanApi.md#listUserCurrencyQuota) | **GET** /loan/multi_collateral/currency_quota | Query user's collateral and borrowing currency quota information
+[**listMultiCollateralCurrencies**](MultiCollateralLoanApi.md#listMultiCollateralCurrencies) | **GET** /loan/multi_collateral/currencies | Query supported borrowing and collateral currencies for multi-currency collateral
+[**getMultiCollateralLtv**](MultiCollateralLoanApi.md#getMultiCollateralLtv) | **GET** /loan/multi_collateral/ltv | Query collateralization ratio information
+[**getMultiCollateralFixRate**](MultiCollateralLoanApi.md#getMultiCollateralFixRate) | **GET** /loan/multi_collateral/fixed_rate | Query currency's 7-day and 30-day fixed interest rates
+[**getMultiCollateralCurrentRate**](MultiCollateralLoanApi.md#getMultiCollateralCurrentRate) | **GET** /loan/multi_collateral/current_rate | Query currency's current interest rate
+
+
+
+# **listMultiCollateralOrders**
+> List<MultiCollateralOrder> listMultiCollateralOrders().page(page).limit(limit).sort(sort).orderType(orderType).execute();
+
+Query multi-currency collateral order list
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ Integer page = 1; // Integer | Page number
+ Integer limit = 10; // Integer | Maximum number of records returned in a single list
+ String sort = "ltv_asc"; // String | Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending.
+ String orderType = "current"; // String | Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders if not specified
+ try {
+ List result = apiInstance.listMultiCollateralOrders()
+ .page(page)
+ .limit(limit)
+ .sort(sort)
+ .orderType(orderType)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#listMultiCollateralOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 10]
+ **sort** | **String**| Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending. | [optional]
+ **orderType** | **String**| Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders if not specified | [optional]
+
+### Return type
+
+[**List<MultiCollateralOrder>**](MultiCollateralOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **createMultiCollateral**
+> OrderResp createMultiCollateral(createMultiCollateralOrder)
+
+Place multi-currency collateral order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ CreateMultiCollateralOrder createMultiCollateralOrder = new CreateMultiCollateralOrder(); // CreateMultiCollateralOrder |
+ try {
+ OrderResp result = apiInstance.createMultiCollateral(createMultiCollateralOrder);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#createMultiCollateral");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **createMultiCollateralOrder** | [**CreateMultiCollateralOrder**](CreateMultiCollateralOrder.md)| |
+
+### Return type
+
+[**OrderResp**](OrderResp.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order placed successfully | - |
+
+
+# **getMultiCollateralOrderDetail**
+> MultiCollateralOrder getMultiCollateralOrderDetail(orderId)
+
+Query order details
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ String orderId = "12345"; // String | Order ID returned when order is successfully created
+ try {
+ MultiCollateralOrder result = apiInstance.getMultiCollateralOrderDetail(orderId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#getMultiCollateralOrderDetail");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **String**| Order ID returned when order is successfully created |
+
+### Return type
+
+[**MultiCollateralOrder**](MultiCollateralOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order details queried successfully | - |
+
+
+# **listMultiRepayRecords**
+> List<MultiRepayRecord> listMultiRepayRecords(type).borrowCurrency(borrowCurrency).page(page).limit(limit).from(from).to(to).execute();
+
+Query multi-currency collateral repayment records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ String type = "repay"; // String | Operation type: repay - Regular repayment, liquidate - Liquidation
+ String borrowCurrency = "USDT"; // String | Borrowed currency
+ Integer page = 1; // Integer | Page number
+ Integer limit = 10; // Integer | Maximum number of records returned in a single list
+ Long from = 1609459200L; // Long | Start timestamp for the query
+ Long to = 1609459200L; // Long | End timestamp for the query, defaults to current time if not specified
+ try {
+ List result = apiInstance.listMultiRepayRecords(type)
+ .borrowCurrency(borrowCurrency)
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#listMultiRepayRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **type** | **String**| Operation type: repay - Regular repayment, liquidate - Liquidation |
+ **borrowCurrency** | **String**| Borrowed currency | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 10]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+
+### Return type
+
+[**List<MultiRepayRecord>**](MultiRepayRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **repayMultiCollateralLoan**
+> MultiRepayResp repayMultiCollateralLoan(repayMultiLoan)
+
+Multi-currency collateral repayment
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ RepayMultiLoan repayMultiLoan = new RepayMultiLoan(); // RepayMultiLoan |
+ try {
+ MultiRepayResp result = apiInstance.repayMultiCollateralLoan(repayMultiLoan);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#repayMultiCollateralLoan");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **repayMultiLoan** | [**RepayMultiLoan**](RepayMultiLoan.md)| |
+
+### Return type
+
+[**MultiRepayResp**](MultiRepayResp.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Operation successful | - |
+
+
+# **listMultiCollateralRecords**
+> List<MultiCollateralRecord> listMultiCollateralRecords().page(page).limit(limit).from(from).to(to).collateralCurrency(collateralCurrency).execute();
+
+Query collateral adjustment records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ Integer page = 1; // Integer | Page number
+ Integer limit = 10; // Integer | Maximum number of records returned in a single list
+ Long from = 1609459200L; // Long | Start timestamp for the query
+ Long to = 1609459200L; // Long | End timestamp for the query, defaults to current time if not specified
+ String collateralCurrency = "BTC"; // String | Collateral currency
+ try {
+ List result = apiInstance.listMultiCollateralRecords()
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .collateralCurrency(collateralCurrency)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#listMultiCollateralRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 10]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **collateralCurrency** | **String**| Collateral currency | [optional]
+
+### Return type
+
+[**List<MultiCollateralRecord>**](MultiCollateralRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **operateMultiCollateral**
+> CollateralAdjustRes operateMultiCollateral(collateralAdjust)
+
+Add or withdraw collateral
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ CollateralAdjust collateralAdjust = new CollateralAdjust(); // CollateralAdjust |
+ try {
+ CollateralAdjustRes result = apiInstance.operateMultiCollateral(collateralAdjust);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#operateMultiCollateral");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **collateralAdjust** | [**CollateralAdjust**](CollateralAdjust.md)| |
+
+### Return type
+
+[**CollateralAdjustRes**](CollateralAdjustRes.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Operation successful | - |
+
+
+# **listUserCurrencyQuota**
+> List<CurrencyQuota> listUserCurrencyQuota(type, currency)
+
+Query user's collateral and borrowing currency quota information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ String type = "collateral"; // String | Currency type: collateral - Collateral currency, borrow - Borrowing currency
+ String currency = "BTC"; // String | When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided.
+ try {
+ List result = apiInstance.listUserCurrencyQuota(type, currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#listUserCurrencyQuota");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **type** | **String**| Currency type: collateral - Collateral currency, borrow - Borrowing currency |
+ **currency** | **String**| When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided. |
+
+### Return type
+
+[**List<CurrencyQuota>**](CurrencyQuota.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listMultiCollateralCurrencies**
+> MultiCollateralCurrency listMultiCollateralCurrencies()
+
+Query supported borrowing and collateral currencies for multi-currency collateral
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ try {
+ MultiCollateralCurrency result = apiInstance.listMultiCollateralCurrencies();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#listMultiCollateralCurrencies");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**MultiCollateralCurrency**](MultiCollateralCurrency.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getMultiCollateralLtv**
+> CollateralLtv getMultiCollateralLtv()
+
+Query collateralization ratio information
+
+Multi-currency collateral ratio is fixed, independent of currency
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ try {
+ CollateralLtv result = apiInstance.getMultiCollateralLtv();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#getMultiCollateralLtv");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**CollateralLtv**](CollateralLtv.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getMultiCollateralFixRate**
+> List<CollateralFixRate> getMultiCollateralFixRate()
+
+Query currency's 7-day and 30-day fixed interest rates
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ try {
+ List result = apiInstance.getMultiCollateralFixRate();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#getMultiCollateralFixRate");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<CollateralFixRate>**](CollateralFixRate.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getMultiCollateralCurrentRate**
+> List<CollateralCurrentRate> getMultiCollateralCurrentRate(currencies).vipLevel(vipLevel).execute();
+
+Query currency's current interest rate
+
+Query currency's current interest rate for the previous hour, current interest rate updates hourly
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.MultiCollateralLoanApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ MultiCollateralLoanApi apiInstance = new MultiCollateralLoanApi(defaultClient);
+ List currencies = Arrays.asList(); // List | Specify currency name query array, separated by commas, maximum 100 items
+ String vipLevel = "\"0\""; // String | VIP level, defaults to 0 if not specified
+ try {
+ List result = apiInstance.getMultiCollateralCurrentRate(currencies)
+ .vipLevel(vipLevel)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling MultiCollateralLoanApi#getMultiCollateralCurrentRate");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencies** | [**List<String>**](String.md)| Specify currency name query array, separated by commas, maximum 100 items |
+ **vipLevel** | **String**| VIP level, defaults to 0 if not specified | [optional] [default to "0"]
+
+### Return type
+
+[**List<CollateralCurrentRate>**](CollateralCurrentRate.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
diff --git a/docs/MultiCollateralOrder.md b/docs/MultiCollateralOrder.md
new file mode 100644
index 0000000..bc39f2c
--- /dev/null
+++ b/docs/MultiCollateralOrder.md
@@ -0,0 +1,24 @@
+
+# MultiCollateralOrder
+
+Multi-Collateral Order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **String** | Order ID | [optional]
+**orderType** | **String** | current - current, fixed - fixed | [optional]
+**fixedType** | **String** | Fixed interest rate loan periods: 7d - 7 days, 30d - 30 days | [optional]
+**fixedRate** | **String** | Fixed interest rate | [optional]
+**expireTime** | **Long** | Expiration time, timestamp, unit in seconds | [optional]
+**autoRenew** | **Boolean** | Fixed interest rate, auto-renewal | [optional]
+**autoRepay** | **Boolean** | Fixed interest rate, auto-repayment | [optional]
+**currentLtv** | **String** | Current collateralization rate | [optional]
+**status** | **String** | Order status: - initial: Initial state after placing the order - collateral_deducted: Collateral deduction successful - collateral_returning: Loan failed - Collateral return pending - lent: Loan successful - repaying: Repayment in progress - liquidating: Liquidation in progress - finished: Order completed - closed_liquidated: Liquidation and repayment completed | [optional]
+**borrowTime** | **Long** | Borrowing time, timestamp in seconds | [optional]
+**totalLeftRepayUsdt** | **String** | Total outstanding value converted to USDT | [optional]
+**totalLeftCollateralUsdt** | **String** | Total collateral value converted to USDT | [optional]
+**borrowCurrencies** | [**List<BorrowCurrencyInfo>**](BorrowCurrencyInfo.md) | Borrowing Currency List | [optional]
+**collateralCurrencies** | [**List<CollateralCurrencyInfo>**](CollateralCurrencyInfo.md) | Collateral Currency List | [optional]
+
diff --git a/docs/MultiCollateralRecord.md b/docs/MultiCollateralRecord.md
new file mode 100644
index 0000000..c800ba4
--- /dev/null
+++ b/docs/MultiCollateralRecord.md
@@ -0,0 +1,17 @@
+
+# MultiCollateralRecord
+
+Multi-Collateral adjustment record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+**recordId** | **Long** | Collateral record ID | [optional]
+**beforeLtv** | **String** | Collateral ratio before adjustment | [optional]
+**afterLtv** | **String** | Collateral ratio before adjustment | [optional]
+**operateTime** | **Long** | Operation time, timestamp in seconds | [optional]
+**borrowCurrencies** | [**List<MultiCollateralRecordCurrency>**](MultiCollateralRecordCurrency.md) | Borrowing Currency List | [optional]
+**collateralCurrencies** | [**List<MultiCollateralRecordCurrency>**](MultiCollateralRecordCurrency.md) | Collateral Currency List | [optional]
+
diff --git a/docs/MultiCollateralRecordCurrency.md b/docs/MultiCollateralRecordCurrency.md
new file mode 100644
index 0000000..b147ff0
--- /dev/null
+++ b/docs/MultiCollateralRecordCurrency.md
@@ -0,0 +1,14 @@
+
+# MultiCollateralRecordCurrency
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**beforeAmount** | **String** | Amount before the operation | [optional]
+**beforeAmountUsdt** | **String** | USDT Amount before the operation | [optional]
+**afterAmount** | **String** | Amount after the operation | [optional]
+**afterAmountUsdt** | **String** | USDT Amount after the operation | [optional]
+
diff --git a/docs/MultiLoanItem.md b/docs/MultiLoanItem.md
new file mode 100644
index 0000000..ce949d7
--- /dev/null
+++ b/docs/MultiLoanItem.md
@@ -0,0 +1,10 @@
+
+# MultiLoanItem
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**price** | **String** | Latest price of the currency | [optional]
+
diff --git a/docs/MultiLoanRepayItem.md b/docs/MultiLoanRepayItem.md
new file mode 100644
index 0000000..0a563aa
--- /dev/null
+++ b/docs/MultiLoanRepayItem.md
@@ -0,0 +1,11 @@
+
+# MultiLoanRepayItem
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Repayment currency | [optional]
+**amount** | **String** | Size | [optional]
+**repaidAll** | **Boolean** | Repayment method, set to true for full repayment, false for partial repayment |
+
diff --git a/docs/MultiRepayRecord.md b/docs/MultiRepayRecord.md
new file mode 100644
index 0000000..43880bd
--- /dev/null
+++ b/docs/MultiRepayRecord.md
@@ -0,0 +1,22 @@
+
+# MultiRepayRecord
+
+Multi-Collateral Repayment Record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+**recordId** | **Long** | Repayment record ID | [optional]
+**initLtv** | **String** | Initial collateralization rate | [optional]
+**beforeLtv** | **String** | Ltv before the operation | [optional]
+**afterLtv** | **String** | Ltv after the operation | [optional]
+**borrowTime** | **Long** | Borrowing time, timestamp in seconds | [optional]
+**repayTime** | **Long** | Repayment time, timestamp in seconds | [optional]
+**borrowCurrencies** | [**List<RepayRecordCurrency>**](RepayRecordCurrency.md) | List of borrowing information | [optional]
+**collateralCurrencies** | [**List<RepayRecordCurrency>**](RepayRecordCurrency.md) | List of collateral information | [optional]
+**repaidCurrencies** | [**List<RepayRecordRepaidCurrency>**](RepayRecordRepaidCurrency.md) | Repay Currency List | [optional]
+**totalInterestList** | [**List<RepayRecordTotalInterest>**](RepayRecordTotalInterest.md) | Total Interest List | [optional]
+**leftRepayInterestList** | [**List<RepayRecordLeftInterest>**](RepayRecordLeftInterest.md) | List of remaining interest to be repaid | [optional]
+
diff --git a/docs/MultiRepayResp.md b/docs/MultiRepayResp.md
new file mode 100644
index 0000000..afdbea9
--- /dev/null
+++ b/docs/MultiRepayResp.md
@@ -0,0 +1,12 @@
+
+# MultiRepayResp
+
+Multi-currency collateral repayment
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+**repaidCurrencies** | [**List<RepayCurrencyRes>**](RepayCurrencyRes.md) | Repay Currency List | [optional]
+
diff --git a/docs/MyFuturesTrade.md b/docs/MyFuturesTrade.md
index b0af3a2..6ba2205 100644
--- a/docs/MyFuturesTrade.md
+++ b/docs/MyFuturesTrade.md
@@ -5,13 +5,17 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **Long** | Trade ID | [optional]
-**createTime** | **Double** | Trading time | [optional]
+**id** | **Long** | Fill ID | [optional]
+**createTime** | **Double** | Fill Time | [optional]
**contract** | **String** | Futures contract | [optional]
-**orderId** | **String** | Order ID related | [optional]
+**orderId** | **String** | Related order ID | [optional]
**size** | **Long** | Trading size | [optional]
-**price** | **String** | Trading price | [optional]
-**role** | [**RoleEnum**](#RoleEnum) | Trade role. Available values are `taker` and `maker` | [optional]
+**closeSize** | **Long** | Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position | [optional]
+**price** | **String** | Fill Price | [optional]
+**role** | [**RoleEnum**](#RoleEnum) | Trade role. taker - taker, maker - maker | [optional]
+**text** | **String** | Order custom information | [optional]
+**fee** | **String** | Trade fee | [optional]
+**pointFee** | **String** | Points used to deduct trade fee | [optional]
## Enum: RoleEnum
diff --git a/docs/MyFuturesTradeTimeRange.md b/docs/MyFuturesTradeTimeRange.md
new file mode 100644
index 0000000..c9a11be
--- /dev/null
+++ b/docs/MyFuturesTradeTimeRange.md
@@ -0,0 +1,26 @@
+
+# MyFuturesTradeTimeRange
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tradeId** | **String** | Fill ID | [optional]
+**createTime** | **Double** | Fill Time | [optional]
+**contract** | **String** | Futures contract | [optional]
+**orderId** | **String** | Related order ID | [optional]
+**size** | **Long** | Trading size | [optional]
+**closeSize** | **Long** | Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position | [optional]
+**price** | **String** | Fill Price | [optional]
+**role** | [**RoleEnum**](#RoleEnum) | Trade role. taker - taker, maker - maker | [optional]
+**text** | **String** | Order custom information | [optional]
+**fee** | **String** | Trade fee | [optional]
+**pointFee** | **String** | Points used to deduct trade fee | [optional]
+
+## Enum: RoleEnum
+
+Name | Value
+---- | -----
+TAKER | "taker"
+MAKER | "maker"
+
diff --git a/docs/OpenOrders.md b/docs/OpenOrders.md
index 4357658..75b0f2e 100644
--- a/docs/OpenOrders.md
+++ b/docs/OpenOrders.md
@@ -6,6 +6,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currencyPair** | **String** | Currency pair | [optional]
-**total** | **Integer** | Total open orders in this currency pair | [optional]
+**total** | **Integer** | Total number of open orders for this trading pair on the current page | [optional]
**orders** | [**List<Order>**](Order.md) | | [optional]
diff --git a/docs/OptionsAccount.md b/docs/OptionsAccount.md
new file mode 100644
index 0000000..df62861
--- /dev/null
+++ b/docs/OptionsAccount.md
@@ -0,0 +1,35 @@
+
+# OptionsAccount
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**user** | **Long** | User ID | [optional]
+**total** | **String** | Account Balance | [optional]
+**positionValue** | **String** | Position value, long position value is positive, short position value is negative | [optional]
+**equity** | **String** | Account equity, the sum of account balance and position value | [optional]
+**shortEnabled** | **Boolean** | If the account is allowed to short | [optional]
+**mmpEnabled** | **Boolean** | Whether to enable MMP | [optional]
+**liqTriggered** | **Boolean** | Whether to trigger position liquidation | [optional]
+**marginMode** | [**MarginModeEnum**](#MarginModeEnum) | | 保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 | [optional]
+**unrealisedPnl** | **String** | Unrealized PNL | [optional]
+**initMargin** | **String** | Initial position margin | [optional]
+**maintMargin** | **String** | Position maintenance margin | [optional]
+**orderMargin** | **String** | Order margin of unfinished orders | [optional]
+**askOrderMargin** | **String** | Margin for outstanding sell orders | [optional]
+**bidOrderMargin** | **String** | Margin for outstanding buy orders | [optional]
+**available** | **String** | Available balance to transfer out or trade | [optional]
+**point** | **String** | Point card amount | [optional]
+**currency** | **String** | Settlement currency | [optional]
+**ordersLimit** | **Integer** | Maximum number of outstanding orders | [optional]
+**positionNotionalLimit** | **Long** | Notional value upper limit, including the nominal value of positions and outstanding orders | [optional]
+
+## Enum: MarginModeEnum
+
+Name | Value
+---- | -----
+NUMBER_0 | 0
+NUMBER_1 | 1
+NUMBER_2 | 2
+
diff --git a/docs/OptionsAccountBook.md b/docs/OptionsAccountBook.md
new file mode 100644
index 0000000..7c12eb6
--- /dev/null
+++ b/docs/OptionsAccountBook.md
@@ -0,0 +1,13 @@
+
+# OptionsAccountBook
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Double** | Change time | [optional]
+**change** | **String** | Amount changed (USDT) | [optional]
+**balance** | **String** | Account total balance after change (USDT) | [optional]
+**type** | **String** | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional]
+**text** | **String** | Remark | [optional]
+
diff --git a/docs/OptionsApi.md b/docs/OptionsApi.md
new file mode 100644
index 0000000..a55b055
--- /dev/null
+++ b/docs/OptionsApi.md
@@ -0,0 +1,2039 @@
+# OptionsApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**listOptionsUnderlyings**](OptionsApi.md#listOptionsUnderlyings) | **GET** /options/underlyings | List all underlying assets
+[**listOptionsExpirations**](OptionsApi.md#listOptionsExpirations) | **GET** /options/expirations | List all expiration dates
+[**listOptionsContracts**](OptionsApi.md#listOptionsContracts) | **GET** /options/contracts | List all contracts for specified underlying and expiration date
+[**getOptionsContract**](OptionsApi.md#getOptionsContract) | **GET** /options/contracts/{contract} | Query specified contract details
+[**listOptionsSettlements**](OptionsApi.md#listOptionsSettlements) | **GET** /options/settlements | List settlement history
+[**getOptionsSettlement**](OptionsApi.md#getOptionsSettlement) | **GET** /options/settlements/{contract} | Get specified contract settlement information
+[**listMyOptionsSettlements**](OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | Query personal settlement records
+[**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Query options contract order book
+[**listOptionsTickers**](OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | Query options market ticker information
+[**listOptionsUnderlyingTickers**](OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Query underlying ticker information
+[**listOptionsCandlesticks**](OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Options contract market candlestick chart
+[**listOptionsUnderlyingCandlesticks**](OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Underlying index price candlestick chart
+[**listOptionsTrades**](OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Market trade records
+[**listOptionsAccount**](OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | Query account information
+[**listOptionsAccountBook**](OptionsApi.md#listOptionsAccountBook) | **GET** /options/account_book | Query account change history
+[**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 options orders
+[**createOptionsOrder**](OptionsApi.md#createOptionsOrder) | **POST** /options/orders | Create an options order
+[**cancelOptionsOrders**](OptionsApi.md#cancelOptionsOrders) | **DELETE** /options/orders | Cancel all orders with 'open' status
+[**getOptionsOrder**](OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Query single order details
+[**cancelOptionsOrder**](OptionsApi.md#cancelOptionsOrder) | **DELETE** /options/orders/{order_id} | Cancel single order
+[**countdownCancelAllOptions**](OptionsApi.md#countdownCancelAllOptions) | **POST** /options/countdown_cancel_all | Countdown cancel orders
+[**listMyOptionsTrades**](OptionsApi.md#listMyOptionsTrades) | **GET** /options/my_trades | Query personal trading records
+[**getOptionsMMP**](OptionsApi.md#getOptionsMMP) | **GET** /options/mmp | MMP Query.
+[**setOptionsMMP**](OptionsApi.md#setOptionsMMP) | **POST** /options/mmp | MMP Settings
+[**resetOptionsMMP**](OptionsApi.md#resetOptionsMMP) | **POST** /options/mmp/reset | MMP Reset
+
+
+
+# **listOptionsUnderlyings**
+> List<OptionsUnderlying> listOptionsUnderlyings()
+
+List all underlying assets
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ try {
+ List result = apiInstance.listOptionsUnderlyings();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsUnderlyings");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<OptionsUnderlying>**](OptionsUnderlying.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **listOptionsExpirations**
+> List<Long> listOptionsExpirations(underlying)
+
+List all expiration dates
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ try {
+ List result = apiInstance.listOptionsExpirations(underlying);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsExpirations");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+
+### Return type
+
+**List<Long>**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List expiration dates for specified underlying | - |
+
+
+# **listOptionsContracts**
+> List<OptionsContract> listOptionsContracts(underlying).expiration(expiration).execute();
+
+List all contracts for specified underlying and expiration date
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ Long expiration = 1636588800L; // Long | Unix timestamp of expiration date
+ try {
+ List result = apiInstance.listOptionsContracts(underlying)
+ .expiration(expiration)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsContracts");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+ **expiration** | **Long**| Unix timestamp of expiration date | [optional]
+
+### Return type
+
+[**List<OptionsContract>**](OptionsContract.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **getOptionsContract**
+> OptionsContract getOptionsContract(contract)
+
+Query specified contract details
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String contract = "BTC_USDT-20211130-65000-C"; // String |
+ try {
+ OptionsContract result = apiInstance.getOptionsContract(contract);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#getOptionsContract");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **contract** | **String**| |
+
+### Return type
+
+[**OptionsContract**](OptionsContract.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listOptionsSettlements**
+> List<OptionsSettlement> listOptionsSettlements(underlying).limit(limit).offset(offset).from(from).to(to).execute();
+
+List settlement history
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ try {
+ List result = apiInstance.listOptionsSettlements(underlying)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsSettlements");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+
+### Return type
+
+[**List<OptionsSettlement>**](OptionsSettlement.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **getOptionsSettlement**
+> OptionsSettlement getOptionsSettlement(contract, underlying, at)
+
+Get specified contract settlement information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String contract = "BTC_USDT-20211130-65000-C"; // String |
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ Long at = 56L; // Long |
+ try {
+ OptionsSettlement result = apiInstance.getOptionsSettlement(contract, underlying, at);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#getOptionsSettlement");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **contract** | **String**| |
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+ **at** | **Long**| |
+
+### Return type
+
+[**OptionsSettlement**](OptionsSettlement.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listMyOptionsSettlements**
+> List<OptionsMySettlements> listMyOptionsSettlements(underlying).contract(contract).limit(limit).offset(offset).from(from).to(to).execute();
+
+Query personal settlement records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ try {
+ List result = apiInstance.listMyOptionsSettlements(underlying)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listMyOptionsSettlements");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+ **contract** | **String**| Options contract name | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+
+### Return type
+
+[**List<OptionsMySettlements>**](OptionsMySettlements.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **listOptionsOrderBook**
+> FuturesOrderBook listOptionsOrderBook(contract).interval(interval).limit(limit).withId(withId).execute();
+
+Query options contract order book
+
+Bids will be sorted by price from high to low, while asks sorted reversely
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ String interval = "0"; // String | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified
+ Integer limit = 10; // Integer | Number of depth levels
+ Boolean withId = false; // Boolean | Whether to return depth update ID. This ID increments by 1 each time depth changes
+ try {
+ FuturesOrderBook result = apiInstance.listOptionsOrderBook(contract)
+ .interval(interval)
+ .limit(limit)
+ .withId(withId)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsOrderBook");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **contract** | **String**| Options contract name |
+ **interval** | **String**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to 0] [enum: 0, 0.1, 0.01]
+ **limit** | **Integer**| Number of depth levels | [optional] [default to 10]
+ **withId** | **Boolean**| Whether to return depth update ID. This ID increments by 1 each time depth changes | [optional] [default to false]
+
+### Return type
+
+[**FuturesOrderBook**](FuturesOrderBook.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Depth query successful | - |
+
+
+# **listOptionsTickers**
+> List<OptionsTicker> listOptionsTickers(underlying)
+
+Query options market ticker information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ try {
+ List result = apiInstance.listOptionsTickers(underlying);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsTickers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+
+### Return type
+
+[**List<OptionsTicker>**](OptionsTicker.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listOptionsUnderlyingTickers**
+> OptionsUnderlyingTicker listOptionsUnderlyingTickers(underlying)
+
+Query underlying ticker information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying
+ try {
+ OptionsUnderlyingTicker result = apiInstance.listOptionsUnderlyingTickers(underlying);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsUnderlyingTickers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying |
+
+### Return type
+
+[**OptionsUnderlyingTicker**](OptionsUnderlyingTicker.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listOptionsCandlesticks**
+> List<OptionsCandlestick> listOptionsCandlesticks(contract).limit(limit).from(from).to(to).interval(interval).execute();
+
+Options contract market candlestick chart
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ String interval = "5m"; // String | Time interval between data points
+ try {
+ List result = apiInstance.listOptionsCandlesticks(contract)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .interval(interval)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsCandlesticks");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **contract** | **String**| Options contract name |
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **interval** | **String**| Time interval between data points | [optional] [default to 5m] [enum: 1m, 5m, 15m, 30m, 1h]
+
+### Return type
+
+[**List<OptionsCandlestick>**](OptionsCandlestick.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listOptionsUnderlyingCandlesticks**
+> List<FuturesCandlestick> listOptionsUnderlyingCandlesticks(underlying).limit(limit).from(from).to(to).interval(interval).execute();
+
+Underlying index price candlestick chart
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ String interval = "5m"; // String | Time interval between data points
+ try {
+ List result = apiInstance.listOptionsUnderlyingCandlesticks(underlying)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .interval(interval)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsUnderlyingCandlesticks");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **interval** | **String**| Time interval between data points | [optional] [default to 5m] [enum: 1m, 5m, 15m, 30m, 1h]
+
+### Return type
+
+[**List<FuturesCandlestick>**](FuturesCandlestick.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listOptionsTrades**
+> List<FuturesTrade> listOptionsTrades().contract(contract).type(type).limit(limit).offset(offset).from(from).to(to).execute();
+
+Market trade records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ String type = "1546935600"; // String | `C` for call, `P` for put
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ try {
+ List result = apiInstance.listOptionsTrades()
+ .contract(contract)
+ .type(type)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsTrades");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **contract** | **String**| Options contract name | [optional]
+ **type** | **String**| `C` for call, `P` for put | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+
+### Return type
+
+[**List<FuturesTrade>**](FuturesTrade.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **listOptionsAccount**
+> OptionsAccount listOptionsAccount()
+
+Query account information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ try {
+ OptionsAccount result = apiInstance.listOptionsAccount();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**OptionsAccount**](OptionsAccount.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listOptionsAccountBook**
+> List<OptionsAccountBook> listOptionsAccountBook().limit(limit).offset(offset).from(from).to(to).type(type).execute();
+
+Query account change history
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ String type = "dnw"; // String | Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L
+ try {
+ List result = apiInstance.listOptionsAccountBook()
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .type(type)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsAccountBook");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+ **type** | **String**| Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L | [optional] [enum: dnw, prem, fee, refr, set]
+
+### Return type
+
+[**List<OptionsAccountBook>**](OptionsAccountBook.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **listOptionsPositions**
+> List<OptionsPosition> listOptionsPositions().underlying(underlying).execute();
+
+List user's positions of specified underlying
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying
+ try {
+ List result = apiInstance.listOptionsPositions()
+ .underlying(underlying)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsPositions");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying | [optional]
+
+### Return type
+
+[**List<OptionsPosition>**](OptionsPosition.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **getOptionsPosition**
+> OptionsPosition getOptionsPosition(contract)
+
+Get specified contract position
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String contract = "BTC_USDT-20211130-65000-C"; // String |
+ try {
+ OptionsPosition result = apiInstance.getOptionsPosition(contract);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#getOptionsPosition");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **contract** | **String**| |
+
+### Return type
+
+[**OptionsPosition**](OptionsPosition.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listOptionsPositionClose**
+> List<OptionsPositionClose> listOptionsPositionClose(underlying).contract(contract).execute();
+
+List user's liquidation history of specified underlying
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ try {
+ List result = apiInstance.listOptionsPositionClose(underlying)
+ .contract(contract)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsPositionClose");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+ **contract** | **String**| Options contract name | [optional]
+
+### Return type
+
+[**List<OptionsPositionClose>**](OptionsPositionClose.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **listOptionsOrders**
+> List<OptionsOrder> listOptionsOrders(status).contract(contract).underlying(underlying).limit(limit).offset(offset).from(from).to(to).execute();
+
+List options orders
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String status = "open"; // String | Query order list based on status
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ String underlying = "BTC_USDT"; // String | Underlying
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ try {
+ List result = apiInstance.listOptionsOrders(status)
+ .contract(contract)
+ .underlying(underlying)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listOptionsOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | **String**| Query order list based on status | [enum: open, finished]
+ **contract** | **String**| Options contract name | [optional]
+ **underlying** | **String**| Underlying | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+
+### Return type
+
+[**List<OptionsOrder>**](OptionsOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **createOptionsOrder**
+> OptionsOrder createOptionsOrder(optionsOrder)
+
+Create an options order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ OptionsOrder optionsOrder = new OptionsOrder(); // OptionsOrder |
+ try {
+ OptionsOrder result = apiInstance.createOptionsOrder(optionsOrder);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#createOptionsOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **optionsOrder** | [**OptionsOrder**](OptionsOrder.md)| |
+
+### Return type
+
+[**OptionsOrder**](OptionsOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**201** | Order detail | - |
+
+
+# **cancelOptionsOrders**
+> List<OptionsOrder> cancelOptionsOrders(contract, underlying, side)
+
+Cancel all orders with 'open' status
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ String underlying = "BTC_USDT"; // String | Underlying
+ String side = "ask"; // String | Specify all bids or all asks, both included if not specified
+ try {
+ List result = apiInstance.cancelOptionsOrders(contract, underlying, side);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#cancelOptionsOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **contract** | **String**| Options contract name | [optional]
+ **underlying** | **String**| Underlying | [optional]
+ **side** | **String**| Specify all bids or all asks, both included if not specified | [optional] [enum: ask, bid]
+
+### Return type
+
+[**List<OptionsOrder>**](OptionsOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Batch cancellation successful | - |
+
+
+# **getOptionsOrder**
+> OptionsOrder getOptionsOrder(orderId)
+
+Query single order details
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ Long orderId = 12345L; // Long | Order ID returned when order is successfully created
+ try {
+ OptionsOrder result = apiInstance.getOptionsOrder(orderId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#getOptionsOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| Order ID returned when order is successfully created |
+
+### Return type
+
+[**OptionsOrder**](OptionsOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order detail | - |
+
+
+# **cancelOptionsOrder**
+> OptionsOrder cancelOptionsOrder(orderId)
+
+Cancel single order
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ Long orderId = 12345L; // Long | Order ID returned when order is successfully created
+ try {
+ OptionsOrder result = apiInstance.cancelOptionsOrder(orderId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#cancelOptionsOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| Order ID returned when order is successfully created |
+
+### Return type
+
+[**OptionsOrder**](OptionsOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order detail | - |
+
+
+# **countdownCancelAllOptions**
+> TriggerTime countdownCancelAllOptions(countdownCancelAllOptionsTask)
+
+Countdown cancel orders
+
+Option order heartbeat detection, when the `timeout` time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related `option pending order` will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown `timeout` set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the `underlying` `contract` you specified will be automatically cancelled. If `underlying` `contract` is not specified, user will be automatically cancelled If `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ CountdownCancelAllOptionsTask countdownCancelAllOptionsTask = new CountdownCancelAllOptionsTask(); // CountdownCancelAllOptionsTask |
+ try {
+ TriggerTime result = apiInstance.countdownCancelAllOptions(countdownCancelAllOptionsTask);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#countdownCancelAllOptions");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **countdownCancelAllOptionsTask** | [**CountdownCancelAllOptionsTask**](CountdownCancelAllOptionsTask.md)| |
+
+### Return type
+
+[**TriggerTime**](TriggerTime.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Countdown set successfully | - |
+
+
+# **listMyOptionsTrades**
+> List<OptionsMyTrade> listMyOptionsTrades(underlying).contract(contract).limit(limit).offset(offset).from(from).to(to).execute();
+
+Query personal trading records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint)
+ String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long from = 1547706332L; // Long | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
+ Long to = 1547706332L; // Long | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
+ try {
+ List result = apiInstance.listMyOptionsTrades(underlying)
+ .contract(contract)
+ .limit(limit)
+ .offset(offset)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#listMyOptionsTrades");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) |
+ **contract** | **String**| Options contract name | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **from** | **Long**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional]
+ **to** | **Long**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional]
+
+### Return type
+
+[**List<OptionsMyTrade>**](OptionsMyTrade.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **getOptionsMMP**
+> List<OptionsMMP> getOptionsMMP().underlying(underlying).execute();
+
+MMP Query.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ String underlying = "BTC_USDT"; // String | Underlying
+ try {
+ List result = apiInstance.getOptionsMMP()
+ .underlying(underlying)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#getOptionsMMP");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **underlying** | **String**| Underlying | [optional]
+
+### Return type
+
+[**List<OptionsMMP>**](OptionsMMP.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **setOptionsMMP**
+> OptionsMMP setOptionsMMP(optionsMMP)
+
+MMP Settings
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ OptionsMMP optionsMMP = new OptionsMMP(); // OptionsMMP |
+ try {
+ OptionsMMP result = apiInstance.setOptionsMMP(optionsMMP);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#setOptionsMMP");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **optionsMMP** | [**OptionsMMP**](OptionsMMP.md)| |
+
+### Return type
+
+[**OptionsMMP**](OptionsMMP.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | MMP Information | - |
+
+
+# **resetOptionsMMP**
+> OptionsMMP resetOptionsMMP(optionsMMPReset)
+
+MMP Reset
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.OptionsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ OptionsApi apiInstance = new OptionsApi(defaultClient);
+ OptionsMMPReset optionsMMPReset = new OptionsMMPReset(); // OptionsMMPReset |
+ try {
+ OptionsMMP result = apiInstance.resetOptionsMMP(optionsMMPReset);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OptionsApi#resetOptionsMMP");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **optionsMMPReset** | [**OptionsMMPReset**](OptionsMMPReset.md)| |
+
+### Return type
+
+[**OptionsMMP**](OptionsMMP.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | MMP Information | - |
+
diff --git a/docs/OptionsCandlestick.md b/docs/OptionsCandlestick.md
new file mode 100644
index 0000000..1f6a717
--- /dev/null
+++ b/docs/OptionsCandlestick.md
@@ -0,0 +1,16 @@
+
+# OptionsCandlestick
+
+data point in every timestamp
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**t** | **Double** | Unix timestamp in seconds | [optional]
+**v** | **Long** | size volume (contract size). Only returned if `contract` is not prefixed | [optional]
+**c** | **String** | Close price (quote currency, unit: underlying corresponding option price) | [optional]
+**h** | **String** | Highest price (quote currency, unit: underlying corresponding option price) | [optional]
+**l** | **String** | Lowest price (quote currency, unit: underlying corresponding option price) | [optional]
+**o** | **String** | Open price (quote currency, unit: underlying corresponding option price) | [optional]
+
diff --git a/docs/OptionsContract.md b/docs/OptionsContract.md
new file mode 100644
index 0000000..c0943d3
--- /dev/null
+++ b/docs/OptionsContract.md
@@ -0,0 +1,35 @@
+
+# OptionsContract
+
+Options contract details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Options contract name | [optional]
+**tag** | **String** | Tag | [optional]
+**createTime** | **Double** | Created time | [optional]
+**expirationTime** | **Double** | Expiration time | [optional]
+**isCall** | **Boolean** | `true` means call options, `false` means put options | [optional]
+**multiplier** | **String** | Multiplier used in converting from invoicing to settlement currency | [optional]
+**underlying** | **String** | Underlying | [optional]
+**underlyingPrice** | **String** | Underlying price (quote currency) | [optional]
+**lastPrice** | **String** | Last trading price | [optional]
+**markPrice** | **String** | Current mark price (quote currency) | [optional]
+**indexPrice** | **String** | Current index price (quote currency) | [optional]
+**makerFeeRate** | **String** | Maker fee rate, negative values indicate rebates | [optional]
+**takerFeeRate** | **String** | Taker fee rate | [optional]
+**orderPriceRound** | **String** | Minimum order price increment | [optional]
+**markPriceRound** | **String** | Minimum mark price increment | [optional]
+**orderSizeMin** | **Long** | Minimum order size allowed by the contract | [optional]
+**orderSizeMax** | **Long** | Maximum order size allowed by the contract | [optional]
+**orderPriceDeviate** | **String** | The positive and negative offset allowed between the order price and the current mark price, that `order_price` must meet the following conditions: order_price is within the range of mark_price +/- order_price_deviate * underlying_price and does not distinguish between buy and sell orders | [optional]
+**refDiscountRate** | **String** | Trading fee discount for referred users | [optional]
+**refRebateRate** | **String** | Commission rate for referrers | [optional]
+**orderbookId** | **Long** | Orderbook update ID | [optional]
+**tradeId** | **Long** | Current trade ID | [optional]
+**tradeSize** | **Long** | Historical cumulative trading volume | [optional]
+**positionSize** | **Long** | Current total long position size | [optional]
+**ordersLimit** | **Integer** | Maximum number of pending orders | [optional]
+
diff --git a/docs/OptionsMMP.md b/docs/OptionsMMP.md
new file mode 100644
index 0000000..2465f3a
--- /dev/null
+++ b/docs/OptionsMMP.md
@@ -0,0 +1,17 @@
+
+# OptionsMMP
+
+MMP Settings
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**underlying** | **String** | Underlying |
+**window** | **Integer** | Time window (milliseconds), between 1-5000, 0 means disable MMP |
+**frozenPeriod** | **Integer** | Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze |
+**qtyLimit** | **String** | Trading volume upper limit (positive number, up to 2 decimal places) |
+**deltaLimit** | **String** | Upper limit of net delta value (positive number, up to 2 decimal places) |
+**triggerTimeMs** | **Long** | Trigger freeze time (milliseconds), 0 means no freeze is triggered | [optional] [readonly]
+**frozenUntilMs** | **Long** | Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered | [optional] [readonly]
+
diff --git a/docs/OptionsMMPReset.md b/docs/OptionsMMPReset.md
new file mode 100644
index 0000000..8f90a9c
--- /dev/null
+++ b/docs/OptionsMMPReset.md
@@ -0,0 +1,17 @@
+
+# OptionsMMPReset
+
+MMP Reset
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**underlying** | **String** | Underlying |
+**window** | **Integer** | Time window (milliseconds), between 1-5000, 0 means disable MMP | [optional] [readonly]
+**frozenPeriod** | **Integer** | Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze | [optional] [readonly]
+**qtyLimit** | **String** | Trading volume upper limit (positive number, up to 2 decimal places) | [optional] [readonly]
+**deltaLimit** | **String** | Upper limit of net delta value (positive number, up to 2 decimal places) | [optional] [readonly]
+**triggerTimeMs** | **Long** | Trigger freeze time (milliseconds), 0 means no freeze is triggered | [optional] [readonly]
+**frozenUntilMs** | **Long** | Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered | [optional] [readonly]
+
diff --git a/docs/OptionsMySettlements.md b/docs/OptionsMySettlements.md
new file mode 100644
index 0000000..1bf8c76
--- /dev/null
+++ b/docs/OptionsMySettlements.md
@@ -0,0 +1,17 @@
+
+# OptionsMySettlements
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Double** | Settlement time | [optional]
+**underlying** | **String** | Underlying | [optional]
+**contract** | **String** | Options contract name | [optional]
+**strikePrice** | **String** | Strike price (quote currency) | [optional]
+**settlePrice** | **String** | Settlement price (quote currency) | [optional]
+**size** | **Long** | Settlement size | [optional]
+**settleProfit** | **String** | Settlement profit (quote currency) | [optional]
+**fee** | **String** | Settlement fee (quote currency) | [optional]
+**realisedPnl** | **String** | Accumulated profit and loss from opening positions, including premium, fees, settlement profit, etc. (quote currency) | [optional]
+
diff --git a/docs/OptionsMyTrade.md b/docs/OptionsMyTrade.md
new file mode 100644
index 0000000..a8228ae
--- /dev/null
+++ b/docs/OptionsMyTrade.md
@@ -0,0 +1,23 @@
+
+# OptionsMyTrade
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | Fill ID | [optional]
+**createTime** | **Double** | Fill Time | [optional]
+**contract** | **String** | Options contract name | [optional]
+**orderId** | **Integer** | Related order ID | [optional]
+**size** | **Long** | Trading size | [optional]
+**price** | **String** | Trade price (quote currency) | [optional]
+**underlyingPrice** | **String** | Underlying price (quote currency) | [optional]
+**role** | [**RoleEnum**](#RoleEnum) | Trade role. taker - taker, maker - maker | [optional]
+
+## Enum: RoleEnum
+
+Name | Value
+---- | -----
+TAKER | "taker"
+MAKER | "maker"
+
diff --git a/docs/OptionsOrder.md b/docs/OptionsOrder.md
new file mode 100644
index 0000000..e35daf6
--- /dev/null
+++ b/docs/OptionsOrder.md
@@ -0,0 +1,64 @@
+
+# OptionsOrder
+
+Options order details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | Options order ID | [optional] [readonly]
+**user** | **Integer** | User ID | [optional] [readonly]
+**createTime** | **Double** | Creation time of order | [optional] [readonly]
+**finishTime** | **Double** | Order finished time. Not returned if order is open | [optional] [readonly]
+**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | Order finish reason: - filled: Fully filled - cancelled: User cancelled - liquidated: Cancelled due to liquidation - ioc: Not immediately fully filled due to IOC time-in-force setting - auto_deleveraged: Cancelled due to auto-deleveraging - reduce_only: Cancelled due to position increase while reduce-only is set - position_closed: Cancelled because the position was closed - reduce_out: Only reduce positions by excluding hard-to-fill orders - mmp_cancelled: Cancelled by MMP | [optional] [readonly]
+**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: Pending - `finished`: Completed | [optional] [readonly]
+**contract** | **String** | Options identifier |
+**size** | **Long** | Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. |
+**iceberg** | **Long** | Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. | [optional]
+**price** | **String** | Order price. Price of 0 with `tif` set as `ioc` represents market order (quote currency) | [optional]
+**close** | **Boolean** | Set as `true` to close the position, with `size` set to 0 | [optional]
+**isClose** | **Boolean** | Is the order to close position | [optional] [readonly]
+**reduceOnly** | **Boolean** | Set as `true` to be reduce-only order | [optional]
+**isReduceOnly** | **Boolean** | Is the order reduce-only | [optional] [readonly]
+**isLiq** | **Boolean** | Is the order for liquidation | [optional] [readonly]
+**mmp** | **Boolean** | When set to true, it is an MMP order | [optional]
+**isMmp** | **Boolean** | Whether it is an MMP order. Corresponds to `mmp` in the request | [optional] [readonly]
+**tif** | [**TifEnum**](#TifEnum) | Time in force strategy. Market orders currently only support IOC mode - gtc: Good Till Cancelled - ioc: Immediate Or Cancelled, execute immediately or cancel, taker only - poc: Pending Or Cancelled, passive order, maker only | [optional]
+**left** | **Long** | Unfilled quantity | [optional] [readonly]
+**fillPrice** | **String** | Fill price | [optional] [readonly]
+**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]
+**tkfr** | **String** | Taker fee | [optional] [readonly]
+**mkfr** | **String** | Maker fee | [optional] [readonly]
+**refu** | **Integer** | Referrer user ID | [optional] [readonly]
+**refr** | **String** | Referrer rebate | [optional] [readonly]
+
+## Enum: FinishAsEnum
+
+Name | Value
+---- | -----
+FILLED | "filled"
+CANCELLED | "cancelled"
+LIQUIDATED | "liquidated"
+IOC | "ioc"
+AUTO_DELEVERAGED | "auto_deleveraged"
+REDUCE_ONLY | "reduce_only"
+POSITION_CLOSED | "position_closed"
+REDUCE_OUT | "reduce_out"
+MMP_CANCELLED | "mmp_cancelled"
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+OPEN | "open"
+FINISHED | "finished"
+
+## Enum: TifEnum
+
+Name | Value
+---- | -----
+GTC | "gtc"
+IOC | "ioc"
+POC | "poc"
+
diff --git a/docs/OptionsPosition.md b/docs/OptionsPosition.md
new file mode 100644
index 0000000..958bf5c
--- /dev/null
+++ b/docs/OptionsPosition.md
@@ -0,0 +1,26 @@
+
+# OptionsPosition
+
+Options contract position details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**user** | **Integer** | User ID | [optional] [readonly]
+**underlying** | **String** | Underlying | [optional] [readonly]
+**underlyingPrice** | **String** | Underlying price (quote currency) | [optional] [readonly]
+**contract** | **String** | Options contract name | [optional] [readonly]
+**size** | **Long** | Position size (contract quantity) | [optional] [readonly]
+**entryPrice** | **String** | Entry size (quote currency) | [optional] [readonly]
+**markPrice** | **String** | Current mark price (quote currency) | [optional] [readonly]
+**markIv** | **String** | Implied volatility | [optional] [readonly]
+**realisedPnl** | **String** | Realized PnL | [optional] [readonly]
+**unrealisedPnl** | **String** | Unrealized PNL | [optional] [readonly]
+**pendingOrders** | **Integer** | Current pending order quantity | [optional] [readonly]
+**closeOrder** | [**OptionsPositionCloseOrder**](OptionsPositionCloseOrder.md) | | [optional]
+**delta** | **String** | Greek letter delta | [optional] [readonly]
+**gamma** | **String** | Greek letter gamma | [optional] [readonly]
+**vega** | **String** | Greek letter vega | [optional] [readonly]
+**theta** | **String** | Greek letter theta | [optional] [readonly]
+
diff --git a/docs/OptionsPositionClose.md b/docs/OptionsPositionClose.md
new file mode 100644
index 0000000..7f241db
--- /dev/null
+++ b/docs/OptionsPositionClose.md
@@ -0,0 +1,21 @@
+
+# OptionsPositionClose
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Double** | Position close time | [optional] [readonly]
+**contract** | **String** | Options contract name | [optional] [readonly]
+**side** | [**SideEnum**](#SideEnum) | Position side - `long`: Long position - `short`: Short position | [optional] [readonly]
+**pnl** | **String** | PnL | [optional] [readonly]
+**text** | **String** | Source of close order. See `order.text` field for specific values | [optional] [readonly]
+**settleSize** | **String** | Settlement size | [optional] [readonly]
+
+## Enum: SideEnum
+
+Name | Value
+---- | -----
+LONG | "long"
+SHORT | "short"
+
diff --git a/docs/OptionsPositionCloseOrder.md b/docs/OptionsPositionCloseOrder.md
new file mode 100644
index 0000000..8cc7bdc
--- /dev/null
+++ b/docs/OptionsPositionCloseOrder.md
@@ -0,0 +1,13 @@
+
+# OptionsPositionCloseOrder
+
+Current close order information, or `null` if no close order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | Order ID | [optional]
+**price** | **String** | Order price (quote currency) | [optional]
+**isLiq** | **Boolean** | Whether the close order is from liquidation | [optional]
+
diff --git a/docs/OptionsSettlement.md b/docs/OptionsSettlement.md
new file mode 100644
index 0000000..b13aa6a
--- /dev/null
+++ b/docs/OptionsSettlement.md
@@ -0,0 +1,14 @@
+
+# OptionsSettlement
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Double** | Last configuration update time | [optional]
+**contract** | **String** | Options contract name | [optional]
+**profit** | **String** | Settlement profit per contract (quote currency) | [optional]
+**fee** | **String** | Settlement fee per contract (quote currency) | [optional]
+**strikePrice** | **String** | Strike price (quote currency) | [optional]
+**settlePrice** | **String** | Settlement price (quote currency) | [optional]
+
diff --git a/docs/OptionsTicker.md b/docs/OptionsTicker.md
new file mode 100644
index 0000000..4f01c27
--- /dev/null
+++ b/docs/OptionsTicker.md
@@ -0,0 +1,28 @@
+
+# OptionsTicker
+
+Options contract details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Options contract name | [optional]
+**lastPrice** | **String** | Last trade price (quote currency) | [optional]
+**markPrice** | **String** | Current mark price (quote currency) | [optional]
+**indexPrice** | **String** | Current index price (quote currency) | [optional]
+**ask1Size** | **Long** | Best ask size | [optional]
+**ask1Price** | **String** | Best ask price | [optional]
+**bid1Size** | **Long** | Best bid size | [optional]
+**bid1Price** | **String** | Best bid price | [optional]
+**positionSize** | **Long** | Current total long position size | [optional]
+**markIv** | **String** | Implied volatility | [optional]
+**bidIv** | **String** | Bid side implied volatility | [optional]
+**askIv** | **String** | Ask side implied volatility | [optional]
+**leverage** | **String** | Current leverage. Formula: underlying_price / mark_price * delta | [optional]
+**delta** | **String** | Greek letter delta | [optional]
+**gamma** | **String** | Greek letter gamma | [optional]
+**vega** | **String** | Greek letter vega | [optional]
+**theta** | **String** | Greek letter theta | [optional]
+**rho** | **String** | Rho | [optional]
+
diff --git a/docs/OptionsUnderlying.md b/docs/OptionsUnderlying.md
new file mode 100644
index 0000000..40e0148
--- /dev/null
+++ b/docs/OptionsUnderlying.md
@@ -0,0 +1,10 @@
+
+# OptionsUnderlying
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Underlying name | [optional]
+**indexPrice** | **String** | Spot index price (quote currency) | [optional]
+
diff --git a/docs/OptionsUnderlyingTicker.md b/docs/OptionsUnderlyingTicker.md
new file mode 100644
index 0000000..19d8af3
--- /dev/null
+++ b/docs/OptionsUnderlyingTicker.md
@@ -0,0 +1,13 @@
+
+# OptionsUnderlyingTicker
+
+Options underlying detail
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tradePut** | **Long** | Total put options trades amount in last 24h | [optional]
+**tradeCall** | **Long** | Total call options trades amount in last 24h | [optional]
+**indexPrice** | **String** | Index price (quote currency) | [optional]
+
diff --git a/docs/Order.md b/docs/Order.md
index 84e359a..d1ae44c 100644
--- a/docs/Order.md
+++ b/docs/Order.md
@@ -8,32 +8,41 @@ Spot order details
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | Order ID | [optional] [readonly]
-**text** | **String** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional]
+**text** | **String** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional]
+**amendText** | **String** | The custom data that the user remarked when amending the order | [optional] [readonly]
**createTime** | **String** | Creation time of order | [optional] [readonly]
**updateTime** | **String** | Last modification time of order | [optional] [readonly]
**createTimeMs** | **Long** | Creation time of order (in milliseconds) | [optional] [readonly]
**updateTimeMs** | **Long** | Last modification time of order (in milliseconds) | [optional] [readonly]
**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly]
**currencyPair** | **String** | Currency pair |
-**type** | [**TypeEnum**](#TypeEnum) | Order type. limit - limit order | [optional]
-**account** | [**AccountEnum**](#AccountEnum) | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional]
-**side** | [**SideEnum**](#SideEnum) | Order side |
-**amount** | **String** | Trade amount |
-**price** | **String** | Order price |
-**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional]
-**iceberg** | **String** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional]
-**autoBorrow** | **Boolean** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional]
-**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]
+**type** | [**TypeEnum**](#TypeEnum) | Order Type - limit : Limit Order - market : Market Order | [optional]
+**account** | **String** | Account type, spot - spot account, margin - leveraged account, unified - unified account | [optional]
+**side** | [**SideEnum**](#SideEnum) | Buy or sell order |
+**amount** | **String** | Trading quantity When `type` is `limit`, it refers to the base currency (the currency being traded), such as `BTC` in `BTC_USDT` When `type` is `market`, it refers to different currencies based on the side: - `side`: `buy` refers to quote currency, `BTC_USDT` means `USDT` - `side`: `sell` refers to base currency, `BTC_USDT` means `BTC` |
+**price** | **String** | Trading price, required when `type`=`limit` | [optional]
+**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | 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]
+**iceberg** | **String** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported | [optional]
+**autoBorrow** | **Boolean** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough | [optional]
+**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` can be both set to true in one order | [optional]
**left** | **String** | Amount left to fill | [optional] [readonly]
+**filledAmount** | **String** | Amount filled | [optional] [readonly]
**fillPrice** | **String** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly]
**filledTotal** | **String** | Total filled in quote currency | [optional] [readonly]
+**avgDealPrice** | **String** | Average fill price | [optional] [readonly]
**fee** | **String** | Fee deducted | [optional] [readonly]
**feeCurrency** | **String** | Fee currency unit | [optional] [readonly]
**pointFee** | **String** | Points used to deduct fee | [optional] [readonly]
**gtFee** | **String** | GT used to deduct fee | [optional] [readonly]
-**gtDiscount** | **Boolean** | Whether GT fee discount is used | [optional] [readonly]
+**gtMakerFee** | **String** | GT amount used to deduct maker fee | [optional] [readonly]
+**gtTakerFee** | **String** | GT amount used to deduct taker fee | [optional] [readonly]
+**gtDiscount** | **Boolean** | Whether GT fee deduction is enabled | [optional] [readonly]
**rebatedFee** | **String** | Rebated fee | [optional] [readonly]
**rebatedFeeCurrency** | **String** | Rebated fee currency unit | [optional] [readonly]
+**stpId** | **Integer** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly]
+**stpAct** | [**StpActEnum**](#StpActEnum) | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional]
+**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | Order completion statuses include: - open: Awaiting processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled due to liquidation - small: Order quantity too small - depth_not_enough: Cancelled due to insufficient market depth - trader_not_enough: Cancelled due to insufficient counterparty - ioc: Not immediately filled because tif is set to ioc - poc: Not met the order poc - fok: Not fully filled immediately because tif is set to fok - stp: Cancelled due to self-trade prevention - unknown: Unknown | [optional] [readonly]
+**actionMode** | **String** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional]
## Enum: StatusEnum
@@ -48,14 +57,7 @@ CANCELLED | "cancelled"
Name | Value
---- | -----
LIMIT | "limit"
-
-## Enum: AccountEnum
-
-Name | Value
----- | -----
-SPOT | "spot"
-MARGIN | "margin"
-CROSS_MARGIN | "cross_margin"
+MARKET | "market"
## Enum: SideEnum
@@ -71,4 +73,31 @@ Name | Value
GTC | "gtc"
IOC | "ioc"
POC | "poc"
+FOK | "fok"
+
+## Enum: StpActEnum
+
+Name | Value
+---- | -----
+CN | "cn"
+CO | "co"
+CB | "cb"
+MINUS | "-"
+
+## Enum: FinishAsEnum
+
+Name | Value
+---- | -----
+OPEN | "open"
+FILLED | "filled"
+CANCELLED | "cancelled"
+LIQUIDATE_CANCELLED | "liquidate_cancelled"
+DEPTH_NOT_ENOUGH | "depth_not_enough"
+TRADER_NOT_ENOUGH | "trader_not_enough"
+SMALL | "small"
+IOC | "ioc"
+POC | "poc"
+FOK | "fok"
+STP | "stp"
+UNKNOWN | "unknown"
diff --git a/docs/OrderBook.md b/docs/OrderBook.md
index ce9ec36..c3389ed 100644
--- a/docs/OrderBook.md
+++ b/docs/OrderBook.md
@@ -8,6 +8,6 @@ Name | Type | Description | Notes
**id** | **Long** | Order book ID, which is updated whenever the order book is changed. Valid only when `with_id` is set to `true` | [optional]
**current** | **Long** | The timestamp of the response data being generated (in milliseconds) | [optional]
**update** | **Long** | The timestamp of when the orderbook last changed (in milliseconds) | [optional]
-**asks** | [**List<List<String>>**](List.md) | Asks order depth |
-**bids** | [**List<List<String>>**](List.md) | Bids order depth |
+**asks** | [**List<List<String>>**](List.md) | Ask Depth |
+**bids** | [**List<List<String>>**](List.md) | Bid Depth |
diff --git a/docs/OrderCancel.md b/docs/OrderCancel.md
new file mode 100644
index 0000000..02edb7c
--- /dev/null
+++ b/docs/OrderCancel.md
@@ -0,0 +1,99 @@
+
+# OrderCancel
+
+Spot order details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **String** | Order ID | [optional] [readonly]
+**text** | **String** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional]
+**amendText** | **String** | The custom data that the user remarked when amending the order | [optional] [readonly]
+**succeeded** | **Boolean** | Request execution result | [optional]
+**label** | **String** | Error label, if any, otherwise an empty string | [optional]
+**message** | **String** | Detailed error message, if any, otherwise an empty string | [optional]
+**createTime** | **String** | Creation time of order | [optional] [readonly]
+**updateTime** | **String** | Last modification time of order | [optional] [readonly]
+**createTimeMs** | **Long** | Creation time of order (in milliseconds) | [optional] [readonly]
+**updateTimeMs** | **Long** | Last modification time of order (in milliseconds) | [optional] [readonly]
+**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly]
+**currencyPair** | **String** | Currency pair |
+**type** | [**TypeEnum**](#TypeEnum) | Order Type - limit : Limit Order - market : Market Order | [optional]
+**account** | **String** | Account type, spot - spot account, margin - leveraged account, unified - unified account | [optional]
+**side** | [**SideEnum**](#SideEnum) | Buy or sell order |
+**amount** | **String** | Trading quantity When `type` is `limit`, it refers to the base currency (the currency being traded), such as `BTC` in `BTC_USDT` When `type` is `market`, it refers to different currencies based on the side: - `side`: `buy` refers to quote currency, `BTC_USDT` means `USDT` - `side`: `sell` refers to base currency, `BTC_USDT` means `BTC` |
+**price** | **String** | Trading price, required when `type`=`limit` | [optional]
+**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | 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]
+**iceberg** | **String** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported | [optional]
+**autoBorrow** | **Boolean** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough | [optional]
+**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` can be both set to true in one order | [optional]
+**left** | **String** | Amount left to fill | [optional] [readonly]
+**filledAmount** | **String** | Amount filled | [optional] [readonly]
+**fillPrice** | **String** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly]
+**filledTotal** | **String** | Total filled in quote currency | [optional] [readonly]
+**avgDealPrice** | **String** | Average fill price | [optional] [readonly]
+**fee** | **String** | Fee deducted | [optional] [readonly]
+**feeCurrency** | **String** | Fee currency unit | [optional] [readonly]
+**pointFee** | **String** | Points used to deduct fee | [optional] [readonly]
+**gtFee** | **String** | GT used to deduct fee | [optional] [readonly]
+**gtMakerFee** | **String** | GT amount used to deduct maker fee | [optional] [readonly]
+**gtTakerFee** | **String** | GT amount used to deduct taker fee | [optional] [readonly]
+**gtDiscount** | **Boolean** | Whether GT fee deduction is enabled | [optional] [readonly]
+**rebatedFee** | **String** | Rebated fee | [optional] [readonly]
+**rebatedFeeCurrency** | **String** | Rebated fee currency unit | [optional] [readonly]
+**stpId** | **Integer** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly]
+**stpAct** | [**StpActEnum**](#StpActEnum) | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional]
+**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | How the order was finished. - open: processing - filled: filled totally - cancelled: manually cancelled - ioc: time in force is `IOC`, finish immediately - stp: cancelled because self trade prevention | [optional] [readonly]
+**actionMode** | **String** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional]
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+OPEN | "open"
+CLOSED | "closed"
+CANCELLED | "cancelled"
+
+## Enum: TypeEnum
+
+Name | Value
+---- | -----
+LIMIT | "limit"
+MARKET | "market"
+
+## Enum: SideEnum
+
+Name | Value
+---- | -----
+BUY | "buy"
+SELL | "sell"
+
+## Enum: TimeInForceEnum
+
+Name | Value
+---- | -----
+GTC | "gtc"
+IOC | "ioc"
+POC | "poc"
+FOK | "fok"
+
+## Enum: StpActEnum
+
+Name | Value
+---- | -----
+CN | "cn"
+CO | "co"
+CB | "cb"
+MINUS | "-"
+
+## Enum: FinishAsEnum
+
+Name | Value
+---- | -----
+OPEN | "open"
+FILLED | "filled"
+CANCELLED | "cancelled"
+IOC | "ioc"
+STP | "stp"
+
diff --git a/docs/OrderPatch.md b/docs/OrderPatch.md
new file mode 100644
index 0000000..88d1655
--- /dev/null
+++ b/docs/OrderPatch.md
@@ -0,0 +1,16 @@
+
+# OrderPatch
+
+Spot order details
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPair** | **String** | Currency pair | [optional]
+**account** | **String** | Specify query account | [optional]
+**amount** | **String** | Trading quantity. Either `amount` or `price` must be specified | [optional]
+**price** | **String** | Trading price. Either `amount` or `price` must be specified | [optional]
+**amendText** | **String** | Custom info during order amendment | [optional]
+**actionMode** | **String** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional]
+
diff --git a/docs/OrderResp.md b/docs/OrderResp.md
new file mode 100644
index 0000000..2ae418f
--- /dev/null
+++ b/docs/OrderResp.md
@@ -0,0 +1,9 @@
+
+# OrderResp
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+
diff --git a/docs/PartnerCommissionHistory.md b/docs/PartnerCommissionHistory.md
new file mode 100644
index 0000000..aa64c35
--- /dev/null
+++ b/docs/PartnerCommissionHistory.md
@@ -0,0 +1,10 @@
+
+# PartnerCommissionHistory
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**total** | **Long** | Total | [optional]
+**list** | [**List<AgencyCommission>**](AgencyCommission.md) | List of commission history | [optional]
+
diff --git a/docs/PartnerSub.md b/docs/PartnerSub.md
new file mode 100644
index 0000000..52b0f25
--- /dev/null
+++ b/docs/PartnerSub.md
@@ -0,0 +1,11 @@
+
+# PartnerSub
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | User ID | [optional]
+**userJoinTime** | **Long** | Time when user joined the system, Unix timestamp in seconds | [optional]
+**type** | **Long** | Type (1-Sub-agent 2-Indirect direct customer 3-Direct direct customer) | [optional]
+
diff --git a/docs/PartnerSubList.md b/docs/PartnerSubList.md
new file mode 100644
index 0000000..5b4073b
--- /dev/null
+++ b/docs/PartnerSubList.md
@@ -0,0 +1,10 @@
+
+# PartnerSubList
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**total** | **Long** | Total | [optional]
+**list** | [**List<PartnerSub>**](PartnerSub.md) | Subordinate list | [optional]
+
diff --git a/docs/PartnerTransactionHistory.md b/docs/PartnerTransactionHistory.md
new file mode 100644
index 0000000..af44969
--- /dev/null
+++ b/docs/PartnerTransactionHistory.md
@@ -0,0 +1,10 @@
+
+# PartnerTransactionHistory
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**total** | **Long** | Total | [optional]
+**list** | [**List<AgencyTransaction>**](AgencyTransaction.md) | List of transaction history | [optional]
+
diff --git a/docs/PatchUniLend.md b/docs/PatchUniLend.md
new file mode 100644
index 0000000..91ad469
--- /dev/null
+++ b/docs/PatchUniLend.md
@@ -0,0 +1,10 @@
+
+# PatchUniLend
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name | [optional]
+**minRate** | **String** | Minimum interest rate | [optional]
+
diff --git a/docs/PlaceDualInvestmentOrder.md b/docs/PlaceDualInvestmentOrder.md
new file mode 100644
index 0000000..2607a54
--- /dev/null
+++ b/docs/PlaceDualInvestmentOrder.md
@@ -0,0 +1,13 @@
+
+# PlaceDualInvestmentOrder
+
+Dual Investment Order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**planId** | **String** | Product ID |
+**amount** | **String** | Subscription amount, mutually exclusive with copies field |
+**text** | **String** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional]
+
diff --git a/docs/Position.md b/docs/Position.md
index d7465af..eb133ef 100644
--- a/docs/Position.md
+++ b/docs/Position.md
@@ -19,17 +19,28 @@ Name | Type | Description | Notes
**entryPrice** | **String** | Entry price | [optional] [readonly]
**liqPrice** | **String** | Liquidation price | [optional] [readonly]
**markPrice** | **String** | Current mark price | [optional] [readonly]
+**initialMargin** | **String** | The initial margin occupied by the position, applicable to the portfolio margin account | [optional] [readonly]
+**maintenanceMargin** | **String** | Maintenance margin required for the position, applicable to portfolio margin account | [optional] [readonly]
**unrealisedPnl** | **String** | Unrealized PNL | [optional] [readonly]
-**realisedPnl** | **String** | Realized PNL | [optional] [readonly]
-**historyPnl** | **String** | History realized PNL | [optional] [readonly]
+**realisedPnl** | **String** | Realized PnL | [optional] [readonly]
+**pnlPnl** | **String** | Realized PNL - Position P/L | [optional] [readonly]
+**pnlFund** | **String** | Realized PNL - Funding Fees | [optional] [readonly]
+**pnlFee** | **String** | Realized PNL - Transaction Fees | [optional] [readonly]
+**historyPnl** | **String** | Total realized PnL from closed positions | [optional] [readonly]
**lastClosePnl** | **String** | PNL of last position close | [optional] [readonly]
**realisedPoint** | **String** | Realized POINT PNL | [optional] [readonly]
**historyPoint** | **String** | History realized POINT PNL | [optional] [readonly]
-**adlRanking** | **Integer** | ADL ranking, ranging from 1 to 5 | [optional] [readonly]
-**pendingOrders** | **Integer** | Current open orders | [optional] [readonly]
+**adlRanking** | **Integer** | Ranking of auto deleveraging, a total of 1-5 grades, `1` is the highest, `5` is the lowest, and `6` is the special case when there is no position held or in liquidation | [optional] [readonly]
+**pendingOrders** | **Integer** | Current pending order quantity | [optional] [readonly]
**closeOrder** | [**PositionCloseOrder**](PositionCloseOrder.md) | | [optional]
-**mode** | [**ModeEnum**](#ModeEnum) | Position mode, including: - `single`: dual mode is not enabled- `dual_long`: long position in dual mode- `dual_short`: short position in dual mode | [optional]
-**crossLeverageLimit** | **String** | Cross margin leverage(valid only when `leverage` is 0) | [optional]
+**mode** | [**ModeEnum**](#ModeEnum) | Position mode, including: - `single`: Single position mode - `dual_long`: Long position in dual position mode - `dual_short`: Short position in dual position mode | [optional]
+**crossLeverageLimit** | **String** | Cross margin leverage (valid only when `leverage` is 0) | [optional]
+**updateTime** | **Long** | Last update time | [optional] [readonly]
+**updateId** | **Long** | Update ID. The value increments by 1 each time the position is updated | [optional] [readonly]
+**openTime** | **Long** | First Open Time | [optional]
+**riskLimitTable** | **String** | Risk limit table ID | [optional] [readonly]
+**averageMaintenanceRate** | **String** | Average maintenance margin rate | [optional] [readonly]
+**pid** | **Long** | Sub-account position ID | [optional] [readonly]
## Enum: ModeEnum
diff --git a/docs/PositionClose.md b/docs/PositionClose.md
index 866556a..def9d71 100644
--- a/docs/PositionClose.md
+++ b/docs/PositionClose.md
@@ -7,9 +7,17 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **Double** | Position close time | [optional] [readonly]
**contract** | **String** | Futures contract | [optional] [readonly]
-**side** | [**SideEnum**](#SideEnum) | Position side, long or short | [optional] [readonly]
-**pnl** | **String** | PNL | [optional] [readonly]
-**text** | **String** | Text of close order | [optional] [readonly]
+**side** | [**SideEnum**](#SideEnum) | Position side - `long`: Long position - `short`: Short position | [optional] [readonly]
+**pnl** | **String** | PnL | [optional] [readonly]
+**pnlPnl** | **String** | PNL - Position P/L | [optional] [readonly]
+**pnlFund** | **String** | PNL - Funding Fees | [optional] [readonly]
+**pnlFee** | **String** | PNL - Transaction Fees | [optional] [readonly]
+**text** | **String** | Source of close order. See `order.text` field for specific values | [optional] [readonly]
+**maxSize** | **String** | Max Trade Size | [optional] [readonly]
+**accumSize** | **String** | Cumulative closed position volume | [optional] [readonly]
+**firstOpenTime** | **Long** | First Open Time | [optional] [readonly]
+**longPrice** | **String** | When side is 'long', it indicates the opening average price; when side is 'short', it indicates the closing average price | [optional] [readonly]
+**shortPrice** | **String** | When side is 'long', it indicates the closing average price; when side is 'short', it indicates the opening average price | [optional] [readonly]
## Enum: SideEnum
diff --git a/docs/PositionCloseOrder.md b/docs/PositionCloseOrder.md
index 13c6ad6..72d4929 100644
--- a/docs/PositionCloseOrder.md
+++ b/docs/PositionCloseOrder.md
@@ -1,13 +1,13 @@
# PositionCloseOrder
-Current close order if any, or `null`
+Current close order information, or `null` if no close order
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **Long** | Close order ID | [optional]
-**price** | **String** | Close order price | [optional]
-**isLiq** | **Boolean** | Is the close order from liquidation | [optional]
+**id** | **Long** | Order ID | [optional]
+**price** | **String** | Order price | [optional]
+**isLiq** | **Boolean** | Whether the close order is from liquidation | [optional]
diff --git a/docs/ProfitLossRange.md b/docs/ProfitLossRange.md
new file mode 100644
index 0000000..8c95b59
--- /dev/null
+++ b/docs/ProfitLossRange.md
@@ -0,0 +1,13 @@
+
+# ProfitLossRange
+
+Profit and loss range
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**pricePercentage** | **String** | Percentage change in price | [optional]
+**impliedVolatilityPercentage** | **String** | Percentage change in implied volatility | [optional]
+**profitLoss** | **String** | PnL | [optional]
+
diff --git a/docs/RebateApi.md b/docs/RebateApi.md
new file mode 100644
index 0000000..333e137
--- /dev/null
+++ b/docs/RebateApi.md
@@ -0,0 +1,748 @@
+# RebateApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**agencyTransactionHistory**](RebateApi.md#agencyTransactionHistory) | **GET** /rebate/agency/transaction_history | Broker obtains transaction history of recommended users
+[**agencyCommissionsHistory**](RebateApi.md#agencyCommissionsHistory) | **GET** /rebate/agency/commission_history | Broker obtains rebate history of recommended users
+[**partnerTransactionHistory**](RebateApi.md#partnerTransactionHistory) | **GET** /rebate/partner/transaction_history | Partner obtains transaction history of recommended users
+[**partnerCommissionsHistory**](RebateApi.md#partnerCommissionsHistory) | **GET** /rebate/partner/commission_history | Partner obtains rebate records of recommended users
+[**partnerSubList**](RebateApi.md#partnerSubList) | **GET** /rebate/partner/sub_list | Partner subordinate list
+[**rebateBrokerCommissionHistory**](RebateApi.md#rebateBrokerCommissionHistory) | **GET** /rebate/broker/commission_history | Broker obtains user's rebate records
+[**rebateBrokerTransactionHistory**](RebateApi.md#rebateBrokerTransactionHistory) | **GET** /rebate/broker/transaction_history | Broker obtains user's trading history
+[**rebateUserInfo**](RebateApi.md#rebateUserInfo) | **GET** /rebate/user/info | User obtains rebate information
+[**userSubRelation**](RebateApi.md#userSubRelation) | **GET** /rebate/user/sub_relation | User subordinate relationship
+
+
+
+# **agencyTransactionHistory**
+> List<AgencyTransactionHistory> agencyTransactionHistory().currencyPair(currencyPair).userId(userId).from(from).to(to).limit(limit).offset(offset).execute();
+
+Broker obtains transaction history of recommended users
+
+Record query time range cannot exceed 30 days
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ String currencyPair = "BTC_USDT"; // String | Specify the trading pair. If not specified, returns all trading pairs
+ Long userId = 10003L; // Long | User ID. If not specified, all user records will be returned
+ Long from = 1602120000L; // Long | Start time for querying records, defaults to 7 days before current time if not specified
+ Long to = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ try {
+ List result = apiInstance.agencyTransactionHistory()
+ .currencyPair(currencyPair)
+ .userId(userId)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .offset(offset)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#agencyTransactionHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencyPair** | **String**| Specify the trading pair. If not specified, returns all trading pairs | [optional]
+ **userId** | **Long**| User ID. If not specified, all user records will be returned | [optional]
+ **from** | **Long**| Start time for querying records, defaults to 7 days before current time if not specified | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+
+### Return type
+
+[**List<AgencyTransactionHistory>**](AgencyTransactionHistory.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **agencyCommissionsHistory**
+> List<AgencyCommissionHistory> agencyCommissionsHistory().currency(currency).commissionType(commissionType).userId(userId).from(from).to(to).limit(limit).offset(offset).execute();
+
+Broker obtains rebate history of recommended users
+
+Record query time range cannot exceed 30 days
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ String currency = "BTC"; // String | Specify the currency. If not specified, returns all currencies
+ Integer commissionType = 1; // Integer | Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate
+ Long userId = 10003L; // Long | User ID. If not specified, all user records will be returned
+ Long from = 1602120000L; // Long | Start time for querying records, defaults to 7 days before current time if not specified
+ Long to = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ try {
+ List result = apiInstance.agencyCommissionsHistory()
+ .currency(currency)
+ .commissionType(commissionType)
+ .userId(userId)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .offset(offset)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#agencyCommissionsHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Specify the currency. If not specified, returns all currencies | [optional]
+ **commissionType** | **Integer**| Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate | [optional]
+ **userId** | **Long**| User ID. If not specified, all user records will be returned | [optional]
+ **from** | **Long**| Start time for querying records, defaults to 7 days before current time if not specified | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+
+### Return type
+
+[**List<AgencyCommissionHistory>**](AgencyCommissionHistory.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **partnerTransactionHistory**
+> PartnerTransactionHistory partnerTransactionHistory().currencyPair(currencyPair).userId(userId).from(from).to(to).limit(limit).offset(offset).execute();
+
+Partner obtains transaction history of recommended users
+
+Record query time range cannot exceed 30 days
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ String currencyPair = "BTC_USDT"; // String | Specify the trading pair. If not specified, returns all trading pairs
+ Long userId = 10003L; // Long | User ID. If not specified, all user records will be returned
+ Long from = 1602120000L; // Long | Start time for querying records, defaults to 7 days before current time if not specified
+ Long to = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ try {
+ PartnerTransactionHistory result = apiInstance.partnerTransactionHistory()
+ .currencyPair(currencyPair)
+ .userId(userId)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .offset(offset)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#partnerTransactionHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencyPair** | **String**| Specify the trading pair. If not specified, returns all trading pairs | [optional]
+ **userId** | **Long**| User ID. If not specified, all user records will be returned | [optional]
+ **from** | **Long**| Start time for querying records, defaults to 7 days before current time if not specified | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+
+### Return type
+
+[**PartnerTransactionHistory**](PartnerTransactionHistory.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **partnerCommissionsHistory**
+> PartnerCommissionHistory partnerCommissionsHistory().currency(currency).userId(userId).from(from).to(to).limit(limit).offset(offset).execute();
+
+Partner obtains rebate records of recommended users
+
+Record query time range cannot exceed 30 days
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ String currency = "BTC"; // String | Specify the currency. If not specified, returns all currencies
+ Long userId = 10003L; // Long | User ID. If not specified, all user records will be returned
+ Long from = 1602120000L; // Long | Start time for querying records, defaults to 7 days before current time if not specified
+ Long to = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ try {
+ PartnerCommissionHistory result = apiInstance.partnerCommissionsHistory()
+ .currency(currency)
+ .userId(userId)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .offset(offset)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#partnerCommissionsHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Specify the currency. If not specified, returns all currencies | [optional]
+ **userId** | **Long**| User ID. If not specified, all user records will be returned | [optional]
+ **from** | **Long**| Start time for querying records, defaults to 7 days before current time if not specified | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+
+### Return type
+
+[**PartnerCommissionHistory**](PartnerCommissionHistory.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **partnerSubList**
+> PartnerSubList partnerSubList().userId(userId).limit(limit).offset(offset).execute();
+
+Partner subordinate list
+
+Including sub-agents, direct customers, and indirect customers
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ Long userId = 10003L; // Long | User ID. If not specified, all user records will be returned
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ try {
+ PartnerSubList result = apiInstance.partnerSubList()
+ .userId(userId)
+ .limit(limit)
+ .offset(offset)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#partnerSubList");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Long**| User ID. If not specified, all user records will be returned | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+
+### Return type
+
+[**PartnerSubList**](PartnerSubList.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **rebateBrokerCommissionHistory**
+> List<BrokerCommission> rebateBrokerCommissionHistory().limit(limit).offset(offset).userId(userId).from(from).to(to).execute();
+
+Broker obtains user's rebate records
+
+Record query time range cannot exceed 30 days
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long userId = 10003L; // Long | User ID. If not specified, all user records will be returned
+ Long from = 1711929600L; // Long | Start time of the query record. If not specified, defaults to 30 days before the current time
+ Long to = 1714521600L; // Long | End timestamp for the query, defaults to current time if not specified
+ try {
+ List result = apiInstance.rebateBrokerCommissionHistory()
+ .limit(limit)
+ .offset(offset)
+ .userId(userId)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#rebateBrokerCommissionHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **userId** | **Long**| User ID. If not specified, all user records will be returned | [optional]
+ **from** | **Long**| Start time of the query record. If not specified, defaults to 30 days before the current time | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+
+### Return type
+
+[**List<BrokerCommission>**](BrokerCommission.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **rebateBrokerTransactionHistory**
+> List<BrokerTransaction> rebateBrokerTransactionHistory().limit(limit).offset(offset).userId(userId).from(from).to(to).execute();
+
+Broker obtains user's trading history
+
+Record query time range cannot exceed 30 days
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ Integer offset = 0; // Integer | List offset, starting from 0
+ Long userId = 10003L; // Long | User ID. If not specified, all user records will be returned
+ Long from = 1711929600L; // Long | Start time of the query record. If not specified, defaults to 30 days before the current time
+ Long to = 1714521600L; // Long | End timestamp for the query, defaults to current time if not specified
+ try {
+ List result = apiInstance.rebateBrokerTransactionHistory()
+ .limit(limit)
+ .offset(offset)
+ .userId(userId)
+ .from(from)
+ .to(to)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#rebateBrokerTransactionHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **userId** | **Long**| User ID. If not specified, all user records will be returned | [optional]
+ **from** | **Long**| Start time of the query record. If not specified, defaults to 30 days before the current time | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+
+### Return type
+
+[**List<BrokerTransaction>**](BrokerTransaction.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **rebateUserInfo**
+> List<RebateUserInfo> rebateUserInfo()
+
+User obtains rebate information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ try {
+ List result = apiInstance.rebateUserInfo();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#rebateUserInfo");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<RebateUserInfo>**](RebateUserInfo.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **userSubRelation**
+> UserSubRelation userSubRelation(userIdList)
+
+User subordinate relationship
+
+Query whether the specified user is within the system
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.RebateApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ RebateApi apiInstance = new RebateApi(defaultClient);
+ String userIdList = "1, 2, 3"; // String | Query user ID list, separated by commas. If more than 100, only 100 will be returned
+ try {
+ UserSubRelation result = apiInstance.userSubRelation(userIdList);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling RebateApi#userSubRelation");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userIdList** | **String**| Query user ID list, separated by commas. If more than 100, only 100 will be returned |
+
+### Return type
+
+[**UserSubRelation**](UserSubRelation.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
diff --git a/docs/RebateUserInfo.md b/docs/RebateUserInfo.md
new file mode 100644
index 0000000..b0e707d
--- /dev/null
+++ b/docs/RebateUserInfo.md
@@ -0,0 +1,11 @@
+
+# RebateUserInfo
+
+Retrieve user rebate information
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**inviteUid** | **Long** | My inviter's UID | [optional]
+
diff --git a/docs/RepayCurrencyRes.md b/docs/RepayCurrencyRes.md
new file mode 100644
index 0000000..ad7ad8b
--- /dev/null
+++ b/docs/RepayCurrencyRes.md
@@ -0,0 +1,14 @@
+
+# RepayCurrencyRes
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**succeeded** | **Boolean** | Whether the repayment was successful | [optional]
+**label** | **String** | Error identifier for failed operations; empty when successful | [optional]
+**message** | **String** | Error description for failed operations; empty when successful | [optional]
+**currency** | **String** | Repayment currency | [optional]
+**repaidPrincipal** | **String** | Principal | [optional]
+**repaidInterest** | **String** | Principal | [optional]
+
diff --git a/docs/RepayLoan.md b/docs/RepayLoan.md
new file mode 100644
index 0000000..8ecfaaf
--- /dev/null
+++ b/docs/RepayLoan.md
@@ -0,0 +1,13 @@
+
+# RepayLoan
+
+Repay
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID |
+**repayAmount** | **String** | Repayment amount, it is mandatory when making partial repayments |
+**repaidAll** | **Boolean** | Repayment method, set to `true` for full repayment, and `false` for partial repayment; When partial repayment, the repay_amount parameter cannot be greater than the remaining amount to be repaid by the user. |
+
diff --git a/docs/RepayMultiLoan.md b/docs/RepayMultiLoan.md
new file mode 100644
index 0000000..835ffdd
--- /dev/null
+++ b/docs/RepayMultiLoan.md
@@ -0,0 +1,12 @@
+
+# RepayMultiLoan
+
+Multi-currency collateral repayment
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID |
+**repayItems** | [**List<MultiLoanRepayItem>**](MultiLoanRepayItem.md) | Repay Currency Item |
+
diff --git a/docs/RepayRecord.md b/docs/RepayRecord.md
new file mode 100644
index 0000000..8082201
--- /dev/null
+++ b/docs/RepayRecord.md
@@ -0,0 +1,23 @@
+
+# RepayRecord
+
+Repayment record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderId** | **Long** | Order ID | [optional]
+**recordId** | **Long** | Repayment record ID | [optional]
+**repaidAmount** | **String** | Repayment amount | [optional]
+**borrowCurrency** | **String** | Borrowed currency | [optional]
+**collateralCurrency** | **String** | Collateral currency | [optional]
+**initLtv** | **String** | Initial collateralization rate | [optional]
+**borrowTime** | **Long** | Borrowing time, timestamp | [optional]
+**repayTime** | **Long** | Repayment time, timestamp | [optional]
+**totalInterest** | **String** | Total interest | [optional]
+**beforeLeftPrincipal** | **String** | Principal to be repaid before repayment | [optional]
+**afterLeftPrincipal** | **String** | Principal to be repaid after repayment | [optional]
+**beforeLeftCollateral** | **String** | Collateral amount before repayment | [optional]
+**afterLeftCollateral** | **String** | Collateral amount after repayment | [optional]
+
diff --git a/docs/RepayRecordCurrency.md b/docs/RepayRecordCurrency.md
new file mode 100644
index 0000000..b597b39
--- /dev/null
+++ b/docs/RepayRecordCurrency.md
@@ -0,0 +1,14 @@
+
+# RepayRecordCurrency
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**beforeAmount** | **String** | Amount before the operation | [optional]
+**beforeAmountUsdt** | **String** | USDT Amount before the operation | [optional]
+**afterAmount** | **String** | Amount after the operation | [optional]
+**afterAmountUsdt** | **String** | USDT Amount after the operation | [optional]
+
diff --git a/docs/RepayRecordLeftInterest.md b/docs/RepayRecordLeftInterest.md
new file mode 100644
index 0000000..1956af7
--- /dev/null
+++ b/docs/RepayRecordLeftInterest.md
@@ -0,0 +1,14 @@
+
+# RepayRecordLeftInterest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**beforeAmount** | **String** | Interest amount before repayment | [optional]
+**beforeAmountUsdt** | **String** | Converted value of interest before repayment in USDT | [optional]
+**afterAmount** | **String** | Interest amount after repayment | [optional]
+**afterAmountUsdt** | **String** | Converted value of interest after repayment in USDT | [optional]
+
diff --git a/docs/RepayRecordRepaidCurrency.md b/docs/RepayRecordRepaidCurrency.md
new file mode 100644
index 0000000..60256f0
--- /dev/null
+++ b/docs/RepayRecordRepaidCurrency.md
@@ -0,0 +1,14 @@
+
+# RepayRecordRepaidCurrency
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Repayment currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**repaidAmount** | **String** | Repayment amount | [optional]
+**repaidPrincipal** | **String** | Principal | [optional]
+**repaidInterest** | **String** | Interest | [optional]
+**repaidAmountUsdt** | **String** | Repayment amount converted to USDT | [optional]
+
diff --git a/docs/RepayRecordTotalInterest.md b/docs/RepayRecordTotalInterest.md
new file mode 100644
index 0000000..aa2b6a4
--- /dev/null
+++ b/docs/RepayRecordTotalInterest.md
@@ -0,0 +1,12 @@
+
+# RepayRecordTotalInterest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**indexPrice** | **String** | Currency Index Price | [optional]
+**amount** | **String** | Interest Amount | [optional]
+**amountUsdt** | **String** | Interest amount converted to USDT | [optional]
+
diff --git a/docs/RepayRequest.md b/docs/RepayRequest.md
deleted file mode 100644
index 3b8ab1d..0000000
--- a/docs/RepayRequest.md
+++ /dev/null
@@ -1,19 +0,0 @@
-
-# RepayRequest
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**currencyPair** | **String** | Currency pair |
-**currency** | **String** | Loan currency |
-**mode** | [**ModeEnum**](#ModeEnum) | Repay mode. all - repay all; partial - repay only some portion |
-**amount** | **String** | Repay amount. Required in `partial` mode | [optional]
-
-## Enum: ModeEnum
-
-Name | Value
----- | -----
-ALL | "all"
-PARTIAL | "partial"
-
diff --git a/docs/RepayResp.md b/docs/RepayResp.md
new file mode 100644
index 0000000..baaf387
--- /dev/null
+++ b/docs/RepayResp.md
@@ -0,0 +1,12 @@
+
+# RepayResp
+
+Repay
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**repaidPrincipal** | **String** | Principal | [optional]
+**repaidInterest** | **String** | Interest | [optional]
+
diff --git a/docs/Repayment.md b/docs/Repayment.md
deleted file mode 100644
index e6aedc1..0000000
--- a/docs/Repayment.md
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# Repayment
-
-## Properties
-
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **String** | Loan record ID | [optional]
-**createTime** | **String** | Repayment time | [optional]
-**principal** | **String** | Repaid principal | [optional]
-**interest** | **String** | Repaid interest | [optional]
-
diff --git a/docs/RiskUnits.md b/docs/RiskUnits.md
new file mode 100644
index 0000000..ffbb7d1
--- /dev/null
+++ b/docs/RiskUnits.md
@@ -0,0 +1,16 @@
+
+# RiskUnits
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**symbol** | **String** | Risk unit flag | [optional]
+**spotInUse** | **String** | Spot hedging occupied amount | [optional]
+**maintainMargin** | **String** | Maintenance margin for risk unit | [optional]
+**initialMargin** | **String** | Initial margin for risk unit | [optional]
+**delta** | **String** | Total Delta of risk unit | [optional]
+**gamma** | **String** | Total Gamma of risk unit | [optional]
+**theta** | **String** | Total Theta of risk unit | [optional]
+**vega** | **String** | Total Vega of risk unit | [optional]
+
diff --git a/docs/SavedAddress.md b/docs/SavedAddress.md
new file mode 100644
index 0000000..2fcd258
--- /dev/null
+++ b/docs/SavedAddress.md
@@ -0,0 +1,14 @@
+
+# SavedAddress
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**chain** | **String** | Chain name | [optional]
+**address** | **String** | Address | [optional]
+**name** | **String** | Name | [optional]
+**tag** | **String** | Tag | [optional]
+**verified** | **String** | Whether to pass the verification 0-unverified, 1-verified | [optional]
+
diff --git a/docs/SmallBalance.md b/docs/SmallBalance.md
new file mode 100644
index 0000000..574983d
--- /dev/null
+++ b/docs/SmallBalance.md
@@ -0,0 +1,14 @@
+
+# SmallBalance
+
+Small Balance Conversion
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**availableBalance** | **String** | Available balance | [optional]
+**estimatedAsBtc** | **String** | Estimated as BTC | [optional]
+**convertibleToGt** | **String** | Estimated conversion to GT | [optional]
+
diff --git a/docs/SmallBalanceHistory.md b/docs/SmallBalanceHistory.md
new file mode 100644
index 0000000..3471863
--- /dev/null
+++ b/docs/SmallBalanceHistory.md
@@ -0,0 +1,15 @@
+
+# SmallBalanceHistory
+
+Small Balance Conversion
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **String** | Order ID | [optional] [readonly]
+**currency** | **String** | Currency | [optional] [readonly]
+**amount** | **String** | Swap Amount | [optional] [readonly]
+**gtAmount** | **String** | GT amount | [optional] [readonly]
+**createTime** | **Long** | Exchange time (in seconds) | [optional] [readonly]
+
diff --git a/docs/SpotAccount.md b/docs/SpotAccount.md
index e184510..167c46d 100644
--- a/docs/SpotAccount.md
+++ b/docs/SpotAccount.md
@@ -8,4 +8,5 @@ Name | Type | Description | Notes
**currency** | **String** | Currency detail | [optional]
**available** | **String** | Available amount | [optional]
**locked** | **String** | Locked amount, used in trading | [optional]
+**updateId** | **Long** | Version number | [optional]
diff --git a/docs/SpotAccountBook.md b/docs/SpotAccountBook.md
new file mode 100644
index 0000000..9e7096f
--- /dev/null
+++ b/docs/SpotAccountBook.md
@@ -0,0 +1,16 @@
+
+# SpotAccountBook
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **String** | Balance change record ID | [optional]
+**time** | **Long** | The timestamp of the change (in milliseconds) | [optional]
+**currency** | **String** | Currency changed | [optional]
+**change** | **String** | Amount changed. Positive value means transferring in, while negative out | [optional]
+**balance** | **String** | Balance after change | [optional]
+**type** | **String** | Account book type. Please refer to [account book type](#accountbook-type) for more detail | [optional]
+**code** | **String** | Account change code, see [Asset Record Code] (Asset Record Code) | [optional]
+**text** | **String** | Additional information | [optional]
+
diff --git a/docs/SpotApi.md b/docs/SpotApi.md
index 9998589..a77f802 100644
--- a/docs/SpotApi.md
+++ b/docs/SpotApi.md
@@ -4,37 +4,47 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
Method | HTTP request | Description
------------- | ------------- | -------------
-[**listCurrencies**](SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies' details
-[**getCurrency**](SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency
-[**listCurrencyPairs**](SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported
-[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order
-[**listTickers**](SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information
-[**listOrderBook**](SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book
-[**listTrades**](SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades
-[**listCandlesticks**](SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks
-[**getFee**](SpotApi.md#getFee) | **GET** /spot/fee | Query user trading fee rates
-[**listSpotAccounts**](SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts
-[**createBatchOrders**](SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Create a batch of orders
+[**listCurrencies**](SpotApi.md#listCurrencies) | **GET** /spot/currencies | Query all currency information
+[**getCurrency**](SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Query single currency information
+[**listCurrencyPairs**](SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | Query all supported currency pairs
+[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Query single currency pair details
+[**listTickers**](SpotApi.md#listTickers) | **GET** /spot/tickers | Get currency pair ticker information
+[**listOrderBook**](SpotApi.md#listOrderBook) | **GET** /spot/order_book | Get market depth information
+[**listTrades**](SpotApi.md#listTrades) | **GET** /spot/trades | Query market transaction records
+[**listCandlesticks**](SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market K-line chart
+[**getFee**](SpotApi.md#getFee) | **GET** /spot/fee | Query account fee rates
+[**getBatchSpotFee**](SpotApi.md#getBatchSpotFee) | **GET** /spot/batch_fee | Batch query account fee rates
+[**listSpotAccounts**](SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot trading accounts
+[**listSpotAccountBook**](SpotApi.md#listSpotAccountBook) | **GET** /spot/account_book | Query spot account transaction history
+[**createBatchOrders**](SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Batch place orders
[**listAllOpenOrders**](SpotApi.md#listAllOpenOrders) | **GET** /spot/open_orders | List all open orders
+[**createCrossLiquidateOrder**](SpotApi.md#createCrossLiquidateOrder) | **POST** /spot/cross_liquidate_orders | Close position when cross-currency is disabled
[**listOrders**](SpotApi.md#listOrders) | **GET** /spot/orders | List orders
[**createOrder**](SpotApi.md#createOrder) | **POST** /spot/orders | Create an order
[**cancelOrders**](SpotApi.md#cancelOrders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair
-[**cancelBatchOrders**](SpotApi.md#cancelBatchOrders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list
-[**getOrder**](SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Get a single order
-[**cancelOrder**](SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order
-[**listMyTrades**](SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history
-[**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
-[**cancelSpotPriceTriggeredOrder**](SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order
+[**cancelBatchOrders**](SpotApi.md#cancelBatchOrders) | **POST** /spot/cancel_batch_orders | Cancel batch orders by specified ID list
+[**getOrder**](SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Query single order details
+[**cancelOrder**](SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel single order
+[**amendOrder**](SpotApi.md#amendOrder) | **PATCH** /spot/orders/{order_id} | Amend single order
+[**listMyTrades**](SpotApi.md#listMyTrades) | **GET** /spot/my_trades | Query personal trading records
+[**getSystemTime**](SpotApi.md#getSystemTime) | **GET** /spot/time | Get server current time
+[**countdownCancelAllSpot**](SpotApi.md#countdownCancelAllSpot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders
+[**amendBatchOrders**](SpotApi.md#amendBatchOrders) | **POST** /spot/amend_batch_orders | Batch modification of orders
+[**getSpotInsuranceHistory**](SpotApi.md#getSpotInsuranceHistory) | **GET** /spot/insurance_history | Query spot insurance fund historical data
+[**listSpotPriceTriggeredOrders**](SpotApi.md#listSpotPriceTriggeredOrders) | **GET** /spot/price_orders | Query running auto order list
+[**createSpotPriceTriggeredOrder**](SpotApi.md#createSpotPriceTriggeredOrder) | **POST** /spot/price_orders | Create price-triggered order
+[**cancelSpotPriceTriggeredOrderList**](SpotApi.md#cancelSpotPriceTriggeredOrderList) | **DELETE** /spot/price_orders | Cancel all auto orders
+[**getSpotPriceTriggeredOrder**](SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Query single auto order details
+[**cancelSpotPriceTriggeredOrder**](SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | Cancel single auto order
# **listCurrencies**
> List<Currency> listCurrencies()
-List all currencies' details
+Query all currency information
+
+When a currency corresponds to multiple chains, you can query the information of multiple chains through the `chains` field, such as the charging and recharge status, identification, etc. of the chain
### Example
@@ -88,13 +98,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **getCurrency**
> Currency getCurrency(currency)
-Get details of a specific currency
+Query single currency information
### Example
@@ -152,13 +162,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listCurrencyPairs**
> List<CurrencyPair> listCurrencyPairs()
-List all currency pairs supported
+Query all supported currency pairs
### Example
@@ -218,7 +228,7 @@ No authorization required
# **getCurrencyPair**
> CurrencyPair getCurrencyPair(currencyPair)
-Get details of a specifc order
+Query single currency pair details
### Example
@@ -276,15 +286,15 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listTickers**
-> List<Ticker> listTickers().currencyPair(currencyPair).execute();
+> List<Ticker> listTickers().currencyPair(currencyPair).timezone(timezone).execute();
-Retrieve ticker information
+Get currency pair ticker information
-Return only related data if `currency_pair` is specified; otherwise return all of them
+If `currency_pair` is specified, only query that currency pair; otherwise return all information
### Example
@@ -304,9 +314,11 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
String currencyPair = "BTC_USDT"; // String | Currency pair
+ String timezone = "utc0"; // String | Timezone
try {
List result = apiInstance.listTickers()
.currencyPair(currencyPair)
+ .timezone(timezone)
.execute();
System.out.println(result);
} catch (GateApiException e) {
@@ -327,6 +339,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**currencyPair** | **String**| Currency pair | [optional]
+ **timezone** | **String**| Timezone | [optional] [enum: utc0, utc8, all]
### Return type
@@ -344,15 +357,15 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listOrderBook**
> OrderBook listOrderBook(currencyPair).interval(interval).limit(limit).withId(withId).execute();
-Retrieve order book
+Get market depth information
-Order book will be sorted by price from high to low on bids; low to high on asks
+Market depth buy orders are sorted by price from high to low, sell orders are sorted from low to high
### Example
@@ -372,9 +385,9 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
String currencyPair = "BTC_USDT"; // String | Currency pair
- String interval = "\"0\""; // String | Order depth. 0 means no aggregation is applied. default to 0
- Integer limit = 10; // Integer | Maximum number of order depth data in asks or bids
- Boolean withId = false; // Boolean | Return order book ID
+ String interval = "\"0\""; // String | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified
+ Integer limit = 10; // Integer | Number of depth levels
+ Boolean withId = false; // Boolean | Return order book update ID
try {
OrderBook result = apiInstance.listOrderBook(currencyPair)
.interval(interval)
@@ -400,9 +413,9 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**currencyPair** | **String**| Currency pair |
- **interval** | **String**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to "0"]
- **limit** | **Integer**| Maximum number of order depth data in asks or bids | [optional] [default to 10]
- **withId** | **Boolean**| Return order book ID | [optional] [default to false]
+ **interval** | **String**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to "0"]
+ **limit** | **Integer**| Number of depth levels | [optional] [default to 10]
+ **withId** | **Boolean**| Return order book update ID | [optional] [default to false]
### Return type
@@ -420,13 +433,15 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **listTrades**
-> List<Trade> listTrades(currencyPair).limit(limit).lastId(lastId).reverse(reverse).execute();
+> List<Trade> listTrades(currencyPair).limit(limit).lastId(lastId).reverse(reverse).from(from).to(to).page(page).execute();
+
+Query market transaction records
-Retrieve market trades
+Supports querying by time range using `from` and `to` parameters or pagination based on `last_id`. By default, queries the last 30 days. Pagination based on `last_id` is no longer recommended. If `last_id` is specified, the time range query parameters will be ignored. When using limit&page pagination to retrieve data, the maximum number of pages is 100,000, that is, limit * (page - 1) <= 100,000.
### Example
@@ -446,14 +461,20 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
String currencyPair = "BTC_USDT"; // String | Currency pair
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
- String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
- Boolean reverse = false; // Boolean | Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault 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.
+ Integer limit = 100; // Integer | Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000
+ String lastId = "12345"; // String | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used
+ Boolean reverse = false; // Boolean | Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`. Set to `true` to trace back market trade records, `false` to get latest trades. No effect when `last_id` is not set.
+ Long from = 1627706330L; // Long | Start timestamp for the query
+ Long to = 1635329650L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer page = 1; // Integer | Page number
try {
List result = apiInstance.listTrades(currencyPair)
.limit(limit)
.lastId(lastId)
.reverse(reverse)
+ .from(from)
+ .to(to)
+ .page(page)
.execute();
System.out.println(result);
} catch (GateApiException e) {
@@ -474,9 +495,12 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**currencyPair** | **String**| Currency pair |
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
- **lastId** | **String**| Specify list staring point using the `id` of last record in previous list-query results | [optional]
- **reverse** | **Boolean**| Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault 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 false]
+ **limit** | **Integer**| Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 | [optional] [default to 100]
+ **lastId** | **String**| Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional]
+ **reverse** | **Boolean**| Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`. Set to `true` to trace back market trade records, `false` to get latest trades. No effect when `last_id` is not set. | [optional] [default to false]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
### Return type
@@ -494,13 +518,13 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listCandlesticks**
> List<List<String>> listCandlesticks(currencyPair).limit(limit).from(from).to(to).interval(interval).execute();
-Market candlesticks
+Market K-line chart
Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval
@@ -522,10 +546,10 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
String currencyPair = "BTC_USDT"; // String | Currency pair
- Integer limit = 100; // Integer | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
+ Integer limit = 100; // Integer | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
Long from = 1546905600L; // Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
- Long to = 1546935600L; // Long | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
- String interval = "30m"; // String | Interval time between data points
+ Long to = 1546935600L; // Long | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision
+ String interval = "30m"; // String | Time interval between data points. Note that `30d` represents a calendar month, not aligned to 30 days
try {
List> result = apiInstance.listCandlesticks(currencyPair)
.limit(limit)
@@ -552,10 +576,10 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**currencyPair** | **String**| Currency pair |
- **limit** | **Integer**| 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]
+ **limit** | **Integer**| Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100]
**from** | **Long**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional]
- **to** | **Long**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional]
- **interval** | **String**| Interval time between data points | [optional] [default to 30m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d]
+ **to** | **Long**| Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision | [optional]
+ **interval** | **String**| Time interval between data points. Note that `30d` represents a calendar month, not aligned to 30 days | [optional] [default to 30m] [enum: 1s, 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d, 30d]
### Return type
@@ -573,15 +597,15 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
# **getFee**
-> TradeFee getFee().currencyPair(currencyPair).execute();
+> SpotFee getFee().currencyPair(currencyPair).execute();
-Query user trading fee rates
+Query account fee rates
-This API is deprecated in favour of new fee retrieving API `/wallet/fee`.
+This API is deprecated. The new fee query API is `/wallet/fee`
### Example
@@ -604,9 +628,9 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String 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
+ String currencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.
try {
- TradeFee result = apiInstance.getFee()
+ SpotFee result = apiInstance.getFee()
.currencyPair(currencyPair)
.execute();
System.out.println(result);
@@ -627,11 +651,11 @@ public class Example {
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]
+ **currencyPair** | **String**| Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. | [optional]
### Return type
-[**TradeFee**](TradeFee.md)
+[**SpotFee**](SpotFee.md)
### Authorization
@@ -645,13 +669,81 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | Query successful | - |
+
+
+# **getBatchSpotFee**
+> Map<String, SpotFee> getBatchSpotFee(currencyPairs)
+
+Batch query account fee rates
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ String currencyPairs = "BTC_USDT,ETH_USDT"; // String | Maximum 50 currency pairs per request
+ try {
+ Map result = apiInstance.getBatchSpotFee(currencyPairs);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#getBatchSpotFee");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencyPairs** | **String**| Maximum 50 currency pairs per request |
+
+### Return type
+
+[**Map<String, SpotFee>**](SpotFee.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
# **listSpotAccounts**
> List<SpotAccount> listSpotAccounts().currency(currency).execute();
-List spot accounts
+List spot trading accounts
### Example
@@ -674,7 +766,7 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
+ String currency = "BTC"; // String | Query by specified currency name
try {
List result = apiInstance.listSpotAccounts()
.currency(currency)
@@ -697,7 +789,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency | [optional]
+ **currency** | **String**| Query by specified currency name | [optional]
### Return type
@@ -715,15 +807,105 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
+
+
+# **listSpotAccountBook**
+> List<SpotAccountBook> listSpotAccountBook().currency(currency).from(from).to(to).page(page).limit(limit).type(type).code(code).execute();
+
+Query spot account transaction history
+
+Record query time range cannot exceed 30 days. When using limit&page pagination to retrieve data, the maximum number of pages is 100,000, that is, limit * (page - 1) <= 100,000.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ Long from = 1627706330L; // Long | Start timestamp for the query
+ Long to = 1635329650L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
+ String type = "lend"; // String | Query by specified account change type. If not specified, all change types will be included.
+ String code = "code_example"; // String | Specify account change code for query. If not specified, all change types are included. This parameter has higher priority than `type`
+ try {
+ List result = apiInstance.listSpotAccountBook()
+ .currency(currency)
+ .from(from)
+ .to(to)
+ .page(page)
+ .limit(limit)
+ .type(type)
+ .code(code)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#listSpotAccountBook");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
+ **type** | **String**| Query by specified account change type. If not specified, all change types will be included. | [optional]
+ **code** | **String**| Specify account change code for query. If not specified, all change types are included. This parameter has higher priority than `type` | [optional]
+
+### Return type
+
+[**List<SpotAccountBook>**](SpotAccountBook.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
# **createBatchOrders**
-> List<BatchOrder> createBatchOrders(order)
+> List<BatchOrder> createBatchOrders(order, xGateExptime)
-Create a batch of orders
+Batch place orders
-Batch orders requirements: 1. custom order field `text` is required 2. At most 4 currency pairs, maximum 10 orders each, are allowed in one request 3. No mixture of spot orders and margin orders, i.e. `account` must be identical for all orders
+Batch order requirements: 1. Custom order field `text` must be specified 2. Up to 4 currency pairs per request, with up to 10 orders per currency pair 3. Spot orders and margin orders cannot be mixed; all `account` fields in the same request must be identical
### Example
@@ -747,8 +929,9 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
List order = Arrays.asList(); // List |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- List result = apiInstance.createBatchOrders(order);
+ List result = apiInstance.createBatchOrders(order, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
@@ -768,6 +951,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order** | [**List<Order>**](Order.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
@@ -785,7 +969,7 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Request is completed | - |
+**200** | Request execution completed | - |
# **listAllOpenOrders**
@@ -793,7 +977,7 @@ Name | Type | Description | Notes
List all open orders
-List open orders in all currency pairs. Note that pagination parameters affect record number in each currency pair's open order list. No pagination is applied to the number of currency pairs returned. All currency pairs with open orders will be returned. Spot and margin orders are returned by default. To list cross margin orders, `account` must be set to `cross_margin`
+Query the current order list of all trading pairs. Please note that the paging parameter controls the number of pending orders in each trading pair. There is no paging control trading pairs. All trading pairs with pending orders will be returned.
### Example
@@ -818,7 +1002,7 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records returned in one page in each currency pair
- String 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
+ String account = "spot"; // String | Specify query account
try {
List result = apiInstance.listAllOpenOrders()
.page(page)
@@ -845,7 +1029,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**page** | **Integer**| Page number | [optional] [default to 1]
**limit** | **Integer**| Maximum number of records returned in one page in each currency pair | [optional] [default to 100]
- **account** | **String**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional]
+ **account** | **String**| Specify query account | [optional]
### Return type
@@ -863,7 +1047,77 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
+
+
+# **createCrossLiquidateOrder**
+> Order createCrossLiquidateOrder(liquidateOrder)
+
+Close position when cross-currency is disabled
+
+Currently, only cross-margin accounts are supported to place buy orders for disabled currencies. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in pending orders) / 0.998
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ LiquidateOrder liquidateOrder = new LiquidateOrder(); // LiquidateOrder |
+ try {
+ Order result = apiInstance.createCrossLiquidateOrder(liquidateOrder);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#createCrossLiquidateOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **liquidateOrder** | [**LiquidateOrder**](LiquidateOrder.md)| |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**201** | Order created successfully | - |
# **listOrders**
@@ -871,7 +1125,7 @@ Name | Type | Description | Notes
List orders
-Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` When `status` is `open`, i.e., listing open orders, only pagination parameters `page` and `limit` are supported and `limit` cannot be larger than 100. Query by `side` and time range parameters `from` and `to` are not supported. When `status` is `finished`, i.e., listing finished orders, pagination parameters, time range parameters `from` and `to`, and `side` parameters are all supported. Time range parameters are handled as order finish time.
+Note that query results default to spot order lists for spot, unified account, and isolated margin accounts. When `status` is set to `open` (i.e., when querying pending order lists), only `page` and `limit` pagination controls are supported. `limit` can only be set to a maximum of 100. The `side` parameter and time range query parameters `from` and `to` are not supported. When `status` is set to `finished` (i.e., when querying historical orders), in addition to pagination queries, `from` and `to` time range queries are also supported. Additionally, the `side` parameter can be set to filter one-sided history. Time range filter parameters are processed according to the order end time.
### Example
@@ -894,14 +1148,14 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String currencyPair = "BTC_USDT"; // String | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones.
+ String currencyPair = "BTC_USDT"; // String | Query by specified currency pair. Required for open orders, optional for filled orders
String status = "open"; // String | List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100
- String 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
- Long from = 56L; // Long | Time range beginning, default to 7 days before current time
- Long to = 56L; // Long | Time range ending, default to current time
- String side = "sell"; // String | All bids or asks. Both included if not specified
+ String account = "spot"; // String | Specify query account
+ Long from = 1627706330L; // Long | Start timestamp for the query
+ Long to = 1635329650L; // Long | End timestamp for the query, defaults to current time if not specified
+ String side = "sell"; // String | Specify all bids or all asks, both included if not specified
try {
List result = apiInstance.listOrders(currencyPair, status)
.page(page)
@@ -929,14 +1183,14 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currencyPair** | **String**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. |
- **status** | **String**| List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled | [enum: open, finished]
+ **currencyPair** | **String**| Query by specified currency pair. Required for open orders, optional for filled orders |
+ **status** | **String**| List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled |
**page** | **Integer**| Page number | [optional] [default to 1]
**limit** | **Integer**| Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100]
- **account** | **String**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional]
- **from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
- **to** | **Long**| Time range ending, default to current time | [optional]
- **side** | **String**| All bids or asks. Both included if not specified | [optional] [enum: buy, sell]
+ **account** | **String**| Specify query account | [optional]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **side** | **String**| Specify all bids or all asks, both included if not specified | [optional]
### Return type
@@ -954,15 +1208,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **createOrder**
-> Order createOrder(order)
+> Order createOrder(order, xGateExptime)
Create an order
-You can place orders with spot, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate.
+Supports spot, margin, leverage, and cross-margin leverage orders. Use different accounts through the `account` field. Default is `spot`, which means using the spot account to place orders. If the user has a `unified` account, the default is to place orders with the unified account. When using leveraged account trading (i.e., when `account` is set to `margin`), you can set `auto_borrow` to `true`. In case of insufficient account balance, the system will automatically execute `POST /margin/uni/loans` to borrow the insufficient amount. Whether assets obtained after leveraged order execution are automatically used to repay borrowing orders of the isolated margin account depends on the automatic repayment settings of the user's isolated margin account. Account automatic repayment settings can be queried and set through `/margin/auto_repay`. When using unified account trading (i.e., when `account` is set to `unified`), `auto_borrow` can also be enabled to realize automatic borrowing of insufficient amounts. However, unlike the isolated margin account, whether unified account orders are automatically repaid depends on the `auto_repay` setting when placing the order. This setting only applies to the current order, meaning only assets obtained after order execution will be used to repay borrowing orders of the cross-margin account. Unified account ordering currently supports enabling both `auto_borrow` and `auto_repay` simultaneously. Auto repayment will be triggered when the order ends, i.e., when `status` is `cancelled` or `closed`. **Order Status** The order status in pending orders is `open`, which remains `open` until all quantity is filled. If fully filled, the order ends and status becomes `closed`. If the order is cancelled before all transactions are completed, regardless of partial fills, the status will become `cancelled`. **Iceberg Orders** `iceberg` is used to set the displayed quantity of iceberg orders and does not support complete hiding. Note that hidden portions are charged according to the taker's fee rate. **Self-Trade Prevention** Set `stp_act` to determine the self-trade prevention strategy to use
### Example
@@ -986,8 +1240,9 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
Order order = new Order(); // Order |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- Order result = apiInstance.createOrder(order);
+ Order result = apiInstance.createOrder(order, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
@@ -1007,6 +1262,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order** | [**Order**](Order.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
@@ -1024,15 +1280,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**201** | Order created. | - |
+**201** | Order created | - |
# **cancelOrders**
-> List<Order> cancelOrders(currencyPair, side, account)
+> List<OrderCancel> cancelOrders(currencyPair, side, account, actionMode, xGateExptime)
Cancel all `open` orders in specified currency pair
-If `account` is not set, all open orders, including spot, margin and cross margin ones, will be cancelled. You can set `account` to cancel only orders within the specified account
+When the `account` parameter is not specified, all pending orders including spot, unified account, and isolated margin will be cancelled. When `currency_pair` is not specified, all trading pair pending orders will be cancelled. You can specify a particular account to cancel all pending orders under that account
### Example
@@ -1056,10 +1312,12 @@ public class Example {
SpotApi apiInstance = new SpotApi(defaultClient);
String currencyPair = "BTC_USDT"; // String | Currency pair
- String side = "sell"; // String | All bids or asks. Both included if not specified
- String account = "spot"; // String | Specify account type. Default to all account types being included
+ String side = "sell"; // String | Specify all bids or all asks, both included if not specified
+ String account = "spot"; // String | Specify account type Classic account: All are included if not specified Unified account: Specify `unified`
+ String actionMode = "ACK"; // String | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default)
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- List result = apiInstance.cancelOrders(currencyPair, side, account);
+ List result = apiInstance.cancelOrders(currencyPair, side, account, actionMode, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
@@ -1078,13 +1336,15 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currencyPair** | **String**| Currency pair |
- **side** | **String**| All bids or asks. Both included if not specified | [optional] [enum: buy, sell]
- **account** | **String**| Specify account type. Default to all account types being included | [optional] [enum: spot, margin, cross_margin]
+ **currencyPair** | **String**| Currency pair | [optional]
+ **side** | **String**| Specify all bids or all asks, both included if not specified | [optional]
+ **account** | **String**| Specify account type Classic account: All are included if not specified Unified account: Specify `unified` | [optional]
+ **actionMode** | **String**| Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional]
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
-[**List<Order>**](Order.md)
+[**List<OrderCancel>**](OrderCancel.md)
### Authorization
@@ -1098,13 +1358,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Batch cancellation request accepted. Query order status by listing orders | - |
+**200** | Batch cancellation request accepted and processed, success determined by order list | - |
# **cancelBatchOrders**
-> List<CancelOrderResult> cancelBatchOrders(cancelOrder)
+> List<CancelOrderResult> cancelBatchOrders(cancelBatchOrder, xGateExptime)
-Cancel a batch of orders with an ID list
+Cancel batch orders by specified ID list
Multiple currency pairs can be specified, but maximum 20 orders are allowed per request
@@ -1129,9 +1389,10 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- List cancelOrder = Arrays.asList(); // List |
+ List cancelBatchOrder = Arrays.asList(); // List |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- List result = apiInstance.cancelBatchOrders(cancelOrder);
+ List result = apiInstance.cancelBatchOrders(cancelBatchOrder, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
@@ -1150,7 +1411,8 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **cancelOrder** | [**List<CancelOrder>**](CancelOrder.md)| |
+ **cancelBatchOrder** | [**List<CancelBatchOrder>**](CancelBatchOrder.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
@@ -1174,9 +1436,9 @@ Name | Type | Description | Notes
# **getOrder**
> Order getOrder(orderId, currencyPair, account)
-Get a single order
+Query single order details
-Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin`
+By default, queries orders for spot, unified account, and isolated margin accounts.
### Example
@@ -1199,9 +1461,9 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String 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.
- String currencyPair = "BTC_USDT"; // String | Currency pair
- String 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
+ String orderId = "12345"; // String | The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel)
+ String currencyPair = "BTC_USDT"; // String | Specify the trading pair to query. This field is required when querying pending order records. This field can be omitted when querying filled order records.
+ String account = "spot"; // String | Specify query account
try {
Order result = apiInstance.getOrder(orderId, currencyPair, account);
System.out.println(result);
@@ -1222,9 +1484,9 @@ public class Example {
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. |
- **currencyPair** | **String**| Currency pair |
- **account** | **String**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional]
+ **orderId** | **String**| The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) |
+ **currencyPair** | **String**| Specify the trading pair to query. This field is required when querying pending order records. This field can be omitted when querying filled order records. |
+ **account** | **String**| Specify query account | [optional]
### Return type
@@ -1246,11 +1508,11 @@ Name | Type | Description | Notes
# **cancelOrder**
-> Order cancelOrder(orderId, currencyPair, account)
+> Order cancelOrder(orderId, currencyPair, account, actionMode, xGateExptime)
-Cancel a single order
+Cancel single order
-Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin`
+By default, orders for spot, unified accounts and leveraged accounts are revoked.
### Example
@@ -1273,11 +1535,13 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String 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.
+ String orderId = "12345"; // String | The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel)
String currencyPair = "BTC_USDT"; // String | Currency pair
- String 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
+ String account = "spot"; // String | Specify query account
+ String actionMode = "ACK"; // String | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default)
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
try {
- Order result = apiInstance.cancelOrder(orderId, currencyPair, account);
+ Order result = apiInstance.cancelOrder(orderId, currencyPair, account, actionMode, xGateExptime);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
@@ -1296,9 +1560,11 @@ public class Example {
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. |
+ **orderId** | **String**| The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) |
**currencyPair** | **String**| Currency pair |
- **account** | **String**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional]
+ **account** | **String**| Specify query account | [optional]
+ **actionMode** | **String**| Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional]
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
### Return type
@@ -1318,13 +1584,91 @@ Name | Type | Description | Notes
|-------------|-------------|------------------|
**200** | Order cancelled | - |
+
+# **amendOrder**
+> Order amendOrder(orderId, orderPatch, currencyPair, account, xGateExptime)
+
+Amend single order
+
+Modify orders in spot, unified account and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation operation.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ String orderId = "12345"; // String | The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel)
+ OrderPatch orderPatch = new OrderPatch(); // OrderPatch |
+ String currencyPair = "BTC_USDT"; // String | Currency pair
+ String account = "spot"; // String | Specify query account
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
+ try {
+ Order result = apiInstance.amendOrder(orderId, orderPatch, currencyPair, account, xGateExptime);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#amendOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **String**| The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) |
+ **orderPatch** | [**OrderPatch**](OrderPatch.md)| |
+ **currencyPair** | **String**| Currency pair | [optional]
+ **account** | **String**| Specify query account | [optional]
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Updated successfully | - |
+
# **listMyTrades**
-> List<Trade> listMyTrades(currencyPair).limit(limit).page(page).orderId(orderId).account(account).from(from).to(to).execute();
+> List<Trade> listMyTrades().currencyPair(currencyPair).limit(limit).page(page).orderId(orderId).account(account).from(from).to(to).execute();
-List personal trading history
+Query personal trading records
-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.
+By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts. The history within a specified time range can be queried by specifying `from` or (and) `to`. - If no time parameters are specified, only data for the last 7 days can be obtained. - If only any parameter of `from` or `to` is specified, only 7-day data from the start (or end) of the specified time is returned. - The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time. The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0.
### Example
@@ -1347,15 +1691,16 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String currencyPair = "BTC_USDT"; // String | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones.
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String currencyPair = "BTC_USDT"; // String | Retrieve results with specified currency pair
+ Integer limit = 100; // Integer | Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000
Integer page = 1; // Integer | Page number
String orderId = "12345"; // String | Filter trades with specified order ID. `currency_pair` is also required if this field is present
- String 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
- Long from = 56L; // Long | Time range beginning, default to 7 days before current time
- Long to = 56L; // Long | Time range ending, default to current time
+ String account = "spot"; // String | Specify query account
+ Long from = 1627706330L; // Long | Start timestamp for the query
+ Long to = 1635329650L; // Long | End timestamp for the query, defaults to current time if not specified
try {
- List result = apiInstance.listMyTrades(currencyPair)
+ List result = apiInstance.listMyTrades()
+ .currencyPair(currencyPair)
.limit(limit)
.page(page)
.orderId(orderId)
@@ -1381,13 +1726,13 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currencyPair** | **String**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. |
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **currencyPair** | **String**| Retrieve results with specified currency pair | [optional]
+ **limit** | **Integer**| Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 | [optional] [default to 100]
**page** | **Integer**| 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]
- **account** | **String**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional]
- **from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
- **to** | **Long**| Time range ending, default to current time | [optional]
+ **account** | **String**| Specify query account | [optional]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
### Return type
@@ -1405,13 +1750,292 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
+
+
+# **getSystemTime**
+> SystemTime getSystemTime()
+
+Get server current time
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ try {
+ SystemTime result = apiInstance.getSystemTime();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#getSystemTime");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**SystemTime**](SystemTime.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **countdownCancelAllSpot**
+> TriggerTime countdownCancelAllSpot(countdownCancelAllSpotTask)
+
+Countdown cancel orders
+
+Spot order heartbeat detection. If there is no \"cancel existing countdown\" or \"set new countdown\" when the user-set `timeout` time is reached, the related `spot pending orders` will be automatically cancelled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at 30s intervals, setting the countdown `timeout` to `30 (seconds)` each time. If this interface is not called again within 30 seconds, all pending orders on the `market` you specified will be automatically cancelled. If no `market` is specified, all market cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will be terminated and the automatic order cancellation function will be cancelled.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ CountdownCancelAllSpotTask countdownCancelAllSpotTask = new CountdownCancelAllSpotTask(); // CountdownCancelAllSpotTask |
+ try {
+ TriggerTime result = apiInstance.countdownCancelAllSpot(countdownCancelAllSpotTask);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#countdownCancelAllSpot");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **countdownCancelAllSpotTask** | [**CountdownCancelAllSpotTask**](CountdownCancelAllSpotTask.md)| |
+
+### Return type
+
+[**TriggerTime**](TriggerTime.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Countdown set successfully | - |
+
+
+# **amendBatchOrders**
+> List<BatchOrder> amendBatchOrders(batchAmendItem, xGateExptime)
+
+Batch modification of orders
+
+Modify orders in spot, unified account and isolated margin account by default. Modify uncompleted orders, up to 5 orders can be modified at a time. Request parameters should be passed in array format. If there are order modification failures during the batch modification process, the modification of the next order will continue to be executed, and the execution will return with the corresponding order failure information. The call order of batch modification orders is consistent with the order list order. The return content order of batch modification orders is consistent with the order list order.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ List batchAmendItem = Arrays.asList(); // List |
+ String xGateExptime = "1689560679123"; // String | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected
+ try {
+ List result = apiInstance.amendBatchOrders(batchAmendItem, xGateExptime);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#amendBatchOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **batchAmendItem** | [**List<BatchAmendItem>**](BatchAmendItem.md)| |
+ **xGateExptime** | **String**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional]
+
+### Return type
+
+[**List<BatchOrder>**](BatchOrder.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Order modification executed successfully | - |
+
+
+# **getSpotInsuranceHistory**
+> List<SpotInsuranceHistory> getSpotInsuranceHistory(business, currency, from, to).page(page).limit(limit).execute();
+
+Query spot insurance fund historical data
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SpotApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ SpotApi apiInstance = new SpotApi(defaultClient);
+ String business = "margin"; // String | Leverage business, margin - position by position; unified - unified account
+ String currency = "BTC"; // String | Currency
+ Long from = 1547706332L; // Long | Start timestamp in seconds
+ Long to = 1547706332L; // Long | End timestamp in seconds
+ Integer page = 1; // Integer | Page number
+ Integer limit = 30; // Integer | The maximum number of items returned in the list, the default value is 30
+ try {
+ List result = apiInstance.getSpotInsuranceHistory(business, currency, from, to)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SpotApi#getSpotInsuranceHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **business** | **String**| Leverage business, margin - position by position; unified - unified account |
+ **currency** | **String**| Currency |
+ **from** | **Long**| Start timestamp in seconds |
+ **to** | **Long**| End timestamp in seconds |
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| The maximum number of items returned in the list, the default value is 30 | [optional] [default to 30]
+
+### Return type
+
+[**List<SpotInsuranceHistory>**](SpotInsuranceHistory.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
# **listSpotPriceTriggeredOrders**
> List<SpotPriceTriggeredOrder> listSpotPriceTriggeredOrders(status).market(market).account(account).limit(limit).offset(offset).execute();
-Retrieve running auto order list
+Query running auto order list
### Example
@@ -1434,10 +2058,10 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String status = "status_example"; // String | Only list the orders with this status
- String market = "BTC_USDT"; // String | Currency pair
- String account = "account_example"; // String | Trading account
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String status = "status_example"; // String | Query order list based on status
+ String market = "BTC_USDT"; // String | Trading market
+ String account = "account_example"; // String | Trading account type. Unified account must be set to `unified`
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
try {
List result = apiInstance.listSpotPriceTriggeredOrders(status)
@@ -1464,10 +2088,10 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **status** | **String**| Only list the orders with this status | [enum: open, finished]
- **market** | **String**| Currency pair | [optional]
- **account** | **String**| Trading account | [optional] [enum: normal, margin]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **status** | **String**| Query order list based on status | [enum: open, finished]
+ **market** | **String**| Trading market | [optional]
+ **account** | **String**| Trading account type. Unified account must be set to `unified` | [optional] [enum: normal, margin, unified]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
@@ -1486,13 +2110,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **createSpotPriceTriggeredOrder**
> TriggerOrderResponse createSpotPriceTriggeredOrder(spotPriceTriggeredOrder)
-Create a price-triggered order
+Create price-triggered order
### Example
@@ -1554,13 +2178,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**201** | Order created | - |
+**201** | Order created successfully | - |
# **cancelSpotPriceTriggeredOrderList**
> List<SpotPriceTriggeredOrder> cancelSpotPriceTriggeredOrderList(market, account)
-Cancel all open orders
+Cancel all auto orders
### Example
@@ -1583,8 +2207,8 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String market = "BTC_USDT"; // String | Currency pair
- String account = "account_example"; // String | Trading account
+ String market = "BTC_USDT"; // String | Trading market
+ String account = "account_example"; // String | Trading account type. Unified account must be set to `unified`
try {
List result = apiInstance.cancelSpotPriceTriggeredOrderList(market, account);
System.out.println(result);
@@ -1605,8 +2229,8 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **market** | **String**| Currency pair | [optional]
- **account** | **String**| Trading account | [optional] [enum: normal, margin]
+ **market** | **String**| Trading market | [optional]
+ **account** | **String**| Trading account type. Unified account must be set to `unified` | [optional] [enum: normal, margin, unified]
### Return type
@@ -1624,13 +2248,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Batch cancellation request accepted. Query order status by listing orders | - |
+**200** | Batch cancellation request accepted and processed, success determined by order list | - |
# **getSpotPriceTriggeredOrder**
> SpotPriceTriggeredOrder getSpotPriceTriggeredOrder(orderId)
-Get a single order
+Query single auto order details
### Example
@@ -1653,7 +2277,7 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "orderId_example"; // String | ID returned when order is successfully created
try {
SpotPriceTriggeredOrder result = apiInstance.getSpotPriceTriggeredOrder(orderId);
System.out.println(result);
@@ -1674,7 +2298,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -1692,13 +2316,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Auto order detail | - |
+**200** | Auto order details | - |
# **cancelSpotPriceTriggeredOrder**
> SpotPriceTriggeredOrder cancelSpotPriceTriggeredOrder(orderId)
-Cancel a single order
+Cancel single auto order
### Example
@@ -1721,7 +2345,7 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
SpotApi apiInstance = new SpotApi(defaultClient);
- String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
+ String orderId = "orderId_example"; // String | ID returned when order is successfully created
try {
SpotPriceTriggeredOrder result = apiInstance.cancelSpotPriceTriggeredOrder(orderId);
System.out.println(result);
@@ -1742,7 +2366,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **orderId** | **String**| Retrieve the data of the order with the specified ID |
+ **orderId** | **String**| ID returned when order is successfully created |
### Return type
@@ -1760,5 +2384,5 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Auto order detail | - |
+**200** | Auto order details | - |
diff --git a/docs/SpotCurrencyChain.md b/docs/SpotCurrencyChain.md
new file mode 100644
index 0000000..a5b9ee0
--- /dev/null
+++ b/docs/SpotCurrencyChain.md
@@ -0,0 +1,13 @@
+
+# SpotCurrencyChain
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Blockchain name | [optional]
+**addr** | **String** | token address | [optional]
+**withdrawDisabled** | **Boolean** | Whether currency's withdrawal is disabled | [optional]
+**withdrawDelayed** | **Boolean** | Whether currency's withdrawal is delayed | [optional]
+**depositDisabled** | **Boolean** | Whether currency's deposit is disabled | [optional]
+
diff --git a/docs/SpotFee.md b/docs/SpotFee.md
new file mode 100644
index 0000000..4af52ff
--- /dev/null
+++ b/docs/SpotFee.md
@@ -0,0 +1,18 @@
+
+# SpotFee
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | User ID | [optional]
+**takerFee** | **String** | taker fee rate | [optional]
+**makerFee** | **String** | maker fee rate | [optional]
+**gtDiscount** | **Boolean** | Whether GT deduction discount is enabled | [optional]
+**gtTakerFee** | **String** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional]
+**gtMakerFee** | **String** | Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled | [optional]
+**loanFee** | **String** | Loan fee rate of margin lending | [optional]
+**pointType** | **String** | Point card type: 0 - Original version, 1 - New version since 202009 | [optional]
+**currencyPair** | **String** | Currency pair | [optional]
+**debitFee** | **Integer** | Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates | [optional]
+
diff --git a/docs/SpotInsuranceHistory.md b/docs/SpotInsuranceHistory.md
new file mode 100644
index 0000000..9a5427d
--- /dev/null
+++ b/docs/SpotInsuranceHistory.md
@@ -0,0 +1,11 @@
+
+# SpotInsuranceHistory
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional]
+**balance** | **String** | Balance | [optional]
+**time** | **Long** | Creation time, timestamp, milliseconds | [optional]
+
diff --git a/docs/SpotPricePutOrder.md b/docs/SpotPricePutOrder.md
index f0bcd2c..96165ab 100644
--- a/docs/SpotPricePutOrder.md
+++ b/docs/SpotPricePutOrder.md
@@ -5,12 +5,22 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**type** | **String** | Order type, default to `limit` | [optional]
+**type** | [**TypeEnum**](#TypeEnum) | Order type,default to `limit` - limit : Limit Order - market : Market Order | [optional]
**side** | [**SideEnum**](#SideEnum) | Order side - buy: buy side - sell: sell side |
**price** | **String** | Order price |
-**amount** | **String** | Order amount |
-**account** | [**AccountEnum**](#AccountEnum) | Trading type - normal: spot trading - margin: margin trading |
+**amount** | **String** | Trading quantity When `type` is `limit`, it refers to the base currency (the currency being traded), such as `BTC` in `BTC_USDT` When `type` is `market`, it refers to different currencies based on the side: - `side`: `buy` refers to quote currency, `BTC_USDT` means `USDT` - `side`: `sell` refers to base currency, `BTC_USDT` means `BTC` |
+**account** | [**AccountEnum**](#AccountEnum) | Trading account type. Unified account must be set to `unified` - normal: spot trading - margin: margin trading - unified: unified account |
**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional]
+**autoBorrow** | **Boolean** | Whether to borrow coins automatically | [optional]
+**autoRepay** | **Boolean** | Whether to repay the loan automatically | [optional]
+**text** | **String** | The source of the order, including: - web: Web - api: API call - app: Mobile app | [optional]
+
+## Enum: TypeEnum
+
+Name | Value
+---- | -----
+LIMIT | "limit"
+MARKET | "market"
## Enum: SideEnum
@@ -25,6 +35,7 @@ Name | Value
---- | -----
NORMAL | "normal"
MARGIN | "margin"
+UNIFIED | "unified"
## Enum: TimeInForceEnum
diff --git a/docs/SpotPriceTrigger.md b/docs/SpotPriceTrigger.md
index 2da8bfc..cc6f694 100644
--- a/docs/SpotPriceTrigger.md
+++ b/docs/SpotPriceTrigger.md
@@ -6,8 +6,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**price** | **String** | Trigger price |
-**rule** | [**RuleEnum**](#RuleEnum) | Price trigger condition - >=: triggered when market price larger than or equal to `price` field - <=: triggered when market price less than or equal to `price` field |
-**expiration** | **Integer** | How long (in seconds) to wait for the condition to be triggered before cancelling the order. |
+**rule** | [**RuleEnum**](#RuleEnum) | Price trigger condition - `>=`: triggered when market price is greater than or equal to `price` - `<=`: triggered when market price is less than or equal to `price` |
+**expiration** | **Integer** | Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout |
## Enum: RuleEnum
diff --git a/docs/SpotPriceTriggeredOrder.md b/docs/SpotPriceTriggeredOrder.md
index 19fb39d..d7ba163 100644
--- a/docs/SpotPriceTriggeredOrder.md
+++ b/docs/SpotPriceTriggeredOrder.md
@@ -1,7 +1,7 @@
# SpotPriceTriggeredOrder
-Spot order detail
+Spot price order details
## Properties
@@ -11,10 +11,10 @@ Name | Type | Description | Notes
**put** | [**SpotPricePutOrder**](SpotPricePutOrder.md) | |
**id** | **Long** | Auto order ID | [optional] [readonly]
**user** | **Integer** | User ID | [optional] [readonly]
-**market** | **String** | Currency pair |
-**ctime** | **Double** | Creation time | [optional] [readonly]
-**ftime** | **Double** | Finished time | [optional] [readonly]
-**firedOrderId** | **Long** | ID of the newly created order on condition triggered | [optional] [readonly]
-**status** | **String** | Status - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired | [optional] [readonly]
-**reason** | **String** | Additional remarks on how the order was finished | [optional] [readonly]
+**market** | **String** | Market |
+**ctime** | **Long** | Created time | [optional] [readonly]
+**ftime** | **Long** | End time | [optional] [readonly]
+**firedOrderId** | **Long** | ID of the order created after trigger | [optional] [readonly]
+**status** | **String** | Status - open: Running - cancelled: Manually cancelled - finish: Successfully completed - failed: Failed to execute - expired: Expired | [optional] [readonly]
+**reason** | **String** | Additional description of how the order was completed | [optional] [readonly]
diff --git a/docs/StpGroup.md b/docs/StpGroup.md
new file mode 100644
index 0000000..732f17c
--- /dev/null
+++ b/docs/StpGroup.md
@@ -0,0 +1,12 @@
+
+# StpGroup
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | STP Group ID | [optional]
+**name** | **String** | STP Group name |
+**creatorId** | **Long** | Creator ID | [optional]
+**createTime** | **Long** | Created time | [optional]
+
diff --git a/docs/StpGroupUser.md b/docs/StpGroupUser.md
new file mode 100644
index 0000000..b873a7c
--- /dev/null
+++ b/docs/StpGroupUser.md
@@ -0,0 +1,11 @@
+
+# StpGroupUser
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | User ID | [optional]
+**stpId** | **Long** | STP Group ID | [optional]
+**createTime** | **Long** | Created time | [optional]
+
diff --git a/docs/StructuredBuy.md b/docs/StructuredBuy.md
new file mode 100644
index 0000000..3a10b82
--- /dev/null
+++ b/docs/StructuredBuy.md
@@ -0,0 +1,12 @@
+
+# StructuredBuy
+
+Dual Investment Buy
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**pid** | **String** | Product ID | [optional]
+**amount** | **String** | Buy Quantity | [optional]
+
diff --git a/docs/StructuredGetProjectList.md b/docs/StructuredGetProjectList.md
new file mode 100644
index 0000000..78a37ac
--- /dev/null
+++ b/docs/StructuredGetProjectList.md
@@ -0,0 +1,22 @@
+
+# StructuredGetProjectList
+
+Structured Investment
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Integer** | Product ID | [optional]
+**type** | **String** | Product Type: `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball | [optional]
+**nameEn** | **String** | Product Name | [optional]
+**investmentCoin** | **String** | Investment Token | [optional]
+**investmentPeriod** | **String** | Investment Period | [optional]
+**minAnnualRate** | **String** | Minimum Annual Rate | [optional]
+**midAnnualRate** | **String** | Intermediate Annual Rate | [optional]
+**maxAnnualRate** | **String** | Maximum Annual Rate | [optional]
+**watchMarket** | **String** | Underlying Market | [optional]
+**startTime** | **Integer** | Start Time | [optional]
+**endTime** | **Integer** | End time | [optional]
+**status** | **String** | Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done | [optional]
+
diff --git a/docs/StructuredOrderList.md b/docs/StructuredOrderList.md
new file mode 100644
index 0000000..5b25dc7
--- /dev/null
+++ b/docs/StructuredOrderList.md
@@ -0,0 +1,17 @@
+
+# StructuredOrderList
+
+Structured order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Integer** | Order ID | [optional]
+**pid** | **String** | Product ID | [optional]
+**lockCoin** | **String** | Locked coin | [optional]
+**amount** | **String** | Locked amount | [optional]
+**status** | **String** | Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE | [optional]
+**income** | **String** | Income | [optional]
+**createTime** | **Integer** | Created time | [optional]
+
diff --git a/docs/SubAccount.md b/docs/SubAccount.md
new file mode 100644
index 0000000..277844e
--- /dev/null
+++ b/docs/SubAccount.md
@@ -0,0 +1,16 @@
+
+# SubAccount
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**remark** | **String** | Remark | [optional]
+**loginName** | **String** | Sub-account login name: Only letters, numbers and underscores are supported, cannot contain other invalid characters |
+**password** | **String** | The sub-account's password. (Default: the same as main account's password) | [optional]
+**email** | **String** | The sub-account's email address. (Default: the same as main account's email address) | [optional]
+**state** | **Integer** | Sub-account status: 1-normal, 2-locked | [optional] [readonly]
+**type** | **Integer** | Sub-account type: 1-Regular sub-account, 3-Cross margin sub-account | [optional] [readonly]
+**userId** | **Long** | Sub-account user ID | [optional] [readonly]
+**createTime** | **Long** | Created time | [optional] [readonly]
+
diff --git a/docs/SubAccountApi.md b/docs/SubAccountApi.md
new file mode 100644
index 0000000..439800d
--- /dev/null
+++ b/docs/SubAccountApi.md
@@ -0,0 +1,773 @@
+# 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 sub-account
+[**listSubAccountKeys**](SubAccountApi.md#listSubAccountKeys) | **GET** /sub_accounts/{user_id}/keys | List all API key pairs of the sub-account
+[**createSubAccountKeys**](SubAccountApi.md#createSubAccountKeys) | **POST** /sub_accounts/{user_id}/keys | Create new sub-account API key pair
+[**getSubAccountKey**](SubAccountApi.md#getSubAccountKey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get specific API key pair of the sub-account
+[**updateSubAccountKeys**](SubAccountApi.md#updateSubAccountKeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update sub-account API key pair
+[**deleteSubAccountKeys**](SubAccountApi.md#deleteSubAccountKeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete sub-account API key pair
+[**lockSubAccount**](SubAccountApi.md#lockSubAccount) | **POST** /sub_accounts/{user_id}/lock | Lock sub-account
+[**unlockSubAccount**](SubAccountApi.md#unlockSubAccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock sub-account
+[**listUnifiedMode**](SubAccountApi.md#listUnifiedMode) | **GET** /sub_accounts/unified_mode | Get sub-account mode
+
+
+
+# **listSubAccounts**
+> List<SubAccount> listSubAccounts().type(type).execute();
+
+List sub-accounts
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ String type = "0"; // String | Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default.
+ try {
+ List result = apiInstance.listSubAccounts()
+ .type(type)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#listSubAccounts");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **type** | **String**| Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default. | [optional]
+
+### Return type
+
+[**List<SubAccount>**](SubAccount.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **createSubAccounts**
+> SubAccount createSubAccounts(subAccount)
+
+Create a new sub-account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ SubAccount subAccount = new SubAccount(); // SubAccount |
+ try {
+ SubAccount result = apiInstance.createSubAccounts(subAccount);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#createSubAccounts");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **subAccount** | [**SubAccount**](SubAccount.md)| |
+
+### Return type
+
+[**SubAccount**](SubAccount.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**201** | Created successfully | - |
+
+
+# **getSubAccount**
+> SubAccount getSubAccount(userId)
+
+Get sub-account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Long userId = 56L; // Long | Sub-account user ID
+ try {
+ SubAccount result = apiInstance.getSubAccount(userId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#getSubAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Long**| Sub-account user ID |
+
+### Return type
+
+[**SubAccount**](SubAccount.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **listSubAccountKeys**
+> List<SubAccountKey> listSubAccountKeys(userId)
+
+List all API key pairs of the sub-account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Integer userId = 56; // Integer | Sub-account user ID
+ try {
+ List result = apiInstance.listSubAccountKeys(userId);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#listSubAccountKeys");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Integer**| Sub-account user ID |
+
+### Return type
+
+[**List<SubAccountKey>**](SubAccountKey.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **createSubAccountKeys**
+> SubAccountKey createSubAccountKeys(userId, subAccountKey)
+
+Create new sub-account API key pair
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Long userId = 56L; // Long | Sub-account user ID
+ SubAccountKey subAccountKey = new SubAccountKey(); // SubAccountKey |
+ try {
+ SubAccountKey result = apiInstance.createSubAccountKeys(userId, subAccountKey);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#createSubAccountKeys");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Long**| Sub-account user ID |
+ **subAccountKey** | [**SubAccountKey**](SubAccountKey.md)| |
+
+### Return type
+
+[**SubAccountKey**](SubAccountKey.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Created successfully | - |
+
+
+# **getSubAccountKey**
+> SubAccountKey getSubAccountKey(userId, key)
+
+Get specific API key pair of the sub-account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Integer userId = 56; // Integer | Sub-account user ID
+ String key = "key_example"; // String | Sub-account API key
+ try {
+ SubAccountKey result = apiInstance.getSubAccountKey(userId, key);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#getSubAccountKey");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Integer**| Sub-account user ID |
+ **key** | **String**| Sub-account API key |
+
+### Return type
+
+[**SubAccountKey**](SubAccountKey.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successfully retrieved | - |
+
+
+# **updateSubAccountKeys**
+> updateSubAccountKeys(userId, key, subAccountKey)
+
+Update sub-account API key pair
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Integer userId = 56; // Integer | Sub-account user ID
+ String key = "key_example"; // String | Sub-account API key
+ SubAccountKey subAccountKey = new SubAccountKey(); // SubAccountKey |
+ try {
+ apiInstance.updateSubAccountKeys(userId, key, subAccountKey);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#updateSubAccountKeys");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Integer**| Sub-account user ID |
+ **key** | **String**| Sub-account API key |
+ **subAccountKey** | [**SubAccountKey**](SubAccountKey.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Updated successfully | - |
+
+
+# **deleteSubAccountKeys**
+> deleteSubAccountKeys(userId, key)
+
+Delete sub-account API key pair
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Integer userId = 56; // Integer | Sub-account user ID
+ String key = "key_example"; // String | Sub-account API key
+ try {
+ apiInstance.deleteSubAccountKeys(userId, key);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#deleteSubAccountKeys");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Integer**| Sub-account user ID |
+ **key** | **String**| Sub-account API key |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Deleted successfully | - |
+
+
+# **lockSubAccount**
+> lockSubAccount(userId)
+
+Lock sub-account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Long userId = 56L; // Long | Sub-account user ID
+ try {
+ apiInstance.lockSubAccount(userId);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#lockSubAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Long**| Sub-account user ID |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Locked successfully | - |
+
+
+# **unlockSubAccount**
+> unlockSubAccount(userId)
+
+Unlock sub-account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ Long userId = 56L; // Long | Sub-account user ID
+ try {
+ apiInstance.unlockSubAccount(userId);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#unlockSubAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **userId** | **Long**| Sub-account user ID |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Unlocked successfully | - |
+
+
+# **listUnifiedMode**
+> List<SubUserMode> listUnifiedMode()
+
+Get sub-account mode
+
+Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.SubAccountApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ SubAccountApi apiInstance = new SubAccountApi(defaultClient);
+ try {
+ List result = apiInstance.listUnifiedMode();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling SubAccountApi#listUnifiedMode");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<SubUserMode>**](SubUserMode.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
diff --git a/docs/SubAccountCrossMarginBalance.md b/docs/SubAccountCrossMarginBalance.md
new file mode 100644
index 0000000..c9de6fc
--- /dev/null
+++ b/docs/SubAccountCrossMarginBalance.md
@@ -0,0 +1,10 @@
+
+# SubAccountCrossMarginBalance
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uid** | **String** | User ID | [optional]
+**available** | [**SubCrossMarginAccount**](.md) | 账户余额信息 | [optional]
+
diff --git a/docs/SubAccountFuturesBalance.md b/docs/SubAccountFuturesBalance.md
new file mode 100644
index 0000000..c1ea4b0
--- /dev/null
+++ b/docs/SubAccountFuturesBalance.md
@@ -0,0 +1,10 @@
+
+# SubAccountFuturesBalance
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uid** | **String** | User ID | [optional]
+**available** | [**Map<String, FuturesAccount>**](FuturesAccount.md) | Futures account balances | [optional]
+
diff --git a/docs/SubAccountKey.md b/docs/SubAccountKey.md
new file mode 100644
index 0000000..a9700da
--- /dev/null
+++ b/docs/SubAccountKey.md
@@ -0,0 +1,18 @@
+
+# SubAccountKey
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | User ID | [optional] [readonly]
+**mode** | **Integer** | Mode: 1 - classic 2 - portfolio account | [optional]
+**name** | **String** | API Key Name | [optional]
+**perms** | [**List<SubAccountKeyPerms>**](SubAccountKeyPerms.md) | | [optional]
+**ipWhitelist** | **List<String>** | IP whitelist (list will be cleared if no value is passed) | [optional]
+**key** | **String** | API Key | [optional] [readonly]
+**state** | **Integer** | Status: 1-Normal 2-Frozen 3-Locked | [optional] [readonly]
+**createdAt** | **Long** | Created time | [optional] [readonly]
+**updatedAt** | **Long** | Last Update Time | [optional] [readonly]
+**lastAccess** | **Long** | Last Access Time | [optional] [readonly]
+
diff --git a/docs/SubAccountKeyPerms.md b/docs/SubAccountKeyPerms.md
new file mode 100644
index 0000000..78f1a2a
--- /dev/null
+++ b/docs/SubAccountKeyPerms.md
@@ -0,0 +1,10 @@
+
+# SubAccountKeyPerms
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Permission function name (no value will be cleared) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery contract - earn: earn - custody: custody - options: options - account: account information - loan: lending - margin: margin - unified: unified account - copy: copy trading | [optional]
+**readOnly** | **Boolean** | Read Only | [optional]
+
diff --git a/docs/SubAccountMarginBalance.md b/docs/SubAccountMarginBalance.md
new file mode 100644
index 0000000..ab7ed81
--- /dev/null
+++ b/docs/SubAccountMarginBalance.md
@@ -0,0 +1,10 @@
+
+# SubAccountMarginBalance
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uid** | **String** | User ID | [optional]
+**available** | [**List<MarginAccount>**](MarginAccount.md) | Margin account balances | [optional]
+
diff --git a/docs/SubAccountToSubAccount.md b/docs/SubAccountToSubAccount.md
new file mode 100644
index 0000000..c15d433
--- /dev/null
+++ b/docs/SubAccountToSubAccount.md
@@ -0,0 +1,15 @@
+
+# SubAccountToSubAccount
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Transfer currency name |
+**subAccountType** | **String** | Transfer from account (deprecated, use `sub_account_from_type` and `sub_account_to_type` instead) | [optional]
+**subAccountFrom** | **String** | Transfer from the user id of the sub-account |
+**subAccountFromType** | **String** | Source sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account |
+**subAccountTo** | **String** | Transfer to the user id of the sub-account |
+**subAccountToType** | **String** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account |
+**amount** | **String** | Transfer amount |
+
diff --git a/docs/SubAccountTransfer.md b/docs/SubAccountTransfer.md
index 1c0d054..dca8285 100644
--- a/docs/SubAccountTransfer.md
+++ b/docs/SubAccountTransfer.md
@@ -5,26 +5,10 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**currency** | **String** | Transfer currency name |
**subAccount** | **String** | Sub account user ID |
-**direction** | [**DirectionEnum**](#DirectionEnum) | Transfer direction. to - transfer into sub account; from - transfer out from sub account |
+**subAccountType** | **String** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account | [optional]
+**currency** | **String** | Transfer currency name |
**amount** | **String** | Transfer amount |
-**uid** | **String** | Main account user ID | [optional] [readonly]
-**timest** | **String** | Transfer timestamp | [optional] [readonly]
-**source** | **String** | Where the operation is initiated from | [optional] [readonly]
-**subAccountType** | [**SubAccountTypeEnum**](#SubAccountTypeEnum) | Target sub user's account. `spot` - spot account, `futures` - perpetual contract account | [optional]
-
-## Enum: DirectionEnum
-
-Name | Value
----- | -----
-TO | "to"
-FROM | "from"
-
-## Enum: SubAccountTypeEnum
-
-Name | Value
----- | -----
-SPOT | "spot"
-FUTURES | "futures"
+**direction** | **String** | Transfer direction: to - transfer into sub-account, from - transfer out from sub-account |
+**clientOrderId** | **String** | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters | [optional]
diff --git a/docs/SubAccountTransferRecordItem.md b/docs/SubAccountTransferRecordItem.md
new file mode 100644
index 0000000..5b5a70c
--- /dev/null
+++ b/docs/SubAccountTransferRecordItem.md
@@ -0,0 +1,18 @@
+
+# SubAccountTransferRecordItem
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**timest** | **String** | Transfer timestamp | [optional] [readonly]
+**uid** | **String** | Main account user ID | [optional] [readonly]
+**subAccount** | **String** | Sub account user ID |
+**subAccountType** | **String** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account | [optional]
+**currency** | **String** | Transfer currency name |
+**amount** | **String** | Transfer amount |
+**direction** | **String** | Transfer direction: to - transfer into sub-account, from - transfer out from sub-account |
+**source** | **String** | Source of the transfer operation | [optional] [readonly]
+**clientOrderId** | **String** | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters | [optional]
+**status** | **String** | Sub-account transfer record status, currently only 'success' | [optional]
+
diff --git a/docs/SubCrossMarginAccount.md b/docs/SubCrossMarginAccount.md
new file mode 100644
index 0000000..d8c4f02
--- /dev/null
+++ b/docs/SubCrossMarginAccount.md
@@ -0,0 +1,24 @@
+
+# SubCrossMarginAccount
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | Cross margin account user ID. 0 means this sub-account has not yet opened a cross margin account | [optional]
+**locked** | **Boolean** | Whether the account is locked | [optional]
+**balances** | [**Map<String, CrossMarginBalance>**](CrossMarginBalance.md) | | [optional]
+**total** | **String** | Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` | [optional]
+**borrowed** | **String** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional]
+**borrowedNet** | **String** | Total borrowed value in USDT * leverage factor | [optional]
+**net** | **String** | Total net assets in USDT | [optional]
+**leverage** | **String** | Position leverage | [optional]
+**interest** | **String** | Total unpaid interest in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional]
+**risk** | **String** | Risk rate. When it falls below 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional]
+**totalInitialMargin** | **String** | Total initial margin | [optional]
+**totalMarginBalance** | **String** | Total margin balance | [optional]
+**totalMaintenanceMargin** | **String** | Total maintenance margin | [optional]
+**totalInitialMarginRate** | **String** | Total initial margin rate | [optional]
+**totalMaintenanceMarginRate** | **String** | Total maintenance margin rate | [optional]
+**totalAvailableMargin** | **String** | Total available margin | [optional]
+
diff --git a/docs/SubUserMode.md b/docs/SubUserMode.md
new file mode 100644
index 0000000..68bb280
--- /dev/null
+++ b/docs/SubUserMode.md
@@ -0,0 +1,11 @@
+
+# SubUserMode
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | User ID | [optional]
+**isUnified** | **Boolean** | Whether it is a unified account | [optional]
+**mode** | **String** | Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode | [optional]
+
diff --git a/docs/SwapCoin.md b/docs/SwapCoin.md
new file mode 100644
index 0000000..13f5657
--- /dev/null
+++ b/docs/SwapCoin.md
@@ -0,0 +1,14 @@
+
+# SwapCoin
+
+Blockchain Mining
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**coin** | **String** | Currency |
+**side** | **String** | 0 - Stake 1 - Redeem |
+**amount** | **String** | Size |
+**pid** | **Integer** | DeFi-type Mining Protocol Identifier | [optional]
+
diff --git a/docs/SwapCoinStruct.md b/docs/SwapCoinStruct.md
new file mode 100644
index 0000000..2fc1966
--- /dev/null
+++ b/docs/SwapCoinStruct.md
@@ -0,0 +1,23 @@
+
+# SwapCoinStruct
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Integer** | Order ID | [optional]
+**pid** | **Integer** | Product ID | [optional]
+**uid** | **Integer** | User ID | [optional]
+**coin** | **String** | Currency | [optional]
+**type** | **Integer** | Type 0-Staking 1-Redemption | [optional]
+**subtype** | **String** | SubType | [optional]
+**amount** | **String** | Amount | [optional]
+**exchangeRate** | **String** | Exchange ratio | [optional]
+**exchangeAmount** | **String** | Redemption Amount | [optional]
+**updateStamp** | **Integer** | UpdateTimestamp | [optional]
+**createStamp** | **Integer** | Transaction timestamp | [optional]
+**status** | **Integer** | status 1-success | [optional]
+**protocolType** | **Integer** | DEFI Protocol Type | [optional]
+**clientOrderId** | **String** | Reference ID | [optional]
+**source** | **String** | Order Origin | [optional]
+
diff --git a/docs/SystemTime.md b/docs/SystemTime.md
new file mode 100644
index 0000000..ebc18b1
--- /dev/null
+++ b/docs/SystemTime.md
@@ -0,0 +1,9 @@
+
+# SystemTime
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**serverTime** | **Long** | Server current time(ms) | [optional]
+
diff --git a/docs/Ticker.md b/docs/Ticker.md
index 7d2d1ab..77c5da5 100644
--- a/docs/Ticker.md
+++ b/docs/Ticker.md
@@ -7,15 +7,19 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currencyPair** | **String** | Currency pair | [optional]
**last** | **String** | Last trading price | [optional]
-**lowestAsk** | **String** | Lowest ask | [optional]
-**highestBid** | **String** | Highest bid | [optional]
-**changePercentage** | **String** | Change percentage. | [optional]
-**baseVolume** | **String** | Base currency trade volume | [optional]
-**quoteVolume** | **String** | Quote currency trade volume | [optional]
-**high24h** | **String** | Highest price in 24h | [optional]
-**low24h** | **String** | Lowest price in 24h | [optional]
+**lowestAsk** | **String** | Recent lowest ask | [optional]
+**lowestSize** | **String** | Latest seller's lowest price quantity; not available for batch queries; available for single queries, empty if no data | [optional]
+**highestBid** | **String** | Recent highest bid | [optional]
+**highestSize** | **String** | Latest buyer's highest price quantity; not available for batch queries; available for single queries, empty if no data | [optional]
+**changePercentage** | **String** | 24h price change percentage (negative for decrease, e.g., -7.45) | [optional]
+**changeUtc0** | **String** | UTC+0 timezone, 24h price change percentage, negative for decline (e.g., -7.45) | [optional]
+**changeUtc8** | **String** | UTC+8 timezone, 24h price change percentage, negative for decline (e.g., -7.45) | [optional]
+**baseVolume** | **String** | Base currency trading volume in the last 24h | [optional]
+**quoteVolume** | **String** | Quote currency trading volume in the last 24h | [optional]
+**high24h** | **String** | 24h High | [optional]
+**low24h** | **String** | 24h Low | [optional]
**etfNetValue** | **String** | ETF net value | [optional]
-**etfPreNetValue** | **String** | ETF previous net value at re-balancing time | [optional]
-**etfPreTimestamp** | **Long** | ETF previous re-balancing time | [optional]
+**etfPreNetValue** | **String** | ETF net value at previous rebalancing point | [optional]
+**etfPreTimestamp** | **Long** | ETF previous rebalancing time | [optional]
**etfLeverage** | **String** | ETF current leverage | [optional]
diff --git a/docs/TotalBalance.md b/docs/TotalBalance.md
index 5ed79f2..a17191f 100644
--- a/docs/TotalBalance.md
+++ b/docs/TotalBalance.md
@@ -1,12 +1,12 @@
# TotalBalance
-User's balance in all accounts
+User's total balance information
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | [**AccountBalance**](AccountBalance.md) | | [optional]
-**details** | [**Map<String, AccountBalance>**](AccountBalance.md) | Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: futures account - delivery: delivery account - warrant: warrant account - cbbc: cbbc account | [optional]
+**details** | [**Map<String, AccountBalance>**](AccountBalance.md) | Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: perpetual contract account - delivery: delivery contract account - warrant: warrant account - cbbc: CBBC account | [optional]
diff --git a/docs/Trade.md b/docs/Trade.md
index a5039f1..fb513ba 100644
--- a/docs/Trade.md
+++ b/docs/Trade.md
@@ -5,19 +5,22 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **String** | Trade ID | [optional]
-**createTime** | **String** | Trading time | [optional]
+**id** | **String** | Fill ID | [optional]
+**createTime** | **String** | Fill Time | [optional]
**createTimeMs** | **String** | Trading time, with millisecond precision | [optional]
**currencyPair** | **String** | Currency pair | [optional]
-**side** | [**SideEnum**](#SideEnum) | Order side | [optional]
-**role** | [**RoleEnum**](#RoleEnum) | Trade role | [optional]
+**side** | [**SideEnum**](#SideEnum) | Buy or sell order | [optional]
+**role** | [**RoleEnum**](#RoleEnum) | Trade role, not returned in public endpoints | [optional]
**amount** | **String** | Trade amount | [optional]
**price** | **String** | Order price | [optional]
-**orderId** | **String** | Related order ID. No value in public endpoints | [optional]
-**fee** | **String** | Fee deducted. No value in public endpoints | [optional]
-**feeCurrency** | **String** | Fee currency unit. No value in public endpoints | [optional]
-**pointFee** | **String** | Points used to deduct fee | [optional]
-**gtFee** | **String** | GT used to deduct fee | [optional]
+**orderId** | **String** | Related order ID, not returned in public endpoints | [optional]
+**fee** | **String** | Fee deducted, not returned in public endpoints | [optional]
+**feeCurrency** | **String** | Fee currency unit, not returned in public endpoints | [optional]
+**pointFee** | **String** | Points used to deduct fee, not returned in public endpoints | [optional]
+**gtFee** | **String** | GT used to deduct fee, not returned in public endpoints | [optional]
+**amendText** | **String** | The custom data that the user remarked when amending the order | [optional]
+**sequenceId** | **String** | Consecutive trade ID within a single market. Used to track and identify trades in the specific market | [optional]
+**text** | **String** | User-defined information, not returned in public endpoints | [optional]
## Enum: SideEnum
diff --git a/docs/TradeFee.md b/docs/TradeFee.md
index 70ac3fa..cb01b2d 100644
--- a/docs/TradeFee.md
+++ b/docs/TradeFee.md
@@ -8,11 +8,14 @@ Name | Type | Description | Notes
**userId** | **Long** | User ID | [optional]
**takerFee** | **String** | taker fee rate | [optional]
**makerFee** | **String** | maker fee rate | [optional]
-**gtDiscount** | **Boolean** | If GT deduction is enabled | [optional]
+**gtDiscount** | **Boolean** | Whether GT deduction discount is enabled | [optional]
**gtTakerFee** | **String** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional]
-**gtMakerFee** | **String** | Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional]
+**gtMakerFee** | **String** | Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled | [optional]
**loanFee** | **String** | Loan fee rate of margin lending | [optional]
-**pointType** | **String** | Point type. 0 - Initial version. 1 - new version since 202009 | [optional]
-**futuresTakerFee** | **String** | Futures trading taker fee | [optional]
-**futuresMakerFee** | **String** | Future trading maker fee | [optional]
+**pointType** | **String** | Point card type: 0 - Original version, 1 - New version since 202009 | [optional]
+**futuresTakerFee** | **String** | Perpetual contract taker fee rate | [optional]
+**futuresMakerFee** | **String** | Perpetual contract maker fee rate | [optional]
+**deliveryTakerFee** | **String** | Delivery contract taker fee rate | [optional]
+**deliveryMakerFee** | **String** | Delivery contract maker fee rate | [optional]
+**debitFee** | **Integer** | Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates | [optional]
diff --git a/docs/TransactionID.md b/docs/TransactionID.md
new file mode 100644
index 0000000..9431f79
--- /dev/null
+++ b/docs/TransactionID.md
@@ -0,0 +1,9 @@
+
+# TransactionID
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**txId** | **Long** | Order ID | [optional]
+
diff --git a/docs/Transfer.md b/docs/Transfer.md
index 261988b..d25d251 100644
--- a/docs/Transfer.md
+++ b/docs/Transfer.md
@@ -1,18 +1,18 @@
# Transfer
-Accounts available to transfer: - `spot`: spot account - `margin`: margin account - `futures`: perpetual futures account - `delivery`: delivery futures account - `cross_margin`: cross margin account
+Accounts available to transfer: - `spot`: spot account - `margin`: margin account - `futures`: perpetual futures account - `delivery`: delivery futures account - `options`: options account
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**currency** | **String** | Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency |
+**currency** | **String** | Transfer currency name. For contract accounts, `currency` can be set to `POINT` (points) or supported settlement currencies (e.g., `BTC`, `USDT`) |
**from** | [**FromEnum**](#FromEnum) | Account to transfer from |
**to** | [**ToEnum**](#ToEnum) | Account to transfer to |
**amount** | **String** | Transfer amount |
-**currencyPair** | **String** | Margin currency pair. Required if transfer from or to margin account | [optional]
-**settle** | **String** | Futures settle currency. Required if `currency` is `POINT` | [optional]
+**currencyPair** | **String** | Margin trading pair. Required when transferring to or from margin account | [optional]
+**settle** | **String** | Contract settlement currency. Required when transferring to or from contract account | [optional]
## Enum: FromEnum
@@ -22,7 +22,7 @@ SPOT | "spot"
MARGIN | "margin"
FUTURES | "futures"
DELIVERY | "delivery"
-CROSS_MARGIN | "cross_margin"
+OPTIONS | "options"
## Enum: ToEnum
@@ -32,5 +32,5 @@ SPOT | "spot"
MARGIN | "margin"
FUTURES | "futures"
DELIVERY | "delivery"
-CROSS_MARGIN | "cross_margin"
+OPTIONS | "options"
diff --git a/docs/TransferOrderStatus.md b/docs/TransferOrderStatus.md
new file mode 100644
index 0000000..85b41b4
--- /dev/null
+++ b/docs/TransferOrderStatus.md
@@ -0,0 +1,10 @@
+
+# TransferOrderStatus
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**txId** | **String** | Order ID | [optional]
+**status** | **String** | Transfer status: PENDING - Processing, SUCCESS - Transfer successful, FAIL - Transfer failed, PARTIAL_SUCCESS - Partially successful (this status appears when transferring between sub-accounts) | [optional]
+
diff --git a/docs/TransferablesResult.md b/docs/TransferablesResult.md
new file mode 100644
index 0000000..53216b6
--- /dev/null
+++ b/docs/TransferablesResult.md
@@ -0,0 +1,12 @@
+
+# TransferablesResult
+
+Batch query unified account maximum transferable results
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency detail | [optional]
+**amount** | **String** | Maximum transferable amount | [optional]
+
diff --git a/docs/TriggerTime.md b/docs/TriggerTime.md
new file mode 100644
index 0000000..1eb4c55
--- /dev/null
+++ b/docs/TriggerTime.md
@@ -0,0 +1,9 @@
+
+# TriggerTime
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**triggerTime** | **Long** | Timestamp when countdown ends, in milliseconds | [optional]
+
diff --git a/docs/UidPushOrder.md b/docs/UidPushOrder.md
new file mode 100644
index 0000000..66934e7
--- /dev/null
+++ b/docs/UidPushOrder.md
@@ -0,0 +1,17 @@
+
+# UidPushOrder
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | Order ID | [optional]
+**pushUid** | **Long** | Initiator User ID | [optional]
+**receiveUid** | **Long** | Recipient User ID | [optional]
+**currency** | **String** | Currency name | [optional]
+**amount** | **String** | Transfer amount | [optional]
+**createTime** | **Long** | Created time | [optional]
+**status** | **String** | Withdrawal status: - CREATING: Creating - PENDING: Waiting for recipient (Please contact the recipient to accept the transfer on Gate official website) - CANCELLING: Cancelling - CANCELLED: Cancelled - REFUSING: Refusing - REFUSED: Refused - RECEIVING: Receiving - RECEIVED: Success | [optional]
+**message** | **String** | PENDING reason tips | [optional]
+**transactionType** | **String** | Order Type | [optional]
+
diff --git a/docs/UidPushWithdrawal.md b/docs/UidPushWithdrawal.md
new file mode 100644
index 0000000..4fcd82e
--- /dev/null
+++ b/docs/UidPushWithdrawal.md
@@ -0,0 +1,11 @@
+
+# UidPushWithdrawal
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**receiveUid** | **Long** | Recipient UID |
+**currency** | **String** | Currency name |
+**amount** | **String** | Transfer amount |
+
diff --git a/docs/UidPushWithdrawalResp.md b/docs/UidPushWithdrawalResp.md
new file mode 100644
index 0000000..5d7e783
--- /dev/null
+++ b/docs/UidPushWithdrawalResp.md
@@ -0,0 +1,9 @@
+
+# UidPushWithdrawalResp
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | Order ID | [optional]
+
diff --git a/docs/UniCurrency.md b/docs/UniCurrency.md
new file mode 100644
index 0000000..0cc1548
--- /dev/null
+++ b/docs/UniCurrency.md
@@ -0,0 +1,15 @@
+
+# UniCurrency
+
+Currency detail
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name | [optional] [readonly]
+**minLendAmount** | **String** | The minimum lending amount, in the unit of the currency | [optional] [readonly]
+**maxLendAmount** | **String** | The total maximum lending amount, in USDT | [optional] [readonly]
+**maxRate** | **String** | Maximum rate (Hourly) | [optional] [readonly]
+**minRate** | **String** | Minimum rate (Hourly) | [optional] [readonly]
+
diff --git a/docs/UniCurrencyInterest.md b/docs/UniCurrencyInterest.md
new file mode 100644
index 0000000..212afc2
--- /dev/null
+++ b/docs/UniCurrencyInterest.md
@@ -0,0 +1,10 @@
+
+# UniCurrencyInterest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional] [readonly]
+**interestStatus** | **String** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly]
+
diff --git a/docs/UniCurrencyPair.md b/docs/UniCurrencyPair.md
new file mode 100644
index 0000000..2b09132
--- /dev/null
+++ b/docs/UniCurrencyPair.md
@@ -0,0 +1,14 @@
+
+# UniCurrencyPair
+
+Currency pair of the loan
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currencyPair** | **String** | Currency pair | [optional] [readonly]
+**baseMinBorrowAmount** | **String** | Minimum borrow amount of base currency | [optional] [readonly]
+**quoteMinBorrowAmount** | **String** | Minimum borrow amount of quote currency | [optional] [readonly]
+**leverage** | **String** | Position leverage | [optional] [readonly]
+
diff --git a/docs/UniInterestRecord.md b/docs/UniInterestRecord.md
new file mode 100644
index 0000000..bd2d474
--- /dev/null
+++ b/docs/UniInterestRecord.md
@@ -0,0 +1,16 @@
+
+# UniInterestRecord
+
+Interest Record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**status** | **Integer** | Status: 0 - fail, 1 - success | [optional] [readonly]
+**currency** | **String** | Currency | [optional] [readonly]
+**actualRate** | **String** | Actual Rate | [optional] [readonly]
+**interest** | **String** | Interest | [optional] [readonly]
+**interestStatus** | **String** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly]
+**createTime** | **Long** | Created time | [optional] [readonly]
+
diff --git a/docs/UniLend.md b/docs/UniLend.md
new file mode 100644
index 0000000..961d0ab
--- /dev/null
+++ b/docs/UniLend.md
@@ -0,0 +1,20 @@
+
+# UniLend
+
+Loan record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional] [readonly]
+**currentAmount** | **String** | Current amount | [optional] [readonly]
+**amount** | **String** | Total Lending Amount | [optional] [readonly]
+**lentAmount** | **String** | Lent Amount | [optional] [readonly]
+**frozenAmount** | **String** | Pending Redemption Amount | [optional] [readonly]
+**minRate** | **String** | Minimum interest rate | [optional] [readonly]
+**interestStatus** | **String** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly]
+**reinvestLeftAmount** | **String** | Non-reinvested Amount | [optional] [readonly]
+**createTime** | **Long** | Lending Order Creation Time | [optional] [readonly]
+**updateTime** | **Long** | Lending Order Last Update Time | [optional] [readonly]
+
diff --git a/docs/UniLendInterest.md b/docs/UniLendInterest.md
new file mode 100644
index 0000000..feaaf25
--- /dev/null
+++ b/docs/UniLendInterest.md
@@ -0,0 +1,10 @@
+
+# UniLendInterest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional] [readonly]
+**interest** | **String** | Interest income | [optional] [readonly]
+
diff --git a/docs/UniLendRecord.md b/docs/UniLendRecord.md
new file mode 100644
index 0000000..fef9b1b
--- /dev/null
+++ b/docs/UniLendRecord.md
@@ -0,0 +1,17 @@
+
+# UniLendRecord
+
+Lending Record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name | [optional] [readonly]
+**amount** | **String** | Current Amount | [optional] [readonly]
+**lastWalletAmount** | **String** | Previous Available Amount | [optional] [readonly]
+**lastLentAmount** | **String** | Previous Lent Amount | [optional] [readonly]
+**lastFrozenAmount** | **String** | Previous Frozen Amount | [optional] [readonly]
+**type** | **String** | Record Type: lend - Lend, redeem - Redeem | [optional] [readonly]
+**createTime** | **Long** | Created time | [optional] [readonly]
+
diff --git a/docs/UniLoan.md b/docs/UniLoan.md
new file mode 100644
index 0000000..758c1ed
--- /dev/null
+++ b/docs/UniLoan.md
@@ -0,0 +1,16 @@
+
+# UniLoan
+
+Borrowing
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency | [optional] [readonly]
+**currencyPair** | **String** | Currency pair | [optional] [readonly]
+**amount** | **String** | Amount to Repay | [optional] [readonly]
+**type** | **String** | Loan type: platform borrowing - platform, margin borrowing - margin | [optional] [readonly]
+**createTime** | **Long** | Created time | [optional] [readonly]
+**updateTime** | **Long** | Last Update Time | [optional] [readonly]
+
diff --git a/docs/UniLoanInterestRecord.md b/docs/UniLoanInterestRecord.md
new file mode 100644
index 0000000..31bfe46
--- /dev/null
+++ b/docs/UniLoanInterestRecord.md
@@ -0,0 +1,17 @@
+
+# UniLoanInterestRecord
+
+Interest Deduction Record
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name | [optional] [readonly]
+**currencyPair** | **String** | Currency pair | [optional] [readonly]
+**actualRate** | **String** | Actual Rate | [optional] [readonly]
+**interest** | **String** | Interest | [optional] [readonly]
+**status** | **Integer** | Status: 0 - fail, 1 - success | [optional] [readonly]
+**type** | **String** | Type: platform - Platform borrowing, margin - Margin borrowing | [optional] [readonly]
+**createTime** | **Long** | Created time | [optional] [readonly]
+
diff --git a/docs/UniLoanRecord.md b/docs/UniLoanRecord.md
new file mode 100644
index 0000000..9adc6ee
--- /dev/null
+++ b/docs/UniLoanRecord.md
@@ -0,0 +1,15 @@
+
+# UniLoanRecord
+
+Borrowing Records
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **String** | Type: `borrow` - borrow, `repay` - repay | [optional] [readonly]
+**currencyPair** | **String** | Currency pair | [optional] [readonly]
+**currency** | **String** | Currency | [optional] [readonly]
+**amount** | **String** | Borrow or repayment amount | [optional] [readonly]
+**createTime** | **Long** | Created time | [optional] [readonly]
+
diff --git a/docs/UnifiedAccount.md b/docs/UnifiedAccount.md
new file mode 100644
index 0000000..67395f9
--- /dev/null
+++ b/docs/UnifiedAccount.md
@@ -0,0 +1,28 @@
+
+# UnifiedAccount
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | User ID | [optional]
+**refreshTime** | **Long** | Last refresh time | [optional]
+**locked** | **Boolean** | Whether the account is locked, valid in cross-currency margin/combined margin mode, false in other modes such as single-currency margin mode | [optional]
+**balances** | [**Map<String, UnifiedBalance>**](UnifiedBalance.md) | | [optional]
+**total** | **String** | Total account assets converted to USD, i.e. the sum of `(available + freeze) * price` in all currencies (deprecated, to be removed, replaced by unified_account_total) | [optional]
+**borrowed** | **String** | Total borrowed amount converted to USD, i.e. the sum of `borrowed * price` of all currencies (excluding point cards), valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**totalInitialMargin** | **String** | Total initial margin, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**totalMarginBalance** | **String** | Total margin balance, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**totalMaintenanceMargin** | **String** | Total maintenance margin is valid in cross-currency margin/combined margin mode, and is 0 in other modes such as single-currency margin mode | [optional]
+**totalInitialMarginRate** | **String** | Total initial margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**totalMaintenanceMarginRate** | **String** | Total maintenance margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**totalAvailableMargin** | **String** | Available margin amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**unifiedAccountTotal** | **String** | Total unified account assets, valid in single currency margin/cross-currency margin/combined margin mode | [optional]
+**unifiedAccountTotalLiab** | **String** | Total unified account borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**unifiedAccountTotalEquity** | **String** | Total unified account equity, valid in single currency margin/cross-currency margin/combined margin mode | [optional]
+**leverage** | **String** | Actual leverage ratio, valid in cross-currency margin/combined margin mode | [optional] [readonly]
+**spotOrderLoss** | **String** | Total pending order loss, in USDT, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**spotHedge** | **Boolean** | Spot hedging status: true - enabled, false - disabled | [optional]
+**useFunding** | **Boolean** | Whether to use Earn funds as margin | [optional]
+**isAllCollateral** | **Boolean** | Whether all currencies are used as margin: true - all currencies as margin, false - no | [optional]
+
diff --git a/docs/UnifiedApi.md b/docs/UnifiedApi.md
new file mode 100644
index 0000000..22186b2
--- /dev/null
+++ b/docs/UnifiedApi.md
@@ -0,0 +1,1562 @@
+# UnifiedApi
+
+All URIs are relative to *https://api.gateio.ws/api/v4*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**listUnifiedAccounts**](UnifiedApi.md#listUnifiedAccounts) | **GET** /unified/accounts | Get unified account information
+[**getUnifiedBorrowable**](UnifiedApi.md#getUnifiedBorrowable) | **GET** /unified/borrowable | Query maximum borrowable amount for unified account
+[**getUnifiedTransferable**](UnifiedApi.md#getUnifiedTransferable) | **GET** /unified/transferable | Query maximum transferable amount for unified account
+[**getUnifiedTransferables**](UnifiedApi.md#getUnifiedTransferables) | **GET** /unified/transferables | Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
+[**getUnifiedBorrowableList**](UnifiedApi.md#getUnifiedBorrowableList) | **GET** /unified/batch_borrowable | Batch query unified account maximum borrowable amount
+[**listUnifiedLoans**](UnifiedApi.md#listUnifiedLoans) | **GET** /unified/loans | Query loans
+[**createUnifiedLoan**](UnifiedApi.md#createUnifiedLoan) | **POST** /unified/loans | Borrow or repay
+[**listUnifiedLoanRecords**](UnifiedApi.md#listUnifiedLoanRecords) | **GET** /unified/loan_records | Query loan records
+[**listUnifiedLoanInterestRecords**](UnifiedApi.md#listUnifiedLoanInterestRecords) | **GET** /unified/interest_records | Query interest deduction records
+[**getUnifiedRiskUnits**](UnifiedApi.md#getUnifiedRiskUnits) | **GET** /unified/risk_units | Get user risk unit details
+[**getUnifiedMode**](UnifiedApi.md#getUnifiedMode) | **GET** /unified/unified_mode | Query mode of the unified account
+[**setUnifiedMode**](UnifiedApi.md#setUnifiedMode) | **PUT** /unified/unified_mode | Set unified account mode
+[**getUnifiedEstimateRate**](UnifiedApi.md#getUnifiedEstimateRate) | **GET** /unified/estimate_rate | Query unified account estimated interest rate
+[**listCurrencyDiscountTiers**](UnifiedApi.md#listCurrencyDiscountTiers) | **GET** /unified/currency_discount_tiers | Query unified account tiered
+[**listLoanMarginTiers**](UnifiedApi.md#listLoanMarginTiers) | **GET** /unified/loan_margin_tiers | Query unified account tiered loan margin
+[**calculatePortfolioMargin**](UnifiedApi.md#calculatePortfolioMargin) | **POST** /unified/portfolio_calculator | Portfolio margin calculator
+[**getUserLeverageCurrencyConfig**](UnifiedApi.md#getUserLeverageCurrencyConfig) | **GET** /unified/leverage/user_currency_config | Maximum and minimum currency leverage that can be set
+[**getUserLeverageCurrencySetting**](UnifiedApi.md#getUserLeverageCurrencySetting) | **GET** /unified/leverage/user_currency_setting | Get user currency leverage
+[**setUserLeverageCurrencySetting**](UnifiedApi.md#setUserLeverageCurrencySetting) | **POST** /unified/leverage/user_currency_setting | Set loan currency leverage
+[**listUnifiedCurrencies**](UnifiedApi.md#listUnifiedCurrencies) | **GET** /unified/currencies | List of loan currencies supported by unified account
+[**getHistoryLoanRate**](UnifiedApi.md#getHistoryLoanRate) | **GET** /unified/history_loan_rate | Get historical lending rates
+[**setUnifiedCollateral**](UnifiedApi.md#setUnifiedCollateral) | **POST** /unified/collateral_currencies | Set collateral currency
+
+
+
+# **listUnifiedAccounts**
+> UnifiedAccount listUnifiedAccounts().currency(currency).subUid(subUid).execute();
+
+Get unified account information
+
+The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. For specific formulas, please refer to [Margin Formula](#margin-formula)
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ String subUid = "10001"; // String | Sub account user ID
+ try {
+ UnifiedAccount result = apiInstance.listUnifiedAccounts()
+ .currency(currency)
+ .subUid(subUid)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#listUnifiedAccounts");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **subUid** | **String**| Sub account user ID | [optional]
+
+### Return type
+
+[**UnifiedAccount**](UnifiedAccount.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **getUnifiedBorrowable**
+> UnifiedBorrowable getUnifiedBorrowable(currency)
+
+Query maximum borrowable amount for unified account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ try {
+ UnifiedBorrowable result = apiInstance.getUnifiedBorrowable(currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUnifiedBorrowable");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name |
+
+### Return type
+
+[**UnifiedBorrowable**](UnifiedBorrowable.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUnifiedTransferable**
+> UnifiedTransferable getUnifiedTransferable(currency)
+
+Query maximum transferable amount for unified account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ try {
+ UnifiedTransferable result = apiInstance.getUnifiedTransferable(currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUnifiedTransferable");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name |
+
+### Return type
+
+[**UnifiedTransferable**](UnifiedTransferable.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUnifiedTransferables**
+> List<TransferablesResult> getUnifiedTransferables(currencies)
+
+Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currencies = "BTC,ETH"; // String | Specify the currency name to query in batches, and support up to 100 pass parameters at a time
+ try {
+ List result = apiInstance.getUnifiedTransferables(currencies);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUnifiedTransferables");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencies** | **String**| Specify the currency name to query in batches, and support up to 100 pass parameters at a time |
+
+### Return type
+
+[**List<TransferablesResult>**](TransferablesResult.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUnifiedBorrowableList**
+> List<UnifiedBorrowable1> getUnifiedBorrowableList(currencies)
+
+Batch query unified account maximum borrowable amount
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ List currencies = Arrays.asList(); // List | Specify currency names for querying in an array, separated by commas, maximum 10 currencies
+ try {
+ List result = apiInstance.getUnifiedBorrowableList(currencies);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUnifiedBorrowableList");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencies** | [**List<String>**](String.md)| Specify currency names for querying in an array, separated by commas, maximum 10 currencies |
+
+### Return type
+
+[**List<UnifiedBorrowable1>**](UnifiedBorrowable1.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listUnifiedLoans**
+> List<UniLoan> listUnifiedLoans().currency(currency).page(page).limit(limit).type(type).execute();
+
+Query loans
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ String type = "platform"; // String | Loan type: platform borrowing - platform, margin borrowing - margin
+ try {
+ List result = apiInstance.listUnifiedLoans()
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .type(type)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#listUnifiedLoans");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+ **type** | **String**| Loan type: platform borrowing - platform, margin borrowing - margin | [optional]
+
+### Return type
+
+[**List<UniLoan>**](UniLoan.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **createUnifiedLoan**
+> UnifiedLoanResult createUnifiedLoan(unifiedLoan)
+
+Borrow or repay
+
+When borrowing, ensure the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and user. Loan interest will be automatically deducted from the account at regular intervals. Users are responsible for managing repayment of borrowed amounts. For repayment, use `repaid_all=true` to repay all available amounts
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ UnifiedLoan unifiedLoan = new UnifiedLoan(); // UnifiedLoan |
+ try {
+ UnifiedLoanResult result = apiInstance.createUnifiedLoan(unifiedLoan);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#createUnifiedLoan");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **unifiedLoan** | [**UnifiedLoan**](UnifiedLoan.md)| |
+
+### Return type
+
+[**UnifiedLoanResult**](UnifiedLoanResult.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Operation successful | - |
+
+
+# **listUnifiedLoanRecords**
+> List<UnifiedLoanRecord> listUnifiedLoanRecords().type(type).currency(currency).page(page).limit(limit).execute();
+
+Query loan records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String type = "type_example"; // String | Loan record type: borrow - borrowing, repay - repayment
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ try {
+ List result = apiInstance.listUnifiedLoanRecords()
+ .type(type)
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#listUnifiedLoanRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **type** | **String**| Loan record type: borrow - borrowing, repay - repayment | [optional]
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+
+### Return type
+
+[**List<UnifiedLoanRecord>**](UnifiedLoanRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listUnifiedLoanInterestRecords**
+> List<UniLoanInterestRecord> listUnifiedLoanInterestRecords().currency(currency).page(page).limit(limit).from(from).to(to).type(type).execute();
+
+Query interest deduction records
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Query by specified currency name
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ Long from = 1627706330L; // Long | Start timestamp for the query
+ Long to = 1635329650L; // Long | End timestamp for the query, defaults to current time if not specified
+ String type = "platform"; // String | Loan type: platform borrowing - platform, margin borrowing - margin. Defaults to margin if not specified
+ try {
+ List result = apiInstance.listUnifiedLoanInterestRecords()
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .from(from)
+ .to(to)
+ .type(type)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#listUnifiedLoanInterestRecords");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Query by specified currency name | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+ **from** | **Long**| Start timestamp for the query | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **type** | **String**| Loan type: platform borrowing - platform, margin borrowing - margin. Defaults to margin if not specified | [optional]
+
+### Return type
+
+[**List<UniLoanInterestRecord>**](UniLoanInterestRecord.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUnifiedRiskUnits**
+> UnifiedRiskUnits getUnifiedRiskUnits()
+
+Get user risk unit details
+
+Get user risk unit details, only valid in portfolio margin mode
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ try {
+ UnifiedRiskUnits result = apiInstance.getUnifiedRiskUnits();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUnifiedRiskUnits");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**UnifiedRiskUnits**](UnifiedRiskUnits.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUnifiedMode**
+> UnifiedModeSet getUnifiedMode()
+
+Query mode of the unified account
+
+Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ try {
+ UnifiedModeSet result = apiInstance.getUnifiedMode();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUnifiedMode");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**UnifiedModeSet**](UnifiedModeSet.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **setUnifiedMode**
+> setUnifiedMode(unifiedModeSet)
+
+Set unified account mode
+
+Each account mode switch only requires passing the corresponding account mode parameter, and also supports turning on or off the configuration switches under the corresponding account mode during the switch. - When enabling the classic account mode, mode=classic ``` PUT /unified/unified_mode { \"mode\": \"classic\" } ``` - When enabling the cross-currency margin \"multi_currency\", \"settings\": { \"usdt_futures\": true } } ``` - When enabling the portfolio margin mode, mode=portfolio ``` PUT /unified/unified_mode { \"mode\": \"portfolio\", \"settings\": { \"spot_hedge\": true } } ``` - When enabling the single-currency margin mode, mode=single_currency ``` PUT /unified/unified_mode { \"mode\": \"single_currency\" } ```
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ UnifiedModeSet unifiedModeSet = new UnifiedModeSet(); // UnifiedModeSet |
+ try {
+ apiInstance.setUnifiedMode(unifiedModeSet);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#setUnifiedMode");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **unifiedModeSet** | [**UnifiedModeSet**](UnifiedModeSet.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Set successfully | - |
+
+
+# **getUnifiedEstimateRate**
+> Map<String, String> getUnifiedEstimateRate(currencies)
+
+Query unified account estimated interest rate
+
+Interest rates fluctuate hourly based on lending depth, so exact rates cannot be provided. When a currency is not supported, the interest rate returned will be an empty string
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ List currencies = Arrays.asList(); // List | Specify currency names for querying in an array, separated by commas, maximum 10 currencies
+ try {
+ Map result = apiInstance.getUnifiedEstimateRate(currencies);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUnifiedEstimateRate");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencies** | [**List<String>**](String.md)| Specify currency names for querying in an array, separated by commas, maximum 10 currencies |
+
+### Return type
+
+**Map<String, String>**
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listCurrencyDiscountTiers**
+> List<UnifiedDiscount> listCurrencyDiscountTiers()
+
+Query unified account tiered
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ try {
+ List result = apiInstance.listCurrencyDiscountTiers();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#listCurrencyDiscountTiers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<UnifiedDiscount>**](UnifiedDiscount.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **listLoanMarginTiers**
+> List<UnifiedMarginTiers> listLoanMarginTiers()
+
+Query unified account tiered loan margin
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ try {
+ List result = apiInstance.listLoanMarginTiers();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#listLoanMarginTiers");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<UnifiedMarginTiers>**](UnifiedMarginTiers.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **calculatePortfolioMargin**
+> UnifiedPortfolioOutput calculatePortfolioMargin(unifiedPortfolioInput)
+
+Portfolio margin calculator
+
+Portfolio Margin Calculator When inputting simulated position portfolios, each position includes the position name and quantity held, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. When inputting simulated orders, each order includes the market identifier, order price, and order quantity, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. Market orders are not included.
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ UnifiedPortfolioInput unifiedPortfolioInput = new UnifiedPortfolioInput(); // UnifiedPortfolioInput |
+ try {
+ UnifiedPortfolioOutput result = apiInstance.calculatePortfolioMargin(unifiedPortfolioInput);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#calculatePortfolioMargin");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **unifiedPortfolioInput** | [**UnifiedPortfolioInput**](UnifiedPortfolioInput.md)| |
+
+### Return type
+
+[**UnifiedPortfolioOutput**](UnifiedPortfolioOutput.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUserLeverageCurrencyConfig**
+> UnifiedLeverageConfig getUserLeverageCurrencyConfig(currency)
+
+Maximum and minimum currency leverage that can be set
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Currency
+ try {
+ UnifiedLeverageConfig result = apiInstance.getUserLeverageCurrencyConfig(currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUserLeverageCurrencyConfig");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency |
+
+### Return type
+
+[**UnifiedLeverageConfig**](UnifiedLeverageConfig.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getUserLeverageCurrencySetting**
+> List<UnifiedLeverageSetting> getUserLeverageCurrencySetting().currency(currency).execute();
+
+Get user currency leverage
+
+Get user currency leverage. If currency is not specified, query all currencies
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Currency
+ try {
+ List result = apiInstance.getUserLeverageCurrencySetting()
+ .currency(currency)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getUserLeverageCurrencySetting");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency | [optional]
+
+### Return type
+
+[**List<UnifiedLeverageSetting>**](UnifiedLeverageSetting.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **setUserLeverageCurrencySetting**
+> setUserLeverageCurrencySetting(unifiedLeverageSetting)
+
+Set loan currency leverage
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ UnifiedLeverageSetting unifiedLeverageSetting = new UnifiedLeverageSetting(); // UnifiedLeverageSetting |
+ try {
+ apiInstance.setUserLeverageCurrencySetting(unifiedLeverageSetting);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#setUserLeverageCurrencySetting");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **unifiedLeverageSetting** | [**UnifiedLeverageSetting**](UnifiedLeverageSetting.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Set successfully | - |
+
+
+# **listUnifiedCurrencies**
+> List<UnifiedCurrency> listUnifiedCurrencies().currency(currency).execute();
+
+List of loan currencies supported by unified account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "BTC"; // String | Currency
+ try {
+ List result = apiInstance.listUnifiedCurrencies()
+ .currency(currency)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#listUnifiedCurrencies");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency | [optional]
+
+### Return type
+
+[**List<UnifiedCurrency>**](UnifiedCurrency.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **getHistoryLoanRate**
+> UnifiedHistoryLoanRate getHistoryLoanRate(currency).tier(tier).page(page).limit(limit).execute();
+
+Get historical lending rates
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ String currency = "USDT"; // String | Currency
+ String tier = "1"; // String | VIP level for the floating rate to be queried
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ try {
+ UnifiedHistoryLoanRate result = apiInstance.getHistoryLoanRate(currency)
+ .tier(tier)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#getHistoryLoanRate");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency |
+ **tier** | **String**| VIP level for the floating rate to be queried | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+
+### Return type
+
+[**UnifiedHistoryLoanRate**](UnifiedHistoryLoanRate.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **setUnifiedCollateral**
+> UnifiedCollateralRes setUnifiedCollateral(unifiedCollateralReq)
+
+Set collateral currency
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.UnifiedApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ UnifiedApi apiInstance = new UnifiedApi(defaultClient);
+ UnifiedCollateralReq unifiedCollateralReq = new UnifiedCollateralReq(); // UnifiedCollateralReq |
+ try {
+ UnifiedCollateralRes result = apiInstance.setUnifiedCollateral(unifiedCollateralReq);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UnifiedApi#setUnifiedCollateral");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **unifiedCollateralReq** | [**UnifiedCollateralReq**](UnifiedCollateralReq.md)| |
+
+### Return type
+
+[**UnifiedCollateralRes**](UnifiedCollateralRes.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Updated successfully | - |
+
diff --git a/docs/UnifiedBalance.md b/docs/UnifiedBalance.md
new file mode 100644
index 0000000..f19915a
--- /dev/null
+++ b/docs/UnifiedBalance.md
@@ -0,0 +1,28 @@
+
+# UnifiedBalance
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**available** | **String** | Available balance, valid in single currency margin/cross-currency margin/combined margin mode, calculation varies by mode | [optional]
+**freeze** | **String** | Locked balance, valid in single currency margin/cross-currency margin/combined margin mode | [optional]
+**borrowed** | **String** | Borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**negativeLiab** | **String** | Negative balance borrowing, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**futuresPosLiab** | **String** | Contract opening position borrowing currency (abandoned, to be offline field) | [optional]
+**equity** | **String** | Equity, valid in single currency margin/cross currency margin/combined margin mode | [optional]
+**totalFreeze** | **String** | Total frozen (deprecated, to be removed) | [optional]
+**totalLiab** | **String** | Total borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional]
+**spotInUse** | **String** | The amount of spot hedging is valid in the combined margin mode, and is 0 in other margin modes such as single currency and cross-currency margin modes | [optional]
+**funding** | **String** | Uniloan financial management amount, effective when turned on as a unified account margin switch | [optional]
+**fundingVersion** | **String** | Funding version | [optional]
+**crossBalance** | **String** | Full margin balance is valid in single currency margin mode, and is 0 in other modes such as cross currency margin/combined margin mode | [optional]
+**isoBalance** | **String** | Isolated margin balance is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode | [optional]
+**im** | **String** | Full-position initial margin is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode | [optional]
+**mm** | **String** | Cross margin maintenance margin, valid in single-currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode | [optional]
+**imr** | **String** | Full-position initial margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode | [optional]
+**mmr** | **String** | Full-position maintenance margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode | [optional]
+**marginBalance** | **String** | Full margin balance is valid in single currency margin mode and is 0 in other modes such as cross currency margin/combined margin mode | [optional]
+**availableMargin** | **String** | Cross margin available balance, valid in single currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode | [optional]
+**enabledCollateral** | **Boolean** | Currency enabled as margin: true - Enabled, false - Disabled | [optional]
+
diff --git a/docs/CrossMarginBorrowable.md b/docs/UnifiedBorrowable.md
similarity index 90%
rename from docs/CrossMarginBorrowable.md
rename to docs/UnifiedBorrowable.md
index faec447..f23cf0a 100644
--- a/docs/CrossMarginBorrowable.md
+++ b/docs/UnifiedBorrowable.md
@@ -1,5 +1,5 @@
-# CrossMarginBorrowable
+# UnifiedBorrowable
## Properties
diff --git a/docs/MarginBorrowable.md b/docs/UnifiedBorrowable1.md
similarity index 54%
rename from docs/MarginBorrowable.md
rename to docs/UnifiedBorrowable1.md
index 0bdecc8..4401c4d 100644
--- a/docs/MarginBorrowable.md
+++ b/docs/UnifiedBorrowable1.md
@@ -1,11 +1,12 @@
-# MarginBorrowable
+# UnifiedBorrowable1
+
+Batch query unified account maximum borrowable results
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currency** | **String** | Currency detail | [optional]
-**currencyPair** | **String** | Currency pair | [optional]
-**amount** | **String** | Max borrowable amount | [optional]
+**amount** | **String** | Maximum borrowable amount | [optional]
diff --git a/docs/UnifiedCollateralReq.md b/docs/UnifiedCollateralReq.md
new file mode 100644
index 0000000..367f95d
--- /dev/null
+++ b/docs/UnifiedCollateralReq.md
@@ -0,0 +1,18 @@
+
+# UnifiedCollateralReq
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**collateralType** | [**CollateralTypeEnum**](#CollateralTypeEnum) | User-set collateral mode: 0(all)-All currencies as collateral, 1(custom)-Custom currencies as collateral. When collateral_type is 0(all), enable_list and disable_list parameters are invalid | [optional]
+**enableList** | **List<String>** | Currency list, where collateral_type=1(custom) indicates the addition logic | [optional]
+**disableList** | **List<String>** | Disable list, indicating the disable logic | [optional]
+
+## Enum: CollateralTypeEnum
+
+Name | Value
+---- | -----
+NUMBER_0 | 0
+NUMBER_1 | 1
+
diff --git a/docs/UnifiedCollateralRes.md b/docs/UnifiedCollateralRes.md
new file mode 100644
index 0000000..23b7c2a
--- /dev/null
+++ b/docs/UnifiedCollateralRes.md
@@ -0,0 +1,11 @@
+
+# UnifiedCollateralRes
+
+Unified account collateral mode settings response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**isSuccess** | **Boolean** | Whether the setting was successful | [optional]
+
diff --git a/docs/UnifiedCurrency.md b/docs/UnifiedCurrency.md
new file mode 100644
index 0000000..d941bfe
--- /dev/null
+++ b/docs/UnifiedCurrency.md
@@ -0,0 +1,14 @@
+
+# UnifiedCurrency
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Currency name | [optional]
+**prec** | **String** | Currency precision | [optional]
+**minBorrowAmount** | **String** | Minimum borrowable limit, in currency units | [optional]
+**userMaxBorrowAmount** | **String** | User's maximum borrowable limit, in USDT | [optional]
+**totalMaxBorrowAmount** | **String** | Platform's maximum borrowable limit, in USDT | [optional]
+**loanStatus** | **String** | Lending status - `disable` : Lending prohibited - `enable` : Lending supported | [optional]
+
diff --git a/docs/UnifiedDiscount.md b/docs/UnifiedDiscount.md
new file mode 100644
index 0000000..5e9b790
--- /dev/null
+++ b/docs/UnifiedDiscount.md
@@ -0,0 +1,12 @@
+
+# UnifiedDiscount
+
+Unified account tiered discount
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name | [optional]
+**discountTiers** | [**List<UnifiedDiscountTiers>**](UnifiedDiscountTiers.md) | Tiered discount | [optional]
+
diff --git a/docs/UnifiedDiscountTiers.md b/docs/UnifiedDiscountTiers.md
new file mode 100644
index 0000000..ab0ac91
--- /dev/null
+++ b/docs/UnifiedDiscountTiers.md
@@ -0,0 +1,13 @@
+
+# UnifiedDiscountTiers
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tier** | **String** | Tier | [optional]
+**discount** | **String** | Discount | [optional]
+**lowerLimit** | **String** | Lower limit | [optional]
+**upperLimit** | **String** | Upper limit, + indicates positive infinity | [optional]
+**leverage** | **String** | Position leverage | [optional]
+
diff --git a/docs/UnifiedHistoryLoanRate.md b/docs/UnifiedHistoryLoanRate.md
new file mode 100644
index 0000000..4be5ce0
--- /dev/null
+++ b/docs/UnifiedHistoryLoanRate.md
@@ -0,0 +1,12 @@
+
+# UnifiedHistoryLoanRate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name | [optional]
+**tier** | **String** | VIP level for the floating rate to be retrieved | [optional]
+**tierUpRate** | **String** | Floating rate corresponding to VIP level | [optional]
+**rates** | [**List<UnifiedHistoryLoanRateRates>**](UnifiedHistoryLoanRateRates.md) | Historical interest rate information, one data point per hour, array size determined by page and limit parameters from the API request, sorted by time from recent to distant | [optional]
+
diff --git a/docs/UnifiedHistoryLoanRateRates.md b/docs/UnifiedHistoryLoanRateRates.md
new file mode 100644
index 0000000..eeec610
--- /dev/null
+++ b/docs/UnifiedHistoryLoanRateRates.md
@@ -0,0 +1,10 @@
+
+# UnifiedHistoryLoanRateRates
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **Long** | Hourly timestamp corresponding to this interest rate, in milliseconds | [optional]
+**rate** | **String** | Historical interest rate for this hour | [optional]
+
diff --git a/docs/UnifiedLeverageConfig.md b/docs/UnifiedLeverageConfig.md
new file mode 100644
index 0000000..2bb44f2
--- /dev/null
+++ b/docs/UnifiedLeverageConfig.md
@@ -0,0 +1,15 @@
+
+# UnifiedLeverageConfig
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currentLeverage** | **String** | Current leverage ratio | [optional]
+**minLeverage** | **String** | Minimum adjustable leverage ratio | [optional]
+**maxLeverage** | **String** | Maximum adjustable leverage ratio | [optional]
+**debit** | **String** | Current liabilities | [optional]
+**availableMargin** | **String** | Available Margin | [optional]
+**borrowable** | **String** | Maximum borrowable amount at current leverage | [optional]
+**exceptLeverageBorrowable** | **String** | Maximum borrowable from margin and maximum borrowable from Earn, whichever is smaller | [optional]
+
diff --git a/docs/UnifiedLeverageSetting.md b/docs/UnifiedLeverageSetting.md
new file mode 100644
index 0000000..1f2e200
--- /dev/null
+++ b/docs/UnifiedLeverageSetting.md
@@ -0,0 +1,12 @@
+
+# UnifiedLeverageSetting
+
+Leverage multiplier for borrowing currency
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name |
+**leverage** | **String** | Multiplier |
+
diff --git a/docs/UnifiedLoan.md b/docs/UnifiedLoan.md
new file mode 100644
index 0000000..58564c0
--- /dev/null
+++ b/docs/UnifiedLoan.md
@@ -0,0 +1,22 @@
+
+# UnifiedLoan
+
+Borrow or repay
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency |
+**type** | [**TypeEnum**](#TypeEnum) | Type: `borrow` - borrow, `repay` - repay |
+**amount** | **String** | Borrow or repayment amount |
+**repaidAll** | **Boolean** | Full repayment, only used for repayment operations. When set to `true`, overrides `amount` and directly repays the full amount | [optional]
+**text** | **String** | User defined custom ID | [optional]
+
+## Enum: TypeEnum
+
+Name | Value
+---- | -----
+BORROW | "borrow"
+REPAY | "repay"
+
diff --git a/docs/UnifiedLoanRecord.md b/docs/UnifiedLoanRecord.md
new file mode 100644
index 0000000..2b88b30
--- /dev/null
+++ b/docs/UnifiedLoanRecord.md
@@ -0,0 +1,18 @@
+
+# UnifiedLoanRecord
+
+Borrowing Records
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | ID | [optional] [readonly]
+**type** | **String** | Type: `borrow` - borrow, `repay` - repay | [optional] [readonly]
+**repaymentType** | **String** | Repayment type: none - No repayment type, manual_repay - Manual repayment, auto_repay - Automatic repayment, cancel_auto_repay - Automatic repayment after order cancellation, different_currencies_repayment - Cross-currency repayment | [optional] [readonly]
+**borrowType** | **String** | Borrowing type, returned when querying loan records: manual_borrow - Manual borrowing, auto_borrow - Automatic borrowing | [optional]
+**currencyPair** | **String** | Currency pair | [optional] [readonly]
+**currency** | **String** | Currency | [optional] [readonly]
+**amount** | **String** | Borrow or repayment amount | [optional] [readonly]
+**createTime** | **Long** | Created time | [optional] [readonly]
+
diff --git a/docs/UnifiedLoanResult.md b/docs/UnifiedLoanResult.md
new file mode 100644
index 0000000..938be13
--- /dev/null
+++ b/docs/UnifiedLoanResult.md
@@ -0,0 +1,11 @@
+
+# UnifiedLoanResult
+
+Unified account borrowing and repayment response result
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tranId** | **Long** | Transaction ID | [optional]
+
diff --git a/docs/UnifiedMarginTiers.md b/docs/UnifiedMarginTiers.md
new file mode 100644
index 0000000..2c4ab10
--- /dev/null
+++ b/docs/UnifiedMarginTiers.md
@@ -0,0 +1,12 @@
+
+# UnifiedMarginTiers
+
+Unified account borrowing margin tiers
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **String** | Currency name | [optional]
+**marginTiers** | [**List<MarginTiers>**](MarginTiers.md) | Tiered margin | [optional]
+
diff --git a/docs/UnifiedModeSet.md b/docs/UnifiedModeSet.md
new file mode 100644
index 0000000..13ba0fa
--- /dev/null
+++ b/docs/UnifiedModeSet.md
@@ -0,0 +1,10 @@
+
+# UnifiedModeSet
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mode** | **String** | Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode |
+**settings** | [**UnifiedSettings**](UnifiedSettings.md) | | [optional]
+
diff --git a/docs/UnifiedPortfolioInput.md b/docs/UnifiedPortfolioInput.md
new file mode 100644
index 0000000..78bb520
--- /dev/null
+++ b/docs/UnifiedPortfolioInput.md
@@ -0,0 +1,17 @@
+
+# UnifiedPortfolioInput
+
+Portfolio margin calculator input
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**spotBalances** | [**List<MockSpotBalance>**](MockSpotBalance.md) | Spot | [optional]
+**spotOrders** | [**List<MockSpotOrder>**](MockSpotOrder.md) | Spot orders | [optional]
+**futuresPositions** | [**List<MockFuturesPosition>**](MockFuturesPosition.md) | Futures positions | [optional]
+**futuresOrders** | [**List<MockFuturesOrder>**](MockFuturesOrder.md) | Futures order | [optional]
+**optionsPositions** | [**List<MockOptionsPosition>**](MockOptionsPosition.md) | Options positions | [optional]
+**optionsOrders** | [**List<MockOptionsOrder>**](MockOptionsOrder.md) | Option orders | [optional]
+**spotHedge** | **Boolean** | Whether to enable spot hedging | [optional]
+
diff --git a/docs/UnifiedPortfolioOutput.md b/docs/UnifiedPortfolioOutput.md
new file mode 100644
index 0000000..d6fc162
--- /dev/null
+++ b/docs/UnifiedPortfolioOutput.md
@@ -0,0 +1,14 @@
+
+# UnifiedPortfolioOutput
+
+Portfolio margin calculator output
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**maintainMarginTotal** | **String** | Total maintenance margin, including only portfolio margin calculation results for positions in risk units, excluding borrowing margin. If borrowing exists, conventional borrowing margin requirements will still apply | [optional]
+**initialMarginTotal** | **String** | Total initial margin, calculated as the maximum of the following three combinations: position, position + positive delta orders, position + negative delta orders | [optional]
+**calculateTime** | **Long** | Calculation time | [optional]
+**riskUnit** | [**List<MockRiskUnit>**](MockRiskUnit.md) | Risk unit | [optional]
+
diff --git a/docs/UnifiedRiskUnits.md b/docs/UnifiedRiskUnits.md
new file mode 100644
index 0000000..f64d09e
--- /dev/null
+++ b/docs/UnifiedRiskUnits.md
@@ -0,0 +1,11 @@
+
+# UnifiedRiskUnits
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userId** | **Long** | User ID | [optional]
+**spotHedge** | **Boolean** | Spot hedging status: true - enabled, false - disabled | [optional]
+**riskUnits** | [**List<RiskUnits>**](RiskUnits.md) | Risk unit | [optional]
+
diff --git a/docs/UnifiedSettings.md b/docs/UnifiedSettings.md
new file mode 100644
index 0000000..8c56c9a
--- /dev/null
+++ b/docs/UnifiedSettings.md
@@ -0,0 +1,12 @@
+
+# UnifiedSettings
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**usdtFutures** | **Boolean** | USDT futures switch. In cross-currency margin mode, can only be enabled and cannot be disabled | [optional]
+**spotHedge** | **Boolean** | Spot hedging switch | [optional]
+**useFunding** | **Boolean** | Earn switch, when mode is cross-currency margin mode, whether to use Earn funds as margin | [optional]
+**options** | **Boolean** | Options switch. In cross-currency margin mode, can only be enabled and cannot be disabled | [optional]
+
diff --git a/docs/CrossMarginTransferable.md b/docs/UnifiedTransferable.md
similarity index 65%
rename from docs/CrossMarginTransferable.md
rename to docs/UnifiedTransferable.md
index ba551b9..23e6b01 100644
--- a/docs/CrossMarginTransferable.md
+++ b/docs/UnifiedTransferable.md
@@ -1,10 +1,10 @@
-# CrossMarginTransferable
+# UnifiedTransferable
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currency** | **String** | Currency detail | [optional]
-**amount** | **String** | Max transferable amount | [optional]
+**amount** | **String** | Maximum transferable amount | [optional]
diff --git a/docs/UserLtvInfo.md b/docs/UserLtvInfo.md
new file mode 100644
index 0000000..0298471
--- /dev/null
+++ b/docs/UserLtvInfo.md
@@ -0,0 +1,17 @@
+
+# UserLtvInfo
+
+User's currency statistics data
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**collateralCurrency** | **String** | Collateral currency | [optional]
+**borrowCurrency** | **String** | Borrowed currency | [optional]
+**initLtv** | **String** | Initial collateralization rate | [optional]
+**alertLtv** | **String** | Warning collateralization rate | [optional]
+**liquidateLtv** | **String** | Liquidation collateralization rate | [optional]
+**minBorrowAmount** | **String** | Minimum borrowable amount for the loan currency | [optional]
+**leftBorrowableAmount** | **String** | Remaining borrowable amount for the loan currency | [optional]
+
diff --git a/docs/UserSub.md b/docs/UserSub.md
new file mode 100644
index 0000000..4ebec41
--- /dev/null
+++ b/docs/UserSub.md
@@ -0,0 +1,12 @@
+
+# UserSub
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uid** | **Long** | User ID | [optional]
+**belong** | **String** | User's system affiliation (partner/referral). Empty means not belonging to any system | [optional]
+**type** | **Long** | Type (0-Not in system 1-Direct subordinate agent 2-Indirect subordinate agent 3-Direct direct customer 4-Indirect direct customer 5-Regular user) | [optional]
+**refUid** | **Long** | Inviter user ID | [optional]
+
diff --git a/docs/UserSubRelation.md b/docs/UserSubRelation.md
new file mode 100644
index 0000000..5a2eb51
--- /dev/null
+++ b/docs/UserSubRelation.md
@@ -0,0 +1,9 @@
+
+# UserSubRelation
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**list** | [**List<UserSub>**](UserSub.md) | Subordinate relationship list | [optional]
+
diff --git a/docs/UserTotalAmount.md b/docs/UserTotalAmount.md
new file mode 100644
index 0000000..0dfe968
--- /dev/null
+++ b/docs/UserTotalAmount.md
@@ -0,0 +1,12 @@
+
+# UserTotalAmount
+
+User's total borrowing and collateral amount
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**borrowAmount** | **String** | Total borrowing amount in USDT | [optional]
+**collateralAmount** | **String** | Total collateral amount in USDT | [optional]
+
diff --git a/docs/WalletApi.md b/docs/WalletApi.md
index a688520..1fedfb4 100644
--- a/docs/WalletApi.md
+++ b/docs/WalletApi.md
@@ -4,17 +4,92 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
Method | HTTP request | Description
------------- | ------------- | -------------
+[**listCurrencyChains**](WalletApi.md#listCurrencyChains) | **GET** /wallet/currency_chains | Query chains supported for specified currency
[**getDepositAddress**](WalletApi.md#getDepositAddress) | **GET** /wallet/deposit_address | Generate currency deposit address
-[**listWithdrawals**](WalletApi.md#listWithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records
-[**listDeposits**](WalletApi.md#listDeposits) | **GET** /wallet/deposits | Retrieve deposit records
+[**listWithdrawals**](WalletApi.md#listWithdrawals) | **GET** /wallet/withdrawals | Get withdrawal records
+[**listDeposits**](WalletApi.md#listDeposits) | **GET** /wallet/deposits | Get deposit records
[**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
+[**listSubAccountTransfers**](WalletApi.md#listSubAccountTransfers) | **GET** /wallet/sub_account_transfers | Get transfer records between main and sub accounts
[**transferWithSubAccount**](WalletApi.md#transferWithSubAccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts
-[**listWithdrawStatus**](WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status
-[**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances
-[**getTradeFee**](WalletApi.md#getTradeFee) | **GET** /wallet/fee | Retrieve personal trading fee
-[**getTotalBalance**](WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Retrieve user's total balances
+[**subAccountToSubAccount**](WalletApi.md#subAccountToSubAccount) | **POST** /wallet/sub_account_to_sub_account | Transfer between sub-accounts
+[**getTransferOrderStatus**](WalletApi.md#getTransferOrderStatus) | **GET** /wallet/order_status | Transfer status query
+[**listWithdrawStatus**](WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Query withdrawal status
+[**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Query sub-account balance information
+[**listSubAccountMarginBalances**](WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub-account isolated margin account balance information
+[**listSubAccountFuturesBalances**](WalletApi.md#listSubAccountFuturesBalances) | **GET** /wallet/sub_account_futures_balances | Query sub-account perpetual futures account balance information
+[**listSubAccountCrossMarginBalances**](WalletApi.md#listSubAccountCrossMarginBalances) | **GET** /wallet/sub_account_cross_margin_balances | Query sub-account cross margin account balance information
+[**listSavedAddress**](WalletApi.md#listSavedAddress) | **GET** /wallet/saved_address | Query withdrawal address whitelist
+[**getTradeFee**](WalletApi.md#getTradeFee) | **GET** /wallet/fee | Query personal trading fees
+[**getTotalBalance**](WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Query personal account totals
+[**listSmallBalance**](WalletApi.md#listSmallBalance) | **GET** /wallet/small_balance | Get list of convertible small balance currencies
+[**convertSmallBalance**](WalletApi.md#convertSmallBalance) | **POST** /wallet/small_balance | Convert small balance currency
+[**listSmallBalanceHistory**](WalletApi.md#listSmallBalanceHistory) | **GET** /wallet/small_balance_history | Get convertible small balance currency history
+[**listPushOrders**](WalletApi.md#listPushOrders) | **GET** /wallet/push | Get UID transfer history
+
+
+
+# **listCurrencyChains**
+> List<CurrencyChain> listCurrencyChains(currency)
+
+Query chains supported for specified currency
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ String currency = "GT"; // String | Currency name
+ try {
+ List result = apiInstance.listCurrencyChains(currency);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#listCurrencyChains");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency name |
+
+### Return type
+
+[**List<CurrencyChain>**](CurrencyChain.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
# **getDepositAddress**
@@ -86,11 +161,11 @@ Name | Type | Description | Notes
# **listWithdrawals**
-> List<LedgerRecord> listWithdrawals().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();
+> List<WithdrawalRecord> listWithdrawals().currency(currency).withdrawId(withdrawId).assetClass(assetClass).withdrawOrderId(withdrawOrderId).from(from).to(to).limit(limit).offset(offset).execute();
-Retrieve withdrawal records
+Get withdrawal records
-Record time range cannot exceed 30 days
+Record query time range cannot exceed 30 days
### Example
@@ -113,14 +188,20 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApi apiInstance = new WalletApi(defaultClient);
- String currency = "BTC"; // String | Filter by currency. Return all currency records if not specified
- Long from = 1602120000L; // Long | Time range beginning, default to 7 days before current time
- Long to = 1602123600L; // Long | Time range ending, default to current time
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String currency = "BTC"; // String | Specify the currency. If not specified, returns all currencies
+ String withdrawId = "withdrawId_example"; // String | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled
+ String assetClass = "assetClass_example"; // String | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone
+ String withdrawOrderId = "withdrawOrderId_example"; // String | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried
+ Long from = 1602120000L; // Long | Start time for querying records, defaults to 7 days before current time if not specified
+ Long to = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
try {
- List result = apiInstance.listWithdrawals()
+ List result = apiInstance.listWithdrawals()
.currency(currency)
+ .withdrawId(withdrawId)
+ .assetClass(assetClass)
+ .withdrawOrderId(withdrawOrderId)
.from(from)
.to(to)
.limit(limit)
@@ -144,15 +225,18 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| Filter by currency. Return all currency records if not specified | [optional]
- **from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
- **to** | **Long**| Time range ending, default to current time | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **currency** | **String**| Specify the currency. If not specified, returns all currencies | [optional]
+ **withdrawId** | **String**| Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled | [optional]
+ **assetClass** | **String**| Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone | [optional]
+ **withdrawOrderId** | **String**| User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried | [optional]
+ **from** | **Long**| Start time for querying records, defaults to 7 days before current time if not specified | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
-[**List<LedgerRecord>**](LedgerRecord.md)
+[**List<WithdrawalRecord>**](WithdrawalRecord.md)
### Authorization
@@ -166,15 +250,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listDeposits**
-> List<LedgerRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();
+> List<DepositRecord> listDeposits().currency(currency).from(from).to(to).limit(limit).offset(offset).execute();
-Retrieve deposit records
+Get deposit records
-Record time range cannot exceed 30 days
+Record query time range cannot exceed 30 days
### Example
@@ -197,13 +281,13 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApi apiInstance = new WalletApi(defaultClient);
- String currency = "BTC"; // String | Filter by currency. Return all currency records if not specified
- Long from = 1602120000L; // Long | Time range beginning, default to 7 days before current time
- Long to = 1602123600L; // Long | Time range ending, default to current time
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String currency = "BTC"; // String | Specify the currency. If not specified, returns all currencies
+ Long from = 1602120000L; // Long | Start time for querying records, defaults to 7 days before current time if not specified
+ Long to = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer limit = 100; // Integer | Maximum number of entries returned in the list, limited to 500 transactions
Integer offset = 0; // Integer | List offset, starting from 0
try {
- List result = apiInstance.listDeposits()
+ List result = apiInstance.listDeposits()
.currency(currency)
.from(from)
.to(to)
@@ -228,15 +312,15 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| Filter by currency. Return all currency records if not specified | [optional]
- **from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
- **to** | **Long**| Time range ending, default to current time | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **currency** | **String**| Specify the currency. If not specified, returns all currencies | [optional]
+ **from** | **Long**| Start time for querying records, defaults to 7 days before current time if not specified | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **limit** | **Integer**| Maximum number of entries returned in the list, limited to 500 transactions | [optional] [default to 100]
**offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
-[**List<LedgerRecord>**](LedgerRecord.md)
+[**List<DepositRecord>**](DepositRecord.md)
### Authorization
@@ -250,15 +334,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **transfer**
-> transfer(transfer)
+> TransactionID transfer(transfer)
Transfer between trading accounts
-Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin
+Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account
### Example
@@ -283,7 +367,8 @@ public class Example {
WalletApi apiInstance = new WalletApi(defaultClient);
Transfer transfer = new Transfer(); // Transfer |
try {
- apiInstance.transfer(transfer);
+ TransactionID result = apiInstance.transfer(transfer);
+ System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
@@ -305,7 +390,7 @@ Name | Type | Description | Notes
### Return type
-null (empty response body)
+[**TransactionID**](TransactionID.md)
### Authorization
@@ -314,20 +399,20 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: Not defined
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**204** | Balance transferred | - |
+**200** | Transfer operation successful | - |
# **listSubAccountTransfers**
-> List<SubAccountTransfer> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();
+> List<SubAccountTransferRecordItem> listSubAccountTransfers().subUid(subUid).from(from).to(to).limit(limit).offset(offset).execute();
-Retrieve transfer records between main and sub accounts
+Get transfer records between main and sub accounts
-Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved
+Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved
### Example
@@ -350,13 +435,13 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApi apiInstance = new WalletApi(defaultClient);
- String subUid = "10003"; // String | Sub account user ID. Return records related to all sub accounts if not specified
- Long from = 1602120000L; // Long | Time range beginning, default to 7 days before current time
- Long to = 1602123600L; // Long | Time range ending, default to current time
- Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
+ String subUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts
+ Long from = 1602120000L; // Long | Start time for querying records, defaults to 7 days before current time if not specified
+ Long to = 1602123600L; // Long | End timestamp for the query, defaults to current time if not specified
+ Integer limit = 100; // Integer | Maximum number of records returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
try {
- List result = apiInstance.listSubAccountTransfers()
+ List result = apiInstance.listSubAccountTransfers()
.subUid(subUid)
.from(from)
.to(to)
@@ -381,15 +466,15 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **subUid** | **String**| Sub account user ID. Return records related to all sub accounts if not specified | [optional]
- **from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
- **to** | **Long**| Time range ending, default to current time | [optional]
- **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
+ **subUid** | **String**| Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts | [optional]
+ **from** | **Long**| Start time for querying records, defaults to 7 days before current time if not specified | [optional]
+ **to** | **Long**| End timestamp for the query, defaults to current time if not specified | [optional]
+ **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100]
**offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
### Return type
-[**List<SubAccountTransfer>**](SubAccountTransfer.md)
+[**List<SubAccountTransferRecordItem>**](SubAccountTransferRecordItem.md)
### Authorization
@@ -403,15 +488,15 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **transferWithSubAccount**
-> transferWithSubAccount(subAccountTransfer)
+> TransactionID transferWithSubAccount(subAccountTransfer)
Transfer between main and sub accounts
-Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated.
+Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used
### Example
@@ -436,7 +521,8 @@ public class Example {
WalletApi apiInstance = new WalletApi(defaultClient);
SubAccountTransfer subAccountTransfer = new SubAccountTransfer(); // SubAccountTransfer |
try {
- apiInstance.transferWithSubAccount(subAccountTransfer);
+ TransactionID result = apiInstance.transferWithSubAccount(subAccountTransfer);
+ System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
@@ -458,7 +544,7 @@ Name | Type | Description | Notes
### Return type
-null (empty response body)
+[**TransactionID**](TransactionID.md)
### Authorization
@@ -467,18 +553,163 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- - **Accept**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Transfer operation successful | - |
+
+
+# **subAccountToSubAccount**
+> TransactionID subAccountToSubAccount(subAccountToSubAccount)
+
+Transfer between sub-accounts
+
+Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ SubAccountToSubAccount subAccountToSubAccount = new SubAccountToSubAccount(); // SubAccountToSubAccount |
+ try {
+ TransactionID result = apiInstance.subAccountToSubAccount(subAccountToSubAccount);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#subAccountToSubAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **subAccountToSubAccount** | [**SubAccountToSubAccount**](SubAccountToSubAccount.md)| |
+
+### Return type
+
+[**TransactionID**](TransactionID.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Transfer operation successful | - |
+
+
+# **getTransferOrderStatus**
+> TransferOrderStatus getTransferOrderStatus().clientOrderId(clientOrderId).txId(txId).execute();
+
+Transfer status query
+
+Supports querying transfer status based on user-defined client_order_id or tx_id returned by the transfer interface
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ String clientOrderId = "da3ce7a088c8b0372b741419c7829033"; // String | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters
+ String txId = "59636381286"; // String | Transfer operation number, cannot be empty at the same time as client_order_id
+ try {
+ TransferOrderStatus result = apiInstance.getTransferOrderStatus()
+ .clientOrderId(clientOrderId)
+ .txId(txId)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#getTransferOrderStatus");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **clientOrderId** | **String**| Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters | [optional]
+ **txId** | **String**| Transfer operation number, cannot be empty at the same time as client_order_id | [optional]
+
+### Return type
+
+[**TransferOrderStatus**](TransferOrderStatus.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**204** | Balance transferred | - |
+**200** | Transfer status retrieved successfully | - |
# **listWithdrawStatus**
> List<WithdrawStatus> listWithdrawStatus().currency(currency).execute();
-Retrieve withdrawal status
+Query withdrawal status
### Example
@@ -501,7 +732,7 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApi apiInstance = new WalletApi(defaultClient);
- String currency = "BTC"; // String | Retrieve data of the specified currency
+ String currency = "BTC"; // String | Query by specified currency name
try {
List result = apiInstance.listWithdrawStatus()
.currency(currency)
@@ -524,7 +755,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| Retrieve data of the specified currency | [optional]
+ **currency** | **String**| Query by specified currency name | [optional]
### Return type
@@ -542,13 +773,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
# **listSubAccountBalances**
> List<SubAccountBalance> listSubAccountBalances().subUid(subUid).execute();
-Retrieve sub account balances
+Query sub-account balance information
### Example
@@ -571,7 +802,7 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApi apiInstance = new WalletApi(defaultClient);
- String subUid = "10003"; // String | Sub account user ID. Return records related to all sub accounts if not specified
+ String subUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts
try {
List result = apiInstance.listSubAccountBalances()
.subUid(subUid)
@@ -594,7 +825,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **subUid** | **String**| Sub account user ID. Return records related to all sub accounts if not specified | [optional]
+ **subUid** | **String**| Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts | [optional]
### Return type
@@ -612,13 +843,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | List retrieved | - |
+**200** | List retrieved successfully | - |
-
-# **getTradeFee**
-> TradeFee getTradeFee().currencyPair(currencyPair).execute();
+
+# **listSubAccountMarginBalances**
+> List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute();
-Retrieve personal trading fee
+Query sub-account isolated margin account balance information
### Example
@@ -641,17 +872,17 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApi apiInstance = new WalletApi(defaultClient);
- String 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
+ String subUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts
try {
- TradeFee result = apiInstance.getTradeFee()
- .currencyPair(currencyPair)
+ List result = apiInstance.listSubAccountMarginBalances()
+ .subUid(subUid)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling WalletApi#getTradeFee");
+ System.err.println("Exception when calling WalletApi#listSubAccountMarginBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -664,11 +895,11 @@ public class Example {
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]
+ **subUid** | **String**| Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts | [optional]
### Return type
-[**TradeFee**](TradeFee.md)
+[**List<SubAccountMarginBalance>**](SubAccountMarginBalance.md)
### Authorization
@@ -682,13 +913,13 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Successfully retrieved | - |
+**200** | List retrieved successfully | - |
-
-# **getTotalBalance**
-> TotalBalance getTotalBalance().currency(currency).execute();
+
+# **listSubAccountFuturesBalances**
+> List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute();
-Retrieve user's total balances
+Query sub-account perpetual futures account balance information
### Example
@@ -711,17 +942,19 @@ public class Example {
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
WalletApi apiInstance = new WalletApi(defaultClient);
- String currency = "\"USDT\""; // String | Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default.
+ String subUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts
+ String settle = "usdt"; // String | Query balance of specified settlement currency
try {
- TotalBalance result = apiInstance.getTotalBalance()
- .currency(currency)
+ List result = apiInstance.listSubAccountFuturesBalances()
+ .subUid(subUid)
+ .settle(settle)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
- System.err.println("Exception when calling WalletApi#getTotalBalance");
+ System.err.println("Exception when calling WalletApi#listSubAccountFuturesBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
@@ -734,11 +967,597 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **currency** | **String**| Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. | [optional] [default to "USDT"]
+ **subUid** | **String**| Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts | [optional]
+ **settle** | **String**| Query balance of specified settlement currency | [optional]
### Return type
-[**TotalBalance**](TotalBalance.md)
+[**List<SubAccountFuturesBalance>**](SubAccountFuturesBalance.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **listSubAccountCrossMarginBalances**
+> List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute();
+
+Query sub-account cross margin account balance information
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ String subUid = "10003"; // String | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts
+ try {
+ List result = apiInstance.listSubAccountCrossMarginBalances()
+ .subUid(subUid)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#listSubAccountCrossMarginBalances");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **subUid** | **String**| Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts | [optional]
+
+### Return type
+
+[**List<SubAccountCrossMarginBalance>**](SubAccountCrossMarginBalance.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **listSavedAddress**
+> List<SavedAddress> listSavedAddress(currency).chain(chain).limit(limit).page(page).execute();
+
+Query withdrawal address whitelist
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ String currency = "USDT"; // String | Currency
+ String chain = "\"\""; // String | Chain name
+ String limit = "\"50\""; // String | Maximum number returned, up to 100
+ Integer page = 1; // Integer | Page number
+ try {
+ List result = apiInstance.listSavedAddress(currency)
+ .chain(chain)
+ .limit(limit)
+ .page(page)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#listSavedAddress");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency |
+ **chain** | **String**| Chain name | [optional] [default to ""]
+ **limit** | **String**| Maximum number returned, up to 100 | [optional] [default to "50"]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+
+### Return type
+
+[**List<SavedAddress>**](SavedAddress.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | List retrieved successfully | - |
+
+
+# **getTradeFee**
+> TradeFee getTradeFee().currencyPair(currencyPair).settle(settle).execute();
+
+Query personal trading fees
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ String currencyPair = "BTC_USDT"; // String | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs.
+ String settle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same.
+ try {
+ TradeFee result = apiInstance.getTradeFee()
+ .currencyPair(currencyPair)
+ .settle(settle)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#getTradeFee");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currencyPair** | **String**| Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. | [optional]
+ **settle** | **String**| Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same. | [optional] [enum: BTC, USDT, USD]
+
+### Return type
+
+[**TradeFee**](TradeFee.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Query successful | - |
+
+
+# **getTotalBalance**
+> TotalBalance getTotalBalance().currency(currency).execute();
+
+Query personal account totals
+
+This query endpoint returns the total *estimated value* of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ String currency = "\"USDT\""; // String | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value
+ try {
+ TotalBalance result = apiInstance.getTotalBalance()
+ .currency(currency)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#getTotalBalance");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value | [optional] [default to "USDT"]
+
+### Return type
+
+[**TotalBalance**](TotalBalance.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Request is valid and successfully returned | - |
+
+
+# **listSmallBalance**
+> List<SmallBalance> listSmallBalance()
+
+Get list of convertible small balance currencies
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ try {
+ List result = apiInstance.listSmallBalance();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#listSmallBalance");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<SmallBalance>**](SmallBalance.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+
+# **convertSmallBalance**
+> convertSmallBalance(convertSmallBalance)
+
+Convert small balance currency
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ ConvertSmallBalance convertSmallBalance = new ConvertSmallBalance(); // ConvertSmallBalance |
+ try {
+ apiInstance.convertSmallBalance(convertSmallBalance);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#convertSmallBalance");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **convertSmallBalance** | [**ConvertSmallBalance**](ConvertSmallBalance.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+
+# **listSmallBalanceHistory**
+> List<SmallBalanceHistory> listSmallBalanceHistory().currency(currency).page(page).limit(limit).execute();
+
+Get convertible small balance currency history
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ String currency = "currency_example"; // String | Currency to convert
+ Integer page = 1; // Integer | Page number
+ Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
+ try {
+ List result = apiInstance.listSmallBalanceHistory()
+ .currency(currency)
+ .page(page)
+ .limit(limit)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#listSmallBalanceHistory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **currency** | **String**| Currency to convert | [optional]
+ **page** | **Integer**| Page number | [optional] [default to 1]
+ **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100]
+
+### Return type
+
+[**List<SmallBalanceHistory>**](SmallBalanceHistory.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+
+# **listPushOrders**
+> List<UidPushOrder> listPushOrders().id(id).from(from).to(to).limit(limit).offset(offset).transactionType(transactionType).execute();
+
+Get UID transfer history
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WalletApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WalletApi apiInstance = new WalletApi(defaultClient);
+ Integer id = 56; // Integer | Order ID
+ Integer from = 56; // Integer | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds
+ Integer to = 56; // Integer | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds
+ Integer limit = 100; // Integer | Maximum number of items returned in the list, default value is 100
+ Integer offset = 0; // Integer | List offset, starting from 0
+ String transactionType = "\"withdraw\""; // String | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`.
+ try {
+ List result = apiInstance.listPushOrders()
+ .id(id)
+ .from(from)
+ .to(to)
+ .limit(limit)
+ .offset(offset)
+ .transactionType(transactionType)
+ .execute();
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WalletApi#listPushOrders");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **Integer**| Order ID | [optional]
+ **from** | **Integer**| Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds | [optional]
+ **to** | **Integer**| End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds | [optional]
+ **limit** | **Integer**| Maximum number of items returned in the list, default value is 100 | [optional] [default to 100]
+ **offset** | **Integer**| List offset, starting from 0 | [optional] [default to 0]
+ **transactionType** | **String**| Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. | [optional] [default to "withdraw"]
+
+### Return type
+
+[**List<UidPushOrder>**](UidPushOrder.md)
### Authorization
@@ -752,5 +1571,5 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**200** | Request is valid and is successfully responded | - |
+**200** | Success | - |
diff --git a/docs/WithdrawStatus.md b/docs/WithdrawStatus.md
index f4def17..8ae61da 100644
--- a/docs/WithdrawStatus.md
+++ b/docs/WithdrawStatus.md
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**currency** | **String** | Currency | [optional]
**name** | **String** | Currency name | [optional]
**nameCn** | **String** | Currency Chinese name | [optional]
-**deposit** | **String** | Deposits fee | [optional]
+**deposit** | **String** | Deposit fee | [optional]
**withdrawPercent** | **String** | Withdrawal fee rate percentage | [optional]
**withdrawFix** | **String** | Fixed withdrawal fee | [optional]
**withdrawDayLimit** | **String** | Daily allowed withdrawal amount | [optional]
@@ -16,4 +16,5 @@ Name | Type | Description | Notes
**withdrawDayLimitRemain** | **String** | Daily withdrawal amount left | [optional]
**withdrawEachtimeLimit** | **String** | Maximum amount for each withdrawal | [optional]
**withdrawFixOnChains** | **Map<String, String>** | Fixed withdrawal fee on multiple chains | [optional]
+**withdrawPercentOnChains** | **Map<String, String>** | Percentage withdrawal fee on multiple chains | [optional]
diff --git a/docs/WithdrawalApi.md b/docs/WithdrawalApi.md
index 4ed229b..167f992 100644
--- a/docs/WithdrawalApi.md
+++ b/docs/WithdrawalApi.md
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
Method | HTTP request | Description
------------- | ------------- | -------------
[**withdraw**](WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw
+[**withdrawPushOrder**](WithdrawalApi.md#withdrawPushOrder) | **POST** /withdrawals/push | UID transfer
[**cancelWithdrawal**](WithdrawalApi.md#cancelWithdrawal) | **DELETE** /withdrawals/{withdrawal_id} | Cancel withdrawal with specified ID
@@ -14,6 +15,8 @@ Method | HTTP request | Description
Withdraw
+If the recipient's on-chain address is also Gate, no transaction fee will be charged
+
### Example
```java
@@ -74,7 +77,77 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**202** | Withdraw request is accepted. Refer to withdrawal records for status | - |
+**200** | Withdrawal request accepted. Check withdrawal record status for processing result | - |
+
+
+# **withdrawPushOrder**
+> UidPushWithdrawalResp withdrawPushOrder(uidPushWithdrawal)
+
+UID transfer
+
+Transfers between main spot accounts. Both parties cannot be sub-accounts
+
+### Example
+
+```java
+// Import classes:
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.GateApiException;
+import io.gate.gateapi.auth.*;
+import io.gate.gateapi.models.*;
+import io.gate.gateapi.api.WithdrawalApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.gateio.ws/api/v4");
+
+ // Configure APIv4 authorization: apiv4
+ defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
+
+ WithdrawalApi apiInstance = new WithdrawalApi(defaultClient);
+ UidPushWithdrawal uidPushWithdrawal = new UidPushWithdrawal(); // UidPushWithdrawal |
+ try {
+ UidPushWithdrawalResp result = apiInstance.withdrawPushOrder(uidPushWithdrawal);
+ System.out.println(result);
+ } catch (GateApiException e) {
+ System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
+ e.printStackTrace();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WithdrawalApi#withdrawPushOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **uidPushWithdrawal** | [**UidPushWithdrawal**](UidPushWithdrawal.md)| |
+
+### Return type
+
+[**UidPushWithdrawalResp**](UidPushWithdrawalResp.md)
+
+### Authorization
+
+[apiv4](../README.md#apiv4)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Request accepted. Check withdrawal record status for processing result | - |
# **cancelWithdrawal**
@@ -142,5 +215,5 @@ Name | Type | Description | Notes
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-**202** | Cancellation accepted. Refer to record status for the cancellation result | - |
+**202** | Cancellation request accepted. Check record status for cancellation result | - |
diff --git a/docs/WithdrawalRecord.md b/docs/WithdrawalRecord.md
new file mode 100644
index 0000000..58247a8
--- /dev/null
+++ b/docs/WithdrawalRecord.md
@@ -0,0 +1,22 @@
+
+# WithdrawalRecord
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **String** | Record ID | [optional] [readonly]
+**txid** | **String** | Hash record of the withdrawal | [optional] [readonly]
+**blockNumber** | **String** | Block Number | [optional] [readonly]
+**withdrawOrderId** | **String** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional]
+**timestamp** | **String** | Operation time | [optional] [readonly]
+**amount** | **String** | Token amount |
+**fee** | **String** | fee | [optional] [readonly]
+**currency** | **String** | Currency name |
+**address** | **String** | Withdrawal address | [optional]
+**failReason** | **String** | Reason for withdrawal failure. Has a value when status = CANCEL, empty for all other statuses | [optional]
+**timestamp2** | **String** | Withdrawal final time, i.e.: withdrawal cancellation time or withdrawal success time When status = CANCEL, corresponds to cancellation time When status = DONE and block_number > 0, it is the withdrawal success time | [optional]
+**memo** | **String** | Additional remarks with regards to the withdrawal | [optional]
+**status** | **String** | Transaction status - DONE: Completed (block_number > 0 is considered to be truly completed) - CANCEL: Canceled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: Recharge code operation - EXTPEND: Sent awaiting confirmation - FAIL: Failure on the chain awaiting confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: pending manual review - REVIEW: Under review | [optional] [readonly]
+**chain** | **String** | Name of the chain used in withdrawals |
+
diff --git a/example/FutureTest.java b/example/FutureTest.java
index 105bcd3..f60d2ea 100644
--- a/example/FutureTest.java
+++ b/example/FutureTest.java
@@ -36,7 +36,7 @@ public void run() throws ApiException {
// update position leverage
String leverage = "3";
- futuresApi.updatePositionLeverage(settle, contract, leverage);
+ futuresApi.updatePositionLeverage(settle, contract, leverage, "0");
// retrieve position information
Long positionSize = 0L;
@@ -153,4 +153,4 @@ public void run() throws ApiException {
futuresApi.updatePositionMargin(settle, contract, change);
}
}
-}
+}
\ No newline at end of file
diff --git a/example/SpotTest.java b/example/SpotTest.java
index 6d64097..7721de6 100644
--- a/example/SpotTest.java
+++ b/example/SpotTest.java
@@ -29,7 +29,7 @@ public void run() throws ApiException {
SpotApi spotApi = new SpotApi(client);
CurrencyPair pair = spotApi.getCurrencyPair(currencyPair);
System.out.println("testing against currency pair: " + currencyPair);
- String minAmount = pair.getMinQuoteAmount();
+ String minAmount = pair.getMinBaseAmount();
// get last price
List tickers = spotApi.listTickers().currencyPair(currencyPair).execute();
@@ -63,10 +63,10 @@ public void run() throws ApiException {
Order created = spotApi.createOrder(order);
System.out.printf("order created with id %s, status %s\n", created.getId(), created.getStatus());
if (Order.StatusEnum.OPEN.equals(created.getStatus())) {
- Order orderResult = spotApi.getOrder(created.getId(), currencyPair);
+ Order orderResult = spotApi.getOrder(created.getId(), currencyPair, null);
System.out.printf("order %s filled: %s, left: %s\n", orderResult.getId(), orderResult.getFilledTotal(), orderResult.getLeft());
- Order result = spotApi.cancelOrder(orderResult.getId(), currencyPair);
+ Order result = spotApi.cancelOrder(orderResult.getId(), currencyPair, null);
if (Order.StatusEnum.CANCELLED.equals(result.getStatus())) {
System.out.println("order " + orderResult.getId() + " canceled\n");
}
diff --git a/example/pom.xml b/example/pom.xml
index f0772f7..12e9a82 100644
--- a/example/pom.xml
+++ b/example/pom.xml
@@ -21,12 +21,12 @@
io.gate
gate-api
- 5.15.3
+ 6.23.2
commons-cli
commons-cli
- 1.4
+ 1.5.0
diff --git a/gradlew b/gradlew
old mode 100755
new mode 100644
diff --git a/pom.xml b/pom.xml
index 2837777..66fdb7c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,8 +5,8 @@
gate-api
jar
gate-api
- 6.22.2
- https://github.com/openapitools/openapi-generator
+ 7.1.8
+ https://github.com/gateio/gateapi-java.git
Java client for gateapi
scm:git:https://github.com/gateio/gateapi-java.git
@@ -24,10 +24,10 @@
- GateIO
- support@mail.gate.io
- GateIO
- https://www.gate.io
+ Gate
+ support@mail.gate.com
+ Gate
+ https://www.gate.com
@@ -185,18 +185,22 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.7
+ 1.6.13
true
ossrh
- https://s01.oss.sonatype.org/
- false
+ https://ossrh-staging-api.central.sonatype.com
+ true
+ 20
+ 10
+ true
+ true
org.apache.maven.plugins
maven-gpg-plugin
- 1.5
+ 3.2.7
sign-artifacts
@@ -230,11 +234,11 @@
ossrh
- https://s01.oss.sonatype.org/content/repositories/snapshots
+ https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots
ossrh
- https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
+ https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/
@@ -293,8 +297,8 @@
${java.version}
${java.version}
1.8.4
- 3.14.7
- 2.8.6
+ 4.9.3
+ 2.10
3.10
1.14
1.3.2
diff --git a/settings.xml b/settings.xml
new file mode 100644
index 0000000..68ff477
--- /dev/null
+++ b/settings.xml
@@ -0,0 +1,15 @@
+
+
+
+ ossrh
+ ${env.MAVEN_CENTRAL_USERNAME}
+ ${env.MAVEN_CENTRAL_PASSWORD}
+
+
+ gpg.passphrase
+ ${env.MAVEN_GPG_PASSPHRASE}
+
+
+
diff --git a/src/main/java/io/gate/gateapi/ApiCallback.java b/src/main/java/io/gate/gateapi/ApiCallback.java
index 23a5725..8b0ed68 100644
--- a/src/main/java/io/gate/gateapi/ApiCallback.java
+++ b/src/main/java/io/gate/gateapi/ApiCallback.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/ApiClient.java b/src/main/java/io/gate/gateapi/ApiClient.java
index 89a45ce..177103f 100644
--- a/src/main/java/io/gate/gateapi/ApiClient.java
+++ b/src/main/java/io/gate/gateapi/ApiClient.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -113,7 +113,7 @@ private void init() {
json = new JSON();
// Set default User-Agent.
- setUserAgent("OpenAPI-Generator/6.22.2/java");
+ setUserAgent("OpenAPI-Generator/7.1.8/java");
authentications = new HashMap();
}
diff --git a/src/main/java/io/gate/gateapi/ApiException.java b/src/main/java/io/gate/gateapi/ApiException.java
index f546bef..435362e 100644
--- a/src/main/java/io/gate/gateapi/ApiException.java
+++ b/src/main/java/io/gate/gateapi/ApiException.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/ApiResponse.java b/src/main/java/io/gate/gateapi/ApiResponse.java
index 4650fbc..d019d81 100644
--- a/src/main/java/io/gate/gateapi/ApiResponse.java
+++ b/src/main/java/io/gate/gateapi/ApiResponse.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/Configuration.java b/src/main/java/io/gate/gateapi/Configuration.java
index e3964fe..50578fc 100644
--- a/src/main/java/io/gate/gateapi/Configuration.java
+++ b/src/main/java/io/gate/gateapi/Configuration.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/GzipRequestInterceptor.java b/src/main/java/io/gate/gateapi/GzipRequestInterceptor.java
index d3ad58f..363f118 100644
--- a/src/main/java/io/gate/gateapi/GzipRequestInterceptor.java
+++ b/src/main/java/io/gate/gateapi/GzipRequestInterceptor.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/JSON.java b/src/main/java/io/gate/gateapi/JSON.java
index 10453c5..2d66d18 100644
--- a/src/main/java/io/gate/gateapi/JSON.java
+++ b/src/main/java/io/gate/gateapi/JSON.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/Pair.java b/src/main/java/io/gate/gateapi/Pair.java
index 82b35cd..95acb44 100644
--- a/src/main/java/io/gate/gateapi/Pair.java
+++ b/src/main/java/io/gate/gateapi/Pair.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/ProgressRequestBody.java b/src/main/java/io/gate/gateapi/ProgressRequestBody.java
index cf49f2a..c36f23e 100644
--- a/src/main/java/io/gate/gateapi/ProgressRequestBody.java
+++ b/src/main/java/io/gate/gateapi/ProgressRequestBody.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/ProgressResponseBody.java b/src/main/java/io/gate/gateapi/ProgressResponseBody.java
index 344faf8..ce6f7c0 100644
--- a/src/main/java/io/gate/gateapi/ProgressResponseBody.java
+++ b/src/main/java/io/gate/gateapi/ProgressResponseBody.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/StringUtil.java b/src/main/java/io/gate/gateapi/StringUtil.java
index 5bfebf7..38ce9f0 100644
--- a/src/main/java/io/gate/gateapi/StringUtil.java
+++ b/src/main/java/io/gate/gateapi/StringUtil.java
@@ -1,6 +1,6 @@
/*
- * 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.
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
diff --git a/src/main/java/io/gate/gateapi/api/AccountApi.java b/src/main/java/io/gate/gateapi/api/AccountApi.java
new file mode 100644
index 0000000..3e3d775
--- /dev/null
+++ b/src/main/java/io/gate/gateapi/api/AccountApi.java
@@ -0,0 +1,1047 @@
+/*
+ * Gate API
+ * Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package io.gate.gateapi.api;
+
+import io.gate.gateapi.ApiCallback;
+import io.gate.gateapi.ApiClient;
+import io.gate.gateapi.ApiException;
+import io.gate.gateapi.ApiResponse;
+import io.gate.gateapi.Configuration;
+import io.gate.gateapi.Pair;
+
+import com.google.gson.reflect.TypeToken;
+
+
+import io.gate.gateapi.models.AccountDetail;
+import io.gate.gateapi.models.AccountRateLimit;
+import io.gate.gateapi.models.DebitFee;
+import io.gate.gateapi.models.StpGroup;
+import io.gate.gateapi.models.StpGroupUser;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class AccountApi {
+ private ApiClient localVarApiClient;
+
+ public AccountApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public AccountApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ /**
+ * Build call for getAccountDetail
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public okhttp3.Call getAccountDetailCall(final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/account/detail";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { "apiv4" };
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getAccountDetailValidateBeforeCall(final ApiCallback _callback) throws ApiException {
+ okhttp3.Call localVarCall = getAccountDetailCall(_callback);
+ return localVarCall;
+ }
+
+ /**
+ * Retrieve user account information
+ *
+ * @return AccountDetail
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public AccountDetail getAccountDetail() throws ApiException {
+ ApiResponse localVarResp = getAccountDetailWithHttpInfo();
+ return localVarResp.getData();
+ }
+
+ /**
+ * Retrieve user account information
+ *
+ * @return ApiResponse<AccountDetail>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public ApiResponse getAccountDetailWithHttpInfo() throws ApiException {
+ okhttp3.Call localVarCall = getAccountDetailValidateBeforeCall(null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Retrieve user account information (asynchronously)
+ *
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public okhttp3.Call getAccountDetailAsync(final ApiCallback _callback) throws ApiException {
+ okhttp3.Call localVarCall = getAccountDetailValidateBeforeCall(_callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+
+ /**
+ * Build call for getAccountRateLimit
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public okhttp3.Call getAccountRateLimitCall(final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/account/rate_limit";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { "apiv4" };
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getAccountRateLimitValidateBeforeCall(final ApiCallback _callback) throws ApiException {
+ okhttp3.Call localVarCall = getAccountRateLimitCall(_callback);
+ return localVarCall;
+ }
+
+ /**
+ * Get user transaction rate limit information
+ *
+ * @return List<AccountRateLimit>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public List getAccountRateLimit() throws ApiException {
+ ApiResponse> localVarResp = getAccountRateLimitWithHttpInfo();
+ return localVarResp.getData();
+ }
+
+ /**
+ * Get user transaction rate limit information
+ *
+ * @return ApiResponse<List<AccountRateLimit>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public ApiResponse> getAccountRateLimitWithHttpInfo() throws ApiException {
+ okhttp3.Call localVarCall = getAccountRateLimitValidateBeforeCall(null);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Get user transaction rate limit information (asynchronously)
+ *
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | Successfully retrieved | - |
+
+ */
+ public okhttp3.Call getAccountRateLimitAsync(final ApiCallback> _callback) throws ApiException {
+ okhttp3.Call localVarCall = getAccountRateLimitValidateBeforeCall(_callback);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+
+ private okhttp3.Call listSTPGroupsCall(String name, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/account/stp_groups";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (name != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
+ }
+
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { "apiv4" };
+ return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call listSTPGroupsValidateBeforeCall(String name, final ApiCallback _callback) throws ApiException {
+ okhttp3.Call localVarCall = listSTPGroupsCall(name, _callback);
+ return localVarCall;
+ }
+
+
+ private ApiResponse> listSTPGroupsWithHttpInfo(String name) throws ApiException {
+ okhttp3.Call localVarCall = listSTPGroupsValidateBeforeCall(name, null);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ private okhttp3.Call listSTPGroupsAsync(String name, final ApiCallback> _callback) throws ApiException {
+ okhttp3.Call localVarCall = listSTPGroupsValidateBeforeCall(name, _callback);
+ Type localVarReturnType = new TypeToken