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>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistSTPGroupsRequest { + private String name; + + private APIlistSTPGroupsRequest() { + } + + /** + * Set name + * @param name Fuzzy search by name (optional) + * @return APIlistSTPGroupsRequest + */ + public APIlistSTPGroupsRequest name(String name) { + this.name = name; + return this; + } + + /** + * Build call for listSTPGroups + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listSTPGroupsCall(name, _callback); + } + + /** + * Execute listSTPGroups request + * @return List<StpGroup> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listSTPGroupsWithHttpInfo(name); + return localVarResp.getData(); + } + + /** + * Execute listSTPGroups request with HTTP info returned + * @return ApiResponse<List<StpGroup>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSTPGroupsWithHttpInfo(name); + } + + /** + * Execute listSTPGroups request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSTPGroupsAsync(name, _callback); + } + } + + /** + * Query STP user groups created by the user + * Only query STP user groups created by the current main account + * @return APIlistSTPGroupsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistSTPGroupsRequest listSTPGroups() { + return new APIlistSTPGroupsRequest(); + } + + /** + * Build call for createSTPGroup + * @param stpGroup (required) + * @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 User added successfully, returning current users in the STP group -
+ */ + public okhttp3.Call createSTPGroupCall(StpGroup stpGroup, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = stpGroup; + + // create path and map variables + String localVarPath = "/account/stp_groups"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSTPGroupValidateBeforeCall(StpGroup stpGroup, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'stpGroup' is set + if (stpGroup == null) { + throw new ApiException("Missing the required parameter 'stpGroup' when calling createSTPGroup(Async)"); + } + + okhttp3.Call localVarCall = createSTPGroupCall(stpGroup, _callback); + return localVarCall; + } + + /** + * Create STP user group + * Only the main account is allowed to create a new STP user group + * @param stpGroup (required) + * @return StpGroup + * @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 User added successfully, returning current users in the STP group -
+ */ + public StpGroup createSTPGroup(StpGroup stpGroup) throws ApiException { + ApiResponse localVarResp = createSTPGroupWithHttpInfo(stpGroup); + return localVarResp.getData(); + } + + /** + * Create STP user group + * Only the main account is allowed to create a new STP user group + * @param stpGroup (required) + * @return ApiResponse<StpGroup> + * @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 User added successfully, returning current users in the STP group -
+ */ + public ApiResponse createSTPGroupWithHttpInfo(StpGroup stpGroup) throws ApiException { + okhttp3.Call localVarCall = createSTPGroupValidateBeforeCall(stpGroup, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create STP user group (asynchronously) + * Only the main account is allowed to create a new STP user group + * @param stpGroup (required) + * @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 User added successfully, returning current users in the STP group -
+ */ + public okhttp3.Call createSTPGroupAsync(StpGroup stpGroup, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createSTPGroupValidateBeforeCall(stpGroup, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listSTPGroupsUsers + * @param stpId STP Group ID (required) + * @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 List retrieved successfully -
+ */ + public okhttp3.Call listSTPGroupsUsersCall(Long stpId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/account/stp_groups/{stp_id}/users" + .replaceAll("\\{" + "stp_id" + "\\}", localVarApiClient.escapeString(stpId.toString())); + + 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 listSTPGroupsUsersValidateBeforeCall(Long stpId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'stpId' is set + if (stpId == null) { + throw new ApiException("Missing the required parameter 'stpId' when calling listSTPGroupsUsers(Async)"); + } + + okhttp3.Call localVarCall = listSTPGroupsUsersCall(stpId, _callback); + return localVarCall; + } + + /** + * 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 + * @param stpId STP Group ID (required) + * @return List<StpGroupUser> + * @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 List retrieved successfully -
+ */ + public List listSTPGroupsUsers(Long stpId) throws ApiException { + ApiResponse> localVarResp = listSTPGroupsUsersWithHttpInfo(stpId); + return localVarResp.getData(); + } + + /** + * 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 + * @param stpId STP Group ID (required) + * @return ApiResponse<List<StpGroupUser>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> listSTPGroupsUsersWithHttpInfo(Long stpId) throws ApiException { + okhttp3.Call localVarCall = listSTPGroupsUsersValidateBeforeCall(stpId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query users in the STP user group (asynchronously) + * Only the main account that created this STP group can query the account ID list in the current STP group + * @param stpId STP Group ID (required) + * @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 List retrieved successfully -
+ */ + public okhttp3.Call listSTPGroupsUsersAsync(Long stpId, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSTPGroupsUsersValidateBeforeCall(stpId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for addSTPGroupUsers + * @param stpId STP Group ID (required) + * @param requestBody User ID (required) + * @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 User added successfully, returning current users in the STP group -
+ */ + public okhttp3.Call addSTPGroupUsersCall(Long stpId, List requestBody, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = requestBody; + + // create path and map variables + String localVarPath = "/account/stp_groups/{stp_id}/users" + .replaceAll("\\{" + "stp_id" + "\\}", localVarApiClient.escapeString(stpId.toString())); + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addSTPGroupUsersValidateBeforeCall(Long stpId, List requestBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'stpId' is set + if (stpId == null) { + throw new ApiException("Missing the required parameter 'stpId' when calling addSTPGroupUsers(Async)"); + } + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling addSTPGroupUsers(Async)"); + } + + okhttp3.Call localVarCall = addSTPGroupUsersCall(stpId, requestBody, _callback); + return localVarCall; + } + + /** + * 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 + * @param stpId STP Group ID (required) + * @param requestBody User ID (required) + * @return List<StpGroupUser> + * @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 User added successfully, returning current users in the STP group -
+ */ + public List addSTPGroupUsers(Long stpId, List requestBody) throws ApiException { + ApiResponse> localVarResp = addSTPGroupUsersWithHttpInfo(stpId, requestBody); + return localVarResp.getData(); + } + + /** + * 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 + * @param stpId STP Group ID (required) + * @param requestBody User ID (required) + * @return ApiResponse<List<StpGroupUser>> + * @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 User added successfully, returning current users in the STP group -
+ */ + public ApiResponse> addSTPGroupUsersWithHttpInfo(Long stpId, List requestBody) throws ApiException { + okhttp3.Call localVarCall = addSTPGroupUsersValidateBeforeCall(stpId, requestBody, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add users to the STP user group (asynchronously) + * - 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 + * @param stpId STP Group ID (required) + * @param requestBody User ID (required) + * @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 User added successfully, returning current users in the STP group -
+ */ + public okhttp3.Call addSTPGroupUsersAsync(Long stpId, List requestBody, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = addSTPGroupUsersValidateBeforeCall(stpId, requestBody, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for deleteSTPGroupUsers + * @param stpId STP Group ID (required) + * @param userId STP user IDs, multiple IDs can be separated by commas (required) + * @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 Users deleted successfully, returns current users in the STP group -
+ */ + public okhttp3.Call deleteSTPGroupUsersCall(Long stpId, Long userId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/account/stp_groups/{stp_id}/users" + .replaceAll("\\{" + "stp_id" + "\\}", localVarApiClient.escapeString(stpId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSTPGroupUsersValidateBeforeCall(Long stpId, Long userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'stpId' is set + if (stpId == null) { + throw new ApiException("Missing the required parameter 'stpId' when calling deleteSTPGroupUsers(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteSTPGroupUsers(Async)"); + } + + okhttp3.Call localVarCall = deleteSTPGroupUsersCall(stpId, userId, _callback); + return localVarCall; + } + + /** + * 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 + * @param stpId STP Group ID (required) + * @param userId STP user IDs, multiple IDs can be separated by commas (required) + * @return List<StpGroupUser> + * @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 Users deleted successfully, returns current users in the STP group -
+ */ + public List deleteSTPGroupUsers(Long stpId, Long userId) throws ApiException { + ApiResponse> localVarResp = deleteSTPGroupUsersWithHttpInfo(stpId, userId); + return localVarResp.getData(); + } + + /** + * 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 + * @param stpId STP Group ID (required) + * @param userId STP user IDs, multiple IDs can be separated by commas (required) + * @return ApiResponse<List<StpGroupUser>> + * @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 Users deleted successfully, returns current users in the STP group -
+ */ + public ApiResponse> deleteSTPGroupUsersWithHttpInfo(Long stpId, Long userId) throws ApiException { + okhttp3.Call localVarCall = deleteSTPGroupUsersValidateBeforeCall(stpId, userId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete users from the STP user group (asynchronously) + * - 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 + * @param stpId STP Group ID (required) + * @param userId STP user IDs, multiple IDs can be separated by commas (required) + * @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 Users deleted successfully, returns current users in the STP group -
+ */ + public okhttp3.Call deleteSTPGroupUsersAsync(Long stpId, Long userId, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = deleteSTPGroupUsersValidateBeforeCall(stpId, userId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getDebitFee + * @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 Success -
+ */ + public okhttp3.Call getDebitFeeCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/account/debit_fee"; + + 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 getDebitFeeValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getDebitFeeCall(_callback); + return localVarCall; + } + + /** + * Query GT fee deduction configuration + * Query the GT fee deduction configuration for the current account + * @return DebitFee + * @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 Success -
+ */ + public DebitFee getDebitFee() throws ApiException { + ApiResponse localVarResp = getDebitFeeWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query GT fee deduction configuration + * Query the GT fee deduction configuration for the current account + * @return ApiResponse<DebitFee> + * @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 Success -
+ */ + public ApiResponse getDebitFeeWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getDebitFeeValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query GT fee deduction configuration (asynchronously) + * Query the GT fee deduction configuration for the current account + * @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 Success -
+ */ + public okhttp3.Call getDebitFeeAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getDebitFeeValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for setDebitFee + * @param debitFee (required) + * @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 Success -
+ */ + public okhttp3.Call setDebitFeeCall(DebitFee debitFee, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = debitFee; + + // create path and map variables + String localVarPath = "/account/debit_fee"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setDebitFeeValidateBeforeCall(DebitFee debitFee, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'debitFee' is set + if (debitFee == null) { + throw new ApiException("Missing the required parameter 'debitFee' when calling setDebitFee(Async)"); + } + + okhttp3.Call localVarCall = setDebitFeeCall(debitFee, _callback); + return localVarCall; + } + + /** + * Configure GT fee deduction + * Enable or disable GT fee deduction for the current account + * @param debitFee (required) + * @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 Success -
+ */ + public void setDebitFee(DebitFee debitFee) throws ApiException { + setDebitFeeWithHttpInfo(debitFee); + } + + /** + * Configure GT fee deduction + * Enable or disable GT fee deduction for the current account + * @param debitFee (required) + * @return ApiResponse<Void> + * @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 Success -
+ */ + public ApiResponse setDebitFeeWithHttpInfo(DebitFee debitFee) throws ApiException { + okhttp3.Call localVarCall = setDebitFeeValidateBeforeCall(debitFee, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Configure GT fee deduction (asynchronously) + * Enable or disable GT fee deduction for the current account + * @param debitFee (required) + * @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 Success -
+ */ + public okhttp3.Call setDebitFeeAsync(DebitFee debitFee, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = setDebitFeeValidateBeforeCall(debitFee, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/CollateralLoanApi.java b/src/main/java/io/gate/gateapi/api/CollateralLoanApi.java new file mode 100644 index 0000000..135456c --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/CollateralLoanApi.java @@ -0,0 +1,1486 @@ +/* + * 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.CollateralAlign; +import io.gate.gateapi.models.CollateralLoanCurrency; +import io.gate.gateapi.models.CollateralOrder; +import io.gate.gateapi.models.CollateralRecord; +import io.gate.gateapi.models.CreateCollateralOrder; +import io.gate.gateapi.models.OrderResp; +import io.gate.gateapi.models.RepayLoan; +import io.gate.gateapi.models.RepayRecord; +import io.gate.gateapi.models.RepayResp; +import io.gate.gateapi.models.UserLtvInfo; +import io.gate.gateapi.models.UserTotalAmount; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CollateralLoanApi { + private ApiClient localVarApiClient; + + public CollateralLoanApi() { + this(Configuration.getDefaultApiClient()); + } + + public CollateralLoanApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + private okhttp3.Call listCollateralLoanOrdersCall(Integer page, Integer limit, String collateralCurrency, String borrowCurrency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/collateral/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (collateralCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("collateral_currency", collateralCurrency)); + } + + if (borrowCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("borrow_currency", borrowCurrency)); + } + + 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 listCollateralLoanOrdersValidateBeforeCall(Integer page, Integer limit, String collateralCurrency, String borrowCurrency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listCollateralLoanOrdersCall(page, limit, collateralCurrency, borrowCurrency, _callback); + return localVarCall; + } + + + private ApiResponse> listCollateralLoanOrdersWithHttpInfo(Integer page, Integer limit, String collateralCurrency, String borrowCurrency) throws ApiException { + okhttp3.Call localVarCall = listCollateralLoanOrdersValidateBeforeCall(page, limit, collateralCurrency, borrowCurrency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listCollateralLoanOrdersAsync(Integer page, Integer limit, String collateralCurrency, String borrowCurrency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listCollateralLoanOrdersValidateBeforeCall(page, limit, collateralCurrency, borrowCurrency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistCollateralLoanOrdersRequest { + private Integer page; + private Integer limit; + private String collateralCurrency; + private String borrowCurrency; + + private APIlistCollateralLoanOrdersRequest() { + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistCollateralLoanOrdersRequest + */ + public APIlistCollateralLoanOrdersRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistCollateralLoanOrdersRequest + */ + public APIlistCollateralLoanOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set collateralCurrency + * @param collateralCurrency Collateral currency (optional) + * @return APIlistCollateralLoanOrdersRequest + */ + public APIlistCollateralLoanOrdersRequest collateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Set borrowCurrency + * @param borrowCurrency Borrowed currency (optional) + * @return APIlistCollateralLoanOrdersRequest + */ + public APIlistCollateralLoanOrdersRequest borrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Build call for listCollateralLoanOrders + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listCollateralLoanOrdersCall(page, limit, collateralCurrency, borrowCurrency, _callback); + } + + /** + * Execute listCollateralLoanOrders request + * @return List<CollateralOrder> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listCollateralLoanOrdersWithHttpInfo(page, limit, collateralCurrency, borrowCurrency); + return localVarResp.getData(); + } + + /** + * Execute listCollateralLoanOrders request with HTTP info returned + * @return ApiResponse<List<CollateralOrder>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listCollateralLoanOrdersWithHttpInfo(page, limit, collateralCurrency, borrowCurrency); + } + + /** + * Execute listCollateralLoanOrders request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listCollateralLoanOrdersAsync(page, limit, collateralCurrency, borrowCurrency, _callback); + } + } + + /** + * Query collateral loan order list + * + * @return APIlistCollateralLoanOrdersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistCollateralLoanOrdersRequest listCollateralLoanOrders() { + return new APIlistCollateralLoanOrdersRequest(); + } + + /** + * Build call for createCollateralLoan + * @param createCollateralOrder (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call createCollateralLoanCall(CreateCollateralOrder createCollateralOrder, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = createCollateralOrder; + + // create path and map variables + String localVarPath = "/loan/collateral/orders"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCollateralLoanValidateBeforeCall(CreateCollateralOrder createCollateralOrder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createCollateralOrder' is set + if (createCollateralOrder == null) { + throw new ApiException("Missing the required parameter 'createCollateralOrder' when calling createCollateralLoan(Async)"); + } + + okhttp3.Call localVarCall = createCollateralLoanCall(createCollateralOrder, _callback); + return localVarCall; + } + + /** + * Place collateral loan order + * + * @param createCollateralOrder (required) + * @return OrderResp + * @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 Order placed successfully -
+ */ + public OrderResp createCollateralLoan(CreateCollateralOrder createCollateralOrder) throws ApiException { + ApiResponse localVarResp = createCollateralLoanWithHttpInfo(createCollateralOrder); + return localVarResp.getData(); + } + + /** + * Place collateral loan order + * + * @param createCollateralOrder (required) + * @return ApiResponse<OrderResp> + * @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 Order placed successfully -
+ */ + public ApiResponse createCollateralLoanWithHttpInfo(CreateCollateralOrder createCollateralOrder) throws ApiException { + okhttp3.Call localVarCall = createCollateralLoanValidateBeforeCall(createCollateralOrder, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Place collateral loan order (asynchronously) + * + * @param createCollateralOrder (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call createCollateralLoanAsync(CreateCollateralOrder createCollateralOrder, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createCollateralLoanValidateBeforeCall(createCollateralOrder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getCollateralLoanOrderDetail + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order details queried successfully -
+ */ + public okhttp3.Call getCollateralLoanOrderDetailCall(Long orderId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/collateral/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + + 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 getCollateralLoanOrderDetailValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling getCollateralLoanOrderDetail(Async)"); + } + + okhttp3.Call localVarCall = getCollateralLoanOrderDetailCall(orderId, _callback); + return localVarCall; + } + + /** + * Query single order details + * + * @param orderId Order ID returned when order is successfully created (required) + * @return CollateralOrder + * @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 Order details queried successfully -
+ */ + public CollateralOrder getCollateralLoanOrderDetail(Long orderId) throws ApiException { + ApiResponse localVarResp = getCollateralLoanOrderDetailWithHttpInfo(orderId); + return localVarResp.getData(); + } + + /** + * Query single order details + * + * @param orderId Order ID returned when order is successfully created (required) + * @return ApiResponse<CollateralOrder> + * @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 Order details queried successfully -
+ */ + public ApiResponse getCollateralLoanOrderDetailWithHttpInfo(Long orderId) throws ApiException { + okhttp3.Call localVarCall = getCollateralLoanOrderDetailValidateBeforeCall(orderId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query single order details (asynchronously) + * + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order details queried successfully -
+ */ + public okhttp3.Call getCollateralLoanOrderDetailAsync(Long orderId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getCollateralLoanOrderDetailValidateBeforeCall(orderId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for repayCollateralLoan + * @param repayLoan (required) + * @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 Operation successful -
+ */ + public okhttp3.Call repayCollateralLoanCall(RepayLoan repayLoan, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = repayLoan; + + // create path and map variables + String localVarPath = "/loan/collateral/repay"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call repayCollateralLoanValidateBeforeCall(RepayLoan repayLoan, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repayLoan' is set + if (repayLoan == null) { + throw new ApiException("Missing the required parameter 'repayLoan' when calling repayCollateralLoan(Async)"); + } + + okhttp3.Call localVarCall = repayCollateralLoanCall(repayLoan, _callback); + return localVarCall; + } + + /** + * Collateral loan repayment + * + * @param repayLoan (required) + * @return RepayResp + * @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 Operation successful -
+ */ + public RepayResp repayCollateralLoan(RepayLoan repayLoan) throws ApiException { + ApiResponse localVarResp = repayCollateralLoanWithHttpInfo(repayLoan); + return localVarResp.getData(); + } + + /** + * Collateral loan repayment + * + * @param repayLoan (required) + * @return ApiResponse<RepayResp> + * @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 Operation successful -
+ */ + public ApiResponse repayCollateralLoanWithHttpInfo(RepayLoan repayLoan) throws ApiException { + okhttp3.Call localVarCall = repayCollateralLoanValidateBeforeCall(repayLoan, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Collateral loan repayment (asynchronously) + * + * @param repayLoan (required) + * @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 Operation successful -
+ */ + public okhttp3.Call repayCollateralLoanAsync(RepayLoan repayLoan, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = repayCollateralLoanValidateBeforeCall(repayLoan, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listRepayRecordsCall(String source, String borrowCurrency, String collateralCurrency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/collateral/repay_records"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (source != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("source", source)); + } + + if (borrowCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("borrow_currency", borrowCurrency)); + } + + if (collateralCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("collateral_currency", collateralCurrency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listRepayRecordsValidateBeforeCall(String source, String borrowCurrency, String collateralCurrency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'source' is set + if (source == null) { + throw new ApiException("Missing the required parameter 'source' when calling listRepayRecords(Async)"); + } + + okhttp3.Call localVarCall = listRepayRecordsCall(source, borrowCurrency, collateralCurrency, page, limit, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listRepayRecordsWithHttpInfo(String source, String borrowCurrency, String collateralCurrency, Integer page, Integer limit, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listRepayRecordsValidateBeforeCall(source, borrowCurrency, collateralCurrency, page, limit, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listRepayRecordsAsync(String source, String borrowCurrency, String collateralCurrency, Integer page, Integer limit, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listRepayRecordsValidateBeforeCall(source, borrowCurrency, collateralCurrency, page, limit, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistRepayRecordsRequest { + private final String source; + private String borrowCurrency; + private String collateralCurrency; + private Integer page; + private Integer limit; + private Long from; + private Long to; + + private APIlistRepayRecordsRequest(String source) { + this.source = source; + } + + /** + * Set borrowCurrency + * @param borrowCurrency Borrowed currency (optional) + * @return APIlistRepayRecordsRequest + */ + public APIlistRepayRecordsRequest borrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Set collateralCurrency + * @param collateralCurrency Collateral currency (optional) + * @return APIlistRepayRecordsRequest + */ + public APIlistRepayRecordsRequest collateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistRepayRecordsRequest + */ + public APIlistRepayRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistRepayRecordsRequest + */ + public APIlistRepayRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistRepayRecordsRequest + */ + public APIlistRepayRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistRepayRecordsRequest + */ + public APIlistRepayRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listRepayRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listRepayRecordsCall(source, borrowCurrency, collateralCurrency, page, limit, from, to, _callback); + } + + /** + * Execute listRepayRecords request + * @return List<RepayRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listRepayRecordsWithHttpInfo(source, borrowCurrency, collateralCurrency, page, limit, from, to); + return localVarResp.getData(); + } + + /** + * Execute listRepayRecords request with HTTP info returned + * @return ApiResponse<List<RepayRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listRepayRecordsWithHttpInfo(source, borrowCurrency, collateralCurrency, page, limit, from, to); + } + + /** + * Execute listRepayRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listRepayRecordsAsync(source, borrowCurrency, collateralCurrency, page, limit, from, to, _callback); + } + } + + /** + * Query collateral loan repayment records + * + * @param source Operation type: repay - Regular repayment, liquidate - Liquidation (required) + * @return APIlistRepayRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistRepayRecordsRequest listRepayRecords(String source) { + return new APIlistRepayRecordsRequest(source); + } + + private okhttp3.Call listCollateralRecordsCall(Integer page, Integer limit, Long from, Long to, String borrowCurrency, String collateralCurrency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/collateral/collaterals"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (borrowCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("borrow_currency", borrowCurrency)); + } + + if (collateralCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("collateral_currency", collateralCurrency)); + } + + 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 listCollateralRecordsValidateBeforeCall(Integer page, Integer limit, Long from, Long to, String borrowCurrency, String collateralCurrency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listCollateralRecordsCall(page, limit, from, to, borrowCurrency, collateralCurrency, _callback); + return localVarCall; + } + + + private ApiResponse> listCollateralRecordsWithHttpInfo(Integer page, Integer limit, Long from, Long to, String borrowCurrency, String collateralCurrency) throws ApiException { + okhttp3.Call localVarCall = listCollateralRecordsValidateBeforeCall(page, limit, from, to, borrowCurrency, collateralCurrency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listCollateralRecordsAsync(Integer page, Integer limit, Long from, Long to, String borrowCurrency, String collateralCurrency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listCollateralRecordsValidateBeforeCall(page, limit, from, to, borrowCurrency, collateralCurrency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistCollateralRecordsRequest { + private Integer page; + private Integer limit; + private Long from; + private Long to; + private String borrowCurrency; + private String collateralCurrency; + + private APIlistCollateralRecordsRequest() { + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistCollateralRecordsRequest + */ + public APIlistCollateralRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistCollateralRecordsRequest + */ + public APIlistCollateralRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistCollateralRecordsRequest + */ + public APIlistCollateralRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistCollateralRecordsRequest + */ + public APIlistCollateralRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set borrowCurrency + * @param borrowCurrency Borrowed currency (optional) + * @return APIlistCollateralRecordsRequest + */ + public APIlistCollateralRecordsRequest borrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Set collateralCurrency + * @param collateralCurrency Collateral currency (optional) + * @return APIlistCollateralRecordsRequest + */ + public APIlistCollateralRecordsRequest collateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Build call for listCollateralRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listCollateralRecordsCall(page, limit, from, to, borrowCurrency, collateralCurrency, _callback); + } + + /** + * Execute listCollateralRecords request + * @return List<CollateralRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listCollateralRecordsWithHttpInfo(page, limit, from, to, borrowCurrency, collateralCurrency); + return localVarResp.getData(); + } + + /** + * Execute listCollateralRecords request with HTTP info returned + * @return ApiResponse<List<CollateralRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listCollateralRecordsWithHttpInfo(page, limit, from, to, borrowCurrency, collateralCurrency); + } + + /** + * Execute listCollateralRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listCollateralRecordsAsync(page, limit, from, to, borrowCurrency, collateralCurrency, _callback); + } + } + + /** + * Query collateral adjustment records + * + * @return APIlistCollateralRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistCollateralRecordsRequest listCollateralRecords() { + return new APIlistCollateralRecordsRequest(); + } + + /** + * Build call for operateCollateral + * @param collateralAlign (required) + * @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
204 Operation successful -
+ */ + public okhttp3.Call operateCollateralCall(CollateralAlign collateralAlign, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = collateralAlign; + + // create path and map variables + String localVarPath = "/loan/collateral/collaterals"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call operateCollateralValidateBeforeCall(CollateralAlign collateralAlign, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'collateralAlign' is set + if (collateralAlign == null) { + throw new ApiException("Missing the required parameter 'collateralAlign' when calling operateCollateral(Async)"); + } + + okhttp3.Call localVarCall = operateCollateralCall(collateralAlign, _callback); + return localVarCall; + } + + /** + * Increase or redeem collateral + * + * @param collateralAlign (required) + * @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
204 Operation successful -
+ */ + public void operateCollateral(CollateralAlign collateralAlign) throws ApiException { + operateCollateralWithHttpInfo(collateralAlign); + } + + /** + * Increase or redeem collateral + * + * @param collateralAlign (required) + * @return ApiResponse<Void> + * @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
204 Operation successful -
+ */ + public ApiResponse operateCollateralWithHttpInfo(CollateralAlign collateralAlign) throws ApiException { + okhttp3.Call localVarCall = operateCollateralValidateBeforeCall(collateralAlign, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Increase or redeem collateral (asynchronously) + * + * @param collateralAlign (required) + * @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
204 Operation successful -
+ */ + public okhttp3.Call operateCollateralAsync(CollateralAlign collateralAlign, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = operateCollateralValidateBeforeCall(collateralAlign, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for getUserTotalAmount + * @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 Query successful -
+ */ + public okhttp3.Call getUserTotalAmountCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/collateral/total_amount"; + + 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 getUserTotalAmountValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUserTotalAmountCall(_callback); + return localVarCall; + } + + /** + * Query user's total borrowing and collateral amount + * + * @return UserTotalAmount + * @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 Query successful -
+ */ + public UserTotalAmount getUserTotalAmount() throws ApiException { + ApiResponse localVarResp = getUserTotalAmountWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query user's total borrowing and collateral amount + * + * @return ApiResponse<UserTotalAmount> + * @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 Query successful -
+ */ + public ApiResponse getUserTotalAmountWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getUserTotalAmountValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query user's total borrowing and collateral amount (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 Query successful -
+ */ + public okhttp3.Call getUserTotalAmountAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUserTotalAmountValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUserLtvInfo + * @param collateralCurrency Collateral currency (required) + * @param borrowCurrency Borrowed currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUserLtvInfoCall(String collateralCurrency, String borrowCurrency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/collateral/ltv"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (collateralCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("collateral_currency", collateralCurrency)); + } + + if (borrowCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("borrow_currency", borrowCurrency)); + } + + 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 getUserLtvInfoValidateBeforeCall(String collateralCurrency, String borrowCurrency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'collateralCurrency' is set + if (collateralCurrency == null) { + throw new ApiException("Missing the required parameter 'collateralCurrency' when calling getUserLtvInfo(Async)"); + } + + // verify the required parameter 'borrowCurrency' is set + if (borrowCurrency == null) { + throw new ApiException("Missing the required parameter 'borrowCurrency' when calling getUserLtvInfo(Async)"); + } + + okhttp3.Call localVarCall = getUserLtvInfoCall(collateralCurrency, borrowCurrency, _callback); + return localVarCall; + } + + /** + * Query user's collateralization ratio and remaining borrowable currencies + * + * @param collateralCurrency Collateral currency (required) + * @param borrowCurrency Borrowed currency (required) + * @return UserLtvInfo + * @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 Query successful -
+ */ + public UserLtvInfo getUserLtvInfo(String collateralCurrency, String borrowCurrency) throws ApiException { + ApiResponse localVarResp = getUserLtvInfoWithHttpInfo(collateralCurrency, borrowCurrency); + return localVarResp.getData(); + } + + /** + * Query user's collateralization ratio and remaining borrowable currencies + * + * @param collateralCurrency Collateral currency (required) + * @param borrowCurrency Borrowed currency (required) + * @return ApiResponse<UserLtvInfo> + * @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 Query successful -
+ */ + public ApiResponse getUserLtvInfoWithHttpInfo(String collateralCurrency, String borrowCurrency) throws ApiException { + okhttp3.Call localVarCall = getUserLtvInfoValidateBeforeCall(collateralCurrency, borrowCurrency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query user's collateralization ratio and remaining borrowable currencies (asynchronously) + * + * @param collateralCurrency Collateral currency (required) + * @param borrowCurrency Borrowed currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUserLtvInfoAsync(String collateralCurrency, String borrowCurrency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUserLtvInfoValidateBeforeCall(collateralCurrency, borrowCurrency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listCollateralCurrenciesCall(String loanCurrency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/collateral/currencies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (loanCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("loan_currency", loanCurrency)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCollateralCurrenciesValidateBeforeCall(String loanCurrency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listCollateralCurrenciesCall(loanCurrency, _callback); + return localVarCall; + } + + + private ApiResponse> listCollateralCurrenciesWithHttpInfo(String loanCurrency) throws ApiException { + okhttp3.Call localVarCall = listCollateralCurrenciesValidateBeforeCall(loanCurrency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listCollateralCurrenciesAsync(String loanCurrency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listCollateralCurrenciesValidateBeforeCall(loanCurrency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistCollateralCurrenciesRequest { + private String loanCurrency; + + private APIlistCollateralCurrenciesRequest() { + } + + /** + * Set loanCurrency + * @param loanCurrency 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 APIlistCollateralCurrenciesRequest + */ + public APIlistCollateralCurrenciesRequest loanCurrency(String loanCurrency) { + this.loanCurrency = loanCurrency; + return this; + } + + /** + * Build call for listCollateralCurrencies + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listCollateralCurrenciesCall(loanCurrency, _callback); + } + + /** + * Execute listCollateralCurrencies request + * @return List<CollateralLoanCurrency> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listCollateralCurrenciesWithHttpInfo(loanCurrency); + return localVarResp.getData(); + } + + /** + * Execute listCollateralCurrencies request with HTTP info returned + * @return ApiResponse<List<CollateralLoanCurrency>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listCollateralCurrenciesWithHttpInfo(loanCurrency); + } + + /** + * Execute listCollateralCurrencies request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listCollateralCurrenciesAsync(loanCurrency, _callback); + } + } + + /** + * Query supported borrowing and collateral currencies + * + * @return APIlistCollateralCurrenciesRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistCollateralCurrenciesRequest listCollateralCurrencies() { + return new APIlistCollateralCurrenciesRequest(); + } + +} diff --git a/src/main/java/io/gate/gateapi/api/DeliveryApi.java b/src/main/java/io/gate/gateapi/api/DeliveryApi.java index e5b680a..81d8fee 100644 --- a/src/main/java/io/gate/gateapi/api/DeliveryApi.java +++ b/src/main/java/io/gate/gateapi/api/DeliveryApi.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 @@ -20,16 +20,17 @@ import com.google.gson.reflect.TypeToken; +import io.gate.gateapi.models.DeliveryCandlestick; import io.gate.gateapi.models.DeliveryContract; import io.gate.gateapi.models.DeliverySettlement; +import io.gate.gateapi.models.DeliveryTicker; import io.gate.gateapi.models.FuturesAccount; import io.gate.gateapi.models.FuturesAccountBook; -import io.gate.gateapi.models.FuturesCandlestick; +import io.gate.gateapi.models.FuturesLimitRiskTiers; import io.gate.gateapi.models.FuturesLiquidate; import io.gate.gateapi.models.FuturesOrder; import io.gate.gateapi.models.FuturesOrderBook; import io.gate.gateapi.models.FuturesPriceTriggeredOrder; -import io.gate.gateapi.models.FuturesTicker; import io.gate.gateapi.models.FuturesTrade; import io.gate.gateapi.models.InsuranceRecord; import io.gate.gateapi.models.MyFuturesTrade; @@ -71,7 +72,7 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listDeliveryContractsCall(String settle, final ApiCallback _callback) throws ApiException { @@ -116,7 +117,7 @@ private okhttp3.Call listDeliveryContractsValidateBeforeCall(String settle, fina } /** - * List all futures contracts + * Query all futures contracts * * @param settle Settle currency (required) * @return List<DeliveryContract> @@ -124,7 +125,7 @@ private okhttp3.Call listDeliveryContractsValidateBeforeCall(String settle, fina * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List listDeliveryContracts(String settle) throws ApiException { @@ -133,7 +134,7 @@ public List listDeliveryContracts(String settle) throws ApiExc } /** - * List all futures contracts + * Query all futures contracts * * @param settle Settle currency (required) * @return ApiResponse<List<DeliveryContract>> @@ -141,7 +142,7 @@ public List listDeliveryContracts(String settle) throws ApiExc * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> listDeliveryContractsWithHttpInfo(String settle) throws ApiException { @@ -151,7 +152,7 @@ public ApiResponse> listDeliveryContractsWithHttpInfo(Str } /** - * List all futures contracts (asynchronously) + * Query all futures contracts (asynchronously) * * @param settle Settle currency (required) * @param _callback The callback to be executed when the API call finishes @@ -160,7 +161,7 @@ public ApiResponse> listDeliveryContractsWithHttpInfo(Str * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listDeliveryContractsAsync(String settle, final ApiCallback> _callback) throws ApiException { @@ -231,7 +232,7 @@ private okhttp3.Call getDeliveryContractValidateBeforeCall(String settle, String } /** - * Get a single contract + * Query single contract information * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -249,7 +250,7 @@ public DeliveryContract getDeliveryContract(String settle, String contract) thro } /** - * Get a single contract + * Query single contract information * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -268,7 +269,7 @@ public ApiResponse getDeliveryContractWithHttpInfo(String sett } /** - * Get a single contract (asynchronously) + * Query single contract information (asynchronously) * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -378,7 +379,7 @@ private APIlistDeliveryOrderBookRequest(String settle, String contract) { /** * Set interval - * @param interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to 0) + * @param interval Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional, default to 0) * @return APIlistDeliveryOrderBookRequest */ public APIlistDeliveryOrderBookRequest interval(String interval) { @@ -388,7 +389,7 @@ public APIlistDeliveryOrderBookRequest interval(String interval) { /** * Set limit - * @param limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param limit Number of depth levels (optional, default to 10) * @return APIlistDeliveryOrderBookRequest */ public APIlistDeliveryOrderBookRequest limit(Integer limit) { @@ -398,7 +399,7 @@ public APIlistDeliveryOrderBookRequest limit(Integer limit) { /** * Set withId - * @param withId Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) + * @param withId Whether to return depth update ID. This ID increments by 1 each time depth changes (optional, default to false) * @return APIlistDeliveryOrderBookRequest */ public APIlistDeliveryOrderBookRequest withId(Boolean withId) { @@ -414,7 +415,7 @@ public APIlistDeliveryOrderBookRequest withId(Boolean withId) { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -428,7 +429,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public FuturesOrderBook execute() throws ApiException { @@ -443,7 +444,7 @@ public FuturesOrderBook execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { @@ -458,7 +459,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { @@ -467,7 +468,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) } /** - * Futures order book + * Query futures market depth information * Bids will be sorted by price from high to low, while asks sorted reversely * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -475,7 +476,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public APIlistDeliveryOrderBookRequest listDeliveryOrderBook(String settle, String contract) { @@ -577,7 +578,7 @@ private APIlistDeliveryTradesRequest(String settle, String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistDeliveryTradesRequest */ public APIlistDeliveryTradesRequest limit(Integer limit) { @@ -587,7 +588,7 @@ public APIlistDeliveryTradesRequest limit(Integer limit) { /** * Set lastId - * @param lastId Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param lastId 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) * @return APIlistDeliveryTradesRequest */ public APIlistDeliveryTradesRequest lastId(String lastId) { @@ -607,7 +608,7 @@ public APIlistDeliveryTradesRequest from(Long from) { /** * Set to - * @param to Specify end time in Unix seconds, default to current time (optional) + * @param to Specify end time in Unix seconds, default to current time. (optional) * @return APIlistDeliveryTradesRequest */ public APIlistDeliveryTradesRequest to(Long to) { @@ -623,7 +624,7 @@ public APIlistDeliveryTradesRequest to(Long to) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -637,7 +638,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -652,7 +653,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -667,7 +668,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -676,7 +677,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback } /** - * Futures trading history + * Futures market transaction records * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -684,7 +685,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistDeliveryTradesRequest listDeliveryTrades(String settle, String contract) { @@ -758,15 +759,15 @@ private okhttp3.Call listDeliveryCandlesticksValidateBeforeCall(String settle, S } - private ApiResponse> listDeliveryCandlesticksWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit, String interval) throws ApiException { + private ApiResponse> listDeliveryCandlesticksWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit, String interval) throws ApiException { okhttp3.Call localVarCall = listDeliveryCandlesticksValidateBeforeCall(settle, contract, from, to, limit, interval, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listDeliveryCandlesticksAsync(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback> _callback) throws ApiException { + private okhttp3.Call listDeliveryCandlesticksAsync(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = listDeliveryCandlesticksValidateBeforeCall(settle, contract, from, to, limit, interval, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -796,7 +797,7 @@ public APIlistDeliveryCandlesticksRequest from(Long from) { /** * Set to - * @param to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param to 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) * @return APIlistDeliveryCandlesticksRequest */ public APIlistDeliveryCandlesticksRequest to(Long to) { @@ -806,7 +807,7 @@ public APIlistDeliveryCandlesticksRequest to(Long to) { /** * Set limit - * @param limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param limit 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) * @return APIlistDeliveryCandlesticksRequest */ public APIlistDeliveryCandlesticksRequest limit(Integer limit) { @@ -816,7 +817,7 @@ public APIlistDeliveryCandlesticksRequest limit(Integer limit) { /** * Set interval - * @param interval Interval time between data points (optional, default to 5m) + * @param interval Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time (optional, default to 5m) * @return APIlistDeliveryCandlesticksRequest */ public APIlistDeliveryCandlesticksRequest interval(String interval) { @@ -832,7 +833,7 @@ public APIlistDeliveryCandlesticksRequest interval(String interval) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -841,30 +842,30 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { /** * Execute listDeliveryCandlesticks request - * @return List<FuturesCandlestick> + * @return List<DeliveryCandlestick> * @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 -
200 Query successful -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listDeliveryCandlesticksWithHttpInfo(settle, contract, from, to, limit, interval); + public List execute() throws ApiException { + ApiResponse> localVarResp = listDeliveryCandlesticksWithHttpInfo(settle, contract, from, to, limit, interval); return localVarResp.getData(); } /** * Execute listDeliveryCandlesticks request with HTTP info returned - * @return ApiResponse<List<FuturesCandlestick>> + * @return ApiResponse<List<DeliveryCandlestick>> * @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 -
200 Query successful -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { + public ApiResponse> executeWithHttpInfo() throws ApiException { return listDeliveryCandlesticksWithHttpInfo(settle, contract, from, to, limit, interval); } @@ -876,16 +877,16 @@ public ApiResponse> executeWithHttpInfo() throws ApiExc * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listDeliveryCandlesticksAsync(settle, contract, from, to, limit, interval, _callback); } } /** - * 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` * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -893,7 +894,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _ca * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistDeliveryCandlesticksRequest listDeliveryCandlesticks(String settle, String contract) { @@ -946,15 +947,15 @@ private okhttp3.Call listDeliveryTickersValidateBeforeCall(String settle, String } - private ApiResponse> listDeliveryTickersWithHttpInfo(String settle, String contract) throws ApiException { + private ApiResponse> listDeliveryTickersWithHttpInfo(String settle, String contract) throws ApiException { okhttp3.Call localVarCall = listDeliveryTickersValidateBeforeCall(settle, contract, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listDeliveryTickersAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { + private okhttp3.Call listDeliveryTickersAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = listDeliveryTickersValidateBeforeCall(settle, contract, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -985,7 +986,7 @@ public APIlistDeliveryTickersRequest contract(String contract) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -994,30 +995,30 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { /** * Execute listDeliveryTickers request - * @return List<FuturesTicker> + * @return List<DeliveryTicker> * @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 -
200 Query successful -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listDeliveryTickersWithHttpInfo(settle, contract); + public List execute() throws ApiException { + ApiResponse> localVarResp = listDeliveryTickersWithHttpInfo(settle, contract); return localVarResp.getData(); } /** * Execute listDeliveryTickers request with HTTP info returned - * @return ApiResponse<List<FuturesTicker>> + * @return ApiResponse<List<DeliveryTicker>> * @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 -
200 Query successful -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { + public ApiResponse> executeWithHttpInfo() throws ApiException { return listDeliveryTickersWithHttpInfo(settle, contract); } @@ -1029,23 +1030,23 @@ public ApiResponse> executeWithHttpInfo() throws ApiExceptio * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listDeliveryTickersAsync(settle, contract, _callback); } } /** - * List futures tickers + * Get all futures trading statistics * * @param settle Settle currency (required) * @return APIlistDeliveryTickersRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistDeliveryTickersRequest listDeliveryTickers(String settle) { @@ -1121,7 +1122,7 @@ private APIlistDeliveryInsuranceLedgerRequest(String settle) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistDeliveryInsuranceLedgerRequest */ public APIlistDeliveryInsuranceLedgerRequest limit(Integer limit) { @@ -1137,7 +1138,7 @@ public APIlistDeliveryInsuranceLedgerRequest limit(Integer limit) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1151,7 +1152,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public List execute() throws ApiException { @@ -1166,7 +1167,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -1181,7 +1182,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1190,14 +1191,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callb } /** - * Futures insurance balance history + * Futures market insurance fund history * * @param settle Settle currency (required) * @return APIlistDeliveryInsuranceLedgerRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistDeliveryInsuranceLedgerRequest listDeliveryInsuranceLedger(String settle) { @@ -1213,7 +1214,7 @@ public APIlistDeliveryInsuranceLedgerRequest listDeliveryInsuranceLedger(String * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listDeliveryAccountsCall(String settle, final ApiCallback _callback) throws ApiException { @@ -1258,7 +1259,7 @@ private okhttp3.Call listDeliveryAccountsValidateBeforeCall(String settle, final } /** - * Query futures account + * Get futures account * * @param settle Settle currency (required) * @return FuturesAccount @@ -1266,7 +1267,7 @@ private okhttp3.Call listDeliveryAccountsValidateBeforeCall(String settle, final * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public FuturesAccount listDeliveryAccounts(String settle) throws ApiException { @@ -1275,7 +1276,7 @@ public FuturesAccount listDeliveryAccounts(String settle) throws ApiException { } /** - * Query futures account + * Get futures account * * @param settle Settle currency (required) * @return ApiResponse<FuturesAccount> @@ -1283,7 +1284,7 @@ public FuturesAccount listDeliveryAccounts(String settle) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse listDeliveryAccountsWithHttpInfo(String settle) throws ApiException { @@ -1293,7 +1294,7 @@ public ApiResponse listDeliveryAccountsWithHttpInfo(String settl } /** - * Query futures account (asynchronously) + * Get futures account (asynchronously) * * @param settle Settle currency (required) * @param _callback The callback to be executed when the API call finishes @@ -1302,7 +1303,7 @@ public ApiResponse listDeliveryAccountsWithHttpInfo(String settl * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listDeliveryAccountsAsync(String settle, final ApiCallback _callback) throws ApiException { @@ -1396,7 +1397,7 @@ private APIlistDeliveryAccountBookRequest(String settle) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistDeliveryAccountBookRequest */ public APIlistDeliveryAccountBookRequest limit(Integer limit) { @@ -1406,7 +1407,7 @@ public APIlistDeliveryAccountBookRequest limit(Integer limit) { /** * Set from - * @param from Start timestamp (optional) + * @param from 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) * @return APIlistDeliveryAccountBookRequest */ public APIlistDeliveryAccountBookRequest from(Long from) { @@ -1416,7 +1417,7 @@ public APIlistDeliveryAccountBookRequest from(Long from) { /** * Set to - * @param to End timestamp (optional) + * @param to 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 APIlistDeliveryAccountBookRequest */ public APIlistDeliveryAccountBookRequest to(Long to) { @@ -1426,7 +1427,7 @@ public APIlistDeliveryAccountBookRequest to(Long to) { /** * Set type - * @param type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) + * @param type 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) * @return APIlistDeliveryAccountBookRequest */ public APIlistDeliveryAccountBookRequest type(String type) { @@ -1442,7 +1443,7 @@ public APIlistDeliveryAccountBookRequest type(String type) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1456,7 +1457,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -1471,7 +1472,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -1486,7 +1487,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExc * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1495,14 +1496,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _ca } /** - * Query account book + * Query futures account change history * * @param settle Settle currency (required) * @return APIlistDeliveryAccountBookRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistDeliveryAccountBookRequest listDeliveryAccountBook(String settle) { @@ -1518,7 +1519,7 @@ public APIlistDeliveryAccountBookRequest listDeliveryAccountBook(String settle) * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listDeliveryPositionsCall(String settle, final ApiCallback _callback) throws ApiException { @@ -1563,7 +1564,7 @@ private okhttp3.Call listDeliveryPositionsValidateBeforeCall(String settle, fina } /** - * List all positions of a user + * Get user position list * * @param settle Settle currency (required) * @return List<Position> @@ -1571,7 +1572,7 @@ private okhttp3.Call listDeliveryPositionsValidateBeforeCall(String settle, fina * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List listDeliveryPositions(String settle) throws ApiException { @@ -1580,7 +1581,7 @@ public List listDeliveryPositions(String settle) throws ApiException { } /** - * List all positions of a user + * Get user position list * * @param settle Settle currency (required) * @return ApiResponse<List<Position>> @@ -1588,7 +1589,7 @@ public List listDeliveryPositions(String settle) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> listDeliveryPositionsWithHttpInfo(String settle) throws ApiException { @@ -1598,7 +1599,7 @@ public ApiResponse> listDeliveryPositionsWithHttpInfo(String sett } /** - * List all positions of a user (asynchronously) + * Get user position list (asynchronously) * * @param settle Settle currency (required) * @param _callback The callback to be executed when the API call finishes @@ -1607,7 +1608,7 @@ public ApiResponse> listDeliveryPositionsWithHttpInfo(String sett * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listDeliveryPositionsAsync(String settle, final ApiCallback> _callback) throws ApiException { @@ -1678,7 +1679,7 @@ private okhttp3.Call getDeliveryPositionValidateBeforeCall(String settle, String } /** - * Get single position + * Get single position information * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -1696,7 +1697,7 @@ public Position getDeliveryPosition(String settle, String contract) throws ApiEx } /** - * Get single position + * Get single position information * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -1715,7 +1716,7 @@ public ApiResponse getDeliveryPositionWithHttpInfo(String settle, Stri } /** - * Get single position (asynchronously) + * Get single position information (asynchronously) * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -1739,7 +1740,7 @@ public okhttp3.Call getDeliveryPositionAsync(String settle, String contract, fin * Build call for updateDeliveryPositionMargin * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1810,7 +1811,7 @@ private okhttp3.Call updateDeliveryPositionMarginValidateBeforeCall(String settl * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @return Position * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1829,7 +1830,7 @@ public Position updateDeliveryPositionMargin(String settle, String contract, Str * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @return ApiResponse<Position> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1849,7 +1850,7 @@ public ApiResponse updateDeliveryPositionMarginWithHttpInfo(String set * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @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 @@ -2238,7 +2239,7 @@ public APIlistDeliveryOrdersRequest contract(String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistDeliveryOrdersRequest */ public APIlistDeliveryOrdersRequest limit(Integer limit) { @@ -2258,7 +2259,7 @@ public APIlistDeliveryOrdersRequest offset(Integer offset) { /** * Set lastId - * @param lastId Specify list staring point using the `id` of last record in previous list-query results (optional) + * @param lastId 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 APIlistDeliveryOrdersRequest */ public APIlistDeliveryOrdersRequest lastId(String lastId) { @@ -2268,7 +2269,7 @@ public APIlistDeliveryOrdersRequest lastId(String lastId) { /** * Set countTotal - * @param countTotal Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param countTotal Whether to return total number matched, defaults to 0 (no return) (optional, default to 0) * @return APIlistDeliveryOrdersRequest */ public APIlistDeliveryOrdersRequest countTotal(Integer countTotal) { @@ -2284,7 +2285,7 @@ public APIlistDeliveryOrdersRequest countTotal(Integer countTotal) { * @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
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2298,7 +2299,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @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
*/ public List execute() throws ApiException { @@ -2313,7 +2314,7 @@ public List execute() throws ApiException { * @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
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -2328,7 +2329,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @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
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -2337,15 +2338,15 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback } /** - * List futures orders - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Query futures order list + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) - * @param status Only list the orders with this status (required) + * @param status Query order list based on status (required) * @return APIlistDeliveryOrdersRequest * @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
*/ public APIlistDeliveryOrdersRequest listDeliveryOrders(String settle, String status) { @@ -2412,8 +2413,8 @@ private okhttp3.Call createDeliveryOrderValidateBeforeCall(String settle, Future } /** - * Create a futures order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Place futures order + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param futuresOrder (required) * @return FuturesOrder @@ -2430,8 +2431,8 @@ public FuturesOrder createDeliveryOrder(String settle, FuturesOrder futuresOrder } /** - * Create a futures order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Place futures order + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param futuresOrder (required) * @return ApiResponse<FuturesOrder> @@ -2449,8 +2450,8 @@ public ApiResponse createDeliveryOrderWithHttpInfo(String settle, } /** - * Create a futures order (asynchronously) - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Place futures order (asynchronously) + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param futuresOrder (required) * @param _callback The callback to be executed when the API call finishes @@ -2473,14 +2474,14 @@ public okhttp3.Call createDeliveryOrderAsync(String settle, FuturesOrder futures * Build call for cancelDeliveryOrders * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ public okhttp3.Call cancelDeliveryOrdersCall(String settle, String contract, String side, final ApiCallback _callback) throws ApiException { @@ -2538,17 +2539,17 @@ private okhttp3.Call cancelDeliveryOrdersValidateBeforeCall(String settle, Strin } /** - * Cancel all `open` orders matched - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Cancel all orders with 'open' status + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) * @return List<FuturesOrder> * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ public List cancelDeliveryOrders(String settle, String contract, String side) throws ApiException { @@ -2557,17 +2558,17 @@ public List cancelDeliveryOrders(String settle, String contract, S } /** - * Cancel all `open` orders matched - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Cancel all orders with 'open' status + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) * @return ApiResponse<List<FuturesOrder>> * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ public ApiResponse> cancelDeliveryOrdersWithHttpInfo(String settle, String contract, String side) throws ApiException { @@ -2577,18 +2578,18 @@ public ApiResponse> cancelDeliveryOrdersWithHttpInfo(String s } /** - * Cancel all `open` orders matched (asynchronously) - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Cancel all orders with 'open' status (asynchronously) + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ public okhttp3.Call cancelDeliveryOrdersAsync(String settle, String contract, String side, final ApiCallback> _callback) throws ApiException { @@ -2601,7 +2602,7 @@ public okhttp3.Call cancelDeliveryOrdersAsync(String settle, String contract, St /** * Build call for getDeliveryOrder * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2659,10 +2660,10 @@ private okhttp3.Call getDeliveryOrderValidateBeforeCall(String settle, String or } /** - * Get a single order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Query single order details + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return FuturesOrder * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2677,10 +2678,10 @@ public FuturesOrder getDeliveryOrder(String settle, String orderId) throws ApiEx } /** - * Get a single order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Query single order details + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<FuturesOrder> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2696,10 +2697,10 @@ public ApiResponse getDeliveryOrderWithHttpInfo(String settle, Str } /** - * Get a single order (asynchronously) - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Query single order details (asynchronously) + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 @@ -2719,7 +2720,7 @@ public okhttp3.Call getDeliveryOrderAsync(String settle, String orderId, final A /** * Build call for cancelDeliveryOrder * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2777,10 +2778,10 @@ private okhttp3.Call cancelDeliveryOrderValidateBeforeCall(String settle, String } /** - * Cancel a single order + * Cancel single order * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return FuturesOrder * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2795,10 +2796,10 @@ public FuturesOrder cancelDeliveryOrder(String settle, String orderId) throws Ap } /** - * Cancel a single order + * Cancel single order * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<FuturesOrder> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2814,10 +2815,10 @@ public ApiResponse cancelDeliveryOrderWithHttpInfo(String settle, } /** - * Cancel a single order (asynchronously) + * Cancel single order (asynchronously) * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 @@ -2948,7 +2949,7 @@ public APIgetMyDeliveryTradesRequest order(Long order) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIgetMyDeliveryTradesRequest */ public APIgetMyDeliveryTradesRequest limit(Integer limit) { @@ -2968,7 +2969,7 @@ public APIgetMyDeliveryTradesRequest offset(Integer offset) { /** * Set lastId - * @param lastId Specify list staring point using the `id` of last record in previous list-query results (optional) + * @param lastId 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 APIgetMyDeliveryTradesRequest */ public APIgetMyDeliveryTradesRequest lastId(String lastId) { @@ -2978,7 +2979,7 @@ public APIgetMyDeliveryTradesRequest lastId(String lastId) { /** * Set countTotal - * @param countTotal Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param countTotal Whether to return total number matched, defaults to 0 (no return) (optional, default to 0) * @return APIgetMyDeliveryTradesRequest */ public APIgetMyDeliveryTradesRequest countTotal(Integer countTotal) { @@ -2994,7 +2995,7 @@ public APIgetMyDeliveryTradesRequest countTotal(Integer countTotal) { * @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
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -3008,7 +3009,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @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
*/ public List execute() throws ApiException { @@ -3023,7 +3024,7 @@ public List execute() throws ApiException { * @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
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -3038,7 +3039,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcepti * @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
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -3047,14 +3048,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callba } /** - * List personal trading history + * Query personal trading records * * @param settle Settle currency (required) * @return APIgetMyDeliveryTradesRequest * @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
*/ public APIgetMyDeliveryTradesRequest getMyDeliveryTrades(String settle) { @@ -3145,7 +3146,7 @@ public APIlistDeliveryPositionCloseRequest contract(String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistDeliveryPositionCloseRequest */ public APIlistDeliveryPositionCloseRequest limit(Integer limit) { @@ -3161,7 +3162,7 @@ public APIlistDeliveryPositionCloseRequest limit(Integer limit) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -3175,7 +3176,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -3190,7 +3191,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -3205,7 +3206,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExceptio * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -3214,14 +3215,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callbac } /** - * List position close history + * Query position close history * * @param settle Settle currency (required) * @return APIlistDeliveryPositionCloseRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistDeliveryPositionCloseRequest listDeliveryPositionClose(String settle) { @@ -3317,7 +3318,7 @@ public APIlistDeliveryLiquidatesRequest contract(String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistDeliveryLiquidatesRequest */ public APIlistDeliveryLiquidatesRequest limit(Integer limit) { @@ -3327,7 +3328,7 @@ public APIlistDeliveryLiquidatesRequest limit(Integer limit) { /** * Set at - * @param at Specify a liquidation timestamp (optional, default to 0) + * @param at Specify liquidation timestamp (optional, default to 0) * @return APIlistDeliveryLiquidatesRequest */ public APIlistDeliveryLiquidatesRequest at(Integer at) { @@ -3343,7 +3344,7 @@ public APIlistDeliveryLiquidatesRequest at(Integer at) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -3357,7 +3358,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -3372,7 +3373,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -3387,7 +3388,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcep * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -3396,14 +3397,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _call } /** - * List liquidation history + * Query liquidation history * * @param settle Settle currency (required) * @return APIlistDeliveryLiquidatesRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistDeliveryLiquidatesRequest listDeliveryLiquidates(String settle) { @@ -3499,7 +3500,7 @@ public APIlistDeliverySettlementsRequest contract(String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistDeliverySettlementsRequest */ public APIlistDeliverySettlementsRequest limit(Integer limit) { @@ -3509,7 +3510,7 @@ public APIlistDeliverySettlementsRequest limit(Integer limit) { /** * Set at - * @param at Specify a settlement timestamp (optional, default to 0) + * @param at Specify settlement timestamp (optional, default to 0) * @return APIlistDeliverySettlementsRequest */ public APIlistDeliverySettlementsRequest at(Integer at) { @@ -3525,7 +3526,7 @@ public APIlistDeliverySettlementsRequest at(Integer at) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -3539,7 +3540,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -3554,7 +3555,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -3569,7 +3570,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExc * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -3578,20 +3579,202 @@ public okhttp3.Call executeAsync(final ApiCallback> _ca } /** - * List settlement history + * Query settlement records * * @param settle Settle currency (required) * @return APIlistDeliverySettlementsRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistDeliverySettlementsRequest listDeliverySettlements(String settle) { return new APIlistDeliverySettlementsRequest(settle); } + private okhttp3.Call listDeliveryRiskLimitTiersCall(String settle, String contract, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/delivery/{settle}/risk_limit_tiers" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listDeliveryRiskLimitTiersValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling listDeliveryRiskLimitTiers(Async)"); + } + + okhttp3.Call localVarCall = listDeliveryRiskLimitTiersCall(settle, contract, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse> listDeliveryRiskLimitTiersWithHttpInfo(String settle, String contract, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = listDeliveryRiskLimitTiersValidateBeforeCall(settle, contract, limit, offset, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listDeliveryRiskLimitTiersAsync(String settle, String contract, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listDeliveryRiskLimitTiersValidateBeforeCall(settle, contract, limit, offset, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistDeliveryRiskLimitTiersRequest { + private final String settle; + private String contract; + private Integer limit; + private Integer offset; + + private APIlistDeliveryRiskLimitTiersRequest(String settle) { + this.settle = settle; + } + + /** + * Set contract + * @param contract Futures contract (optional) + * @return APIlistDeliveryRiskLimitTiersRequest + */ + public APIlistDeliveryRiskLimitTiersRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistDeliveryRiskLimitTiersRequest + */ + public APIlistDeliveryRiskLimitTiersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistDeliveryRiskLimitTiersRequest + */ + public APIlistDeliveryRiskLimitTiersRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for listDeliveryRiskLimitTiers + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listDeliveryRiskLimitTiersCall(settle, contract, limit, offset, _callback); + } + + /** + * Execute listDeliveryRiskLimitTiers request + * @return List<FuturesLimitRiskTiers> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listDeliveryRiskLimitTiersWithHttpInfo(settle, contract, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute listDeliveryRiskLimitTiers request with HTTP info returned + * @return ApiResponse<List<FuturesLimitRiskTiers>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listDeliveryRiskLimitTiersWithHttpInfo(settle, contract, limit, offset); + } + + /** + * Execute listDeliveryRiskLimitTiers request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listDeliveryRiskLimitTiersAsync(settle, contract, limit, offset, _callback); + } + } + + /** + * 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. + * @param settle Settle currency (required) + * @return APIlistDeliveryRiskLimitTiersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistDeliveryRiskLimitTiersRequest listDeliveryRiskLimitTiers(String settle) { + return new APIlistDeliveryRiskLimitTiersRequest(settle); + } + private okhttp3.Call listPriceTriggeredDeliveryOrdersCall(String settle, String status, String contract, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; @@ -3692,7 +3875,7 @@ public APIlistPriceTriggeredDeliveryOrdersRequest contract(String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistPriceTriggeredDeliveryOrdersRequest */ public APIlistPriceTriggeredDeliveryOrdersRequest limit(Integer limit) { @@ -3718,7 +3901,7 @@ public APIlistPriceTriggeredDeliveryOrdersRequest offset(Integer offset) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -3732,7 +3915,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -3747,7 +3930,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -3762,7 +3945,7 @@ public ApiResponse> executeWithHttpInfo() throw * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -3771,15 +3954,15 @@ public okhttp3.Call executeAsync(final ApiCallback Status Code Description Response Headers - 200 List retrieved - + 200 List retrieved successfully - */ public APIlistPriceTriggeredDeliveryOrdersRequest listPriceTriggeredDeliveryOrders(String settle, String status) { @@ -3796,7 +3979,7 @@ public APIlistPriceTriggeredDeliveryOrdersRequest listPriceTriggeredDeliveryOrde * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public okhttp3.Call createPriceTriggeredDeliveryOrderCall(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder, final ApiCallback _callback) throws ApiException { @@ -3846,7 +4029,7 @@ private okhttp3.Call createPriceTriggeredDeliveryOrderValidateBeforeCall(String } /** - * Create a price-triggered order + * Create price-triggered order * * @param settle Settle currency (required) * @param futuresPriceTriggeredOrder (required) @@ -3855,7 +4038,7 @@ private okhttp3.Call createPriceTriggeredDeliveryOrderValidateBeforeCall(String * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public TriggerOrderResponse createPriceTriggeredDeliveryOrder(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder) throws ApiException { @@ -3864,7 +4047,7 @@ public TriggerOrderResponse createPriceTriggeredDeliveryOrder(String settle, Fut } /** - * Create a price-triggered order + * Create price-triggered order * * @param settle Settle currency (required) * @param futuresPriceTriggeredOrder (required) @@ -3873,7 +4056,7 @@ public TriggerOrderResponse createPriceTriggeredDeliveryOrder(String settle, Fut * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public ApiResponse createPriceTriggeredDeliveryOrderWithHttpInfo(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder) throws ApiException { @@ -3883,7 +4066,7 @@ public ApiResponse createPriceTriggeredDeliveryOrderWithHt } /** - * Create a price-triggered order (asynchronously) + * Create price-triggered order (asynchronously) * * @param settle Settle currency (required) * @param futuresPriceTriggeredOrder (required) @@ -3893,7 +4076,7 @@ public ApiResponse createPriceTriggeredDeliveryOrderWithHt * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public okhttp3.Call createPriceTriggeredDeliveryOrderAsync(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder, final ApiCallback _callback) throws ApiException { @@ -3913,7 +4096,7 @@ public okhttp3.Call createPriceTriggeredDeliveryOrderAsync(String settle, Future * @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 -
*/ public okhttp3.Call cancelPriceTriggeredDeliveryOrderListCall(String settle, String contract, final ApiCallback _callback) throws ApiException { @@ -3967,7 +4150,7 @@ private okhttp3.Call cancelPriceTriggeredDeliveryOrderListValidateBeforeCall(Str } /** - * Cancel all open orders + * Cancel all auto orders * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -3976,7 +4159,7 @@ private okhttp3.Call cancelPriceTriggeredDeliveryOrderListValidateBeforeCall(Str * @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 -
*/ public List cancelPriceTriggeredDeliveryOrderList(String settle, String contract) throws ApiException { @@ -3985,7 +4168,7 @@ public List cancelPriceTriggeredDeliveryOrderList(St } /** - * Cancel all open orders + * Cancel all auto orders * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -3994,7 +4177,7 @@ public List cancelPriceTriggeredDeliveryOrderList(St * @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 -
*/ public ApiResponse> cancelPriceTriggeredDeliveryOrderListWithHttpInfo(String settle, String contract) throws ApiException { @@ -4004,7 +4187,7 @@ public ApiResponse> cancelPriceTriggeredDeliver } /** - * Cancel all open orders (asynchronously) + * Cancel all auto orders (asynchronously) * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -4014,7 +4197,7 @@ public ApiResponse> cancelPriceTriggeredDeliver * @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 -
*/ public okhttp3.Call cancelPriceTriggeredDeliveryOrderListAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { @@ -4027,14 +4210,14 @@ public okhttp3.Call cancelPriceTriggeredDeliveryOrderListAsync(String settle, St /** * Build call for getPriceTriggeredDeliveryOrder * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call getPriceTriggeredDeliveryOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { @@ -4085,16 +4268,16 @@ private okhttp3.Call getPriceTriggeredDeliveryOrderValidateBeforeCall(String set } /** - * Get a single order + * Query single auto order details * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return FuturesPriceTriggeredOrder * @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 Auto order detail -
200 Auto order details -
*/ public FuturesPriceTriggeredOrder getPriceTriggeredDeliveryOrder(String settle, String orderId) throws ApiException { @@ -4103,16 +4286,16 @@ public FuturesPriceTriggeredOrder getPriceTriggeredDeliveryOrder(String settle, } /** - * Get a single order + * Query single auto order details * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<FuturesPriceTriggeredOrder> * @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 Auto order detail -
200 Auto order details -
*/ public ApiResponse getPriceTriggeredDeliveryOrderWithHttpInfo(String settle, String orderId) throws ApiException { @@ -4122,17 +4305,17 @@ public ApiResponse getPriceTriggeredDeliveryOrderWit } /** - * Get a single order (asynchronously) + * Query single auto order details (asynchronously) * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call getPriceTriggeredDeliveryOrderAsync(String settle, String orderId, final ApiCallback _callback) throws ApiException { @@ -4145,14 +4328,14 @@ public okhttp3.Call getPriceTriggeredDeliveryOrderAsync(String settle, String or /** * Build call for cancelPriceTriggeredDeliveryOrder * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call cancelPriceTriggeredDeliveryOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { @@ -4203,16 +4386,16 @@ private okhttp3.Call cancelPriceTriggeredDeliveryOrderValidateBeforeCall(String } /** - * Cancel a single order + * Cancel single auto order * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return FuturesPriceTriggeredOrder * @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 Auto order detail -
200 Auto order details -
*/ public FuturesPriceTriggeredOrder cancelPriceTriggeredDeliveryOrder(String settle, String orderId) throws ApiException { @@ -4221,16 +4404,16 @@ public FuturesPriceTriggeredOrder cancelPriceTriggeredDeliveryOrder(String settl } /** - * Cancel a single order + * Cancel single auto order * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<FuturesPriceTriggeredOrder> * @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 Auto order detail -
200 Auto order details -
*/ public ApiResponse cancelPriceTriggeredDeliveryOrderWithHttpInfo(String settle, String orderId) throws ApiException { @@ -4240,17 +4423,17 @@ public ApiResponse cancelPriceTriggeredDeliveryOrder } /** - * Cancel a single order (asynchronously) + * Cancel single auto order (asynchronously) * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call cancelPriceTriggeredDeliveryOrderAsync(String settle, String orderId, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/io/gate/gateapi/api/EarnApi.java b/src/main/java/io/gate/gateapi/api/EarnApi.java new file mode 100644 index 0000000..78ffd05 --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/EarnApi.java @@ -0,0 +1,1385 @@ +/* + * 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.DualGetOrders; +import io.gate.gateapi.models.DualGetPlans; +import io.gate.gateapi.models.Eth2RateList; +import io.gate.gateapi.models.Eth2Swap; +import io.gate.gateapi.models.FindCoin; +import io.gate.gateapi.models.PlaceDualInvestmentOrder; +import io.gate.gateapi.models.StructuredBuy; +import io.gate.gateapi.models.StructuredGetProjectList; +import io.gate.gateapi.models.StructuredOrderList; +import io.gate.gateapi.models.SwapCoin; +import io.gate.gateapi.models.SwapCoinStruct; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EarnApi { + private ApiClient localVarApiClient; + + public EarnApi() { + this(Configuration.getDefaultApiClient()); + } + + public EarnApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for swapETH2 + * @param eth2Swap (required) + * @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 Swap successful -
+ */ + public okhttp3.Call swapETH2Call(Eth2Swap eth2Swap, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = eth2Swap; + + // create path and map variables + String localVarPath = "/earn/staking/eth2/swap"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call swapETH2ValidateBeforeCall(Eth2Swap eth2Swap, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'eth2Swap' is set + if (eth2Swap == null) { + throw new ApiException("Missing the required parameter 'eth2Swap' when calling swapETH2(Async)"); + } + + okhttp3.Call localVarCall = swapETH2Call(eth2Swap, _callback); + return localVarCall; + } + + /** + * ETH2 swap + * + * @param eth2Swap (required) + * @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 Swap successful -
+ */ + public void swapETH2(Eth2Swap eth2Swap) throws ApiException { + swapETH2WithHttpInfo(eth2Swap); + } + + /** + * ETH2 swap + * + * @param eth2Swap (required) + * @return ApiResponse<Void> + * @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 Swap successful -
+ */ + public ApiResponse swapETH2WithHttpInfo(Eth2Swap eth2Swap) throws ApiException { + okhttp3.Call localVarCall = swapETH2ValidateBeforeCall(eth2Swap, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * ETH2 swap (asynchronously) + * + * @param eth2Swap (required) + * @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 Swap successful -
+ */ + public okhttp3.Call swapETH2Async(Eth2Swap eth2Swap, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = swapETH2ValidateBeforeCall(eth2Swap, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for rateListETH2 + * @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 rateListETH2Call(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/staking/eth2/rate_records"; + + 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 rateListETH2ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = rateListETH2Call(_callback); + return localVarCall; + } + + /** + * ETH2 historical return rate query + * Query ETH earnings rate records for the last 31 days + * @return List<Eth2RateList> + * @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 rateListETH2() throws ApiException { + ApiResponse> localVarResp = rateListETH2WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * ETH2 historical return rate query + * Query ETH earnings rate records for the last 31 days + * @return ApiResponse<List<Eth2RateList>> + * @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> rateListETH2WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = rateListETH2ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * ETH2 historical return rate query (asynchronously) + * Query ETH earnings rate records for the last 31 days + * @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 rateListETH2Async(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = rateListETH2ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listDualInvestmentPlansCall(Long planId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/dual/investment_plan"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (planId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("plan_id", planId)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listDualInvestmentPlansValidateBeforeCall(Long planId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listDualInvestmentPlansCall(planId, _callback); + return localVarCall; + } + + + private ApiResponse> listDualInvestmentPlansWithHttpInfo(Long planId) throws ApiException { + okhttp3.Call localVarCall = listDualInvestmentPlansValidateBeforeCall(planId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listDualInvestmentPlansAsync(Long planId, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listDualInvestmentPlansValidateBeforeCall(planId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistDualInvestmentPlansRequest { + private Long planId; + + private APIlistDualInvestmentPlansRequest() { + } + + /** + * Set planId + * @param planId Financial project ID (optional) + * @return APIlistDualInvestmentPlansRequest + */ + public APIlistDualInvestmentPlansRequest planId(Long planId) { + this.planId = planId; + return this; + } + + /** + * Build call for listDualInvestmentPlans + * @param _callback ApiCallback API callback + * @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 buildCall(final ApiCallback _callback) throws ApiException { + return listDualInvestmentPlansCall(planId, _callback); + } + + /** + * Execute listDualInvestmentPlans request + * @return List<DualGetPlans> + * @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 execute() throws ApiException { + ApiResponse> localVarResp = listDualInvestmentPlansWithHttpInfo(planId); + return localVarResp.getData(); + } + + /** + * Execute listDualInvestmentPlans request with HTTP info returned + * @return ApiResponse<List<DualGetPlans>> + * @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> executeWithHttpInfo() throws ApiException { + return listDualInvestmentPlansWithHttpInfo(planId); + } + + /** + * Execute listDualInvestmentPlans request (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 executeAsync(final ApiCallback> _callback) throws ApiException { + return listDualInvestmentPlansAsync(planId, _callback); + } + } + + /** + * Dual Investment product list + * + * @return APIlistDualInvestmentPlansRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Successfully retrieved -
+ */ + public APIlistDualInvestmentPlansRequest listDualInvestmentPlans() { + return new APIlistDualInvestmentPlansRequest(); + } + + private okhttp3.Call listDualOrdersCall(Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/dual/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 listDualOrdersValidateBeforeCall(Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listDualOrdersCall(from, to, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listDualOrdersWithHttpInfo(Long from, Long to, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listDualOrdersValidateBeforeCall(from, to, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listDualOrdersAsync(Long from, Long to, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listDualOrdersValidateBeforeCall(from, to, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistDualOrdersRequest { + private Long from; + private Long to; + private Integer page; + private Integer limit; + + private APIlistDualOrdersRequest() { + } + + /** + * Set from + * @param from Start settlement time (optional) + * @return APIlistDualOrdersRequest + */ + public APIlistDualOrdersRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End settlement time (optional) + * @return APIlistDualOrdersRequest + */ + public APIlistDualOrdersRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistDualOrdersRequest + */ + public APIlistDualOrdersRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistDualOrdersRequest + */ + public APIlistDualOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listDualOrders + * @param _callback ApiCallback API callback + * @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 buildCall(final ApiCallback _callback) throws ApiException { + return listDualOrdersCall(from, to, page, limit, _callback); + } + + /** + * Execute listDualOrders request + * @return List<DualGetOrders> + * @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 execute() throws ApiException { + ApiResponse> localVarResp = listDualOrdersWithHttpInfo(from, to, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listDualOrders request with HTTP info returned + * @return ApiResponse<List<DualGetOrders>> + * @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> executeWithHttpInfo() throws ApiException { + return listDualOrdersWithHttpInfo(from, to, page, limit); + } + + /** + * Execute listDualOrders request (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 executeAsync(final ApiCallback> _callback) throws ApiException { + return listDualOrdersAsync(from, to, page, limit, _callback); + } + } + + /** + * Dual Investment order list + * + * @return APIlistDualOrdersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Successfully retrieved -
+ */ + public APIlistDualOrdersRequest listDualOrders() { + return new APIlistDualOrdersRequest(); + } + + /** + * Build call for placeDualOrder + * @param placeDualInvestmentOrder (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call placeDualOrderCall(PlaceDualInvestmentOrder placeDualInvestmentOrder, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = placeDualInvestmentOrder; + + // create path and map variables + String localVarPath = "/earn/dual/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call placeDualOrderValidateBeforeCall(PlaceDualInvestmentOrder placeDualInvestmentOrder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'placeDualInvestmentOrder' is set + if (placeDualInvestmentOrder == null) { + throw new ApiException("Missing the required parameter 'placeDualInvestmentOrder' when calling placeDualOrder(Async)"); + } + + okhttp3.Call localVarCall = placeDualOrderCall(placeDualInvestmentOrder, _callback); + return localVarCall; + } + + /** + * Place Dual Investment order + * + * @param placeDualInvestmentOrder (required) + * @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 Order placed successfully -
+ */ + public void placeDualOrder(PlaceDualInvestmentOrder placeDualInvestmentOrder) throws ApiException { + placeDualOrderWithHttpInfo(placeDualInvestmentOrder); + } + + /** + * Place Dual Investment order + * + * @param placeDualInvestmentOrder (required) + * @return ApiResponse<Void> + * @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 Order placed successfully -
+ */ + public ApiResponse placeDualOrderWithHttpInfo(PlaceDualInvestmentOrder placeDualInvestmentOrder) throws ApiException { + okhttp3.Call localVarCall = placeDualOrderValidateBeforeCall(placeDualInvestmentOrder, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Place Dual Investment order (asynchronously) + * + * @param placeDualInvestmentOrder (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call placeDualOrderAsync(PlaceDualInvestmentOrder placeDualInvestmentOrder, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = placeDualOrderValidateBeforeCall(placeDualInvestmentOrder, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + private okhttp3.Call listStructuredProductsCall(String status, String type, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/structured/products"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listStructuredProductsValidateBeforeCall(String status, String type, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException("Missing the required parameter 'status' when calling listStructuredProducts(Async)"); + } + + okhttp3.Call localVarCall = listStructuredProductsCall(status, type, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listStructuredProductsWithHttpInfo(String status, String type, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listStructuredProductsValidateBeforeCall(status, type, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listStructuredProductsAsync(String status, String type, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listStructuredProductsValidateBeforeCall(status, type, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistStructuredProductsRequest { + private final String status; + private String type; + private Integer page; + private Integer limit; + + private APIlistStructuredProductsRequest(String status) { + this.status = status; + } + + /** + * Set type + * @param type 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) + * @return APIlistStructuredProductsRequest + */ + public APIlistStructuredProductsRequest type(String type) { + this.type = type; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistStructuredProductsRequest + */ + public APIlistStructuredProductsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistStructuredProductsRequest + */ + public APIlistStructuredProductsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listStructuredProducts + * @param _callback ApiCallback API callback + * @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 buildCall(final ApiCallback _callback) throws ApiException { + return listStructuredProductsCall(status, type, page, limit, _callback); + } + + /** + * Execute listStructuredProducts request + * @return List<StructuredGetProjectList> + * @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 execute() throws ApiException { + ApiResponse> localVarResp = listStructuredProductsWithHttpInfo(status, type, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listStructuredProducts request with HTTP info returned + * @return ApiResponse<List<StructuredGetProjectList>> + * @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> executeWithHttpInfo() throws ApiException { + return listStructuredProductsWithHttpInfo(status, type, page, limit); + } + + /** + * Execute listStructuredProducts request (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 executeAsync(final ApiCallback> _callback) throws ApiException { + return listStructuredProductsAsync(status, type, page, limit, _callback); + } + } + + /** + * Structured Product List + * + * @param status Status (Default empty to query all) `in_process`-In progress `will_begin`-Not started `wait_settlement`-Pending settlement `done`-Completed (required) + * @return APIlistStructuredProductsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Successfully retrieved -
+ */ + public APIlistStructuredProductsRequest listStructuredProducts(String status) { + return new APIlistStructuredProductsRequest(status); + } + + private okhttp3.Call listStructuredOrdersCall(Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/structured/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 listStructuredOrdersValidateBeforeCall(Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listStructuredOrdersCall(from, to, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listStructuredOrdersWithHttpInfo(Long from, Long to, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listStructuredOrdersValidateBeforeCall(from, to, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listStructuredOrdersAsync(Long from, Long to, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listStructuredOrdersValidateBeforeCall(from, to, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistStructuredOrdersRequest { + private Long from; + private Long to; + private Integer page; + private Integer limit; + + private APIlistStructuredOrdersRequest() { + } + + /** + * Set from + * @param from 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) + * @return APIlistStructuredOrdersRequest + */ + public APIlistStructuredOrdersRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistStructuredOrdersRequest + */ + public APIlistStructuredOrdersRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistStructuredOrdersRequest + */ + public APIlistStructuredOrdersRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistStructuredOrdersRequest + */ + public APIlistStructuredOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listStructuredOrders + * @param _callback ApiCallback API callback + * @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 buildCall(final ApiCallback _callback) throws ApiException { + return listStructuredOrdersCall(from, to, page, limit, _callback); + } + + /** + * Execute listStructuredOrders request + * @return List<StructuredOrderList> + * @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 execute() throws ApiException { + ApiResponse> localVarResp = listStructuredOrdersWithHttpInfo(from, to, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listStructuredOrders request with HTTP info returned + * @return ApiResponse<List<StructuredOrderList>> + * @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> executeWithHttpInfo() throws ApiException { + return listStructuredOrdersWithHttpInfo(from, to, page, limit); + } + + /** + * Execute listStructuredOrders request (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 executeAsync(final ApiCallback> _callback) throws ApiException { + return listStructuredOrdersAsync(from, to, page, limit, _callback); + } + } + + /** + * Structured Product Order List + * + * @return APIlistStructuredOrdersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Successfully retrieved -
+ */ + public APIlistStructuredOrdersRequest listStructuredOrders() { + return new APIlistStructuredOrdersRequest(); + } + + /** + * Build call for placeStructuredOrder + * @param structuredBuy (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call placeStructuredOrderCall(StructuredBuy structuredBuy, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = structuredBuy; + + // create path and map variables + String localVarPath = "/earn/structured/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call placeStructuredOrderValidateBeforeCall(StructuredBuy structuredBuy, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'structuredBuy' is set + if (structuredBuy == null) { + throw new ApiException("Missing the required parameter 'structuredBuy' when calling placeStructuredOrder(Async)"); + } + + okhttp3.Call localVarCall = placeStructuredOrderCall(structuredBuy, _callback); + return localVarCall; + } + + /** + * Place Structured Product Order + * + * @param structuredBuy (required) + * @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 Order placed successfully -
+ */ + public void placeStructuredOrder(StructuredBuy structuredBuy) throws ApiException { + placeStructuredOrderWithHttpInfo(structuredBuy); + } + + /** + * Place Structured Product Order + * + * @param structuredBuy (required) + * @return ApiResponse<Void> + * @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 Order placed successfully -
+ */ + public ApiResponse placeStructuredOrderWithHttpInfo(StructuredBuy structuredBuy) throws ApiException { + okhttp3.Call localVarCall = placeStructuredOrderValidateBeforeCall(structuredBuy, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Place Structured Product Order (asynchronously) + * + * @param structuredBuy (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call placeStructuredOrderAsync(StructuredBuy structuredBuy, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = placeStructuredOrderValidateBeforeCall(structuredBuy, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for findCoin + * @param findCoin (required) + * @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 findCoinCall(FindCoin findCoin, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = findCoin; + + // create path and map variables + String localVarPath = "/earn/staking/coins"; + + 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 = { + "application/json" + }; + 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 findCoinValidateBeforeCall(FindCoin findCoin, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'findCoin' is set + if (findCoin == null) { + throw new ApiException("Missing the required parameter 'findCoin' when calling findCoin(Async)"); + } + + okhttp3.Call localVarCall = findCoinCall(findCoin, _callback); + return localVarCall; + } + + /** + * Staking coins + * + * @param findCoin (required) + * @return Object + * @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 Object findCoin(FindCoin findCoin) throws ApiException { + ApiResponse localVarResp = findCoinWithHttpInfo(findCoin); + return localVarResp.getData(); + } + + /** + * Staking coins + * + * @param findCoin (required) + * @return ApiResponse<Object> + * @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 findCoinWithHttpInfo(FindCoin findCoin) throws ApiException { + okhttp3.Call localVarCall = findCoinValidateBeforeCall(findCoin, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Staking coins (asynchronously) + * + * @param findCoin (required) + * @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 findCoinAsync(FindCoin findCoin, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = findCoinValidateBeforeCall(findCoin, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for swapStakingCoin + * @param swapCoin (required) + * @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 Swap successful -
+ */ + public okhttp3.Call swapStakingCoinCall(SwapCoin swapCoin, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = swapCoin; + + // create path and map variables + String localVarPath = "/earn/staking/swap"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call swapStakingCoinValidateBeforeCall(SwapCoin swapCoin, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'swapCoin' is set + if (swapCoin == null) { + throw new ApiException("Missing the required parameter 'swapCoin' when calling swapStakingCoin(Async)"); + } + + okhttp3.Call localVarCall = swapStakingCoinCall(swapCoin, _callback); + return localVarCall; + } + + /** + * On-chain token swap for earned coins + * + * @param swapCoin (required) + * @return SwapCoinStruct + * @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 Swap successful -
+ */ + public SwapCoinStruct swapStakingCoin(SwapCoin swapCoin) throws ApiException { + ApiResponse localVarResp = swapStakingCoinWithHttpInfo(swapCoin); + return localVarResp.getData(); + } + + /** + * On-chain token swap for earned coins + * + * @param swapCoin (required) + * @return ApiResponse<SwapCoinStruct> + * @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 Swap successful -
+ */ + public ApiResponse swapStakingCoinWithHttpInfo(SwapCoin swapCoin) throws ApiException { + okhttp3.Call localVarCall = swapStakingCoinValidateBeforeCall(swapCoin, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * On-chain token swap for earned coins (asynchronously) + * + * @param swapCoin (required) + * @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 Swap successful -
+ */ + public okhttp3.Call swapStakingCoinAsync(SwapCoin swapCoin, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = swapStakingCoinValidateBeforeCall(swapCoin, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/EarnUniApi.java b/src/main/java/io/gate/gateapi/api/EarnUniApi.java new file mode 100644 index 0000000..c6a53ed --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/EarnUniApi.java @@ -0,0 +1,1516 @@ +/* + * 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.CreateUniLend; +import io.gate.gateapi.models.InlineResponse200; +import io.gate.gateapi.models.InlineResponse2001; +import io.gate.gateapi.models.PatchUniLend; +import io.gate.gateapi.models.UniCurrency; +import io.gate.gateapi.models.UniCurrencyInterest; +import io.gate.gateapi.models.UniInterestRecord; +import io.gate.gateapi.models.UniLend; +import io.gate.gateapi.models.UniLendInterest; +import io.gate.gateapi.models.UniLendRecord; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EarnUniApi { + private ApiClient localVarApiClient; + + public EarnUniApi() { + this(Configuration.getDefaultApiClient()); + } + + public EarnUniApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for listUniCurrencies + * @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 Query successful -
+ */ + public okhttp3.Call listUniCurrenciesCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/currencies"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUniCurrenciesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniCurrenciesCall(_callback); + return localVarCall; + } + + /** + * Query lending currency list + * + * @return List<UniCurrency> + * @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 Query successful -
+ */ + public List listUniCurrencies() throws ApiException { + ApiResponse> localVarResp = listUniCurrenciesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query lending currency list + * + * @return ApiResponse<List<UniCurrency>> + * @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 Query successful -
+ */ + public ApiResponse> listUniCurrenciesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listUniCurrenciesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query lending currency list (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 Query successful -
+ */ + public okhttp3.Call listUniCurrenciesAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniCurrenciesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUniCurrency + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniCurrencyCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/currencies/{currency}" + .replaceAll("\\{" + "currency" + "\\}", localVarApiClient.escapeString(currency)); + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUniCurrencyValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getUniCurrency(Async)"); + } + + okhttp3.Call localVarCall = getUniCurrencyCall(currency, _callback); + return localVarCall; + } + + /** + * Query single lending currency details + * + * @param currency Currency (required) + * @return UniCurrency + * @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 Query successful -
+ */ + public UniCurrency getUniCurrency(String currency) throws ApiException { + ApiResponse localVarResp = getUniCurrencyWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Query single lending currency details + * + * @param currency Currency (required) + * @return ApiResponse<UniCurrency> + * @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 Query successful -
+ */ + public ApiResponse getUniCurrencyWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUniCurrencyValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query single lending currency details (asynchronously) + * + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniCurrencyAsync(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUniCurrencyValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listUserUniLendsCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/lends"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 listUserUniLendsValidateBeforeCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUserUniLendsCall(currency, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listUserUniLendsWithHttpInfo(String currency, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listUserUniLendsValidateBeforeCall(currency, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUserUniLendsAsync(String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUserUniLendsValidateBeforeCall(currency, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUserUniLendsRequest { + private String currency; + private Integer page; + private Integer limit; + + private APIlistUserUniLendsRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUserUniLendsRequest + */ + public APIlistUserUniLendsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUserUniLendsRequest + */ + public APIlistUserUniLendsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUserUniLendsRequest + */ + public APIlistUserUniLendsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listUserUniLends + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUserUniLendsCall(currency, page, limit, _callback); + } + + /** + * Execute listUserUniLends request + * @return List<UniLend> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUserUniLendsWithHttpInfo(currency, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listUserUniLends request with HTTP info returned + * @return ApiResponse<List<UniLend>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUserUniLendsWithHttpInfo(currency, page, limit); + } + + /** + * Execute listUserUniLends request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUserUniLendsAsync(currency, page, limit, _callback); + } + } + + /** + * Query user's lending order list + * + * @return APIlistUserUniLendsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUserUniLendsRequest listUserUniLends() { + return new APIlistUserUniLendsRequest(); + } + + /** + * Build call for createUniLend + * @param createUniLend (required) + * @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
204 Operation successful -
+ */ + public okhttp3.Call createUniLendCall(CreateUniLend createUniLend, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = createUniLend; + + // create path and map variables + String localVarPath = "/earn/uni/lends"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUniLendValidateBeforeCall(CreateUniLend createUniLend, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createUniLend' is set + if (createUniLend == null) { + throw new ApiException("Missing the required parameter 'createUniLend' when calling createUniLend(Async)"); + } + + okhttp3.Call localVarCall = createUniLendCall(createUniLend, _callback); + return localVarCall; + } + + /** + * 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. + * @param createUniLend (required) + * @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
204 Operation successful -
+ */ + public void createUniLend(CreateUniLend createUniLend) throws ApiException { + createUniLendWithHttpInfo(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. + * @param createUniLend (required) + * @return ApiResponse<Void> + * @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
204 Operation successful -
+ */ + public ApiResponse createUniLendWithHttpInfo(CreateUniLend createUniLend) throws ApiException { + okhttp3.Call localVarCall = createUniLendValidateBeforeCall(createUniLend, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create lending or redemption (asynchronously) + * 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. + * @param createUniLend (required) + * @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
204 Operation successful -
+ */ + public okhttp3.Call createUniLendAsync(CreateUniLend createUniLend, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createUniLendValidateBeforeCall(createUniLend, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for changeUniLend + * @param patchUniLend (required) + * @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
204 Updated successfully -
+ */ + public okhttp3.Call changeUniLendCall(PatchUniLend patchUniLend, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = patchUniLend; + + // create path and map variables + String localVarPath = "/earn/uni/lends"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call changeUniLendValidateBeforeCall(PatchUniLend patchUniLend, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'patchUniLend' is set + if (patchUniLend == null) { + throw new ApiException("Missing the required parameter 'patchUniLend' when calling changeUniLend(Async)"); + } + + okhttp3.Call localVarCall = changeUniLendCall(patchUniLend, _callback); + return localVarCall; + } + + /** + * Amend user lending information + * Currently only supports amending minimum interest rate (hourly) + * @param patchUniLend (required) + * @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
204 Updated successfully -
+ */ + public void changeUniLend(PatchUniLend patchUniLend) throws ApiException { + changeUniLendWithHttpInfo(patchUniLend); + } + + /** + * Amend user lending information + * Currently only supports amending minimum interest rate (hourly) + * @param patchUniLend (required) + * @return ApiResponse<Void> + * @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
204 Updated successfully -
+ */ + public ApiResponse changeUniLendWithHttpInfo(PatchUniLend patchUniLend) throws ApiException { + okhttp3.Call localVarCall = changeUniLendValidateBeforeCall(patchUniLend, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Amend user lending information (asynchronously) + * Currently only supports amending minimum interest rate (hourly) + * @param patchUniLend (required) + * @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
204 Updated successfully -
+ */ + public okhttp3.Call changeUniLendAsync(PatchUniLend patchUniLend, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = changeUniLendValidateBeforeCall(patchUniLend, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + private okhttp3.Call listUniLendRecordsCall(String currency, Integer page, Integer limit, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/lend_records"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + 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 listUniLendRecordsValidateBeforeCall(String currency, Integer page, Integer limit, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLendRecordsCall(currency, page, limit, from, to, type, _callback); + return localVarCall; + } + + + private ApiResponse> listUniLendRecordsWithHttpInfo(String currency, Integer page, Integer limit, Long from, Long to, String type) throws ApiException { + okhttp3.Call localVarCall = listUniLendRecordsValidateBeforeCall(currency, page, limit, from, to, type, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUniLendRecordsAsync(String currency, Integer page, Integer limit, Long from, Long to, String type, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLendRecordsValidateBeforeCall(currency, page, limit, from, to, type, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUniLendRecordsRequest { + private String currency; + private Integer page; + private Integer limit; + private Long from; + private Long to; + private String type; + + private APIlistUniLendRecordsRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUniLendRecordsRequest + */ + public APIlistUniLendRecordsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUniLendRecordsRequest + */ + public APIlistUniLendRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUniLendRecordsRequest + */ + public APIlistUniLendRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistUniLendRecordsRequest + */ + public APIlistUniLendRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistUniLendRecordsRequest + */ + public APIlistUniLendRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set type + * @param type Operation type: lend - Lend, redeem - Redeem (optional) + * @return APIlistUniLendRecordsRequest + */ + public APIlistUniLendRecordsRequest type(String type) { + this.type = type; + return this; + } + + /** + * Build call for listUniLendRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUniLendRecordsCall(currency, page, limit, from, to, type, _callback); + } + + /** + * Execute listUniLendRecords request + * @return List<UniLendRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUniLendRecordsWithHttpInfo(currency, page, limit, from, to, type); + return localVarResp.getData(); + } + + /** + * Execute listUniLendRecords request with HTTP info returned + * @return ApiResponse<List<UniLendRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUniLendRecordsWithHttpInfo(currency, page, limit, from, to, type); + } + + /** + * Execute listUniLendRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUniLendRecordsAsync(currency, page, limit, from, to, type, _callback); + } + } + + /** + * Query lending transaction records + * + * @return APIlistUniLendRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUniLendRecordsRequest listUniLendRecords() { + return new APIlistUniLendRecordsRequest(); + } + + /** + * Build call for getUniInterest + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniInterestCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/interests/{currency}" + .replaceAll("\\{" + "currency" + "\\}", localVarApiClient.escapeString(currency)); + + 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 getUniInterestValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getUniInterest(Async)"); + } + + okhttp3.Call localVarCall = getUniInterestCall(currency, _callback); + return localVarCall; + } + + /** + * Query user's total interest income for specified currency + * + * @param currency Currency (required) + * @return UniLendInterest + * @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 Query successful -
+ */ + public UniLendInterest getUniInterest(String currency) throws ApiException { + ApiResponse localVarResp = getUniInterestWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Query user's total interest income for specified currency + * + * @param currency Currency (required) + * @return ApiResponse<UniLendInterest> + * @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 Query successful -
+ */ + public ApiResponse getUniInterestWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUniInterestValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query user's total interest income for specified currency (asynchronously) + * + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniInterestAsync(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUniInterestValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listUniInterestRecordsCall(String currency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/interest_records"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listUniInterestRecordsValidateBeforeCall(String currency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniInterestRecordsCall(currency, page, limit, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listUniInterestRecordsWithHttpInfo(String currency, Integer page, Integer limit, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listUniInterestRecordsValidateBeforeCall(currency, page, limit, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUniInterestRecordsAsync(String currency, Integer page, Integer limit, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniInterestRecordsValidateBeforeCall(currency, page, limit, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUniInterestRecordsRequest { + private String currency; + private Integer page; + private Integer limit; + private Long from; + private Long to; + + private APIlistUniInterestRecordsRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUniInterestRecordsRequest + */ + public APIlistUniInterestRecordsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUniInterestRecordsRequest + */ + public APIlistUniInterestRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUniInterestRecordsRequest + */ + public APIlistUniInterestRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistUniInterestRecordsRequest + */ + public APIlistUniInterestRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistUniInterestRecordsRequest + */ + public APIlistUniInterestRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listUniInterestRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUniInterestRecordsCall(currency, page, limit, from, to, _callback); + } + + /** + * Execute listUniInterestRecords request + * @return List<UniInterestRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUniInterestRecordsWithHttpInfo(currency, page, limit, from, to); + return localVarResp.getData(); + } + + /** + * Execute listUniInterestRecords request with HTTP info returned + * @return ApiResponse<List<UniInterestRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUniInterestRecordsWithHttpInfo(currency, page, limit, from, to); + } + + /** + * Execute listUniInterestRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUniInterestRecordsAsync(currency, page, limit, from, to, _callback); + } + } + + /** + * Query user dividend records + * + * @return APIlistUniInterestRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUniInterestRecordsRequest listUniInterestRecords() { + return new APIlistUniInterestRecordsRequest(); + } + + /** + * Build call for getUniInterestStatus + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniInterestStatusCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/interest_status/{currency}" + .replaceAll("\\{" + "currency" + "\\}", localVarApiClient.escapeString(currency)); + + 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 getUniInterestStatusValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getUniInterestStatus(Async)"); + } + + okhttp3.Call localVarCall = getUniInterestStatusCall(currency, _callback); + return localVarCall; + } + + /** + * Query currency interest compounding status + * + * @param currency Currency (required) + * @return UniCurrencyInterest + * @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 Query successful -
+ */ + public UniCurrencyInterest getUniInterestStatus(String currency) throws ApiException { + ApiResponse localVarResp = getUniInterestStatusWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Query currency interest compounding status + * + * @param currency Currency (required) + * @return ApiResponse<UniCurrencyInterest> + * @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 Query successful -
+ */ + public ApiResponse getUniInterestStatusWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUniInterestStatusValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query currency interest compounding status (asynchronously) + * + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniInterestStatusAsync(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUniInterestStatusValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listUniChart + * @param from Start timestamp in seconds, maximum span 30 days (required) + * @param to End timestamp in seconds, maximum span 30 days (required) + * @param asset Currency name (required) + * @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 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 -
+ */ + public okhttp3.Call listUniChartCall(Long from, Long to, String asset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/chart"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + 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 listUniChartValidateBeforeCall(Long from, Long to, String asset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'from' is set + if (from == null) { + throw new ApiException("Missing the required parameter 'from' when calling listUniChart(Async)"); + } + + // verify the required parameter 'to' is set + if (to == null) { + throw new ApiException("Missing the required parameter 'to' when calling listUniChart(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling listUniChart(Async)"); + } + + okhttp3.Call localVarCall = listUniChartCall(from, to, asset, _callback); + return localVarCall; + } + + /** + * 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 + * @param from Start timestamp in seconds, maximum span 30 days (required) + * @param to End timestamp in seconds, maximum span 30 days (required) + * @param asset Currency name (required) + * @return List<InlineResponse200> + * @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 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 -
+ */ + public List listUniChart(Long from, Long to, String asset) throws ApiException { + ApiResponse> localVarResp = listUniChartWithHttpInfo(from, to, asset); + return localVarResp.getData(); + } + + /** + * 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 + * @param from Start timestamp in seconds, maximum span 30 days (required) + * @param to End timestamp in seconds, maximum span 30 days (required) + * @param asset Currency name (required) + * @return ApiResponse<List<InlineResponse200>> + * @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 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 -
+ */ + public ApiResponse> listUniChartWithHttpInfo(Long from, Long to, String asset) throws ApiException { + okhttp3.Call localVarCall = listUniChartValidateBeforeCall(from, to, asset, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * UniLoan currency annualized trend chart (asynchronously) + * 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 + * @param from Start timestamp in seconds, maximum span 30 days (required) + * @param to End timestamp in seconds, maximum span 30 days (required) + * @param asset Currency name (required) + * @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 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 -
+ */ + public okhttp3.Call listUniChartAsync(Long from, Long to, String asset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniChartValidateBeforeCall(from, to, asset, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listUniRate + * @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 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 -
+ */ + public okhttp3.Call listUniRateCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/earn/uni/rate"; + + 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 listUniRateValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniRateCall(_callback); + return localVarCall; + } + + /** + * 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 + * @return List<InlineResponse2001> + * @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 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 -
+ */ + public List listUniRate() throws ApiException { + ApiResponse> localVarResp = listUniRateWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * 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 + * @return ApiResponse<List<InlineResponse2001>> + * @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 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 -
+ */ + public ApiResponse> listUniRateWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listUniRateValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Currency estimated annualized interest rate (asynchronously) + * 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 + * @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 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 -
+ */ + public okhttp3.Call listUniRateAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniRateValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/FlashSwapApi.java b/src/main/java/io/gate/gateapi/api/FlashSwapApi.java new file mode 100644 index 0000000..b168961 --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/FlashSwapApi.java @@ -0,0 +1,767 @@ +/* + * 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.FlashSwapCurrencyPair; +import io.gate.gateapi.models.FlashSwapOrder; +import io.gate.gateapi.models.FlashSwapOrderPreview; +import io.gate.gateapi.models.FlashSwapOrderRequest; +import io.gate.gateapi.models.FlashSwapPreviewRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FlashSwapApi { + private ApiClient localVarApiClient; + + public FlashSwapApi() { + this(Configuration.getDefaultApiClient()); + } + + public FlashSwapApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + private okhttp3.Call listFlashSwapCurrencyPairCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/flash_swap/currency_pairs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFlashSwapCurrencyPairValidateBeforeCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listFlashSwapCurrencyPairCall(currency, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listFlashSwapCurrencyPairWithHttpInfo(String currency, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listFlashSwapCurrencyPairValidateBeforeCall(currency, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listFlashSwapCurrencyPairAsync(String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFlashSwapCurrencyPairValidateBeforeCall(currency, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistFlashSwapCurrencyPairRequest { + private String currency; + private Integer page; + private Integer limit; + + private APIlistFlashSwapCurrencyPairRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistFlashSwapCurrencyPairRequest + */ + public APIlistFlashSwapCurrencyPairRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistFlashSwapCurrencyPairRequest + */ + public APIlistFlashSwapCurrencyPairRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 1000, minimum: 1, maximum: 1000 (optional, default to 1000) + * @return APIlistFlashSwapCurrencyPairRequest + */ + public APIlistFlashSwapCurrencyPairRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listFlashSwapCurrencyPair + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listFlashSwapCurrencyPairCall(currency, page, limit, _callback); + } + + /** + * Execute listFlashSwapCurrencyPair request + * @return List<FlashSwapCurrencyPair> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listFlashSwapCurrencyPairWithHttpInfo(currency, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listFlashSwapCurrencyPair request with HTTP info returned + * @return ApiResponse<List<FlashSwapCurrencyPair>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listFlashSwapCurrencyPairWithHttpInfo(currency, page, limit); + } + + /** + * Execute listFlashSwapCurrencyPair request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listFlashSwapCurrencyPairAsync(currency, page, limit, _callback); + } + } + + /** + * 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. + * @return APIlistFlashSwapCurrencyPairRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistFlashSwapCurrencyPairRequest listFlashSwapCurrencyPair() { + return new APIlistFlashSwapCurrencyPairRequest(); + } + + private okhttp3.Call listFlashSwapOrdersCall(Integer status, String sellCurrency, String buyCurrency, Boolean reverse, Integer limit, Integer page, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/flash_swap/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + } + + if (sellCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sell_currency", sellCurrency)); + } + + if (buyCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("buy_currency", buyCurrency)); + } + + if (reverse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reverse", reverse)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + 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 listFlashSwapOrdersValidateBeforeCall(Integer status, String sellCurrency, String buyCurrency, Boolean reverse, Integer limit, Integer page, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listFlashSwapOrdersCall(status, sellCurrency, buyCurrency, reverse, limit, page, _callback); + return localVarCall; + } + + + private ApiResponse> listFlashSwapOrdersWithHttpInfo(Integer status, String sellCurrency, String buyCurrency, Boolean reverse, Integer limit, Integer page) throws ApiException { + okhttp3.Call localVarCall = listFlashSwapOrdersValidateBeforeCall(status, sellCurrency, buyCurrency, reverse, limit, page, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listFlashSwapOrdersAsync(Integer status, String sellCurrency, String buyCurrency, Boolean reverse, Integer limit, Integer page, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFlashSwapOrdersValidateBeforeCall(status, sellCurrency, buyCurrency, reverse, limit, page, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistFlashSwapOrdersRequest { + private Integer status; + private String sellCurrency; + private String buyCurrency; + private Boolean reverse; + private Integer limit; + private Integer page; + + private APIlistFlashSwapOrdersRequest() { + } + + /** + * Set status + * @param status Flash swap order status `1` - success `2` - failed (optional) + * @return APIlistFlashSwapOrdersRequest + */ + public APIlistFlashSwapOrdersRequest status(Integer status) { + this.status = status; + return this; + } + + /** + * Set sellCurrency + * @param sellCurrency Asset name to sell - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies (optional) + * @return APIlistFlashSwapOrdersRequest + */ + public APIlistFlashSwapOrdersRequest sellCurrency(String sellCurrency) { + this.sellCurrency = sellCurrency; + return this; + } + + /** + * Set buyCurrency + * @param buyCurrency Asset name to buy - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies (optional) + * @return APIlistFlashSwapOrdersRequest + */ + public APIlistFlashSwapOrdersRequest buyCurrency(String buyCurrency) { + this.buyCurrency = buyCurrency; + return this; + } + + /** + * Set reverse + * @param reverse 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) + * @return APIlistFlashSwapOrdersRequest + */ + public APIlistFlashSwapOrdersRequest reverse(Boolean reverse) { + this.reverse = reverse; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistFlashSwapOrdersRequest + */ + public APIlistFlashSwapOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistFlashSwapOrdersRequest + */ + public APIlistFlashSwapOrdersRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Build call for listFlashSwapOrders + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listFlashSwapOrdersCall(status, sellCurrency, buyCurrency, reverse, limit, page, _callback); + } + + /** + * Execute listFlashSwapOrders request + * @return List<FlashSwapOrder> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listFlashSwapOrdersWithHttpInfo(status, sellCurrency, buyCurrency, reverse, limit, page); + return localVarResp.getData(); + } + + /** + * Execute listFlashSwapOrders request with HTTP info returned + * @return ApiResponse<List<FlashSwapOrder>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listFlashSwapOrdersWithHttpInfo(status, sellCurrency, buyCurrency, reverse, limit, page); + } + + /** + * Execute listFlashSwapOrders request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listFlashSwapOrdersAsync(status, sellCurrency, buyCurrency, reverse, limit, page, _callback); + } + } + + /** + * Query flash swap order list + * + * @return APIlistFlashSwapOrdersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistFlashSwapOrdersRequest listFlashSwapOrders() { + return new APIlistFlashSwapOrdersRequest(); + } + + /** + * Build call for createFlashSwapOrder + * @param flashSwapOrderRequest (required) + * @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
201 Flash swap order created successfully -
+ */ + public okhttp3.Call createFlashSwapOrderCall(FlashSwapOrderRequest flashSwapOrderRequest, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = flashSwapOrderRequest; + + // create path and map variables + String localVarPath = "/flash_swap/orders"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createFlashSwapOrderValidateBeforeCall(FlashSwapOrderRequest flashSwapOrderRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'flashSwapOrderRequest' is set + if (flashSwapOrderRequest == null) { + throw new ApiException("Missing the required parameter 'flashSwapOrderRequest' when calling createFlashSwapOrder(Async)"); + } + + okhttp3.Call localVarCall = createFlashSwapOrderCall(flashSwapOrderRequest, _callback); + return localVarCall; + } + + /** + * Create a flash swap order + * Initiate a flash swap preview in advance because order creation requires a preview result + * @param flashSwapOrderRequest (required) + * @return FlashSwapOrder + * @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
201 Flash swap order created successfully -
+ */ + public FlashSwapOrder createFlashSwapOrder(FlashSwapOrderRequest flashSwapOrderRequest) throws ApiException { + ApiResponse localVarResp = createFlashSwapOrderWithHttpInfo(flashSwapOrderRequest); + return localVarResp.getData(); + } + + /** + * Create a flash swap order + * Initiate a flash swap preview in advance because order creation requires a preview result + * @param flashSwapOrderRequest (required) + * @return ApiResponse<FlashSwapOrder> + * @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
201 Flash swap order created successfully -
+ */ + public ApiResponse createFlashSwapOrderWithHttpInfo(FlashSwapOrderRequest flashSwapOrderRequest) throws ApiException { + okhttp3.Call localVarCall = createFlashSwapOrderValidateBeforeCall(flashSwapOrderRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a flash swap order (asynchronously) + * Initiate a flash swap preview in advance because order creation requires a preview result + * @param flashSwapOrderRequest (required) + * @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
201 Flash swap order created successfully -
+ */ + public okhttp3.Call createFlashSwapOrderAsync(FlashSwapOrderRequest flashSwapOrderRequest, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createFlashSwapOrderValidateBeforeCall(flashSwapOrderRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getFlashSwapOrder + * @param orderId Flash swap order ID (required) + * @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 Query successful -
+ */ + public okhttp3.Call getFlashSwapOrderCall(Integer orderId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/flash_swap/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + + 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 getFlashSwapOrderValidateBeforeCall(Integer orderId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling getFlashSwapOrder(Async)"); + } + + okhttp3.Call localVarCall = getFlashSwapOrderCall(orderId, _callback); + return localVarCall; + } + + /** + * Query single flash swap order + * + * @param orderId Flash swap order ID (required) + * @return FlashSwapOrder + * @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 Query successful -
+ */ + public FlashSwapOrder getFlashSwapOrder(Integer orderId) throws ApiException { + ApiResponse localVarResp = getFlashSwapOrderWithHttpInfo(orderId); + return localVarResp.getData(); + } + + /** + * Query single flash swap order + * + * @param orderId Flash swap order ID (required) + * @return ApiResponse<FlashSwapOrder> + * @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 Query successful -
+ */ + public ApiResponse getFlashSwapOrderWithHttpInfo(Integer orderId) throws ApiException { + okhttp3.Call localVarCall = getFlashSwapOrderValidateBeforeCall(orderId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query single flash swap order (asynchronously) + * + * @param orderId Flash swap order ID (required) + * @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 Query successful -
+ */ + public okhttp3.Call getFlashSwapOrderAsync(Integer orderId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getFlashSwapOrderValidateBeforeCall(orderId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for previewFlashSwapOrder + * @param flashSwapPreviewRequest (required) + * @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 Flash swap order preview successful -
+ */ + public okhttp3.Call previewFlashSwapOrderCall(FlashSwapPreviewRequest flashSwapPreviewRequest, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = flashSwapPreviewRequest; + + // create path and map variables + String localVarPath = "/flash_swap/orders/preview"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call previewFlashSwapOrderValidateBeforeCall(FlashSwapPreviewRequest flashSwapPreviewRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'flashSwapPreviewRequest' is set + if (flashSwapPreviewRequest == null) { + throw new ApiException("Missing the required parameter 'flashSwapPreviewRequest' when calling previewFlashSwapOrder(Async)"); + } + + okhttp3.Call localVarCall = previewFlashSwapOrderCall(flashSwapPreviewRequest, _callback); + return localVarCall; + } + + /** + * Flash swap order preview + * + * @param flashSwapPreviewRequest (required) + * @return FlashSwapOrderPreview + * @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 Flash swap order preview successful -
+ */ + public FlashSwapOrderPreview previewFlashSwapOrder(FlashSwapPreviewRequest flashSwapPreviewRequest) throws ApiException { + ApiResponse localVarResp = previewFlashSwapOrderWithHttpInfo(flashSwapPreviewRequest); + return localVarResp.getData(); + } + + /** + * Flash swap order preview + * + * @param flashSwapPreviewRequest (required) + * @return ApiResponse<FlashSwapOrderPreview> + * @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 Flash swap order preview successful -
+ */ + public ApiResponse previewFlashSwapOrderWithHttpInfo(FlashSwapPreviewRequest flashSwapPreviewRequest) throws ApiException { + okhttp3.Call localVarCall = previewFlashSwapOrderValidateBeforeCall(flashSwapPreviewRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Flash swap order preview (asynchronously) + * + * @param flashSwapPreviewRequest (required) + * @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 Flash swap order preview successful -
+ */ + public okhttp3.Call previewFlashSwapOrderAsync(FlashSwapPreviewRequest flashSwapPreviewRequest, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = previewFlashSwapOrderValidateBeforeCall(flashSwapPreviewRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/FuturesApi.java b/src/main/java/io/gate/gateapi/api/FuturesApi.java index 19db3ba..b2d70e3 100644 --- a/src/main/java/io/gate/gateapi/api/FuturesApi.java +++ b/src/main/java/io/gate/gateapi/api/FuturesApi.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 @@ -20,23 +20,39 @@ import com.google.gson.reflect.TypeToken; +import io.gate.gateapi.models.BatchAmendOrderReq; +import io.gate.gateapi.models.BatchFuturesOrder; import io.gate.gateapi.models.Contract; import io.gate.gateapi.models.ContractStat; +import io.gate.gateapi.models.CountdownCancelAllFuturesTask; import io.gate.gateapi.models.FundingRateRecord; +import io.gate.gateapi.models.FutureCancelOrderResult; import io.gate.gateapi.models.FuturesAccount; import io.gate.gateapi.models.FuturesAccountBook; +import io.gate.gateapi.models.FuturesAutoDeleverage; import io.gate.gateapi.models.FuturesCandlestick; +import io.gate.gateapi.models.FuturesFee; +import io.gate.gateapi.models.FuturesIndexConstituents; +import io.gate.gateapi.models.FuturesLimitRiskTiers; +import io.gate.gateapi.models.FuturesLiqOrder; import io.gate.gateapi.models.FuturesLiquidate; import io.gate.gateapi.models.FuturesOrder; +import io.gate.gateapi.models.FuturesOrderAmendment; import io.gate.gateapi.models.FuturesOrderBook; +import io.gate.gateapi.models.FuturesPositionCrossMode; +import io.gate.gateapi.models.FuturesPremiumIndex; import io.gate.gateapi.models.FuturesPriceTriggeredOrder; +import io.gate.gateapi.models.FuturesRiskLimitTier; import io.gate.gateapi.models.FuturesTicker; import io.gate.gateapi.models.FuturesTrade; +import io.gate.gateapi.models.InlineObject; import io.gate.gateapi.models.InsuranceRecord; import io.gate.gateapi.models.MyFuturesTrade; +import io.gate.gateapi.models.MyFuturesTradeTimeRange; import io.gate.gateapi.models.Position; import io.gate.gateapi.models.PositionClose; import io.gate.gateapi.models.TriggerOrderResponse; +import io.gate.gateapi.models.TriggerTime; import java.lang.reflect.Type; import java.util.ArrayList; @@ -63,19 +79,7 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } - /** - * Build call for listFuturesContracts - * @param settle Settle currency (required) - * @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 List retrieved -
- */ - public okhttp3.Call listFuturesContractsCall(String settle, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesContractsCall(String settle, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -84,6 +88,14 @@ public okhttp3.Call listFuturesContractsCall(String settle, final ApiCallback _c List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -106,69 +118,132 @@ public okhttp3.Call listFuturesContractsCall(String settle, final ApiCallback _c } @SuppressWarnings("rawtypes") - private okhttp3.Call listFuturesContractsValidateBeforeCall(String settle, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesContractsValidateBeforeCall(String settle, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling listFuturesContracts(Async)"); } - okhttp3.Call localVarCall = listFuturesContractsCall(settle, _callback); + okhttp3.Call localVarCall = listFuturesContractsCall(settle, limit, offset, _callback); return localVarCall; } - /** - * List all futures contracts - * - * @param settle Settle currency (required) - * @return List<Contract> - * @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 List retrieved -
- */ - public List listFuturesContracts(String settle) throws ApiException { - ApiResponse> localVarResp = listFuturesContractsWithHttpInfo(settle); - return localVarResp.getData(); - } - /** - * List all futures contracts - * - * @param settle Settle currency (required) - * @return ApiResponse<List<Contract>> - * @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 List retrieved -
- */ - public ApiResponse> listFuturesContractsWithHttpInfo(String settle) throws ApiException { - okhttp3.Call localVarCall = listFuturesContractsValidateBeforeCall(settle, null); + private ApiResponse> listFuturesContractsWithHttpInfo(String settle, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = listFuturesContractsValidateBeforeCall(settle, limit, offset, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } + private okhttp3.Call listFuturesContractsAsync(String settle, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesContractsValidateBeforeCall(settle, limit, offset, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistFuturesContractsRequest { + private final String settle; + private Integer limit; + private Integer offset; + + private APIlistFuturesContractsRequest(String settle) { + this.settle = settle; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistFuturesContractsRequest + */ + public APIlistFuturesContractsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistFuturesContractsRequest + */ + public APIlistFuturesContractsRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for listFuturesContracts + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listFuturesContractsCall(settle, limit, offset, _callback); + } + + /** + * Execute listFuturesContracts request + * @return List<Contract> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listFuturesContractsWithHttpInfo(settle, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute listFuturesContracts request with HTTP info returned + * @return ApiResponse<List<Contract>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listFuturesContractsWithHttpInfo(settle, limit, offset); + } + + /** + * Execute listFuturesContracts request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listFuturesContractsAsync(settle, limit, offset, _callback); + } + } + /** - * List all futures contracts (asynchronously) + * Query all futures contracts * * @param settle Settle currency (required) - * @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 + * @return APIlistFuturesContractsRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call listFuturesContractsAsync(String settle, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesContractsValidateBeforeCall(settle, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; + public APIlistFuturesContractsRequest listFuturesContracts(String settle) { + return new APIlistFuturesContractsRequest(settle); } /** @@ -232,7 +307,7 @@ private okhttp3.Call getFuturesContractValidateBeforeCall(String settle, String } /** - * Get a single contract + * Query single contract information * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -250,7 +325,7 @@ public Contract getFuturesContract(String settle, String contract) throws ApiExc } /** - * Get a single contract + * Query single contract information * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -269,7 +344,7 @@ public ApiResponse getFuturesContractWithHttpInfo(String settle, Strin } /** - * Get a single contract (asynchronously) + * Query single contract information (asynchronously) * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -379,7 +454,7 @@ private APIlistFuturesOrderBookRequest(String settle, String contract) { /** * Set interval - * @param interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to 0) + * @param interval Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional, default to "0") * @return APIlistFuturesOrderBookRequest */ public APIlistFuturesOrderBookRequest interval(String interval) { @@ -389,7 +464,7 @@ public APIlistFuturesOrderBookRequest interval(String interval) { /** * Set limit - * @param limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param limit Number of depth levels (optional, default to 10) * @return APIlistFuturesOrderBookRequest */ public APIlistFuturesOrderBookRequest limit(Integer limit) { @@ -399,7 +474,7 @@ public APIlistFuturesOrderBookRequest limit(Integer limit) { /** * Set withId - * @param withId Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) + * @param withId Whether to return depth update ID. This ID increments by 1 each time depth changes (optional, default to false) * @return APIlistFuturesOrderBookRequest */ public APIlistFuturesOrderBookRequest withId(Boolean withId) { @@ -415,7 +490,7 @@ public APIlistFuturesOrderBookRequest withId(Boolean withId) { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -429,7 +504,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public FuturesOrderBook execute() throws ApiException { @@ -444,7 +519,7 @@ public FuturesOrderBook execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { @@ -459,7 +534,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { @@ -468,7 +543,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) } /** - * Futures order book + * Query futures market depth information * Bids will be sorted by price from high to low, while asks sorted reversely * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -476,14 +551,14 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) * @http.response.details - +
Status Code Description Response Headers
200 Order book retrieved -
200 Depth query successful -
*/ public APIlistFuturesOrderBookRequest listFuturesOrderBook(String settle, String contract) { return new APIlistFuturesOrderBookRequest(settle, contract); } - private okhttp3.Call listFuturesTradesCall(String settle, String contract, Integer limit, String lastId, Long from, Long to, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesTradesCall(String settle, String contract, Integer limit, Integer offset, String lastId, Long from, Long to, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -500,6 +575,10 @@ private okhttp3.Call listFuturesTradesCall(String settle, String contract, Integ localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + if (lastId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("last_id", lastId)); } @@ -534,7 +613,7 @@ private okhttp3.Call listFuturesTradesCall(String settle, String contract, Integ } @SuppressWarnings("rawtypes") - private okhttp3.Call listFuturesTradesValidateBeforeCall(String settle, String contract, Integer limit, String lastId, Long from, Long to, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesTradesValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, String lastId, Long from, Long to, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling listFuturesTrades(Async)"); @@ -545,19 +624,19 @@ private okhttp3.Call listFuturesTradesValidateBeforeCall(String settle, String c throw new ApiException("Missing the required parameter 'contract' when calling listFuturesTrades(Async)"); } - okhttp3.Call localVarCall = listFuturesTradesCall(settle, contract, limit, lastId, from, to, _callback); + okhttp3.Call localVarCall = listFuturesTradesCall(settle, contract, limit, offset, lastId, from, to, _callback); return localVarCall; } - private ApiResponse> listFuturesTradesWithHttpInfo(String settle, String contract, Integer limit, String lastId, Long from, Long to) throws ApiException { - okhttp3.Call localVarCall = listFuturesTradesValidateBeforeCall(settle, contract, limit, lastId, from, to, null); + private ApiResponse> listFuturesTradesWithHttpInfo(String settle, String contract, Integer limit, Integer offset, String lastId, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listFuturesTradesValidateBeforeCall(settle, contract, limit, offset, lastId, from, to, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listFuturesTradesAsync(String settle, String contract, Integer limit, String lastId, Long from, Long to, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesTradesValidateBeforeCall(settle, contract, limit, lastId, from, to, _callback); + private okhttp3.Call listFuturesTradesAsync(String settle, String contract, Integer limit, Integer offset, String lastId, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesTradesValidateBeforeCall(settle, contract, limit, offset, lastId, from, to, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -567,6 +646,7 @@ public class APIlistFuturesTradesRequest { private final String settle; private final String contract; private Integer limit; + private Integer offset; private String lastId; private Long from; private Long to; @@ -578,7 +658,7 @@ private APIlistFuturesTradesRequest(String settle, String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistFuturesTradesRequest */ public APIlistFuturesTradesRequest limit(Integer limit) { @@ -586,6 +666,16 @@ public APIlistFuturesTradesRequest limit(Integer limit) { return this; } + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistFuturesTradesRequest + */ + public APIlistFuturesTradesRequest offset(Integer offset) { + this.offset = offset; + return this; + } + /** * Set lastId * @param lastId Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) @@ -608,7 +698,7 @@ public APIlistFuturesTradesRequest from(Long from) { /** * Set to - * @param to Specify end time in Unix seconds, default to current time (optional) + * @param to Specify end time in Unix seconds, default to current time. (optional) * @return APIlistFuturesTradesRequest */ public APIlistFuturesTradesRequest to(Long to) { @@ -624,11 +714,11 @@ public APIlistFuturesTradesRequest to(Long to) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listFuturesTradesCall(settle, contract, limit, lastId, from, to, _callback); + return listFuturesTradesCall(settle, contract, limit, offset, lastId, from, to, _callback); } /** @@ -638,11 +728,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listFuturesTradesWithHttpInfo(settle, contract, limit, lastId, from, to); + ApiResponse> localVarResp = listFuturesTradesWithHttpInfo(settle, contract, limit, offset, lastId, from, to); return localVarResp.getData(); } @@ -653,11 +743,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listFuturesTradesWithHttpInfo(settle, contract, limit, lastId, from, to); + return listFuturesTradesWithHttpInfo(settle, contract, limit, offset, lastId, from, to); } /** @@ -668,16 +758,16 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listFuturesTradesAsync(settle, contract, limit, lastId, from, to, _callback); + return listFuturesTradesAsync(settle, contract, limit, offset, lastId, from, to, _callback); } } /** - * Futures trading history + * Futures market transaction records * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -685,14 +775,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistFuturesTradesRequest listFuturesTrades(String settle, String contract) { return new APIlistFuturesTradesRequest(settle, contract); } - private okhttp3.Call listFuturesCandlesticksCall(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesCandlesticksCall(String settle, String contract, Long from, Long to, Integer limit, String interval, String timezone, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -721,6 +811,10 @@ private okhttp3.Call listFuturesCandlesticksCall(String settle, String contract, localVarQueryParams.addAll(localVarApiClient.parameterToPair("interval", interval)); } + if (timezone != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timezone", timezone)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -743,7 +837,7 @@ private okhttp3.Call listFuturesCandlesticksCall(String settle, String contract, } @SuppressWarnings("rawtypes") - private okhttp3.Call listFuturesCandlesticksValidateBeforeCall(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesCandlesticksValidateBeforeCall(String settle, String contract, Long from, Long to, Integer limit, String interval, String timezone, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling listFuturesCandlesticks(Async)"); @@ -754,19 +848,19 @@ private okhttp3.Call listFuturesCandlesticksValidateBeforeCall(String settle, St throw new ApiException("Missing the required parameter 'contract' when calling listFuturesCandlesticks(Async)"); } - okhttp3.Call localVarCall = listFuturesCandlesticksCall(settle, contract, from, to, limit, interval, _callback); + okhttp3.Call localVarCall = listFuturesCandlesticksCall(settle, contract, from, to, limit, interval, timezone, _callback); return localVarCall; } - private ApiResponse> listFuturesCandlesticksWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit, String interval) throws ApiException { - okhttp3.Call localVarCall = listFuturesCandlesticksValidateBeforeCall(settle, contract, from, to, limit, interval, null); + private ApiResponse> listFuturesCandlesticksWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit, String interval, String timezone) throws ApiException { + okhttp3.Call localVarCall = listFuturesCandlesticksValidateBeforeCall(settle, contract, from, to, limit, interval, timezone, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listFuturesCandlesticksAsync(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesCandlesticksValidateBeforeCall(settle, contract, from, to, limit, interval, _callback); + private okhttp3.Call listFuturesCandlesticksAsync(String settle, String contract, Long from, Long to, Integer limit, String interval, String timezone, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesCandlesticksValidateBeforeCall(settle, contract, from, to, limit, interval, timezone, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -779,6 +873,7 @@ public class APIlistFuturesCandlesticksRequest { private Long to; private Integer limit; private String interval; + private String timezone; private APIlistFuturesCandlesticksRequest(String settle, String contract) { this.settle = settle; @@ -797,7 +892,7 @@ public APIlistFuturesCandlesticksRequest from(Long from) { /** * Set to - * @param to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param to 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) * @return APIlistFuturesCandlesticksRequest */ public APIlistFuturesCandlesticksRequest to(Long to) { @@ -807,7 +902,7 @@ public APIlistFuturesCandlesticksRequest to(Long to) { /** * Set limit - * @param limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param limit 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) * @return APIlistFuturesCandlesticksRequest */ public APIlistFuturesCandlesticksRequest limit(Integer limit) { @@ -817,7 +912,7 @@ public APIlistFuturesCandlesticksRequest limit(Integer limit) { /** * Set interval - * @param interval Interval time between data points (optional, default to 5m) + * @param interval 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) * @return APIlistFuturesCandlesticksRequest */ public APIlistFuturesCandlesticksRequest interval(String interval) { @@ -825,6 +920,16 @@ public APIlistFuturesCandlesticksRequest interval(String interval) { return this; } + /** + * Set timezone + * @param timezone Time zone: all/utc0/utc8, default utc0 (optional, default to "utc0") + * @return APIlistFuturesCandlesticksRequest + */ + public APIlistFuturesCandlesticksRequest timezone(String timezone) { + this.timezone = timezone; + return this; + } + /** * Build call for listFuturesCandlesticks * @param _callback ApiCallback API callback @@ -833,11 +938,11 @@ public APIlistFuturesCandlesticksRequest interval(String interval) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listFuturesCandlesticksCall(settle, contract, from, to, limit, interval, _callback); + return listFuturesCandlesticksCall(settle, contract, from, to, limit, interval, timezone, _callback); } /** @@ -847,11 +952,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listFuturesCandlesticksWithHttpInfo(settle, contract, from, to, limit, interval); + ApiResponse> localVarResp = listFuturesCandlesticksWithHttpInfo(settle, contract, from, to, limit, interval, timezone); return localVarResp.getData(); } @@ -862,11 +967,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listFuturesCandlesticksWithHttpInfo(settle, contract, from, to, limit, interval); + return listFuturesCandlesticksWithHttpInfo(settle, contract, from, to, limit, interval, timezone); } /** @@ -877,16 +982,16 @@ public ApiResponse> executeWithHttpInfo() throws ApiExc * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listFuturesCandlesticksAsync(settle, contract, from, to, limit, interval, _callback); + return listFuturesCandlesticksAsync(settle, contract, from, to, limit, interval, timezone, _callback); } } /** - * 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` * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -894,18 +999,18 @@ public okhttp3.Call executeAsync(final ApiCallback> _ca * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistFuturesCandlesticksRequest listFuturesCandlesticks(String settle, String contract) { return new APIlistFuturesCandlesticksRequest(settle, contract); } - private okhttp3.Call listFuturesTickersCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesPremiumIndexCall(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/futures/{settle}/tickers" + String localVarPath = "/futures/{settle}/premium_index" .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); @@ -914,6 +1019,22 @@ private okhttp3.Call listFuturesTickersCall(String settle, String contract, fina localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); } + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (interval != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("interval", interval)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -936,128 +1057,169 @@ private okhttp3.Call listFuturesTickersCall(String settle, String contract, fina } @SuppressWarnings("rawtypes") - private okhttp3.Call listFuturesTickersValidateBeforeCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesPremiumIndexValidateBeforeCall(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling listFuturesTickers(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling listFuturesPremiumIndex(Async)"); } - okhttp3.Call localVarCall = listFuturesTickersCall(settle, contract, _callback); + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling listFuturesPremiumIndex(Async)"); + } + + okhttp3.Call localVarCall = listFuturesPremiumIndexCall(settle, contract, from, to, limit, interval, _callback); return localVarCall; } - private ApiResponse> listFuturesTickersWithHttpInfo(String settle, String contract) throws ApiException { - okhttp3.Call localVarCall = listFuturesTickersValidateBeforeCall(settle, contract, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> listFuturesPremiumIndexWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit, String interval) throws ApiException { + okhttp3.Call localVarCall = listFuturesPremiumIndexValidateBeforeCall(settle, contract, from, to, limit, interval, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listFuturesTickersAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesTickersValidateBeforeCall(settle, contract, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call listFuturesPremiumIndexAsync(String settle, String contract, Long from, Long to, Integer limit, String interval, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesPremiumIndexValidateBeforeCall(settle, contract, from, to, limit, interval, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistFuturesTickersRequest { + public class APIlistFuturesPremiumIndexRequest { private final String settle; - private String contract; + private final String contract; + private Long from; + private Long to; + private Integer limit; + private String interval; - private APIlistFuturesTickersRequest(String settle) { + private APIlistFuturesPremiumIndexRequest(String settle, String contract) { this.settle = settle; + this.contract = contract; } /** - * Set contract - * @param contract Futures contract, return related data only if specified (optional) - * @return APIlistFuturesTickersRequest + * Set from + * @param from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) + * @return APIlistFuturesPremiumIndexRequest */ - public APIlistFuturesTickersRequest contract(String contract) { - this.contract = contract; + public APIlistFuturesPremiumIndexRequest from(Long from) { + this.from = from; return this; } /** - * Build call for listFuturesTickers + * Set to + * @param to 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) + * @return APIlistFuturesPremiumIndexRequest + */ + public APIlistFuturesPremiumIndexRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set limit + * @param limit 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) + * @return APIlistFuturesPremiumIndexRequest + */ + public APIlistFuturesPremiumIndexRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set interval + * @param interval Time interval between data points (optional, default to 5m) + * @return APIlistFuturesPremiumIndexRequest + */ + public APIlistFuturesPremiumIndexRequest interval(String interval) { + this.interval = interval; + return this; + } + + /** + * Build call for listFuturesPremiumIndex * @param _callback ApiCallback API callback * @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 -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listFuturesTickersCall(settle, contract, _callback); + return listFuturesPremiumIndexCall(settle, contract, from, to, limit, interval, _callback); } /** - * Execute listFuturesTickers request - * @return List<FuturesTicker> + * Execute listFuturesPremiumIndex request + * @return List<FuturesPremiumIndex> * @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 -
200 Query successful -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listFuturesTickersWithHttpInfo(settle, contract); + public List execute() throws ApiException { + ApiResponse> localVarResp = listFuturesPremiumIndexWithHttpInfo(settle, contract, from, to, limit, interval); return localVarResp.getData(); } /** - * Execute listFuturesTickers request with HTTP info returned - * @return ApiResponse<List<FuturesTicker>> + * Execute listFuturesPremiumIndex request with HTTP info returned + * @return ApiResponse<List<FuturesPremiumIndex>> * @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 -
200 Query successful -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listFuturesTickersWithHttpInfo(settle, contract); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listFuturesPremiumIndexWithHttpInfo(settle, contract, from, to, limit, interval); } /** - * Execute listFuturesTickers request (asynchronously) + * Execute listFuturesPremiumIndex request (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 -
200 Query successful -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listFuturesTickersAsync(settle, contract, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listFuturesPremiumIndexAsync(settle, contract, from, to, limit, interval, _callback); } } /** - * List futures tickers - * + * 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 * @param settle Settle currency (required) - * @return APIlistFuturesTickersRequest + * @param contract Futures contract (required) + * @return APIlistFuturesPremiumIndexRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ - public APIlistFuturesTickersRequest listFuturesTickers(String settle) { - return new APIlistFuturesTickersRequest(settle); + public APIlistFuturesPremiumIndexRequest listFuturesPremiumIndex(String settle, String contract) { + return new APIlistFuturesPremiumIndexRequest(settle, contract); } - private okhttp3.Call listFuturesFundingRateHistoryCall(String settle, String contract, Integer limit, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesTickersCall(String settle, String contract, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/futures/{settle}/funding_rate" + String localVarPath = "/futures/{settle}/tickers" .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); @@ -1066,10 +1228,6 @@ private okhttp3.Call listFuturesFundingRateHistoryCall(String settle, String con localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); } - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -1092,48 +1250,214 @@ private okhttp3.Call listFuturesFundingRateHistoryCall(String settle, String con } @SuppressWarnings("rawtypes") - private okhttp3.Call listFuturesFundingRateHistoryValidateBeforeCall(String settle, String contract, Integer limit, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesTickersValidateBeforeCall(String settle, String contract, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling listFuturesFundingRateHistory(Async)"); - } - - // verify the required parameter 'contract' is set - if (contract == null) { - throw new ApiException("Missing the required parameter 'contract' when calling listFuturesFundingRateHistory(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling listFuturesTickers(Async)"); } - okhttp3.Call localVarCall = listFuturesFundingRateHistoryCall(settle, contract, limit, _callback); + okhttp3.Call localVarCall = listFuturesTickersCall(settle, contract, _callback); return localVarCall; } - private ApiResponse> listFuturesFundingRateHistoryWithHttpInfo(String settle, String contract, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listFuturesFundingRateHistoryValidateBeforeCall(settle, contract, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> listFuturesTickersWithHttpInfo(String settle, String contract) throws ApiException { + okhttp3.Call localVarCall = listFuturesTickersValidateBeforeCall(settle, contract, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listFuturesFundingRateHistoryAsync(String settle, String contract, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesFundingRateHistoryValidateBeforeCall(settle, contract, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call listFuturesTickersAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesTickersValidateBeforeCall(settle, contract, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistFuturesFundingRateHistoryRequest { + public class APIlistFuturesTickersRequest { private final String settle; - private final String contract; - private Integer limit; + private String contract; - private APIlistFuturesFundingRateHistoryRequest(String settle, String contract) { + private APIlistFuturesTickersRequest(String settle) { this.settle = settle; - this.contract = contract; } /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIlistFuturesTickersRequest + */ + public APIlistFuturesTickersRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Build call for listFuturesTickers + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listFuturesTickersCall(settle, contract, _callback); + } + + /** + * Execute listFuturesTickers request + * @return List<FuturesTicker> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listFuturesTickersWithHttpInfo(settle, contract); + return localVarResp.getData(); + } + + /** + * Execute listFuturesTickers request with HTTP info returned + * @return ApiResponse<List<FuturesTicker>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listFuturesTickersWithHttpInfo(settle, contract); + } + + /** + * Execute listFuturesTickers request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listFuturesTickersAsync(settle, contract, _callback); + } + } + + /** + * Get all futures trading statistics + * + * @param settle Settle currency (required) + * @return APIlistFuturesTickersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistFuturesTickersRequest listFuturesTickers(String settle) { + return new APIlistFuturesTickersRequest(settle); + } + + private okhttp3.Call listFuturesFundingRateHistoryCall(String settle, String contract, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/funding_rate" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFuturesFundingRateHistoryValidateBeforeCall(String settle, String contract, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling listFuturesFundingRateHistory(Async)"); + } + + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling listFuturesFundingRateHistory(Async)"); + } + + okhttp3.Call localVarCall = listFuturesFundingRateHistoryCall(settle, contract, limit, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listFuturesFundingRateHistoryWithHttpInfo(String settle, String contract, Integer limit, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listFuturesFundingRateHistoryValidateBeforeCall(settle, contract, limit, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listFuturesFundingRateHistoryAsync(String settle, String contract, Integer limit, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesFundingRateHistoryValidateBeforeCall(settle, contract, limit, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistFuturesFundingRateHistoryRequest { + private final String settle; + private final String contract; + private Integer limit; + private Long from; + private Long to; + + private APIlistFuturesFundingRateHistoryRequest(String settle, String contract) { + this.settle = settle; + this.contract = contract; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistFuturesFundingRateHistoryRequest */ public APIlistFuturesFundingRateHistoryRequest limit(Integer limit) { @@ -1141,6 +1465,26 @@ public APIlistFuturesFundingRateHistoryRequest limit(Integer limit) { return this; } + /** + * Set from + * @param from 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) + * @return APIlistFuturesFundingRateHistoryRequest + */ + public APIlistFuturesFundingRateHistoryRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistFuturesFundingRateHistoryRequest + */ + public APIlistFuturesFundingRateHistoryRequest to(Long to) { + this.to = to; + return this; + } + /** * Build call for listFuturesFundingRateHistory * @param _callback ApiCallback API callback @@ -1149,11 +1493,11 @@ public APIlistFuturesFundingRateHistoryRequest limit(Integer limit) { * @http.response.details - +
Status Code Description Response Headers
200 History retrieved -
200 History query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listFuturesFundingRateHistoryCall(settle, contract, limit, _callback); + return listFuturesFundingRateHistoryCall(settle, contract, limit, from, to, _callback); } /** @@ -1163,11 +1507,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 History retrieved -
200 History query successful -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listFuturesFundingRateHistoryWithHttpInfo(settle, contract, limit); + ApiResponse> localVarResp = listFuturesFundingRateHistoryWithHttpInfo(settle, contract, limit, from, to); return localVarResp.getData(); } @@ -1178,11 +1522,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 History retrieved -
200 History query successful -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listFuturesFundingRateHistoryWithHttpInfo(settle, contract, limit); + return listFuturesFundingRateHistoryWithHttpInfo(settle, contract, limit, from, to); } /** @@ -1193,16 +1537,16 @@ public ApiResponse> executeWithHttpInfo() throws ApiExce * @http.response.details - +
Status Code Description Response Headers
200 History retrieved -
200 History query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listFuturesFundingRateHistoryAsync(settle, contract, limit, _callback); + return listFuturesFundingRateHistoryAsync(settle, contract, limit, from, to, _callback); } } /** - * Funding rate history + * Futures market historical funding rate * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -1210,7 +1554,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _cal * @http.response.details - +
Status Code Description Response Headers
200 History retrieved -
200 History query successful -
*/ public APIlistFuturesFundingRateHistoryRequest listFuturesFundingRateHistory(String settle, String contract) { @@ -1286,7 +1630,7 @@ private APIlistFuturesInsuranceLedgerRequest(String settle) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistFuturesInsuranceLedgerRequest */ public APIlistFuturesInsuranceLedgerRequest limit(Integer limit) { @@ -1302,7 +1646,7 @@ public APIlistFuturesInsuranceLedgerRequest limit(Integer limit) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1316,7 +1660,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public List execute() throws ApiException { @@ -1331,7 +1675,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -1346,7 +1690,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1355,14 +1699,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callb } /** - * Futures insurance balance history + * Futures market insurance fund history * * @param settle Settle currency (required) * @return APIlistFuturesInsuranceLedgerRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistFuturesInsuranceLedgerRequest listFuturesInsuranceLedger(String settle) { @@ -1469,7 +1813,7 @@ public APIlistContractStatsRequest from(Long from) { /** * Set interval - * @param interval (optional, default to 5m) + * @param interval (optional, default to "5m") * @return APIlistContractStatsRequest */ public APIlistContractStatsRequest interval(String interval) { @@ -1495,7 +1839,7 @@ public APIlistContractStatsRequest limit(Integer limit) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1509,7 +1853,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -1524,7 +1868,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -1539,7 +1883,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1548,7 +1892,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback } /** - * Futures stats + * Futures statistics * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -1556,38 +1900,36 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistContractStatsRequest listContractStats(String settle, String contract) { return new APIlistContractStatsRequest(settle, contract); } - private okhttp3.Call listLiquidatedOrdersCall(String settle, String contract, Long from, Long to, Integer limit, final ApiCallback _callback) throws ApiException { + /** + * Build call for getIndexConstituents + * @param settle Settle currency (required) + * @param index Index name (required) + * @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 Query successful -
+ */ + public okhttp3.Call getIndexConstituentsCall(String settle, String index, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/futures/{settle}/liq_orders" - .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + String localVarPath = "/futures/{settle}/index_constituents/{index}" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) + .replaceAll("\\{" + "index" + "\\}", localVarApiClient.escapeString(index)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (contract != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); - } - - if (from != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); - } - - if (to != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -1610,38 +1952,158 @@ private okhttp3.Call listLiquidatedOrdersCall(String settle, String contract, Lo } @SuppressWarnings("rawtypes") - private okhttp3.Call listLiquidatedOrdersValidateBeforeCall(String settle, String contract, Long from, Long to, Integer limit, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getIndexConstituentsValidateBeforeCall(String settle, String index, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling listLiquidatedOrders(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling getIndexConstituents(Async)"); } - okhttp3.Call localVarCall = listLiquidatedOrdersCall(settle, contract, from, to, limit, _callback); + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException("Missing the required parameter 'index' when calling getIndexConstituents(Async)"); + } + + okhttp3.Call localVarCall = getIndexConstituentsCall(settle, index, _callback); return localVarCall; } + /** + * Query index constituents + * + * @param settle Settle currency (required) + * @param index Index name (required) + * @return FuturesIndexConstituents + * @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 Query successful -
+ */ + public FuturesIndexConstituents getIndexConstituents(String settle, String index) throws ApiException { + ApiResponse localVarResp = getIndexConstituentsWithHttpInfo(settle, index); + return localVarResp.getData(); + } - private ApiResponse> listLiquidatedOrdersWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listLiquidatedOrdersValidateBeforeCall(settle, contract, from, to, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + /** + * Query index constituents + * + * @param settle Settle currency (required) + * @param index Index name (required) + * @return ApiResponse<FuturesIndexConstituents> + * @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 Query successful -
+ */ + public ApiResponse getIndexConstituentsWithHttpInfo(String settle, String index) throws ApiException { + okhttp3.Call localVarCall = getIndexConstituentsValidateBeforeCall(settle, index, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listLiquidatedOrdersAsync(String settle, String contract, Long from, Long to, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listLiquidatedOrdersValidateBeforeCall(settle, contract, from, to, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + /** + * Query index constituents (asynchronously) + * + * @param settle Settle currency (required) + * @param index Index name (required) + * @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 Query successful -
+ */ + public okhttp3.Call getIndexConstituentsAsync(String settle, String index, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getIndexConstituentsValidateBeforeCall(settle, index, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistLiquidatedOrdersRequest { - private final String settle; - private String contract; - private Long from; - private Long to; - private Integer limit; + private okhttp3.Call listLiquidatedOrdersCall(String settle, String contract, Long from, Long to, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; - private APIlistLiquidatedOrdersRequest(String settle) { + // create path and map variables + String localVarPath = "/futures/{settle}/liq_orders" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listLiquidatedOrdersValidateBeforeCall(String settle, String contract, Long from, Long to, Integer limit, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling listLiquidatedOrders(Async)"); + } + + okhttp3.Call localVarCall = listLiquidatedOrdersCall(settle, contract, from, to, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listLiquidatedOrdersWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listLiquidatedOrdersValidateBeforeCall(settle, contract, from, to, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listLiquidatedOrdersAsync(String settle, String contract, Long from, Long to, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listLiquidatedOrdersValidateBeforeCall(settle, contract, from, to, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistLiquidatedOrdersRequest { + private final String settle; + private String contract; + private Long from; + private Long to; + private Integer limit; + + private APIlistLiquidatedOrdersRequest(String settle) { this.settle = settle; } @@ -1657,7 +2119,7 @@ public APIlistLiquidatedOrdersRequest contract(String contract) { /** * Set from - * @param from Start timestamp (optional) + * @param from 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) * @return APIlistLiquidatedOrdersRequest */ public APIlistLiquidatedOrdersRequest from(Long from) { @@ -1667,7 +2129,7 @@ public APIlistLiquidatedOrdersRequest from(Long from) { /** * Set to - * @param to End timestamp (optional) + * @param to 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 APIlistLiquidatedOrdersRequest */ public APIlistLiquidatedOrdersRequest to(Long to) { @@ -1677,7 +2139,7 @@ public APIlistLiquidatedOrdersRequest to(Long to) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistLiquidatedOrdersRequest */ public APIlistLiquidatedOrdersRequest limit(Integer limit) { @@ -1693,7 +2155,7 @@ public APIlistLiquidatedOrdersRequest limit(Integer limit) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1702,30 +2164,30 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { /** * Execute listLiquidatedOrders request - * @return List<FuturesLiquidate> + * @return List<FuturesLiqOrder> * @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 List retrieved -
200 List retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listLiquidatedOrdersWithHttpInfo(settle, contract, from, to, limit); + public List execute() throws ApiException { + ApiResponse> localVarResp = listLiquidatedOrdersWithHttpInfo(settle, contract, from, to, limit); return localVarResp.getData(); } /** * Execute listLiquidatedOrders request with HTTP info returned - * @return ApiResponse<List<FuturesLiquidate>> + * @return ApiResponse<List<FuturesLiqOrder>> * @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 List retrieved -
200 List retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { + public ApiResponse> executeWithHttpInfo() throws ApiException { return listLiquidatedOrdersWithHttpInfo(settle, contract, from, to, limit); } @@ -1737,29 +2199,211 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcep * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listLiquidatedOrdersAsync(settle, contract, from, to, limit, _callback); } } /** - * 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 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 * @param settle Settle currency (required) * @return APIlistLiquidatedOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistLiquidatedOrdersRequest listLiquidatedOrders(String settle) { return new APIlistLiquidatedOrdersRequest(settle); } + private okhttp3.Call listFuturesRiskLimitTiersCall(String settle, String contract, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/risk_limit_tiers" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFuturesRiskLimitTiersValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling listFuturesRiskLimitTiers(Async)"); + } + + okhttp3.Call localVarCall = listFuturesRiskLimitTiersCall(settle, contract, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse> listFuturesRiskLimitTiersWithHttpInfo(String settle, String contract, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = listFuturesRiskLimitTiersValidateBeforeCall(settle, contract, limit, offset, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listFuturesRiskLimitTiersAsync(String settle, String contract, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesRiskLimitTiersValidateBeforeCall(settle, contract, limit, offset, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistFuturesRiskLimitTiersRequest { + private final String settle; + private String contract; + private Integer limit; + private Integer offset; + + private APIlistFuturesRiskLimitTiersRequest(String settle) { + this.settle = settle; + } + + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIlistFuturesRiskLimitTiersRequest + */ + public APIlistFuturesRiskLimitTiersRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistFuturesRiskLimitTiersRequest + */ + public APIlistFuturesRiskLimitTiersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistFuturesRiskLimitTiersRequest + */ + public APIlistFuturesRiskLimitTiersRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for listFuturesRiskLimitTiers + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listFuturesRiskLimitTiersCall(settle, contract, limit, offset, _callback); + } + + /** + * Execute listFuturesRiskLimitTiers request + * @return List<FuturesLimitRiskTiers> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listFuturesRiskLimitTiersWithHttpInfo(settle, contract, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute listFuturesRiskLimitTiers request with HTTP info returned + * @return ApiResponse<List<FuturesLimitRiskTiers>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listFuturesRiskLimitTiersWithHttpInfo(settle, contract, limit, offset); + } + + /** + * Execute listFuturesRiskLimitTiers request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listFuturesRiskLimitTiersAsync(settle, contract, limit, offset, _callback); + } + } + + /** + * 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. + * @param settle Settle currency (required) + * @return APIlistFuturesRiskLimitTiersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistFuturesRiskLimitTiersRequest listFuturesRiskLimitTiers(String settle) { + return new APIlistFuturesRiskLimitTiersRequest(settle); + } + /** * Build call for listFuturesAccounts * @param settle Settle currency (required) @@ -1769,7 +2413,7 @@ public APIlistLiquidatedOrdersRequest listLiquidatedOrders(String settle) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Query successful -
*/ public okhttp3.Call listFuturesAccountsCall(String settle, final ApiCallback _callback) throws ApiException { @@ -1814,7 +2458,7 @@ private okhttp3.Call listFuturesAccountsValidateBeforeCall(String settle, final } /** - * Query futures account + * Get futures account * * @param settle Settle currency (required) * @return FuturesAccount @@ -1822,7 +2466,7 @@ private okhttp3.Call listFuturesAccountsValidateBeforeCall(String settle, final * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Query successful -
*/ public FuturesAccount listFuturesAccounts(String settle) throws ApiException { @@ -1831,7 +2475,7 @@ public FuturesAccount listFuturesAccounts(String settle) throws ApiException { } /** - * Query futures account + * Get futures account * * @param settle Settle currency (required) * @return ApiResponse<FuturesAccount> @@ -1839,7 +2483,7 @@ public FuturesAccount listFuturesAccounts(String settle) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Query successful -
*/ public ApiResponse listFuturesAccountsWithHttpInfo(String settle) throws ApiException { @@ -1849,7 +2493,7 @@ public ApiResponse listFuturesAccountsWithHttpInfo(String settle } /** - * Query futures account (asynchronously) + * Get futures account (asynchronously) * * @param settle Settle currency (required) * @param _callback The callback to be executed when the API call finishes @@ -1858,7 +2502,7 @@ public ApiResponse listFuturesAccountsWithHttpInfo(String settle * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Query successful -
*/ public okhttp3.Call listFuturesAccountsAsync(String settle, final ApiCallback _callback) throws ApiException { @@ -1868,7 +2512,7 @@ public okhttp3.Call listFuturesAccountsAsync(String settle, final ApiCallback localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + if (limit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + if (from != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); } @@ -1915,25 +2567,25 @@ private okhttp3.Call listFuturesAccountBookCall(String settle, Integer limit, Lo } @SuppressWarnings("rawtypes") - private okhttp3.Call listFuturesAccountBookValidateBeforeCall(String settle, Integer limit, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesAccountBookValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling listFuturesAccountBook(Async)"); } - okhttp3.Call localVarCall = listFuturesAccountBookCall(settle, limit, from, to, type, _callback); + okhttp3.Call localVarCall = listFuturesAccountBookCall(settle, contract, limit, offset, from, to, type, _callback); return localVarCall; } - private ApiResponse> listFuturesAccountBookWithHttpInfo(String settle, Integer limit, Long from, Long to, String type) throws ApiException { - okhttp3.Call localVarCall = listFuturesAccountBookValidateBeforeCall(settle, limit, from, to, type, null); + private ApiResponse> listFuturesAccountBookWithHttpInfo(String settle, String contract, Integer limit, Integer offset, Long from, Long to, String type) throws ApiException { + okhttp3.Call localVarCall = listFuturesAccountBookValidateBeforeCall(settle, contract, limit, offset, from, to, type, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listFuturesAccountBookAsync(String settle, Integer limit, Long from, Long to, String type, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesAccountBookValidateBeforeCall(settle, limit, from, to, type, _callback); + private okhttp3.Call listFuturesAccountBookAsync(String settle, String contract, Integer limit, Integer offset, Long from, Long to, String type, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesAccountBookValidateBeforeCall(settle, contract, limit, offset, from, to, type, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -1941,7 +2593,9 @@ private okhttp3.Call listFuturesAccountBookAsync(String settle, Integer limit, L public class APIlistFuturesAccountBookRequest { private final String settle; + private String contract; private Integer limit; + private Integer offset; private Long from; private Long to; private String type; @@ -1950,9 +2604,19 @@ private APIlistFuturesAccountBookRequest(String settle) { this.settle = settle; } + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIlistFuturesAccountBookRequest + */ + public APIlistFuturesAccountBookRequest contract(String contract) { + this.contract = contract; + return this; + } + /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistFuturesAccountBookRequest */ public APIlistFuturesAccountBookRequest limit(Integer limit) { @@ -1960,9 +2624,19 @@ public APIlistFuturesAccountBookRequest limit(Integer limit) { return this; } + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistFuturesAccountBookRequest + */ + public APIlistFuturesAccountBookRequest offset(Integer offset) { + this.offset = offset; + return this; + } + /** * Set from - * @param from Start timestamp (optional) + * @param from 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) * @return APIlistFuturesAccountBookRequest */ public APIlistFuturesAccountBookRequest from(Long from) { @@ -1972,7 +2646,7 @@ public APIlistFuturesAccountBookRequest from(Long from) { /** * Set to - * @param to End timestamp (optional) + * @param to 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 APIlistFuturesAccountBookRequest */ public APIlistFuturesAccountBookRequest to(Long to) { @@ -1982,7 +2656,7 @@ public APIlistFuturesAccountBookRequest to(Long to) { /** * Set type - * @param type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) + * @param type 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 APIlistFuturesAccountBookRequest */ public APIlistFuturesAccountBookRequest type(String type) { @@ -1998,11 +2672,11 @@ public APIlistFuturesAccountBookRequest type(String type) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listFuturesAccountBookCall(settle, limit, from, to, type, _callback); + return listFuturesAccountBookCall(settle, contract, limit, offset, from, to, type, _callback); } /** @@ -2012,11 +2686,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listFuturesAccountBookWithHttpInfo(settle, limit, from, to, type); + ApiResponse> localVarResp = listFuturesAccountBookWithHttpInfo(settle, contract, limit, offset, from, to, type); return localVarResp.getData(); } @@ -2027,11 +2701,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listFuturesAccountBookWithHttpInfo(settle, limit, from, to, type); + return listFuturesAccountBookWithHttpInfo(settle, contract, limit, offset, from, to, type); } /** @@ -2042,42 +2716,30 @@ public ApiResponse> executeWithHttpInfo() throws ApiExc * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listFuturesAccountBookAsync(settle, limit, from, to, type, _callback); + return listFuturesAccountBookAsync(settle, contract, limit, offset, from, to, type, _callback); } } /** - * Query account book - * + * Query futures account change history + * If the contract field is passed, only records containing this field after 2023-10-30 can be filtered. * @param settle Settle currency (required) * @return APIlistFuturesAccountBookRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistFuturesAccountBookRequest listFuturesAccountBook(String settle) { return new APIlistFuturesAccountBookRequest(settle); } - /** - * Build call for listPositions - * @param settle Settle currency (required) - * @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 List retrieved -
- */ - public okhttp3.Call listPositionsCall(String settle, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPositionsCall(String settle, Boolean holding, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -2086,6 +2748,18 @@ public okhttp3.Call listPositionsCall(String settle, final ApiCallback _callback List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (holding != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("holding", holding)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2108,85 +2782,146 @@ public okhttp3.Call listPositionsCall(String settle, final ApiCallback _callback } @SuppressWarnings("rawtypes") - private okhttp3.Call listPositionsValidateBeforeCall(String settle, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPositionsValidateBeforeCall(String settle, Boolean holding, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling listPositions(Async)"); } - okhttp3.Call localVarCall = listPositionsCall(settle, _callback); + okhttp3.Call localVarCall = listPositionsCall(settle, holding, limit, offset, _callback); return localVarCall; } - /** - * List all positions of a user - * - * @param settle Settle currency (required) - * @return List<Position> - * @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 List retrieved -
- */ - public List listPositions(String settle) throws ApiException { - ApiResponse> localVarResp = listPositionsWithHttpInfo(settle); - return localVarResp.getData(); - } - /** - * List all positions of a user - * - * @param settle Settle currency (required) - * @return ApiResponse<List<Position>> - * @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 List retrieved -
- */ - public ApiResponse> listPositionsWithHttpInfo(String settle) throws ApiException { - okhttp3.Call localVarCall = listPositionsValidateBeforeCall(settle, null); + private ApiResponse> listPositionsWithHttpInfo(String settle, Boolean holding, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = listPositionsValidateBeforeCall(settle, holding, limit, offset, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * List all positions of a user (asynchronously) - * - * @param settle Settle currency (required) - * @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 List retrieved -
- */ - public okhttp3.Call listPositionsAsync(String settle, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listPositionsValidateBeforeCall(settle, _callback); + private okhttp3.Call listPositionsAsync(String settle, Boolean holding, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listPositionsValidateBeforeCall(settle, holding, limit, offset, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + public class APIlistPositionsRequest { + private final String settle; + private Boolean holding; + private Integer limit; + private Integer offset; + + private APIlistPositionsRequest(String settle) { + this.settle = settle; + } + + /** + * Set holding + * @param holding Return only real positions - true, return all - false (optional) + * @return APIlistPositionsRequest + */ + public APIlistPositionsRequest holding(Boolean holding) { + this.holding = holding; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistPositionsRequest + */ + public APIlistPositionsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistPositionsRequest + */ + public APIlistPositionsRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for listPositions + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listPositionsCall(settle, holding, limit, offset, _callback); + } + + /** + * Execute listPositions request + * @return List<Position> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listPositionsWithHttpInfo(settle, holding, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute listPositions request with HTTP info returned + * @return ApiResponse<List<Position>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listPositionsWithHttpInfo(settle, holding, limit, offset); + } + + /** + * Execute listPositions request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listPositionsAsync(settle, holding, limit, offset, _callback); + } + } + /** - * Build call for getPosition + * Get user position list + * * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object + * @return APIlistPositionsRequest * @http.response.details - +
Status Code Description Response Headers
200 Position information -
200 List retrieved successfully -
*/ - public okhttp3.Call getPositionCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + public APIlistPositionsRequest listPositions(String settle) { + return new APIlistPositionsRequest(settle); + } + + private okhttp3.Call getPositionCall(String settle, String contract, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -2233,69 +2968,110 @@ private okhttp3.Call getPositionValidateBeforeCall(String settle, String contrac return localVarCall; } - /** - * Get single position - * - * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @return Position - * @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 Position information -
- */ - public Position getPosition(String settle, String contract) throws ApiException { - ApiResponse localVarResp = getPositionWithHttpInfo(settle, contract); - return localVarResp.getData(); - } - /** - * Get single position - * - * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @return ApiResponse<Position> - * @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 Position information -
- */ - public ApiResponse getPositionWithHttpInfo(String settle, String contract) throws ApiException { + private ApiResponse getPositionWithHttpInfo(String settle, String contract) throws ApiException { okhttp3.Call localVarCall = getPositionValidateBeforeCall(settle, contract, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } + private okhttp3.Call getPositionAsync(String settle, String contract, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getPositionValidateBeforeCall(settle, contract, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetPositionRequest { + private final String settle; + private final String contract; + + private APIgetPositionRequest(String settle, String contract) { + this.settle = settle; + this.contract = contract; + } + + /** + * Build call for getPosition + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Position information -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getPositionCall(settle, contract, _callback); + } + + /** + * Execute getPosition request + * @return Position + * @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 Position information -
+ */ + public Position execute() throws ApiException { + ApiResponse localVarResp = getPositionWithHttpInfo(settle, contract); + return localVarResp.getData(); + } + + /** + * Execute getPosition request with HTTP info returned + * @return ApiResponse<Position> + * @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 Position information -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getPositionWithHttpInfo(settle, contract); + } + + /** + * Execute getPosition request (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 Position information -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getPositionAsync(settle, contract, _callback); + } + } + /** - * Get single position (asynchronously) + * Get single position information * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @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 + * @return APIgetPositionRequest * @http.response.details
Status Code Description Response Headers
200 Position information -
*/ - public okhttp3.Call getPositionAsync(String settle, String contract, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPositionValidateBeforeCall(settle, contract, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; + public APIgetPositionRequest getPosition(String settle, String contract) { + return new APIgetPositionRequest(settle, contract); } /** * Build call for updatePositionMargin * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2366,7 +3142,7 @@ private okhttp3.Call updatePositionMarginValidateBeforeCall(String settle, Strin * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @return Position * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2385,7 +3161,7 @@ public Position updatePositionMargin(String settle, String contract, String chan * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @return ApiResponse<Position> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2405,7 +3181,7 @@ public ApiResponse updatePositionMarginWithHttpInfo(String settle, Str * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) * @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 @@ -2427,7 +3203,8 @@ public okhttp3.Call updatePositionMarginAsync(String settle, String contract, St * @param settle Settle currency (required) * @param contract Futures contract (required) * @param leverage New position leverage (required) - * @param crossLeverageLimit Cross margin leverage(valid only when `leverage` is 0) (optional) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) + * @param pid Product ID (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2437,7 +3214,7 @@ public okhttp3.Call updatePositionMarginAsync(String settle, String contract, St 200 Position information - */ - public okhttp3.Call updatePositionLeverageCall(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updatePositionLeverageCall(String settle, String contract, String leverage, String crossLeverageLimit, Integer pid, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -2455,6 +3232,10 @@ public okhttp3.Call updatePositionLeverageCall(String settle, String contract, S localVarQueryParams.addAll(localVarApiClient.parameterToPair("cross_leverage_limit", crossLeverageLimit)); } + if (pid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pid", pid)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2477,7 +3258,7 @@ public okhttp3.Call updatePositionLeverageCall(String settle, String contract, S } @SuppressWarnings("rawtypes") - private okhttp3.Call updatePositionLeverageValidateBeforeCall(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updatePositionLeverageValidateBeforeCall(String settle, String contract, String leverage, String crossLeverageLimit, Integer pid, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling updatePositionLeverage(Async)"); @@ -2493,7 +3274,7 @@ private okhttp3.Call updatePositionLeverageValidateBeforeCall(String settle, Str throw new ApiException("Missing the required parameter 'leverage' when calling updatePositionLeverage(Async)"); } - okhttp3.Call localVarCall = updatePositionLeverageCall(settle, contract, leverage, crossLeverageLimit, _callback); + okhttp3.Call localVarCall = updatePositionLeverageCall(settle, contract, leverage, crossLeverageLimit, pid, _callback); return localVarCall; } @@ -2503,7 +3284,8 @@ private okhttp3.Call updatePositionLeverageValidateBeforeCall(String settle, Str * @param settle Settle currency (required) * @param contract Futures contract (required) * @param leverage New position leverage (required) - * @param crossLeverageLimit Cross margin leverage(valid only when `leverage` is 0) (optional) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) + * @param pid Product ID (optional) * @return Position * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2512,8 +3294,8 @@ private okhttp3.Call updatePositionLeverageValidateBeforeCall(String settle, Str 200 Position information - */ - public Position updatePositionLeverage(String settle, String contract, String leverage, String crossLeverageLimit) throws ApiException { - ApiResponse localVarResp = updatePositionLeverageWithHttpInfo(settle, contract, leverage, crossLeverageLimit); + public Position updatePositionLeverage(String settle, String contract, String leverage, String crossLeverageLimit, Integer pid) throws ApiException { + ApiResponse localVarResp = updatePositionLeverageWithHttpInfo(settle, contract, leverage, crossLeverageLimit, pid); return localVarResp.getData(); } @@ -2523,7 +3305,8 @@ public Position updatePositionLeverage(String settle, String contract, String le * @param settle Settle currency (required) * @param contract Futures contract (required) * @param leverage New position leverage (required) - * @param crossLeverageLimit Cross margin leverage(valid only when `leverage` is 0) (optional) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) + * @param pid Product ID (optional) * @return ApiResponse<Position> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2532,8 +3315,8 @@ public Position updatePositionLeverage(String settle, String contract, String le 200 Position information - */ - public ApiResponse updatePositionLeverageWithHttpInfo(String settle, String contract, String leverage, String crossLeverageLimit) throws ApiException { - okhttp3.Call localVarCall = updatePositionLeverageValidateBeforeCall(settle, contract, leverage, crossLeverageLimit, null); + public ApiResponse updatePositionLeverageWithHttpInfo(String settle, String contract, String leverage, String crossLeverageLimit, Integer pid) throws ApiException { + okhttp3.Call localVarCall = updatePositionLeverageValidateBeforeCall(settle, contract, leverage, crossLeverageLimit, pid, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2544,7 +3327,8 @@ public ApiResponse updatePositionLeverageWithHttpInfo(String settle, S * @param settle Settle currency (required) * @param contract Futures contract (required) * @param leverage New position leverage (required) - * @param crossLeverageLimit Cross margin leverage(valid only when `leverage` is 0) (optional) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) + * @param pid Product ID (optional) * @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 @@ -2554,18 +3338,17 @@ public ApiResponse updatePositionLeverageWithHttpInfo(String settle, S 200 Position information - */ - public okhttp3.Call updatePositionLeverageAsync(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updatePositionLeverageValidateBeforeCall(settle, contract, leverage, crossLeverageLimit, _callback); + public okhttp3.Call updatePositionLeverageAsync(String settle, String contract, String leverage, String crossLeverageLimit, Integer pid, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = updatePositionLeverageValidateBeforeCall(settle, contract, leverage, crossLeverageLimit, pid, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updatePositionRiskLimit + * Build call for updatePositionCrossMode * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param futuresPositionCrossMode (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2575,20 +3358,15 @@ public okhttp3.Call updatePositionLeverageAsync(String settle, String contract, 200 Position information - */ - public okhttp3.Call updatePositionRiskLimitCall(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public okhttp3.Call updatePositionCrossModeCall(String settle, FuturesPositionCrossMode futuresPositionCrossMode, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = futuresPositionCrossMode; // create path and map variables - String localVarPath = "/futures/{settle}/positions/{contract}/risk_limit" - .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) - .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); + String localVarPath = "/futures/{settle}/positions/cross_mode" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (riskLimit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("risk_limit", riskLimit)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2601,7 +3379,7 @@ public okhttp3.Call updatePositionRiskLimitCall(String settle, String contract, } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -2611,32 +3389,26 @@ public okhttp3.Call updatePositionRiskLimitCall(String settle, String contract, } @SuppressWarnings("rawtypes") - private okhttp3.Call updatePositionRiskLimitValidateBeforeCall(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updatePositionCrossModeValidateBeforeCall(String settle, FuturesPositionCrossMode futuresPositionCrossMode, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling updatePositionRiskLimit(Async)"); - } - - // verify the required parameter 'contract' is set - if (contract == null) { - throw new ApiException("Missing the required parameter 'contract' when calling updatePositionRiskLimit(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling updatePositionCrossMode(Async)"); } - // verify the required parameter 'riskLimit' is set - if (riskLimit == null) { - throw new ApiException("Missing the required parameter 'riskLimit' when calling updatePositionRiskLimit(Async)"); + // verify the required parameter 'futuresPositionCrossMode' is set + if (futuresPositionCrossMode == null) { + throw new ApiException("Missing the required parameter 'futuresPositionCrossMode' when calling updatePositionCrossMode(Async)"); } - okhttp3.Call localVarCall = updatePositionRiskLimitCall(settle, contract, riskLimit, _callback); + okhttp3.Call localVarCall = updatePositionCrossModeCall(settle, futuresPositionCrossMode, _callback); return localVarCall; } /** - * Update position risk limit + * Switch Position Margin Mode * * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param futuresPositionCrossMode (required) * @return Position * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2645,17 +3417,16 @@ private okhttp3.Call updatePositionRiskLimitValidateBeforeCall(String settle, St 200 Position information - */ - public Position updatePositionRiskLimit(String settle, String contract, String riskLimit) throws ApiException { - ApiResponse localVarResp = updatePositionRiskLimitWithHttpInfo(settle, contract, riskLimit); + public Position updatePositionCrossMode(String settle, FuturesPositionCrossMode futuresPositionCrossMode) throws ApiException { + ApiResponse localVarResp = updatePositionCrossModeWithHttpInfo(settle, futuresPositionCrossMode); return localVarResp.getData(); } /** - * Update position risk limit + * Switch Position Margin Mode * * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param futuresPositionCrossMode (required) * @return ApiResponse<Position> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2664,18 +3435,17 @@ public Position updatePositionRiskLimit(String settle, String contract, String r 200 Position information - */ - public ApiResponse updatePositionRiskLimitWithHttpInfo(String settle, String contract, String riskLimit) throws ApiException { - okhttp3.Call localVarCall = updatePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, null); + public ApiResponse updatePositionCrossModeWithHttpInfo(String settle, FuturesPositionCrossMode futuresPositionCrossMode) throws ApiException { + okhttp3.Call localVarCall = updatePositionCrossModeValidateBeforeCall(settle, futuresPositionCrossMode, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update position risk limit (asynchronously) + * Switch Position Margin Mode (asynchronously) * * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param futuresPositionCrossMode (required) * @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 @@ -2685,39 +3455,35 @@ public ApiResponse updatePositionRiskLimitWithHttpInfo(String settle, 200 Position information - */ - public okhttp3.Call updatePositionRiskLimitAsync(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updatePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, _callback); + public okhttp3.Call updatePositionCrossModeAsync(String settle, FuturesPositionCrossMode futuresPositionCrossMode, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = updatePositionCrossModeValidateBeforeCall(settle, futuresPositionCrossMode, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for setDualMode + * Build call for updateDualCompPositionCrossMode * @param settle Settle currency (required) - * @param dualMode Whether to enable dual mode (required) + * @param inlineObject (required) * @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 Updated -
200 Query successful -
*/ - public okhttp3.Call setDualModeCall(String settle, Boolean dualMode, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public okhttp3.Call updateDualCompPositionCrossModeCall(String settle, InlineObject inlineObject, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = inlineObject; // create path and map variables - String localVarPath = "/futures/{settle}/dual_mode" + String localVarPath = "/futures/{settle}/dual_comp/positions/cross_mode" .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (dualMode != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dual_mode", dualMode)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2730,7 +3496,7 @@ public okhttp3.Call setDualModeCall(String settle, Boolean dualMode, final ApiCa } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -2740,102 +3506,107 @@ public okhttp3.Call setDualModeCall(String settle, Boolean dualMode, final ApiCa } @SuppressWarnings("rawtypes") - private okhttp3.Call setDualModeValidateBeforeCall(String settle, Boolean dualMode, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateDualCompPositionCrossModeValidateBeforeCall(String settle, InlineObject inlineObject, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling setDualMode(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling updateDualCompPositionCrossMode(Async)"); } - // verify the required parameter 'dualMode' is set - if (dualMode == null) { - throw new ApiException("Missing the required parameter 'dualMode' when calling setDualMode(Async)"); + // verify the required parameter 'inlineObject' is set + if (inlineObject == null) { + throw new ApiException("Missing the required parameter 'inlineObject' when calling updateDualCompPositionCrossMode(Async)"); } - okhttp3.Call localVarCall = setDualModeCall(settle, dualMode, _callback); + okhttp3.Call localVarCall = updateDualCompPositionCrossModeCall(settle, inlineObject, _callback); return localVarCall; } /** - * Enable or disable dual mode - * Before setting dual mode, make sure all positions are closed and no orders are open + * Switch Between Cross and Isolated Margin Modes Under Hedge Mode + * * @param settle Settle currency (required) - * @param dualMode Whether to enable dual mode (required) - * @return FuturesAccount + * @param inlineObject (required) + * @return List<Position> * @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 Updated -
200 Query successful -
*/ - public FuturesAccount setDualMode(String settle, Boolean dualMode) throws ApiException { - ApiResponse localVarResp = setDualModeWithHttpInfo(settle, dualMode); + public List updateDualCompPositionCrossMode(String settle, InlineObject inlineObject) throws ApiException { + ApiResponse> localVarResp = updateDualCompPositionCrossModeWithHttpInfo(settle, inlineObject); return localVarResp.getData(); } /** - * Enable or disable dual mode - * Before setting dual mode, make sure all positions are closed and no orders are open + * Switch Between Cross and Isolated Margin Modes Under Hedge Mode + * * @param settle Settle currency (required) - * @param dualMode Whether to enable dual mode (required) - * @return ApiResponse<FuturesAccount> + * @param inlineObject (required) + * @return ApiResponse<List<Position>> * @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 Updated -
200 Query successful -
*/ - public ApiResponse setDualModeWithHttpInfo(String settle, Boolean dualMode) throws ApiException { - okhttp3.Call localVarCall = setDualModeValidateBeforeCall(settle, dualMode, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse> updateDualCompPositionCrossModeWithHttpInfo(String settle, InlineObject inlineObject) throws ApiException { + okhttp3.Call localVarCall = updateDualCompPositionCrossModeValidateBeforeCall(settle, inlineObject, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Enable or disable dual mode (asynchronously) - * Before setting dual mode, make sure all positions are closed and no orders are open + * Switch Between Cross and Isolated Margin Modes Under Hedge Mode (asynchronously) + * * @param settle Settle currency (required) - * @param dualMode Whether to enable dual mode (required) + * @param inlineObject (required) * @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 Updated -
200 Query successful -
*/ - public okhttp3.Call setDualModeAsync(String settle, Boolean dualMode, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = setDualModeValidateBeforeCall(settle, dualMode, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateDualCompPositionCrossModeAsync(String settle, InlineObject inlineObject, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = updateDualCompPositionCrossModeValidateBeforeCall(settle, inlineObject, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getDualModePosition + * Build call for updatePositionRiskLimit * @param settle Settle currency (required) * @param contract Futures contract (required) + * @param riskLimit New risk limit value (required) * @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 -
200 Position information -
*/ - public okhttp3.Call getDualModePositionCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updatePositionRiskLimitCall(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/futures/{settle}/dual_comp/positions/{contract}" + String localVarPath = "/futures/{settle}/positions/{contract}/risk_limit" .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (riskLimit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("risk_limit", riskLimit)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2854,114 +3625,115 @@ public okhttp3.Call getDualModePositionCall(String settle, String contract, fina localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDualModePositionValidateBeforeCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updatePositionRiskLimitValidateBeforeCall(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling getDualModePosition(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling updatePositionRiskLimit(Async)"); } // verify the required parameter 'contract' is set if (contract == null) { - throw new ApiException("Missing the required parameter 'contract' when calling getDualModePosition(Async)"); + throw new ApiException("Missing the required parameter 'contract' when calling updatePositionRiskLimit(Async)"); } - okhttp3.Call localVarCall = getDualModePositionCall(settle, contract, _callback); + // verify the required parameter 'riskLimit' is set + if (riskLimit == null) { + throw new ApiException("Missing the required parameter 'riskLimit' when calling updatePositionRiskLimit(Async)"); + } + + okhttp3.Call localVarCall = updatePositionRiskLimitCall(settle, contract, riskLimit, _callback); return localVarCall; } /** - * Retrieve position detail in dual mode + * Update position risk limit * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @return List<Position> + * @param riskLimit New risk limit value (required) + * @return Position * @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 -
200 Position information -
*/ - public List getDualModePosition(String settle, String contract) throws ApiException { - ApiResponse> localVarResp = getDualModePositionWithHttpInfo(settle, contract); + public Position updatePositionRiskLimit(String settle, String contract, String riskLimit) throws ApiException { + ApiResponse localVarResp = updatePositionRiskLimitWithHttpInfo(settle, contract, riskLimit); return localVarResp.getData(); } /** - * Retrieve position detail in dual mode + * Update position risk limit * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @return ApiResponse<List<Position>> + * @param riskLimit New risk limit value (required) + * @return ApiResponse<Position> * @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 -
200 Position information -
*/ - public ApiResponse> getDualModePositionWithHttpInfo(String settle, String contract) throws ApiException { - okhttp3.Call localVarCall = getDualModePositionValidateBeforeCall(settle, contract, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + public ApiResponse updatePositionRiskLimitWithHttpInfo(String settle, String contract, String riskLimit) throws ApiException { + okhttp3.Call localVarCall = updatePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Retrieve position detail in dual mode (asynchronously) + * Update position risk limit (asynchronously) * * @param settle Settle currency (required) * @param contract Futures contract (required) + * @param riskLimit New risk limit value (required) * @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 -
200 Position information -
*/ - public okhttp3.Call getDualModePositionAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = getDualModePositionValidateBeforeCall(settle, contract, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + public okhttp3.Call updatePositionRiskLimitAsync(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = updatePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateDualModePositionMargin + * Build call for setDualMode * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) - * @param dualSide Long or short position (required) + * @param dualMode Whether to enable dual mode (required) * @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 -
200 Updated successfully -
*/ - public okhttp3.Call updateDualModePositionMarginCall(String settle, String contract, String change, String dualSide, final ApiCallback _callback) throws ApiException { + public okhttp3.Call setDualModeCall(String settle, Boolean dualMode, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/futures/{settle}/dual_comp/positions/{contract}/margin" - .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) - .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); + String localVarPath = "/futures/{settle}/dual_mode" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (change != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("change", change)); - } - - if (dualSide != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dual_side", dualSide)); + if (dualMode != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dual_mode", dualMode)); } Map localVarHeaderParams = new HashMap(); @@ -2986,123 +3758,89 @@ public okhttp3.Call updateDualModePositionMarginCall(String settle, String contr } @SuppressWarnings("rawtypes") - private okhttp3.Call updateDualModePositionMarginValidateBeforeCall(String settle, String contract, String change, String dualSide, final ApiCallback _callback) throws ApiException { + private okhttp3.Call setDualModeValidateBeforeCall(String settle, Boolean dualMode, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling updateDualModePositionMargin(Async)"); - } - - // verify the required parameter 'contract' is set - if (contract == null) { - throw new ApiException("Missing the required parameter 'contract' when calling updateDualModePositionMargin(Async)"); - } - - // verify the required parameter 'change' is set - if (change == null) { - throw new ApiException("Missing the required parameter 'change' when calling updateDualModePositionMargin(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling setDualMode(Async)"); } - // verify the required parameter 'dualSide' is set - if (dualSide == null) { - throw new ApiException("Missing the required parameter 'dualSide' when calling updateDualModePositionMargin(Async)"); + // verify the required parameter 'dualMode' is set + if (dualMode == null) { + throw new ApiException("Missing the required parameter 'dualMode' when calling setDualMode(Async)"); } - okhttp3.Call localVarCall = updateDualModePositionMarginCall(settle, contract, change, dualSide, _callback); + okhttp3.Call localVarCall = setDualModeCall(settle, dualMode, _callback); return localVarCall; } /** - * Update position margin in dual mode - * + * Set position mode + * The prerequisite for changing mode is that all positions have no holdings and no pending orders * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) - * @param dualSide Long or short position (required) - * @return List<Position> + * @param dualMode Whether to enable dual mode (required) + * @return FuturesAccount * @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 -
200 Updated successfully -
*/ - public List updateDualModePositionMargin(String settle, String contract, String change, String dualSide) throws ApiException { - ApiResponse> localVarResp = updateDualModePositionMarginWithHttpInfo(settle, contract, change, dualSide); + public FuturesAccount setDualMode(String settle, Boolean dualMode) throws ApiException { + ApiResponse localVarResp = setDualModeWithHttpInfo(settle, dualMode); return localVarResp.getData(); } /** - * Update position margin in dual mode - * + * Set position mode + * The prerequisite for changing mode is that all positions have no holdings and no pending orders * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) - * @param dualSide Long or short position (required) - * @return ApiResponse<List<Position>> + * @param dualMode Whether to enable dual mode (required) + * @return ApiResponse<FuturesAccount> * @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 -
200 Updated successfully -
*/ - public ApiResponse> updateDualModePositionMarginWithHttpInfo(String settle, String contract, String change, String dualSide) throws ApiException { - okhttp3.Call localVarCall = updateDualModePositionMarginValidateBeforeCall(settle, contract, change, dualSide, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + public ApiResponse setDualModeWithHttpInfo(String settle, Boolean dualMode) throws ApiException { + okhttp3.Call localVarCall = setDualModeValidateBeforeCall(settle, dualMode, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update position margin in dual mode (asynchronously) - * + * Set position mode (asynchronously) + * The prerequisite for changing mode is that all positions have no holdings and no pending orders * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param change Margin change. Use positive number to increase margin, negative number otherwise. (required) - * @param dualSide Long or short position (required) + * @param dualMode Whether to enable dual mode (required) * @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 -
200 Updated successfully -
*/ - public okhttp3.Call updateDualModePositionMarginAsync(String settle, String contract, String change, String dualSide, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = updateDualModePositionMarginValidateBeforeCall(settle, contract, change, dualSide, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + public okhttp3.Call setDualModeAsync(String settle, Boolean dualMode, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = setDualModeValidateBeforeCall(settle, dualMode, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for updateDualModePositionLeverage - * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param leverage New position leverage (required) - * @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 updateDualModePositionLeverageCall(String settle, String contract, String leverage, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getDualModePositionCall(String settle, String contract, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/futures/{settle}/dual_comp/positions/{contract}/leverage" + String localVarPath = "/futures/{settle}/dual_comp/positions/{contract}" .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (leverage != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("leverage", leverage)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -3121,65 +3859,380 @@ public okhttp3.Call updateDualModePositionLeverageCall(String settle, String con localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateDualModePositionLeverageValidateBeforeCall(String settle, String contract, String leverage, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getDualModePositionValidateBeforeCall(String settle, String contract, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling updateDualModePositionLeverage(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling getDualModePosition(Async)"); } // verify the required parameter 'contract' is set if (contract == null) { - throw new ApiException("Missing the required parameter 'contract' when calling updateDualModePositionLeverage(Async)"); + throw new ApiException("Missing the required parameter 'contract' when calling getDualModePosition(Async)"); } - // verify the required parameter 'leverage' is set - if (leverage == null) { - throw new ApiException("Missing the required parameter 'leverage' when calling updateDualModePositionLeverage(Async)"); - } + okhttp3.Call localVarCall = getDualModePositionCall(settle, contract, _callback); + return localVarCall; + } + + + private ApiResponse> getDualModePositionWithHttpInfo(String settle, String contract) throws ApiException { + okhttp3.Call localVarCall = getDualModePositionValidateBeforeCall(settle, contract, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } - okhttp3.Call localVarCall = updateDualModePositionLeverageCall(settle, contract, leverage, _callback); + private okhttp3.Call getDualModePositionAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getDualModePositionValidateBeforeCall(settle, contract, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + public class APIgetDualModePositionRequest { + private final String settle; + private final String contract; + + private APIgetDualModePositionRequest(String settle, String contract) { + this.settle = settle; + this.contract = contract; + } + + /** + * Build call for getDualModePosition + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getDualModePositionCall(settle, contract, _callback); + } + + /** + * Execute getDualModePosition request + * @return List<Position> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getDualModePositionWithHttpInfo(settle, contract); + return localVarResp.getData(); + } + + /** + * Execute getDualModePosition request with HTTP info returned + * @return ApiResponse<List<Position>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getDualModePositionWithHttpInfo(settle, contract); + } + + /** + * Execute getDualModePosition request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getDualModePositionAsync(settle, contract, _callback); + } + } + /** - * Update position leverage in dual mode + * Get position information in dual mode * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param leverage New position leverage (required) - * @return List<Position> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @return APIgetDualModePositionRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ - public List updateDualModePositionLeverage(String settle, String contract, String leverage) throws ApiException { - ApiResponse> localVarResp = updateDualModePositionLeverageWithHttpInfo(settle, contract, leverage); - return localVarResp.getData(); + public APIgetDualModePositionRequest getDualModePosition(String settle, String contract) { + return new APIgetDualModePositionRequest(settle, contract); } /** - * Update position leverage in dual mode - * + * Build call for updateDualModePositionMargin * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param leverage New position leverage (required) - * @return ApiResponse<List<Position>> + * @param change Margin change amount, positive number increases, negative number decreases (required) + * @param dualSide Long or short position (required) + * @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 Query successful -
+ */ + public okhttp3.Call updateDualModePositionMarginCall(String settle, String contract, String change, String dualSide, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/dual_comp/positions/{contract}/margin" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) + .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (change != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("change", change)); + } + + if (dualSide != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dual_side", dualSide)); + } + + 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateDualModePositionMarginValidateBeforeCall(String settle, String contract, String change, String dualSide, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling updateDualModePositionMargin(Async)"); + } + + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling updateDualModePositionMargin(Async)"); + } + + // verify the required parameter 'change' is set + if (change == null) { + throw new ApiException("Missing the required parameter 'change' when calling updateDualModePositionMargin(Async)"); + } + + // verify the required parameter 'dualSide' is set + if (dualSide == null) { + throw new ApiException("Missing the required parameter 'dualSide' when calling updateDualModePositionMargin(Async)"); + } + + okhttp3.Call localVarCall = updateDualModePositionMarginCall(settle, contract, change, dualSide, _callback); + return localVarCall; + } + + /** + * Update position margin in dual mode + * + * @param settle Settle currency (required) + * @param contract Futures contract (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) + * @param dualSide Long or short position (required) + * @return List<Position> + * @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 Query successful -
+ */ + public List updateDualModePositionMargin(String settle, String contract, String change, String dualSide) throws ApiException { + ApiResponse> localVarResp = updateDualModePositionMarginWithHttpInfo(settle, contract, change, dualSide); + return localVarResp.getData(); + } + + /** + * Update position margin in dual mode + * + * @param settle Settle currency (required) + * @param contract Futures contract (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) + * @param dualSide Long or short position (required) + * @return ApiResponse<List<Position>> + * @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 Query successful -
+ */ + public ApiResponse> updateDualModePositionMarginWithHttpInfo(String settle, String contract, String change, String dualSide) throws ApiException { + okhttp3.Call localVarCall = updateDualModePositionMarginValidateBeforeCall(settle, contract, change, dualSide, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update position margin in dual mode (asynchronously) + * + * @param settle Settle currency (required) + * @param contract Futures contract (required) + * @param change Margin change amount, positive number increases, negative number decreases (required) + * @param dualSide Long or short position (required) + * @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 Query successful -
+ */ + public okhttp3.Call updateDualModePositionMarginAsync(String settle, String contract, String change, String dualSide, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = updateDualModePositionMarginValidateBeforeCall(settle, contract, change, dualSide, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateDualModePositionLeverage + * @param settle Settle currency (required) + * @param contract Futures contract (required) + * @param leverage New position leverage (required) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) + * @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 Query successful -
+ */ + public okhttp3.Call updateDualModePositionLeverageCall(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/dual_comp/positions/{contract}/leverage" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) + .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (leverage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("leverage", leverage)); + } + + if (crossLeverageLimit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cross_leverage_limit", crossLeverageLimit)); + } + + 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateDualModePositionLeverageValidateBeforeCall(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling updateDualModePositionLeverage(Async)"); + } + + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling updateDualModePositionLeverage(Async)"); + } + + // verify the required parameter 'leverage' is set + if (leverage == null) { + throw new ApiException("Missing the required parameter 'leverage' when calling updateDualModePositionLeverage(Async)"); + } + + okhttp3.Call localVarCall = updateDualModePositionLeverageCall(settle, contract, leverage, crossLeverageLimit, _callback); + return localVarCall; + } + + /** + * Update position leverage in dual mode + * + * @param settle Settle currency (required) + * @param contract Futures contract (required) + * @param leverage New position leverage (required) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) + * @return List<Position> + * @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 Query successful -
+ */ + public List updateDualModePositionLeverage(String settle, String contract, String leverage, String crossLeverageLimit) throws ApiException { + ApiResponse> localVarResp = updateDualModePositionLeverageWithHttpInfo(settle, contract, leverage, crossLeverageLimit); + return localVarResp.getData(); + } + + /** + * Update position leverage in dual mode + * + * @param settle Settle currency (required) + * @param contract Futures contract (required) + * @param leverage New position leverage (required) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) + * @return ApiResponse<List<Position>> * @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 -
200 Query successful -
*/ - public ApiResponse> updateDualModePositionLeverageWithHttpInfo(String settle, String contract, String leverage) throws ApiException { - okhttp3.Call localVarCall = updateDualModePositionLeverageValidateBeforeCall(settle, contract, leverage, null); + public ApiResponse> updateDualModePositionLeverageWithHttpInfo(String settle, String contract, String leverage, String crossLeverageLimit) throws ApiException { + okhttp3.Call localVarCall = updateDualModePositionLeverageValidateBeforeCall(settle, contract, leverage, crossLeverageLimit, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -3190,17 +4243,18 @@ public ApiResponse> updateDualModePositionLeverageWithHttpInfo(St * @param settle Settle currency (required) * @param contract Futures contract (required) * @param leverage New position leverage (required) + * @param crossLeverageLimit Cross margin leverage (valid only when `leverage` is 0) (optional) * @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 -
200 Query successful -
*/ - public okhttp3.Call updateDualModePositionLeverageAsync(String settle, String contract, String leverage, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = updateDualModePositionLeverageValidateBeforeCall(settle, contract, leverage, _callback); + public okhttp3.Call updateDualModePositionLeverageAsync(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = updateDualModePositionLeverageValidateBeforeCall(settle, contract, leverage, crossLeverageLimit, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -3210,14 +4264,14 @@ public okhttp3.Call updateDualModePositionLeverageAsync(String settle, String co * Build call for updateDualModePositionRiskLimit * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param riskLimit New risk limit value (required) * @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 -
200 Query successful -
*/ public okhttp3.Call updateDualModePositionRiskLimitCall(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { @@ -3281,13 +4335,13 @@ private okhttp3.Call updateDualModePositionRiskLimitValidateBeforeCall(String se * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param riskLimit New risk limit value (required) * @return List<Position> * @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 -
200 Query successful -
*/ public List updateDualModePositionRiskLimit(String settle, String contract, String riskLimit) throws ApiException { @@ -3300,13 +4354,13 @@ public List updateDualModePositionRiskLimit(String settle, String cont * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param riskLimit New risk limit value (required) * @return ApiResponse<List<Position>> * @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 -
200 Query successful -
*/ public ApiResponse> updateDualModePositionRiskLimitWithHttpInfo(String settle, String contract, String riskLimit) throws ApiException { @@ -3320,14 +4374,14 @@ public ApiResponse> updateDualModePositionRiskLimitWithHttpInfo(S * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (required) + * @param riskLimit New risk limit value (required) * @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 -
200 Query successful -
*/ public okhttp3.Call updateDualModePositionRiskLimitAsync(String settle, String contract, String riskLimit, final ApiCallback> _callback) throws ApiException { @@ -3337,7 +4391,7 @@ public okhttp3.Call updateDualModePositionRiskLimitAsync(String settle, String c return localVarCall; } - private okhttp3.Call listFuturesOrdersCall(String settle, String contract, String status, Integer limit, Integer offset, String lastId, Integer countTotal, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesOrdersCall(String settle, String status, String contract, Integer limit, Integer offset, String lastId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -3366,10 +4420,6 @@ private okhttp3.Call listFuturesOrdersCall(String settle, String contract, Strin localVarQueryParams.addAll(localVarApiClient.parameterToPair("last_id", lastId)); } - if (countTotal != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("count_total", countTotal)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -3392,35 +4442,30 @@ private okhttp3.Call listFuturesOrdersCall(String settle, String contract, Strin } @SuppressWarnings("rawtypes") - private okhttp3.Call listFuturesOrdersValidateBeforeCall(String settle, String contract, String status, Integer limit, Integer offset, String lastId, Integer countTotal, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFuturesOrdersValidateBeforeCall(String settle, String status, String contract, Integer limit, Integer offset, String lastId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling listFuturesOrders(Async)"); } - // verify the required parameter 'contract' is set - if (contract == null) { - throw new ApiException("Missing the required parameter 'contract' when calling listFuturesOrders(Async)"); - } - // verify the required parameter 'status' is set if (status == null) { throw new ApiException("Missing the required parameter 'status' when calling listFuturesOrders(Async)"); } - okhttp3.Call localVarCall = listFuturesOrdersCall(settle, contract, status, limit, offset, lastId, countTotal, _callback); + okhttp3.Call localVarCall = listFuturesOrdersCall(settle, status, contract, limit, offset, lastId, _callback); return localVarCall; } - private ApiResponse> listFuturesOrdersWithHttpInfo(String settle, String contract, String status, Integer limit, Integer offset, String lastId, Integer countTotal) throws ApiException { - okhttp3.Call localVarCall = listFuturesOrdersValidateBeforeCall(settle, contract, status, limit, offset, lastId, countTotal, null); + private ApiResponse> listFuturesOrdersWithHttpInfo(String settle, String status, String contract, Integer limit, Integer offset, String lastId) throws ApiException { + okhttp3.Call localVarCall = listFuturesOrdersValidateBeforeCall(settle, status, contract, limit, offset, lastId, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listFuturesOrdersAsync(String settle, String contract, String status, Integer limit, Integer offset, String lastId, Integer countTotal, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesOrdersValidateBeforeCall(settle, contract, status, limit, offset, lastId, countTotal, _callback); + private okhttp3.Call listFuturesOrdersAsync(String settle, String status, String contract, Integer limit, Integer offset, String lastId, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesOrdersValidateBeforeCall(settle, status, contract, limit, offset, lastId, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -3428,22 +4473,30 @@ private okhttp3.Call listFuturesOrdersAsync(String settle, String contract, Stri public class APIlistFuturesOrdersRequest { private final String settle; - private final String contract; private final String status; + private String contract; private Integer limit; private Integer offset; private String lastId; - private Integer countTotal; - private APIlistFuturesOrdersRequest(String settle, String contract, String status) { + private APIlistFuturesOrdersRequest(String settle, String status) { this.settle = settle; - this.contract = contract; this.status = status; } + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIlistFuturesOrdersRequest + */ + public APIlistFuturesOrdersRequest contract(String contract) { + this.contract = contract; + return this; + } + /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistFuturesOrdersRequest */ public APIlistFuturesOrdersRequest limit(Integer limit) { @@ -3463,7 +4516,7 @@ public APIlistFuturesOrdersRequest offset(Integer offset) { /** * Set lastId - * @param lastId Specify list staring point using the `id` of last record in previous list-query results (optional) + * @param lastId 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 APIlistFuturesOrdersRequest */ public APIlistFuturesOrdersRequest lastId(String lastId) { @@ -3471,16 +4524,6 @@ public APIlistFuturesOrdersRequest lastId(String lastId) { return this; } - /** - * Set countTotal - * @param countTotal Whether to return total number matched. Default to 0(no return) (optional, default to 0) - * @return APIlistFuturesOrdersRequest - */ - public APIlistFuturesOrdersRequest countTotal(Integer countTotal) { - this.countTotal = countTotal; - return this; - } - /** * Build call for listFuturesOrders * @param _callback ApiCallback API callback @@ -3489,11 +4532,11 @@ public APIlistFuturesOrdersRequest countTotal(Integer countTotal) { * @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
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listFuturesOrdersCall(settle, contract, status, limit, offset, lastId, countTotal, _callback); + return listFuturesOrdersCall(settle, status, contract, limit, offset, lastId, _callback); } /** @@ -3503,11 +4546,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @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
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listFuturesOrdersWithHttpInfo(settle, contract, status, limit, offset, lastId, countTotal); + ApiResponse> localVarResp = listFuturesOrdersWithHttpInfo(settle, status, contract, limit, offset, lastId); return localVarResp.getData(); } @@ -3518,11 +4561,11 @@ public List execute() throws ApiException { * @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
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listFuturesOrdersWithHttpInfo(settle, contract, status, limit, offset, lastId, countTotal); + return listFuturesOrdersWithHttpInfo(settle, status, contract, limit, offset, lastId); } /** @@ -3533,35 +4576,35 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @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
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listFuturesOrdersAsync(settle, contract, status, limit, offset, lastId, countTotal, _callback); + return listFuturesOrdersAsync(settle, status, contract, limit, offset, lastId, _callback); } } /** - * List futures orders - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * 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`. * @param settle Settle currency (required) - * @param contract Futures contract (required) - * @param status Only list the orders with this status (required) + * @param status Query order list based on status (required) * @return APIlistFuturesOrdersRequest * @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
*/ - public APIlistFuturesOrdersRequest listFuturesOrders(String settle, String contract, String status) { - return new APIlistFuturesOrdersRequest(settle, contract, status); + public APIlistFuturesOrdersRequest listFuturesOrders(String settle, String status) { + return new APIlistFuturesOrdersRequest(settle, status); } /** * Build call for createFuturesOrder * @param settle Settle currency (required) * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3571,7 +4614,7 @@ public APIlistFuturesOrdersRequest listFuturesOrders(String settle, String contr 201 Order details - */ - public okhttp3.Call createFuturesOrderCall(String settle, FuturesOrder futuresOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createFuturesOrderCall(String settle, FuturesOrder futuresOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { Object localVarPostBody = futuresOrder; // create path and map variables @@ -3581,6 +4624,10 @@ public okhttp3.Call createFuturesOrderCall(String settle, FuturesOrder futuresOr List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { @@ -3602,7 +4649,7 @@ public okhttp3.Call createFuturesOrderCall(String settle, FuturesOrder futuresOr } @SuppressWarnings("rawtypes") - private okhttp3.Call createFuturesOrderValidateBeforeCall(String settle, FuturesOrder futuresOrder, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createFuturesOrderValidateBeforeCall(String settle, FuturesOrder futuresOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling createFuturesOrder(Async)"); @@ -3613,15 +4660,16 @@ private okhttp3.Call createFuturesOrderValidateBeforeCall(String settle, Futures throw new ApiException("Missing the required parameter 'futuresOrder' when calling createFuturesOrder(Async)"); } - okhttp3.Call localVarCall = createFuturesOrderCall(settle, futuresOrder, _callback); + okhttp3.Call localVarCall = createFuturesOrderCall(settle, futuresOrder, xGateExptime, _callback); return localVarCall; } /** - * Create a futures order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * 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` * @param settle Settle currency (required) * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @return FuturesOrder * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3630,16 +4678,17 @@ private okhttp3.Call createFuturesOrderValidateBeforeCall(String settle, Futures 201 Order details - */ - public FuturesOrder createFuturesOrder(String settle, FuturesOrder futuresOrder) throws ApiException { - ApiResponse localVarResp = createFuturesOrderWithHttpInfo(settle, futuresOrder); + public FuturesOrder createFuturesOrder(String settle, FuturesOrder futuresOrder, String xGateExptime) throws ApiException { + ApiResponse localVarResp = createFuturesOrderWithHttpInfo(settle, futuresOrder, xGateExptime); return localVarResp.getData(); } /** - * Create a futures order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * 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` * @param settle Settle currency (required) * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @return ApiResponse<FuturesOrder> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3648,17 +4697,18 @@ public FuturesOrder createFuturesOrder(String settle, FuturesOrder futuresOrder) 201 Order details - */ - public ApiResponse createFuturesOrderWithHttpInfo(String settle, FuturesOrder futuresOrder) throws ApiException { - okhttp3.Call localVarCall = createFuturesOrderValidateBeforeCall(settle, futuresOrder, null); + public ApiResponse createFuturesOrderWithHttpInfo(String settle, FuturesOrder futuresOrder, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = createFuturesOrderValidateBeforeCall(settle, futuresOrder, xGateExptime, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create a futures order (asynchronously) - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Place futures order (asynchronously) + * - 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` * @param settle Settle currency (required) * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @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 @@ -3668,8 +4718,8 @@ public ApiResponse createFuturesOrderWithHttpInfo(String settle, F 201 Order details - */ - public okhttp3.Call createFuturesOrderAsync(String settle, FuturesOrder futuresOrder, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createFuturesOrderValidateBeforeCall(settle, futuresOrder, _callback); + public okhttp3.Call createFuturesOrderAsync(String settle, FuturesOrder futuresOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createFuturesOrderValidateBeforeCall(settle, futuresOrder, xGateExptime, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -3679,17 +4729,20 @@ public okhttp3.Call createFuturesOrderAsync(String settle, FuturesOrder futuresO * Build call for cancelFuturesOrders * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @param side 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) + * @param excludeReduceOnly Whether to exclude reduce-only orders (optional, default to false) + * @param text Remark for order cancellation (optional) * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ - public okhttp3.Call cancelFuturesOrdersCall(String settle, String contract, String side, final ApiCallback _callback) throws ApiException { + public okhttp3.Call cancelFuturesOrdersCall(String settle, String contract, String xGateExptime, String side, Boolean excludeReduceOnly, String text, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -3706,7 +4759,19 @@ public okhttp3.Call cancelFuturesOrdersCall(String settle, String contract, Stri localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); } + if (excludeReduceOnly != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("exclude_reduce_only", excludeReduceOnly)); + } + + if (text != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("text", text)); + } + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { @@ -3728,7 +4793,7 @@ public okhttp3.Call cancelFuturesOrdersCall(String settle, String contract, Stri } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelFuturesOrdersValidateBeforeCall(String settle, String contract, String side, final ApiCallback _callback) throws ApiException { + private okhttp3.Call cancelFuturesOrdersValidateBeforeCall(String settle, String contract, String xGateExptime, String side, Boolean excludeReduceOnly, String text, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling cancelFuturesOrders(Async)"); @@ -3739,95 +4804,320 @@ private okhttp3.Call cancelFuturesOrdersValidateBeforeCall(String settle, String throw new ApiException("Missing the required parameter 'contract' when calling cancelFuturesOrders(Async)"); } - okhttp3.Call localVarCall = cancelFuturesOrdersCall(settle, contract, side, _callback); + okhttp3.Call localVarCall = cancelFuturesOrdersCall(settle, contract, xGateExptime, side, excludeReduceOnly, text, _callback); return localVarCall; } /** - * Cancel all `open` orders matched - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Cancel all orders with 'open' status + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @param side 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) + * @param excludeReduceOnly Whether to exclude reduce-only orders (optional, default to false) + * @param text Remark for order cancellation (optional) * @return List<FuturesOrder> * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ - public List cancelFuturesOrders(String settle, String contract, String side) throws ApiException { - ApiResponse> localVarResp = cancelFuturesOrdersWithHttpInfo(settle, contract, side); + public List cancelFuturesOrders(String settle, String contract, String xGateExptime, String side, Boolean excludeReduceOnly, String text) throws ApiException { + ApiResponse> localVarResp = cancelFuturesOrdersWithHttpInfo(settle, contract, xGateExptime, side, excludeReduceOnly, text); return localVarResp.getData(); } /** - * Cancel all `open` orders matched - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Cancel all orders with 'open' status + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @param side 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) + * @param excludeReduceOnly Whether to exclude reduce-only orders (optional, default to false) + * @param text Remark for order cancellation (optional) * @return ApiResponse<List<FuturesOrder>> * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ - public ApiResponse> cancelFuturesOrdersWithHttpInfo(String settle, String contract, String side) throws ApiException { - okhttp3.Call localVarCall = cancelFuturesOrdersValidateBeforeCall(settle, contract, side, null); + public ApiResponse> cancelFuturesOrdersWithHttpInfo(String settle, String contract, String xGateExptime, String side, Boolean excludeReduceOnly, String text) throws ApiException { + okhttp3.Call localVarCall = cancelFuturesOrdersValidateBeforeCall(settle, contract, xGateExptime, side, excludeReduceOnly, text, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Cancel all `open` orders matched (asynchronously) - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Cancel all orders with 'open' status (asynchronously) + * Zero-fill orders cannot be retrieved 10 minutes after order cancellation * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param side All bids or asks. Both included if not specified (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @param side 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) + * @param excludeReduceOnly Whether to exclude reduce-only orders (optional, default to false) + * @param text Remark for order cancellation (optional) * @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 All orders matched cancelled -
200 Batch cancellation successful -
*/ - public okhttp3.Call cancelFuturesOrdersAsync(String settle, String contract, String side, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = cancelFuturesOrdersValidateBeforeCall(settle, contract, side, _callback); + public okhttp3.Call cancelFuturesOrdersAsync(String settle, String contract, String xGateExptime, String side, Boolean excludeReduceOnly, String text, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = cancelFuturesOrdersValidateBeforeCall(settle, contract, xGateExptime, side, excludeReduceOnly, text, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call getOrdersWithTimeRangeCall(String settle, String contract, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/orders_timerange" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 getOrdersWithTimeRangeValidateBeforeCall(String settle, String contract, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling getOrdersWithTimeRange(Async)"); + } + + okhttp3.Call localVarCall = getOrdersWithTimeRangeCall(settle, contract, from, to, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse> getOrdersWithTimeRangeWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = getOrdersWithTimeRangeValidateBeforeCall(settle, contract, from, to, limit, offset, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getOrdersWithTimeRangeAsync(String settle, String contract, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getOrdersWithTimeRangeValidateBeforeCall(settle, contract, from, to, limit, offset, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + public class APIgetOrdersWithTimeRangeRequest { + private final String settle; + private String contract; + private Long from; + private Long to; + private Integer limit; + private Integer offset; + + private APIgetOrdersWithTimeRangeRequest(String settle) { + this.settle = settle; + } + + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIgetOrdersWithTimeRangeRequest + */ + public APIgetOrdersWithTimeRangeRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIgetOrdersWithTimeRangeRequest + */ + public APIgetOrdersWithTimeRangeRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIgetOrdersWithTimeRangeRequest + */ + public APIgetOrdersWithTimeRangeRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIgetOrdersWithTimeRangeRequest + */ + public APIgetOrdersWithTimeRangeRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIgetOrdersWithTimeRangeRequest + */ + public APIgetOrdersWithTimeRangeRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for getOrdersWithTimeRange + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @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
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getOrdersWithTimeRangeCall(settle, contract, from, to, limit, offset, _callback); + } + + /** + * Execute getOrdersWithTimeRange request + * @return List<FuturesOrder> + * @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 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getOrdersWithTimeRangeWithHttpInfo(settle, contract, from, to, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute getOrdersWithTimeRange request with HTTP info returned + * @return ApiResponse<List<FuturesOrder>> + * @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 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getOrdersWithTimeRangeWithHttpInfo(settle, contract, from, to, limit, offset); + } + + /** + * Execute getOrdersWithTimeRange request (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 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getOrdersWithTimeRangeAsync(settle, contract, from, to, limit, offset, _callback); + } + } + /** - * Build call for getFuturesOrder + * Query futures order list by time range + * + * @param settle Settle currency (required) + * @return APIgetOrdersWithTimeRangeRequest + * @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
+ */ + public APIgetOrdersWithTimeRangeRequest getOrdersWithTimeRange(String settle) { + return new APIgetOrdersWithTimeRangeRequest(settle); + } + + /** + * Build call for createBatchFuturesOrder * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @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 Order details -
200 Request execution completed -
*/ - public okhttp3.Call getFuturesOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public okhttp3.Call createBatchFuturesOrderCall(String settle, List futuresOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = futuresOrder; // create path and map variables - String localVarPath = "/futures/{settle}/orders/{order_id}" - .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + String localVarPath = "/futures/{settle}/batch_orders" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { @@ -3839,93 +5129,96 @@ public okhttp3.Call getFuturesOrderCall(String settle, String orderId, final Api } final String[] localVarContentTypes = { - + "application/json" }; 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); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getFuturesOrderValidateBeforeCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createBatchFuturesOrderValidateBeforeCall(String settle, List futuresOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling getFuturesOrder(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling createBatchFuturesOrder(Async)"); } - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId' when calling getFuturesOrder(Async)"); + // verify the required parameter 'futuresOrder' is set + if (futuresOrder == null) { + throw new ApiException("Missing the required parameter 'futuresOrder' when calling createBatchFuturesOrder(Async)"); } - okhttp3.Call localVarCall = getFuturesOrderCall(settle, orderId, _callback); + okhttp3.Call localVarCall = createBatchFuturesOrderCall(settle, futuresOrder, xGateExptime, _callback); return localVarCall; } /** - * Get a single order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * 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 * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @return FuturesOrder + * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return List<BatchFuturesOrder> * @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 Order details -
200 Request execution completed -
*/ - public FuturesOrder getFuturesOrder(String settle, String orderId) throws ApiException { - ApiResponse localVarResp = getFuturesOrderWithHttpInfo(settle, orderId); + public List createBatchFuturesOrder(String settle, List futuresOrder, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = createBatchFuturesOrderWithHttpInfo(settle, futuresOrder, xGateExptime); return localVarResp.getData(); } /** - * Get a single order - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * 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 * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @return ApiResponse<FuturesOrder> + * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<List<BatchFuturesOrder>> * @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 Order details -
200 Request execution completed -
*/ - public ApiResponse getFuturesOrderWithHttpInfo(String settle, String orderId) throws ApiException { - okhttp3.Call localVarCall = getFuturesOrderValidateBeforeCall(settle, orderId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse> createBatchFuturesOrderWithHttpInfo(String settle, List futuresOrder, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = createBatchFuturesOrderValidateBeforeCall(settle, futuresOrder, xGateExptime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get a single order (asynchronously) - * Zero-fill order cannot be retrieved for 60 seconds after cancellation + * Place batch futures orders (asynchronously) + * - 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 * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param futuresOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @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 Order details -
200 Request execution completed -
*/ - public okhttp3.Call getFuturesOrderAsync(String settle, String orderId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFuturesOrderValidateBeforeCall(settle, orderId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createBatchFuturesOrderAsync(String settle, List futuresOrder, String xGateExptime, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = createBatchFuturesOrderValidateBeforeCall(settle, futuresOrder, xGateExptime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for cancelFuturesOrder + * Build call for getFuturesOrder * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3935,7 +5228,7 @@ public okhttp3.Call getFuturesOrderAsync(String settle, String orderId, final Ap 200 Order details - */ - public okhttp3.Call cancelFuturesOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFuturesOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -3963,30 +5256,30 @@ public okhttp3.Call cancelFuturesOrderCall(String settle, String orderId, final localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelFuturesOrderValidateBeforeCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getFuturesOrderValidateBeforeCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling cancelFuturesOrder(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling getFuturesOrder(Async)"); } // verify the required parameter 'orderId' is set if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId' when calling cancelFuturesOrder(Async)"); + throw new ApiException("Missing the required parameter 'orderId' when calling getFuturesOrder(Async)"); } - okhttp3.Call localVarCall = cancelFuturesOrderCall(settle, orderId, _callback); + okhttp3.Call localVarCall = getFuturesOrderCall(settle, orderId, _callback); return localVarCall; } /** - * Cancel a single order - * + * 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. * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @return FuturesOrder * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3995,16 +5288,16 @@ private okhttp3.Call cancelFuturesOrderValidateBeforeCall(String settle, String 200 Order details - */ - public FuturesOrder cancelFuturesOrder(String settle, String orderId) throws ApiException { - ApiResponse localVarResp = cancelFuturesOrderWithHttpInfo(settle, orderId); + public FuturesOrder getFuturesOrder(String settle, String orderId) throws ApiException { + ApiResponse localVarResp = getFuturesOrderWithHttpInfo(settle, orderId); return localVarResp.getData(); } /** - * Cancel a single order - * + * 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. * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @return ApiResponse<FuturesOrder> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4013,17 +5306,17 @@ public FuturesOrder cancelFuturesOrder(String settle, String orderId) throws Api 200 Order details - */ - public ApiResponse cancelFuturesOrderWithHttpInfo(String settle, String orderId) throws ApiException { - okhttp3.Call localVarCall = cancelFuturesOrderValidateBeforeCall(settle, orderId, null); + public ApiResponse getFuturesOrderWithHttpInfo(String settle, String orderId) throws ApiException { + okhttp3.Call localVarCall = getFuturesOrderValidateBeforeCall(settle, orderId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Cancel a single order (asynchronously) - * + * Query single order details (asynchronously) + * - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. * @param settle Settle currency (required) - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @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 @@ -4033,29 +5326,290 @@ public ApiResponse cancelFuturesOrderWithHttpInfo(String settle, S 200 Order details - */ - public okhttp3.Call cancelFuturesOrderAsync(String settle, String orderId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = cancelFuturesOrderValidateBeforeCall(settle, orderId, _callback); + public okhttp3.Call getFuturesOrderAsync(String settle, String orderId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getFuturesOrderValidateBeforeCall(settle, orderId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - private okhttp3.Call getMyTradesCall(String settle, String contract, Long order, Integer limit, Integer offset, String lastId, Integer countTotal, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + /** + * Build call for amendFuturesOrder + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param futuresOrderAmendment (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order details -
+ */ + public okhttp3.Call amendFuturesOrderCall(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = futuresOrderAmendment; // create path and map variables - String localVarPath = "/futures/{settle}/my_trades" - .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + String localVarPath = "/futures/{settle}/orders/{order_id}" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (contract != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); } - if (order != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); - } + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call amendFuturesOrderValidateBeforeCall(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling amendFuturesOrder(Async)"); + } + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling amendFuturesOrder(Async)"); + } + + // verify the required parameter 'futuresOrderAmendment' is set + if (futuresOrderAmendment == null) { + throw new ApiException("Missing the required parameter 'futuresOrderAmendment' when calling amendFuturesOrder(Async)"); + } + + okhttp3.Call localVarCall = amendFuturesOrderCall(settle, orderId, futuresOrderAmendment, xGateExptime, _callback); + return localVarCall; + } + + /** + * Amend single order + * + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param futuresOrderAmendment (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return FuturesOrder + * @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 Order details -
+ */ + public FuturesOrder amendFuturesOrder(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, String xGateExptime) throws ApiException { + ApiResponse localVarResp = amendFuturesOrderWithHttpInfo(settle, orderId, futuresOrderAmendment, xGateExptime); + return localVarResp.getData(); + } + + /** + * Amend single order + * + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param futuresOrderAmendment (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<FuturesOrder> + * @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 Order details -
+ */ + public ApiResponse amendFuturesOrderWithHttpInfo(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = amendFuturesOrderValidateBeforeCall(settle, orderId, futuresOrderAmendment, xGateExptime, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Amend single order (asynchronously) + * + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param futuresOrderAmendment (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order details -
+ */ + public okhttp3.Call amendFuturesOrderAsync(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, String xGateExptime, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = amendFuturesOrderValidateBeforeCall(settle, orderId, futuresOrderAmendment, xGateExptime, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for cancelFuturesOrder + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order details -
+ */ + public okhttp3.Call cancelFuturesOrderCall(String settle, String orderId, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/orders/{order_id}" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelFuturesOrderValidateBeforeCall(String settle, String orderId, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling cancelFuturesOrder(Async)"); + } + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling cancelFuturesOrder(Async)"); + } + + okhttp3.Call localVarCall = cancelFuturesOrderCall(settle, orderId, xGateExptime, _callback); + return localVarCall; + } + + /** + * Cancel single order + * + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return FuturesOrder + * @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 Order details -
+ */ + public FuturesOrder cancelFuturesOrder(String settle, String orderId, String xGateExptime) throws ApiException { + ApiResponse localVarResp = cancelFuturesOrderWithHttpInfo(settle, orderId, xGateExptime); + return localVarResp.getData(); + } + + /** + * Cancel single order + * + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<FuturesOrder> + * @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 Order details -
+ */ + public ApiResponse cancelFuturesOrderWithHttpInfo(String settle, String orderId, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = cancelFuturesOrderValidateBeforeCall(settle, orderId, xGateExptime, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel single order (asynchronously) + * + * @param settle Settle currency (required) + * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order details -
+ */ + public okhttp3.Call cancelFuturesOrderAsync(String settle, String orderId, String xGateExptime, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = cancelFuturesOrderValidateBeforeCall(settle, orderId, xGateExptime, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call getMyTradesCall(String settle, String contract, Long order, Integer limit, Integer offset, String lastId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/my_trades" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (order != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); + } if (limit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); @@ -4069,10 +5623,6 @@ private okhttp3.Call getMyTradesCall(String settle, String contract, Long order, localVarQueryParams.addAll(localVarApiClient.parameterToPair("last_id", lastId)); } - if (countTotal != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("count_total", countTotal)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -4095,25 +5645,25 @@ private okhttp3.Call getMyTradesCall(String settle, String contract, Long order, } @SuppressWarnings("rawtypes") - private okhttp3.Call getMyTradesValidateBeforeCall(String settle, String contract, Long order, Integer limit, Integer offset, String lastId, Integer countTotal, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getMyTradesValidateBeforeCall(String settle, String contract, Long order, Integer limit, Integer offset, String lastId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { throw new ApiException("Missing the required parameter 'settle' when calling getMyTrades(Async)"); } - okhttp3.Call localVarCall = getMyTradesCall(settle, contract, order, limit, offset, lastId, countTotal, _callback); + okhttp3.Call localVarCall = getMyTradesCall(settle, contract, order, limit, offset, lastId, _callback); return localVarCall; } - private ApiResponse> getMyTradesWithHttpInfo(String settle, String contract, Long order, Integer limit, Integer offset, String lastId, Integer countTotal) throws ApiException { - okhttp3.Call localVarCall = getMyTradesValidateBeforeCall(settle, contract, order, limit, offset, lastId, countTotal, null); + private ApiResponse> getMyTradesWithHttpInfo(String settle, String contract, Long order, Integer limit, Integer offset, String lastId) throws ApiException { + okhttp3.Call localVarCall = getMyTradesValidateBeforeCall(settle, contract, order, limit, offset, lastId, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call getMyTradesAsync(String settle, String contract, Long order, Integer limit, Integer offset, String lastId, Integer countTotal, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = getMyTradesValidateBeforeCall(settle, contract, order, limit, offset, lastId, countTotal, _callback); + private okhttp3.Call getMyTradesAsync(String settle, String contract, Long order, Integer limit, Integer offset, String lastId, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getMyTradesValidateBeforeCall(settle, contract, order, limit, offset, lastId, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -4126,7 +5676,6 @@ public class APIgetMyTradesRequest { private Integer limit; private Integer offset; private String lastId; - private Integer countTotal; private APIgetMyTradesRequest(String settle) { this.settle = settle; @@ -4154,7 +5703,7 @@ public APIgetMyTradesRequest order(Long order) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIgetMyTradesRequest */ public APIgetMyTradesRequest limit(Integer limit) { @@ -4174,7 +5723,7 @@ public APIgetMyTradesRequest offset(Integer offset) { /** * Set lastId - * @param lastId Specify list staring point using the `id` of last record in previous list-query results (optional) + * @param lastId 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 APIgetMyTradesRequest */ public APIgetMyTradesRequest lastId(String lastId) { @@ -4182,16 +5731,6 @@ public APIgetMyTradesRequest lastId(String lastId) { return this; } - /** - * Set countTotal - * @param countTotal Whether to return total number matched. Default to 0(no return) (optional, default to 0) - * @return APIgetMyTradesRequest - */ - public APIgetMyTradesRequest countTotal(Integer countTotal) { - this.countTotal = countTotal; - return this; - } - /** * Build call for getMyTrades * @param _callback ApiCallback API callback @@ -4200,11 +5739,11 @@ public APIgetMyTradesRequest countTotal(Integer countTotal) { * @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
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getMyTradesCall(settle, contract, order, limit, offset, lastId, countTotal, _callback); + return getMyTradesCall(settle, contract, order, limit, offset, lastId, _callback); } /** @@ -4214,11 +5753,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @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
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = getMyTradesWithHttpInfo(settle, contract, order, limit, offset, lastId, countTotal); + ApiResponse> localVarResp = getMyTradesWithHttpInfo(settle, contract, order, limit, offset, lastId); return localVarResp.getData(); } @@ -4229,11 +5768,11 @@ public List execute() throws ApiException { * @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
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return getMyTradesWithHttpInfo(settle, contract, order, limit, offset, lastId, countTotal); + return getMyTradesWithHttpInfo(settle, contract, order, limit, offset, lastId); } /** @@ -4244,34 +5783,34 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcepti * @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
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return getMyTradesAsync(settle, contract, order, limit, offset, lastId, countTotal, _callback); + return getMyTradesAsync(settle, contract, order, limit, offset, lastId, _callback); } } /** - * List personal trading history - * + * 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`. * @param settle Settle currency (required) * @return APIgetMyTradesRequest * @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
*/ public APIgetMyTradesRequest getMyTrades(String settle) { return new APIgetMyTradesRequest(settle); } - private okhttp3.Call listPositionCloseCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getMyTradesWithTimeRangeCall(String settle, String contract, Long from, Long to, Integer limit, Integer offset, String role, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/futures/{settle}/position_close" + String localVarPath = "/futures/{settle}/my_trades_timerange" .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); @@ -4280,6 +5819,14 @@ private okhttp3.Call listPositionCloseCall(String settle, String contract, Integ localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); } + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + if (limit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } @@ -4288,12 +5835,8 @@ private okhttp3.Call listPositionCloseCall(String settle, String contract, Integ localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); } - if (from != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); - } - - if (to != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + if (role != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("role", role)); } Map localVarHeaderParams = new HashMap(); @@ -4318,58 +5861,79 @@ private okhttp3.Call listPositionCloseCall(String settle, String contract, Integ } @SuppressWarnings("rawtypes") - private okhttp3.Call listPositionCloseValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getMyTradesWithTimeRangeValidateBeforeCall(String settle, String contract, Long from, Long to, Integer limit, Integer offset, String role, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling listPositionClose(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling getMyTradesWithTimeRange(Async)"); } - okhttp3.Call localVarCall = listPositionCloseCall(settle, contract, limit, offset, from, to, _callback); + okhttp3.Call localVarCall = getMyTradesWithTimeRangeCall(settle, contract, from, to, limit, offset, role, _callback); return localVarCall; } - private ApiResponse> listPositionCloseWithHttpInfo(String settle, String contract, Integer limit, Integer offset, Long from, Long to) throws ApiException { - okhttp3.Call localVarCall = listPositionCloseValidateBeforeCall(settle, contract, limit, offset, from, to, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> getMyTradesWithTimeRangeWithHttpInfo(String settle, String contract, Long from, Long to, Integer limit, Integer offset, String role) throws ApiException { + okhttp3.Call localVarCall = getMyTradesWithTimeRangeValidateBeforeCall(settle, contract, from, to, limit, offset, role, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listPositionCloseAsync(String settle, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listPositionCloseValidateBeforeCall(settle, contract, limit, offset, from, to, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call getMyTradesWithTimeRangeAsync(String settle, String contract, Long from, Long to, Integer limit, Integer offset, String role, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getMyTradesWithTimeRangeValidateBeforeCall(settle, contract, from, to, limit, offset, role, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistPositionCloseRequest { + public class APIgetMyTradesWithTimeRangeRequest { private final String settle; private String contract; - private Integer limit; - private Integer offset; private Long from; private Long to; + private Integer limit; + private Integer offset; + private String role; - private APIlistPositionCloseRequest(String settle) { + private APIgetMyTradesWithTimeRangeRequest(String settle) { this.settle = settle; } /** * Set contract * @param contract Futures contract, return related data only if specified (optional) - * @return APIlistPositionCloseRequest + * @return APIgetMyTradesWithTimeRangeRequest */ - public APIlistPositionCloseRequest contract(String contract) { + public APIgetMyTradesWithTimeRangeRequest contract(String contract) { this.contract = contract; return this; } + /** + * Set from + * @param from 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) + * @return APIgetMyTradesWithTimeRangeRequest + */ + public APIgetMyTradesWithTimeRangeRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIgetMyTradesWithTimeRangeRequest + */ + public APIgetMyTradesWithTimeRangeRequest to(Long to) { + this.to = to; + return this; + } + /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistPositionCloseRequest + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIgetMyTradesWithTimeRangeRequest */ - public APIlistPositionCloseRequest limit(Integer limit) { + public APIgetMyTradesWithTimeRangeRequest limit(Integer limit) { this.limit = limit; return this; } @@ -4377,26 +5941,238 @@ public APIlistPositionCloseRequest limit(Integer limit) { /** * Set offset * @param offset List offset, starting from 0 (optional, default to 0) - * @return APIlistPositionCloseRequest + * @return APIgetMyTradesWithTimeRangeRequest */ - public APIlistPositionCloseRequest offset(Integer offset) { + public APIgetMyTradesWithTimeRangeRequest offset(Integer offset) { this.offset = offset; return this; } /** - * Set from - * @param from Start timestamp (optional) - * @return APIlistPositionCloseRequest + * Set role + * @param role Query role, maker or taker (optional) + * @return APIgetMyTradesWithTimeRangeRequest */ - public APIlistPositionCloseRequest from(Long from) { - this.from = from; + public APIgetMyTradesWithTimeRangeRequest role(String role) { + this.role = role; + return this; + } + + /** + * Build call for getMyTradesWithTimeRange + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @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
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getMyTradesWithTimeRangeCall(settle, contract, from, to, limit, offset, role, _callback); + } + + /** + * Execute getMyTradesWithTimeRange request + * @return List<MyFuturesTradeTimeRange> + * @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 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getMyTradesWithTimeRangeWithHttpInfo(settle, contract, from, to, limit, offset, role); + return localVarResp.getData(); + } + + /** + * Execute getMyTradesWithTimeRange request with HTTP info returned + * @return ApiResponse<List<MyFuturesTradeTimeRange>> + * @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 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getMyTradesWithTimeRangeWithHttpInfo(settle, contract, from, to, limit, offset, role); + } + + /** + * Execute getMyTradesWithTimeRange request (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 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getMyTradesWithTimeRangeAsync(settle, contract, from, to, limit, offset, role, _callback); + } + } + + /** + * Query personal trading records by time range + * + * @param settle Settle currency (required) + * @return APIgetMyTradesWithTimeRangeRequest + * @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
+ */ + public APIgetMyTradesWithTimeRangeRequest getMyTradesWithTimeRange(String settle) { + return new APIgetMyTradesWithTimeRangeRequest(settle); + } + + private okhttp3.Call listPositionCloseCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, String side, String pnl, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/position_close" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (side != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); + } + + if (pnl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pnl", pnl)); + } + + 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 listPositionCloseValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, String side, String pnl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling listPositionClose(Async)"); + } + + okhttp3.Call localVarCall = listPositionCloseCall(settle, contract, limit, offset, from, to, side, pnl, _callback); + return localVarCall; + } + + + private ApiResponse> listPositionCloseWithHttpInfo(String settle, String contract, Integer limit, Integer offset, Long from, Long to, String side, String pnl) throws ApiException { + okhttp3.Call localVarCall = listPositionCloseValidateBeforeCall(settle, contract, limit, offset, from, to, side, pnl, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listPositionCloseAsync(String settle, String contract, Integer limit, Integer offset, Long from, Long to, String side, String pnl, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listPositionCloseValidateBeforeCall(settle, contract, limit, offset, from, to, side, pnl, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistPositionCloseRequest { + private final String settle; + private String contract; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + private String side; + private String pnl; + + private APIlistPositionCloseRequest(String settle) { + this.settle = settle; + } + + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIlistPositionCloseRequest + */ + public APIlistPositionCloseRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistPositionCloseRequest + */ + public APIlistPositionCloseRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistPositionCloseRequest + */ + public APIlistPositionCloseRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistPositionCloseRequest + */ + public APIlistPositionCloseRequest from(Long from) { + this.from = from; return this; } /** * Set to - * @param to End timestamp (optional) + * @param to 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 APIlistPositionCloseRequest */ public APIlistPositionCloseRequest to(Long to) { @@ -4404,6 +6180,26 @@ public APIlistPositionCloseRequest to(Long to) { return this; } + /** + * Set side + * @param side Query side. long or shot (optional) + * @return APIlistPositionCloseRequest + */ + public APIlistPositionCloseRequest side(String side) { + this.side = side; + return this; + } + + /** + * Set pnl + * @param pnl Query profit or loss (optional) + * @return APIlistPositionCloseRequest + */ + public APIlistPositionCloseRequest pnl(String pnl) { + this.pnl = pnl; + return this; + } + /** * Build call for listPositionClose * @param _callback ApiCallback API callback @@ -4412,11 +6208,11 @@ public APIlistPositionCloseRequest to(Long to) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listPositionCloseCall(settle, contract, limit, offset, from, to, _callback); + return listPositionCloseCall(settle, contract, limit, offset, from, to, side, pnl, _callback); } /** @@ -4426,11 +6222,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listPositionCloseWithHttpInfo(settle, contract, limit, offset, from, to); + ApiResponse> localVarResp = listPositionCloseWithHttpInfo(settle, contract, limit, offset, from, to, side, pnl); return localVarResp.getData(); } @@ -4441,66 +6237,920 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listPositionCloseWithHttpInfo(settle, contract, limit, offset, from, to); + return listPositionCloseWithHttpInfo(settle, contract, limit, offset, from, to, side, pnl); + } + + /** + * Execute listPositionClose request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listPositionCloseAsync(settle, contract, limit, offset, from, to, side, pnl, _callback); + } + } + + /** + * Query position close history + * + * @param settle Settle currency (required) + * @return APIlistPositionCloseRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistPositionCloseRequest listPositionClose(String settle) { + return new APIlistPositionCloseRequest(settle); + } + + private okhttp3.Call listLiquidatesCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/liquidates" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (at != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("at", at)); + } + + 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 listLiquidatesValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling listLiquidates(Async)"); + } + + okhttp3.Call localVarCall = listLiquidatesCall(settle, contract, limit, offset, from, to, at, _callback); + return localVarCall; + } + + + private ApiResponse> listLiquidatesWithHttpInfo(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at) throws ApiException { + okhttp3.Call localVarCall = listLiquidatesValidateBeforeCall(settle, contract, limit, offset, from, to, at, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listLiquidatesAsync(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listLiquidatesValidateBeforeCall(settle, contract, limit, offset, from, to, at, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistLiquidatesRequest { + private final String settle; + private String contract; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + private Integer at; + + private APIlistLiquidatesRequest(String settle) { + this.settle = settle; + } + + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIlistLiquidatesRequest + */ + public APIlistLiquidatesRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistLiquidatesRequest + */ + public APIlistLiquidatesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistLiquidatesRequest + */ + public APIlistLiquidatesRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistLiquidatesRequest + */ + public APIlistLiquidatesRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistLiquidatesRequest + */ + public APIlistLiquidatesRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set at + * @param at Specify liquidation timestamp (optional, default to 0) + * @return APIlistLiquidatesRequest + */ + public APIlistLiquidatesRequest at(Integer at) { + this.at = at; + return this; + } + + /** + * Build call for listLiquidates + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listLiquidatesCall(settle, contract, limit, offset, from, to, at, _callback); + } + + /** + * Execute listLiquidates request + * @return List<FuturesLiquidate> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listLiquidatesWithHttpInfo(settle, contract, limit, offset, from, to, at); + return localVarResp.getData(); + } + + /** + * Execute listLiquidates request with HTTP info returned + * @return ApiResponse<List<FuturesLiquidate>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listLiquidatesWithHttpInfo(settle, contract, limit, offset, from, to, at); + } + + /** + * Execute listLiquidates request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listLiquidatesAsync(settle, contract, limit, offset, from, to, at, _callback); + } + } + + /** + * Query liquidation history + * + * @param settle Settle currency (required) + * @return APIlistLiquidatesRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistLiquidatesRequest listLiquidates(String settle) { + return new APIlistLiquidatesRequest(settle); + } + + private okhttp3.Call listAutoDeleveragesCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/auto_deleverages" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (at != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("at", at)); + } + + 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 listAutoDeleveragesValidateBeforeCall(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling listAutoDeleverages(Async)"); + } + + okhttp3.Call localVarCall = listAutoDeleveragesCall(settle, contract, limit, offset, from, to, at, _callback); + return localVarCall; + } + + + private ApiResponse> listAutoDeleveragesWithHttpInfo(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at) throws ApiException { + okhttp3.Call localVarCall = listAutoDeleveragesValidateBeforeCall(settle, contract, limit, offset, from, to, at, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listAutoDeleveragesAsync(String settle, String contract, Integer limit, Integer offset, Long from, Long to, Integer at, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listAutoDeleveragesValidateBeforeCall(settle, contract, limit, offset, from, to, at, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistAutoDeleveragesRequest { + private final String settle; + private String contract; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + private Integer at; + + private APIlistAutoDeleveragesRequest(String settle) { + this.settle = settle; + } + + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIlistAutoDeleveragesRequest + */ + public APIlistAutoDeleveragesRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistAutoDeleveragesRequest + */ + public APIlistAutoDeleveragesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistAutoDeleveragesRequest + */ + public APIlistAutoDeleveragesRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistAutoDeleveragesRequest + */ + public APIlistAutoDeleveragesRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistAutoDeleveragesRequest + */ + public APIlistAutoDeleveragesRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set at + * @param at Specify auto-deleveraging timestamp (optional, default to 0) + * @return APIlistAutoDeleveragesRequest + */ + public APIlistAutoDeleveragesRequest at(Integer at) { + this.at = at; + return this; + } + + /** + * Build call for listAutoDeleverages + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listAutoDeleveragesCall(settle, contract, limit, offset, from, to, at, _callback); + } + + /** + * Execute listAutoDeleverages request + * @return List<FuturesAutoDeleverage> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listAutoDeleveragesWithHttpInfo(settle, contract, limit, offset, from, to, at); + return localVarResp.getData(); + } + + /** + * Execute listAutoDeleverages request with HTTP info returned + * @return ApiResponse<List<FuturesAutoDeleverage>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listAutoDeleveragesWithHttpInfo(settle, contract, limit, offset, from, to, at); + } + + /** + * Execute listAutoDeleverages request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listAutoDeleveragesAsync(settle, contract, limit, offset, from, to, at, _callback); + } + } + + /** + * Query ADL auto-deleveraging order information + * + * @param settle Settle currency (required) + * @return APIlistAutoDeleveragesRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistAutoDeleveragesRequest listAutoDeleverages(String settle) { + return new APIlistAutoDeleveragesRequest(settle); + } + + /** + * Build call for countdownCancelAllFutures + * @param settle Settle currency (required) + * @param countdownCancelAllFuturesTask (required) + * @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 Countdown set successfully -
+ */ + public okhttp3.Call countdownCancelAllFuturesCall(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = countdownCancelAllFuturesTask; + + // create path and map variables + String localVarPath = "/futures/{settle}/countdown_cancel_all" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call countdownCancelAllFuturesValidateBeforeCall(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling countdownCancelAllFutures(Async)"); + } + + // verify the required parameter 'countdownCancelAllFuturesTask' is set + if (countdownCancelAllFuturesTask == null) { + throw new ApiException("Missing the required parameter 'countdownCancelAllFuturesTask' when calling countdownCancelAllFutures(Async)"); + } + + okhttp3.Call localVarCall = countdownCancelAllFuturesCall(settle, countdownCancelAllFuturesTask, _callback); + return localVarCall; + } + + /** + * Countdown cancel orders + * 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. + * @param settle Settle currency (required) + * @param countdownCancelAllFuturesTask (required) + * @return TriggerTime + * @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 Countdown set successfully -
+ */ + public TriggerTime countdownCancelAllFutures(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask) throws ApiException { + ApiResponse localVarResp = countdownCancelAllFuturesWithHttpInfo(settle, countdownCancelAllFuturesTask); + return localVarResp.getData(); + } + + /** + * Countdown cancel orders + * 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. + * @param settle Settle currency (required) + * @param countdownCancelAllFuturesTask (required) + * @return ApiResponse<TriggerTime> + * @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 Countdown set successfully -
+ */ + public ApiResponse countdownCancelAllFuturesWithHttpInfo(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask) throws ApiException { + okhttp3.Call localVarCall = countdownCancelAllFuturesValidateBeforeCall(settle, countdownCancelAllFuturesTask, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Countdown cancel orders (asynchronously) + * 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. + * @param settle Settle currency (required) + * @param countdownCancelAllFuturesTask (required) + * @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 Countdown set successfully -
+ */ + public okhttp3.Call countdownCancelAllFuturesAsync(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = countdownCancelAllFuturesValidateBeforeCall(settle, countdownCancelAllFuturesTask, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call getFuturesFeeCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/fee" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + 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 getFuturesFeeValidateBeforeCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling getFuturesFee(Async)"); + } + + okhttp3.Call localVarCall = getFuturesFeeCall(settle, contract, _callback); + return localVarCall; + } + + + private ApiResponse> getFuturesFeeWithHttpInfo(String settle, String contract) throws ApiException { + okhttp3.Call localVarCall = getFuturesFeeValidateBeforeCall(settle, contract, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getFuturesFeeAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getFuturesFeeValidateBeforeCall(settle, contract, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetFuturesFeeRequest { + private final String settle; + private String contract; + + private APIgetFuturesFeeRequest(String settle) { + this.settle = settle; + } + + /** + * Set contract + * @param contract Futures contract, return related data only if specified (optional) + * @return APIgetFuturesFeeRequest + */ + public APIgetFuturesFeeRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Build call for getFuturesFee + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getFuturesFeeCall(settle, contract, _callback); + } + + /** + * Execute getFuturesFee request + * @return Map<String, FuturesFee> + * @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 Query successful -
+ */ + public Map execute() throws ApiException { + ApiResponse> localVarResp = getFuturesFeeWithHttpInfo(settle, contract); + return localVarResp.getData(); + } + + /** + * Execute getFuturesFee request with HTTP info returned + * @return ApiResponse<Map<String, FuturesFee>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getFuturesFeeWithHttpInfo(settle, contract); + } + + /** + * Execute getFuturesFee request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getFuturesFeeAsync(settle, contract, _callback); + } + } + + /** + * Query futures market trading fee rates + * + * @param settle Settle currency (required) + * @return APIgetFuturesFeeRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIgetFuturesFeeRequest getFuturesFee(String settle) { + return new APIgetFuturesFeeRequest(settle); + } + + /** + * Build call for cancelBatchFutureOrders + * @param settle Settle currency (required) + * @param requestBody (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order cancellation operation completed -
+ */ + public okhttp3.Call cancelBatchFutureOrdersCall(String settle, List requestBody, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = requestBody; + + // create path and map variables + String localVarPath = "/futures/{settle}/batch_cancel_orders" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelBatchFutureOrdersValidateBeforeCall(String settle, List requestBody, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling cancelBatchFutureOrders(Async)"); } - /** - * Execute listPositionClose request (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 List retrieved -
- */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listPositionCloseAsync(settle, contract, limit, offset, from, to, _callback); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling cancelBatchFutureOrders(Async)"); } + + okhttp3.Call localVarCall = cancelBatchFutureOrdersCall(settle, requestBody, xGateExptime, _callback); + return localVarCall; } /** - * List position close history - * + * Cancel batch orders by specified ID list + * Multiple different order IDs can be specified, maximum 20 records per request * @param settle Settle currency (required) - * @return APIlistPositionCloseRequest + * @param requestBody (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return List<FutureCancelOrderResult> + * @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 List retrieved -
200 Order cancellation operation completed -
*/ - public APIlistPositionCloseRequest listPositionClose(String settle) { - return new APIlistPositionCloseRequest(settle); + public List cancelBatchFutureOrders(String settle, List requestBody, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = cancelBatchFutureOrdersWithHttpInfo(settle, requestBody, xGateExptime); + return localVarResp.getData(); } - private okhttp3.Call listLiquidatesCall(String settle, String contract, Integer limit, Integer at, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + /** + * Cancel batch orders by specified ID list + * Multiple different order IDs can be specified, maximum 20 records per request + * @param settle Settle currency (required) + * @param requestBody (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<List<FutureCancelOrderResult>> + * @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 Order cancellation operation completed -
+ */ + public ApiResponse> cancelBatchFutureOrdersWithHttpInfo(String settle, List requestBody, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = cancelBatchFutureOrdersValidateBeforeCall(settle, requestBody, xGateExptime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel batch orders by specified ID list (asynchronously) + * Multiple different order IDs can be specified, maximum 20 records per request + * @param settle Settle currency (required) + * @param requestBody (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order cancellation operation completed -
+ */ + public okhttp3.Call cancelBatchFutureOrdersAsync(String settle, List requestBody, String xGateExptime, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = cancelBatchFutureOrdersValidateBeforeCall(settle, requestBody, xGateExptime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for amendBatchFutureOrders + * @param settle Settle currency (required) + * @param batchAmendOrderReq (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Request execution completed -
+ */ + public okhttp3.Call amendBatchFutureOrdersCall(String settle, List batchAmendOrderReq, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = batchAmendOrderReq; // create path and map variables - String localVarPath = "/futures/{settle}/liquidates" + String localVarPath = "/futures/{settle}/batch_amend_orders" .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (contract != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (at != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("at", at)); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { @@ -4512,153 +7162,211 @@ private okhttp3.Call listLiquidatesCall(String settle, String contract, Integer } final String[] localVarContentTypes = { - + "application/json" }; 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); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listLiquidatesValidateBeforeCall(String settle, String contract, Integer limit, Integer at, final ApiCallback _callback) throws ApiException { + private okhttp3.Call amendBatchFutureOrdersValidateBeforeCall(String settle, List batchAmendOrderReq, String xGateExptime, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settle' is set if (settle == null) { - throw new ApiException("Missing the required parameter 'settle' when calling listLiquidates(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling amendBatchFutureOrders(Async)"); + } + + // verify the required parameter 'batchAmendOrderReq' is set + if (batchAmendOrderReq == null) { + throw new ApiException("Missing the required parameter 'batchAmendOrderReq' when calling amendBatchFutureOrders(Async)"); } - okhttp3.Call localVarCall = listLiquidatesCall(settle, contract, limit, at, _callback); + okhttp3.Call localVarCall = amendBatchFutureOrdersCall(settle, batchAmendOrderReq, xGateExptime, _callback); return localVarCall; } + /** + * Batch modify orders by specified IDs + * Multiple different order IDs can be specified, maximum 10 orders per request + * @param settle Settle currency (required) + * @param batchAmendOrderReq (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return List<BatchFuturesOrder> + * @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 Request execution completed -
+ */ + public List amendBatchFutureOrders(String settle, List batchAmendOrderReq, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = amendBatchFutureOrdersWithHttpInfo(settle, batchAmendOrderReq, xGateExptime); + return localVarResp.getData(); + } - private ApiResponse> listLiquidatesWithHttpInfo(String settle, String contract, Integer limit, Integer at) throws ApiException { - okhttp3.Call localVarCall = listLiquidatesValidateBeforeCall(settle, contract, limit, at, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + /** + * Batch modify orders by specified IDs + * Multiple different order IDs can be specified, maximum 10 orders per request + * @param settle Settle currency (required) + * @param batchAmendOrderReq (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<List<BatchFuturesOrder>> + * @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 Request execution completed -
+ */ + public ApiResponse> amendBatchFutureOrdersWithHttpInfo(String settle, List batchAmendOrderReq, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = amendBatchFutureOrdersValidateBeforeCall(settle, batchAmendOrderReq, xGateExptime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listLiquidatesAsync(String settle, String contract, Integer limit, Integer at, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listLiquidatesValidateBeforeCall(settle, contract, limit, at, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + /** + * Batch modify orders by specified IDs (asynchronously) + * Multiple different order IDs can be specified, maximum 10 orders per request + * @param settle Settle currency (required) + * @param batchAmendOrderReq (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Request execution completed -
+ */ + public okhttp3.Call amendBatchFutureOrdersAsync(String settle, List batchAmendOrderReq, String xGateExptime, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = amendBatchFutureOrdersValidateBeforeCall(settle, batchAmendOrderReq, xGateExptime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistLiquidatesRequest { - private final String settle; - private String contract; - private Integer limit; - private Integer at; + /** + * Build call for getFuturesRiskLimitTable + * @param settle Settle currency (required) + * @param tableId Risk limit table ID (required) + * @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 Query successful -
+ */ + public okhttp3.Call getFuturesRiskLimitTableCall(String settle, String tableId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; - private APIlistLiquidatesRequest(String settle) { - this.settle = settle; - } + // create path and map variables + String localVarPath = "/futures/{settle}/risk_limit_table" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); - /** - * Set contract - * @param contract Futures contract, return related data only if specified (optional) - * @return APIlistLiquidatesRequest - */ - public APIlistLiquidatesRequest contract(String contract) { - this.contract = contract; - return this; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (tableId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("table_id", tableId)); } - /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistLiquidatesRequest - */ - public APIlistLiquidatesRequest limit(Integer limit) { - this.limit = limit; - return this; + 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); } - /** - * Set at - * @param at Specify a liquidation timestamp (optional, default to 0) - * @return APIlistLiquidatesRequest - */ - public APIlistLiquidatesRequest at(Integer at) { - this.at = at; - return this; - } + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); - /** - * Build call for listLiquidates - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listLiquidatesCall(settle, contract, limit, at, _callback); - } + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } - /** - * Execute listLiquidates request - * @return List<FuturesLiquidate> - * @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 List retrieved -
- */ - public List execute() throws ApiException { - ApiResponse> localVarResp = listLiquidatesWithHttpInfo(settle, contract, limit, at); - return localVarResp.getData(); + @SuppressWarnings("rawtypes") + private okhttp3.Call getFuturesRiskLimitTableValidateBeforeCall(String settle, String tableId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settle' is set + if (settle == null) { + throw new ApiException("Missing the required parameter 'settle' when calling getFuturesRiskLimitTable(Async)"); } - /** - * Execute listLiquidates request with HTTP info returned - * @return ApiResponse<List<FuturesLiquidate>> - * @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 List retrieved -
- */ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listLiquidatesWithHttpInfo(settle, contract, limit, at); + // verify the required parameter 'tableId' is set + if (tableId == null) { + throw new ApiException("Missing the required parameter 'tableId' when calling getFuturesRiskLimitTable(Async)"); } - /** - * Execute listLiquidates request (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 List retrieved -
- */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listLiquidatesAsync(settle, contract, limit, at, _callback); - } + okhttp3.Call localVarCall = getFuturesRiskLimitTableCall(settle, tableId, _callback); + return localVarCall; } /** - * List liquidation history - * + * Query risk limit table by table_id + * Just pass table_id * @param settle Settle currency (required) - * @return APIlistLiquidatesRequest + * @param tableId Risk limit table ID (required) + * @return List<FuturesRiskLimitTier> + * @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 List retrieved -
200 Query successful -
*/ - public APIlistLiquidatesRequest listLiquidates(String settle) { - return new APIlistLiquidatesRequest(settle); + public List getFuturesRiskLimitTable(String settle, String tableId) throws ApiException { + ApiResponse> localVarResp = getFuturesRiskLimitTableWithHttpInfo(settle, tableId); + return localVarResp.getData(); + } + + /** + * Query risk limit table by table_id + * Just pass table_id + * @param settle Settle currency (required) + * @param tableId Risk limit table ID (required) + * @return ApiResponse<List<FuturesRiskLimitTier>> + * @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 Query successful -
+ */ + public ApiResponse> getFuturesRiskLimitTableWithHttpInfo(String settle, String tableId) throws ApiException { + okhttp3.Call localVarCall = getFuturesRiskLimitTableValidateBeforeCall(settle, tableId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query risk limit table by table_id (asynchronously) + * Just pass table_id + * @param settle Settle currency (required) + * @param tableId Risk limit table ID (required) + * @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 Query successful -
+ */ + public okhttp3.Call getFuturesRiskLimitTableAsync(String settle, String tableId, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getFuturesRiskLimitTableValidateBeforeCall(settle, tableId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; } private okhttp3.Call listPriceTriggeredOrdersCall(String settle, String status, String contract, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { @@ -4761,7 +7469,7 @@ public APIlistPriceTriggeredOrdersRequest contract(String contract) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistPriceTriggeredOrdersRequest */ public APIlistPriceTriggeredOrdersRequest limit(Integer limit) { @@ -4787,7 +7495,7 @@ public APIlistPriceTriggeredOrdersRequest offset(Integer offset) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -4801,7 +7509,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -4816,7 +7524,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -4831,7 +7539,7 @@ public ApiResponse> executeWithHttpInfo() throw * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -4840,15 +7548,15 @@ public okhttp3.Call executeAsync(final ApiCallback Status Code Description Response Headers - 200 List retrieved - + 200 List retrieved successfully - */ public APIlistPriceTriggeredOrdersRequest listPriceTriggeredOrders(String settle, String status) { @@ -4865,7 +7573,7 @@ public APIlistPriceTriggeredOrdersRequest listPriceTriggeredOrders(String settle * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public okhttp3.Call createPriceTriggeredOrderCall(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder, final ApiCallback _callback) throws ApiException { @@ -4915,7 +7623,7 @@ private okhttp3.Call createPriceTriggeredOrderValidateBeforeCall(String settle, } /** - * Create a price-triggered order + * Create price-triggered order * * @param settle Settle currency (required) * @param futuresPriceTriggeredOrder (required) @@ -4924,7 +7632,7 @@ private okhttp3.Call createPriceTriggeredOrderValidateBeforeCall(String settle, * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public TriggerOrderResponse createPriceTriggeredOrder(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder) throws ApiException { @@ -4933,7 +7641,7 @@ public TriggerOrderResponse createPriceTriggeredOrder(String settle, FuturesPric } /** - * Create a price-triggered order + * Create price-triggered order * * @param settle Settle currency (required) * @param futuresPriceTriggeredOrder (required) @@ -4942,7 +7650,7 @@ public TriggerOrderResponse createPriceTriggeredOrder(String settle, FuturesPric * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public ApiResponse createPriceTriggeredOrderWithHttpInfo(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder) throws ApiException { @@ -4952,7 +7660,7 @@ public ApiResponse createPriceTriggeredOrderWithHttpInfo(S } /** - * Create a price-triggered order (asynchronously) + * Create price-triggered order (asynchronously) * * @param settle Settle currency (required) * @param futuresPriceTriggeredOrder (required) @@ -4962,7 +7670,7 @@ public ApiResponse createPriceTriggeredOrderWithHttpInfo(S * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public okhttp3.Call createPriceTriggeredOrderAsync(String settle, FuturesPriceTriggeredOrder futuresPriceTriggeredOrder, final ApiCallback _callback) throws ApiException { @@ -4975,14 +7683,14 @@ public okhttp3.Call createPriceTriggeredOrderAsync(String settle, FuturesPriceTr /** * Build call for cancelPriceTriggeredOrderList * @param settle Settle currency (required) - * @param contract Futures contract (required) + * @param contract Futures contract, return related data only if specified (optional) * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public okhttp3.Call cancelPriceTriggeredOrderListCall(String settle, String contract, final ApiCallback _callback) throws ApiException { @@ -5026,26 +7734,21 @@ private okhttp3.Call cancelPriceTriggeredOrderListValidateBeforeCall(String sett throw new ApiException("Missing the required parameter 'settle' when calling cancelPriceTriggeredOrderList(Async)"); } - // verify the required parameter 'contract' is set - if (contract == null) { - throw new ApiException("Missing the required parameter 'contract' when calling cancelPriceTriggeredOrderList(Async)"); - } - okhttp3.Call localVarCall = cancelPriceTriggeredOrderListCall(settle, contract, _callback); return localVarCall; } /** - * Cancel all open orders + * Cancel all auto orders * * @param settle Settle currency (required) - * @param contract Futures contract (required) + * @param contract Futures contract, return related data only if specified (optional) * @return List<FuturesPriceTriggeredOrder> * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public List cancelPriceTriggeredOrderList(String settle, String contract) throws ApiException { @@ -5054,16 +7757,16 @@ public List cancelPriceTriggeredOrderList(String set } /** - * Cancel all open orders + * Cancel all auto orders * * @param settle Settle currency (required) - * @param contract Futures contract (required) + * @param contract Futures contract, return related data only if specified (optional) * @return ApiResponse<List<FuturesPriceTriggeredOrder>> * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public ApiResponse> cancelPriceTriggeredOrderListWithHttpInfo(String settle, String contract) throws ApiException { @@ -5073,17 +7776,17 @@ public ApiResponse> cancelPriceTriggeredOrderLi } /** - * Cancel all open orders (asynchronously) + * Cancel all auto orders (asynchronously) * * @param settle Settle currency (required) - * @param contract Futures contract (required) + * @param contract Futures contract, return related data only if specified (optional) * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public okhttp3.Call cancelPriceTriggeredOrderListAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { @@ -5096,14 +7799,14 @@ public okhttp3.Call cancelPriceTriggeredOrderListAsync(String settle, String con /** * Build call for getPriceTriggeredOrder * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call getPriceTriggeredOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { @@ -5154,16 +7857,16 @@ private okhttp3.Call getPriceTriggeredOrderValidateBeforeCall(String settle, Str } /** - * Get a single order + * Query single auto order details * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return FuturesPriceTriggeredOrder * @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 Auto order detail -
200 Auto order details -
*/ public FuturesPriceTriggeredOrder getPriceTriggeredOrder(String settle, String orderId) throws ApiException { @@ -5172,16 +7875,16 @@ public FuturesPriceTriggeredOrder getPriceTriggeredOrder(String settle, String o } /** - * Get a single order + * Query single auto order details * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<FuturesPriceTriggeredOrder> * @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 Auto order detail -
200 Auto order details -
*/ public ApiResponse getPriceTriggeredOrderWithHttpInfo(String settle, String orderId) throws ApiException { @@ -5191,17 +7894,17 @@ public ApiResponse getPriceTriggeredOrderWithHttpInf } /** - * Get a single order (asynchronously) + * Query single auto order details (asynchronously) * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call getPriceTriggeredOrderAsync(String settle, String orderId, final ApiCallback _callback) throws ApiException { @@ -5214,14 +7917,14 @@ public okhttp3.Call getPriceTriggeredOrderAsync(String settle, String orderId, f /** * Build call for cancelPriceTriggeredOrder * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call cancelPriceTriggeredOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { @@ -5272,16 +7975,16 @@ private okhttp3.Call cancelPriceTriggeredOrderValidateBeforeCall(String settle, } /** - * Cancel a single order + * Cancel single auto order * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return FuturesPriceTriggeredOrder * @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 Auto order detail -
200 Auto order details -
*/ public FuturesPriceTriggeredOrder cancelPriceTriggeredOrder(String settle, String orderId) throws ApiException { @@ -5290,16 +7993,16 @@ public FuturesPriceTriggeredOrder cancelPriceTriggeredOrder(String settle, Strin } /** - * Cancel a single order + * Cancel single auto order * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<FuturesPriceTriggeredOrder> * @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 Auto order detail -
200 Auto order details -
*/ public ApiResponse cancelPriceTriggeredOrderWithHttpInfo(String settle, String orderId) throws ApiException { @@ -5309,17 +8012,17 @@ public ApiResponse cancelPriceTriggeredOrderWithHttp } /** - * Cancel a single order (asynchronously) + * Cancel single auto order (asynchronously) * * @param settle Settle currency (required) - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call cancelPriceTriggeredOrderAsync(String settle, String orderId, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/io/gate/gateapi/api/MarginApi.java b/src/main/java/io/gate/gateapi/api/MarginApi.java index 750375f..f9834ba 100644 --- a/src/main/java/io/gate/gateapi/api/MarginApi.java +++ b/src/main/java/io/gate/gateapi/api/MarginApi.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 @@ -21,26 +21,14 @@ import io.gate.gateapi.models.AutoRepaySetting; -import io.gate.gateapi.models.CrossMarginAccount; -import io.gate.gateapi.models.CrossMarginAccountBook; -import io.gate.gateapi.models.CrossMarginBorrowable; -import io.gate.gateapi.models.CrossMarginCurrency; import io.gate.gateapi.models.CrossMarginLoan; -import io.gate.gateapi.models.CrossMarginRepayRequest; import io.gate.gateapi.models.CrossMarginRepayment; -import io.gate.gateapi.models.CrossMarginTransferable; import io.gate.gateapi.models.FundingAccount; -import io.gate.gateapi.models.FundingBookItem; -import io.gate.gateapi.models.Loan; -import io.gate.gateapi.models.LoanPatch; -import io.gate.gateapi.models.LoanRecord; import io.gate.gateapi.models.MarginAccount; import io.gate.gateapi.models.MarginAccountBook; -import io.gate.gateapi.models.MarginBorrowable; -import io.gate.gateapi.models.MarginCurrencyPair; +import io.gate.gateapi.models.MarginLeverageTier; +import io.gate.gateapi.models.MarginMarketLeverage; import io.gate.gateapi.models.MarginTransferable; -import io.gate.gateapi.models.RepayRequest; -import io.gate.gateapi.models.Repayment; import java.lang.reflect.Type; import java.util.ArrayList; @@ -67,323 +55,6 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } - /** - * Build call for listMarginCurrencyPairs - * @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 List retrieved -
- */ - public okhttp3.Call listMarginCurrencyPairsCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/currency_pairs"; - - 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[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listMarginCurrencyPairsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listMarginCurrencyPairsCall(_callback); - return localVarCall; - } - - /** - * List all supported currency pairs supported in margin trading - * - * @return List<MarginCurrencyPair> - * @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 List retrieved -
- */ - public List listMarginCurrencyPairs() throws ApiException { - ApiResponse> localVarResp = listMarginCurrencyPairsWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * List all supported currency pairs supported in margin trading - * - * @return ApiResponse<List<MarginCurrencyPair>> - * @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 List retrieved -
- */ - public ApiResponse> listMarginCurrencyPairsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listMarginCurrencyPairsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List all supported currency pairs supported in margin trading (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 List retrieved -
- */ - public okhttp3.Call listMarginCurrencyPairsAsync(final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listMarginCurrencyPairsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getMarginCurrencyPair - * @param currencyPair Margin currency pair (required) - * @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 getMarginCurrencyPairCall(String currencyPair, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/currency_pairs/{currency_pair}" - .replaceAll("\\{" + "currency_pair" + "\\}", localVarApiClient.escapeString(currencyPair)); - - 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[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getMarginCurrencyPairValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currencyPair' is set - if (currencyPair == null) { - throw new ApiException("Missing the required parameter 'currencyPair' when calling getMarginCurrencyPair(Async)"); - } - - okhttp3.Call localVarCall = getMarginCurrencyPairCall(currencyPair, _callback); - return localVarCall; - } - - /** - * Query one single margin currency pair - * - * @param currencyPair Margin currency pair (required) - * @return MarginCurrencyPair - * @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 MarginCurrencyPair getMarginCurrencyPair(String currencyPair) throws ApiException { - ApiResponse localVarResp = getMarginCurrencyPairWithHttpInfo(currencyPair); - return localVarResp.getData(); - } - - /** - * Query one single margin currency pair - * - * @param currencyPair Margin currency pair (required) - * @return ApiResponse<MarginCurrencyPair> - * @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 getMarginCurrencyPairWithHttpInfo(String currencyPair) throws ApiException { - okhttp3.Call localVarCall = getMarginCurrencyPairValidateBeforeCall(currencyPair, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Query one single margin currency pair (asynchronously) - * - * @param currencyPair Margin currency pair (required) - * @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 getMarginCurrencyPairAsync(String currencyPair, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getMarginCurrencyPairValidateBeforeCall(currencyPair, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listFundingBook - * @param currency Retrieve data of the specified currency (required) - * @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 Order book retrieved -
- */ - public okhttp3.Call listFundingBookCall(String currency, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/funding_book"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - 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[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listFundingBookValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currency' is set - if (currency == null) { - throw new ApiException("Missing the required parameter 'currency' when calling listFundingBook(Async)"); - } - - okhttp3.Call localVarCall = listFundingBookCall(currency, _callback); - return localVarCall; - } - - /** - * Order book of lending loans - * - * @param currency Retrieve data of the specified currency (required) - * @return List<FundingBookItem> - * @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 Order book retrieved -
- */ - public List listFundingBook(String currency) throws ApiException { - ApiResponse> localVarResp = listFundingBookWithHttpInfo(currency); - return localVarResp.getData(); - } - - /** - * Order book of lending loans - * - * @param currency Retrieve data of the specified currency (required) - * @return ApiResponse<List<FundingBookItem>> - * @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 Order book retrieved -
- */ - public ApiResponse> listFundingBookWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = listFundingBookValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Order book of lending loans (asynchronously) - * - * @param currency Retrieve data of the specified currency (required) - * @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 Order book retrieved -
- */ - public okhttp3.Call listFundingBookAsync(String currency, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFundingBookValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - private okhttp3.Call listMarginAccountsCall(String currencyPair, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; @@ -461,7 +132,7 @@ public APIlistMarginAccountsRequest currencyPair(String currencyPair) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -475,7 +146,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -490,7 +161,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -505,7 +176,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExceptio * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -520,14 +191,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callbac * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistMarginAccountsRequest listMarginAccounts() { return new APIlistMarginAccountsRequest(); } - private okhttp3.Call listMarginAccountBookCall(String currency, String currencyPair, Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listMarginAccountBookCall(String currency, String currencyPair, String type, Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -543,6 +214,10 @@ private okhttp3.Call listMarginAccountBookCall(String currency, String currencyP localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); } + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + if (from != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); } @@ -581,20 +256,20 @@ private okhttp3.Call listMarginAccountBookCall(String currency, String currencyP } @SuppressWarnings("rawtypes") - private okhttp3.Call listMarginAccountBookValidateBeforeCall(String currency, String currencyPair, Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listMarginAccountBookCall(currency, currencyPair, from, to, page, limit, _callback); + private okhttp3.Call listMarginAccountBookValidateBeforeCall(String currency, String currencyPair, String type, Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMarginAccountBookCall(currency, currencyPair, type, from, to, page, limit, _callback); return localVarCall; } - private ApiResponse> listMarginAccountBookWithHttpInfo(String currency, String currencyPair, Long from, Long to, Integer page, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listMarginAccountBookValidateBeforeCall(currency, currencyPair, from, to, page, limit, null); + private ApiResponse> listMarginAccountBookWithHttpInfo(String currency, String currencyPair, String type, Long from, Long to, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listMarginAccountBookValidateBeforeCall(currency, currencyPair, type, from, to, page, limit, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listMarginAccountBookAsync(String currency, String currencyPair, Long from, Long to, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listMarginAccountBookValidateBeforeCall(currency, currencyPair, from, to, page, limit, _callback); + private okhttp3.Call listMarginAccountBookAsync(String currency, String currencyPair, String type, Long from, Long to, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMarginAccountBookValidateBeforeCall(currency, currencyPair, type, from, to, page, limit, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -603,6 +278,7 @@ private okhttp3.Call listMarginAccountBookAsync(String currency, String currency public class APIlistMarginAccountBookRequest { private String currency; private String currencyPair; + private String type; private Long from; private Long to; private Integer page; @@ -613,7 +289,7 @@ private APIlistMarginAccountBookRequest() { /** * Set currency - * @param currency List records related to specified currency only. If specified, `currency_pair` is also required. (optional) + * @param currency Query history for specified currency. If `currency` is specified, `currency_pair` must also be specified. (optional) * @return APIlistMarginAccountBookRequest */ public APIlistMarginAccountBookRequest currency(String currency) { @@ -623,7 +299,7 @@ public APIlistMarginAccountBookRequest currency(String currency) { /** * Set currencyPair - * @param currencyPair List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional) + * @param currencyPair Specify margin account currency pair. Used in combination with `currency`. Ignored if `currency` is not specified (optional) * @return APIlistMarginAccountBookRequest */ public APIlistMarginAccountBookRequest currencyPair(String currencyPair) { @@ -631,9 +307,19 @@ public APIlistMarginAccountBookRequest currencyPair(String currencyPair) { return this; } + /** + * Set type + * @param type Query by specified account change type. If not specified, all change types will be included. (optional) + * @return APIlistMarginAccountBookRequest + */ + public APIlistMarginAccountBookRequest type(String type) { + this.type = type; + return this; + } + /** * Set from - * @param from Time range beginning, default to 7 days before current time (optional) + * @param from Start timestamp for the query (optional) * @return APIlistMarginAccountBookRequest */ public APIlistMarginAccountBookRequest from(Long from) { @@ -643,7 +329,7 @@ public APIlistMarginAccountBookRequest from(Long from) { /** * Set to - * @param to Time range ending, default to current time (optional) + * @param to End timestamp for the query, defaults to current time if not specified (optional) * @return APIlistMarginAccountBookRequest */ public APIlistMarginAccountBookRequest to(Long to) { @@ -663,7 +349,7 @@ public APIlistMarginAccountBookRequest page(Integer page) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistMarginAccountBookRequest */ public APIlistMarginAccountBookRequest limit(Integer limit) { @@ -679,11 +365,11 @@ public APIlistMarginAccountBookRequest limit(Integer limit) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listMarginAccountBookCall(currency, currencyPair, from, to, page, limit, _callback); + return listMarginAccountBookCall(currency, currencyPair, type, from, to, page, limit, _callback); } /** @@ -693,11 +379,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listMarginAccountBookWithHttpInfo(currency, currencyPair, from, to, page, limit); + ApiResponse> localVarResp = listMarginAccountBookWithHttpInfo(currency, currencyPair, type, from, to, page, limit); return localVarResp.getData(); } @@ -708,11 +394,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listMarginAccountBookWithHttpInfo(currency, currencyPair, from, to, page, limit); + return listMarginAccountBookWithHttpInfo(currency, currencyPair, type, from, to, page, limit); } /** @@ -723,22 +409,22 @@ public ApiResponse> executeWithHttpInfo() throws ApiExce * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listMarginAccountBookAsync(currency, currencyPair, from, to, page, limit, _callback); + return listMarginAccountBookAsync(currency, currencyPair, type, from, to, page, limit, _callback); } } /** - * List margin account balance change history - * Only transferals from and to margin account are provided for now. Time range allows 30 days at most + * Query margin account balance change history + * Currently only provides transfer history to and from margin accounts. Query time range cannot exceed 30 days * @return APIlistMarginAccountBookRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistMarginAccountBookRequest listMarginAccountBook() { @@ -806,7 +492,7 @@ private APIlistFundingAccountsRequest() { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistFundingAccountsRequest */ public APIlistFundingAccountsRequest currency(String currency) { @@ -822,7 +508,7 @@ public APIlistFundingAccountsRequest currency(String currency) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -836,7 +522,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -851,7 +537,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -866,7 +552,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcepti * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -881,1493 +567,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callba * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistFundingAccountsRequest listFundingAccounts() { return new APIlistFundingAccountsRequest(); } - private okhttp3.Call listLoansCall(String status, String side, String currency, String currencyPair, String sortBy, Boolean reverseSort, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/loans"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (status != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); - } - - if (side != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); - } - - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - if (currencyPair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); - } - - if (sortBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_by", sortBy)); - } - - if (reverseSort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reverse_sort", reverseSort)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - 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 listLoansValidateBeforeCall(String status, String side, String currency, String currencyPair, String sortBy, Boolean reverseSort, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'status' is set - if (status == null) { - throw new ApiException("Missing the required parameter 'status' when calling listLoans(Async)"); - } - - // verify the required parameter 'side' is set - if (side == null) { - throw new ApiException("Missing the required parameter 'side' when calling listLoans(Async)"); - } - - okhttp3.Call localVarCall = listLoansCall(status, side, currency, currencyPair, sortBy, reverseSort, page, limit, _callback); - return localVarCall; - } - - - private ApiResponse> listLoansWithHttpInfo(String status, String side, String currency, String currencyPair, String sortBy, Boolean reverseSort, Integer page, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listLoansValidateBeforeCall(status, side, currency, currencyPair, sortBy, reverseSort, page, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - private okhttp3.Call listLoansAsync(String status, String side, String currency, String currencyPair, String sortBy, Boolean reverseSort, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listLoansValidateBeforeCall(status, side, currency, currencyPair, sortBy, reverseSort, page, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - public class APIlistLoansRequest { - private final String status; - private final String side; - private String currency; - private String currencyPair; - private String sortBy; - private Boolean reverseSort; - private Integer page; - private Integer limit; - - private APIlistLoansRequest(String status, String side) { - this.status = status; - this.side = side; - } - - /** - * Set currency - * @param currency Retrieve data of the specified currency (optional) - * @return APIlistLoansRequest - */ - public APIlistLoansRequest currency(String currency) { - this.currency = currency; - return this; - } - - /** - * Set currencyPair - * @param currencyPair Currency pair (optional) - * @return APIlistLoansRequest - */ - public APIlistLoansRequest currencyPair(String currencyPair) { - this.currencyPair = currencyPair; - return this; - } - - /** - * Set sortBy - * @param sortBy Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` (optional) - * @return APIlistLoansRequest - */ - public APIlistLoansRequest sortBy(String sortBy) { - this.sortBy = sortBy; - return this; - } - - /** - * Set reverseSort - * @param reverseSort Whether to sort in descending order. Default to `true` (optional) - * @return APIlistLoansRequest - */ - public APIlistLoansRequest reverseSort(Boolean reverseSort) { - this.reverseSort = reverseSort; - return this; - } - - /** - * Set page - * @param page Page number (optional, default to 1) - * @return APIlistLoansRequest - */ - public APIlistLoansRequest page(Integer page) { - this.page = page; - return this; - } - - /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistLoansRequest - */ - public APIlistLoansRequest limit(Integer limit) { - this.limit = limit; - return this; - } - - /** - * Build call for listLoans - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listLoansCall(status, side, currency, currencyPair, sortBy, reverseSort, page, limit, _callback); - } - - /** - * Execute listLoans request - * @return List<Loan> - * @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 List retrieved -
- */ - public List execute() throws ApiException { - ApiResponse> localVarResp = listLoansWithHttpInfo(status, side, currency, currencyPair, sortBy, reverseSort, page, limit); - return localVarResp.getData(); - } - - /** - * Execute listLoans request with HTTP info returned - * @return ApiResponse<List<Loan>> - * @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 List retrieved -
- */ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listLoansWithHttpInfo(status, side, currency, currencyPair, sortBy, reverseSort, page, limit); - } - - /** - * Execute listLoans request (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 List retrieved -
- */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listLoansAsync(status, side, currency, currencyPair, sortBy, reverseSort, page, limit, _callback); - } - } - - /** - * List all loans - * - * @param status Loan status (required) - * @param side Lend or borrow (required) - * @return APIlistLoansRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - public APIlistLoansRequest listLoans(String status, String side) { - return new APIlistLoansRequest(status, side); - } - - /** - * Build call for createLoan - * @param loan (required) - * @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
201 Loan created -
- */ - public okhttp3.Call createLoanCall(Loan loan, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = loan; - - // create path and map variables - String localVarPath = "/margin/loans"; - - 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 = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createLoanValidateBeforeCall(Loan loan, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loan' is set - if (loan == null) { - throw new ApiException("Missing the required parameter 'loan' when calling createLoan(Async)"); - } - - okhttp3.Call localVarCall = createLoanCall(loan, _callback); - return localVarCall; - } - - /** - * Lend or borrow - * - * @param loan (required) - * @return Loan - * @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
201 Loan created -
- */ - public Loan createLoan(Loan loan) throws ApiException { - ApiResponse localVarResp = createLoanWithHttpInfo(loan); - return localVarResp.getData(); - } - - /** - * Lend or borrow - * - * @param loan (required) - * @return ApiResponse<Loan> - * @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
201 Loan created -
- */ - public ApiResponse createLoanWithHttpInfo(Loan loan) throws ApiException { - okhttp3.Call localVarCall = createLoanValidateBeforeCall(loan, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Lend or borrow (asynchronously) - * - * @param loan (required) - * @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
201 Loan created -
- */ - public okhttp3.Call createLoanAsync(Loan loan, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createLoanValidateBeforeCall(loan, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for mergeLoans - * @param currency Retrieve data of the specified currency (required) - * @param ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) - * @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
201 Loans merged -
- */ - public okhttp3.Call mergeLoansCall(String currency, String ids, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/merged_loans"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - if (ids != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ids", ids)); - } - - 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call mergeLoansValidateBeforeCall(String currency, String ids, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currency' is set - if (currency == null) { - throw new ApiException("Missing the required parameter 'currency' when calling mergeLoans(Async)"); - } - - // verify the required parameter 'ids' is set - if (ids == null) { - throw new ApiException("Missing the required parameter 'ids' when calling mergeLoans(Async)"); - } - - okhttp3.Call localVarCall = mergeLoansCall(currency, ids, _callback); - return localVarCall; - } - - /** - * Merge multiple lending loans - * - * @param currency Retrieve data of the specified currency (required) - * @param ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) - * @return Loan - * @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
201 Loans merged -
- */ - public Loan mergeLoans(String currency, String ids) throws ApiException { - ApiResponse localVarResp = mergeLoansWithHttpInfo(currency, ids); - return localVarResp.getData(); - } - - /** - * Merge multiple lending loans - * - * @param currency Retrieve data of the specified currency (required) - * @param ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) - * @return ApiResponse<Loan> - * @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
201 Loans merged -
- */ - public ApiResponse mergeLoansWithHttpInfo(String currency, String ids) throws ApiException { - okhttp3.Call localVarCall = mergeLoansValidateBeforeCall(currency, ids, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Merge multiple lending loans (asynchronously) - * - * @param currency Retrieve data of the specified currency (required) - * @param ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) - * @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
201 Loans merged -
- */ - public okhttp3.Call mergeLoansAsync(String currency, String ids, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = mergeLoansValidateBeforeCall(currency, ids, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getLoan - * @param loanId Loan ID (required) - * @param side Lend or borrow (required) - * @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 List retrieved -
- */ - public okhttp3.Call getLoanCall(String loanId, String side, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/loans/{loan_id}" - .replaceAll("\\{" + "loan_id" + "\\}", localVarApiClient.escapeString(loanId)); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (side != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); - } - - 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 getLoanValidateBeforeCall(String loanId, String side, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling getLoan(Async)"); - } - - // verify the required parameter 'side' is set - if (side == null) { - throw new ApiException("Missing the required parameter 'side' when calling getLoan(Async)"); - } - - okhttp3.Call localVarCall = getLoanCall(loanId, side, _callback); - return localVarCall; - } - - /** - * Retrieve one single loan detail - * - * @param loanId Loan ID (required) - * @param side Lend or borrow (required) - * @return Loan - * @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 List retrieved -
- */ - public Loan getLoan(String loanId, String side) throws ApiException { - ApiResponse localVarResp = getLoanWithHttpInfo(loanId, side); - return localVarResp.getData(); - } - - /** - * Retrieve one single loan detail - * - * @param loanId Loan ID (required) - * @param side Lend or borrow (required) - * @return ApiResponse<Loan> - * @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 List retrieved -
- */ - public ApiResponse getLoanWithHttpInfo(String loanId, String side) throws ApiException { - okhttp3.Call localVarCall = getLoanValidateBeforeCall(loanId, side, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Retrieve one single loan detail (asynchronously) - * - * @param loanId Loan ID (required) - * @param side Lend or borrow (required) - * @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 List retrieved -
- */ - public okhttp3.Call getLoanAsync(String loanId, String side, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getLoanValidateBeforeCall(loanId, side, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for cancelLoan - * @param loanId Loan ID (required) - * @param currency Retrieve data of the specified currency (required) - * @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 Order cancelled -
- */ - public okhttp3.Call cancelLoanCall(String loanId, String currency, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/loans/{loan_id}" - .replaceAll("\\{" + "loan_id" + "\\}", localVarApiClient.escapeString(loanId)); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call cancelLoanValidateBeforeCall(String loanId, String currency, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling cancelLoan(Async)"); - } - - // verify the required parameter 'currency' is set - if (currency == null) { - throw new ApiException("Missing the required parameter 'currency' when calling cancelLoan(Async)"); - } - - okhttp3.Call localVarCall = cancelLoanCall(loanId, currency, _callback); - return localVarCall; - } - - /** - * Cancel lending loan - * Only lent loans can be cancelled - * @param loanId Loan ID (required) - * @param currency Retrieve data of the specified currency (required) - * @return Loan - * @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 Order cancelled -
- */ - public Loan cancelLoan(String loanId, String currency) throws ApiException { - ApiResponse localVarResp = cancelLoanWithHttpInfo(loanId, currency); - return localVarResp.getData(); - } - - /** - * Cancel lending loan - * Only lent loans can be cancelled - * @param loanId Loan ID (required) - * @param currency Retrieve data of the specified currency (required) - * @return ApiResponse<Loan> - * @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 Order cancelled -
- */ - public ApiResponse cancelLoanWithHttpInfo(String loanId, String currency) throws ApiException { - okhttp3.Call localVarCall = cancelLoanValidateBeforeCall(loanId, currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Cancel lending loan (asynchronously) - * Only lent loans can be cancelled - * @param loanId Loan ID (required) - * @param currency Retrieve data of the specified currency (required) - * @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 Order cancelled -
- */ - public okhttp3.Call cancelLoanAsync(String loanId, String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = cancelLoanValidateBeforeCall(loanId, currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateLoan - * @param loanId Loan ID (required) - * @param loanPatch (required) - * @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 Updated -
- */ - public okhttp3.Call updateLoanCall(String loanId, LoanPatch loanPatch, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = loanPatch; - - // create path and map variables - String localVarPath = "/margin/loans/{loan_id}" - .replaceAll("\\{" + "loan_id" + "\\}", localVarApiClient.escapeString(loanId)); - - 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 = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateLoanValidateBeforeCall(String loanId, LoanPatch loanPatch, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling updateLoan(Async)"); - } - - // verify the required parameter 'loanPatch' is set - if (loanPatch == null) { - throw new ApiException("Missing the required parameter 'loanPatch' when calling updateLoan(Async)"); - } - - okhttp3.Call localVarCall = updateLoanCall(loanId, loanPatch, _callback); - return localVarCall; - } - - /** - * Modify a loan - * Only `auto_renew` modification is supported currently - * @param loanId Loan ID (required) - * @param loanPatch (required) - * @return Loan - * @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 Updated -
- */ - public Loan updateLoan(String loanId, LoanPatch loanPatch) throws ApiException { - ApiResponse localVarResp = updateLoanWithHttpInfo(loanId, loanPatch); - return localVarResp.getData(); - } - - /** - * Modify a loan - * Only `auto_renew` modification is supported currently - * @param loanId Loan ID (required) - * @param loanPatch (required) - * @return ApiResponse<Loan> - * @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 Updated -
- */ - public ApiResponse updateLoanWithHttpInfo(String loanId, LoanPatch loanPatch) throws ApiException { - okhttp3.Call localVarCall = updateLoanValidateBeforeCall(loanId, loanPatch, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Modify a loan (asynchronously) - * Only `auto_renew` modification is supported currently - * @param loanId Loan ID (required) - * @param loanPatch (required) - * @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 Updated -
- */ - public okhttp3.Call updateLoanAsync(String loanId, LoanPatch loanPatch, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateLoanValidateBeforeCall(loanId, loanPatch, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for listLoanRepayments - * @param loanId Loan ID (required) - * @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 List retrieved -
- */ - public okhttp3.Call listLoanRepaymentsCall(String loanId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/loans/{loan_id}/repayment" - .replaceAll("\\{" + "loan_id" + "\\}", localVarApiClient.escapeString(loanId)); - - 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 listLoanRepaymentsValidateBeforeCall(String loanId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling listLoanRepayments(Async)"); - } - - okhttp3.Call localVarCall = listLoanRepaymentsCall(loanId, _callback); - return localVarCall; - } - - /** - * List loan repayment records - * - * @param loanId Loan ID (required) - * @return List<Repayment> - * @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 List retrieved -
- */ - public List listLoanRepayments(String loanId) throws ApiException { - ApiResponse> localVarResp = listLoanRepaymentsWithHttpInfo(loanId); - return localVarResp.getData(); - } - - /** - * List loan repayment records - * - * @param loanId Loan ID (required) - * @return ApiResponse<List<Repayment>> - * @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 List retrieved -
- */ - public ApiResponse> listLoanRepaymentsWithHttpInfo(String loanId) throws ApiException { - okhttp3.Call localVarCall = listLoanRepaymentsValidateBeforeCall(loanId, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List loan repayment records (asynchronously) - * - * @param loanId Loan ID (required) - * @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 List retrieved -
- */ - public okhttp3.Call listLoanRepaymentsAsync(String loanId, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listLoanRepaymentsValidateBeforeCall(loanId, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for repayLoan - * @param loanId Loan ID (required) - * @param repayRequest (required) - * @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 Loan repaid -
- */ - public okhttp3.Call repayLoanCall(String loanId, RepayRequest repayRequest, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = repayRequest; - - // create path and map variables - String localVarPath = "/margin/loans/{loan_id}/repayment" - .replaceAll("\\{" + "loan_id" + "\\}", localVarApiClient.escapeString(loanId)); - - 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 = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call repayLoanValidateBeforeCall(String loanId, RepayRequest repayRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling repayLoan(Async)"); - } - - // verify the required parameter 'repayRequest' is set - if (repayRequest == null) { - throw new ApiException("Missing the required parameter 'repayRequest' when calling repayLoan(Async)"); - } - - okhttp3.Call localVarCall = repayLoanCall(loanId, repayRequest, _callback); - return localVarCall; - } - - /** - * Repay a loan - * - * @param loanId Loan ID (required) - * @param repayRequest (required) - * @return Loan - * @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 Loan repaid -
- */ - public Loan repayLoan(String loanId, RepayRequest repayRequest) throws ApiException { - ApiResponse localVarResp = repayLoanWithHttpInfo(loanId, repayRequest); - return localVarResp.getData(); - } - - /** - * Repay a loan - * - * @param loanId Loan ID (required) - * @param repayRequest (required) - * @return ApiResponse<Loan> - * @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 Loan repaid -
- */ - public ApiResponse repayLoanWithHttpInfo(String loanId, RepayRequest repayRequest) throws ApiException { - okhttp3.Call localVarCall = repayLoanValidateBeforeCall(loanId, repayRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Repay a loan (asynchronously) - * - * @param loanId Loan ID (required) - * @param repayRequest (required) - * @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 Loan repaid -
- */ - public okhttp3.Call repayLoanAsync(String loanId, RepayRequest repayRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = repayLoanValidateBeforeCall(loanId, repayRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - private okhttp3.Call listLoanRecordsCall(String loanId, String status, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/loan_records"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (loanId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("loan_id", loanId)); - } - - if (status != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - 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 listLoanRecordsValidateBeforeCall(String loanId, String status, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling listLoanRecords(Async)"); - } - - okhttp3.Call localVarCall = listLoanRecordsCall(loanId, status, page, limit, _callback); - return localVarCall; - } - - - private ApiResponse> listLoanRecordsWithHttpInfo(String loanId, String status, Integer page, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listLoanRecordsValidateBeforeCall(loanId, status, page, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - private okhttp3.Call listLoanRecordsAsync(String loanId, String status, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listLoanRecordsValidateBeforeCall(loanId, status, page, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - public class APIlistLoanRecordsRequest { - private final String loanId; - private String status; - private Integer page; - private Integer limit; - - private APIlistLoanRecordsRequest(String loanId) { - this.loanId = loanId; - } - - /** - * Set status - * @param status Loan record status (optional) - * @return APIlistLoanRecordsRequest - */ - public APIlistLoanRecordsRequest status(String status) { - this.status = status; - return this; - } - - /** - * Set page - * @param page Page number (optional, default to 1) - * @return APIlistLoanRecordsRequest - */ - public APIlistLoanRecordsRequest page(Integer page) { - this.page = page; - return this; - } - - /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistLoanRecordsRequest - */ - public APIlistLoanRecordsRequest limit(Integer limit) { - this.limit = limit; - return this; - } - - /** - * Build call for listLoanRecords - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listLoanRecordsCall(loanId, status, page, limit, _callback); - } - - /** - * Execute listLoanRecords request - * @return List<LoanRecord> - * @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 List retrieved -
- */ - public List execute() throws ApiException { - ApiResponse> localVarResp = listLoanRecordsWithHttpInfo(loanId, status, page, limit); - return localVarResp.getData(); - } - - /** - * Execute listLoanRecords request with HTTP info returned - * @return ApiResponse<List<LoanRecord>> - * @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 List retrieved -
- */ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listLoanRecordsWithHttpInfo(loanId, status, page, limit); - } - - /** - * Execute listLoanRecords request (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 List retrieved -
- */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listLoanRecordsAsync(loanId, status, page, limit, _callback); - } - } - - /** - * List repayment records of a specific loan - * - * @param loanId Loan ID (required) - * @return APIlistLoanRecordsRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - public APIlistLoanRecordsRequest listLoanRecords(String loanId) { - return new APIlistLoanRecordsRequest(loanId); - } - - /** - * Build call for getLoanRecord - * @param loanRecordId Loan record ID (required) - * @param loanId Loan ID (required) - * @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 Detail retrieved -
- */ - public okhttp3.Call getLoanRecordCall(String loanRecordId, String loanId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/loan_records/{loan_record_id}" - .replaceAll("\\{" + "loan_record_id" + "\\}", localVarApiClient.escapeString(loanRecordId)); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (loanId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("loan_id", loanId)); - } - - 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 getLoanRecordValidateBeforeCall(String loanRecordId, String loanId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanRecordId' is set - if (loanRecordId == null) { - throw new ApiException("Missing the required parameter 'loanRecordId' when calling getLoanRecord(Async)"); - } - - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling getLoanRecord(Async)"); - } - - okhttp3.Call localVarCall = getLoanRecordCall(loanRecordId, loanId, _callback); - return localVarCall; - } - - /** - * Get one single loan record - * - * @param loanRecordId Loan record ID (required) - * @param loanId Loan ID (required) - * @return LoanRecord - * @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 Detail retrieved -
- */ - public LoanRecord getLoanRecord(String loanRecordId, String loanId) throws ApiException { - ApiResponse localVarResp = getLoanRecordWithHttpInfo(loanRecordId, loanId); - return localVarResp.getData(); - } - - /** - * Get one single loan record - * - * @param loanRecordId Loan record ID (required) - * @param loanId Loan ID (required) - * @return ApiResponse<LoanRecord> - * @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 Detail retrieved -
- */ - public ApiResponse getLoanRecordWithHttpInfo(String loanRecordId, String loanId) throws ApiException { - okhttp3.Call localVarCall = getLoanRecordValidateBeforeCall(loanRecordId, loanId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get one single loan record (asynchronously) - * - * @param loanRecordId Loan record ID (required) - * @param loanId Loan ID (required) - * @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 Detail retrieved -
- */ - public okhttp3.Call getLoanRecordAsync(String loanRecordId, String loanId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getLoanRecordValidateBeforeCall(loanRecordId, loanId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateLoanRecord - * @param loanRecordId Loan record ID (required) - * @param loanPatch (required) - * @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 Loan record updated -
- */ - public okhttp3.Call updateLoanRecordCall(String loanRecordId, LoanPatch loanPatch, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = loanPatch; - - // create path and map variables - String localVarPath = "/margin/loan_records/{loan_record_id}" - .replaceAll("\\{" + "loan_record_id" + "\\}", localVarApiClient.escapeString(loanRecordId)); - - 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 = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateLoanRecordValidateBeforeCall(String loanRecordId, LoanPatch loanPatch, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanRecordId' is set - if (loanRecordId == null) { - throw new ApiException("Missing the required parameter 'loanRecordId' when calling updateLoanRecord(Async)"); - } - - // verify the required parameter 'loanPatch' is set - if (loanPatch == null) { - throw new ApiException("Missing the required parameter 'loanPatch' when calling updateLoanRecord(Async)"); - } - - okhttp3.Call localVarCall = updateLoanRecordCall(loanRecordId, loanPatch, _callback); - return localVarCall; - } - - /** - * Modify a loan record - * Only `auto_renew` modification is supported currently - * @param loanRecordId Loan record ID (required) - * @param loanPatch (required) - * @return LoanRecord - * @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 Loan record updated -
- */ - public LoanRecord updateLoanRecord(String loanRecordId, LoanPatch loanPatch) throws ApiException { - ApiResponse localVarResp = updateLoanRecordWithHttpInfo(loanRecordId, loanPatch); - return localVarResp.getData(); - } - - /** - * Modify a loan record - * Only `auto_renew` modification is supported currently - * @param loanRecordId Loan record ID (required) - * @param loanPatch (required) - * @return ApiResponse<LoanRecord> - * @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 Loan record updated -
- */ - public ApiResponse updateLoanRecordWithHttpInfo(String loanRecordId, LoanPatch loanPatch) throws ApiException { - okhttp3.Call localVarCall = updateLoanRecordValidateBeforeCall(loanRecordId, loanPatch, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Modify a loan record (asynchronously) - * Only `auto_renew` modification is supported currently - * @param loanRecordId Loan record ID (required) - * @param loanPatch (required) - * @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 Loan record updated -
- */ - public okhttp3.Call updateLoanRecordAsync(String loanRecordId, LoanPatch loanPatch, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateLoanRecordValidateBeforeCall(loanRecordId, loanPatch, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for getAutoRepayStatus * @param _callback Callback for upload/download progress @@ -2376,7 +582,7 @@ public okhttp3.Call updateLoanRecordAsync(String loanRecordId, LoanPatch loanPat * @http.response.details - +
Status Code Description Response Headers
200 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public okhttp3.Call getAutoRepayStatusCall(final ApiCallback _callback) throws ApiException { @@ -2415,14 +621,14 @@ private okhttp3.Call getAutoRepayStatusValidateBeforeCall(final ApiCallback _cal } /** - * Retrieve user auto repayment setting + * Query user auto repayment settings * * @return AutoRepaySetting * @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 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public AutoRepaySetting getAutoRepayStatus() throws ApiException { @@ -2431,14 +637,14 @@ public AutoRepaySetting getAutoRepayStatus() throws ApiException { } /** - * Retrieve user auto repayment setting + * Query user auto repayment settings * * @return ApiResponse<AutoRepaySetting> * @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 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public ApiResponse getAutoRepayStatusWithHttpInfo() throws ApiException { @@ -2448,7 +654,7 @@ public ApiResponse getAutoRepayStatusWithHttpInfo() throws Api } /** - * Retrieve user auto repayment setting (asynchronously) + * Query user auto repayment settings (asynchronously) * * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -2456,7 +662,7 @@ public ApiResponse getAutoRepayStatusWithHttpInfo() throws Api * @http.response.details - +
Status Code Description Response Headers
200 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public okhttp3.Call getAutoRepayStatusAsync(final ApiCallback _callback) throws ApiException { @@ -2468,14 +674,14 @@ public okhttp3.Call getAutoRepayStatusAsync(final ApiCallback /** * Build call for setAutoRepay - * @param status New auto repayment status. `on` - enabled, `off` - disabled (required) + * @param status Whether to enable auto repayment: `on` - enabled, `off` - disabled (required) * @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 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public okhttp3.Call setAutoRepayCall(String status, final ApiCallback _callback) throws ApiException { @@ -2523,15 +729,15 @@ private okhttp3.Call setAutoRepayValidateBeforeCall(String status, final ApiCall } /** - * Update user's auto repayment setting + * Update user auto repayment settings * - * @param status New auto repayment status. `on` - enabled, `off` - disabled (required) + * @param status Whether to enable auto repayment: `on` - enabled, `off` - disabled (required) * @return AutoRepaySetting * @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 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public AutoRepaySetting setAutoRepay(String status) throws ApiException { @@ -2540,15 +746,15 @@ public AutoRepaySetting setAutoRepay(String status) throws ApiException { } /** - * Update user's auto repayment setting + * Update user auto repayment settings * - * @param status New auto repayment status. `on` - enabled, `off` - disabled (required) + * @param status Whether to enable auto repayment: `on` - enabled, `off` - disabled (required) * @return ApiResponse<AutoRepaySetting> * @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 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public ApiResponse setAutoRepayWithHttpInfo(String status) throws ApiException { @@ -2558,16 +764,16 @@ public ApiResponse setAutoRepayWithHttpInfo(String status) thr } /** - * Update user's auto repayment setting (asynchronously) + * Update user auto repayment settings (asynchronously) * - * @param status New auto repayment status. `on` - enabled, `off` - disabled (required) + * @param status Whether to enable auto repayment: `on` - enabled, `off` - disabled (required) * @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 Current auto repayment setting -
200 User's current auto repayment settings -
*/ public okhttp3.Call setAutoRepayAsync(String status, final ApiCallback _callback) throws ApiException { @@ -2665,7 +871,7 @@ public APIgetMarginTransferableRequest currencyPair(String currencyPair) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2679,7 +885,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public MarginTransferable execute() throws ApiException { @@ -2694,7 +900,7 @@ public MarginTransferable execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { @@ -2709,7 +915,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { @@ -2718,194 +924,44 @@ public okhttp3.Call executeAsync(final ApiCallback _callback } /** - * Get the max transferable amount for a specific margin currency + * Get maximum transferable amount for isolated margin * - * @param currency Retrieve data of the specified currency (required) + * @param currency Query by specified currency name (required) * @return APIgetMarginTransferableRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIgetMarginTransferableRequest getMarginTransferable(String currency) { return new APIgetMarginTransferableRequest(currency); } - private okhttp3.Call getMarginBorrowableCall(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/borrowable"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - if (currencyPair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); - } - - 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 getMarginBorrowableValidateBeforeCall(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currency' is set - if (currency == null) { - throw new ApiException("Missing the required parameter 'currency' when calling getMarginBorrowable(Async)"); - } - - okhttp3.Call localVarCall = getMarginBorrowableCall(currency, currencyPair, _callback); - return localVarCall; - } - - - private ApiResponse getMarginBorrowableWithHttpInfo(String currency, String currencyPair) throws ApiException { - okhttp3.Call localVarCall = getMarginBorrowableValidateBeforeCall(currency, currencyPair, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - private okhttp3.Call getMarginBorrowableAsync(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getMarginBorrowableValidateBeforeCall(currency, currencyPair, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - public class APIgetMarginBorrowableRequest { - private final String currency; - private String currencyPair; - - private APIgetMarginBorrowableRequest(String currency) { - this.currency = currency; - } - - /** - * Set currencyPair - * @param currencyPair Currency pair (optional) - * @return APIgetMarginBorrowableRequest - */ - public APIgetMarginBorrowableRequest currencyPair(String currencyPair) { - this.currencyPair = currencyPair; - return this; - } - - /** - * Build call for getMarginBorrowable - * @param _callback ApiCallback API callback - * @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 buildCall(final ApiCallback _callback) throws ApiException { - return getMarginBorrowableCall(currency, currencyPair, _callback); - } - - /** - * Execute getMarginBorrowable request - * @return MarginBorrowable - * @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 MarginBorrowable execute() throws ApiException { - ApiResponse localVarResp = getMarginBorrowableWithHttpInfo(currency, currencyPair); - return localVarResp.getData(); - } - - /** - * Execute getMarginBorrowable request with HTTP info returned - * @return ApiResponse<MarginBorrowable> - * @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 executeWithHttpInfo() throws ApiException { - return getMarginBorrowableWithHttpInfo(currency, currencyPair); - } - - /** - * Execute getMarginBorrowable request (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 executeAsync(final ApiCallback _callback) throws ApiException { - return getMarginBorrowableAsync(currency, currencyPair, _callback); - } - } - - /** - * Get the max borrowable amount for a specific margin currency - * - * @param currency Retrieve data of the specified currency (required) - * @return APIgetMarginBorrowableRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 Successfully retrieved -
- */ - public APIgetMarginBorrowableRequest getMarginBorrowable(String currency) { - return new APIgetMarginBorrowableRequest(currency); - } - /** - * Build call for listCrossMarginCurrencies + * Build call for getUserMarginTier + * @param currencyPair Currency pair (required) * @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 List retrieved -
200 Query successful -
*/ - public okhttp3.Call listCrossMarginCurrenciesCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUserMarginTierCall(String currencyPair, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/margin/cross/currencies"; + String localVarPath = "/margin/user/loan_margin_tiers"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2923,89 +979,100 @@ public okhttp3.Call listCrossMarginCurrenciesCall(final ApiCallback _callback) t final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] { "apiv4" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listCrossMarginCurrenciesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginCurrenciesCall(_callback); + private okhttp3.Call getUserMarginTierValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencyPair' is set + if (currencyPair == null) { + throw new ApiException("Missing the required parameter 'currencyPair' when calling getUserMarginTier(Async)"); + } + + okhttp3.Call localVarCall = getUserMarginTierCall(currencyPair, _callback); return localVarCall; } /** - * Currencies supported by cross margin. + * Query user's own leverage lending tiers in current market * - * @return List<CrossMarginCurrency> + * @param currencyPair Currency pair (required) + * @return List<MarginLeverageTier> * @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 List retrieved -
200 Query successful -
*/ - public List listCrossMarginCurrencies() throws ApiException { - ApiResponse> localVarResp = listCrossMarginCurrenciesWithHttpInfo(); + public List getUserMarginTier(String currencyPair) throws ApiException { + ApiResponse> localVarResp = getUserMarginTierWithHttpInfo(currencyPair); return localVarResp.getData(); } /** - * Currencies supported by cross margin. + * Query user's own leverage lending tiers in current market * - * @return ApiResponse<List<CrossMarginCurrency>> + * @param currencyPair Currency pair (required) + * @return ApiResponse<List<MarginLeverageTier>> * @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 List retrieved -
200 Query successful -
*/ - public ApiResponse> listCrossMarginCurrenciesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listCrossMarginCurrenciesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); + public ApiResponse> getUserMarginTierWithHttpInfo(String currencyPair) throws ApiException { + okhttp3.Call localVarCall = getUserMarginTierValidateBeforeCall(currencyPair, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Currencies supported by cross margin. (asynchronously) + * Query user's own leverage lending tiers in current market (asynchronously) * + * @param currencyPair Currency pair (required) * @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 List retrieved -
200 Query successful -
*/ - public okhttp3.Call listCrossMarginCurrenciesAsync(final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginCurrenciesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + public okhttp3.Call getUserMarginTierAsync(String currencyPair, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getUserMarginTierValidateBeforeCall(currencyPair, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getCrossMarginCurrency - * @param currency Currency name (required) + * Build call for getMarketMarginTier + * @param currencyPair Currency pair (required) * @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 -
200 Query successful -
*/ - public okhttp3.Call getCrossMarginCurrencyCall(String currency, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getMarketMarginTierCall(String currencyPair, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/margin/cross/currencies/{currency}" - .replaceAll("\\{" + "currency" + "\\}", localVarApiClient.escapeString(currency)); + String localVarPath = "/margin/loan_margin_tiers"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -3028,87 +1095,88 @@ public okhttp3.Call getCrossMarginCurrencyCall(String currency, final ApiCallbac } @SuppressWarnings("rawtypes") - private okhttp3.Call getCrossMarginCurrencyValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currency' is set - if (currency == null) { - throw new ApiException("Missing the required parameter 'currency' when calling getCrossMarginCurrency(Async)"); + private okhttp3.Call getMarketMarginTierValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencyPair' is set + if (currencyPair == null) { + throw new ApiException("Missing the required parameter 'currencyPair' when calling getMarketMarginTier(Async)"); } - okhttp3.Call localVarCall = getCrossMarginCurrencyCall(currency, _callback); + okhttp3.Call localVarCall = getMarketMarginTierCall(currencyPair, _callback); return localVarCall; } /** - * Retrieve detail of one single currency supported by cross margin + * Query current market leverage lending tiers * - * @param currency Currency name (required) - * @return CrossMarginCurrency + * @param currencyPair Currency pair (required) + * @return List<MarginLeverageTier> * @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 -
200 Query successful -
*/ - public CrossMarginCurrency getCrossMarginCurrency(String currency) throws ApiException { - ApiResponse localVarResp = getCrossMarginCurrencyWithHttpInfo(currency); + public List getMarketMarginTier(String currencyPair) throws ApiException { + ApiResponse> localVarResp = getMarketMarginTierWithHttpInfo(currencyPair); return localVarResp.getData(); } /** - * Retrieve detail of one single currency supported by cross margin + * Query current market leverage lending tiers * - * @param currency Currency name (required) - * @return ApiResponse<CrossMarginCurrency> + * @param currencyPair Currency pair (required) + * @return ApiResponse<List<MarginLeverageTier>> * @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 -
200 Query successful -
*/ - public ApiResponse getCrossMarginCurrencyWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginCurrencyValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse> getMarketMarginTierWithHttpInfo(String currencyPair) throws ApiException { + okhttp3.Call localVarCall = getMarketMarginTierValidateBeforeCall(currencyPair, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Retrieve detail of one single currency supported by cross margin (asynchronously) + * Query current market leverage lending tiers (asynchronously) * - * @param currency Currency name (required) + * @param currencyPair Currency pair (required) * @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 -
200 Query successful -
*/ - public okhttp3.Call getCrossMarginCurrencyAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginCurrencyValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getMarketMarginTierAsync(String currencyPair, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getMarketMarginTierValidateBeforeCall(currencyPair, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getCrossMarginAccount + * Build call for setUserMarketLeverage + * @param marginMarketLeverage (required) * @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 -
204 Set successfully -
*/ - public okhttp3.Call getCrossMarginAccountCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public okhttp3.Call setUserMarketLeverageCall(MarginMarketLeverage marginMarketLeverage, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = marginMarketLeverage; // create path and map variables - String localVarPath = "/margin/cross/accounts"; + String localVarPath = "/margin/leverage/user_market_setting"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3116,7 +1184,7 @@ public okhttp3.Call getCrossMarginAccountCall(final ApiCallback _callback) throw Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/json" + }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -3124,103 +1192,87 @@ public okhttp3.Call getCrossMarginAccountCall(final ApiCallback _callback) throw } final String[] localVarContentTypes = { - + "application/json" }; 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); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getCrossMarginAccountValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginAccountCall(_callback); + private okhttp3.Call setUserMarketLeverageValidateBeforeCall(MarginMarketLeverage marginMarketLeverage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'marginMarketLeverage' is set + if (marginMarketLeverage == null) { + throw new ApiException("Missing the required parameter 'marginMarketLeverage' when calling setUserMarketLeverage(Async)"); + } + + okhttp3.Call localVarCall = setUserMarketLeverageCall(marginMarketLeverage, _callback); return localVarCall; } /** - * Retrieve cross margin account + * Set user market leverage multiplier * - * @return CrossMarginAccount + * @param marginMarketLeverage (required) * @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 -
204 Set successfully -
*/ - public CrossMarginAccount getCrossMarginAccount() throws ApiException { - ApiResponse localVarResp = getCrossMarginAccountWithHttpInfo(); - return localVarResp.getData(); + public void setUserMarketLeverage(MarginMarketLeverage marginMarketLeverage) throws ApiException { + setUserMarketLeverageWithHttpInfo(marginMarketLeverage); } /** - * Retrieve cross margin account + * Set user market leverage multiplier * - * @return ApiResponse<CrossMarginAccount> + * @param marginMarketLeverage (required) + * @return ApiResponse<Void> * @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 -
204 Set successfully -
*/ - public ApiResponse getCrossMarginAccountWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getCrossMarginAccountValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse setUserMarketLeverageWithHttpInfo(MarginMarketLeverage marginMarketLeverage) throws ApiException { + okhttp3.Call localVarCall = setUserMarketLeverageValidateBeforeCall(marginMarketLeverage, null); + return localVarApiClient.execute(localVarCall); } /** - * Retrieve cross margin account (asynchronously) + * Set user market leverage multiplier (asynchronously) * + * @param marginMarketLeverage (required) * @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 -
204 Set successfully -
*/ - public okhttp3.Call getCrossMarginAccountAsync(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginAccountValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + public okhttp3.Call setUserMarketLeverageAsync(MarginMarketLeverage marginMarketLeverage, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = setUserMarketLeverageValidateBeforeCall(marginMarketLeverage, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - private okhttp3.Call listCrossMarginAccountBookCall(String currency, Long from, Long to, Integer page, Integer limit, String type, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listMarginUserAccountCall(String currencyPair, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/margin/cross/account_book"; + String localVarPath = "/margin/user/account"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - if (from != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); - } - - if (to != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (type != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); } Map localVarHeaderParams = new HashMap(); @@ -3245,168 +1297,113 @@ private okhttp3.Call listCrossMarginAccountBookCall(String currency, Long from, } @SuppressWarnings("rawtypes") - private okhttp3.Call listCrossMarginAccountBookValidateBeforeCall(String currency, Long from, Long to, Integer page, Integer limit, String type, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginAccountBookCall(currency, from, to, page, limit, type, _callback); + private okhttp3.Call listMarginUserAccountValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMarginUserAccountCall(currencyPair, _callback); return localVarCall; } - private ApiResponse> listCrossMarginAccountBookWithHttpInfo(String currency, Long from, Long to, Integer page, Integer limit, String type) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginAccountBookValidateBeforeCall(currency, from, to, page, limit, type, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> listMarginUserAccountWithHttpInfo(String currencyPair) throws ApiException { + okhttp3.Call localVarCall = listMarginUserAccountValidateBeforeCall(currencyPair, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listCrossMarginAccountBookAsync(String currency, Long from, Long to, Integer page, Integer limit, String type, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginAccountBookValidateBeforeCall(currency, from, to, page, limit, type, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call listMarginUserAccountAsync(String currencyPair, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMarginUserAccountValidateBeforeCall(currencyPair, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistCrossMarginAccountBookRequest { - private String currency; - private Long from; - private Long to; - private Integer page; - private Integer limit; - private String type; - - private APIlistCrossMarginAccountBookRequest() { - } - - /** - * Set currency - * @param currency Filter by currency (optional) - * @return APIlistCrossMarginAccountBookRequest - */ - public APIlistCrossMarginAccountBookRequest currency(String currency) { - this.currency = currency; - return this; - } - - /** - * Set from - * @param from Time range beginning, default to 7 days before current time (optional) - * @return APIlistCrossMarginAccountBookRequest - */ - public APIlistCrossMarginAccountBookRequest from(Long from) { - this.from = from; - return this; - } - - /** - * Set to - * @param to Time range ending, default to current time (optional) - * @return APIlistCrossMarginAccountBookRequest - */ - public APIlistCrossMarginAccountBookRequest to(Long to) { - this.to = to; - return this; - } - - /** - * Set page - * @param page Page number (optional, default to 1) - * @return APIlistCrossMarginAccountBookRequest - */ - public APIlistCrossMarginAccountBookRequest page(Integer page) { - this.page = page; - return this; - } + public class APIlistMarginUserAccountRequest { + private String currencyPair; - /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistCrossMarginAccountBookRequest - */ - public APIlistCrossMarginAccountBookRequest limit(Integer limit) { - this.limit = limit; - return this; + private APIlistMarginUserAccountRequest() { } /** - * Set type - * @param type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) - * @return APIlistCrossMarginAccountBookRequest + * Set currencyPair + * @param currencyPair Currency pair (optional) + * @return APIlistMarginUserAccountRequest */ - public APIlistCrossMarginAccountBookRequest type(String type) { - this.type = type; + public APIlistMarginUserAccountRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; return this; } /** - * Build call for listCrossMarginAccountBook + * Build call for listMarginUserAccount * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listCrossMarginAccountBookCall(currency, from, to, page, limit, type, _callback); + return listMarginUserAccountCall(currencyPair, _callback); } /** - * Execute listCrossMarginAccountBook request - * @return List<CrossMarginAccountBook> + * Execute listMarginUserAccount request + * @return List<MarginAccount> * @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 List retrieved -
200 List retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listCrossMarginAccountBookWithHttpInfo(currency, from, to, page, limit, type); + public List execute() throws ApiException { + ApiResponse> localVarResp = listMarginUserAccountWithHttpInfo(currencyPair); return localVarResp.getData(); } /** - * Execute listCrossMarginAccountBook request with HTTP info returned - * @return ApiResponse<List<CrossMarginAccountBook>> + * Execute listMarginUserAccount request with HTTP info returned + * @return ApiResponse<List<MarginAccount>> * @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 List retrieved -
200 List retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listCrossMarginAccountBookWithHttpInfo(currency, from, to, page, limit, type); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMarginUserAccountWithHttpInfo(currencyPair); } /** - * Execute listCrossMarginAccountBook request (asynchronously) + * Execute listMarginUserAccount request (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 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listCrossMarginAccountBookAsync(currency, from, to, page, limit, type, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMarginUserAccountAsync(currencyPair, _callback); } } /** - * Retrieve cross margin account change history - * Record time range cannot exceed 30 days - * @return APIlistCrossMarginAccountBookRequest + * Query user's isolated margin account list + * Supports querying risk ratio isolated accounts and margin ratio isolated accounts + * @return APIlistMarginUserAccountRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public APIlistCrossMarginAccountBookRequest listCrossMarginAccountBook() { - return new APIlistCrossMarginAccountBookRequest(); + public APIlistMarginUserAccountRequest listMarginUserAccount() { + return new APIlistMarginUserAccountRequest(); } private okhttp3.Call listCrossMarginLoansCall(Integer status, String currency, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { @@ -3458,6 +1455,7 @@ private okhttp3.Call listCrossMarginLoansCall(Integer status, String currency, I return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call listCrossMarginLoansValidateBeforeCall(Integer status, String currency, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { // verify the required parameter 'status' is set @@ -3496,7 +1494,7 @@ private APIlistCrossMarginLoansRequest(Integer status) { /** * Set currency - * @param currency Filter by currency (optional) + * @param currency Query by specified currency, includes all currencies if not specified (optional) * @return APIlistCrossMarginLoansRequest */ public APIlistCrossMarginLoansRequest currency(String currency) { @@ -3506,7 +1504,7 @@ public APIlistCrossMarginLoansRequest currency(String currency) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistCrossMarginLoansRequest */ public APIlistCrossMarginLoansRequest limit(Integer limit) { @@ -3542,9 +1540,11 @@ public APIlistCrossMarginLoansRequest reverse(Boolean reverse) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
+ * @deprecated */ + @Deprecated public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return listCrossMarginLoansCall(status, currency, limit, offset, reverse, _callback); } @@ -3556,9 +1556,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
+ * @deprecated */ + @Deprecated public List execute() throws ApiException { ApiResponse> localVarResp = listCrossMarginLoansWithHttpInfo(status, currency, limit, offset, reverse); return localVarResp.getData(); @@ -3571,9 +1573,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
+ * @deprecated */ + @Deprecated public ApiResponse> executeWithHttpInfo() throws ApiException { return listCrossMarginLoansWithHttpInfo(status, currency, limit, offset, reverse); } @@ -3586,242 +1590,31 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
+ * @deprecated */ + @Deprecated public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listCrossMarginLoansAsync(status, currency, limit, offset, reverse, _callback); } - } - - /** - * List cross margin borrow history - * Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. - * @param status Filter by status. Supported values are 2 and 3. (required) - * @return APIlistCrossMarginLoansRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 Successfully retrieved -
- */ - public APIlistCrossMarginLoansRequest listCrossMarginLoans(Integer status) { - return new APIlistCrossMarginLoansRequest(status); - } - - /** - * Build call for createCrossMarginLoan - * @param crossMarginLoan (required) - * @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 borrowed -
- */ - public okhttp3.Call createCrossMarginLoanCall(CrossMarginLoan crossMarginLoan, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = crossMarginLoan; - - // create path and map variables - String localVarPath = "/margin/cross/loans"; - - 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 = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createCrossMarginLoanValidateBeforeCall(CrossMarginLoan crossMarginLoan, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'crossMarginLoan' is set - if (crossMarginLoan == null) { - throw new ApiException("Missing the required parameter 'crossMarginLoan' when calling createCrossMarginLoan(Async)"); - } - - okhttp3.Call localVarCall = createCrossMarginLoanCall(crossMarginLoan, _callback); - return localVarCall; - } - - /** - * Create a cross margin borrow loan - * Borrow amount cannot be less than currency minimum borrow amount - * @param crossMarginLoan (required) - * @return CrossMarginLoan - * @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 borrowed -
- */ - public CrossMarginLoan createCrossMarginLoan(CrossMarginLoan crossMarginLoan) throws ApiException { - ApiResponse localVarResp = createCrossMarginLoanWithHttpInfo(crossMarginLoan); - return localVarResp.getData(); - } - - /** - * Create a cross margin borrow loan - * Borrow amount cannot be less than currency minimum borrow amount - * @param crossMarginLoan (required) - * @return ApiResponse<CrossMarginLoan> - * @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 borrowed -
- */ - public ApiResponse createCrossMarginLoanWithHttpInfo(CrossMarginLoan crossMarginLoan) throws ApiException { - okhttp3.Call localVarCall = createCrossMarginLoanValidateBeforeCall(crossMarginLoan, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create a cross margin borrow loan (asynchronously) - * Borrow amount cannot be less than currency minimum borrow amount - * @param crossMarginLoan (required) - * @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 borrowed -
- */ - public okhttp3.Call createCrossMarginLoanAsync(CrossMarginLoan crossMarginLoan, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createCrossMarginLoanValidateBeforeCall(crossMarginLoan, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getCrossMarginLoan - * @param loanId Borrow loan ID (required) - * @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 getCrossMarginLoanCall(String loanId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/loans/{loan_id}" - .replaceAll("\\{" + "loan_id" + "\\}", localVarApiClient.escapeString(loanId)); - - 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 getCrossMarginLoanValidateBeforeCall(String loanId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'loanId' is set - if (loanId == null) { - throw new ApiException("Missing the required parameter 'loanId' when calling getCrossMarginLoan(Async)"); - } - - okhttp3.Call localVarCall = getCrossMarginLoanCall(loanId, _callback); - return localVarCall; - } - - /** - * Retrieve single borrow loan detail - * - * @param loanId Borrow loan ID (required) - * @return CrossMarginLoan - * @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 CrossMarginLoan getCrossMarginLoan(String loanId) throws ApiException { - ApiResponse localVarResp = getCrossMarginLoanWithHttpInfo(loanId); - return localVarResp.getData(); - } - - /** - * Retrieve single borrow loan detail - * - * @param loanId Borrow loan ID (required) - * @return ApiResponse<CrossMarginLoan> - * @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 getCrossMarginLoanWithHttpInfo(String loanId) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginLoanValidateBeforeCall(loanId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Retrieve single borrow loan detail (asynchronously) - * - * @param loanId Borrow loan ID (required) - * @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 + } + + /** + * Query cross margin borrow history (deprecated) + * Sorted by creation time in descending order by default. Set `reverse=false` for ascending order + * @param status Filter by status. Supported values are 2 and 3. (deprecated.) (required) + * @return APIlistCrossMarginLoansRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
+ * @deprecated */ - public okhttp3.Call getCrossMarginLoanAsync(String loanId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginLoanValidateBeforeCall(loanId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; + @Deprecated + public APIlistCrossMarginLoansRequest listCrossMarginLoans(Integer status) { + return new APIlistCrossMarginLoansRequest(status); } private okhttp3.Call listCrossMarginRepaymentsCall(String currency, String loanId, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { @@ -3873,6 +1666,7 @@ private okhttp3.Call listCrossMarginRepaymentsCall(String currency, String loanI return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call listCrossMarginRepaymentsValidateBeforeCall(String currency, String loanId, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listCrossMarginRepaymentsCall(currency, loanId, limit, offset, reverse, _callback); @@ -3925,7 +1719,7 @@ public APIlistCrossMarginRepaymentsRequest loanId(String loanId) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistCrossMarginRepaymentsRequest */ public APIlistCrossMarginRepaymentsRequest limit(Integer limit) { @@ -3961,9 +1755,11 @@ public APIlistCrossMarginRepaymentsRequest reverse(Boolean reverse) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
+ * @deprecated */ + @Deprecated public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return listCrossMarginRepaymentsCall(currency, loanId, limit, offset, reverse, _callback); } @@ -3975,9 +1771,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
+ * @deprecated */ + @Deprecated public List execute() throws ApiException { ApiResponse> localVarResp = listCrossMarginRepaymentsWithHttpInfo(currency, loanId, limit, offset, reverse); return localVarResp.getData(); @@ -3990,9 +1788,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
+ * @deprecated */ + @Deprecated public ApiResponse> executeWithHttpInfo() throws ApiException { return listCrossMarginRepaymentsWithHttpInfo(currency, loanId, limit, offset, reverse); } @@ -4005,355 +1805,30 @@ public ApiResponse> executeWithHttpInfo() throws ApiE * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
+ * @deprecated */ + @Deprecated public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listCrossMarginRepaymentsAsync(currency, loanId, limit, offset, reverse, _callback); } } /** - * Retrieve cross margin repayments - * Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. + * Retrieve cross margin repayments. (deprecated) + * Sorted by creation time in descending order by default. Set `reverse=false` for ascending order * @return APIlistCrossMarginRepaymentsRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
+ * @deprecated */ + @Deprecated public APIlistCrossMarginRepaymentsRequest listCrossMarginRepayments() { return new APIlistCrossMarginRepaymentsRequest(); } - /** - * Build call for repayCrossMarginLoan - * @param crossMarginRepayRequest (required) - * @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 Loan repaid -
- */ - public okhttp3.Call repayCrossMarginLoanCall(CrossMarginRepayRequest crossMarginRepayRequest, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = crossMarginRepayRequest; - - // create path and map variables - String localVarPath = "/margin/cross/repayments"; - - 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 = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call repayCrossMarginLoanValidateBeforeCall(CrossMarginRepayRequest crossMarginRepayRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'crossMarginRepayRequest' is set - if (crossMarginRepayRequest == null) { - throw new ApiException("Missing the required parameter 'crossMarginRepayRequest' when calling repayCrossMarginLoan(Async)"); - } - - okhttp3.Call localVarCall = repayCrossMarginLoanCall(crossMarginRepayRequest, _callback); - return localVarCall; - } - - /** - * Repay cross margin loan - * - * @param crossMarginRepayRequest (required) - * @return List<CrossMarginLoan> - * @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 Loan repaid -
- */ - public List repayCrossMarginLoan(CrossMarginRepayRequest crossMarginRepayRequest) throws ApiException { - ApiResponse> localVarResp = repayCrossMarginLoanWithHttpInfo(crossMarginRepayRequest); - return localVarResp.getData(); - } - - /** - * Repay cross margin loan - * - * @param crossMarginRepayRequest (required) - * @return ApiResponse<List<CrossMarginLoan>> - * @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 Loan repaid -
- */ - public ApiResponse> repayCrossMarginLoanWithHttpInfo(CrossMarginRepayRequest crossMarginRepayRequest) throws ApiException { - okhttp3.Call localVarCall = repayCrossMarginLoanValidateBeforeCall(crossMarginRepayRequest, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Repay cross margin loan (asynchronously) - * - * @param crossMarginRepayRequest (required) - * @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 Loan repaid -
- */ - public okhttp3.Call repayCrossMarginLoanAsync(CrossMarginRepayRequest crossMarginRepayRequest, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = repayCrossMarginLoanValidateBeforeCall(crossMarginRepayRequest, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getCrossMarginTransferable - * @param currency Retrieve data of the specified currency (required) - * @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 getCrossMarginTransferableCall(String currency, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/transferable"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - 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 getCrossMarginTransferableValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currency' is set - if (currency == null) { - throw new ApiException("Missing the required parameter 'currency' when calling getCrossMarginTransferable(Async)"); - } - - okhttp3.Call localVarCall = getCrossMarginTransferableCall(currency, _callback); - return localVarCall; - } - - /** - * Get the max transferable amount for a specific cross margin currency - * - * @param currency Retrieve data of the specified currency (required) - * @return CrossMarginTransferable - * @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 CrossMarginTransferable getCrossMarginTransferable(String currency) throws ApiException { - ApiResponse localVarResp = getCrossMarginTransferableWithHttpInfo(currency); - return localVarResp.getData(); - } - - /** - * Get the max transferable amount for a specific cross margin currency - * - * @param currency Retrieve data of the specified currency (required) - * @return ApiResponse<CrossMarginTransferable> - * @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 getCrossMarginTransferableWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginTransferableValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the max transferable amount for a specific cross margin currency (asynchronously) - * - * @param currency Retrieve data of the specified currency (required) - * @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 getCrossMarginTransferableAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginTransferableValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getCrossMarginBorrowable - * @param currency Retrieve data of the specified currency (required) - * @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 getCrossMarginBorrowableCall(String currency, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/borrowable"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - 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 getCrossMarginBorrowableValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currency' is set - if (currency == null) { - throw new ApiException("Missing the required parameter 'currency' when calling getCrossMarginBorrowable(Async)"); - } - - okhttp3.Call localVarCall = getCrossMarginBorrowableCall(currency, _callback); - return localVarCall; - } - - /** - * Get the max borrowable amount for a specific cross margin currency - * - * @param currency Retrieve data of the specified currency (required) - * @return CrossMarginBorrowable - * @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 CrossMarginBorrowable getCrossMarginBorrowable(String currency) throws ApiException { - ApiResponse localVarResp = getCrossMarginBorrowableWithHttpInfo(currency); - return localVarResp.getData(); - } - - /** - * Get the max borrowable amount for a specific cross margin currency - * - * @param currency Retrieve data of the specified currency (required) - * @return ApiResponse<CrossMarginBorrowable> - * @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 getCrossMarginBorrowableWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginBorrowableValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the max borrowable amount for a specific cross margin currency (asynchronously) - * - * @param currency Retrieve data of the specified currency (required) - * @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 getCrossMarginBorrowableAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginBorrowableValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - } diff --git a/src/main/java/io/gate/gateapi/api/MarginUniApi.java b/src/main/java/io/gate/gateapi/api/MarginUniApi.java new file mode 100644 index 0000000..67b72ae --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/MarginUniApi.java @@ -0,0 +1,1208 @@ +/* + * 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.CreateUniLoan; +import io.gate.gateapi.models.MaxUniBorrowable; +import io.gate.gateapi.models.UniCurrencyPair; +import io.gate.gateapi.models.UniLoan; +import io.gate.gateapi.models.UniLoanInterestRecord; +import io.gate.gateapi.models.UniLoanRecord; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MarginUniApi { + private ApiClient localVarApiClient; + + public MarginUniApi() { + this(Configuration.getDefaultApiClient()); + } + + public MarginUniApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for listUniCurrencyPairs + * @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 Query successful -
+ */ + public okhttp3.Call listUniCurrencyPairsCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/margin/uni/currency_pairs"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUniCurrencyPairsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniCurrencyPairsCall(_callback); + return localVarCall; + } + + /** + * List lending markets + * + * @return List<UniCurrencyPair> + * @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 Query successful -
+ */ + public List listUniCurrencyPairs() throws ApiException { + ApiResponse> localVarResp = listUniCurrencyPairsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List lending markets + * + * @return ApiResponse<List<UniCurrencyPair>> + * @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 Query successful -
+ */ + public ApiResponse> listUniCurrencyPairsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listUniCurrencyPairsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List lending markets (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 Query successful -
+ */ + public okhttp3.Call listUniCurrencyPairsAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniCurrencyPairsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUniCurrencyPair + * @param currencyPair Currency pair (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniCurrencyPairCall(String currencyPair, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/margin/uni/currency_pairs/{currency_pair}" + .replaceAll("\\{" + "currency_pair" + "\\}", localVarApiClient.escapeString(currencyPair)); + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUniCurrencyPairValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencyPair' is set + if (currencyPair == null) { + throw new ApiException("Missing the required parameter 'currencyPair' when calling getUniCurrencyPair(Async)"); + } + + okhttp3.Call localVarCall = getUniCurrencyPairCall(currencyPair, _callback); + return localVarCall; + } + + /** + * Get lending market details + * + * @param currencyPair Currency pair (required) + * @return UniCurrencyPair + * @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 Query successful -
+ */ + public UniCurrencyPair getUniCurrencyPair(String currencyPair) throws ApiException { + ApiResponse localVarResp = getUniCurrencyPairWithHttpInfo(currencyPair); + return localVarResp.getData(); + } + + /** + * Get lending market details + * + * @param currencyPair Currency pair (required) + * @return ApiResponse<UniCurrencyPair> + * @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 Query successful -
+ */ + public ApiResponse getUniCurrencyPairWithHttpInfo(String currencyPair) throws ApiException { + okhttp3.Call localVarCall = getUniCurrencyPairValidateBeforeCall(currencyPair, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get lending market details (asynchronously) + * + * @param currencyPair Currency pair (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniCurrencyPairAsync(String currencyPair, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUniCurrencyPairValidateBeforeCall(currencyPair, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getMarginUniEstimateRate + * @param currencies Array of currency names to query, maximum 10 (required) + * @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 Query successful -
+ */ + public okhttp3.Call getMarginUniEstimateRateCall(List currencies, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/margin/uni/estimate_rate"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencies != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "currencies", currencies)); + } + + 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 getMarginUniEstimateRateValidateBeforeCall(List currencies, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencies' is set + if (currencies == null) { + throw new ApiException("Missing the required parameter 'currencies' when calling getMarginUniEstimateRate(Async)"); + } + + okhttp3.Call localVarCall = getMarginUniEstimateRateCall(currencies, _callback); + return localVarCall; + } + + /** + * Estimate interest rate for isolated margin currencies + * Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided. + * @param currencies Array of currency names to query, maximum 10 (required) + * @return Map<String, String> + * @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 Query successful -
+ */ + public Map getMarginUniEstimateRate(List currencies) throws ApiException { + ApiResponse> localVarResp = getMarginUniEstimateRateWithHttpInfo(currencies); + return localVarResp.getData(); + } + + /** + * Estimate interest rate for isolated margin currencies + * Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided. + * @param currencies Array of currency names to query, maximum 10 (required) + * @return ApiResponse<Map<String, String>> + * @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 Query successful -
+ */ + public ApiResponse> getMarginUniEstimateRateWithHttpInfo(List currencies) throws ApiException { + okhttp3.Call localVarCall = getMarginUniEstimateRateValidateBeforeCall(currencies, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Estimate interest rate for isolated margin currencies (asynchronously) + * Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided. + * @param currencies Array of currency names to query, maximum 10 (required) + * @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 Query successful -
+ */ + public okhttp3.Call getMarginUniEstimateRateAsync(List currencies, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getMarginUniEstimateRateValidateBeforeCall(currencies, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listUniLoansCall(String currencyPair, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/margin/uni/loans"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 listUniLoansValidateBeforeCall(String currencyPair, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLoansCall(currencyPair, currency, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listUniLoansWithHttpInfo(String currencyPair, String currency, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listUniLoansValidateBeforeCall(currencyPair, currency, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUniLoansAsync(String currencyPair, String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLoansValidateBeforeCall(currencyPair, currency, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUniLoansRequest { + private String currencyPair; + private String currency; + private Integer page; + private Integer limit; + + private APIlistUniLoansRequest() { + } + + /** + * Set currencyPair + * @param currencyPair Currency pair (optional) + * @return APIlistUniLoansRequest + */ + public APIlistUniLoansRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; + return this; + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUniLoansRequest + */ + public APIlistUniLoansRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUniLoansRequest + */ + public APIlistUniLoansRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUniLoansRequest + */ + public APIlistUniLoansRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listUniLoans + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUniLoansCall(currencyPair, currency, page, limit, _callback); + } + + /** + * Execute listUniLoans request + * @return List<UniLoan> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUniLoansWithHttpInfo(currencyPair, currency, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listUniLoans request with HTTP info returned + * @return ApiResponse<List<UniLoan>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUniLoansWithHttpInfo(currencyPair, currency, page, limit); + } + + /** + * Execute listUniLoans request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUniLoansAsync(currencyPair, currency, page, limit, _callback); + } + } + + /** + * Query loans + * + * @return APIlistUniLoansRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUniLoansRequest listUniLoans() { + return new APIlistUniLoansRequest(); + } + + /** + * Build call for createUniLoan + * @param createUniLoan (required) + * @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
204 Operation successful -
+ */ + public okhttp3.Call createUniLoanCall(CreateUniLoan createUniLoan, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = createUniLoan; + + // create path and map variables + String localVarPath = "/margin/uni/loans"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUniLoanValidateBeforeCall(CreateUniLoan createUniLoan, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createUniLoan' is set + if (createUniLoan == null) { + throw new ApiException("Missing the required parameter 'createUniLoan' when calling createUniLoan(Async)"); + } + + okhttp3.Call localVarCall = createUniLoanCall(createUniLoan, _callback); + return localVarCall; + } + + /** + * Borrow or repay + * + * @param createUniLoan (required) + * @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
204 Operation successful -
+ */ + public void createUniLoan(CreateUniLoan createUniLoan) throws ApiException { + createUniLoanWithHttpInfo(createUniLoan); + } + + /** + * Borrow or repay + * + * @param createUniLoan (required) + * @return ApiResponse<Void> + * @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
204 Operation successful -
+ */ + public ApiResponse createUniLoanWithHttpInfo(CreateUniLoan createUniLoan) throws ApiException { + okhttp3.Call localVarCall = createUniLoanValidateBeforeCall(createUniLoan, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Borrow or repay (asynchronously) + * + * @param createUniLoan (required) + * @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
204 Operation successful -
+ */ + public okhttp3.Call createUniLoanAsync(CreateUniLoan createUniLoan, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createUniLoanValidateBeforeCall(createUniLoan, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + private okhttp3.Call listUniLoanRecordsCall(String type, String currency, String currencyPair, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/margin/uni/loan_records"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 listUniLoanRecordsValidateBeforeCall(String type, String currency, String currencyPair, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLoanRecordsCall(type, currency, currencyPair, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listUniLoanRecordsWithHttpInfo(String type, String currency, String currencyPair, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listUniLoanRecordsValidateBeforeCall(type, currency, currencyPair, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUniLoanRecordsAsync(String type, String currency, String currencyPair, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLoanRecordsValidateBeforeCall(type, currency, currencyPair, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUniLoanRecordsRequest { + private String type; + private String currency; + private String currencyPair; + private Integer page; + private Integer limit; + + private APIlistUniLoanRecordsRequest() { + } + + /** + * Set type + * @param type Type: `borrow` - borrow, `repay` - repay (optional) + * @return APIlistUniLoanRecordsRequest + */ + public APIlistUniLoanRecordsRequest type(String type) { + this.type = type; + return this; + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUniLoanRecordsRequest + */ + public APIlistUniLoanRecordsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set currencyPair + * @param currencyPair Currency pair (optional) + * @return APIlistUniLoanRecordsRequest + */ + public APIlistUniLoanRecordsRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUniLoanRecordsRequest + */ + public APIlistUniLoanRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUniLoanRecordsRequest + */ + public APIlistUniLoanRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listUniLoanRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUniLoanRecordsCall(type, currency, currencyPair, page, limit, _callback); + } + + /** + * Execute listUniLoanRecords request + * @return List<UniLoanRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUniLoanRecordsWithHttpInfo(type, currency, currencyPair, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listUniLoanRecords request with HTTP info returned + * @return ApiResponse<List<UniLoanRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUniLoanRecordsWithHttpInfo(type, currency, currencyPair, page, limit); + } + + /** + * Execute listUniLoanRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUniLoanRecordsAsync(type, currency, currencyPair, page, limit, _callback); + } + } + + /** + * Query loan records + * + * @return APIlistUniLoanRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUniLoanRecordsRequest listUniLoanRecords() { + return new APIlistUniLoanRecordsRequest(); + } + + private okhttp3.Call listUniLoanInterestRecordsCall(String currencyPair, String currency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/margin/uni/interest_records"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listUniLoanInterestRecordsValidateBeforeCall(String currencyPair, String currency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLoanInterestRecordsCall(currencyPair, currency, page, limit, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listUniLoanInterestRecordsWithHttpInfo(String currencyPair, String currency, Integer page, Integer limit, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listUniLoanInterestRecordsValidateBeforeCall(currencyPair, currency, page, limit, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUniLoanInterestRecordsAsync(String currencyPair, String currency, Integer page, Integer limit, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUniLoanInterestRecordsValidateBeforeCall(currencyPair, currency, page, limit, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUniLoanInterestRecordsRequest { + private String currencyPair; + private String currency; + private Integer page; + private Integer limit; + private Long from; + private Long to; + + private APIlistUniLoanInterestRecordsRequest() { + } + + /** + * Set currencyPair + * @param currencyPair Currency pair (optional) + * @return APIlistUniLoanInterestRecordsRequest + */ + public APIlistUniLoanInterestRecordsRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; + return this; + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUniLoanInterestRecordsRequest + */ + public APIlistUniLoanInterestRecordsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUniLoanInterestRecordsRequest + */ + public APIlistUniLoanInterestRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistUniLoanInterestRecordsRequest + */ + public APIlistUniLoanInterestRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistUniLoanInterestRecordsRequest + */ + public APIlistUniLoanInterestRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistUniLoanInterestRecordsRequest + */ + public APIlistUniLoanInterestRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listUniLoanInterestRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUniLoanInterestRecordsCall(currencyPair, currency, page, limit, from, to, _callback); + } + + /** + * Execute listUniLoanInterestRecords request + * @return List<UniLoanInterestRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUniLoanInterestRecordsWithHttpInfo(currencyPair, currency, page, limit, from, to); + return localVarResp.getData(); + } + + /** + * Execute listUniLoanInterestRecords request with HTTP info returned + * @return ApiResponse<List<UniLoanInterestRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUniLoanInterestRecordsWithHttpInfo(currencyPair, currency, page, limit, from, to); + } + + /** + * Execute listUniLoanInterestRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUniLoanInterestRecordsAsync(currencyPair, currency, page, limit, from, to, _callback); + } + } + + /** + * Query interest deduction records + * + * @return APIlistUniLoanInterestRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUniLoanInterestRecordsRequest listUniLoanInterestRecords() { + return new APIlistUniLoanInterestRecordsRequest(); + } + + /** + * Build call for getUniBorrowable + * @param currency Query by specified currency name (required) + * @param currencyPair Currency pair (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniBorrowableCall(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/margin/uni/borrowable"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + 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 getUniBorrowableValidateBeforeCall(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getUniBorrowable(Async)"); + } + + // verify the required parameter 'currencyPair' is set + if (currencyPair == null) { + throw new ApiException("Missing the required parameter 'currencyPair' when calling getUniBorrowable(Async)"); + } + + okhttp3.Call localVarCall = getUniBorrowableCall(currency, currencyPair, _callback); + return localVarCall; + } + + /** + * Query maximum borrowable amount by currency + * + * @param currency Query by specified currency name (required) + * @param currencyPair Currency pair (required) + * @return MaxUniBorrowable + * @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 Query successful -
+ */ + public MaxUniBorrowable getUniBorrowable(String currency, String currencyPair) throws ApiException { + ApiResponse localVarResp = getUniBorrowableWithHttpInfo(currency, currencyPair); + return localVarResp.getData(); + } + + /** + * Query maximum borrowable amount by currency + * + * @param currency Query by specified currency name (required) + * @param currencyPair Currency pair (required) + * @return ApiResponse<MaxUniBorrowable> + * @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 Query successful -
+ */ + public ApiResponse getUniBorrowableWithHttpInfo(String currency, String currencyPair) throws ApiException { + okhttp3.Call localVarCall = getUniBorrowableValidateBeforeCall(currency, currencyPair, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query maximum borrowable amount by currency (asynchronously) + * + * @param currency Query by specified currency name (required) + * @param currencyPair Currency pair (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUniBorrowableAsync(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUniBorrowableValidateBeforeCall(currency, currencyPair, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/MultiCollateralLoanApi.java b/src/main/java/io/gate/gateapi/api/MultiCollateralLoanApi.java new file mode 100644 index 0000000..0dee912 --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/MultiCollateralLoanApi.java @@ -0,0 +1,1671 @@ +/* + * 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.CollateralAdjust; +import io.gate.gateapi.models.CollateralAdjustRes; +import io.gate.gateapi.models.CollateralCurrentRate; +import io.gate.gateapi.models.CollateralFixRate; +import io.gate.gateapi.models.CollateralLtv; +import io.gate.gateapi.models.CreateMultiCollateralOrder; +import io.gate.gateapi.models.CurrencyQuota; +import io.gate.gateapi.models.MultiCollateralCurrency; +import io.gate.gateapi.models.MultiCollateralOrder; +import io.gate.gateapi.models.MultiCollateralRecord; +import io.gate.gateapi.models.MultiRepayRecord; +import io.gate.gateapi.models.MultiRepayResp; +import io.gate.gateapi.models.OrderResp; +import io.gate.gateapi.models.RepayMultiLoan; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MultiCollateralLoanApi { + private ApiClient localVarApiClient; + + public MultiCollateralLoanApi() { + this(Configuration.getDefaultApiClient()); + } + + public MultiCollateralLoanApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + private okhttp3.Call listMultiCollateralOrdersCall(Integer page, Integer limit, String sort, String orderType, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (orderType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_type", orderType)); + } + + 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 listMultiCollateralOrdersValidateBeforeCall(Integer page, Integer limit, String sort, String orderType, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralOrdersCall(page, limit, sort, orderType, _callback); + return localVarCall; + } + + + private ApiResponse> listMultiCollateralOrdersWithHttpInfo(Integer page, Integer limit, String sort, String orderType) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralOrdersValidateBeforeCall(page, limit, sort, orderType, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listMultiCollateralOrdersAsync(Integer page, Integer limit, String sort, String orderType, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralOrdersValidateBeforeCall(page, limit, sort, orderType, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistMultiCollateralOrdersRequest { + private Integer page; + private Integer limit; + private String sort; + private String orderType; + + private APIlistMultiCollateralOrdersRequest() { + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistMultiCollateralOrdersRequest + */ + public APIlistMultiCollateralOrdersRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 10) + * @return APIlistMultiCollateralOrdersRequest + */ + public APIlistMultiCollateralOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set sort + * @param sort Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending. (optional) + * @return APIlistMultiCollateralOrdersRequest + */ + public APIlistMultiCollateralOrdersRequest sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set orderType + * @param orderType Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders if not specified (optional) + * @return APIlistMultiCollateralOrdersRequest + */ + public APIlistMultiCollateralOrdersRequest orderType(String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Build call for listMultiCollateralOrders + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listMultiCollateralOrdersCall(page, limit, sort, orderType, _callback); + } + + /** + * Execute listMultiCollateralOrders request + * @return List<MultiCollateralOrder> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listMultiCollateralOrdersWithHttpInfo(page, limit, sort, orderType); + return localVarResp.getData(); + } + + /** + * Execute listMultiCollateralOrders request with HTTP info returned + * @return ApiResponse<List<MultiCollateralOrder>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMultiCollateralOrdersWithHttpInfo(page, limit, sort, orderType); + } + + /** + * Execute listMultiCollateralOrders request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMultiCollateralOrdersAsync(page, limit, sort, orderType, _callback); + } + } + + /** + * Query multi-currency collateral order list + * + * @return APIlistMultiCollateralOrdersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistMultiCollateralOrdersRequest listMultiCollateralOrders() { + return new APIlistMultiCollateralOrdersRequest(); + } + + /** + * Build call for createMultiCollateral + * @param createMultiCollateralOrder (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call createMultiCollateralCall(CreateMultiCollateralOrder createMultiCollateralOrder, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = createMultiCollateralOrder; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/orders"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createMultiCollateralValidateBeforeCall(CreateMultiCollateralOrder createMultiCollateralOrder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createMultiCollateralOrder' is set + if (createMultiCollateralOrder == null) { + throw new ApiException("Missing the required parameter 'createMultiCollateralOrder' when calling createMultiCollateral(Async)"); + } + + okhttp3.Call localVarCall = createMultiCollateralCall(createMultiCollateralOrder, _callback); + return localVarCall; + } + + /** + * Place multi-currency collateral order + * + * @param createMultiCollateralOrder (required) + * @return OrderResp + * @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 Order placed successfully -
+ */ + public OrderResp createMultiCollateral(CreateMultiCollateralOrder createMultiCollateralOrder) throws ApiException { + ApiResponse localVarResp = createMultiCollateralWithHttpInfo(createMultiCollateralOrder); + return localVarResp.getData(); + } + + /** + * Place multi-currency collateral order + * + * @param createMultiCollateralOrder (required) + * @return ApiResponse<OrderResp> + * @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 Order placed successfully -
+ */ + public ApiResponse createMultiCollateralWithHttpInfo(CreateMultiCollateralOrder createMultiCollateralOrder) throws ApiException { + okhttp3.Call localVarCall = createMultiCollateralValidateBeforeCall(createMultiCollateralOrder, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Place multi-currency collateral order (asynchronously) + * + * @param createMultiCollateralOrder (required) + * @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 Order placed successfully -
+ */ + public okhttp3.Call createMultiCollateralAsync(CreateMultiCollateralOrder createMultiCollateralOrder, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createMultiCollateralValidateBeforeCall(createMultiCollateralOrder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getMultiCollateralOrderDetail + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order details queried successfully -
+ */ + public okhttp3.Call getMultiCollateralOrderDetailCall(String orderId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + + 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 getMultiCollateralOrderDetailValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling getMultiCollateralOrderDetail(Async)"); + } + + okhttp3.Call localVarCall = getMultiCollateralOrderDetailCall(orderId, _callback); + return localVarCall; + } + + /** + * Query order details + * + * @param orderId Order ID returned when order is successfully created (required) + * @return MultiCollateralOrder + * @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 Order details queried successfully -
+ */ + public MultiCollateralOrder getMultiCollateralOrderDetail(String orderId) throws ApiException { + ApiResponse localVarResp = getMultiCollateralOrderDetailWithHttpInfo(orderId); + return localVarResp.getData(); + } + + /** + * Query order details + * + * @param orderId Order ID returned when order is successfully created (required) + * @return ApiResponse<MultiCollateralOrder> + * @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 Order details queried successfully -
+ */ + public ApiResponse getMultiCollateralOrderDetailWithHttpInfo(String orderId) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralOrderDetailValidateBeforeCall(orderId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query order details (asynchronously) + * + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order details queried successfully -
+ */ + public okhttp3.Call getMultiCollateralOrderDetailAsync(String orderId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralOrderDetailValidateBeforeCall(orderId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listMultiRepayRecordsCall(String type, String borrowCurrency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/repay"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (borrowCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("borrow_currency", borrowCurrency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listMultiRepayRecordsValidateBeforeCall(String type, String borrowCurrency, Integer page, Integer limit, Long from, Long to, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling listMultiRepayRecords(Async)"); + } + + okhttp3.Call localVarCall = listMultiRepayRecordsCall(type, borrowCurrency, page, limit, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listMultiRepayRecordsWithHttpInfo(String type, String borrowCurrency, Integer page, Integer limit, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listMultiRepayRecordsValidateBeforeCall(type, borrowCurrency, page, limit, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listMultiRepayRecordsAsync(String type, String borrowCurrency, Integer page, Integer limit, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMultiRepayRecordsValidateBeforeCall(type, borrowCurrency, page, limit, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistMultiRepayRecordsRequest { + private final String type; + private String borrowCurrency; + private Integer page; + private Integer limit; + private Long from; + private Long to; + + private APIlistMultiRepayRecordsRequest(String type) { + this.type = type; + } + + /** + * Set borrowCurrency + * @param borrowCurrency Borrowed currency (optional) + * @return APIlistMultiRepayRecordsRequest + */ + public APIlistMultiRepayRecordsRequest borrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistMultiRepayRecordsRequest + */ + public APIlistMultiRepayRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 10) + * @return APIlistMultiRepayRecordsRequest + */ + public APIlistMultiRepayRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistMultiRepayRecordsRequest + */ + public APIlistMultiRepayRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistMultiRepayRecordsRequest + */ + public APIlistMultiRepayRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listMultiRepayRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listMultiRepayRecordsCall(type, borrowCurrency, page, limit, from, to, _callback); + } + + /** + * Execute listMultiRepayRecords request + * @return List<MultiRepayRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listMultiRepayRecordsWithHttpInfo(type, borrowCurrency, page, limit, from, to); + return localVarResp.getData(); + } + + /** + * Execute listMultiRepayRecords request with HTTP info returned + * @return ApiResponse<List<MultiRepayRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMultiRepayRecordsWithHttpInfo(type, borrowCurrency, page, limit, from, to); + } + + /** + * Execute listMultiRepayRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMultiRepayRecordsAsync(type, borrowCurrency, page, limit, from, to, _callback); + } + } + + /** + * Query multi-currency collateral repayment records + * + * @param type Operation type: repay - Regular repayment, liquidate - Liquidation (required) + * @return APIlistMultiRepayRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistMultiRepayRecordsRequest listMultiRepayRecords(String type) { + return new APIlistMultiRepayRecordsRequest(type); + } + + /** + * Build call for repayMultiCollateralLoan + * @param repayMultiLoan (required) + * @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 Operation successful -
+ */ + public okhttp3.Call repayMultiCollateralLoanCall(RepayMultiLoan repayMultiLoan, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = repayMultiLoan; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/repay"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call repayMultiCollateralLoanValidateBeforeCall(RepayMultiLoan repayMultiLoan, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'repayMultiLoan' is set + if (repayMultiLoan == null) { + throw new ApiException("Missing the required parameter 'repayMultiLoan' when calling repayMultiCollateralLoan(Async)"); + } + + okhttp3.Call localVarCall = repayMultiCollateralLoanCall(repayMultiLoan, _callback); + return localVarCall; + } + + /** + * Multi-currency collateral repayment + * + * @param repayMultiLoan (required) + * @return MultiRepayResp + * @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 Operation successful -
+ */ + public MultiRepayResp repayMultiCollateralLoan(RepayMultiLoan repayMultiLoan) throws ApiException { + ApiResponse localVarResp = repayMultiCollateralLoanWithHttpInfo(repayMultiLoan); + return localVarResp.getData(); + } + + /** + * Multi-currency collateral repayment + * + * @param repayMultiLoan (required) + * @return ApiResponse<MultiRepayResp> + * @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 Operation successful -
+ */ + public ApiResponse repayMultiCollateralLoanWithHttpInfo(RepayMultiLoan repayMultiLoan) throws ApiException { + okhttp3.Call localVarCall = repayMultiCollateralLoanValidateBeforeCall(repayMultiLoan, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Multi-currency collateral repayment (asynchronously) + * + * @param repayMultiLoan (required) + * @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 Operation successful -
+ */ + public okhttp3.Call repayMultiCollateralLoanAsync(RepayMultiLoan repayMultiLoan, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = repayMultiCollateralLoanValidateBeforeCall(repayMultiLoan, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listMultiCollateralRecordsCall(Integer page, Integer limit, Long from, Long to, String collateralCurrency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/mortgage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (collateralCurrency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("collateral_currency", collateralCurrency)); + } + + 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 listMultiCollateralRecordsValidateBeforeCall(Integer page, Integer limit, Long from, Long to, String collateralCurrency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralRecordsCall(page, limit, from, to, collateralCurrency, _callback); + return localVarCall; + } + + + private ApiResponse> listMultiCollateralRecordsWithHttpInfo(Integer page, Integer limit, Long from, Long to, String collateralCurrency) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralRecordsValidateBeforeCall(page, limit, from, to, collateralCurrency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listMultiCollateralRecordsAsync(Integer page, Integer limit, Long from, Long to, String collateralCurrency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralRecordsValidateBeforeCall(page, limit, from, to, collateralCurrency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistMultiCollateralRecordsRequest { + private Integer page; + private Integer limit; + private Long from; + private Long to; + private String collateralCurrency; + + private APIlistMultiCollateralRecordsRequest() { + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistMultiCollateralRecordsRequest + */ + public APIlistMultiCollateralRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 10) + * @return APIlistMultiCollateralRecordsRequest + */ + public APIlistMultiCollateralRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistMultiCollateralRecordsRequest + */ + public APIlistMultiCollateralRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistMultiCollateralRecordsRequest + */ + public APIlistMultiCollateralRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set collateralCurrency + * @param collateralCurrency Collateral currency (optional) + * @return APIlistMultiCollateralRecordsRequest + */ + public APIlistMultiCollateralRecordsRequest collateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Build call for listMultiCollateralRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listMultiCollateralRecordsCall(page, limit, from, to, collateralCurrency, _callback); + } + + /** + * Execute listMultiCollateralRecords request + * @return List<MultiCollateralRecord> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listMultiCollateralRecordsWithHttpInfo(page, limit, from, to, collateralCurrency); + return localVarResp.getData(); + } + + /** + * Execute listMultiCollateralRecords request with HTTP info returned + * @return ApiResponse<List<MultiCollateralRecord>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMultiCollateralRecordsWithHttpInfo(page, limit, from, to, collateralCurrency); + } + + /** + * Execute listMultiCollateralRecords request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMultiCollateralRecordsAsync(page, limit, from, to, collateralCurrency, _callback); + } + } + + /** + * Query collateral adjustment records + * + * @return APIlistMultiCollateralRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistMultiCollateralRecordsRequest listMultiCollateralRecords() { + return new APIlistMultiCollateralRecordsRequest(); + } + + /** + * Build call for operateMultiCollateral + * @param collateralAdjust (required) + * @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 Operation successful -
+ */ + public okhttp3.Call operateMultiCollateralCall(CollateralAdjust collateralAdjust, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = collateralAdjust; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/mortgage"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call operateMultiCollateralValidateBeforeCall(CollateralAdjust collateralAdjust, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'collateralAdjust' is set + if (collateralAdjust == null) { + throw new ApiException("Missing the required parameter 'collateralAdjust' when calling operateMultiCollateral(Async)"); + } + + okhttp3.Call localVarCall = operateMultiCollateralCall(collateralAdjust, _callback); + return localVarCall; + } + + /** + * Add or withdraw collateral + * + * @param collateralAdjust (required) + * @return CollateralAdjustRes + * @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 Operation successful -
+ */ + public CollateralAdjustRes operateMultiCollateral(CollateralAdjust collateralAdjust) throws ApiException { + ApiResponse localVarResp = operateMultiCollateralWithHttpInfo(collateralAdjust); + return localVarResp.getData(); + } + + /** + * Add or withdraw collateral + * + * @param collateralAdjust (required) + * @return ApiResponse<CollateralAdjustRes> + * @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 Operation successful -
+ */ + public ApiResponse operateMultiCollateralWithHttpInfo(CollateralAdjust collateralAdjust) throws ApiException { + okhttp3.Call localVarCall = operateMultiCollateralValidateBeforeCall(collateralAdjust, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add or withdraw collateral (asynchronously) + * + * @param collateralAdjust (required) + * @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 Operation successful -
+ */ + public okhttp3.Call operateMultiCollateralAsync(CollateralAdjust collateralAdjust, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = operateMultiCollateralValidateBeforeCall(collateralAdjust, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listUserCurrencyQuota + * @param type Currency type: collateral - Collateral currency, borrow - Borrowing currency (required) + * @param currency 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. (required) + * @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 Query successful -
+ */ + public okhttp3.Call listUserCurrencyQuotaCall(String type, String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/currency_quota"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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 listUserCurrencyQuotaValidateBeforeCall(String type, String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling listUserCurrencyQuota(Async)"); + } + + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling listUserCurrencyQuota(Async)"); + } + + okhttp3.Call localVarCall = listUserCurrencyQuotaCall(type, currency, _callback); + return localVarCall; + } + + /** + * Query user's collateral and borrowing currency quota information + * + * @param type Currency type: collateral - Collateral currency, borrow - Borrowing currency (required) + * @param currency 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. (required) + * @return List<CurrencyQuota> + * @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 Query successful -
+ */ + public List listUserCurrencyQuota(String type, String currency) throws ApiException { + ApiResponse> localVarResp = listUserCurrencyQuotaWithHttpInfo(type, currency); + return localVarResp.getData(); + } + + /** + * Query user's collateral and borrowing currency quota information + * + * @param type Currency type: collateral - Collateral currency, borrow - Borrowing currency (required) + * @param currency 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. (required) + * @return ApiResponse<List<CurrencyQuota>> + * @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 Query successful -
+ */ + public ApiResponse> listUserCurrencyQuotaWithHttpInfo(String type, String currency) throws ApiException { + okhttp3.Call localVarCall = listUserCurrencyQuotaValidateBeforeCall(type, currency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query user's collateral and borrowing currency quota information (asynchronously) + * + * @param type Currency type: collateral - Collateral currency, borrow - Borrowing currency (required) + * @param currency 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. (required) + * @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 Query successful -
+ */ + public okhttp3.Call listUserCurrencyQuotaAsync(String type, String currency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUserCurrencyQuotaValidateBeforeCall(type, currency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listMultiCollateralCurrencies + * @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 Query successful -
+ */ + public okhttp3.Call listMultiCollateralCurrenciesCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/currencies"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listMultiCollateralCurrenciesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralCurrenciesCall(_callback); + return localVarCall; + } + + /** + * Query supported borrowing and collateral currencies for multi-currency collateral + * + * @return MultiCollateralCurrency + * @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 Query successful -
+ */ + public MultiCollateralCurrency listMultiCollateralCurrencies() throws ApiException { + ApiResponse localVarResp = listMultiCollateralCurrenciesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query supported borrowing and collateral currencies for multi-currency collateral + * + * @return ApiResponse<MultiCollateralCurrency> + * @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 Query successful -
+ */ + public ApiResponse listMultiCollateralCurrenciesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralCurrenciesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query supported borrowing and collateral currencies for multi-currency collateral (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 Query successful -
+ */ + public okhttp3.Call listMultiCollateralCurrenciesAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMultiCollateralCurrenciesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getMultiCollateralLtv + * @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 Query successful -
+ */ + public okhttp3.Call getMultiCollateralLtvCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/ltv"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMultiCollateralLtvValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralLtvCall(_callback); + return localVarCall; + } + + /** + * Query collateralization ratio information + * Multi-currency collateral ratio is fixed, independent of currency + * @return CollateralLtv + * @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 Query successful -
+ */ + public CollateralLtv getMultiCollateralLtv() throws ApiException { + ApiResponse localVarResp = getMultiCollateralLtvWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query collateralization ratio information + * Multi-currency collateral ratio is fixed, independent of currency + * @return ApiResponse<CollateralLtv> + * @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 Query successful -
+ */ + public ApiResponse getMultiCollateralLtvWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralLtvValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query collateralization ratio information (asynchronously) + * Multi-currency collateral ratio is fixed, independent of currency + * @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 Query successful -
+ */ + public okhttp3.Call getMultiCollateralLtvAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralLtvValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getMultiCollateralFixRate + * @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 Query successful -
+ */ + public okhttp3.Call getMultiCollateralFixRateCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/fixed_rate"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMultiCollateralFixRateValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralFixRateCall(_callback); + return localVarCall; + } + + /** + * Query currency's 7-day and 30-day fixed interest rates + * + * @return List<CollateralFixRate> + * @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 Query successful -
+ */ + public List getMultiCollateralFixRate() throws ApiException { + ApiResponse> localVarResp = getMultiCollateralFixRateWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query currency's 7-day and 30-day fixed interest rates + * + * @return ApiResponse<List<CollateralFixRate>> + * @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 Query successful -
+ */ + public ApiResponse> getMultiCollateralFixRateWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralFixRateValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query currency's 7-day and 30-day fixed interest rates (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 Query successful -
+ */ + public okhttp3.Call getMultiCollateralFixRateAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralFixRateValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call getMultiCollateralCurrentRateCall(List currencies, String vipLevel, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/loan/multi_collateral/current_rate"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencies != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "currencies", currencies)); + } + + if (vipLevel != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vip_level", vipLevel)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMultiCollateralCurrentRateValidateBeforeCall(List currencies, String vipLevel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencies' is set + if (currencies == null) { + throw new ApiException("Missing the required parameter 'currencies' when calling getMultiCollateralCurrentRate(Async)"); + } + + okhttp3.Call localVarCall = getMultiCollateralCurrentRateCall(currencies, vipLevel, _callback); + return localVarCall; + } + + + private ApiResponse> getMultiCollateralCurrentRateWithHttpInfo(List currencies, String vipLevel) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralCurrentRateValidateBeforeCall(currencies, vipLevel, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getMultiCollateralCurrentRateAsync(List currencies, String vipLevel, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getMultiCollateralCurrentRateValidateBeforeCall(currencies, vipLevel, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetMultiCollateralCurrentRateRequest { + private final List currencies; + private String vipLevel; + + private APIgetMultiCollateralCurrentRateRequest(List currencies) { + this.currencies = currencies; + } + + /** + * Set vipLevel + * @param vipLevel VIP level, defaults to 0 if not specified (optional, default to "0") + * @return APIgetMultiCollateralCurrentRateRequest + */ + public APIgetMultiCollateralCurrentRateRequest vipLevel(String vipLevel) { + this.vipLevel = vipLevel; + return this; + } + + /** + * Build call for getMultiCollateralCurrentRate + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getMultiCollateralCurrentRateCall(currencies, vipLevel, _callback); + } + + /** + * Execute getMultiCollateralCurrentRate request + * @return List<CollateralCurrentRate> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getMultiCollateralCurrentRateWithHttpInfo(currencies, vipLevel); + return localVarResp.getData(); + } + + /** + * Execute getMultiCollateralCurrentRate request with HTTP info returned + * @return ApiResponse<List<CollateralCurrentRate>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getMultiCollateralCurrentRateWithHttpInfo(currencies, vipLevel); + } + + /** + * Execute getMultiCollateralCurrentRate request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getMultiCollateralCurrentRateAsync(currencies, vipLevel, _callback); + } + } + + /** + * Query currency's current interest rate + * Query currency's current interest rate for the previous hour, current interest rate updates hourly + * @param currencies Specify currency name query array, separated by commas, maximum 100 items (required) + * @return APIgetMultiCollateralCurrentRateRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIgetMultiCollateralCurrentRateRequest getMultiCollateralCurrentRate(List currencies) { + return new APIgetMultiCollateralCurrentRateRequest(currencies); + } + +} diff --git a/src/main/java/io/gate/gateapi/api/OptionsApi.java b/src/main/java/io/gate/gateapi/api/OptionsApi.java new file mode 100644 index 0000000..538f7f5 --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/OptionsApi.java @@ -0,0 +1,4173 @@ +/* + * 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.CountdownCancelAllOptionsTask; +import io.gate.gateapi.models.FuturesCandlestick; +import io.gate.gateapi.models.FuturesOrderBook; +import io.gate.gateapi.models.FuturesTrade; +import io.gate.gateapi.models.OptionsAccount; +import io.gate.gateapi.models.OptionsAccountBook; +import io.gate.gateapi.models.OptionsCandlestick; +import io.gate.gateapi.models.OptionsContract; +import io.gate.gateapi.models.OptionsMMP; +import io.gate.gateapi.models.OptionsMMPReset; +import io.gate.gateapi.models.OptionsMySettlements; +import io.gate.gateapi.models.OptionsMyTrade; +import io.gate.gateapi.models.OptionsOrder; +import io.gate.gateapi.models.OptionsPosition; +import io.gate.gateapi.models.OptionsPositionClose; +import io.gate.gateapi.models.OptionsSettlement; +import io.gate.gateapi.models.OptionsTicker; +import io.gate.gateapi.models.OptionsUnderlying; +import io.gate.gateapi.models.OptionsUnderlyingTicker; +import io.gate.gateapi.models.TriggerTime; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OptionsApi { + private ApiClient localVarApiClient; + + public OptionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OptionsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for listOptionsUnderlyings + * @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 List retrieved successfully -
+ */ + public okhttp3.Call listOptionsUnderlyingsCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/underlyings"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsUnderlyingsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsUnderlyingsCall(_callback); + return localVarCall; + } + + /** + * List all underlying assets + * + * @return List<OptionsUnderlying> + * @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 List retrieved successfully -
+ */ + public List listOptionsUnderlyings() throws ApiException { + ApiResponse> localVarResp = listOptionsUnderlyingsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List all underlying assets + * + * @return ApiResponse<List<OptionsUnderlying>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> listOptionsUnderlyingsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listOptionsUnderlyingsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List all underlying assets (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 List retrieved successfully -
+ */ + public okhttp3.Call listOptionsUnderlyingsAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsUnderlyingsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listOptionsExpirations + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @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 List expiration dates for specified underlying -
+ */ + public okhttp3.Call listOptionsExpirationsCall(String underlying, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/expirations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsExpirationsValidateBeforeCall(String underlying, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listOptionsExpirations(Async)"); + } + + okhttp3.Call localVarCall = listOptionsExpirationsCall(underlying, _callback); + return localVarCall; + } + + /** + * List all expiration dates + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return List<Long> + * @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 List expiration dates for specified underlying -
+ */ + public List listOptionsExpirations(String underlying) throws ApiException { + ApiResponse> localVarResp = listOptionsExpirationsWithHttpInfo(underlying); + return localVarResp.getData(); + } + + /** + * List all expiration dates + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return ApiResponse<List<Long>> + * @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 List expiration dates for specified underlying -
+ */ + public ApiResponse> listOptionsExpirationsWithHttpInfo(String underlying) throws ApiException { + okhttp3.Call localVarCall = listOptionsExpirationsValidateBeforeCall(underlying, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List all expiration dates (asynchronously) + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @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 List expiration dates for specified underlying -
+ */ + public okhttp3.Call listOptionsExpirationsAsync(String underlying, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsExpirationsValidateBeforeCall(underlying, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listOptionsContractsCall(String underlying, Long expiration, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/contracts"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (expiration != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiration", expiration)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsContractsValidateBeforeCall(String underlying, Long expiration, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listOptionsContracts(Async)"); + } + + okhttp3.Call localVarCall = listOptionsContractsCall(underlying, expiration, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsContractsWithHttpInfo(String underlying, Long expiration) throws ApiException { + okhttp3.Call localVarCall = listOptionsContractsValidateBeforeCall(underlying, expiration, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsContractsAsync(String underlying, Long expiration, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsContractsValidateBeforeCall(underlying, expiration, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsContractsRequest { + private final String underlying; + private Long expiration; + + private APIlistOptionsContractsRequest(String underlying) { + this.underlying = underlying; + } + + /** + * Set expiration + * @param expiration Unix timestamp of expiration date (optional) + * @return APIlistOptionsContractsRequest + */ + public APIlistOptionsContractsRequest expiration(Long expiration) { + this.expiration = expiration; + return this; + } + + /** + * Build call for listOptionsContracts + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsContractsCall(underlying, expiration, _callback); + } + + /** + * Execute listOptionsContracts request + * @return List<OptionsContract> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsContractsWithHttpInfo(underlying, expiration); + return localVarResp.getData(); + } + + /** + * Execute listOptionsContracts request with HTTP info returned + * @return ApiResponse<List<OptionsContract>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsContractsWithHttpInfo(underlying, expiration); + } + + /** + * Execute listOptionsContracts request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsContractsAsync(underlying, expiration, _callback); + } + } + + /** + * List all contracts for specified underlying and expiration date + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return APIlistOptionsContractsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistOptionsContractsRequest listOptionsContracts(String underlying) { + return new APIlistOptionsContractsRequest(underlying); + } + + /** + * Build call for getOptionsContract + * @param contract (required) + * @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 Query successful -
+ */ + public okhttp3.Call getOptionsContractCall(String contract, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/contracts/{contract}" + .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOptionsContractValidateBeforeCall(String contract, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling getOptionsContract(Async)"); + } + + okhttp3.Call localVarCall = getOptionsContractCall(contract, _callback); + return localVarCall; + } + + /** + * Query specified contract details + * + * @param contract (required) + * @return OptionsContract + * @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 Query successful -
+ */ + public OptionsContract getOptionsContract(String contract) throws ApiException { + ApiResponse localVarResp = getOptionsContractWithHttpInfo(contract); + return localVarResp.getData(); + } + + /** + * Query specified contract details + * + * @param contract (required) + * @return ApiResponse<OptionsContract> + * @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 Query successful -
+ */ + public ApiResponse getOptionsContractWithHttpInfo(String contract) throws ApiException { + okhttp3.Call localVarCall = getOptionsContractValidateBeforeCall(contract, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query specified contract details (asynchronously) + * + * @param contract (required) + * @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 Query successful -
+ */ + public okhttp3.Call getOptionsContractAsync(String contract, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getOptionsContractValidateBeforeCall(contract, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listOptionsSettlementsCall(String underlying, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/settlements"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsSettlementsValidateBeforeCall(String underlying, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listOptionsSettlements(Async)"); + } + + okhttp3.Call localVarCall = listOptionsSettlementsCall(underlying, limit, offset, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsSettlementsWithHttpInfo(String underlying, Integer limit, Integer offset, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listOptionsSettlementsValidateBeforeCall(underlying, limit, offset, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsSettlementsAsync(String underlying, Integer limit, Integer offset, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsSettlementsValidateBeforeCall(underlying, limit, offset, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsSettlementsRequest { + private final String underlying; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + + private APIlistOptionsSettlementsRequest(String underlying) { + this.underlying = underlying; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistOptionsSettlementsRequest + */ + public APIlistOptionsSettlementsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistOptionsSettlementsRequest + */ + public APIlistOptionsSettlementsRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistOptionsSettlementsRequest + */ + public APIlistOptionsSettlementsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistOptionsSettlementsRequest + */ + public APIlistOptionsSettlementsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listOptionsSettlements + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsSettlementsCall(underlying, limit, offset, from, to, _callback); + } + + /** + * Execute listOptionsSettlements request + * @return List<OptionsSettlement> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsSettlementsWithHttpInfo(underlying, limit, offset, from, to); + return localVarResp.getData(); + } + + /** + * Execute listOptionsSettlements request with HTTP info returned + * @return ApiResponse<List<OptionsSettlement>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsSettlementsWithHttpInfo(underlying, limit, offset, from, to); + } + + /** + * Execute listOptionsSettlements request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsSettlementsAsync(underlying, limit, offset, from, to, _callback); + } + } + + /** + * List settlement history + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return APIlistOptionsSettlementsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistOptionsSettlementsRequest listOptionsSettlements(String underlying) { + return new APIlistOptionsSettlementsRequest(underlying); + } + + /** + * Build call for getOptionsSettlement + * @param contract (required) + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param at (required) + * @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 Query successful -
+ */ + public okhttp3.Call getOptionsSettlementCall(String contract, String underlying, Long at, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/settlements/{contract}" + .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (at != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("at", at)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOptionsSettlementValidateBeforeCall(String contract, String underlying, Long at, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling getOptionsSettlement(Async)"); + } + + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling getOptionsSettlement(Async)"); + } + + // verify the required parameter 'at' is set + if (at == null) { + throw new ApiException("Missing the required parameter 'at' when calling getOptionsSettlement(Async)"); + } + + okhttp3.Call localVarCall = getOptionsSettlementCall(contract, underlying, at, _callback); + return localVarCall; + } + + /** + * Get specified contract settlement information + * + * @param contract (required) + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param at (required) + * @return OptionsSettlement + * @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 Query successful -
+ */ + public OptionsSettlement getOptionsSettlement(String contract, String underlying, Long at) throws ApiException { + ApiResponse localVarResp = getOptionsSettlementWithHttpInfo(contract, underlying, at); + return localVarResp.getData(); + } + + /** + * Get specified contract settlement information + * + * @param contract (required) + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param at (required) + * @return ApiResponse<OptionsSettlement> + * @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 Query successful -
+ */ + public ApiResponse getOptionsSettlementWithHttpInfo(String contract, String underlying, Long at) throws ApiException { + okhttp3.Call localVarCall = getOptionsSettlementValidateBeforeCall(contract, underlying, at, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get specified contract settlement information (asynchronously) + * + * @param contract (required) + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param at (required) + * @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 Query successful -
+ */ + public okhttp3.Call getOptionsSettlementAsync(String contract, String underlying, Long at, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getOptionsSettlementValidateBeforeCall(contract, underlying, at, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listMyOptionsSettlementsCall(String underlying, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/my_settlements"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listMyOptionsSettlementsValidateBeforeCall(String underlying, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listMyOptionsSettlements(Async)"); + } + + okhttp3.Call localVarCall = listMyOptionsSettlementsCall(underlying, contract, limit, offset, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listMyOptionsSettlementsWithHttpInfo(String underlying, String contract, Integer limit, Integer offset, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listMyOptionsSettlementsValidateBeforeCall(underlying, contract, limit, offset, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listMyOptionsSettlementsAsync(String underlying, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMyOptionsSettlementsValidateBeforeCall(underlying, contract, limit, offset, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistMyOptionsSettlementsRequest { + private final String underlying; + private String contract; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + + private APIlistMyOptionsSettlementsRequest(String underlying) { + this.underlying = underlying; + } + + /** + * Set contract + * @param contract Options contract name (optional) + * @return APIlistMyOptionsSettlementsRequest + */ + public APIlistMyOptionsSettlementsRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistMyOptionsSettlementsRequest + */ + public APIlistMyOptionsSettlementsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistMyOptionsSettlementsRequest + */ + public APIlistMyOptionsSettlementsRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistMyOptionsSettlementsRequest + */ + public APIlistMyOptionsSettlementsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistMyOptionsSettlementsRequest + */ + public APIlistMyOptionsSettlementsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listMyOptionsSettlements + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listMyOptionsSettlementsCall(underlying, contract, limit, offset, from, to, _callback); + } + + /** + * Execute listMyOptionsSettlements request + * @return List<OptionsMySettlements> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listMyOptionsSettlementsWithHttpInfo(underlying, contract, limit, offset, from, to); + return localVarResp.getData(); + } + + /** + * Execute listMyOptionsSettlements request with HTTP info returned + * @return ApiResponse<List<OptionsMySettlements>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMyOptionsSettlementsWithHttpInfo(underlying, contract, limit, offset, from, to); + } + + /** + * Execute listMyOptionsSettlements request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMyOptionsSettlementsAsync(underlying, contract, limit, offset, from, to, _callback); + } + } + + /** + * Query personal settlement records + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return APIlistMyOptionsSettlementsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistMyOptionsSettlementsRequest listMyOptionsSettlements(String underlying) { + return new APIlistMyOptionsSettlementsRequest(underlying); + } + + private okhttp3.Call listOptionsOrderBookCall(String contract, String interval, Integer limit, Boolean withId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/order_book"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (interval != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("interval", interval)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (withId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("with_id", withId)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsOrderBookValidateBeforeCall(String contract, String interval, Integer limit, Boolean withId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling listOptionsOrderBook(Async)"); + } + + okhttp3.Call localVarCall = listOptionsOrderBookCall(contract, interval, limit, withId, _callback); + return localVarCall; + } + + + private ApiResponse listOptionsOrderBookWithHttpInfo(String contract, String interval, Integer limit, Boolean withId) throws ApiException { + okhttp3.Call localVarCall = listOptionsOrderBookValidateBeforeCall(contract, interval, limit, withId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsOrderBookAsync(String contract, String interval, Integer limit, Boolean withId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsOrderBookValidateBeforeCall(contract, interval, limit, withId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsOrderBookRequest { + private final String contract; + private String interval; + private Integer limit; + private Boolean withId; + + private APIlistOptionsOrderBookRequest(String contract) { + this.contract = contract; + } + + /** + * Set interval + * @param interval Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional, default to 0) + * @return APIlistOptionsOrderBookRequest + */ + public APIlistOptionsOrderBookRequest interval(String interval) { + this.interval = interval; + return this; + } + + /** + * Set limit + * @param limit Number of depth levels (optional, default to 10) + * @return APIlistOptionsOrderBookRequest + */ + public APIlistOptionsOrderBookRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set withId + * @param withId Whether to return depth update ID. This ID increments by 1 each time depth changes (optional, default to false) + * @return APIlistOptionsOrderBookRequest + */ + public APIlistOptionsOrderBookRequest withId(Boolean withId) { + this.withId = withId; + return this; + } + + /** + * Build call for listOptionsOrderBook + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Depth query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsOrderBookCall(contract, interval, limit, withId, _callback); + } + + /** + * Execute listOptionsOrderBook request + * @return FuturesOrderBook + * @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 Depth query successful -
+ */ + public FuturesOrderBook execute() throws ApiException { + ApiResponse localVarResp = listOptionsOrderBookWithHttpInfo(contract, interval, limit, withId); + return localVarResp.getData(); + } + + /** + * Execute listOptionsOrderBook request with HTTP info returned + * @return ApiResponse<FuturesOrderBook> + * @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 Depth query successful -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listOptionsOrderBookWithHttpInfo(contract, interval, limit, withId); + } + + /** + * Execute listOptionsOrderBook request (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 Depth query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listOptionsOrderBookAsync(contract, interval, limit, withId, _callback); + } + } + + /** + * Query options contract order book + * Bids will be sorted by price from high to low, while asks sorted reversely + * @param contract Options contract name (required) + * @return APIlistOptionsOrderBookRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Depth query successful -
+ */ + public APIlistOptionsOrderBookRequest listOptionsOrderBook(String contract) { + return new APIlistOptionsOrderBookRequest(contract); + } + + /** + * Build call for listOptionsTickers + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @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 Query successful -
+ */ + public okhttp3.Call listOptionsTickersCall(String underlying, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/tickers"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsTickersValidateBeforeCall(String underlying, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listOptionsTickers(Async)"); + } + + okhttp3.Call localVarCall = listOptionsTickersCall(underlying, _callback); + return localVarCall; + } + + /** + * Query options market ticker information + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return List<OptionsTicker> + * @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 Query successful -
+ */ + public List listOptionsTickers(String underlying) throws ApiException { + ApiResponse> localVarResp = listOptionsTickersWithHttpInfo(underlying); + return localVarResp.getData(); + } + + /** + * Query options market ticker information + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return ApiResponse<List<OptionsTicker>> + * @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 Query successful -
+ */ + public ApiResponse> listOptionsTickersWithHttpInfo(String underlying) throws ApiException { + okhttp3.Call localVarCall = listOptionsTickersValidateBeforeCall(underlying, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query options market ticker information (asynchronously) + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @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 Query successful -
+ */ + public okhttp3.Call listOptionsTickersAsync(String underlying, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsTickersValidateBeforeCall(underlying, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listOptionsUnderlyingTickers + * @param underlying Underlying (required) + * @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 Query successful -
+ */ + public okhttp3.Call listOptionsUnderlyingTickersCall(String underlying, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/underlying/tickers/{underlying}" + .replaceAll("\\{" + "underlying" + "\\}", localVarApiClient.escapeString(underlying)); + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsUnderlyingTickersValidateBeforeCall(String underlying, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listOptionsUnderlyingTickers(Async)"); + } + + okhttp3.Call localVarCall = listOptionsUnderlyingTickersCall(underlying, _callback); + return localVarCall; + } + + /** + * Query underlying ticker information + * + * @param underlying Underlying (required) + * @return OptionsUnderlyingTicker + * @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 Query successful -
+ */ + public OptionsUnderlyingTicker listOptionsUnderlyingTickers(String underlying) throws ApiException { + ApiResponse localVarResp = listOptionsUnderlyingTickersWithHttpInfo(underlying); + return localVarResp.getData(); + } + + /** + * Query underlying ticker information + * + * @param underlying Underlying (required) + * @return ApiResponse<OptionsUnderlyingTicker> + * @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 Query successful -
+ */ + public ApiResponse listOptionsUnderlyingTickersWithHttpInfo(String underlying) throws ApiException { + okhttp3.Call localVarCall = listOptionsUnderlyingTickersValidateBeforeCall(underlying, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query underlying ticker information (asynchronously) + * + * @param underlying Underlying (required) + * @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 Query successful -
+ */ + public okhttp3.Call listOptionsUnderlyingTickersAsync(String underlying, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsUnderlyingTickersValidateBeforeCall(underlying, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listOptionsCandlesticksCall(String contract, Integer limit, Long from, Long to, String interval, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/candlesticks"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (interval != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("interval", interval)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsCandlesticksValidateBeforeCall(String contract, Integer limit, Long from, Long to, String interval, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling listOptionsCandlesticks(Async)"); + } + + okhttp3.Call localVarCall = listOptionsCandlesticksCall(contract, limit, from, to, interval, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsCandlesticksWithHttpInfo(String contract, Integer limit, Long from, Long to, String interval) throws ApiException { + okhttp3.Call localVarCall = listOptionsCandlesticksValidateBeforeCall(contract, limit, from, to, interval, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsCandlesticksAsync(String contract, Integer limit, Long from, Long to, String interval, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsCandlesticksValidateBeforeCall(contract, limit, from, to, interval, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsCandlesticksRequest { + private final String contract; + private Integer limit; + private Long from; + private Long to; + private String interval; + + private APIlistOptionsCandlesticksRequest(String contract) { + this.contract = contract; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistOptionsCandlesticksRequest + */ + public APIlistOptionsCandlesticksRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistOptionsCandlesticksRequest + */ + public APIlistOptionsCandlesticksRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistOptionsCandlesticksRequest + */ + public APIlistOptionsCandlesticksRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set interval + * @param interval Time interval between data points (optional, default to 5m) + * @return APIlistOptionsCandlesticksRequest + */ + public APIlistOptionsCandlesticksRequest interval(String interval) { + this.interval = interval; + return this; + } + + /** + * Build call for listOptionsCandlesticks + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsCandlesticksCall(contract, limit, from, to, interval, _callback); + } + + /** + * Execute listOptionsCandlesticks request + * @return List<OptionsCandlestick> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsCandlesticksWithHttpInfo(contract, limit, from, to, interval); + return localVarResp.getData(); + } + + /** + * Execute listOptionsCandlesticks request with HTTP info returned + * @return ApiResponse<List<OptionsCandlestick>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsCandlesticksWithHttpInfo(contract, limit, from, to, interval); + } + + /** + * Execute listOptionsCandlesticks request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsCandlesticksAsync(contract, limit, from, to, interval, _callback); + } + } + + /** + * Options contract market candlestick chart + * + * @param contract Options contract name (required) + * @return APIlistOptionsCandlesticksRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistOptionsCandlesticksRequest listOptionsCandlesticks(String contract) { + return new APIlistOptionsCandlesticksRequest(contract); + } + + private okhttp3.Call listOptionsUnderlyingCandlesticksCall(String underlying, Integer limit, Long from, Long to, String interval, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/underlying/candlesticks"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (interval != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("interval", interval)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsUnderlyingCandlesticksValidateBeforeCall(String underlying, Integer limit, Long from, Long to, String interval, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listOptionsUnderlyingCandlesticks(Async)"); + } + + okhttp3.Call localVarCall = listOptionsUnderlyingCandlesticksCall(underlying, limit, from, to, interval, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsUnderlyingCandlesticksWithHttpInfo(String underlying, Integer limit, Long from, Long to, String interval) throws ApiException { + okhttp3.Call localVarCall = listOptionsUnderlyingCandlesticksValidateBeforeCall(underlying, limit, from, to, interval, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsUnderlyingCandlesticksAsync(String underlying, Integer limit, Long from, Long to, String interval, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsUnderlyingCandlesticksValidateBeforeCall(underlying, limit, from, to, interval, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsUnderlyingCandlesticksRequest { + private final String underlying; + private Integer limit; + private Long from; + private Long to; + private String interval; + + private APIlistOptionsUnderlyingCandlesticksRequest(String underlying) { + this.underlying = underlying; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistOptionsUnderlyingCandlesticksRequest + */ + public APIlistOptionsUnderlyingCandlesticksRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistOptionsUnderlyingCandlesticksRequest + */ + public APIlistOptionsUnderlyingCandlesticksRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistOptionsUnderlyingCandlesticksRequest + */ + public APIlistOptionsUnderlyingCandlesticksRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set interval + * @param interval Time interval between data points (optional, default to 5m) + * @return APIlistOptionsUnderlyingCandlesticksRequest + */ + public APIlistOptionsUnderlyingCandlesticksRequest interval(String interval) { + this.interval = interval; + return this; + } + + /** + * Build call for listOptionsUnderlyingCandlesticks + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsUnderlyingCandlesticksCall(underlying, limit, from, to, interval, _callback); + } + + /** + * Execute listOptionsUnderlyingCandlesticks request + * @return List<FuturesCandlestick> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsUnderlyingCandlesticksWithHttpInfo(underlying, limit, from, to, interval); + return localVarResp.getData(); + } + + /** + * Execute listOptionsUnderlyingCandlesticks request with HTTP info returned + * @return ApiResponse<List<FuturesCandlestick>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsUnderlyingCandlesticksWithHttpInfo(underlying, limit, from, to, interval); + } + + /** + * Execute listOptionsUnderlyingCandlesticks request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsUnderlyingCandlesticksAsync(underlying, limit, from, to, interval, _callback); + } + } + + /** + * Underlying index price candlestick chart + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return APIlistOptionsUnderlyingCandlesticksRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistOptionsUnderlyingCandlesticksRequest listOptionsUnderlyingCandlesticks(String underlying) { + return new APIlistOptionsUnderlyingCandlesticksRequest(underlying); + } + + private okhttp3.Call listOptionsTradesCall(String contract, String type, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/trades"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOptionsTradesValidateBeforeCall(String contract, String type, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsTradesCall(contract, type, limit, offset, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsTradesWithHttpInfo(String contract, String type, Integer limit, Integer offset, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listOptionsTradesValidateBeforeCall(contract, type, limit, offset, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsTradesAsync(String contract, String type, Integer limit, Integer offset, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsTradesValidateBeforeCall(contract, type, limit, offset, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsTradesRequest { + private String contract; + private String type; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + + private APIlistOptionsTradesRequest() { + } + + /** + * Set contract + * @param contract Options contract name (optional) + * @return APIlistOptionsTradesRequest + */ + public APIlistOptionsTradesRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set type + * @param type `C` for call, `P` for put (optional) + * @return APIlistOptionsTradesRequest + */ + public APIlistOptionsTradesRequest type(String type) { + this.type = type; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistOptionsTradesRequest + */ + public APIlistOptionsTradesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistOptionsTradesRequest + */ + public APIlistOptionsTradesRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistOptionsTradesRequest + */ + public APIlistOptionsTradesRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistOptionsTradesRequest + */ + public APIlistOptionsTradesRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listOptionsTrades + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsTradesCall(contract, type, limit, offset, from, to, _callback); + } + + /** + * Execute listOptionsTrades request + * @return List<FuturesTrade> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsTradesWithHttpInfo(contract, type, limit, offset, from, to); + return localVarResp.getData(); + } + + /** + * Execute listOptionsTrades request with HTTP info returned + * @return ApiResponse<List<FuturesTrade>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsTradesWithHttpInfo(contract, type, limit, offset, from, to); + } + + /** + * Execute listOptionsTrades request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsTradesAsync(contract, type, limit, offset, from, to, _callback); + } + } + + /** + * Market trade records + * + * @return APIlistOptionsTradesRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistOptionsTradesRequest listOptionsTrades() { + return new APIlistOptionsTradesRequest(); + } + + /** + * Build call for listOptionsAccount + * @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 Query successful -
+ */ + public okhttp3.Call listOptionsAccountCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/accounts"; + + 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 listOptionsAccountValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsAccountCall(_callback); + return localVarCall; + } + + /** + * Query account information + * + * @return OptionsAccount + * @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 Query successful -
+ */ + public OptionsAccount listOptionsAccount() throws ApiException { + ApiResponse localVarResp = listOptionsAccountWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query account information + * + * @return ApiResponse<OptionsAccount> + * @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 Query successful -
+ */ + public ApiResponse listOptionsAccountWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listOptionsAccountValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query 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 Query successful -
+ */ + public okhttp3.Call listOptionsAccountAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsAccountValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listOptionsAccountBookCall(Integer limit, Integer offset, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/account_book"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + 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 listOptionsAccountBookValidateBeforeCall(Integer limit, Integer offset, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsAccountBookCall(limit, offset, from, to, type, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsAccountBookWithHttpInfo(Integer limit, Integer offset, Long from, Long to, String type) throws ApiException { + okhttp3.Call localVarCall = listOptionsAccountBookValidateBeforeCall(limit, offset, from, to, type, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsAccountBookAsync(Integer limit, Integer offset, Long from, Long to, String type, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsAccountBookValidateBeforeCall(limit, offset, from, to, type, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsAccountBookRequest { + private Integer limit; + private Integer offset; + private Long from; + private Long to; + private String type; + + private APIlistOptionsAccountBookRequest() { + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistOptionsAccountBookRequest + */ + public APIlistOptionsAccountBookRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistOptionsAccountBookRequest + */ + public APIlistOptionsAccountBookRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistOptionsAccountBookRequest + */ + public APIlistOptionsAccountBookRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistOptionsAccountBookRequest + */ + public APIlistOptionsAccountBookRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set type + * @param type Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L (optional) + * @return APIlistOptionsAccountBookRequest + */ + public APIlistOptionsAccountBookRequest type(String type) { + this.type = type; + return this; + } + + /** + * Build call for listOptionsAccountBook + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsAccountBookCall(limit, offset, from, to, type, _callback); + } + + /** + * Execute listOptionsAccountBook request + * @return List<OptionsAccountBook> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsAccountBookWithHttpInfo(limit, offset, from, to, type); + return localVarResp.getData(); + } + + /** + * Execute listOptionsAccountBook request with HTTP info returned + * @return ApiResponse<List<OptionsAccountBook>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsAccountBookWithHttpInfo(limit, offset, from, to, type); + } + + /** + * Execute listOptionsAccountBook request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsAccountBookAsync(limit, offset, from, to, type, _callback); + } + } + + /** + * Query account change history + * + * @return APIlistOptionsAccountBookRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistOptionsAccountBookRequest listOptionsAccountBook() { + return new APIlistOptionsAccountBookRequest(); + } + + private okhttp3.Call listOptionsPositionsCall(String underlying, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/positions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + 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 listOptionsPositionsValidateBeforeCall(String underlying, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsPositionsCall(underlying, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsPositionsWithHttpInfo(String underlying) throws ApiException { + okhttp3.Call localVarCall = listOptionsPositionsValidateBeforeCall(underlying, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsPositionsAsync(String underlying, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsPositionsValidateBeforeCall(underlying, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsPositionsRequest { + private String underlying; + + private APIlistOptionsPositionsRequest() { + } + + /** + * Set underlying + * @param underlying Underlying (optional) + * @return APIlistOptionsPositionsRequest + */ + public APIlistOptionsPositionsRequest underlying(String underlying) { + this.underlying = underlying; + return this; + } + + /** + * Build call for listOptionsPositions + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsPositionsCall(underlying, _callback); + } + + /** + * Execute listOptionsPositions request + * @return List<OptionsPosition> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsPositionsWithHttpInfo(underlying); + return localVarResp.getData(); + } + + /** + * Execute listOptionsPositions request with HTTP info returned + * @return ApiResponse<List<OptionsPosition>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsPositionsWithHttpInfo(underlying); + } + + /** + * Execute listOptionsPositions request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsPositionsAsync(underlying, _callback); + } + } + + /** + * List user's positions of specified underlying + * + * @return APIlistOptionsPositionsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistOptionsPositionsRequest listOptionsPositions() { + return new APIlistOptionsPositionsRequest(); + } + + /** + * Build call for getOptionsPosition + * @param contract (required) + * @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 Query successful -
+ */ + public okhttp3.Call getOptionsPositionCall(String contract, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/positions/{contract}" + .replaceAll("\\{" + "contract" + "\\}", localVarApiClient.escapeString(contract)); + + 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 getOptionsPositionValidateBeforeCall(String contract, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling getOptionsPosition(Async)"); + } + + okhttp3.Call localVarCall = getOptionsPositionCall(contract, _callback); + return localVarCall; + } + + /** + * Get specified contract position + * + * @param contract (required) + * @return OptionsPosition + * @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 Query successful -
+ */ + public OptionsPosition getOptionsPosition(String contract) throws ApiException { + ApiResponse localVarResp = getOptionsPositionWithHttpInfo(contract); + return localVarResp.getData(); + } + + /** + * Get specified contract position + * + * @param contract (required) + * @return ApiResponse<OptionsPosition> + * @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 Query successful -
+ */ + public ApiResponse getOptionsPositionWithHttpInfo(String contract) throws ApiException { + okhttp3.Call localVarCall = getOptionsPositionValidateBeforeCall(contract, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get specified contract position (asynchronously) + * + * @param contract (required) + * @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 Query successful -
+ */ + public okhttp3.Call getOptionsPositionAsync(String contract, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getOptionsPositionValidateBeforeCall(contract, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listOptionsPositionCloseCall(String underlying, String contract, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/position_close"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + 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 listOptionsPositionCloseValidateBeforeCall(String underlying, String contract, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listOptionsPositionClose(Async)"); + } + + okhttp3.Call localVarCall = listOptionsPositionCloseCall(underlying, contract, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsPositionCloseWithHttpInfo(String underlying, String contract) throws ApiException { + okhttp3.Call localVarCall = listOptionsPositionCloseValidateBeforeCall(underlying, contract, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsPositionCloseAsync(String underlying, String contract, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsPositionCloseValidateBeforeCall(underlying, contract, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsPositionCloseRequest { + private final String underlying; + private String contract; + + private APIlistOptionsPositionCloseRequest(String underlying) { + this.underlying = underlying; + } + + /** + * Set contract + * @param contract Options contract name (optional) + * @return APIlistOptionsPositionCloseRequest + */ + public APIlistOptionsPositionCloseRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Build call for listOptionsPositionClose + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsPositionCloseCall(underlying, contract, _callback); + } + + /** + * Execute listOptionsPositionClose request + * @return List<OptionsPositionClose> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsPositionCloseWithHttpInfo(underlying, contract); + return localVarResp.getData(); + } + + /** + * Execute listOptionsPositionClose request with HTTP info returned + * @return ApiResponse<List<OptionsPositionClose>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsPositionCloseWithHttpInfo(underlying, contract); + } + + /** + * Execute listOptionsPositionClose request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsPositionCloseAsync(underlying, contract, _callback); + } + } + + /** + * List user's liquidation history of specified underlying + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return APIlistOptionsPositionCloseRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistOptionsPositionCloseRequest listOptionsPositionClose(String underlying) { + return new APIlistOptionsPositionCloseRequest(underlying); + } + + private okhttp3.Call listOptionsOrdersCall(String status, String contract, String underlying, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listOptionsOrdersValidateBeforeCall(String status, String contract, String underlying, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException("Missing the required parameter 'status' when calling listOptionsOrders(Async)"); + } + + okhttp3.Call localVarCall = listOptionsOrdersCall(status, contract, underlying, limit, offset, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listOptionsOrdersWithHttpInfo(String status, String contract, String underlying, Integer limit, Integer offset, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listOptionsOrdersValidateBeforeCall(status, contract, underlying, limit, offset, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOptionsOrdersAsync(String status, String contract, String underlying, Integer limit, Integer offset, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOptionsOrdersValidateBeforeCall(status, contract, underlying, limit, offset, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistOptionsOrdersRequest { + private final String status; + private String contract; + private String underlying; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + + private APIlistOptionsOrdersRequest(String status) { + this.status = status; + } + + /** + * Set contract + * @param contract Options contract name (optional) + * @return APIlistOptionsOrdersRequest + */ + public APIlistOptionsOrdersRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set underlying + * @param underlying Underlying (optional) + * @return APIlistOptionsOrdersRequest + */ + public APIlistOptionsOrdersRequest underlying(String underlying) { + this.underlying = underlying; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistOptionsOrdersRequest + */ + public APIlistOptionsOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistOptionsOrdersRequest + */ + public APIlistOptionsOrdersRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistOptionsOrdersRequest + */ + public APIlistOptionsOrdersRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistOptionsOrdersRequest + */ + public APIlistOptionsOrdersRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listOptionsOrders + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOptionsOrdersCall(status, contract, underlying, limit, offset, from, to, _callback); + } + + /** + * Execute listOptionsOrders request + * @return List<OptionsOrder> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOptionsOrdersWithHttpInfo(status, contract, underlying, limit, offset, from, to); + return localVarResp.getData(); + } + + /** + * Execute listOptionsOrders request with HTTP info returned + * @return ApiResponse<List<OptionsOrder>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOptionsOrdersWithHttpInfo(status, contract, underlying, limit, offset, from, to); + } + + /** + * Execute listOptionsOrders request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOptionsOrdersAsync(status, contract, underlying, limit, offset, from, to, _callback); + } + } + + /** + * List options orders + * + * @param status Query order list based on status (required) + * @return APIlistOptionsOrdersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistOptionsOrdersRequest listOptionsOrders(String status) { + return new APIlistOptionsOrdersRequest(status); + } + + /** + * Build call for createOptionsOrder + * @param optionsOrder (required) + * @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
201 Order detail -
+ */ + public okhttp3.Call createOptionsOrderCall(OptionsOrder optionsOrder, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = optionsOrder; + + // create path and map variables + String localVarPath = "/options/orders"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOptionsOrderValidateBeforeCall(OptionsOrder optionsOrder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'optionsOrder' is set + if (optionsOrder == null) { + throw new ApiException("Missing the required parameter 'optionsOrder' when calling createOptionsOrder(Async)"); + } + + okhttp3.Call localVarCall = createOptionsOrderCall(optionsOrder, _callback); + return localVarCall; + } + + /** + * Create an options order + * + * @param optionsOrder (required) + * @return OptionsOrder + * @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
201 Order detail -
+ */ + public OptionsOrder createOptionsOrder(OptionsOrder optionsOrder) throws ApiException { + ApiResponse localVarResp = createOptionsOrderWithHttpInfo(optionsOrder); + return localVarResp.getData(); + } + + /** + * Create an options order + * + * @param optionsOrder (required) + * @return ApiResponse<OptionsOrder> + * @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
201 Order detail -
+ */ + public ApiResponse createOptionsOrderWithHttpInfo(OptionsOrder optionsOrder) throws ApiException { + okhttp3.Call localVarCall = createOptionsOrderValidateBeforeCall(optionsOrder, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an options order (asynchronously) + * + * @param optionsOrder (required) + * @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
201 Order detail -
+ */ + public okhttp3.Call createOptionsOrderAsync(OptionsOrder optionsOrder, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createOptionsOrderValidateBeforeCall(optionsOrder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for cancelOptionsOrders + * @param contract Options contract name (optional) + * @param underlying Underlying (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @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 Batch cancellation successful -
+ */ + public okhttp3.Call cancelOptionsOrdersCall(String contract, String underlying, String side, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (side != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); + } + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelOptionsOrdersValidateBeforeCall(String contract, String underlying, String side, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = cancelOptionsOrdersCall(contract, underlying, side, _callback); + return localVarCall; + } + + /** + * Cancel all orders with 'open' status + * + * @param contract Options contract name (optional) + * @param underlying Underlying (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @return List<OptionsOrder> + * @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 Batch cancellation successful -
+ */ + public List cancelOptionsOrders(String contract, String underlying, String side) throws ApiException { + ApiResponse> localVarResp = cancelOptionsOrdersWithHttpInfo(contract, underlying, side); + return localVarResp.getData(); + } + + /** + * Cancel all orders with 'open' status + * + * @param contract Options contract name (optional) + * @param underlying Underlying (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @return ApiResponse<List<OptionsOrder>> + * @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 Batch cancellation successful -
+ */ + public ApiResponse> cancelOptionsOrdersWithHttpInfo(String contract, String underlying, String side) throws ApiException { + okhttp3.Call localVarCall = cancelOptionsOrdersValidateBeforeCall(contract, underlying, side, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel all orders with 'open' status (asynchronously) + * + * @param contract Options contract name (optional) + * @param underlying Underlying (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @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 Batch cancellation successful -
+ */ + public okhttp3.Call cancelOptionsOrdersAsync(String contract, String underlying, String side, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = cancelOptionsOrdersValidateBeforeCall(contract, underlying, side, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getOptionsOrder + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order detail -
+ */ + public okhttp3.Call getOptionsOrderCall(Long orderId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + + 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 getOptionsOrderValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling getOptionsOrder(Async)"); + } + + okhttp3.Call localVarCall = getOptionsOrderCall(orderId, _callback); + return localVarCall; + } + + /** + * Query single order details + * + * @param orderId Order ID returned when order is successfully created (required) + * @return OptionsOrder + * @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 Order detail -
+ */ + public OptionsOrder getOptionsOrder(Long orderId) throws ApiException { + ApiResponse localVarResp = getOptionsOrderWithHttpInfo(orderId); + return localVarResp.getData(); + } + + /** + * Query single order details + * + * @param orderId Order ID returned when order is successfully created (required) + * @return ApiResponse<OptionsOrder> + * @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 Order detail -
+ */ + public ApiResponse getOptionsOrderWithHttpInfo(Long orderId) throws ApiException { + okhttp3.Call localVarCall = getOptionsOrderValidateBeforeCall(orderId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query single order details (asynchronously) + * + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order detail -
+ */ + public okhttp3.Call getOptionsOrderAsync(Long orderId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getOptionsOrderValidateBeforeCall(orderId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for cancelOptionsOrder + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order detail -
+ */ + public okhttp3.Call cancelOptionsOrderCall(Long orderId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelOptionsOrderValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling cancelOptionsOrder(Async)"); + } + + okhttp3.Call localVarCall = cancelOptionsOrderCall(orderId, _callback); + return localVarCall; + } + + /** + * Cancel single order + * + * @param orderId Order ID returned when order is successfully created (required) + * @return OptionsOrder + * @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 Order detail -
+ */ + public OptionsOrder cancelOptionsOrder(Long orderId) throws ApiException { + ApiResponse localVarResp = cancelOptionsOrderWithHttpInfo(orderId); + return localVarResp.getData(); + } + + /** + * Cancel single order + * + * @param orderId Order ID returned when order is successfully created (required) + * @return ApiResponse<OptionsOrder> + * @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 Order detail -
+ */ + public ApiResponse cancelOptionsOrderWithHttpInfo(Long orderId) throws ApiException { + okhttp3.Call localVarCall = cancelOptionsOrderValidateBeforeCall(orderId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel single order (asynchronously) + * + * @param orderId Order ID returned when order is successfully created (required) + * @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 Order detail -
+ */ + public okhttp3.Call cancelOptionsOrderAsync(Long orderId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = cancelOptionsOrderValidateBeforeCall(orderId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for countdownCancelAllOptions + * @param countdownCancelAllOptionsTask (required) + * @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 Countdown set successfully -
+ */ + public okhttp3.Call countdownCancelAllOptionsCall(CountdownCancelAllOptionsTask countdownCancelAllOptionsTask, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = countdownCancelAllOptionsTask; + + // create path and map variables + String localVarPath = "/options/countdown_cancel_all"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call countdownCancelAllOptionsValidateBeforeCall(CountdownCancelAllOptionsTask countdownCancelAllOptionsTask, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'countdownCancelAllOptionsTask' is set + if (countdownCancelAllOptionsTask == null) { + throw new ApiException("Missing the required parameter 'countdownCancelAllOptionsTask' when calling countdownCancelAllOptions(Async)"); + } + + okhttp3.Call localVarCall = countdownCancelAllOptionsCall(countdownCancelAllOptionsTask, _callback); + return localVarCall; + } + + /** + * 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. + * @param countdownCancelAllOptionsTask (required) + * @return TriggerTime + * @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 Countdown set successfully -
+ */ + public TriggerTime countdownCancelAllOptions(CountdownCancelAllOptionsTask countdownCancelAllOptionsTask) throws ApiException { + ApiResponse localVarResp = countdownCancelAllOptionsWithHttpInfo(countdownCancelAllOptionsTask); + return localVarResp.getData(); + } + + /** + * 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. + * @param countdownCancelAllOptionsTask (required) + * @return ApiResponse<TriggerTime> + * @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 Countdown set successfully -
+ */ + public ApiResponse countdownCancelAllOptionsWithHttpInfo(CountdownCancelAllOptionsTask countdownCancelAllOptionsTask) throws ApiException { + okhttp3.Call localVarCall = countdownCancelAllOptionsValidateBeforeCall(countdownCancelAllOptionsTask, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Countdown cancel orders (asynchronously) + * 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. + * @param countdownCancelAllOptionsTask (required) + * @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 Countdown set successfully -
+ */ + public okhttp3.Call countdownCancelAllOptionsAsync(CountdownCancelAllOptionsTask countdownCancelAllOptionsTask, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = countdownCancelAllOptionsValidateBeforeCall(countdownCancelAllOptionsTask, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listMyOptionsTradesCall(String underlying, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/my_trades"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + if (contract != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("contract", contract)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listMyOptionsTradesValidateBeforeCall(String underlying, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'underlying' is set + if (underlying == null) { + throw new ApiException("Missing the required parameter 'underlying' when calling listMyOptionsTrades(Async)"); + } + + okhttp3.Call localVarCall = listMyOptionsTradesCall(underlying, contract, limit, offset, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listMyOptionsTradesWithHttpInfo(String underlying, String contract, Integer limit, Integer offset, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listMyOptionsTradesValidateBeforeCall(underlying, contract, limit, offset, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listMyOptionsTradesAsync(String underlying, String contract, Integer limit, Integer offset, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMyOptionsTradesValidateBeforeCall(underlying, contract, limit, offset, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistMyOptionsTradesRequest { + private final String underlying; + private String contract; + private Integer limit; + private Integer offset; + private Long from; + private Long to; + + private APIlistMyOptionsTradesRequest(String underlying) { + this.underlying = underlying; + } + + /** + * Set contract + * @param contract Options contract name (optional) + * @return APIlistMyOptionsTradesRequest + */ + public APIlistMyOptionsTradesRequest contract(String contract) { + this.contract = contract; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistMyOptionsTradesRequest + */ + public APIlistMyOptionsTradesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistMyOptionsTradesRequest + */ + public APIlistMyOptionsTradesRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set from + * @param from 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) + * @return APIlistMyOptionsTradesRequest + */ + public APIlistMyOptionsTradesRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to 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 APIlistMyOptionsTradesRequest + */ + public APIlistMyOptionsTradesRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listMyOptionsTrades + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listMyOptionsTradesCall(underlying, contract, limit, offset, from, to, _callback); + } + + /** + * Execute listMyOptionsTrades request + * @return List<OptionsMyTrade> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listMyOptionsTradesWithHttpInfo(underlying, contract, limit, offset, from, to); + return localVarResp.getData(); + } + + /** + * Execute listMyOptionsTrades request with HTTP info returned + * @return ApiResponse<List<OptionsMyTrade>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMyOptionsTradesWithHttpInfo(underlying, contract, limit, offset, from, to); + } + + /** + * Execute listMyOptionsTrades request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMyOptionsTradesAsync(underlying, contract, limit, offset, from, to, _callback); + } + } + + /** + * Query personal trading records + * + * @param underlying Underlying (Obtained by listing underlying endpoint) (required) + * @return APIlistMyOptionsTradesRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistMyOptionsTradesRequest listMyOptionsTrades(String underlying) { + return new APIlistMyOptionsTradesRequest(underlying); + } + + private okhttp3.Call getOptionsMMPCall(String underlying, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/options/mmp"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + 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 getOptionsMMPValidateBeforeCall(String underlying, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getOptionsMMPCall(underlying, _callback); + return localVarCall; + } + + + private ApiResponse> getOptionsMMPWithHttpInfo(String underlying) throws ApiException { + okhttp3.Call localVarCall = getOptionsMMPValidateBeforeCall(underlying, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getOptionsMMPAsync(String underlying, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getOptionsMMPValidateBeforeCall(underlying, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetOptionsMMPRequest { + private String underlying; + + private APIgetOptionsMMPRequest() { + } + + /** + * Set underlying + * @param underlying Underlying (optional) + * @return APIgetOptionsMMPRequest + */ + public APIgetOptionsMMPRequest underlying(String underlying) { + this.underlying = underlying; + return this; + } + + /** + * Build call for getOptionsMMP + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getOptionsMMPCall(underlying, _callback); + } + + /** + * Execute getOptionsMMP request + * @return List<OptionsMMP> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getOptionsMMPWithHttpInfo(underlying); + return localVarResp.getData(); + } + + /** + * Execute getOptionsMMP request with HTTP info returned + * @return ApiResponse<List<OptionsMMP>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getOptionsMMPWithHttpInfo(underlying); + } + + /** + * Execute getOptionsMMP request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getOptionsMMPAsync(underlying, _callback); + } + } + + /** + * MMP Query. + * + * @return APIgetOptionsMMPRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIgetOptionsMMPRequest getOptionsMMP() { + return new APIgetOptionsMMPRequest(); + } + + /** + * Build call for setOptionsMMP + * @param optionsMMP (required) + * @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 MMP Information -
+ */ + public okhttp3.Call setOptionsMMPCall(OptionsMMP optionsMMP, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = optionsMMP; + + // create path and map variables + String localVarPath = "/options/mmp"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setOptionsMMPValidateBeforeCall(OptionsMMP optionsMMP, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'optionsMMP' is set + if (optionsMMP == null) { + throw new ApiException("Missing the required parameter 'optionsMMP' when calling setOptionsMMP(Async)"); + } + + okhttp3.Call localVarCall = setOptionsMMPCall(optionsMMP, _callback); + return localVarCall; + } + + /** + * MMP Settings + * + * @param optionsMMP (required) + * @return OptionsMMP + * @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 MMP Information -
+ */ + public OptionsMMP setOptionsMMP(OptionsMMP optionsMMP) throws ApiException { + ApiResponse localVarResp = setOptionsMMPWithHttpInfo(optionsMMP); + return localVarResp.getData(); + } + + /** + * MMP Settings + * + * @param optionsMMP (required) + * @return ApiResponse<OptionsMMP> + * @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 MMP Information -
+ */ + public ApiResponse setOptionsMMPWithHttpInfo(OptionsMMP optionsMMP) throws ApiException { + okhttp3.Call localVarCall = setOptionsMMPValidateBeforeCall(optionsMMP, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * MMP Settings (asynchronously) + * + * @param optionsMMP (required) + * @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 MMP Information -
+ */ + public okhttp3.Call setOptionsMMPAsync(OptionsMMP optionsMMP, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = setOptionsMMPValidateBeforeCall(optionsMMP, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for resetOptionsMMP + * @param optionsMMPReset (required) + * @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 MMP Information -
+ */ + public okhttp3.Call resetOptionsMMPCall(OptionsMMPReset optionsMMPReset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = optionsMMPReset; + + // create path and map variables + String localVarPath = "/options/mmp/reset"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetOptionsMMPValidateBeforeCall(OptionsMMPReset optionsMMPReset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'optionsMMPReset' is set + if (optionsMMPReset == null) { + throw new ApiException("Missing the required parameter 'optionsMMPReset' when calling resetOptionsMMP(Async)"); + } + + okhttp3.Call localVarCall = resetOptionsMMPCall(optionsMMPReset, _callback); + return localVarCall; + } + + /** + * MMP Reset + * + * @param optionsMMPReset (required) + * @return OptionsMMP + * @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 MMP Information -
+ */ + public OptionsMMP resetOptionsMMP(OptionsMMPReset optionsMMPReset) throws ApiException { + ApiResponse localVarResp = resetOptionsMMPWithHttpInfo(optionsMMPReset); + return localVarResp.getData(); + } + + /** + * MMP Reset + * + * @param optionsMMPReset (required) + * @return ApiResponse<OptionsMMP> + * @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 MMP Information -
+ */ + public ApiResponse resetOptionsMMPWithHttpInfo(OptionsMMPReset optionsMMPReset) throws ApiException { + okhttp3.Call localVarCall = resetOptionsMMPValidateBeforeCall(optionsMMPReset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * MMP Reset (asynchronously) + * + * @param optionsMMPReset (required) + * @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 MMP Information -
+ */ + public okhttp3.Call resetOptionsMMPAsync(OptionsMMPReset optionsMMPReset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = resetOptionsMMPValidateBeforeCall(optionsMMPReset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/RebateApi.java b/src/main/java/io/gate/gateapi/api/RebateApi.java new file mode 100644 index 0000000..a0a0246 --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/RebateApi.java @@ -0,0 +1,1733 @@ +/* + * 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.AgencyCommissionHistory; +import io.gate.gateapi.models.AgencyTransactionHistory; +import io.gate.gateapi.models.BrokerCommission; +import io.gate.gateapi.models.BrokerTransaction; +import io.gate.gateapi.models.PartnerCommissionHistory; +import io.gate.gateapi.models.PartnerSubList; +import io.gate.gateapi.models.PartnerTransactionHistory; +import io.gate.gateapi.models.RebateUserInfo; +import io.gate.gateapi.models.UserSubRelation; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RebateApi { + private ApiClient localVarApiClient; + + public RebateApi() { + this(Configuration.getDefaultApiClient()); + } + + public RebateApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + private okhttp3.Call agencyTransactionHistoryCall(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/agency/transaction_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 agencyTransactionHistoryValidateBeforeCall(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = agencyTransactionHistoryCall(currencyPair, userId, from, to, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse> agencyTransactionHistoryWithHttpInfo(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = agencyTransactionHistoryValidateBeforeCall(currencyPair, userId, from, to, limit, offset, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call agencyTransactionHistoryAsync(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = agencyTransactionHistoryValidateBeforeCall(currencyPair, userId, from, to, limit, offset, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIagencyTransactionHistoryRequest { + private String currencyPair; + private Long userId; + private Long from; + private Long to; + private Integer limit; + private Integer offset; + + private APIagencyTransactionHistoryRequest() { + } + + /** + * Set currencyPair + * @param currencyPair Specify the trading pair. If not specified, returns all trading pairs (optional) + * @return APIagencyTransactionHistoryRequest + */ + public APIagencyTransactionHistoryRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; + return this; + } + + /** + * Set userId + * @param userId User ID. If not specified, all user records will be returned (optional) + * @return APIagencyTransactionHistoryRequest + */ + public APIagencyTransactionHistoryRequest userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Set from + * @param from Start time for querying records, defaults to 7 days before current time if not specified (optional) + * @return APIagencyTransactionHistoryRequest + */ + public APIagencyTransactionHistoryRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIagencyTransactionHistoryRequest + */ + public APIagencyTransactionHistoryRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIagencyTransactionHistoryRequest + */ + public APIagencyTransactionHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIagencyTransactionHistoryRequest + */ + public APIagencyTransactionHistoryRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for agencyTransactionHistory + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return agencyTransactionHistoryCall(currencyPair, userId, from, to, limit, offset, _callback); + } + + /** + * Execute agencyTransactionHistory request + * @return List<AgencyTransactionHistory> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = agencyTransactionHistoryWithHttpInfo(currencyPair, userId, from, to, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute agencyTransactionHistory request with HTTP info returned + * @return ApiResponse<List<AgencyTransactionHistory>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return agencyTransactionHistoryWithHttpInfo(currencyPair, userId, from, to, limit, offset); + } + + /** + * Execute agencyTransactionHistory request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return agencyTransactionHistoryAsync(currencyPair, userId, from, to, limit, offset, _callback); + } + } + + /** + * Broker obtains transaction history of recommended users + * Record query time range cannot exceed 30 days + * @return APIagencyTransactionHistoryRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIagencyTransactionHistoryRequest agencyTransactionHistory() { + return new APIagencyTransactionHistoryRequest(); + } + + private okhttp3.Call agencyCommissionsHistoryCall(String currency, Integer commissionType, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/agency/commission_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (commissionType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("commission_type", commissionType)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 agencyCommissionsHistoryValidateBeforeCall(String currency, Integer commissionType, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = agencyCommissionsHistoryCall(currency, commissionType, userId, from, to, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse> agencyCommissionsHistoryWithHttpInfo(String currency, Integer commissionType, Long userId, Long from, Long to, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = agencyCommissionsHistoryValidateBeforeCall(currency, commissionType, userId, from, to, limit, offset, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call agencyCommissionsHistoryAsync(String currency, Integer commissionType, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = agencyCommissionsHistoryValidateBeforeCall(currency, commissionType, userId, from, to, limit, offset, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIagencyCommissionsHistoryRequest { + private String currency; + private Integer commissionType; + private Long userId; + private Long from; + private Long to; + private Integer limit; + private Integer offset; + + private APIagencyCommissionsHistoryRequest() { + } + + /** + * Set currency + * @param currency Specify the currency. If not specified, returns all currencies (optional) + * @return APIagencyCommissionsHistoryRequest + */ + public APIagencyCommissionsHistoryRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set commissionType + * @param commissionType Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate (optional) + * @return APIagencyCommissionsHistoryRequest + */ + public APIagencyCommissionsHistoryRequest commissionType(Integer commissionType) { + this.commissionType = commissionType; + return this; + } + + /** + * Set userId + * @param userId User ID. If not specified, all user records will be returned (optional) + * @return APIagencyCommissionsHistoryRequest + */ + public APIagencyCommissionsHistoryRequest userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Set from + * @param from Start time for querying records, defaults to 7 days before current time if not specified (optional) + * @return APIagencyCommissionsHistoryRequest + */ + public APIagencyCommissionsHistoryRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIagencyCommissionsHistoryRequest + */ + public APIagencyCommissionsHistoryRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIagencyCommissionsHistoryRequest + */ + public APIagencyCommissionsHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIagencyCommissionsHistoryRequest + */ + public APIagencyCommissionsHistoryRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for agencyCommissionsHistory + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return agencyCommissionsHistoryCall(currency, commissionType, userId, from, to, limit, offset, _callback); + } + + /** + * Execute agencyCommissionsHistory request + * @return List<AgencyCommissionHistory> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = agencyCommissionsHistoryWithHttpInfo(currency, commissionType, userId, from, to, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute agencyCommissionsHistory request with HTTP info returned + * @return ApiResponse<List<AgencyCommissionHistory>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return agencyCommissionsHistoryWithHttpInfo(currency, commissionType, userId, from, to, limit, offset); + } + + /** + * Execute agencyCommissionsHistory request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return agencyCommissionsHistoryAsync(currency, commissionType, userId, from, to, limit, offset, _callback); + } + } + + /** + * Broker obtains rebate history of recommended users + * Record query time range cannot exceed 30 days + * @return APIagencyCommissionsHistoryRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIagencyCommissionsHistoryRequest agencyCommissionsHistory() { + return new APIagencyCommissionsHistoryRequest(); + } + + private okhttp3.Call partnerTransactionHistoryCall(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/partner/transaction_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 partnerTransactionHistoryValidateBeforeCall(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = partnerTransactionHistoryCall(currencyPair, userId, from, to, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse partnerTransactionHistoryWithHttpInfo(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = partnerTransactionHistoryValidateBeforeCall(currencyPair, userId, from, to, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call partnerTransactionHistoryAsync(String currencyPair, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = partnerTransactionHistoryValidateBeforeCall(currencyPair, userId, from, to, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIpartnerTransactionHistoryRequest { + private String currencyPair; + private Long userId; + private Long from; + private Long to; + private Integer limit; + private Integer offset; + + private APIpartnerTransactionHistoryRequest() { + } + + /** + * Set currencyPair + * @param currencyPair Specify the trading pair. If not specified, returns all trading pairs (optional) + * @return APIpartnerTransactionHistoryRequest + */ + public APIpartnerTransactionHistoryRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; + return this; + } + + /** + * Set userId + * @param userId User ID. If not specified, all user records will be returned (optional) + * @return APIpartnerTransactionHistoryRequest + */ + public APIpartnerTransactionHistoryRequest userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Set from + * @param from Start time for querying records, defaults to 7 days before current time if not specified (optional) + * @return APIpartnerTransactionHistoryRequest + */ + public APIpartnerTransactionHistoryRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIpartnerTransactionHistoryRequest + */ + public APIpartnerTransactionHistoryRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIpartnerTransactionHistoryRequest + */ + public APIpartnerTransactionHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIpartnerTransactionHistoryRequest + */ + public APIpartnerTransactionHistoryRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for partnerTransactionHistory + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return partnerTransactionHistoryCall(currencyPair, userId, from, to, limit, offset, _callback); + } + + /** + * Execute partnerTransactionHistory request + * @return PartnerTransactionHistory + * @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 List retrieved successfully -
+ */ + public PartnerTransactionHistory execute() throws ApiException { + ApiResponse localVarResp = partnerTransactionHistoryWithHttpInfo(currencyPair, userId, from, to, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute partnerTransactionHistory request with HTTP info returned + * @return ApiResponse<PartnerTransactionHistory> + * @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 List retrieved successfully -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return partnerTransactionHistoryWithHttpInfo(currencyPair, userId, from, to, limit, offset); + } + + /** + * Execute partnerTransactionHistory request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return partnerTransactionHistoryAsync(currencyPair, userId, from, to, limit, offset, _callback); + } + } + + /** + * Partner obtains transaction history of recommended users + * Record query time range cannot exceed 30 days + * @return APIpartnerTransactionHistoryRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIpartnerTransactionHistoryRequest partnerTransactionHistory() { + return new APIpartnerTransactionHistoryRequest(); + } + + private okhttp3.Call partnerCommissionsHistoryCall(String currency, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/partner/commission_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 partnerCommissionsHistoryValidateBeforeCall(String currency, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = partnerCommissionsHistoryCall(currency, userId, from, to, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse partnerCommissionsHistoryWithHttpInfo(String currency, Long userId, Long from, Long to, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = partnerCommissionsHistoryValidateBeforeCall(currency, userId, from, to, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call partnerCommissionsHistoryAsync(String currency, Long userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = partnerCommissionsHistoryValidateBeforeCall(currency, userId, from, to, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIpartnerCommissionsHistoryRequest { + private String currency; + private Long userId; + private Long from; + private Long to; + private Integer limit; + private Integer offset; + + private APIpartnerCommissionsHistoryRequest() { + } + + /** + * Set currency + * @param currency Specify the currency. If not specified, returns all currencies (optional) + * @return APIpartnerCommissionsHistoryRequest + */ + public APIpartnerCommissionsHistoryRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set userId + * @param userId User ID. If not specified, all user records will be returned (optional) + * @return APIpartnerCommissionsHistoryRequest + */ + public APIpartnerCommissionsHistoryRequest userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Set from + * @param from Start time for querying records, defaults to 7 days before current time if not specified (optional) + * @return APIpartnerCommissionsHistoryRequest + */ + public APIpartnerCommissionsHistoryRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIpartnerCommissionsHistoryRequest + */ + public APIpartnerCommissionsHistoryRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIpartnerCommissionsHistoryRequest + */ + public APIpartnerCommissionsHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIpartnerCommissionsHistoryRequest + */ + public APIpartnerCommissionsHistoryRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for partnerCommissionsHistory + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return partnerCommissionsHistoryCall(currency, userId, from, to, limit, offset, _callback); + } + + /** + * Execute partnerCommissionsHistory request + * @return PartnerCommissionHistory + * @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 List retrieved successfully -
+ */ + public PartnerCommissionHistory execute() throws ApiException { + ApiResponse localVarResp = partnerCommissionsHistoryWithHttpInfo(currency, userId, from, to, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute partnerCommissionsHistory request with HTTP info returned + * @return ApiResponse<PartnerCommissionHistory> + * @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 List retrieved successfully -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return partnerCommissionsHistoryWithHttpInfo(currency, userId, from, to, limit, offset); + } + + /** + * Execute partnerCommissionsHistory request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return partnerCommissionsHistoryAsync(currency, userId, from, to, limit, offset, _callback); + } + } + + /** + * Partner obtains rebate records of recommended users + * Record query time range cannot exceed 30 days + * @return APIpartnerCommissionsHistoryRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIpartnerCommissionsHistoryRequest partnerCommissionsHistory() { + return new APIpartnerCommissionsHistoryRequest(); + } + + private okhttp3.Call partnerSubListCall(Long userId, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/partner/sub_list"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + 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 partnerSubListValidateBeforeCall(Long userId, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = partnerSubListCall(userId, limit, offset, _callback); + return localVarCall; + } + + + private ApiResponse partnerSubListWithHttpInfo(Long userId, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = partnerSubListValidateBeforeCall(userId, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call partnerSubListAsync(Long userId, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = partnerSubListValidateBeforeCall(userId, limit, offset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIpartnerSubListRequest { + private Long userId; + private Integer limit; + private Integer offset; + + private APIpartnerSubListRequest() { + } + + /** + * Set userId + * @param userId User ID. If not specified, all user records will be returned (optional) + * @return APIpartnerSubListRequest + */ + public APIpartnerSubListRequest userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIpartnerSubListRequest + */ + public APIpartnerSubListRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIpartnerSubListRequest + */ + public APIpartnerSubListRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Build call for partnerSubList + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return partnerSubListCall(userId, limit, offset, _callback); + } + + /** + * Execute partnerSubList request + * @return PartnerSubList + * @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 List retrieved successfully -
+ */ + public PartnerSubList execute() throws ApiException { + ApiResponse localVarResp = partnerSubListWithHttpInfo(userId, limit, offset); + return localVarResp.getData(); + } + + /** + * Execute partnerSubList request with HTTP info returned + * @return ApiResponse<PartnerSubList> + * @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 List retrieved successfully -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return partnerSubListWithHttpInfo(userId, limit, offset); + } + + /** + * Execute partnerSubList request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return partnerSubListAsync(userId, limit, offset, _callback); + } + } + + /** + * Partner subordinate list + * Including sub-agents, direct customers, and indirect customers + * @return APIpartnerSubListRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIpartnerSubListRequest partnerSubList() { + return new APIpartnerSubListRequest(); + } + + private okhttp3.Call rebateBrokerCommissionHistoryCall(Integer limit, Integer offset, Long userId, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/broker/commission_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 rebateBrokerCommissionHistoryValidateBeforeCall(Integer limit, Integer offset, Long userId, Long from, Long to, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = rebateBrokerCommissionHistoryCall(limit, offset, userId, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> rebateBrokerCommissionHistoryWithHttpInfo(Integer limit, Integer offset, Long userId, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = rebateBrokerCommissionHistoryValidateBeforeCall(limit, offset, userId, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call rebateBrokerCommissionHistoryAsync(Integer limit, Integer offset, Long userId, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = rebateBrokerCommissionHistoryValidateBeforeCall(limit, offset, userId, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIrebateBrokerCommissionHistoryRequest { + private Integer limit; + private Integer offset; + private Long userId; + private Long from; + private Long to; + + private APIrebateBrokerCommissionHistoryRequest() { + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIrebateBrokerCommissionHistoryRequest + */ + public APIrebateBrokerCommissionHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIrebateBrokerCommissionHistoryRequest + */ + public APIrebateBrokerCommissionHistoryRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set userId + * @param userId User ID. If not specified, all user records will be returned (optional) + * @return APIrebateBrokerCommissionHistoryRequest + */ + public APIrebateBrokerCommissionHistoryRequest userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Set from + * @param from Start time of the query record. If not specified, defaults to 30 days before the current time (optional) + * @return APIrebateBrokerCommissionHistoryRequest + */ + public APIrebateBrokerCommissionHistoryRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIrebateBrokerCommissionHistoryRequest + */ + public APIrebateBrokerCommissionHistoryRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for rebateBrokerCommissionHistory + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return rebateBrokerCommissionHistoryCall(limit, offset, userId, from, to, _callback); + } + + /** + * Execute rebateBrokerCommissionHistory request + * @return List<BrokerCommission> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = rebateBrokerCommissionHistoryWithHttpInfo(limit, offset, userId, from, to); + return localVarResp.getData(); + } + + /** + * Execute rebateBrokerCommissionHistory request with HTTP info returned + * @return ApiResponse<List<BrokerCommission>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return rebateBrokerCommissionHistoryWithHttpInfo(limit, offset, userId, from, to); + } + + /** + * Execute rebateBrokerCommissionHistory request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return rebateBrokerCommissionHistoryAsync(limit, offset, userId, from, to, _callback); + } + } + + /** + * Broker obtains user's rebate records + * Record query time range cannot exceed 30 days + * @return APIrebateBrokerCommissionHistoryRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIrebateBrokerCommissionHistoryRequest rebateBrokerCommissionHistory() { + return new APIrebateBrokerCommissionHistoryRequest(); + } + + private okhttp3.Call rebateBrokerTransactionHistoryCall(Integer limit, Integer offset, Long userId, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/broker/transaction_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 rebateBrokerTransactionHistoryValidateBeforeCall(Integer limit, Integer offset, Long userId, Long from, Long to, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = rebateBrokerTransactionHistoryCall(limit, offset, userId, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> rebateBrokerTransactionHistoryWithHttpInfo(Integer limit, Integer offset, Long userId, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = rebateBrokerTransactionHistoryValidateBeforeCall(limit, offset, userId, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call rebateBrokerTransactionHistoryAsync(Integer limit, Integer offset, Long userId, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = rebateBrokerTransactionHistoryValidateBeforeCall(limit, offset, userId, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIrebateBrokerTransactionHistoryRequest { + private Integer limit; + private Integer offset; + private Long userId; + private Long from; + private Long to; + + private APIrebateBrokerTransactionHistoryRequest() { + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIrebateBrokerTransactionHistoryRequest + */ + public APIrebateBrokerTransactionHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIrebateBrokerTransactionHistoryRequest + */ + public APIrebateBrokerTransactionHistoryRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set userId + * @param userId User ID. If not specified, all user records will be returned (optional) + * @return APIrebateBrokerTransactionHistoryRequest + */ + public APIrebateBrokerTransactionHistoryRequest userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Set from + * @param from Start time of the query record. If not specified, defaults to 30 days before the current time (optional) + * @return APIrebateBrokerTransactionHistoryRequest + */ + public APIrebateBrokerTransactionHistoryRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIrebateBrokerTransactionHistoryRequest + */ + public APIrebateBrokerTransactionHistoryRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for rebateBrokerTransactionHistory + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return rebateBrokerTransactionHistoryCall(limit, offset, userId, from, to, _callback); + } + + /** + * Execute rebateBrokerTransactionHistory request + * @return List<BrokerTransaction> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = rebateBrokerTransactionHistoryWithHttpInfo(limit, offset, userId, from, to); + return localVarResp.getData(); + } + + /** + * Execute rebateBrokerTransactionHistory request with HTTP info returned + * @return ApiResponse<List<BrokerTransaction>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return rebateBrokerTransactionHistoryWithHttpInfo(limit, offset, userId, from, to); + } + + /** + * Execute rebateBrokerTransactionHistory request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return rebateBrokerTransactionHistoryAsync(limit, offset, userId, from, to, _callback); + } + } + + /** + * Broker obtains user's trading history + * Record query time range cannot exceed 30 days + * @return APIrebateBrokerTransactionHistoryRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIrebateBrokerTransactionHistoryRequest rebateBrokerTransactionHistory() { + return new APIrebateBrokerTransactionHistoryRequest(); + } + + /** + * Build call for rebateUserInfo + * @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 Query successful -
+ */ + public okhttp3.Call rebateUserInfoCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/user/info"; + + 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 rebateUserInfoValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = rebateUserInfoCall(_callback); + return localVarCall; + } + + /** + * User obtains rebate information + * + * @return List<RebateUserInfo> + * @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 Query successful -
+ */ + public List rebateUserInfo() throws ApiException { + ApiResponse> localVarResp = rebateUserInfoWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * User obtains rebate information + * + * @return ApiResponse<List<RebateUserInfo>> + * @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 Query successful -
+ */ + public ApiResponse> rebateUserInfoWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = rebateUserInfoValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * User obtains rebate 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 Query successful -
+ */ + public okhttp3.Call rebateUserInfoAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = rebateUserInfoValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for userSubRelation + * @param userIdList Query user ID list, separated by commas. If more than 100, only 100 will be returned (required) + * @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 List retrieved successfully -
+ */ + public okhttp3.Call userSubRelationCall(String userIdList, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/rebate/user/sub_relation"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (userIdList != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id_list", userIdList)); + } + + 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 userSubRelationValidateBeforeCall(String userIdList, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userIdList' is set + if (userIdList == null) { + throw new ApiException("Missing the required parameter 'userIdList' when calling userSubRelation(Async)"); + } + + okhttp3.Call localVarCall = userSubRelationCall(userIdList, _callback); + return localVarCall; + } + + /** + * User subordinate relationship + * Query whether the specified user is within the system + * @param userIdList Query user ID list, separated by commas. If more than 100, only 100 will be returned (required) + * @return UserSubRelation + * @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 List retrieved successfully -
+ */ + public UserSubRelation userSubRelation(String userIdList) throws ApiException { + ApiResponse localVarResp = userSubRelationWithHttpInfo(userIdList); + return localVarResp.getData(); + } + + /** + * User subordinate relationship + * Query whether the specified user is within the system + * @param userIdList Query user ID list, separated by commas. If more than 100, only 100 will be returned (required) + * @return ApiResponse<UserSubRelation> + * @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 List retrieved successfully -
+ */ + public ApiResponse userSubRelationWithHttpInfo(String userIdList) throws ApiException { + okhttp3.Call localVarCall = userSubRelationValidateBeforeCall(userIdList, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * User subordinate relationship (asynchronously) + * Query whether the specified user is within the system + * @param userIdList Query user ID list, separated by commas. If more than 100, only 100 will be returned (required) + * @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 List retrieved successfully -
+ */ + public okhttp3.Call userSubRelationAsync(String userIdList, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = userSubRelationValidateBeforeCall(userIdList, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/SpotApi.java b/src/main/java/io/gate/gateapi/api/SpotApi.java index 3f1b8a5..7763fa2 100644 --- a/src/main/java/io/gate/gateapi/api/SpotApi.java +++ b/src/main/java/io/gate/gateapi/api/SpotApi.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 @@ -20,20 +20,29 @@ import com.google.gson.reflect.TypeToken; +import io.gate.gateapi.models.BatchAmendItem; import io.gate.gateapi.models.BatchOrder; -import io.gate.gateapi.models.CancelOrder; +import io.gate.gateapi.models.CancelBatchOrder; import io.gate.gateapi.models.CancelOrderResult; +import io.gate.gateapi.models.CountdownCancelAllSpotTask; import io.gate.gateapi.models.Currency; import io.gate.gateapi.models.CurrencyPair; +import io.gate.gateapi.models.LiquidateOrder; import io.gate.gateapi.models.OpenOrders; import io.gate.gateapi.models.Order; import io.gate.gateapi.models.OrderBook; +import io.gate.gateapi.models.OrderCancel; +import io.gate.gateapi.models.OrderPatch; import io.gate.gateapi.models.SpotAccount; +import io.gate.gateapi.models.SpotAccountBook; +import io.gate.gateapi.models.SpotFee; +import io.gate.gateapi.models.SpotInsuranceHistory; import io.gate.gateapi.models.SpotPriceTriggeredOrder; +import io.gate.gateapi.models.SystemTime; import io.gate.gateapi.models.Ticker; import io.gate.gateapi.models.Trade; -import io.gate.gateapi.models.TradeFee; import io.gate.gateapi.models.TriggerOrderResponse; +import io.gate.gateapi.models.TriggerTime; import java.lang.reflect.Type; import java.util.ArrayList; @@ -68,7 +77,7 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listCurrenciesCall(final ApiCallback _callback) throws ApiException { @@ -107,14 +116,14 @@ private okhttp3.Call listCurrenciesValidateBeforeCall(final ApiCallback _callbac } /** - * 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 * @return List<Currency> * @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 List retrieved -
200 List retrieved successfully -
*/ public List listCurrencies() throws ApiException { @@ -123,14 +132,14 @@ public List listCurrencies() throws ApiException { } /** - * 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 * @return ApiResponse<List<Currency>> * @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 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> listCurrenciesWithHttpInfo() throws ApiException { @@ -140,15 +149,15 @@ public ApiResponse> listCurrenciesWithHttpInfo() throws ApiExcept } /** - * List all currencies' details (asynchronously) - * + * Query all currency information (asynchronously) + * 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 * @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 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listCurrenciesAsync(final ApiCallback> _callback) throws ApiException { @@ -167,7 +176,7 @@ public okhttp3.Call listCurrenciesAsync(final ApiCallback> _callb * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getCurrencyCall(String currency, final ApiCallback _callback) throws ApiException { @@ -212,7 +221,7 @@ private okhttp3.Call getCurrencyValidateBeforeCall(String currency, final ApiCal } /** - * Get details of a specific currency + * Query single currency information * * @param currency Currency name (required) * @return Currency @@ -220,7 +229,7 @@ private okhttp3.Call getCurrencyValidateBeforeCall(String currency, final ApiCal * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public Currency getCurrency(String currency) throws ApiException { @@ -229,7 +238,7 @@ public Currency getCurrency(String currency) throws ApiException { } /** - * Get details of a specific currency + * Query single currency information * * @param currency Currency name (required) * @return ApiResponse<Currency> @@ -237,7 +246,7 @@ public Currency getCurrency(String currency) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getCurrencyWithHttpInfo(String currency) throws ApiException { @@ -247,7 +256,7 @@ public ApiResponse getCurrencyWithHttpInfo(String currency) throws Api } /** - * Get details of a specific currency (asynchronously) + * Query single currency information (asynchronously) * * @param currency Currency name (required) * @param _callback The callback to be executed when the API call finishes @@ -256,7 +265,7 @@ public ApiResponse getCurrencyWithHttpInfo(String currency) throws Api * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getCurrencyAsync(String currency, final ApiCallback _callback) throws ApiException { @@ -313,7 +322,7 @@ private okhttp3.Call listCurrencyPairsValidateBeforeCall(final ApiCallback _call } /** - * List all currency pairs supported + * Query all supported currency pairs * * @return List<CurrencyPair> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -329,7 +338,7 @@ public List listCurrencyPairs() throws ApiException { } /** - * List all currency pairs supported + * Query all supported currency pairs * * @return ApiResponse<List<CurrencyPair>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -346,7 +355,7 @@ public ApiResponse> listCurrencyPairsWithHttpInfo() throws Ap } /** - * List all currency pairs supported (asynchronously) + * Query all supported currency pairs (asynchronously) * * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -373,7 +382,7 @@ public okhttp3.Call listCurrencyPairsAsync(final ApiCallback> * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getCurrencyPairCall(String currencyPair, final ApiCallback _callback) throws ApiException { @@ -418,7 +427,7 @@ private okhttp3.Call getCurrencyPairValidateBeforeCall(String currencyPair, fina } /** - * Get details of a specifc order + * Query single currency pair details * * @param currencyPair Currency pair (required) * @return CurrencyPair @@ -426,7 +435,7 @@ private okhttp3.Call getCurrencyPairValidateBeforeCall(String currencyPair, fina * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public CurrencyPair getCurrencyPair(String currencyPair) throws ApiException { @@ -435,7 +444,7 @@ public CurrencyPair getCurrencyPair(String currencyPair) throws ApiException { } /** - * Get details of a specifc order + * Query single currency pair details * * @param currencyPair Currency pair (required) * @return ApiResponse<CurrencyPair> @@ -443,7 +452,7 @@ public CurrencyPair getCurrencyPair(String currencyPair) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getCurrencyPairWithHttpInfo(String currencyPair) throws ApiException { @@ -453,7 +462,7 @@ public ApiResponse getCurrencyPairWithHttpInfo(String currencyPair } /** - * Get details of a specifc order (asynchronously) + * Query single currency pair details (asynchronously) * * @param currencyPair Currency pair (required) * @param _callback The callback to be executed when the API call finishes @@ -462,7 +471,7 @@ public ApiResponse getCurrencyPairWithHttpInfo(String currencyPair * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getCurrencyPairAsync(String currencyPair, final ApiCallback _callback) throws ApiException { @@ -472,7 +481,7 @@ public okhttp3.Call getCurrencyPairAsync(String currencyPair, final ApiCallback< return localVarCall; } - private okhttp3.Call listTickersCall(String currencyPair, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listTickersCall(String currencyPair, String timezone, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -484,6 +493,10 @@ private okhttp3.Call listTickersCall(String currencyPair, final ApiCallback _cal localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); } + if (timezone != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timezone", timezone)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -506,20 +519,20 @@ private okhttp3.Call listTickersCall(String currencyPair, final ApiCallback _cal } @SuppressWarnings("rawtypes") - private okhttp3.Call listTickersValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listTickersCall(currencyPair, _callback); + private okhttp3.Call listTickersValidateBeforeCall(String currencyPair, String timezone, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listTickersCall(currencyPair, timezone, _callback); return localVarCall; } - private ApiResponse> listTickersWithHttpInfo(String currencyPair) throws ApiException { - okhttp3.Call localVarCall = listTickersValidateBeforeCall(currencyPair, null); + private ApiResponse> listTickersWithHttpInfo(String currencyPair, String timezone) throws ApiException { + okhttp3.Call localVarCall = listTickersValidateBeforeCall(currencyPair, timezone, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listTickersAsync(String currencyPair, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listTickersValidateBeforeCall(currencyPair, _callback); + private okhttp3.Call listTickersAsync(String currencyPair, String timezone, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listTickersValidateBeforeCall(currencyPair, timezone, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -527,6 +540,7 @@ private okhttp3.Call listTickersAsync(String currencyPair, final ApiCallback Status Code Description Response Headers - 200 Successfully retrieved - + 200 Query successful - */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listTickersCall(currencyPair, _callback); + return listTickersCall(currencyPair, timezone, _callback); } /** @@ -563,11 +587,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listTickersWithHttpInfo(currencyPair); + ApiResponse> localVarResp = listTickersWithHttpInfo(currencyPair, timezone); return localVarResp.getData(); } @@ -578,11 +602,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listTickersWithHttpInfo(currencyPair); + return listTickersWithHttpInfo(currencyPair, timezone); } /** @@ -593,22 +617,22 @@ public ApiResponse> executeWithHttpInfo() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listTickersAsync(currencyPair, _callback); + return listTickersAsync(currencyPair, timezone, _callback); } } /** - * Retrieve ticker information - * Return only related data if `currency_pair` is specified; otherwise return all of them + * Get currency pair ticker information + * If `currency_pair` is specified, only query that currency pair; otherwise return all information * @return APIlistTickersRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistTickersRequest listTickers() { @@ -697,7 +721,7 @@ private APIlistOrderBookRequest(String currencyPair) { /** * Set interval - * @param interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to "0") + * @param interval Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional, default to "0") * @return APIlistOrderBookRequest */ public APIlistOrderBookRequest interval(String interval) { @@ -707,7 +731,7 @@ public APIlistOrderBookRequest interval(String interval) { /** * Set limit - * @param limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param limit Number of depth levels (optional, default to 10) * @return APIlistOrderBookRequest */ public APIlistOrderBookRequest limit(Integer limit) { @@ -717,7 +741,7 @@ public APIlistOrderBookRequest limit(Integer limit) { /** * Set withId - * @param withId Return order book ID (optional, default to false) + * @param withId Return order book update ID (optional, default to false) * @return APIlistOrderBookRequest */ public APIlistOrderBookRequest withId(Boolean withId) { @@ -733,7 +757,7 @@ public APIlistOrderBookRequest withId(Boolean withId) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -747,7 +771,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public OrderBook execute() throws ApiException { @@ -762,7 +786,7 @@ public OrderBook execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { @@ -777,7 +801,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { @@ -786,21 +810,21 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throws } /** - * Retrieve order book - * Order book will be sorted by price from high to low on bids; low to high on asks + * Get market depth information + * Market depth buy orders are sorted by price from high to low, sell orders are sorted from low to high * @param currencyPair Currency pair (required) * @return APIlistOrderBookRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistOrderBookRequest listOrderBook(String currencyPair) { return new APIlistOrderBookRequest(currencyPair); } - private okhttp3.Call listTradesCall(String currencyPair, Integer limit, String lastId, Boolean reverse, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listTradesCall(String currencyPair, Integer limit, String lastId, Boolean reverse, Long from, Long to, Integer page, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -824,6 +848,18 @@ private okhttp3.Call listTradesCall(String currencyPair, Integer limit, String l localVarQueryParams.addAll(localVarApiClient.parameterToPair("reverse", reverse)); } + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -846,25 +882,25 @@ private okhttp3.Call listTradesCall(String currencyPair, Integer limit, String l } @SuppressWarnings("rawtypes") - private okhttp3.Call listTradesValidateBeforeCall(String currencyPair, Integer limit, String lastId, Boolean reverse, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listTradesValidateBeforeCall(String currencyPair, Integer limit, String lastId, Boolean reverse, Long from, Long to, Integer page, final ApiCallback _callback) throws ApiException { // verify the required parameter 'currencyPair' is set if (currencyPair == null) { throw new ApiException("Missing the required parameter 'currencyPair' when calling listTrades(Async)"); } - okhttp3.Call localVarCall = listTradesCall(currencyPair, limit, lastId, reverse, _callback); + okhttp3.Call localVarCall = listTradesCall(currencyPair, limit, lastId, reverse, from, to, page, _callback); return localVarCall; } - private ApiResponse> listTradesWithHttpInfo(String currencyPair, Integer limit, String lastId, Boolean reverse) throws ApiException { - okhttp3.Call localVarCall = listTradesValidateBeforeCall(currencyPair, limit, lastId, reverse, null); + private ApiResponse> listTradesWithHttpInfo(String currencyPair, Integer limit, String lastId, Boolean reverse, Long from, Long to, Integer page) throws ApiException { + okhttp3.Call localVarCall = listTradesValidateBeforeCall(currencyPair, limit, lastId, reverse, from, to, page, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listTradesAsync(String currencyPair, Integer limit, String lastId, Boolean reverse, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listTradesValidateBeforeCall(currencyPair, limit, lastId, reverse, _callback); + private okhttp3.Call listTradesAsync(String currencyPair, Integer limit, String lastId, Boolean reverse, Long from, Long to, Integer page, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listTradesValidateBeforeCall(currencyPair, limit, lastId, reverse, from, to, page, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -875,6 +911,9 @@ public class APIlistTradesRequest { private Integer limit; private String lastId; private Boolean reverse; + private Long from; + private Long to; + private Integer page; private APIlistTradesRequest(String currencyPair) { this.currencyPair = currencyPair; @@ -882,7 +921,7 @@ private APIlistTradesRequest(String currencyPair) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 (optional, default to 100) * @return APIlistTradesRequest */ public APIlistTradesRequest limit(Integer limit) { @@ -892,7 +931,7 @@ public APIlistTradesRequest limit(Integer limit) { /** * Set lastId - * @param lastId Specify list staring point using the `id` of last record in previous list-query results (optional) + * @param lastId 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 APIlistTradesRequest */ public APIlistTradesRequest lastId(String lastId) { @@ -902,7 +941,7 @@ public APIlistTradesRequest lastId(String lastId) { /** * Set reverse - * @param reverse 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) + * @param reverse 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) * @return APIlistTradesRequest */ public APIlistTradesRequest reverse(Boolean reverse) { @@ -910,6 +949,36 @@ public APIlistTradesRequest reverse(Boolean reverse) { return this; } + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistTradesRequest + */ + public APIlistTradesRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistTradesRequest + */ + public APIlistTradesRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistTradesRequest + */ + public APIlistTradesRequest page(Integer page) { + this.page = page; + return this; + } + /** * Build call for listTrades * @param _callback ApiCallback API callback @@ -918,11 +987,11 @@ public APIlistTradesRequest reverse(Boolean reverse) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listTradesCall(currencyPair, limit, lastId, reverse, _callback); + return listTradesCall(currencyPair, limit, lastId, reverse, from, to, page, _callback); } /** @@ -932,11 +1001,11 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { - ApiResponse> localVarResp = listTradesWithHttpInfo(currencyPair, limit, lastId, reverse); + ApiResponse> localVarResp = listTradesWithHttpInfo(currencyPair, limit, lastId, reverse, from, to, page); return localVarResp.getData(); } @@ -947,11 +1016,11 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { - return listTradesWithHttpInfo(currencyPair, limit, lastId, reverse); + return listTradesWithHttpInfo(currencyPair, limit, lastId, reverse, from, to, page); } /** @@ -962,23 +1031,23 @@ public ApiResponse> executeWithHttpInfo() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listTradesAsync(currencyPair, limit, lastId, reverse, _callback); + return listTradesAsync(currencyPair, limit, lastId, reverse, from, to, page, _callback); } } /** - * Retrieve market trades - * + * Query market transaction records + * 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. * @param currencyPair Currency pair (required) * @return APIlistTradesRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistTradesRequest listTrades(String currencyPair) { @@ -1072,7 +1141,7 @@ private APIlistCandlesticksRequest(String currencyPair) { /** * Set limit - * @param limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param limit 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) * @return APIlistCandlesticksRequest */ public APIlistCandlesticksRequest limit(Integer limit) { @@ -1092,7 +1161,7 @@ public APIlistCandlesticksRequest from(Long from) { /** * Set to - * @param to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param to 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) * @return APIlistCandlesticksRequest */ public APIlistCandlesticksRequest to(Long to) { @@ -1102,7 +1171,7 @@ public APIlistCandlesticksRequest to(Long to) { /** * Set interval - * @param interval Interval time between data points (optional, default to 30m) + * @param interval Time interval between data points. Note that `30d` represents a calendar month, not aligned to 30 days (optional, default to 30m) * @return APIlistCandlesticksRequest */ public APIlistCandlesticksRequest interval(String interval) { @@ -1118,7 +1187,7 @@ public APIlistCandlesticksRequest interval(String interval) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1132,7 +1201,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public List> execute() throws ApiException { @@ -1147,7 +1216,7 @@ public List> execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse>> executeWithHttpInfo() throws ApiException { @@ -1162,7 +1231,7 @@ public ApiResponse>> executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback>> _callback) throws ApiException { @@ -1171,14 +1240,14 @@ public okhttp3.Call executeAsync(final ApiCallback>> _callback } /** - * 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 * @param currencyPair Currency pair (required) * @return APIlistCandlesticksRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistCandlesticksRequest listCandlesticks(String currencyPair) { @@ -1226,15 +1295,15 @@ private okhttp3.Call getFeeValidateBeforeCall(String currencyPair, final ApiCall } - private ApiResponse getFeeWithHttpInfo(String currencyPair) throws ApiException { + private ApiResponse getFeeWithHttpInfo(String currencyPair) throws ApiException { okhttp3.Call localVarCall = getFeeValidateBeforeCall(currencyPair, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call getFeeAsync(String currencyPair, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getFeeAsync(String currencyPair, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getFeeValidateBeforeCall(currencyPair, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1247,7 +1316,7 @@ private APIgetFeeRequest() { /** * Set currencyPair - * @param currencyPair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * @param currencyPair 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 APIgetFeeRequest */ public APIgetFeeRequest currencyPair(String currencyPair) { @@ -1263,7 +1332,7 @@ public APIgetFeeRequest currencyPair(String currencyPair) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
* @deprecated */ @@ -1274,34 +1343,34 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { /** * Execute getFee request - * @return TradeFee + * @return SpotFee * @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 -
200 Query successful -
* @deprecated */ @Deprecated - public TradeFee execute() throws ApiException { - ApiResponse localVarResp = getFeeWithHttpInfo(currencyPair); + public SpotFee execute() throws ApiException { + ApiResponse localVarResp = getFeeWithHttpInfo(currencyPair); return localVarResp.getData(); } /** * Execute getFee request with HTTP info returned - * @return ApiResponse<TradeFee> + * @return ApiResponse<SpotFee> * @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 -
200 Query successful -
* @deprecated */ @Deprecated - public ApiResponse executeWithHttpInfo() throws ApiException { + public ApiResponse executeWithHttpInfo() throws ApiException { return getFeeWithHttpInfo(currencyPair); } @@ -1313,24 +1382,24 @@ public ApiResponse executeWithHttpInfo() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
* @deprecated */ @Deprecated - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getFeeAsync(currencyPair, _callback); } } /** - * Query user trading fee rates - * This API is deprecated in favour of new fee retrieving API `/wallet/fee`. + * Query account fee rates + * This API is deprecated. The new fee query API is `/wallet/fee` * @return APIgetFeeRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
* @deprecated */ @@ -1339,6 +1408,117 @@ public APIgetFeeRequest getFee() { return new APIgetFeeRequest(); } + /** + * Build call for getBatchSpotFee + * @param currencyPairs Maximum 50 currency pairs per request (required) + * @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 Query successful -
+ */ + public okhttp3.Call getBatchSpotFeeCall(String currencyPairs, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/spot/batch_fee"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPairs != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pairs", currencyPairs)); + } + + 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 getBatchSpotFeeValidateBeforeCall(String currencyPairs, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencyPairs' is set + if (currencyPairs == null) { + throw new ApiException("Missing the required parameter 'currencyPairs' when calling getBatchSpotFee(Async)"); + } + + okhttp3.Call localVarCall = getBatchSpotFeeCall(currencyPairs, _callback); + return localVarCall; + } + + /** + * Batch query account fee rates + * + * @param currencyPairs Maximum 50 currency pairs per request (required) + * @return Map<String, SpotFee> + * @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 Query successful -
+ */ + public Map getBatchSpotFee(String currencyPairs) throws ApiException { + ApiResponse> localVarResp = getBatchSpotFeeWithHttpInfo(currencyPairs); + return localVarResp.getData(); + } + + /** + * Batch query account fee rates + * + * @param currencyPairs Maximum 50 currency pairs per request (required) + * @return ApiResponse<Map<String, SpotFee>> + * @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 Query successful -
+ */ + public ApiResponse> getBatchSpotFeeWithHttpInfo(String currencyPairs) throws ApiException { + okhttp3.Call localVarCall = getBatchSpotFeeValidateBeforeCall(currencyPairs, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Batch query account fee rates (asynchronously) + * + * @param currencyPairs Maximum 50 currency pairs per request (required) + * @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 Query successful -
+ */ + public okhttp3.Call getBatchSpotFeeAsync(String currencyPairs, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getBatchSpotFeeValidateBeforeCall(currencyPairs, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + private okhttp3.Call listSpotAccountsCall(String currency, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; @@ -1400,7 +1580,7 @@ private APIlistSpotAccountsRequest() { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistSpotAccountsRequest */ public APIlistSpotAccountsRequest currency(String currency) { @@ -1416,7 +1596,7 @@ public APIlistSpotAccountsRequest currency(String currency) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1430,7 +1610,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -1445,7 +1625,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -1460,7 +1640,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1469,134 +1649,39 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) } /** - * List spot accounts + * List spot trading accounts * * @return APIlistSpotAccountsRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistSpotAccountsRequest listSpotAccounts() { return new APIlistSpotAccountsRequest(); } - /** - * Build call for createBatchOrders - * @param order (required) - * @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 Request is completed -
- */ - public okhttp3.Call createBatchOrdersCall(List order, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = order; + private okhttp3.Call listSpotAccountBookCall(String currency, Long from, Long to, Integer page, Integer limit, String type, String code, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/spot/batch_orders"; + String localVarPath = "/spot/account_book"; 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); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); } - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createBatchOrdersValidateBeforeCall(List order, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'order' is set - if (order == null) { - throw new ApiException("Missing the required parameter 'order' when calling createBatchOrders(Async)"); + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); } - okhttp3.Call localVarCall = createBatchOrdersCall(order, _callback); - return localVarCall; - } - - /** - * Create a batch of 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 - * @param order (required) - * @return List<BatchOrder> - * @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 Request is completed -
- */ - public List createBatchOrders(List order) throws ApiException { - ApiResponse> localVarResp = createBatchOrdersWithHttpInfo(order); - return localVarResp.getData(); - } - - /** - * Create a batch of 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 - * @param order (required) - * @return ApiResponse<List<BatchOrder>> - * @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 Request is completed -
- */ - public ApiResponse> createBatchOrdersWithHttpInfo(List order) throws ApiException { - okhttp3.Call localVarCall = createBatchOrdersValidateBeforeCall(order, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create a batch of orders (asynchronously) - * 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 - * @param order (required) - * @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 Request is completed -
- */ - public okhttp3.Call createBatchOrdersAsync(List order, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = createBatchOrdersValidateBeforeCall(order, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - private okhttp3.Call listAllOpenOrdersCall(Integer page, Integer limit, String account, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/spot/open_orders"; + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } @@ -1605,8 +1690,12 @@ private okhttp3.Call listAllOpenOrdersCall(Integer page, Integer limit, String a localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } - if (account != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (code != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("code", code)); } Map localVarHeaderParams = new HashMap(); @@ -1631,153 +1720,304 @@ private okhttp3.Call listAllOpenOrdersCall(Integer page, Integer limit, String a } @SuppressWarnings("rawtypes") - private okhttp3.Call listAllOpenOrdersValidateBeforeCall(Integer page, Integer limit, String account, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listAllOpenOrdersCall(page, limit, account, _callback); + private okhttp3.Call listSpotAccountBookValidateBeforeCall(String currency, Long from, Long to, Integer page, Integer limit, String type, String code, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSpotAccountBookCall(currency, from, to, page, limit, type, code, _callback); return localVarCall; } - private ApiResponse> listAllOpenOrdersWithHttpInfo(Integer page, Integer limit, String account) throws ApiException { - okhttp3.Call localVarCall = listAllOpenOrdersValidateBeforeCall(page, limit, account, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> listSpotAccountBookWithHttpInfo(String currency, Long from, Long to, Integer page, Integer limit, String type, String code) throws ApiException { + okhttp3.Call localVarCall = listSpotAccountBookValidateBeforeCall(currency, from, to, page, limit, type, code, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listAllOpenOrdersAsync(Integer page, Integer limit, String account, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listAllOpenOrdersValidateBeforeCall(page, limit, account, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call listSpotAccountBookAsync(String currency, Long from, Long to, Integer page, Integer limit, String type, String code, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSpotAccountBookValidateBeforeCall(currency, from, to, page, limit, type, code, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistAllOpenOrdersRequest { + public class APIlistSpotAccountBookRequest { + private String currency; + private Long from; + private Long to; private Integer page; private Integer limit; - private String account; + private String type; + private String code; - private APIlistAllOpenOrdersRequest() { + private APIlistSpotAccountBookRequest() { } /** - * Set page - * @param page Page number (optional, default to 1) - * @return APIlistAllOpenOrdersRequest + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistSpotAccountBookRequest */ - public APIlistAllOpenOrdersRequest page(Integer page) { - this.page = page; + public APIlistSpotAccountBookRequest currency(String currency) { + this.currency = currency; return this; } /** - * Set limit - * @param limit Maximum number of records returned in one page in each currency pair (optional, default to 100) - * @return APIlistAllOpenOrdersRequest + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistSpotAccountBookRequest */ - public APIlistAllOpenOrdersRequest limit(Integer limit) { + public APIlistSpotAccountBookRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistSpotAccountBookRequest + */ + public APIlistSpotAccountBookRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistSpotAccountBookRequest + */ + public APIlistSpotAccountBookRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistSpotAccountBookRequest + */ + public APIlistSpotAccountBookRequest limit(Integer limit) { this.limit = limit; return this; } /** - * Set account - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @return APIlistAllOpenOrdersRequest + * Set type + * @param type Query by specified account change type. If not specified, all change types will be included. (optional) + * @return APIlistSpotAccountBookRequest */ - public APIlistAllOpenOrdersRequest account(String account) { - this.account = account; + public APIlistSpotAccountBookRequest type(String type) { + this.type = type; return this; } /** - * Build call for listAllOpenOrders + * Set code + * @param code Specify account change code for query. If not specified, all change types are included. This parameter has higher priority than `type` (optional) + * @return APIlistSpotAccountBookRequest + */ + public APIlistSpotAccountBookRequest code(String code) { + this.code = code; + return this; + } + + /** + * Build call for listSpotAccountBook * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listAllOpenOrdersCall(page, limit, account, _callback); + return listSpotAccountBookCall(currency, from, to, page, limit, type, code, _callback); } /** - * Execute listAllOpenOrders request - * @return List<OpenOrders> + * Execute listSpotAccountBook request + * @return List<SpotAccountBook> * @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 List retrieved -
200 List retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listAllOpenOrdersWithHttpInfo(page, limit, account); + public List execute() throws ApiException { + ApiResponse> localVarResp = listSpotAccountBookWithHttpInfo(currency, from, to, page, limit, type, code); return localVarResp.getData(); } /** - * Execute listAllOpenOrders request with HTTP info returned - * @return ApiResponse<List<OpenOrders>> + * Execute listSpotAccountBook request with HTTP info returned + * @return ApiResponse<List<SpotAccountBook>> * @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 List retrieved -
200 List retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listAllOpenOrdersWithHttpInfo(page, limit, account); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSpotAccountBookWithHttpInfo(currency, from, to, page, limit, type, code); } /** - * Execute listAllOpenOrders request (asynchronously) + * Execute listSpotAccountBook request (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 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listAllOpenOrdersAsync(page, limit, account, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSpotAccountBookAsync(currency, from, to, page, limit, type, code, _callback); } } /** - * 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` - * @return APIlistAllOpenOrdersRequest + * 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. + * @return APIlistSpotAccountBookRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public APIlistAllOpenOrdersRequest listAllOpenOrders() { - return new APIlistAllOpenOrdersRequest(); + public APIlistSpotAccountBookRequest listSpotAccountBook() { + return new APIlistSpotAccountBookRequest(); } - private okhttp3.Call listOrdersCall(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + /** + * Build call for createBatchOrders + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Request execution completed -
+ */ + public okhttp3.Call createBatchOrdersCall(List order, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = order; // create path and map variables - String localVarPath = "/spot/orders"; + String localVarPath = "/spot/batch_orders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currencyPair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); } - if (status != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBatchOrdersValidateBeforeCall(List order, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling createBatchOrders(Async)"); } + okhttp3.Call localVarCall = createBatchOrdersCall(order, xGateExptime, _callback); + return localVarCall; + } + + /** + * Batch place 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 + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return List<BatchOrder> + * @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 Request execution completed -
+ */ + public List createBatchOrders(List order, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = createBatchOrdersWithHttpInfo(order, xGateExptime); + return localVarResp.getData(); + } + + /** + * Batch place 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 + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<List<BatchOrder>> + * @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 Request execution completed -
+ */ + public ApiResponse> createBatchOrdersWithHttpInfo(List order, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = createBatchOrdersValidateBeforeCall(order, xGateExptime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Batch place orders (asynchronously) + * 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 + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Request execution completed -
+ */ + public okhttp3.Call createBatchOrdersAsync(List order, String xGateExptime, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = createBatchOrdersValidateBeforeCall(order, xGateExptime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listAllOpenOrdersCall(Integer page, Integer limit, String account, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/spot/open_orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } @@ -1790,18 +2030,6 @@ private okhttp3.Call listOrdersCall(String currencyPair, String status, Integer localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); } - if (from != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); - } - - if (to != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); - } - - if (side != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -1824,203 +2052,154 @@ private okhttp3.Call listOrdersCall(String currencyPair, String status, Integer } @SuppressWarnings("rawtypes") - private okhttp3.Call listOrdersValidateBeforeCall(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currencyPair' is set - if (currencyPair == null) { - throw new ApiException("Missing the required parameter 'currencyPair' when calling listOrders(Async)"); - } - - // verify the required parameter 'status' is set - if (status == null) { - throw new ApiException("Missing the required parameter 'status' when calling listOrders(Async)"); - } - - okhttp3.Call localVarCall = listOrdersCall(currencyPair, status, page, limit, account, from, to, side, _callback); + private okhttp3.Call listAllOpenOrdersValidateBeforeCall(Integer page, Integer limit, String account, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listAllOpenOrdersCall(page, limit, account, _callback); return localVarCall; } - private ApiResponse> listOrdersWithHttpInfo(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side) throws ApiException { - okhttp3.Call localVarCall = listOrdersValidateBeforeCall(currencyPair, status, page, limit, account, from, to, side, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> listAllOpenOrdersWithHttpInfo(Integer page, Integer limit, String account) throws ApiException { + okhttp3.Call localVarCall = listAllOpenOrdersValidateBeforeCall(page, limit, account, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listOrdersAsync(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listOrdersValidateBeforeCall(currencyPair, status, page, limit, account, from, to, side, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call listAllOpenOrdersAsync(Integer page, Integer limit, String account, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listAllOpenOrdersValidateBeforeCall(page, limit, account, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistOrdersRequest { - private final String currencyPair; - private final String status; + public class APIlistAllOpenOrdersRequest { private Integer page; private Integer limit; private String account; - private Long from; - private Long to; - private String side; - private APIlistOrdersRequest(String currencyPair, String status) { - this.currencyPair = currencyPair; - this.status = status; + private APIlistAllOpenOrdersRequest() { } /** * Set page * @param page Page number (optional, default to 1) - * @return APIlistOrdersRequest + * @return APIlistAllOpenOrdersRequest */ - public APIlistOrdersRequest page(Integer page) { + public APIlistAllOpenOrdersRequest page(Integer page) { this.page = page; return this; } /** * Set limit - * @param limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) - * @return APIlistOrdersRequest + * @param limit Maximum number of records returned in one page in each currency pair (optional, default to 100) + * @return APIlistAllOpenOrdersRequest */ - public APIlistOrdersRequest limit(Integer limit) { + public APIlistAllOpenOrdersRequest limit(Integer limit) { this.limit = limit; return this; } /** * Set account - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @return APIlistOrdersRequest + * @param account Specify query account (optional) + * @return APIlistAllOpenOrdersRequest */ - public APIlistOrdersRequest account(String account) { + public APIlistAllOpenOrdersRequest account(String account) { this.account = account; return this; } /** - * Set from - * @param from Time range beginning, default to 7 days before current time (optional) - * @return APIlistOrdersRequest - */ - public APIlistOrdersRequest from(Long from) { - this.from = from; - return this; - } - - /** - * Set to - * @param to Time range ending, default to current time (optional) - * @return APIlistOrdersRequest - */ - public APIlistOrdersRequest to(Long to) { - this.to = to; - return this; - } - - /** - * Set side - * @param side All bids or asks. Both included if not specified (optional) - * @return APIlistOrdersRequest - */ - public APIlistOrdersRequest side(String side) { - this.side = side; - return this; - } - - /** - * Build call for listOrders + * Build call for listAllOpenOrders * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listOrdersCall(currencyPair, status, page, limit, account, from, to, side, _callback); + return listAllOpenOrdersCall(page, limit, account, _callback); } /** - * Execute listOrders request - * @return List<Order> + * Execute listAllOpenOrders request + * @return List<OpenOrders> * @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 List retrieved -
200 List retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listOrdersWithHttpInfo(currencyPair, status, page, limit, account, from, to, side); + public List execute() throws ApiException { + ApiResponse> localVarResp = listAllOpenOrdersWithHttpInfo(page, limit, account); return localVarResp.getData(); } /** - * Execute listOrders request with HTTP info returned - * @return ApiResponse<List<Order>> + * Execute listAllOpenOrders request with HTTP info returned + * @return ApiResponse<List<OpenOrders>> * @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 List retrieved -
200 List retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listOrdersWithHttpInfo(currencyPair, status, page, limit, account, from, to, side); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listAllOpenOrdersWithHttpInfo(page, limit, account); } /** - * Execute listOrders request (asynchronously) + * Execute listAllOpenOrders request (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 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listOrdersAsync(currencyPair, status, page, limit, account, from, to, side, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listAllOpenOrdersAsync(page, limit, account, _callback); } } /** - * 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. - * @param currencyPair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - * @param status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) - * @return APIlistOrdersRequest + * List all open orders + * 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. + * @return APIlistAllOpenOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public APIlistOrdersRequest listOrders(String currencyPair, String status) { - return new APIlistOrdersRequest(currencyPair, status); + public APIlistAllOpenOrdersRequest listAllOpenOrders() { + return new APIlistAllOpenOrdersRequest(); } /** - * Build call for createOrder - * @param order (required) + * Build call for createCrossLiquidateOrder + * @param liquidateOrder (required) * @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
201 Order created. -
201 Order created successfully -
*/ - public okhttp3.Call createOrderCall(Order order, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = order; + public okhttp3.Call createCrossLiquidateOrderCall(LiquidateOrder liquidateOrder, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = liquidateOrder; // create path and map variables - String localVarPath = "/spot/orders"; + String localVarPath = "/spot/cross_liquidate_orders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2046,86 +2225,72 @@ public okhttp3.Call createOrderCall(Order order, final ApiCallback _callback) th } @SuppressWarnings("rawtypes") - private okhttp3.Call createOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'order' is set - if (order == null) { - throw new ApiException("Missing the required parameter 'order' when calling createOrder(Async)"); + private okhttp3.Call createCrossLiquidateOrderValidateBeforeCall(LiquidateOrder liquidateOrder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'liquidateOrder' is set + if (liquidateOrder == null) { + throw new ApiException("Missing the required parameter 'liquidateOrder' when calling createCrossLiquidateOrder(Async)"); } - okhttp3.Call localVarCall = createOrderCall(order, _callback); + okhttp3.Call localVarCall = createCrossLiquidateOrderCall(liquidateOrder, _callback); return localVarCall; } /** - * 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. - * @param order (required) + * 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 + * @param liquidateOrder (required) * @return Order * @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
201 Order created. -
201 Order created successfully -
*/ - public Order createOrder(Order order) throws ApiException { - ApiResponse localVarResp = createOrderWithHttpInfo(order); + public Order createCrossLiquidateOrder(LiquidateOrder liquidateOrder) throws ApiException { + ApiResponse localVarResp = createCrossLiquidateOrderWithHttpInfo(liquidateOrder); return localVarResp.getData(); } /** - * 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. - * @param order (required) + * 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 + * @param liquidateOrder (required) * @return ApiResponse<Order> * @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
201 Order created. -
201 Order created successfully -
*/ - public ApiResponse createOrderWithHttpInfo(Order order) throws ApiException { - okhttp3.Call localVarCall = createOrderValidateBeforeCall(order, null); + public ApiResponse createCrossLiquidateOrderWithHttpInfo(LiquidateOrder liquidateOrder) throws ApiException { + okhttp3.Call localVarCall = createCrossLiquidateOrderValidateBeforeCall(liquidateOrder, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create an order (asynchronously) - * 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. - * @param order (required) + * Close position when cross-currency is disabled (asynchronously) + * 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 + * @param liquidateOrder (required) * @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
201 Order created. -
201 Order created successfully -
*/ - public okhttp3.Call createOrderAsync(Order order, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createOrderValidateBeforeCall(order, _callback); + public okhttp3.Call createCrossLiquidateOrderAsync(LiquidateOrder liquidateOrder, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createCrossLiquidateOrderValidateBeforeCall(liquidateOrder, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for cancelOrders - * @param currencyPair Currency pair (required) - * @param side All bids or asks. Both included if not specified (optional) - * @param account Specify account type. Default to all account types being included (optional) - * @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 Batch cancellation request accepted. Query order status by listing orders -
- */ - public okhttp3.Call cancelOrdersCall(String currencyPair, String side, String account, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listOrdersCall(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -2137,14 +2302,34 @@ public okhttp3.Call cancelOrdersCall(String currencyPair, String side, String ac localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); } - if (side != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } if (account != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); } + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (side != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2163,98 +2348,1222 @@ public okhttp3.Call cancelOrdersCall(String currencyPair, String side, String ac localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelOrdersValidateBeforeCall(String currencyPair, String side, String account, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listOrdersValidateBeforeCall(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side, final ApiCallback _callback) throws ApiException { // verify the required parameter 'currencyPair' is set if (currencyPair == null) { - throw new ApiException("Missing the required parameter 'currencyPair' when calling cancelOrders(Async)"); + throw new ApiException("Missing the required parameter 'currencyPair' when calling listOrders(Async)"); + } + + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException("Missing the required parameter 'status' when calling listOrders(Async)"); } - okhttp3.Call localVarCall = cancelOrdersCall(currencyPair, side, account, _callback); + okhttp3.Call localVarCall = listOrdersCall(currencyPair, status, page, limit, account, from, to, side, _callback); + return localVarCall; + } + + + private ApiResponse> listOrdersWithHttpInfo(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side) throws ApiException { + okhttp3.Call localVarCall = listOrdersValidateBeforeCall(currencyPair, status, page, limit, account, from, to, side, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listOrdersAsync(String currencyPair, String status, Integer page, Integer limit, String account, Long from, Long to, String side, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listOrdersValidateBeforeCall(currencyPair, status, page, limit, account, from, to, side, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + public class APIlistOrdersRequest { + private final String currencyPair; + private final String status; + private Integer page; + private Integer limit; + private String account; + private Long from; + private Long to; + private String side; + + private APIlistOrdersRequest(String currencyPair, String status) { + this.currencyPair = currencyPair; + this.status = status; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistOrdersRequest + */ + public APIlistOrdersRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) + * @return APIlistOrdersRequest + */ + public APIlistOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set account + * @param account Specify query account (optional) + * @return APIlistOrdersRequest + */ + public APIlistOrdersRequest account(String account) { + this.account = account; + return this; + } + + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistOrdersRequest + */ + public APIlistOrdersRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistOrdersRequest + */ + public APIlistOrdersRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set side + * @param side Specify all bids or all asks, both included if not specified (optional) + * @return APIlistOrdersRequest + */ + public APIlistOrdersRequest side(String side) { + this.side = side; + return this; + } + + /** + * Build call for listOrders + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listOrdersCall(currencyPair, status, page, limit, account, from, to, side, _callback); + } + + /** + * Execute listOrders request + * @return List<Order> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listOrdersWithHttpInfo(currencyPair, status, page, limit, account, from, to, side); + return localVarResp.getData(); + } + + /** + * Execute listOrders request with HTTP info returned + * @return ApiResponse<List<Order>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listOrdersWithHttpInfo(currencyPair, status, page, limit, account, from, to, side); + } + + /** + * Execute listOrders request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listOrdersAsync(currencyPair, status, page, limit, account, from, to, side, _callback); + } + } + /** - * 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 - * @param currencyPair Currency pair (required) - * @param side All bids or asks. Both included if not specified (optional) - * @param account Specify account type. Default to all account types being included (optional) - * @return List<Order> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * List orders + * 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. + * @param currencyPair Query by specified currency pair. Required for open orders, optional for filled orders (required) + * @param status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) + * @return APIlistOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 Batch cancellation request accepted. Query order status by listing orders -
200 List retrieved successfully -
*/ - public List cancelOrders(String currencyPair, String side, String account) throws ApiException { - ApiResponse> localVarResp = cancelOrdersWithHttpInfo(currencyPair, side, account); - return localVarResp.getData(); + public APIlistOrdersRequest listOrders(String currencyPair, String status) { + return new APIlistOrdersRequest(currencyPair, status); } - /** - * 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 - * @param currencyPair Currency pair (required) - * @param side All bids or asks. Both included if not specified (optional) - * @param account Specify account type. Default to all account types being included (optional) - * @return ApiResponse<List<Order>> - * @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 Batch cancellation request accepted. Query order status by listing orders -
- */ - public ApiResponse> cancelOrdersWithHttpInfo(String currencyPair, String side, String account) throws ApiException { - okhttp3.Call localVarCall = cancelOrdersValidateBeforeCall(currencyPair, side, account, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + /** + * Build call for createOrder + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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
201 Order created -
+ */ + public okhttp3.Call createOrderCall(Order order, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = order; + + // create path and map variables + String localVarPath = "/spot/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOrderValidateBeforeCall(Order order, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling createOrder(Async)"); + } + + okhttp3.Call localVarCall = createOrderCall(order, xGateExptime, _callback); + return localVarCall; + } + + /** + * Create an order + * 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 + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return Order + * @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
201 Order created -
+ */ + public Order createOrder(Order order, String xGateExptime) throws ApiException { + ApiResponse localVarResp = createOrderWithHttpInfo(order, xGateExptime); + return localVarResp.getData(); + } + + /** + * Create an order + * 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 + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<Order> + * @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
201 Order created -
+ */ + public ApiResponse createOrderWithHttpInfo(Order order, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = createOrderValidateBeforeCall(order, xGateExptime, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an order (asynchronously) + * 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 + * @param order (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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
201 Order created -
+ */ + public okhttp3.Call createOrderAsync(Order order, String xGateExptime, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createOrderValidateBeforeCall(order, xGateExptime, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for cancelOrders + * @param currencyPair Currency pair (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @param account Specify account type Classic account: All are included if not specified Unified account: Specify `unified` (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Batch cancellation request accepted and processed, success determined by order list -
+ */ + public okhttp3.Call cancelOrdersCall(String currencyPair, String side, String account, String actionMode, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/spot/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (side != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("side", side)); + } + + if (account != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + } + + if (actionMode != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("action_mode", actionMode)); + } + + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelOrdersValidateBeforeCall(String currencyPair, String side, String account, String actionMode, String xGateExptime, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = cancelOrdersCall(currencyPair, side, account, actionMode, xGateExptime, _callback); + return localVarCall; + } + + /** + * Cancel all `open` orders in specified currency pair + * 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 + * @param currencyPair Currency pair (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @param account Specify account type Classic account: All are included if not specified Unified account: Specify `unified` (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return List<OrderCancel> + * @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 Batch cancellation request accepted and processed, success determined by order list -
+ */ + public List cancelOrders(String currencyPair, String side, String account, String actionMode, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = cancelOrdersWithHttpInfo(currencyPair, side, account, actionMode, xGateExptime); + return localVarResp.getData(); + } + + /** + * Cancel all `open` orders in specified currency pair + * 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 + * @param currencyPair Currency pair (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @param account Specify account type Classic account: All are included if not specified Unified account: Specify `unified` (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<List<OrderCancel>> + * @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 Batch cancellation request accepted and processed, success determined by order list -
+ */ + public ApiResponse> cancelOrdersWithHttpInfo(String currencyPair, String side, String account, String actionMode, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = cancelOrdersValidateBeforeCall(currencyPair, side, account, actionMode, xGateExptime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel all `open` orders in specified currency pair (asynchronously) + * 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 + * @param currencyPair Currency pair (optional) + * @param side Specify all bids or all asks, both included if not specified (optional) + * @param account Specify account type Classic account: All are included if not specified Unified account: Specify `unified` (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Batch cancellation request accepted and processed, success determined by order list -
+ */ + public okhttp3.Call cancelOrdersAsync(String currencyPair, String side, String account, String actionMode, String xGateExptime, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = cancelOrdersValidateBeforeCall(currencyPair, side, account, actionMode, xGateExptime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for cancelBatchOrders + * @param cancelBatchOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Batch cancellation completed -
+ */ + public okhttp3.Call cancelBatchOrdersCall(List cancelBatchOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = cancelBatchOrder; + + // create path and map variables + String localVarPath = "/spot/cancel_batch_orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelBatchOrdersValidateBeforeCall(List cancelBatchOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'cancelBatchOrder' is set + if (cancelBatchOrder == null) { + throw new ApiException("Missing the required parameter 'cancelBatchOrder' when calling cancelBatchOrders(Async)"); + } + + okhttp3.Call localVarCall = cancelBatchOrdersCall(cancelBatchOrder, xGateExptime, _callback); + return localVarCall; + } + + /** + * Cancel batch orders by specified ID list + * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request + * @param cancelBatchOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return List<CancelOrderResult> + * @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 Batch cancellation completed -
+ */ + public List cancelBatchOrders(List cancelBatchOrder, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = cancelBatchOrdersWithHttpInfo(cancelBatchOrder, xGateExptime); + return localVarResp.getData(); + } + + /** + * Cancel batch orders by specified ID list + * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request + * @param cancelBatchOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<List<CancelOrderResult>> + * @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 Batch cancellation completed -
+ */ + public ApiResponse> cancelBatchOrdersWithHttpInfo(List cancelBatchOrder, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = cancelBatchOrdersValidateBeforeCall(cancelBatchOrder, xGateExptime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel batch orders by specified ID list (asynchronously) + * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request + * @param cancelBatchOrder (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Batch cancellation completed -
+ */ + public okhttp3.Call cancelBatchOrdersAsync(List cancelBatchOrder, String xGateExptime, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = cancelBatchOrdersValidateBeforeCall(cancelBatchOrder, xGateExptime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getOrder + * @param orderId 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) (required) + * @param currencyPair 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. (required) + * @param account Specify query account (optional) + * @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 Detail retrieved -
+ */ + public okhttp3.Call getOrderCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/spot/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (account != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + } + + 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 getOrderValidateBeforeCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling getOrder(Async)"); + } + + // verify the required parameter 'currencyPair' is set + if (currencyPair == null) { + throw new ApiException("Missing the required parameter 'currencyPair' when calling getOrder(Async)"); + } + + okhttp3.Call localVarCall = getOrderCall(orderId, currencyPair, account, _callback); + return localVarCall; + } + + /** + * Query single order details + * By default, queries orders for spot, unified account, and isolated margin accounts. + * @param orderId 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) (required) + * @param currencyPair 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. (required) + * @param account Specify query account (optional) + * @return Order + * @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 Detail retrieved -
+ */ + public Order getOrder(String orderId, String currencyPair, String account) throws ApiException { + ApiResponse localVarResp = getOrderWithHttpInfo(orderId, currencyPair, account); + return localVarResp.getData(); + } + + /** + * Query single order details + * By default, queries orders for spot, unified account, and isolated margin accounts. + * @param orderId 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) (required) + * @param currencyPair 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. (required) + * @param account Specify query account (optional) + * @return ApiResponse<Order> + * @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 Detail retrieved -
+ */ + public ApiResponse getOrderWithHttpInfo(String orderId, String currencyPair, String account) throws ApiException { + okhttp3.Call localVarCall = getOrderValidateBeforeCall(orderId, currencyPair, account, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query single order details (asynchronously) + * By default, queries orders for spot, unified account, and isolated margin accounts. + * @param orderId 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) (required) + * @param currencyPair 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. (required) + * @param account Specify query account (optional) + * @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 Detail retrieved -
+ */ + public okhttp3.Call getOrderAsync(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getOrderValidateBeforeCall(orderId, currencyPair, account, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for cancelOrder + * @param orderId 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) (required) + * @param currencyPair Currency pair (required) + * @param account Specify query account (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order cancelled -
+ */ + public okhttp3.Call cancelOrderCall(String orderId, String currencyPair, String account, String actionMode, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/spot/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (account != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + } + + if (actionMode != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("action_mode", actionMode)); + } + + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelOrderValidateBeforeCall(String orderId, String currencyPair, String account, String actionMode, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling cancelOrder(Async)"); + } + + // verify the required parameter 'currencyPair' is set + if (currencyPair == null) { + throw new ApiException("Missing the required parameter 'currencyPair' when calling cancelOrder(Async)"); + } + + okhttp3.Call localVarCall = cancelOrderCall(orderId, currencyPair, account, actionMode, xGateExptime, _callback); + return localVarCall; + } + + /** + * Cancel single order + * By default, orders for spot, unified accounts and leveraged accounts are revoked. + * @param orderId 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) (required) + * @param currencyPair Currency pair (required) + * @param account Specify query account (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return Order + * @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 Order cancelled -
+ */ + public Order cancelOrder(String orderId, String currencyPair, String account, String actionMode, String xGateExptime) throws ApiException { + ApiResponse localVarResp = cancelOrderWithHttpInfo(orderId, currencyPair, account, actionMode, xGateExptime); + return localVarResp.getData(); + } + + /** + * Cancel single order + * By default, orders for spot, unified accounts and leveraged accounts are revoked. + * @param orderId 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) (required) + * @param currencyPair Currency pair (required) + * @param account Specify query account (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<Order> + * @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 Order cancelled -
+ */ + public ApiResponse cancelOrderWithHttpInfo(String orderId, String currencyPair, String account, String actionMode, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderId, currencyPair, account, actionMode, xGateExptime, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel single order (asynchronously) + * By default, orders for spot, unified accounts and leveraged accounts are revoked. + * @param orderId 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) (required) + * @param currencyPair Currency pair (required) + * @param account Specify query account (optional) + * @param actionMode 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) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Order cancelled -
+ */ + public okhttp3.Call cancelOrderAsync(String orderId, String currencyPair, String account, String actionMode, String xGateExptime, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderId, currencyPair, account, actionMode, xGateExptime, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for amendOrder + * @param orderId 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) (required) + * @param orderPatch (required) + * @param currencyPair Currency pair (optional) + * @param account Specify query account (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Updated successfully -
+ */ + public okhttp3.Call amendOrderCall(String orderId, OrderPatch orderPatch, String currencyPair, String account, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = orderPatch; + + // create path and map variables + String localVarPath = "/spot/orders/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (account != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + } + + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); + } + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call amendOrderValidateBeforeCall(String orderId, OrderPatch orderPatch, String currencyPair, String account, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling amendOrder(Async)"); + } + + // verify the required parameter 'orderPatch' is set + if (orderPatch == null) { + throw new ApiException("Missing the required parameter 'orderPatch' when calling amendOrder(Async)"); + } + + okhttp3.Call localVarCall = amendOrderCall(orderId, orderPatch, currencyPair, account, xGateExptime, _callback); + return localVarCall; + } + + /** + * 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. + * @param orderId 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) (required) + * @param orderPatch (required) + * @param currencyPair Currency pair (optional) + * @param account Specify query account (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return Order + * @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 Updated successfully -
+ */ + public Order amendOrder(String orderId, OrderPatch orderPatch, String currencyPair, String account, String xGateExptime) throws ApiException { + ApiResponse localVarResp = amendOrderWithHttpInfo(orderId, orderPatch, currencyPair, account, xGateExptime); + return localVarResp.getData(); + } + + /** + * 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. + * @param orderId 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) (required) + * @param orderPatch (required) + * @param currencyPair Currency pair (optional) + * @param account Specify query account (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<Order> + * @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 Updated successfully -
+ */ + public ApiResponse amendOrderWithHttpInfo(String orderId, OrderPatch orderPatch, String currencyPair, String account, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = amendOrderValidateBeforeCall(orderId, orderPatch, currencyPair, account, xGateExptime, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Amend single order (asynchronously) + * 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. + * @param orderId 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) (required) + * @param orderPatch (required) + * @param currencyPair Currency pair (optional) + * @param account Specify query account (optional) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @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 Updated successfully -
+ */ + public okhttp3.Call amendOrderAsync(String orderId, OrderPatch orderPatch, String currencyPair, String account, String xGateExptime, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = amendOrderValidateBeforeCall(orderId, orderPatch, currencyPair, account, xGateExptime, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listMyTradesCall(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/spot/my_trades"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (orderId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_id", orderId)); + } + + if (account != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + 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 listMyTradesValidateBeforeCall(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMyTradesCall(currencyPair, limit, page, orderId, account, from, to, _callback); + return localVarCall; + } + + + private ApiResponse> listMyTradesWithHttpInfo(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to) throws ApiException { + okhttp3.Call localVarCall = listMyTradesValidateBeforeCall(currencyPair, limit, page, orderId, account, from, to, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listMyTradesAsync(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listMyTradesValidateBeforeCall(currencyPair, limit, page, orderId, account, from, to, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistMyTradesRequest { + private String currencyPair; + private Integer limit; + private Integer page; + private String orderId; + private String account; + private Long from; + private Long to; + + private APIlistMyTradesRequest() { + } + + /** + * Set currencyPair + * @param currencyPair Retrieve results with specified currency pair (optional) + * @return APIlistMyTradesRequest + */ + public APIlistMyTradesRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 (optional, default to 100) + * @return APIlistMyTradesRequest + */ + public APIlistMyTradesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistMyTradesRequest + */ + public APIlistMyTradesRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set orderId + * @param orderId Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) + * @return APIlistMyTradesRequest + */ + public APIlistMyTradesRequest orderId(String orderId) { + this.orderId = orderId; + return this; + } + + /** + * Set account + * @param account Specify query account (optional) + * @return APIlistMyTradesRequest + */ + public APIlistMyTradesRequest account(String account) { + this.account = account; + return this; + } + + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistMyTradesRequest + */ + public APIlistMyTradesRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistMyTradesRequest + */ + public APIlistMyTradesRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Build call for listMyTrades + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listMyTradesCall(currencyPair, limit, page, orderId, account, from, to, _callback); + } + + /** + * Execute listMyTrades request + * @return List<Trade> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listMyTradesWithHttpInfo(currencyPair, limit, page, orderId, account, from, to); + return localVarResp.getData(); + } + + /** + * Execute listMyTrades request with HTTP info returned + * @return ApiResponse<List<Trade>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMyTradesWithHttpInfo(currencyPair, limit, page, orderId, account, from, to); + } + + /** + * Execute listMyTrades request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMyTradesAsync(currencyPair, limit, page, orderId, account, from, to, _callback); + } } /** - * Cancel all `open` orders in specified currency pair (asynchronously) - * 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 - * @param currencyPair Currency pair (required) - * @param side All bids or asks. Both included if not specified (optional) - * @param account Specify account type. Default to all account types being included (optional) - * @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 + * Query personal trading records + * 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. + * @return APIlistMyTradesRequest * @http.response.details - +
Status Code Description Response Headers
200 Batch cancellation request accepted. Query order status by listing orders -
200 List retrieved successfully -
*/ - public okhttp3.Call cancelOrdersAsync(String currencyPair, String side, String account, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = cancelOrdersValidateBeforeCall(currencyPair, side, account, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; + public APIlistMyTradesRequest listMyTrades() { + return new APIlistMyTradesRequest(); } /** - * Build call for cancelBatchOrders - * @param cancelOrder (required) + * Build call for getSystemTime * @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 Batch cancellation completed -
200 Query successful -
*/ - public okhttp3.Call cancelBatchOrdersCall(List cancelOrder, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = cancelOrder; + public okhttp3.Call getSystemTimeCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/spot/cancel_batch_orders"; + String localVarPath = "/spot/time"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2270,112 +3579,93 @@ public okhttp3.Call cancelBatchOrdersCall(List cancelOrder, final A } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelBatchOrdersValidateBeforeCall(List cancelOrder, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'cancelOrder' is set - if (cancelOrder == null) { - throw new ApiException("Missing the required parameter 'cancelOrder' when calling cancelBatchOrders(Async)"); - } - - okhttp3.Call localVarCall = cancelBatchOrdersCall(cancelOrder, _callback); + private okhttp3.Call getSystemTimeValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getSystemTimeCall(_callback); return localVarCall; } /** - * Cancel a batch of orders with an ID list - * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request - * @param cancelOrder (required) - * @return List<CancelOrderResult> + * Get server current time + * + * @return SystemTime * @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 Batch cancellation completed -
200 Query successful -
*/ - public List cancelBatchOrders(List cancelOrder) throws ApiException { - ApiResponse> localVarResp = cancelBatchOrdersWithHttpInfo(cancelOrder); + public SystemTime getSystemTime() throws ApiException { + ApiResponse localVarResp = getSystemTimeWithHttpInfo(); return localVarResp.getData(); } /** - * Cancel a batch of orders with an ID list - * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request - * @param cancelOrder (required) - * @return ApiResponse<List<CancelOrderResult>> + * Get server current time + * + * @return ApiResponse<SystemTime> * @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 Batch cancellation completed -
200 Query successful -
*/ - public ApiResponse> cancelBatchOrdersWithHttpInfo(List cancelOrder) throws ApiException { - okhttp3.Call localVarCall = cancelBatchOrdersValidateBeforeCall(cancelOrder, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + public ApiResponse getSystemTimeWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSystemTimeValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Cancel a batch of orders with an ID list (asynchronously) - * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request - * @param cancelOrder (required) + * Get server current time (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 Batch cancellation completed -
200 Query successful -
*/ - public okhttp3.Call cancelBatchOrdersAsync(List cancelOrder, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = cancelBatchOrdersValidateBeforeCall(cancelOrder, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + public okhttp3.Call getSystemTimeAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getSystemTimeValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getOrder - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * Build call for countdownCancelAllSpot + * @param countdownCancelAllSpotTask (required) * @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 Detail retrieved -
200 Countdown set successfully -
*/ - public okhttp3.Call getOrderCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public okhttp3.Call countdownCancelAllSpotCall(CountdownCancelAllSpotTask countdownCancelAllSpotTask, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = countdownCancelAllSpotTask; // create path and map variables - String localVarPath = "/spot/orders/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + String localVarPath = "/spot/countdown_cancel_all"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currencyPair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); - } - - if (account != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -2388,124 +3678,107 @@ public okhttp3.Call getOrderCall(String orderId, String currencyPair, String acc } final String[] localVarContentTypes = { - + "application/json" }; 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); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getOrderValidateBeforeCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId' when calling getOrder(Async)"); - } - - // verify the required parameter 'currencyPair' is set - if (currencyPair == null) { - throw new ApiException("Missing the required parameter 'currencyPair' when calling getOrder(Async)"); + private okhttp3.Call countdownCancelAllSpotValidateBeforeCall(CountdownCancelAllSpotTask countdownCancelAllSpotTask, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'countdownCancelAllSpotTask' is set + if (countdownCancelAllSpotTask == null) { + throw new ApiException("Missing the required parameter 'countdownCancelAllSpotTask' when calling countdownCancelAllSpot(Async)"); } - okhttp3.Call localVarCall = getOrderCall(orderId, currencyPair, account, _callback); + okhttp3.Call localVarCall = countdownCancelAllSpotCall(countdownCancelAllSpotTask, _callback); return localVarCall; } /** - * Get a single order - * Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin` - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @return Order + * 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. + * @param countdownCancelAllSpotTask (required) + * @return TriggerTime * @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 Detail retrieved -
200 Countdown set successfully -
*/ - public Order getOrder(String orderId, String currencyPair, String account) throws ApiException { - ApiResponse localVarResp = getOrderWithHttpInfo(orderId, currencyPair, account); + public TriggerTime countdownCancelAllSpot(CountdownCancelAllSpotTask countdownCancelAllSpotTask) throws ApiException { + ApiResponse localVarResp = countdownCancelAllSpotWithHttpInfo(countdownCancelAllSpotTask); return localVarResp.getData(); } /** - * Get a single order - * Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin` - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @return ApiResponse<Order> + * 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. + * @param countdownCancelAllSpotTask (required) + * @return ApiResponse<TriggerTime> * @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 Detail retrieved -
200 Countdown set successfully -
*/ - public ApiResponse getOrderWithHttpInfo(String orderId, String currencyPair, String account) throws ApiException { - okhttp3.Call localVarCall = getOrderValidateBeforeCall(orderId, currencyPair, account, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse countdownCancelAllSpotWithHttpInfo(CountdownCancelAllSpotTask countdownCancelAllSpotTask) throws ApiException { + okhttp3.Call localVarCall = countdownCancelAllSpotValidateBeforeCall(countdownCancelAllSpotTask, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get a single order (asynchronously) - * Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin` - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * Countdown cancel orders (asynchronously) + * 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. + * @param countdownCancelAllSpotTask (required) * @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 Detail retrieved -
200 Countdown set successfully -
*/ - public okhttp3.Call getOrderAsync(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getOrderValidateBeforeCall(orderId, currencyPair, account, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call countdownCancelAllSpotAsync(CountdownCancelAllSpotTask countdownCancelAllSpotTask, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = countdownCancelAllSpotValidateBeforeCall(countdownCancelAllSpotTask, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for cancelOrder - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * Build call for amendBatchOrders + * @param batchAmendItem (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @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 Order cancelled -
200 Order modification executed successfully -
*/ - public okhttp3.Call cancelOrderCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public okhttp3.Call amendBatchOrdersCall(List batchAmendItem, String xGateExptime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = batchAmendItem; // create path and map variables - String localVarPath = "/spot/orders/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId)); + String localVarPath = "/spot/amend_batch_orders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currencyPair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); - } - - if (account != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + Map localVarHeaderParams = new HashMap(); + if (xGateExptime != null) { + localVarHeaderParams.put("x-gate-exptime", localVarApiClient.parameterToString(xGateExptime)); } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { @@ -2517,118 +3790,106 @@ public okhttp3.Call cancelOrderCall(String orderId, String currencyPair, String } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelOrderValidateBeforeCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId' when calling cancelOrder(Async)"); - } - - // verify the required parameter 'currencyPair' is set - if (currencyPair == null) { - throw new ApiException("Missing the required parameter 'currencyPair' when calling cancelOrder(Async)"); + private okhttp3.Call amendBatchOrdersValidateBeforeCall(List batchAmendItem, String xGateExptime, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'batchAmendItem' is set + if (batchAmendItem == null) { + throw new ApiException("Missing the required parameter 'batchAmendItem' when calling amendBatchOrders(Async)"); } - okhttp3.Call localVarCall = cancelOrderCall(orderId, currencyPair, account, _callback); + okhttp3.Call localVarCall = amendBatchOrdersCall(batchAmendItem, xGateExptime, _callback); return localVarCall; } /** - * Cancel a single order - * Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin` - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @return Order + * 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. + * @param batchAmendItem (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return List<BatchOrder> * @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 Order cancelled -
200 Order modification executed successfully -
*/ - public Order cancelOrder(String orderId, String currencyPair, String account) throws ApiException { - ApiResponse localVarResp = cancelOrderWithHttpInfo(orderId, currencyPair, account); + public List amendBatchOrders(List batchAmendItem, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = amendBatchOrdersWithHttpInfo(batchAmendItem, xGateExptime); return localVarResp.getData(); } /** - * Cancel a single order - * Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin` - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @return ApiResponse<Order> + * 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. + * @param batchAmendItem (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + * @return ApiResponse<List<BatchOrder>> * @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 Order cancelled -
200 Order modification executed successfully -
*/ - public ApiResponse cancelOrderWithHttpInfo(String orderId, String currencyPair, String account) throws ApiException { - okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderId, currencyPair, account, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse> amendBatchOrdersWithHttpInfo(List batchAmendItem, String xGateExptime) throws ApiException { + okhttp3.Call localVarCall = amendBatchOrdersValidateBeforeCall(batchAmendItem, xGateExptime, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Cancel a single order (asynchronously) - * Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin` - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * Batch modification of orders (asynchronously) + * 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. + * @param batchAmendItem (required) + * @param xGateExptime Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) * @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 Order cancelled -
200 Order modification executed successfully -
*/ - public okhttp3.Call cancelOrderAsync(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderId, currencyPair, account, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call amendBatchOrdersAsync(List batchAmendItem, String xGateExptime, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = amendBatchOrdersValidateBeforeCall(batchAmendItem, xGateExptime, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - private okhttp3.Call listMyTradesCall(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getSpotInsuranceHistoryCall(String business, String currency, Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/spot/my_trades"; + String localVarPath = "/spot/insurance_history"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currencyPair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + if (business != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("business", business)); } - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); } if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } - if (orderId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_id", orderId)); - } - - if (account != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("account", account)); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } if (from != null) { @@ -2656,181 +3917,161 @@ private okhttp3.Call listMyTradesCall(String currencyPair, Integer limit, Intege final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); - String[] localVarAuthNames = new String[] { "apiv4" }; + String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listMyTradesValidateBeforeCall(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'currencyPair' is set - if (currencyPair == null) { - throw new ApiException("Missing the required parameter 'currencyPair' when calling listMyTrades(Async)"); + private okhttp3.Call getSpotInsuranceHistoryValidateBeforeCall(String business, String currency, Long from, Long to, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'business' is set + if (business == null) { + throw new ApiException("Missing the required parameter 'business' when calling getSpotInsuranceHistory(Async)"); } - okhttp3.Call localVarCall = listMyTradesCall(currencyPair, limit, page, orderId, account, from, to, _callback); + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getSpotInsuranceHistory(Async)"); + } + + // verify the required parameter 'from' is set + if (from == null) { + throw new ApiException("Missing the required parameter 'from' when calling getSpotInsuranceHistory(Async)"); + } + + // verify the required parameter 'to' is set + if (to == null) { + throw new ApiException("Missing the required parameter 'to' when calling getSpotInsuranceHistory(Async)"); + } + + okhttp3.Call localVarCall = getSpotInsuranceHistoryCall(business, currency, from, to, page, limit, _callback); return localVarCall; } - private ApiResponse> listMyTradesWithHttpInfo(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to) throws ApiException { - okhttp3.Call localVarCall = listMyTradesValidateBeforeCall(currencyPair, limit, page, orderId, account, from, to, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> getSpotInsuranceHistoryWithHttpInfo(String business, String currency, Long from, Long to, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = getSpotInsuranceHistoryValidateBeforeCall(business, currency, from, to, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listMyTradesAsync(String currencyPair, Integer limit, Integer page, String orderId, String account, Long from, Long to, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listMyTradesValidateBeforeCall(currencyPair, limit, page, orderId, account, from, to, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call getSpotInsuranceHistoryAsync(String business, String currency, Long from, Long to, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getSpotInsuranceHistoryValidateBeforeCall(business, currency, from, to, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistMyTradesRequest { - private final String currencyPair; - private Integer limit; + public class APIgetSpotInsuranceHistoryRequest { + private final String business; + private final String currency; + private final Long from; + private final Long to; private Integer page; - private String orderId; - private String account; - private Long from; - private Long to; - - private APIlistMyTradesRequest(String currencyPair) { - this.currencyPair = currencyPair; - } + private Integer limit; - /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistMyTradesRequest - */ - public APIlistMyTradesRequest limit(Integer limit) { - this.limit = limit; - return this; + private APIgetSpotInsuranceHistoryRequest(String business, String currency, Long from, Long to) { + this.business = business; + this.currency = currency; + this.from = from; + this.to = to; } /** * Set page * @param page Page number (optional, default to 1) - * @return APIlistMyTradesRequest + * @return APIgetSpotInsuranceHistoryRequest */ - public APIlistMyTradesRequest page(Integer page) { + public APIgetSpotInsuranceHistoryRequest page(Integer page) { this.page = page; return this; } /** - * Set orderId - * @param orderId Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) - * @return APIlistMyTradesRequest - */ - public APIlistMyTradesRequest orderId(String orderId) { - this.orderId = orderId; - return this; - } - - /** - * Set account - * @param account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @return APIlistMyTradesRequest - */ - public APIlistMyTradesRequest account(String account) { - this.account = account; - return this; - } - - /** - * Set from - * @param from Time range beginning, default to 7 days before current time (optional) - * @return APIlistMyTradesRequest - */ - public APIlistMyTradesRequest from(Long from) { - this.from = from; - return this; - } - - /** - * Set to - * @param to Time range ending, default to current time (optional) - * @return APIlistMyTradesRequest + * Set limit + * @param limit The maximum number of items returned in the list, the default value is 30 (optional, default to 30) + * @return APIgetSpotInsuranceHistoryRequest */ - public APIlistMyTradesRequest to(Long to) { - this.to = to; + public APIgetSpotInsuranceHistoryRequest limit(Integer limit) { + this.limit = limit; return this; } /** - * Build call for listMyTrades + * Build call for getSpotInsuranceHistory * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listMyTradesCall(currencyPair, limit, page, orderId, account, from, to, _callback); + return getSpotInsuranceHistoryCall(business, currency, from, to, page, limit, _callback); } /** - * Execute listMyTrades request - * @return List<Trade> + * Execute getSpotInsuranceHistory request + * @return List<SpotInsuranceHistory> * @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 List retrieved -
200 Query successful -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listMyTradesWithHttpInfo(currencyPair, limit, page, orderId, account, from, to); + public List execute() throws ApiException { + ApiResponse> localVarResp = getSpotInsuranceHistoryWithHttpInfo(business, currency, from, to, page, limit); return localVarResp.getData(); } /** - * Execute listMyTrades request with HTTP info returned - * @return ApiResponse<List<Trade>> + * Execute getSpotInsuranceHistory request with HTTP info returned + * @return ApiResponse<List<SpotInsuranceHistory>> * @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 List retrieved -
200 Query successful -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listMyTradesWithHttpInfo(currencyPair, limit, page, orderId, account, from, to); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getSpotInsuranceHistoryWithHttpInfo(business, currency, from, to, page, limit); } /** - * Execute listMyTrades request (asynchronously) + * Execute getSpotInsuranceHistory request (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 List retrieved -
200 Query successful -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listMyTradesAsync(currencyPair, limit, page, orderId, account, from, to, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getSpotInsuranceHistoryAsync(business, currency, from, to, page, limit, _callback); } } /** - * List personal trading history - * Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range Time range parameters are handled as order finish time. - * @param currencyPair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - * @return APIlistMyTradesRequest + * Query spot insurance fund historical data + * + * @param business Leverage business, margin - position by position; unified - unified account (required) + * @param currency Currency (required) + * @param from Start timestamp in seconds (required) + * @param to End timestamp in seconds (required) + * @return APIgetSpotInsuranceHistoryRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Query successful -
*/ - public APIlistMyTradesRequest listMyTrades(String currencyPair) { - return new APIlistMyTradesRequest(currencyPair); + public APIgetSpotInsuranceHistoryRequest getSpotInsuranceHistory(String business, String currency, Long from, Long to) { + return new APIgetSpotInsuranceHistoryRequest(business, currency, from, to); } private okhttp3.Call listSpotPriceTriggeredOrdersCall(String status, String market, String account, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { @@ -2920,7 +4161,7 @@ private APIlistSpotPriceTriggeredOrdersRequest(String status) { /** * Set market - * @param market Currency pair (optional) + * @param market Trading market (optional) * @return APIlistSpotPriceTriggeredOrdersRequest */ public APIlistSpotPriceTriggeredOrdersRequest market(String market) { @@ -2930,7 +4171,7 @@ public APIlistSpotPriceTriggeredOrdersRequest market(String market) { /** * Set account - * @param account Trading account (optional) + * @param account Trading account type. Unified account must be set to `unified` (optional) * @return APIlistSpotPriceTriggeredOrdersRequest */ public APIlistSpotPriceTriggeredOrdersRequest account(String account) { @@ -2940,7 +4181,7 @@ public APIlistSpotPriceTriggeredOrdersRequest account(String account) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistSpotPriceTriggeredOrdersRequest */ public APIlistSpotPriceTriggeredOrdersRequest limit(Integer limit) { @@ -2966,7 +4207,7 @@ public APIlistSpotPriceTriggeredOrdersRequest offset(Integer offset) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2980,7 +4221,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -2995,7 +4236,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -3010,7 +4251,7 @@ public ApiResponse> executeWithHttpInfo() throws A * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -3019,14 +4260,14 @@ public okhttp3.Call executeAsync(final ApiCallback } /** - * Retrieve running auto order list + * Query running auto order list * - * @param status Only list the orders with this status (required) + * @param status Query order list based on status (required) * @return APIlistSpotPriceTriggeredOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistSpotPriceTriggeredOrdersRequest listSpotPriceTriggeredOrders(String status) { @@ -3042,7 +4283,7 @@ public APIlistSpotPriceTriggeredOrdersRequest listSpotPriceTriggeredOrders(Strin * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public okhttp3.Call createSpotPriceTriggeredOrderCall(SpotPriceTriggeredOrder spotPriceTriggeredOrder, final ApiCallback _callback) throws ApiException { @@ -3086,7 +4327,7 @@ private okhttp3.Call createSpotPriceTriggeredOrderValidateBeforeCall(SpotPriceTr } /** - * Create a price-triggered order + * Create price-triggered order * * @param spotPriceTriggeredOrder (required) * @return TriggerOrderResponse @@ -3094,7 +4335,7 @@ private okhttp3.Call createSpotPriceTriggeredOrderValidateBeforeCall(SpotPriceTr * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public TriggerOrderResponse createSpotPriceTriggeredOrder(SpotPriceTriggeredOrder spotPriceTriggeredOrder) throws ApiException { @@ -3103,7 +4344,7 @@ public TriggerOrderResponse createSpotPriceTriggeredOrder(SpotPriceTriggeredOrde } /** - * Create a price-triggered order + * Create price-triggered order * * @param spotPriceTriggeredOrder (required) * @return ApiResponse<TriggerOrderResponse> @@ -3111,7 +4352,7 @@ public TriggerOrderResponse createSpotPriceTriggeredOrder(SpotPriceTriggeredOrde * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public ApiResponse createSpotPriceTriggeredOrderWithHttpInfo(SpotPriceTriggeredOrder spotPriceTriggeredOrder) throws ApiException { @@ -3121,7 +4362,7 @@ public ApiResponse createSpotPriceTriggeredOrderWithHttpIn } /** - * Create a price-triggered order (asynchronously) + * Create price-triggered order (asynchronously) * * @param spotPriceTriggeredOrder (required) * @param _callback The callback to be executed when the API call finishes @@ -3130,7 +4371,7 @@ public ApiResponse createSpotPriceTriggeredOrderWithHttpIn * @http.response.details - +
Status Code Description Response Headers
201 Order created -
201 Order created successfully -
*/ public okhttp3.Call createSpotPriceTriggeredOrderAsync(SpotPriceTriggeredOrder spotPriceTriggeredOrder, final ApiCallback _callback) throws ApiException { @@ -3142,15 +4383,15 @@ public okhttp3.Call createSpotPriceTriggeredOrderAsync(SpotPriceTriggeredOrder s /** * Build call for cancelSpotPriceTriggeredOrderList - * @param market Currency pair (optional) - * @param account Trading account (optional) + * @param market Trading market (optional) + * @param account Trading account type. Unified account must be set to `unified` (optional) * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public okhttp3.Call cancelSpotPriceTriggeredOrderListCall(String market, String account, final ApiCallback _callback) throws ApiException { @@ -3197,16 +4438,16 @@ private okhttp3.Call cancelSpotPriceTriggeredOrderListValidateBeforeCall(String } /** - * Cancel all open orders + * Cancel all auto orders * - * @param market Currency pair (optional) - * @param account Trading account (optional) + * @param market Trading market (optional) + * @param account Trading account type. Unified account must be set to `unified` (optional) * @return List<SpotPriceTriggeredOrder> * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public List cancelSpotPriceTriggeredOrderList(String market, String account) throws ApiException { @@ -3215,16 +4456,16 @@ public List cancelSpotPriceTriggeredOrderList(String ma } /** - * Cancel all open orders + * Cancel all auto orders * - * @param market Currency pair (optional) - * @param account Trading account (optional) + * @param market Trading market (optional) + * @param account Trading account type. Unified account must be set to `unified` (optional) * @return ApiResponse<List<SpotPriceTriggeredOrder>> * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public ApiResponse> cancelSpotPriceTriggeredOrderListWithHttpInfo(String market, String account) throws ApiException { @@ -3234,17 +4475,17 @@ public ApiResponse> cancelSpotPriceTriggeredOrderL } /** - * Cancel all open orders (asynchronously) + * Cancel all auto orders (asynchronously) * - * @param market Currency pair (optional) - * @param account Trading account (optional) + * @param market Trading market (optional) + * @param account Trading account type. Unified account must be set to `unified` (optional) * @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 Batch cancellation request accepted. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ public okhttp3.Call cancelSpotPriceTriggeredOrderListAsync(String market, String account, final ApiCallback> _callback) throws ApiException { @@ -3256,14 +4497,14 @@ public okhttp3.Call cancelSpotPriceTriggeredOrderListAsync(String market, String /** * Build call for getSpotPriceTriggeredOrder - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call getSpotPriceTriggeredOrderCall(String orderId, final ApiCallback _callback) throws ApiException { @@ -3308,15 +4549,15 @@ private okhttp3.Call getSpotPriceTriggeredOrderValidateBeforeCall(String orderId } /** - * Get a single order + * Query single auto order details * - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return SpotPriceTriggeredOrder * @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 Auto order detail -
200 Auto order details -
*/ public SpotPriceTriggeredOrder getSpotPriceTriggeredOrder(String orderId) throws ApiException { @@ -3325,15 +4566,15 @@ public SpotPriceTriggeredOrder getSpotPriceTriggeredOrder(String orderId) throws } /** - * Get a single order + * Query single auto order details * - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<SpotPriceTriggeredOrder> * @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 Auto order detail -
200 Auto order details -
*/ public ApiResponse getSpotPriceTriggeredOrderWithHttpInfo(String orderId) throws ApiException { @@ -3343,16 +4584,16 @@ public ApiResponse getSpotPriceTriggeredOrderWithHttpIn } /** - * Get a single order (asynchronously) + * Query single auto order details (asynchronously) * - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call getSpotPriceTriggeredOrderAsync(String orderId, final ApiCallback _callback) throws ApiException { @@ -3364,14 +4605,14 @@ public okhttp3.Call getSpotPriceTriggeredOrderAsync(String orderId, final ApiCal /** * Build call for cancelSpotPriceTriggeredOrder - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call cancelSpotPriceTriggeredOrderCall(String orderId, final ApiCallback _callback) throws ApiException { @@ -3416,15 +4657,15 @@ private okhttp3.Call cancelSpotPriceTriggeredOrderValidateBeforeCall(String orde } /** - * Cancel a single order + * Cancel single auto order * - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return SpotPriceTriggeredOrder * @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 Auto order detail -
200 Auto order details -
*/ public SpotPriceTriggeredOrder cancelSpotPriceTriggeredOrder(String orderId) throws ApiException { @@ -3433,15 +4674,15 @@ public SpotPriceTriggeredOrder cancelSpotPriceTriggeredOrder(String orderId) thr } /** - * Cancel a single order + * Cancel single auto order * - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @return ApiResponse<SpotPriceTriggeredOrder> * @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 Auto order detail -
200 Auto order details -
*/ public ApiResponse cancelSpotPriceTriggeredOrderWithHttpInfo(String orderId) throws ApiException { @@ -3451,16 +4692,16 @@ public ApiResponse cancelSpotPriceTriggeredOrderWithHtt } /** - * Cancel a single order (asynchronously) + * Cancel single auto order (asynchronously) * - * @param orderId Retrieve the data of the order with the specified ID (required) + * @param orderId ID returned when order is successfully created (required) * @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 Auto order detail -
200 Auto order details -
*/ public okhttp3.Call cancelSpotPriceTriggeredOrderAsync(String orderId, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/io/gate/gateapi/api/SubAccountApi.java b/src/main/java/io/gate/gateapi/api/SubAccountApi.java new file mode 100644 index 0000000..275e990 --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/SubAccountApi.java @@ -0,0 +1,1296 @@ +/* + * 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.SubAccount; +import io.gate.gateapi.models.SubAccountKey; +import io.gate.gateapi.models.SubUserMode; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SubAccountApi { + private ApiClient localVarApiClient; + + public SubAccountApi() { + this(Configuration.getDefaultApiClient()); + } + + public SubAccountApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + private okhttp3.Call listSubAccountsCall(String type, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + 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 listSubAccountsValidateBeforeCall(String type, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountsCall(type, _callback); + return localVarCall; + } + + + private ApiResponse> listSubAccountsWithHttpInfo(String type) throws ApiException { + okhttp3.Call localVarCall = listSubAccountsValidateBeforeCall(type, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listSubAccountsAsync(String type, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountsValidateBeforeCall(type, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistSubAccountsRequest { + private String type; + + private APIlistSubAccountsRequest() { + } + + /** + * Set type + * @param type 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 APIlistSubAccountsRequest + */ + public APIlistSubAccountsRequest type(String type) { + this.type = type; + return this; + } + + /** + * Build call for listSubAccounts + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listSubAccountsCall(type, _callback); + } + + /** + * Execute listSubAccounts request + * @return List<SubAccount> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listSubAccountsWithHttpInfo(type); + return localVarResp.getData(); + } + + /** + * Execute listSubAccounts request with HTTP info returned + * @return ApiResponse<List<SubAccount>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSubAccountsWithHttpInfo(type); + } + + /** + * Execute listSubAccounts request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSubAccountsAsync(type, _callback); + } + } + + /** + * List sub-accounts + * + * @return APIlistSubAccountsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistSubAccountsRequest listSubAccounts() { + return new APIlistSubAccountsRequest(); + } + + /** + * Build call for createSubAccounts + * @param subAccount (required) + * @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
201 Created successfully -
+ */ + public okhttp3.Call createSubAccountsCall(SubAccount subAccount, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = subAccount; + + // create path and map variables + String localVarPath = "/sub_accounts"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSubAccountsValidateBeforeCall(SubAccount subAccount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'subAccount' is set + if (subAccount == null) { + throw new ApiException("Missing the required parameter 'subAccount' when calling createSubAccounts(Async)"); + } + + okhttp3.Call localVarCall = createSubAccountsCall(subAccount, _callback); + return localVarCall; + } + + /** + * Create a new sub-account + * + * @param subAccount (required) + * @return SubAccount + * @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
201 Created successfully -
+ */ + public SubAccount createSubAccounts(SubAccount subAccount) throws ApiException { + ApiResponse localVarResp = createSubAccountsWithHttpInfo(subAccount); + return localVarResp.getData(); + } + + /** + * Create a new sub-account + * + * @param subAccount (required) + * @return ApiResponse<SubAccount> + * @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
201 Created successfully -
+ */ + public ApiResponse createSubAccountsWithHttpInfo(SubAccount subAccount) throws ApiException { + okhttp3.Call localVarCall = createSubAccountsValidateBeforeCall(subAccount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a new sub-account (asynchronously) + * + * @param subAccount (required) + * @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
201 Created successfully -
+ */ + public okhttp3.Call createSubAccountsAsync(SubAccount subAccount, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createSubAccountsValidateBeforeCall(subAccount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getSubAccount + * @param userId Sub-account user ID (required) + * @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 getSubAccountCall(Long userId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())); + + 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 getSubAccountValidateBeforeCall(Long userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling getSubAccount(Async)"); + } + + okhttp3.Call localVarCall = getSubAccountCall(userId, _callback); + return localVarCall; + } + + /** + * Get sub-account + * + * @param userId Sub-account user ID (required) + * @return SubAccount + * @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 SubAccount getSubAccount(Long userId) throws ApiException { + ApiResponse localVarResp = getSubAccountWithHttpInfo(userId); + return localVarResp.getData(); + } + + /** + * Get sub-account + * + * @param userId Sub-account user ID (required) + * @return ApiResponse<SubAccount> + * @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 getSubAccountWithHttpInfo(Long userId) throws ApiException { + okhttp3.Call localVarCall = getSubAccountValidateBeforeCall(userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get sub-account (asynchronously) + * + * @param userId Sub-account user ID (required) + * @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 getSubAccountAsync(Long userId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getSubAccountValidateBeforeCall(userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listSubAccountKeys + * @param userId Sub-account user ID (required) + * @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 List retrieved successfully -
+ */ + public okhttp3.Call listSubAccountKeysCall(Integer userId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}/keys" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())); + + 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 listSubAccountKeysValidateBeforeCall(Integer userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling listSubAccountKeys(Async)"); + } + + okhttp3.Call localVarCall = listSubAccountKeysCall(userId, _callback); + return localVarCall; + } + + /** + * List all API key pairs of the sub-account + * + * @param userId Sub-account user ID (required) + * @return List<SubAccountKey> + * @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 List retrieved successfully -
+ */ + public List listSubAccountKeys(Integer userId) throws ApiException { + ApiResponse> localVarResp = listSubAccountKeysWithHttpInfo(userId); + return localVarResp.getData(); + } + + /** + * List all API key pairs of the sub-account + * + * @param userId Sub-account user ID (required) + * @return ApiResponse<List<SubAccountKey>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> listSubAccountKeysWithHttpInfo(Integer userId) throws ApiException { + okhttp3.Call localVarCall = listSubAccountKeysValidateBeforeCall(userId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List all API key pairs of the sub-account (asynchronously) + * + * @param userId Sub-account user ID (required) + * @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 List retrieved successfully -
+ */ + public okhttp3.Call listSubAccountKeysAsync(Integer userId, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountKeysValidateBeforeCall(userId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createSubAccountKeys + * @param userId Sub-account user ID (required) + * @param subAccountKey (required) + * @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 Created successfully -
+ */ + public okhttp3.Call createSubAccountKeysCall(Long userId, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = subAccountKey; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}/keys" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())); + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSubAccountKeysValidateBeforeCall(Long userId, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling createSubAccountKeys(Async)"); + } + + // verify the required parameter 'subAccountKey' is set + if (subAccountKey == null) { + throw new ApiException("Missing the required parameter 'subAccountKey' when calling createSubAccountKeys(Async)"); + } + + okhttp3.Call localVarCall = createSubAccountKeysCall(userId, subAccountKey, _callback); + return localVarCall; + } + + /** + * Create new sub-account API key pair + * + * @param userId Sub-account user ID (required) + * @param subAccountKey (required) + * @return SubAccountKey + * @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 Created successfully -
+ */ + public SubAccountKey createSubAccountKeys(Long userId, SubAccountKey subAccountKey) throws ApiException { + ApiResponse localVarResp = createSubAccountKeysWithHttpInfo(userId, subAccountKey); + return localVarResp.getData(); + } + + /** + * Create new sub-account API key pair + * + * @param userId Sub-account user ID (required) + * @param subAccountKey (required) + * @return ApiResponse<SubAccountKey> + * @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 Created successfully -
+ */ + public ApiResponse createSubAccountKeysWithHttpInfo(Long userId, SubAccountKey subAccountKey) throws ApiException { + okhttp3.Call localVarCall = createSubAccountKeysValidateBeforeCall(userId, subAccountKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create new sub-account API key pair (asynchronously) + * + * @param userId Sub-account user ID (required) + * @param subAccountKey (required) + * @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 Created successfully -
+ */ + public okhttp3.Call createSubAccountKeysAsync(Long userId, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createSubAccountKeysValidateBeforeCall(userId, subAccountKey, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getSubAccountKey + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @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 getSubAccountKeyCall(Integer userId, String key, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}/keys/{key}" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())) + .replaceAll("\\{" + "key" + "\\}", localVarApiClient.escapeString(key)); + + 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 getSubAccountKeyValidateBeforeCall(Integer userId, String key, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling getSubAccountKey(Async)"); + } + + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException("Missing the required parameter 'key' when calling getSubAccountKey(Async)"); + } + + okhttp3.Call localVarCall = getSubAccountKeyCall(userId, key, _callback); + return localVarCall; + } + + /** + * Get specific API key pair of the sub-account + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @return SubAccountKey + * @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 SubAccountKey getSubAccountKey(Integer userId, String key) throws ApiException { + ApiResponse localVarResp = getSubAccountKeyWithHttpInfo(userId, key); + return localVarResp.getData(); + } + + /** + * Get specific API key pair of the sub-account + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @return ApiResponse<SubAccountKey> + * @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 getSubAccountKeyWithHttpInfo(Integer userId, String key) throws ApiException { + okhttp3.Call localVarCall = getSubAccountKeyValidateBeforeCall(userId, key, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get specific API key pair of the sub-account (asynchronously) + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @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 getSubAccountKeyAsync(Integer userId, String key, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getSubAccountKeyValidateBeforeCall(userId, key, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateSubAccountKeys + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @param subAccountKey (required) + * @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
204 Updated successfully -
+ */ + public okhttp3.Call updateSubAccountKeysCall(Integer userId, String key, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = subAccountKey; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}/keys/{key}" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())) + .replaceAll("\\{" + "key" + "\\}", localVarApiClient.escapeString(key)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSubAccountKeysValidateBeforeCall(Integer userId, String key, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling updateSubAccountKeys(Async)"); + } + + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException("Missing the required parameter 'key' when calling updateSubAccountKeys(Async)"); + } + + // verify the required parameter 'subAccountKey' is set + if (subAccountKey == null) { + throw new ApiException("Missing the required parameter 'subAccountKey' when calling updateSubAccountKeys(Async)"); + } + + okhttp3.Call localVarCall = updateSubAccountKeysCall(userId, key, subAccountKey, _callback); + return localVarCall; + } + + /** + * Update sub-account API key pair + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @param subAccountKey (required) + * @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
204 Updated successfully -
+ */ + public void updateSubAccountKeys(Integer userId, String key, SubAccountKey subAccountKey) throws ApiException { + updateSubAccountKeysWithHttpInfo(userId, key, subAccountKey); + } + + /** + * Update sub-account API key pair + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @param subAccountKey (required) + * @return ApiResponse<Void> + * @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
204 Updated successfully -
+ */ + public ApiResponse updateSubAccountKeysWithHttpInfo(Integer userId, String key, SubAccountKey subAccountKey) throws ApiException { + okhttp3.Call localVarCall = updateSubAccountKeysValidateBeforeCall(userId, key, subAccountKey, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update sub-account API key pair (asynchronously) + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @param subAccountKey (required) + * @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
204 Updated successfully -
+ */ + public okhttp3.Call updateSubAccountKeysAsync(Integer userId, String key, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = updateSubAccountKeysValidateBeforeCall(userId, key, subAccountKey, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteSubAccountKeys + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @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
204 Deleted successfully -
+ */ + public okhttp3.Call deleteSubAccountKeysCall(Integer userId, String key, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}/keys/{key}" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())) + .replaceAll("\\{" + "key" + "\\}", localVarApiClient.escapeString(key)); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSubAccountKeysValidateBeforeCall(Integer userId, String key, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteSubAccountKeys(Async)"); + } + + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException("Missing the required parameter 'key' when calling deleteSubAccountKeys(Async)"); + } + + okhttp3.Call localVarCall = deleteSubAccountKeysCall(userId, key, _callback); + return localVarCall; + } + + /** + * Delete sub-account API key pair + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @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
204 Deleted successfully -
+ */ + public void deleteSubAccountKeys(Integer userId, String key) throws ApiException { + deleteSubAccountKeysWithHttpInfo(userId, key); + } + + /** + * Delete sub-account API key pair + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @return ApiResponse<Void> + * @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
204 Deleted successfully -
+ */ + public ApiResponse deleteSubAccountKeysWithHttpInfo(Integer userId, String key) throws ApiException { + okhttp3.Call localVarCall = deleteSubAccountKeysValidateBeforeCall(userId, key, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete sub-account API key pair (asynchronously) + * + * @param userId Sub-account user ID (required) + * @param key Sub-account API key (required) + * @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
204 Deleted successfully -
+ */ + public okhttp3.Call deleteSubAccountKeysAsync(Integer userId, String key, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = deleteSubAccountKeysValidateBeforeCall(userId, key, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for lockSubAccount + * @param userId Sub-account user ID (required) + * @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
204 Locked successfully -
+ */ + public okhttp3.Call lockSubAccountCall(Long userId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}/lock" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call lockSubAccountValidateBeforeCall(Long userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling lockSubAccount(Async)"); + } + + okhttp3.Call localVarCall = lockSubAccountCall(userId, _callback); + return localVarCall; + } + + /** + * Lock sub-account + * + * @param userId Sub-account user ID (required) + * @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
204 Locked successfully -
+ */ + public void lockSubAccount(Long userId) throws ApiException { + lockSubAccountWithHttpInfo(userId); + } + + /** + * Lock sub-account + * + * @param userId Sub-account user ID (required) + * @return ApiResponse<Void> + * @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
204 Locked successfully -
+ */ + public ApiResponse lockSubAccountWithHttpInfo(Long userId) throws ApiException { + okhttp3.Call localVarCall = lockSubAccountValidateBeforeCall(userId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Lock sub-account (asynchronously) + * + * @param userId Sub-account user ID (required) + * @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
204 Locked successfully -
+ */ + public okhttp3.Call lockSubAccountAsync(Long userId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = lockSubAccountValidateBeforeCall(userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for unlockSubAccount + * @param userId Sub-account user ID (required) + * @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
204 Unlocked successfully -
+ */ + public okhttp3.Call unlockSubAccountCall(Long userId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts/{user_id}/unlock" + .replaceAll("\\{" + "user_id" + "\\}", localVarApiClient.escapeString(userId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call unlockSubAccountValidateBeforeCall(Long userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling unlockSubAccount(Async)"); + } + + okhttp3.Call localVarCall = unlockSubAccountCall(userId, _callback); + return localVarCall; + } + + /** + * Unlock sub-account + * + * @param userId Sub-account user ID (required) + * @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
204 Unlocked successfully -
+ */ + public void unlockSubAccount(Long userId) throws ApiException { + unlockSubAccountWithHttpInfo(userId); + } + + /** + * Unlock sub-account + * + * @param userId Sub-account user ID (required) + * @return ApiResponse<Void> + * @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
204 Unlocked successfully -
+ */ + public ApiResponse unlockSubAccountWithHttpInfo(Long userId) throws ApiException { + okhttp3.Call localVarCall = unlockSubAccountValidateBeforeCall(userId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Unlock sub-account (asynchronously) + * + * @param userId Sub-account user ID (required) + * @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
204 Unlocked successfully -
+ */ + public okhttp3.Call unlockSubAccountAsync(Long userId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = unlockSubAccountValidateBeforeCall(userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for listUnifiedMode + * @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 Query successful -
+ */ + public okhttp3.Call listUnifiedModeCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sub_accounts/unified_mode"; + + 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 listUnifiedModeValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedModeCall(_callback); + return localVarCall; + } + + /** + * Get sub-account mode + * Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode + * @return List<SubUserMode> + * @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 Query successful -
+ */ + public List listUnifiedMode() throws ApiException { + ApiResponse> localVarResp = listUnifiedModeWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get sub-account mode + * Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode + * @return ApiResponse<List<SubUserMode>> + * @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 Query successful -
+ */ + public ApiResponse> listUnifiedModeWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listUnifiedModeValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get sub-account mode (asynchronously) + * Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode + * @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 Query successful -
+ */ + public okhttp3.Call listUnifiedModeAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedModeValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/UnifiedApi.java b/src/main/java/io/gate/gateapi/api/UnifiedApi.java new file mode 100644 index 0000000..baf3a73 --- /dev/null +++ b/src/main/java/io/gate/gateapi/api/UnifiedApi.java @@ -0,0 +1,2879 @@ +/* + * 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.TransferablesResult; +import io.gate.gateapi.models.UniLoan; +import io.gate.gateapi.models.UniLoanInterestRecord; +import io.gate.gateapi.models.UnifiedAccount; +import io.gate.gateapi.models.UnifiedBorrowable; +import io.gate.gateapi.models.UnifiedBorrowable1; +import io.gate.gateapi.models.UnifiedCollateralReq; +import io.gate.gateapi.models.UnifiedCollateralRes; +import io.gate.gateapi.models.UnifiedCurrency; +import io.gate.gateapi.models.UnifiedDiscount; +import io.gate.gateapi.models.UnifiedHistoryLoanRate; +import io.gate.gateapi.models.UnifiedLeverageConfig; +import io.gate.gateapi.models.UnifiedLeverageSetting; +import io.gate.gateapi.models.UnifiedLoan; +import io.gate.gateapi.models.UnifiedLoanRecord; +import io.gate.gateapi.models.UnifiedLoanResult; +import io.gate.gateapi.models.UnifiedMarginTiers; +import io.gate.gateapi.models.UnifiedModeSet; +import io.gate.gateapi.models.UnifiedPortfolioInput; +import io.gate.gateapi.models.UnifiedPortfolioOutput; +import io.gate.gateapi.models.UnifiedRiskUnits; +import io.gate.gateapi.models.UnifiedTransferable; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UnifiedApi { + private ApiClient localVarApiClient; + + public UnifiedApi() { + this(Configuration.getDefaultApiClient()); + } + + public UnifiedApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + private okhttp3.Call listUnifiedAccountsCall(String currency, String subUid, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/accounts"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (subUid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sub_uid", subUid)); + } + + 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 listUnifiedAccountsValidateBeforeCall(String currency, String subUid, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedAccountsCall(currency, subUid, _callback); + return localVarCall; + } + + + private ApiResponse listUnifiedAccountsWithHttpInfo(String currency, String subUid) throws ApiException { + okhttp3.Call localVarCall = listUnifiedAccountsValidateBeforeCall(currency, subUid, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUnifiedAccountsAsync(String currency, String subUid, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedAccountsValidateBeforeCall(currency, subUid, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUnifiedAccountsRequest { + private String currency; + private String subUid; + + private APIlistUnifiedAccountsRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUnifiedAccountsRequest + */ + public APIlistUnifiedAccountsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set subUid + * @param subUid Sub account user ID (optional) + * @return APIlistUnifiedAccountsRequest + */ + public APIlistUnifiedAccountsRequest subUid(String subUid) { + this.subUid = subUid; + return this; + } + + /** + * Build call for listUnifiedAccounts + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUnifiedAccountsCall(currency, subUid, _callback); + } + + /** + * Execute listUnifiedAccounts request + * @return UnifiedAccount + * @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 List retrieved successfully -
+ */ + public UnifiedAccount execute() throws ApiException { + ApiResponse localVarResp = listUnifiedAccountsWithHttpInfo(currency, subUid); + return localVarResp.getData(); + } + + /** + * Execute listUnifiedAccounts request with HTTP info returned + * @return ApiResponse<UnifiedAccount> + * @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 List retrieved successfully -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listUnifiedAccountsWithHttpInfo(currency, subUid); + } + + /** + * Execute listUnifiedAccounts request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listUnifiedAccountsAsync(currency, subUid, _callback); + } + } + + /** + * 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) + * @return APIlistUnifiedAccountsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistUnifiedAccountsRequest listUnifiedAccounts() { + return new APIlistUnifiedAccountsRequest(); + } + + /** + * Build call for getUnifiedBorrowable + * @param currency Query by specified currency name (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedBorrowableCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/borrowable"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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 getUnifiedBorrowableValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getUnifiedBorrowable(Async)"); + } + + okhttp3.Call localVarCall = getUnifiedBorrowableCall(currency, _callback); + return localVarCall; + } + + /** + * Query maximum borrowable amount for unified account + * + * @param currency Query by specified currency name (required) + * @return UnifiedBorrowable + * @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 Query successful -
+ */ + public UnifiedBorrowable getUnifiedBorrowable(String currency) throws ApiException { + ApiResponse localVarResp = getUnifiedBorrowableWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Query maximum borrowable amount for unified account + * + * @param currency Query by specified currency name (required) + * @return ApiResponse<UnifiedBorrowable> + * @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 Query successful -
+ */ + public ApiResponse getUnifiedBorrowableWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUnifiedBorrowableValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query maximum borrowable amount for unified account (asynchronously) + * + * @param currency Query by specified currency name (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedBorrowableAsync(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedBorrowableValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUnifiedTransferable + * @param currency Query by specified currency name (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedTransferableCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/transferable"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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 getUnifiedTransferableValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getUnifiedTransferable(Async)"); + } + + okhttp3.Call localVarCall = getUnifiedTransferableCall(currency, _callback); + return localVarCall; + } + + /** + * Query maximum transferable amount for unified account + * + * @param currency Query by specified currency name (required) + * @return UnifiedTransferable + * @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 Query successful -
+ */ + public UnifiedTransferable getUnifiedTransferable(String currency) throws ApiException { + ApiResponse localVarResp = getUnifiedTransferableWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Query maximum transferable amount for unified account + * + * @param currency Query by specified currency name (required) + * @return ApiResponse<UnifiedTransferable> + * @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 Query successful -
+ */ + public ApiResponse getUnifiedTransferableWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUnifiedTransferableValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query maximum transferable amount for unified account (asynchronously) + * + * @param currency Query by specified currency name (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedTransferableAsync(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedTransferableValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUnifiedTransferables + * @param currencies Specify the currency name to query in batches, and support up to 100 pass parameters at a time (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedTransferablesCall(String currencies, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/transferables"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencies != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currencies", currencies)); + } + + 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 getUnifiedTransferablesValidateBeforeCall(String currencies, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencies' is set + if (currencies == null) { + throw new ApiException("Missing the required parameter 'currencies' when calling getUnifiedTransferables(Async)"); + } + + okhttp3.Call localVarCall = getUnifiedTransferablesCall(currencies, _callback); + return localVarCall; + } + + /** + * 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 + * + * @param currencies Specify the currency name to query in batches, and support up to 100 pass parameters at a time (required) + * @return List<TransferablesResult> + * @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 Query successful -
+ */ + public List getUnifiedTransferables(String currencies) throws ApiException { + ApiResponse> localVarResp = getUnifiedTransferablesWithHttpInfo(currencies); + return localVarResp.getData(); + } + + /** + * 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 + * + * @param currencies Specify the currency name to query in batches, and support up to 100 pass parameters at a time (required) + * @return ApiResponse<List<TransferablesResult>> + * @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 Query successful -
+ */ + public ApiResponse> getUnifiedTransferablesWithHttpInfo(String currencies) throws ApiException { + okhttp3.Call localVarCall = getUnifiedTransferablesValidateBeforeCall(currencies, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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 (asynchronously) + * + * @param currencies Specify the currency name to query in batches, and support up to 100 pass parameters at a time (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedTransferablesAsync(String currencies, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedTransferablesValidateBeforeCall(currencies, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUnifiedBorrowableList + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedBorrowableListCall(List currencies, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/batch_borrowable"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencies != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "currencies", currencies)); + } + + 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 getUnifiedBorrowableListValidateBeforeCall(List currencies, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencies' is set + if (currencies == null) { + throw new ApiException("Missing the required parameter 'currencies' when calling getUnifiedBorrowableList(Async)"); + } + + okhttp3.Call localVarCall = getUnifiedBorrowableListCall(currencies, _callback); + return localVarCall; + } + + /** + * Batch query unified account maximum borrowable amount + * + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @return List<UnifiedBorrowable1> + * @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 Query successful -
+ */ + public List getUnifiedBorrowableList(List currencies) throws ApiException { + ApiResponse> localVarResp = getUnifiedBorrowableListWithHttpInfo(currencies); + return localVarResp.getData(); + } + + /** + * Batch query unified account maximum borrowable amount + * + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @return ApiResponse<List<UnifiedBorrowable1>> + * @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 Query successful -
+ */ + public ApiResponse> getUnifiedBorrowableListWithHttpInfo(List currencies) throws ApiException { + okhttp3.Call localVarCall = getUnifiedBorrowableListValidateBeforeCall(currencies, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Batch query unified account maximum borrowable amount (asynchronously) + * + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedBorrowableListAsync(List currencies, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedBorrowableListValidateBeforeCall(currencies, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listUnifiedLoansCall(String currency, Integer page, Integer limit, String type, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/loans"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + 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 listUnifiedLoansValidateBeforeCall(String currency, Integer page, Integer limit, String type, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoansCall(currency, page, limit, type, _callback); + return localVarCall; + } + + + private ApiResponse> listUnifiedLoansWithHttpInfo(String currency, Integer page, Integer limit, String type) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoansValidateBeforeCall(currency, page, limit, type, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUnifiedLoansAsync(String currency, Integer page, Integer limit, String type, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoansValidateBeforeCall(currency, page, limit, type, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUnifiedLoansRequest { + private String currency; + private Integer page; + private Integer limit; + private String type; + + private APIlistUnifiedLoansRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUnifiedLoansRequest + */ + public APIlistUnifiedLoansRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUnifiedLoansRequest + */ + public APIlistUnifiedLoansRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUnifiedLoansRequest + */ + public APIlistUnifiedLoansRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set type + * @param type Loan type: platform borrowing - platform, margin borrowing - margin (optional) + * @return APIlistUnifiedLoansRequest + */ + public APIlistUnifiedLoansRequest type(String type) { + this.type = type; + return this; + } + + /** + * Build call for listUnifiedLoans + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUnifiedLoansCall(currency, page, limit, type, _callback); + } + + /** + * Execute listUnifiedLoans request + * @return List<UniLoan> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUnifiedLoansWithHttpInfo(currency, page, limit, type); + return localVarResp.getData(); + } + + /** + * Execute listUnifiedLoans request with HTTP info returned + * @return ApiResponse<List<UniLoan>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUnifiedLoansWithHttpInfo(currency, page, limit, type); + } + + /** + * Execute listUnifiedLoans request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUnifiedLoansAsync(currency, page, limit, type, _callback); + } + } + + /** + * Query loans + * + * @return APIlistUnifiedLoansRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUnifiedLoansRequest listUnifiedLoans() { + return new APIlistUnifiedLoansRequest(); + } + + /** + * Build call for createUnifiedLoan + * @param unifiedLoan (required) + * @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 Operation successful -
+ */ + public okhttp3.Call createUnifiedLoanCall(UnifiedLoan unifiedLoan, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = unifiedLoan; + + // create path and map variables + String localVarPath = "/unified/loans"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUnifiedLoanValidateBeforeCall(UnifiedLoan unifiedLoan, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'unifiedLoan' is set + if (unifiedLoan == null) { + throw new ApiException("Missing the required parameter 'unifiedLoan' when calling createUnifiedLoan(Async)"); + } + + okhttp3.Call localVarCall = createUnifiedLoanCall(unifiedLoan, _callback); + return localVarCall; + } + + /** + * 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 + * @param unifiedLoan (required) + * @return UnifiedLoanResult + * @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 Operation successful -
+ */ + public UnifiedLoanResult createUnifiedLoan(UnifiedLoan unifiedLoan) throws ApiException { + ApiResponse localVarResp = createUnifiedLoanWithHttpInfo(unifiedLoan); + return localVarResp.getData(); + } + + /** + * 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 + * @param unifiedLoan (required) + * @return ApiResponse<UnifiedLoanResult> + * @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 Operation successful -
+ */ + public ApiResponse createUnifiedLoanWithHttpInfo(UnifiedLoan unifiedLoan) throws ApiException { + okhttp3.Call localVarCall = createUnifiedLoanValidateBeforeCall(unifiedLoan, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Borrow or repay (asynchronously) + * 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 + * @param unifiedLoan (required) + * @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 Operation successful -
+ */ + public okhttp3.Call createUnifiedLoanAsync(UnifiedLoan unifiedLoan, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = createUnifiedLoanValidateBeforeCall(unifiedLoan, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listUnifiedLoanRecordsCall(String type, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/loan_records"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 listUnifiedLoanRecordsValidateBeforeCall(String type, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoanRecordsCall(type, currency, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listUnifiedLoanRecordsWithHttpInfo(String type, String currency, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoanRecordsValidateBeforeCall(type, currency, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUnifiedLoanRecordsAsync(String type, String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoanRecordsValidateBeforeCall(type, currency, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUnifiedLoanRecordsRequest { + private String type; + private String currency; + private Integer page; + private Integer limit; + + private APIlistUnifiedLoanRecordsRequest() { + } + + /** + * Set type + * @param type Loan record type: borrow - borrowing, repay - repayment (optional) + * @return APIlistUnifiedLoanRecordsRequest + */ + public APIlistUnifiedLoanRecordsRequest type(String type) { + this.type = type; + return this; + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUnifiedLoanRecordsRequest + */ + public APIlistUnifiedLoanRecordsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUnifiedLoanRecordsRequest + */ + public APIlistUnifiedLoanRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUnifiedLoanRecordsRequest + */ + public APIlistUnifiedLoanRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listUnifiedLoanRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUnifiedLoanRecordsCall(type, currency, page, limit, _callback); + } + + /** + * Execute listUnifiedLoanRecords request + * @return List<UnifiedLoanRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUnifiedLoanRecordsWithHttpInfo(type, currency, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listUnifiedLoanRecords request with HTTP info returned + * @return ApiResponse<List<UnifiedLoanRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUnifiedLoanRecordsWithHttpInfo(type, currency, page, limit); + } + + /** + * Execute listUnifiedLoanRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUnifiedLoanRecordsAsync(type, currency, page, limit, _callback); + } + } + + /** + * Query loan records + * + * @return APIlistUnifiedLoanRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUnifiedLoanRecordsRequest listUnifiedLoanRecords() { + return new APIlistUnifiedLoanRecordsRequest(); + } + + private okhttp3.Call listUnifiedLoanInterestRecordsCall(String currency, Integer page, Integer limit, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/interest_records"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + 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 listUnifiedLoanInterestRecordsValidateBeforeCall(String currency, Integer page, Integer limit, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoanInterestRecordsCall(currency, page, limit, from, to, type, _callback); + return localVarCall; + } + + + private ApiResponse> listUnifiedLoanInterestRecordsWithHttpInfo(String currency, Integer page, Integer limit, Long from, Long to, String type) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoanInterestRecordsValidateBeforeCall(currency, page, limit, from, to, type, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUnifiedLoanInterestRecordsAsync(String currency, Integer page, Integer limit, Long from, Long to, String type, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedLoanInterestRecordsValidateBeforeCall(currency, page, limit, from, to, type, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUnifiedLoanInterestRecordsRequest { + private String currency; + private Integer page; + private Integer limit; + private Long from; + private Long to; + private String type; + + private APIlistUnifiedLoanInterestRecordsRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistUnifiedLoanInterestRecordsRequest + */ + public APIlistUnifiedLoanInterestRecordsRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistUnifiedLoanInterestRecordsRequest + */ + public APIlistUnifiedLoanInterestRecordsRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistUnifiedLoanInterestRecordsRequest + */ + public APIlistUnifiedLoanInterestRecordsRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set from + * @param from Start timestamp for the query (optional) + * @return APIlistUnifiedLoanInterestRecordsRequest + */ + public APIlistUnifiedLoanInterestRecordsRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End timestamp for the query, defaults to current time if not specified (optional) + * @return APIlistUnifiedLoanInterestRecordsRequest + */ + public APIlistUnifiedLoanInterestRecordsRequest to(Long to) { + this.to = to; + return this; + } + + /** + * Set type + * @param type Loan type: platform borrowing - platform, margin borrowing - margin. Defaults to margin if not specified (optional) + * @return APIlistUnifiedLoanInterestRecordsRequest + */ + public APIlistUnifiedLoanInterestRecordsRequest type(String type) { + this.type = type; + return this; + } + + /** + * Build call for listUnifiedLoanInterestRecords + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUnifiedLoanInterestRecordsCall(currency, page, limit, from, to, type, _callback); + } + + /** + * Execute listUnifiedLoanInterestRecords request + * @return List<UniLoanInterestRecord> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUnifiedLoanInterestRecordsWithHttpInfo(currency, page, limit, from, to, type); + return localVarResp.getData(); + } + + /** + * Execute listUnifiedLoanInterestRecords request with HTTP info returned + * @return ApiResponse<List<UniLoanInterestRecord>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUnifiedLoanInterestRecordsWithHttpInfo(currency, page, limit, from, to, type); + } + + /** + * Execute listUnifiedLoanInterestRecords request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUnifiedLoanInterestRecordsAsync(currency, page, limit, from, to, type, _callback); + } + } + + /** + * Query interest deduction records + * + * @return APIlistUnifiedLoanInterestRecordsRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIlistUnifiedLoanInterestRecordsRequest listUnifiedLoanInterestRecords() { + return new APIlistUnifiedLoanInterestRecordsRequest(); + } + + /** + * Build call for getUnifiedRiskUnits + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedRiskUnitsCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/risk_units"; + + 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 getUnifiedRiskUnitsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedRiskUnitsCall(_callback); + return localVarCall; + } + + /** + * Get user risk unit details + * Get user risk unit details, only valid in portfolio margin mode + * @return UnifiedRiskUnits + * @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 Query successful -
+ */ + public UnifiedRiskUnits getUnifiedRiskUnits() throws ApiException { + ApiResponse localVarResp = getUnifiedRiskUnitsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get user risk unit details + * Get user risk unit details, only valid in portfolio margin mode + * @return ApiResponse<UnifiedRiskUnits> + * @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 Query successful -
+ */ + public ApiResponse getUnifiedRiskUnitsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getUnifiedRiskUnitsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get user risk unit details (asynchronously) + * Get user risk unit details, only valid in portfolio margin mode + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedRiskUnitsAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedRiskUnitsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUnifiedMode + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedModeCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/unified_mode"; + + 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 getUnifiedModeValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedModeCall(_callback); + return localVarCall; + } + + /** + * 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 + * @return UnifiedModeSet + * @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 Query successful -
+ */ + public UnifiedModeSet getUnifiedMode() throws ApiException { + ApiResponse localVarResp = getUnifiedModeWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * 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 + * @return ApiResponse<UnifiedModeSet> + * @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 Query successful -
+ */ + public ApiResponse getUnifiedModeWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getUnifiedModeValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query mode of the unified account (asynchronously) + * Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedModeAsync(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedModeValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for setUnifiedMode + * @param unifiedModeSet (required) + * @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
204 Set successfully -
+ */ + public okhttp3.Call setUnifiedModeCall(UnifiedModeSet unifiedModeSet, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = unifiedModeSet; + + // create path and map variables + String localVarPath = "/unified/unified_mode"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setUnifiedModeValidateBeforeCall(UnifiedModeSet unifiedModeSet, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'unifiedModeSet' is set + if (unifiedModeSet == null) { + throw new ApiException("Missing the required parameter 'unifiedModeSet' when calling setUnifiedMode(Async)"); + } + + okhttp3.Call localVarCall = setUnifiedModeCall(unifiedModeSet, _callback); + return localVarCall; + } + + /** + * 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\" } ``` + * @param unifiedModeSet (required) + * @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
204 Set successfully -
+ */ + public void setUnifiedMode(UnifiedModeSet unifiedModeSet) throws ApiException { + setUnifiedModeWithHttpInfo(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\" } ``` + * @param unifiedModeSet (required) + * @return ApiResponse<Void> + * @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
204 Set successfully -
+ */ + public ApiResponse setUnifiedModeWithHttpInfo(UnifiedModeSet unifiedModeSet) throws ApiException { + okhttp3.Call localVarCall = setUnifiedModeValidateBeforeCall(unifiedModeSet, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Set unified account mode (asynchronously) + * 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\" } ``` + * @param unifiedModeSet (required) + * @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
204 Set successfully -
+ */ + public okhttp3.Call setUnifiedModeAsync(UnifiedModeSet unifiedModeSet, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = setUnifiedModeValidateBeforeCall(unifiedModeSet, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for getUnifiedEstimateRate + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedEstimateRateCall(List currencies, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/estimate_rate"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencies != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "currencies", currencies)); + } + + 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 getUnifiedEstimateRateValidateBeforeCall(List currencies, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currencies' is set + if (currencies == null) { + throw new ApiException("Missing the required parameter 'currencies' when calling getUnifiedEstimateRate(Async)"); + } + + okhttp3.Call localVarCall = getUnifiedEstimateRateCall(currencies, _callback); + return localVarCall; + } + + /** + * 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 + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @return Map<String, String> + * @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 Query successful -
+ */ + public Map getUnifiedEstimateRate(List currencies) throws ApiException { + ApiResponse> localVarResp = getUnifiedEstimateRateWithHttpInfo(currencies); + return localVarResp.getData(); + } + + /** + * 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 + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @return ApiResponse<Map<String, String>> + * @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 Query successful -
+ */ + public ApiResponse> getUnifiedEstimateRateWithHttpInfo(List currencies) throws ApiException { + okhttp3.Call localVarCall = getUnifiedEstimateRateValidateBeforeCall(currencies, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query unified account estimated interest rate (asynchronously) + * 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 + * @param currencies Specify currency names for querying in an array, separated by commas, maximum 10 currencies (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUnifiedEstimateRateAsync(List currencies, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getUnifiedEstimateRateValidateBeforeCall(currencies, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listCurrencyDiscountTiers + * @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 Query successful -
+ */ + public okhttp3.Call listCurrencyDiscountTiersCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/currency_discount_tiers"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCurrencyDiscountTiersValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listCurrencyDiscountTiersCall(_callback); + return localVarCall; + } + + /** + * Query unified account tiered + * + * @return List<UnifiedDiscount> + * @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 Query successful -
+ */ + public List listCurrencyDiscountTiers() throws ApiException { + ApiResponse> localVarResp = listCurrencyDiscountTiersWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query unified account tiered + * + * @return ApiResponse<List<UnifiedDiscount>> + * @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 Query successful -
+ */ + public ApiResponse> listCurrencyDiscountTiersWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listCurrencyDiscountTiersValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query unified account tiered (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 Query successful -
+ */ + public okhttp3.Call listCurrencyDiscountTiersAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listCurrencyDiscountTiersValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listLoanMarginTiers + * @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 Query successful -
+ */ + public okhttp3.Call listLoanMarginTiersCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/loan_margin_tiers"; + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listLoanMarginTiersValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listLoanMarginTiersCall(_callback); + return localVarCall; + } + + /** + * Query unified account tiered loan margin + * + * @return List<UnifiedMarginTiers> + * @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 Query successful -
+ */ + public List listLoanMarginTiers() throws ApiException { + ApiResponse> localVarResp = listLoanMarginTiersWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Query unified account tiered loan margin + * + * @return ApiResponse<List<UnifiedMarginTiers>> + * @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 Query successful -
+ */ + public ApiResponse> listLoanMarginTiersWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listLoanMarginTiersValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query unified account tiered loan margin (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 Query successful -
+ */ + public okhttp3.Call listLoanMarginTiersAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listLoanMarginTiersValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for calculatePortfolioMargin + * @param unifiedPortfolioInput (required) + * @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 Query successful -
+ */ + public okhttp3.Call calculatePortfolioMarginCall(UnifiedPortfolioInput unifiedPortfolioInput, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = unifiedPortfolioInput; + + // create path and map variables + String localVarPath = "/unified/portfolio_calculator"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call calculatePortfolioMarginValidateBeforeCall(UnifiedPortfolioInput unifiedPortfolioInput, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'unifiedPortfolioInput' is set + if (unifiedPortfolioInput == null) { + throw new ApiException("Missing the required parameter 'unifiedPortfolioInput' when calling calculatePortfolioMargin(Async)"); + } + + okhttp3.Call localVarCall = calculatePortfolioMarginCall(unifiedPortfolioInput, _callback); + return localVarCall; + } + + /** + * 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. + * @param unifiedPortfolioInput (required) + * @return UnifiedPortfolioOutput + * @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 Query successful -
+ */ + public UnifiedPortfolioOutput calculatePortfolioMargin(UnifiedPortfolioInput unifiedPortfolioInput) throws ApiException { + ApiResponse localVarResp = calculatePortfolioMarginWithHttpInfo(unifiedPortfolioInput); + return localVarResp.getData(); + } + + /** + * 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. + * @param unifiedPortfolioInput (required) + * @return ApiResponse<UnifiedPortfolioOutput> + * @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 Query successful -
+ */ + public ApiResponse calculatePortfolioMarginWithHttpInfo(UnifiedPortfolioInput unifiedPortfolioInput) throws ApiException { + okhttp3.Call localVarCall = calculatePortfolioMarginValidateBeforeCall(unifiedPortfolioInput, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Portfolio margin calculator (asynchronously) + * 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. + * @param unifiedPortfolioInput (required) + * @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 Query successful -
+ */ + public okhttp3.Call calculatePortfolioMarginAsync(UnifiedPortfolioInput unifiedPortfolioInput, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = calculatePortfolioMarginValidateBeforeCall(unifiedPortfolioInput, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getUserLeverageCurrencyConfig + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUserLeverageCurrencyConfigCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/leverage/user_currency_config"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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 getUserLeverageCurrencyConfigValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getUserLeverageCurrencyConfig(Async)"); + } + + okhttp3.Call localVarCall = getUserLeverageCurrencyConfigCall(currency, _callback); + return localVarCall; + } + + /** + * Maximum and minimum currency leverage that can be set + * + * @param currency Currency (required) + * @return UnifiedLeverageConfig + * @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 Query successful -
+ */ + public UnifiedLeverageConfig getUserLeverageCurrencyConfig(String currency) throws ApiException { + ApiResponse localVarResp = getUserLeverageCurrencyConfigWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Maximum and minimum currency leverage that can be set + * + * @param currency Currency (required) + * @return ApiResponse<UnifiedLeverageConfig> + * @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 Query successful -
+ */ + public ApiResponse getUserLeverageCurrencyConfigWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUserLeverageCurrencyConfigValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Maximum and minimum currency leverage that can be set (asynchronously) + * + * @param currency Currency (required) + * @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 Query successful -
+ */ + public okhttp3.Call getUserLeverageCurrencyConfigAsync(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUserLeverageCurrencyConfigValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call getUserLeverageCurrencySettingCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/leverage/user_currency_setting"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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 getUserLeverageCurrencySettingValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getUserLeverageCurrencySettingCall(currency, _callback); + return localVarCall; + } + + + private ApiResponse> getUserLeverageCurrencySettingWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUserLeverageCurrencySettingValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getUserLeverageCurrencySettingAsync(String currency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = getUserLeverageCurrencySettingValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetUserLeverageCurrencySettingRequest { + private String currency; + + private APIgetUserLeverageCurrencySettingRequest() { + } + + /** + * Set currency + * @param currency Currency (optional) + * @return APIgetUserLeverageCurrencySettingRequest + */ + public APIgetUserLeverageCurrencySettingRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Build call for getUserLeverageCurrencySetting + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getUserLeverageCurrencySettingCall(currency, _callback); + } + + /** + * Execute getUserLeverageCurrencySetting request + * @return List<UnifiedLeverageSetting> + * @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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getUserLeverageCurrencySettingWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Execute getUserLeverageCurrencySetting request with HTTP info returned + * @return ApiResponse<List<UnifiedLeverageSetting>> + * @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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getUserLeverageCurrencySettingWithHttpInfo(currency); + } + + /** + * Execute getUserLeverageCurrencySetting request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getUserLeverageCurrencySettingAsync(currency, _callback); + } + } + + /** + * Get user currency leverage + * Get user currency leverage. If currency is not specified, query all currencies + * @return APIgetUserLeverageCurrencySettingRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIgetUserLeverageCurrencySettingRequest getUserLeverageCurrencySetting() { + return new APIgetUserLeverageCurrencySettingRequest(); + } + + /** + * Build call for setUserLeverageCurrencySetting + * @param unifiedLeverageSetting (required) + * @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
204 Set successfully -
+ */ + public okhttp3.Call setUserLeverageCurrencySettingCall(UnifiedLeverageSetting unifiedLeverageSetting, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = unifiedLeverageSetting; + + // create path and map variables + String localVarPath = "/unified/leverage/user_currency_setting"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setUserLeverageCurrencySettingValidateBeforeCall(UnifiedLeverageSetting unifiedLeverageSetting, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'unifiedLeverageSetting' is set + if (unifiedLeverageSetting == null) { + throw new ApiException("Missing the required parameter 'unifiedLeverageSetting' when calling setUserLeverageCurrencySetting(Async)"); + } + + okhttp3.Call localVarCall = setUserLeverageCurrencySettingCall(unifiedLeverageSetting, _callback); + return localVarCall; + } + + /** + * Set loan currency leverage + * + * @param unifiedLeverageSetting (required) + * @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
204 Set successfully -
+ */ + public void setUserLeverageCurrencySetting(UnifiedLeverageSetting unifiedLeverageSetting) throws ApiException { + setUserLeverageCurrencySettingWithHttpInfo(unifiedLeverageSetting); + } + + /** + * Set loan currency leverage + * + * @param unifiedLeverageSetting (required) + * @return ApiResponse<Void> + * @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
204 Set successfully -
+ */ + public ApiResponse setUserLeverageCurrencySettingWithHttpInfo(UnifiedLeverageSetting unifiedLeverageSetting) throws ApiException { + okhttp3.Call localVarCall = setUserLeverageCurrencySettingValidateBeforeCall(unifiedLeverageSetting, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Set loan currency leverage (asynchronously) + * + * @param unifiedLeverageSetting (required) + * @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
204 Set successfully -
+ */ + public okhttp3.Call setUserLeverageCurrencySettingAsync(UnifiedLeverageSetting unifiedLeverageSetting, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = setUserLeverageCurrencySettingValidateBeforeCall(unifiedLeverageSetting, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + private okhttp3.Call listUnifiedCurrenciesCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/currencies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listUnifiedCurrenciesValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedCurrenciesCall(currency, _callback); + return localVarCall; + } + + + private ApiResponse> listUnifiedCurrenciesWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = listUnifiedCurrenciesValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listUnifiedCurrenciesAsync(String currency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listUnifiedCurrenciesValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistUnifiedCurrenciesRequest { + private String currency; + + private APIlistUnifiedCurrenciesRequest() { + } + + /** + * Set currency + * @param currency Currency (optional) + * @return APIlistUnifiedCurrenciesRequest + */ + public APIlistUnifiedCurrenciesRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Build call for listUnifiedCurrencies + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listUnifiedCurrenciesCall(currency, _callback); + } + + /** + * Execute listUnifiedCurrencies request + * @return List<UnifiedCurrency> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listUnifiedCurrenciesWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Execute listUnifiedCurrencies request with HTTP info returned + * @return ApiResponse<List<UnifiedCurrency>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listUnifiedCurrenciesWithHttpInfo(currency); + } + + /** + * Execute listUnifiedCurrencies request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listUnifiedCurrenciesAsync(currency, _callback); + } + } + + /** + * List of loan currencies supported by unified account + * + * @return APIlistUnifiedCurrenciesRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistUnifiedCurrenciesRequest listUnifiedCurrencies() { + return new APIlistUnifiedCurrenciesRequest(); + } + + private okhttp3.Call getHistoryLoanRateCall(String currency, String tier, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/unified/history_loan_rate"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (tier != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tier", tier)); + } + + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getHistoryLoanRateValidateBeforeCall(String currency, String tier, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling getHistoryLoanRate(Async)"); + } + + okhttp3.Call localVarCall = getHistoryLoanRateCall(currency, tier, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse getHistoryLoanRateWithHttpInfo(String currency, String tier, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = getHistoryLoanRateValidateBeforeCall(currency, tier, page, limit, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getHistoryLoanRateAsync(String currency, String tier, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getHistoryLoanRateValidateBeforeCall(currency, tier, page, limit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetHistoryLoanRateRequest { + private final String currency; + private String tier; + private Integer page; + private Integer limit; + + private APIgetHistoryLoanRateRequest(String currency) { + this.currency = currency; + } + + /** + * Set tier + * @param tier VIP level for the floating rate to be queried (optional) + * @return APIgetHistoryLoanRateRequest + */ + public APIgetHistoryLoanRateRequest tier(String tier) { + this.tier = tier; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIgetHistoryLoanRateRequest + */ + public APIgetHistoryLoanRateRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIgetHistoryLoanRateRequest + */ + public APIgetHistoryLoanRateRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for getHistoryLoanRate + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getHistoryLoanRateCall(currency, tier, page, limit, _callback); + } + + /** + * Execute getHistoryLoanRate request + * @return UnifiedHistoryLoanRate + * @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 Query successful -
+ */ + public UnifiedHistoryLoanRate execute() throws ApiException { + ApiResponse localVarResp = getHistoryLoanRateWithHttpInfo(currency, tier, page, limit); + return localVarResp.getData(); + } + + /** + * Execute getHistoryLoanRate request with HTTP info returned + * @return ApiResponse<UnifiedHistoryLoanRate> + * @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 Query successful -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getHistoryLoanRateWithHttpInfo(currency, tier, page, limit); + } + + /** + * Execute getHistoryLoanRate request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getHistoryLoanRateAsync(currency, tier, page, limit, _callback); + } + } + + /** + * Get historical lending rates + * + * @param currency Currency (required) + * @return APIgetHistoryLoanRateRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIgetHistoryLoanRateRequest getHistoryLoanRate(String currency) { + return new APIgetHistoryLoanRateRequest(currency); + } + + /** + * Build call for setUnifiedCollateral + * @param unifiedCollateralReq (required) + * @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 Updated successfully -
+ */ + public okhttp3.Call setUnifiedCollateralCall(UnifiedCollateralReq unifiedCollateralReq, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = unifiedCollateralReq; + + // create path and map variables + String localVarPath = "/unified/collateral_currencies"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setUnifiedCollateralValidateBeforeCall(UnifiedCollateralReq unifiedCollateralReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'unifiedCollateralReq' is set + if (unifiedCollateralReq == null) { + throw new ApiException("Missing the required parameter 'unifiedCollateralReq' when calling setUnifiedCollateral(Async)"); + } + + okhttp3.Call localVarCall = setUnifiedCollateralCall(unifiedCollateralReq, _callback); + return localVarCall; + } + + /** + * Set collateral currency + * + * @param unifiedCollateralReq (required) + * @return UnifiedCollateralRes + * @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 Updated successfully -
+ */ + public UnifiedCollateralRes setUnifiedCollateral(UnifiedCollateralReq unifiedCollateralReq) throws ApiException { + ApiResponse localVarResp = setUnifiedCollateralWithHttpInfo(unifiedCollateralReq); + return localVarResp.getData(); + } + + /** + * Set collateral currency + * + * @param unifiedCollateralReq (required) + * @return ApiResponse<UnifiedCollateralRes> + * @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 Updated successfully -
+ */ + public ApiResponse setUnifiedCollateralWithHttpInfo(UnifiedCollateralReq unifiedCollateralReq) throws ApiException { + okhttp3.Call localVarCall = setUnifiedCollateralValidateBeforeCall(unifiedCollateralReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set collateral currency (asynchronously) + * + * @param unifiedCollateralReq (required) + * @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 Updated successfully -
+ */ + public okhttp3.Call setUnifiedCollateralAsync(UnifiedCollateralReq unifiedCollateralReq, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = setUnifiedCollateralValidateBeforeCall(unifiedCollateralReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + +} diff --git a/src/main/java/io/gate/gateapi/api/WalletApi.java b/src/main/java/io/gate/gateapi/api/WalletApi.java index 2dfd624..aecf419 100644 --- a/src/main/java/io/gate/gateapi/api/WalletApi.java +++ b/src/main/java/io/gate/gateapi/api/WalletApi.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 @@ -20,14 +20,28 @@ import com.google.gson.reflect.TypeToken; +import io.gate.gateapi.models.ConvertSmallBalance; +import io.gate.gateapi.models.CurrencyChain; import io.gate.gateapi.models.DepositAddress; -import io.gate.gateapi.models.LedgerRecord; +import io.gate.gateapi.models.DepositRecord; +import io.gate.gateapi.models.SavedAddress; +import io.gate.gateapi.models.SmallBalance; +import io.gate.gateapi.models.SmallBalanceHistory; import io.gate.gateapi.models.SubAccountBalance; +import io.gate.gateapi.models.SubAccountCrossMarginBalance; +import io.gate.gateapi.models.SubAccountFuturesBalance; +import io.gate.gateapi.models.SubAccountMarginBalance; +import io.gate.gateapi.models.SubAccountToSubAccount; import io.gate.gateapi.models.SubAccountTransfer; +import io.gate.gateapi.models.SubAccountTransferRecordItem; import io.gate.gateapi.models.TotalBalance; import io.gate.gateapi.models.TradeFee; +import io.gate.gateapi.models.TransactionID; import io.gate.gateapi.models.Transfer; +import io.gate.gateapi.models.TransferOrderStatus; +import io.gate.gateapi.models.UidPushOrder; import io.gate.gateapi.models.WithdrawStatus; +import io.gate.gateapi.models.WithdrawalRecord; import java.lang.reflect.Type; import java.util.ArrayList; @@ -54,6 +68,117 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + /** + * Build call for listCurrencyChains + * @param currency Currency name (required) + * @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 Query successful -
+ */ + public okhttp3.Call listCurrencyChainsCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/currency_chains"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCurrencyChainsValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling listCurrencyChains(Async)"); + } + + okhttp3.Call localVarCall = listCurrencyChainsCall(currency, _callback); + return localVarCall; + } + + /** + * Query chains supported for specified currency + * + * @param currency Currency name (required) + * @return List<CurrencyChain> + * @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 Query successful -
+ */ + public List listCurrencyChains(String currency) throws ApiException { + ApiResponse> localVarResp = listCurrencyChainsWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Query chains supported for specified currency + * + * @param currency Currency name (required) + * @return ApiResponse<List<CurrencyChain>> + * @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 Query successful -
+ */ + public ApiResponse> listCurrencyChainsWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = listCurrencyChainsValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Query chains supported for specified currency (asynchronously) + * + * @param currency Currency name (required) + * @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 Query successful -
+ */ + public okhttp3.Call listCurrencyChainsAsync(String currency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listCurrencyChainsValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for getDepositAddress * @param currency Currency name (required) @@ -165,7 +290,7 @@ public okhttp3.Call getDepositAddressAsync(String currency, final ApiCallback> listWithdrawalsWithHttpInfo(String currency, Long from, Long to, Integer limit, Integer offset) throws ApiException { - okhttp3.Call localVarCall = listWithdrawalsValidateBeforeCall(currency, from, to, limit, offset, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> listWithdrawalsWithHttpInfo(String currency, String withdrawId, String assetClass, String withdrawOrderId, Long from, Long to, Integer limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = listWithdrawalsValidateBeforeCall(currency, withdrawId, assetClass, withdrawOrderId, from, to, limit, offset, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listWithdrawalsAsync(String currency, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listWithdrawalsValidateBeforeCall(currency, from, to, limit, offset, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call listWithdrawalsAsync(String currency, String withdrawId, String assetClass, String withdrawOrderId, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listWithdrawalsValidateBeforeCall(currency, withdrawId, assetClass, withdrawOrderId, from, to, limit, offset, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIlistWithdrawalsRequest { private String currency; + private String withdrawId; + private String assetClass; + private String withdrawOrderId; private Long from; private Long to; private Integer limit; @@ -246,7 +386,7 @@ private APIlistWithdrawalsRequest() { /** * Set currency - * @param currency Filter by currency. Return all currency records if not specified (optional) + * @param currency Specify the currency. If not specified, returns all currencies (optional) * @return APIlistWithdrawalsRequest */ public APIlistWithdrawalsRequest currency(String currency) { @@ -254,9 +394,39 @@ public APIlistWithdrawalsRequest currency(String currency) { return this; } + /** + * Set withdrawId + * @param withdrawId 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) + * @return APIlistWithdrawalsRequest + */ + public APIlistWithdrawalsRequest withdrawId(String withdrawId) { + this.withdrawId = withdrawId; + return this; + } + + /** + * Set assetClass + * @param assetClass 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) + * @return APIlistWithdrawalsRequest + */ + public APIlistWithdrawalsRequest assetClass(String assetClass) { + this.assetClass = assetClass; + return this; + } + + /** + * Set withdrawOrderId + * @param withdrawOrderId User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional) + * @return APIlistWithdrawalsRequest + */ + public APIlistWithdrawalsRequest withdrawOrderId(String withdrawOrderId) { + this.withdrawOrderId = withdrawOrderId; + return this; + } + /** * Set from - * @param from Time range beginning, default to 7 days before current time (optional) + * @param from Start time for querying records, defaults to 7 days before current time if not specified (optional) * @return APIlistWithdrawalsRequest */ public APIlistWithdrawalsRequest from(Long from) { @@ -266,7 +436,7 @@ public APIlistWithdrawalsRequest from(Long from) { /** * Set to - * @param to Time range ending, default to current time (optional) + * @param to End timestamp for the query, defaults to current time if not specified (optional) * @return APIlistWithdrawalsRequest */ public APIlistWithdrawalsRequest to(Long to) { @@ -276,7 +446,7 @@ public APIlistWithdrawalsRequest to(Long to) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistWithdrawalsRequest */ public APIlistWithdrawalsRequest limit(Integer limit) { @@ -302,40 +472,40 @@ public APIlistWithdrawalsRequest offset(Integer offset) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listWithdrawalsCall(currency, from, to, limit, offset, _callback); + return listWithdrawalsCall(currency, withdrawId, assetClass, withdrawOrderId, from, to, limit, offset, _callback); } /** * Execute listWithdrawals request - * @return List<LedgerRecord> + * @return List<WithdrawalRecord> * @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 List retrieved -
200 List retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listWithdrawalsWithHttpInfo(currency, from, to, limit, offset); + public List execute() throws ApiException { + ApiResponse> localVarResp = listWithdrawalsWithHttpInfo(currency, withdrawId, assetClass, withdrawOrderId, from, to, limit, offset); return localVarResp.getData(); } /** * Execute listWithdrawals request with HTTP info returned - * @return ApiResponse<List<LedgerRecord>> + * @return ApiResponse<List<WithdrawalRecord>> * @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 List retrieved -
200 List retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listWithdrawalsWithHttpInfo(currency, from, to, limit, offset); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listWithdrawalsWithHttpInfo(currency, withdrawId, assetClass, withdrawOrderId, from, to, limit, offset); } /** @@ -346,22 +516,22 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listWithdrawalsAsync(currency, from, to, limit, offset, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listWithdrawalsAsync(currency, withdrawId, assetClass, withdrawOrderId, from, to, limit, offset, _callback); } } /** - * Retrieve withdrawal records - * Record time range cannot exceed 30 days + * Get withdrawal records + * Record query time range cannot exceed 30 days * @return APIlistWithdrawalsRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistWithdrawalsRequest listWithdrawals() { @@ -424,15 +594,15 @@ private okhttp3.Call listDepositsValidateBeforeCall(String currency, Long from, } - private ApiResponse> listDepositsWithHttpInfo(String currency, Long from, Long to, Integer limit, Integer offset) throws ApiException { + private ApiResponse> listDepositsWithHttpInfo(String currency, Long from, Long to, Integer limit, Integer offset) throws ApiException { okhttp3.Call localVarCall = listDepositsValidateBeforeCall(currency, from, to, limit, offset, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listDepositsAsync(String currency, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + private okhttp3.Call listDepositsAsync(String currency, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = listDepositsValidateBeforeCall(currency, from, to, limit, offset, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -449,7 +619,7 @@ private APIlistDepositsRequest() { /** * Set currency - * @param currency Filter by currency. Return all currency records if not specified (optional) + * @param currency Specify the currency. If not specified, returns all currencies (optional) * @return APIlistDepositsRequest */ public APIlistDepositsRequest currency(String currency) { @@ -459,7 +629,7 @@ public APIlistDepositsRequest currency(String currency) { /** * Set from - * @param from Time range beginning, default to 7 days before current time (optional) + * @param from Start time for querying records, defaults to 7 days before current time if not specified (optional) * @return APIlistDepositsRequest */ public APIlistDepositsRequest from(Long from) { @@ -469,7 +639,7 @@ public APIlistDepositsRequest from(Long from) { /** * Set to - * @param to Time range ending, default to current time (optional) + * @param to End timestamp for the query, defaults to current time if not specified (optional) * @return APIlistDepositsRequest */ public APIlistDepositsRequest to(Long to) { @@ -479,7 +649,7 @@ public APIlistDepositsRequest to(Long to) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of entries returned in the list, limited to 500 transactions (optional, default to 100) * @return APIlistDepositsRequest */ public APIlistDepositsRequest limit(Integer limit) { @@ -505,7 +675,7 @@ public APIlistDepositsRequest offset(Integer offset) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -514,30 +684,30 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { /** * Execute listDeposits request - * @return List<LedgerRecord> + * @return List<DepositRecord> * @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 List retrieved -
200 List retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listDepositsWithHttpInfo(currency, from, to, limit, offset); + public List execute() throws ApiException { + ApiResponse> localVarResp = listDepositsWithHttpInfo(currency, from, to, limit, offset); return localVarResp.getData(); } /** * Execute listDeposits request with HTTP info returned - * @return ApiResponse<List<LedgerRecord>> + * @return ApiResponse<List<DepositRecord>> * @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 List retrieved -
200 List retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { + public ApiResponse> executeWithHttpInfo() throws ApiException { return listDepositsWithHttpInfo(currency, from, to, limit, offset); } @@ -549,22 +719,22 @@ public ApiResponse> executeWithHttpInfo() throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listDepositsAsync(currency, from, to, limit, offset, _callback); } } /** - * Retrieve deposit records - * Record time range cannot exceed 30 days + * Get deposit records + * Record query time range cannot exceed 30 days * @return APIlistDepositsRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistDepositsRequest listDeposits() { @@ -580,7 +750,7 @@ public APIlistDepositsRequest listDeposits() { * @http.response.details - +
Status Code Description Response Headers
204 Balance transferred -
200 Transfer operation successful -
*/ public okhttp3.Call transferCall(Transfer transfer, final ApiCallback _callback) throws ApiException { @@ -595,7 +765,7 @@ public okhttp3.Call transferCall(Transfer transfer, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -625,39 +795,42 @@ private okhttp3.Call transferValidateBeforeCall(Transfer transfer, final ApiCall /** * 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 * @param transfer (required) + * @return TransactionID * @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
204 Balance transferred -
200 Transfer operation successful -
*/ - public void transfer(Transfer transfer) throws ApiException { - transferWithHttpInfo(transfer); + public TransactionID transfer(Transfer transfer) throws ApiException { + ApiResponse localVarResp = transferWithHttpInfo(transfer); + return localVarResp.getData(); } /** * 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 * @param transfer (required) - * @return ApiResponse<Void> + * @return ApiResponse<TransactionID> * @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
204 Balance transferred -
200 Transfer operation successful -
*/ - public ApiResponse transferWithHttpInfo(Transfer transfer) throws ApiException { + public ApiResponse transferWithHttpInfo(Transfer transfer) throws ApiException { okhttp3.Call localVarCall = transferValidateBeforeCall(transfer, null); - return localVarApiClient.execute(localVarCall); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Transfer between trading accounts (asynchronously) - * 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 * @param transfer (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -665,12 +838,13 @@ public ApiResponse transferWithHttpInfo(Transfer transfer) throws ApiExcep * @http.response.details - +
Status Code Description Response Headers
204 Balance transferred -
200 Transfer operation successful -
*/ - public okhttp3.Call transferAsync(Transfer transfer, final ApiCallback _callback) throws ApiException { + public okhttp3.Call transferAsync(Transfer transfer, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = transferValidateBeforeCall(transfer, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -730,15 +904,15 @@ private okhttp3.Call listSubAccountTransfersValidateBeforeCall(String subUid, Lo } - private ApiResponse> listSubAccountTransfersWithHttpInfo(String subUid, Long from, Long to, Integer limit, Integer offset) throws ApiException { + private ApiResponse> listSubAccountTransfersWithHttpInfo(String subUid, Long from, Long to, Integer limit, Integer offset) throws ApiException { okhttp3.Call localVarCall = listSubAccountTransfersValidateBeforeCall(subUid, from, to, limit, offset, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listSubAccountTransfersAsync(String subUid, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + private okhttp3.Call listSubAccountTransfersAsync(String subUid, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = listSubAccountTransfersValidateBeforeCall(subUid, from, to, limit, offset, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -755,7 +929,7 @@ private APIlistSubAccountTransfersRequest() { /** * Set subUid - * @param subUid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param subUid Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional) * @return APIlistSubAccountTransfersRequest */ public APIlistSubAccountTransfersRequest subUid(String subUid) { @@ -765,7 +939,7 @@ public APIlistSubAccountTransfersRequest subUid(String subUid) { /** * Set from - * @param from Time range beginning, default to 7 days before current time (optional) + * @param from Start time for querying records, defaults to 7 days before current time if not specified (optional) * @return APIlistSubAccountTransfersRequest */ public APIlistSubAccountTransfersRequest from(Long from) { @@ -775,7 +949,7 @@ public APIlistSubAccountTransfersRequest from(Long from) { /** * Set to - * @param to Time range ending, default to current time (optional) + * @param to End timestamp for the query, defaults to current time if not specified (optional) * @return APIlistSubAccountTransfersRequest */ public APIlistSubAccountTransfersRequest to(Long to) { @@ -785,7 +959,7 @@ public APIlistSubAccountTransfersRequest to(Long to) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistSubAccountTransfersRequest */ public APIlistSubAccountTransfersRequest limit(Integer limit) { @@ -811,7 +985,7 @@ public APIlistSubAccountTransfersRequest offset(Integer offset) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -820,30 +994,30 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { /** * Execute listSubAccountTransfers request - * @return List<SubAccountTransfer> + * @return List<SubAccountTransferRecordItem> * @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 List retrieved -
200 List retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listSubAccountTransfersWithHttpInfo(subUid, from, to, limit, offset); + public List execute() throws ApiException { + ApiResponse> localVarResp = listSubAccountTransfersWithHttpInfo(subUid, from, to, limit, offset); return localVarResp.getData(); } /** * Execute listSubAccountTransfers request with HTTP info returned - * @return ApiResponse<List<SubAccountTransfer>> + * @return ApiResponse<List<SubAccountTransferRecordItem>> * @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 List retrieved -
200 List retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { + public ApiResponse> executeWithHttpInfo() throws ApiException { return listSubAccountTransfersWithHttpInfo(subUid, from, to, limit, offset); } @@ -855,22 +1029,22 @@ public ApiResponse> executeWithHttpInfo() throws ApiExc * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listSubAccountTransfersAsync(subUid, from, to, limit, offset, _callback); } } /** - * Retrieve transfer records between main and sub accounts - * Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved + * Get transfer records between main and sub accounts + * Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved * @return APIlistSubAccountTransfersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistSubAccountTransfersRequest listSubAccountTransfers() { @@ -886,7 +1060,7 @@ public APIlistSubAccountTransfersRequest listSubAccountTransfers() { * @http.response.details - +
Status Code Description Response Headers
204 Balance transferred -
200 Transfer operation successful -
*/ public okhttp3.Call transferWithSubAccountCall(SubAccountTransfer subAccountTransfer, final ApiCallback _callback) throws ApiException { @@ -901,7 +1075,7 @@ public okhttp3.Call transferWithSubAccountCall(SubAccountTransfer subAccountTran Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -931,39 +1105,42 @@ private okhttp3.Call transferWithSubAccountValidateBeforeCall(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 * @param subAccountTransfer (required) + * @return TransactionID * @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
204 Balance transferred -
200 Transfer operation successful -
*/ - public void transferWithSubAccount(SubAccountTransfer subAccountTransfer) throws ApiException { - transferWithSubAccountWithHttpInfo(subAccountTransfer); + public TransactionID transferWithSubAccount(SubAccountTransfer subAccountTransfer) throws ApiException { + ApiResponse localVarResp = transferWithSubAccountWithHttpInfo(subAccountTransfer); + return localVarResp.getData(); } /** * 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 * @param subAccountTransfer (required) - * @return ApiResponse<Void> + * @return ApiResponse<TransactionID> * @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
204 Balance transferred -
200 Transfer operation successful -
*/ - public ApiResponse transferWithSubAccountWithHttpInfo(SubAccountTransfer subAccountTransfer) throws ApiException { + public ApiResponse transferWithSubAccountWithHttpInfo(SubAccountTransfer subAccountTransfer) throws ApiException { okhttp3.Call localVarCall = transferWithSubAccountValidateBeforeCall(subAccountTransfer, null); - return localVarApiClient.execute(localVarCall); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Transfer between main and sub accounts (asynchronously) - * 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 * @param subAccountTransfer (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -971,25 +1148,137 @@ public ApiResponse transferWithSubAccountWithHttpInfo(SubAccountTransfer s * @http.response.details - +
Status Code Description Response Headers
204 Balance transferred -
200 Transfer operation successful -
*/ - public okhttp3.Call transferWithSubAccountAsync(SubAccountTransfer subAccountTransfer, final ApiCallback _callback) throws ApiException { + public okhttp3.Call transferWithSubAccountAsync(SubAccountTransfer subAccountTransfer, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = transferWithSubAccountValidateBeforeCall(subAccountTransfer, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - private okhttp3.Call listWithdrawStatusCall(String currency, final ApiCallback _callback) throws ApiException { + /** + * Build call for subAccountToSubAccount + * @param subAccountToSubAccount (required) + * @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 Transfer operation successful -
+ */ + public okhttp3.Call subAccountToSubAccountCall(SubAccountToSubAccount subAccountToSubAccount, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = subAccountToSubAccount; + + // create path and map variables + String localVarPath = "/wallet/sub_account_to_sub_account"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subAccountToSubAccountValidateBeforeCall(SubAccountToSubAccount subAccountToSubAccount, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'subAccountToSubAccount' is set + if (subAccountToSubAccount == null) { + throw new ApiException("Missing the required parameter 'subAccountToSubAccount' when calling subAccountToSubAccount(Async)"); + } + + okhttp3.Call localVarCall = subAccountToSubAccountCall(subAccountToSubAccount, _callback); + return localVarCall; + } + + /** + * 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 + * @param subAccountToSubAccount (required) + * @return TransactionID + * @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 Transfer operation successful -
+ */ + public TransactionID subAccountToSubAccount(SubAccountToSubAccount subAccountToSubAccount) throws ApiException { + ApiResponse localVarResp = subAccountToSubAccountWithHttpInfo(subAccountToSubAccount); + return localVarResp.getData(); + } + + /** + * 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 + * @param subAccountToSubAccount (required) + * @return ApiResponse<TransactionID> + * @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 Transfer operation successful -
+ */ + public ApiResponse subAccountToSubAccountWithHttpInfo(SubAccountToSubAccount subAccountToSubAccount) throws ApiException { + okhttp3.Call localVarCall = subAccountToSubAccountValidateBeforeCall(subAccountToSubAccount, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Transfer between sub-accounts (asynchronously) + * 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 + * @param subAccountToSubAccount (required) + * @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 Transfer operation successful -
+ */ + public okhttp3.Call subAccountToSubAccountAsync(SubAccountToSubAccount subAccountToSubAccount, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = subAccountToSubAccountValidateBeforeCall(subAccountToSubAccount, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call getTransferOrderStatusCall(String clientOrderId, String txId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/wallet/withdraw_status"; + String localVarPath = "/wallet/order_status"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + if (clientOrderId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("client_order_id", clientOrderId)); + } + + if (txId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tx_id", txId)); } Map localVarHeaderParams = new HashMap(); @@ -1014,125 +1303,136 @@ private okhttp3.Call listWithdrawStatusCall(String currency, final ApiCallback _ } @SuppressWarnings("rawtypes") - private okhttp3.Call listWithdrawStatusValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listWithdrawStatusCall(currency, _callback); + private okhttp3.Call getTransferOrderStatusValidateBeforeCall(String clientOrderId, String txId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getTransferOrderStatusCall(clientOrderId, txId, _callback); return localVarCall; } - private ApiResponse> listWithdrawStatusWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = listWithdrawStatusValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse getTransferOrderStatusWithHttpInfo(String clientOrderId, String txId) throws ApiException { + okhttp3.Call localVarCall = getTransferOrderStatusValidateBeforeCall(clientOrderId, txId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listWithdrawStatusAsync(String currency, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listWithdrawStatusValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call getTransferOrderStatusAsync(String clientOrderId, String txId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getTransferOrderStatusValidateBeforeCall(clientOrderId, txId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIlistWithdrawStatusRequest { - private String currency; + public class APIgetTransferOrderStatusRequest { + private String clientOrderId; + private String txId; - private APIlistWithdrawStatusRequest() { + private APIgetTransferOrderStatusRequest() { } /** - * Set currency - * @param currency Retrieve data of the specified currency (optional) - * @return APIlistWithdrawStatusRequest + * Set clientOrderId + * @param clientOrderId 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) + * @return APIgetTransferOrderStatusRequest */ - public APIlistWithdrawStatusRequest currency(String currency) { - this.currency = currency; + public APIgetTransferOrderStatusRequest clientOrderId(String clientOrderId) { + this.clientOrderId = clientOrderId; return this; } /** - * Build call for listWithdrawStatus + * Set txId + * @param txId Transfer operation number, cannot be empty at the same time as client_order_id (optional) + * @return APIgetTransferOrderStatusRequest + */ + public APIgetTransferOrderStatusRequest txId(String txId) { + this.txId = txId; + return this; + } + + /** + * Build call for getTransferOrderStatus * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Transfer status retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listWithdrawStatusCall(currency, _callback); + return getTransferOrderStatusCall(clientOrderId, txId, _callback); } /** - * Execute listWithdrawStatus request - * @return List<WithdrawStatus> + * Execute getTransferOrderStatus request + * @return TransferOrderStatus * @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 List retrieved -
200 Transfer status retrieved successfully -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listWithdrawStatusWithHttpInfo(currency); + public TransferOrderStatus execute() throws ApiException { + ApiResponse localVarResp = getTransferOrderStatusWithHttpInfo(clientOrderId, txId); return localVarResp.getData(); } /** - * Execute listWithdrawStatus request with HTTP info returned - * @return ApiResponse<List<WithdrawStatus>> + * Execute getTransferOrderStatus request with HTTP info returned + * @return ApiResponse<TransferOrderStatus> * @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 List retrieved -
200 Transfer status retrieved successfully -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listWithdrawStatusWithHttpInfo(currency); + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTransferOrderStatusWithHttpInfo(clientOrderId, txId); } /** - * Execute listWithdrawStatus request (asynchronously) + * Execute getTransferOrderStatus request (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 List retrieved -
200 Transfer status retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listWithdrawStatusAsync(currency, _callback); + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTransferOrderStatusAsync(clientOrderId, txId, _callback); } } /** - * Retrieve withdrawal status - * - * @return APIlistWithdrawStatusRequest + * Transfer status query + * Supports querying transfer status based on user-defined client_order_id or tx_id returned by the transfer interface + * @return APIgetTransferOrderStatusRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Transfer status retrieved successfully -
*/ - public APIlistWithdrawStatusRequest listWithdrawStatus() { - return new APIlistWithdrawStatusRequest(); + public APIgetTransferOrderStatusRequest getTransferOrderStatus() { + return new APIgetTransferOrderStatusRequest(); } - private okhttp3.Call listSubAccountBalancesCall(String subUid, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listWithdrawStatusCall(String currency, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/wallet/sub_account_balances"; + String localVarPath = "/wallet/withdraw_status"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (subUid != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sub_uid", subUid)); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); } Map localVarHeaderParams = new HashMap(); @@ -1157,8 +1457,151 @@ private okhttp3.Call listSubAccountBalancesCall(String subUid, final ApiCallback } @SuppressWarnings("rawtypes") - private okhttp3.Call listSubAccountBalancesValidateBeforeCall(String subUid, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listSubAccountBalancesCall(subUid, _callback); + private okhttp3.Call listWithdrawStatusValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listWithdrawStatusCall(currency, _callback); + return localVarCall; + } + + + private ApiResponse> listWithdrawStatusWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = listWithdrawStatusValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listWithdrawStatusAsync(String currency, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listWithdrawStatusValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistWithdrawStatusRequest { + private String currency; + + private APIlistWithdrawStatusRequest() { + } + + /** + * Set currency + * @param currency Query by specified currency name (optional) + * @return APIlistWithdrawStatusRequest + */ + public APIlistWithdrawStatusRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Build call for listWithdrawStatus + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listWithdrawStatusCall(currency, _callback); + } + + /** + * Execute listWithdrawStatus request + * @return List<WithdrawStatus> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listWithdrawStatusWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Execute listWithdrawStatus request with HTTP info returned + * @return ApiResponse<List<WithdrawStatus>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listWithdrawStatusWithHttpInfo(currency); + } + + /** + * Execute listWithdrawStatus request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listWithdrawStatusAsync(currency, _callback); + } + } + + /** + * Query withdrawal status + * + * @return APIlistWithdrawStatusRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistWithdrawStatusRequest listWithdrawStatus() { + return new APIlistWithdrawStatusRequest(); + } + + private okhttp3.Call listSubAccountBalancesCall(String subUid, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/sub_account_balances"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (subUid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sub_uid", subUid)); + } + + 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 listSubAccountBalancesValidateBeforeCall(String subUid, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountBalancesCall(subUid, _callback); return localVarCall; } @@ -1184,7 +1627,7 @@ private APIlistSubAccountBalancesRequest() { /** * Set subUid - * @param subUid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param subUid Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional) * @return APIlistSubAccountBalancesRequest */ public APIlistSubAccountBalancesRequest subUid(String subUid) { @@ -1200,7 +1643,7 @@ public APIlistSubAccountBalancesRequest subUid(String subUid) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1214,7 +1657,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public List execute() throws ApiException { @@ -1229,7 +1672,7 @@ public List execute() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -1244,7 +1687,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExce * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1253,29 +1696,29 @@ public okhttp3.Call executeAsync(final ApiCallback> _cal } /** - * Retrieve sub account balances + * Query sub-account balance information * * @return APIlistSubAccountBalancesRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistSubAccountBalancesRequest listSubAccountBalances() { return new APIlistSubAccountBalancesRequest(); } - private okhttp3.Call getTradeFeeCall(String currencyPair, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listSubAccountMarginBalancesCall(String subUid, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/wallet/fee"; + String localVarPath = "/wallet/sub_account_margin_balances"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currencyPair != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + if (subUid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sub_uid", subUid)); } Map localVarHeaderParams = new HashMap(); @@ -1300,125 +1743,129 @@ private okhttp3.Call getTradeFeeCall(String currencyPair, final ApiCallback _cal } @SuppressWarnings("rawtypes") - private okhttp3.Call getTradeFeeValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getTradeFeeCall(currencyPair, _callback); + private okhttp3.Call listSubAccountMarginBalancesValidateBeforeCall(String subUid, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountMarginBalancesCall(subUid, _callback); return localVarCall; } - private ApiResponse getTradeFeeWithHttpInfo(String currencyPair) throws ApiException { - okhttp3.Call localVarCall = getTradeFeeValidateBeforeCall(currencyPair, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse> listSubAccountMarginBalancesWithHttpInfo(String subUid) throws ApiException { + okhttp3.Call localVarCall = listSubAccountMarginBalancesValidateBeforeCall(subUid, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call getTradeFeeAsync(String currencyPair, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getTradeFeeValidateBeforeCall(currencyPair, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + private okhttp3.Call listSubAccountMarginBalancesAsync(String subUid, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountMarginBalancesValidateBeforeCall(subUid, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIgetTradeFeeRequest { - private String currencyPair; + public class APIlistSubAccountMarginBalancesRequest { + private String subUid; - private APIgetTradeFeeRequest() { + private APIlistSubAccountMarginBalancesRequest() { } /** - * Set currencyPair - * @param currencyPair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) - * @return APIgetTradeFeeRequest + * Set subUid + * @param subUid Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional) + * @return APIlistSubAccountMarginBalancesRequest */ - public APIgetTradeFeeRequest currencyPair(String currencyPair) { - this.currencyPair = currencyPair; + public APIlistSubAccountMarginBalancesRequest subUid(String subUid) { + this.subUid = subUid; return this; } /** - * Build call for getTradeFee + * Build call for listSubAccountMarginBalances * @param _callback ApiCallback API callback * @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 -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getTradeFeeCall(currencyPair, _callback); + return listSubAccountMarginBalancesCall(subUid, _callback); } /** - * Execute getTradeFee request - * @return TradeFee + * Execute listSubAccountMarginBalances request + * @return List<SubAccountMarginBalance> * @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 -
200 List retrieved successfully -
*/ - public TradeFee execute() throws ApiException { - ApiResponse localVarResp = getTradeFeeWithHttpInfo(currencyPair); + public List execute() throws ApiException { + ApiResponse> localVarResp = listSubAccountMarginBalancesWithHttpInfo(subUid); return localVarResp.getData(); } /** - * Execute getTradeFee request with HTTP info returned - * @return ApiResponse<TradeFee> + * Execute listSubAccountMarginBalances request with HTTP info returned + * @return ApiResponse<List<SubAccountMarginBalance>> * @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 -
200 List retrieved successfully -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getTradeFeeWithHttpInfo(currencyPair); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSubAccountMarginBalancesWithHttpInfo(subUid); } /** - * Execute getTradeFee request (asynchronously) + * Execute listSubAccountMarginBalances request (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 -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getTradeFeeAsync(currencyPair, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSubAccountMarginBalancesAsync(subUid, _callback); } } /** - * Retrieve personal trading fee + * Query sub-account isolated margin account balance information * - * @return APIgetTradeFeeRequest + * @return APIlistSubAccountMarginBalancesRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 List retrieved successfully -
*/ - public APIgetTradeFeeRequest getTradeFee() { - return new APIgetTradeFeeRequest(); + public APIlistSubAccountMarginBalancesRequest listSubAccountMarginBalances() { + return new APIlistSubAccountMarginBalancesRequest(); } - private okhttp3.Call getTotalBalanceCall(String currency, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listSubAccountFuturesBalancesCall(String subUid, String settle, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/wallet/total_balance"; + String localVarPath = "/wallet/sub_account_futures_balances"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + if (subUid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sub_uid", subUid)); + } + + if (settle != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("settle", settle)); } Map localVarHeaderParams = new HashMap(); @@ -1443,113 +1890,1345 @@ private okhttp3.Call getTotalBalanceCall(String currency, final ApiCallback _cal } @SuppressWarnings("rawtypes") - private okhttp3.Call getTotalBalanceValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getTotalBalanceCall(currency, _callback); + private okhttp3.Call listSubAccountFuturesBalancesValidateBeforeCall(String subUid, String settle, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountFuturesBalancesCall(subUid, settle, _callback); return localVarCall; } - private ApiResponse getTotalBalanceWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getTotalBalanceValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); + private ApiResponse> listSubAccountFuturesBalancesWithHttpInfo(String subUid, String settle) throws ApiException { + okhttp3.Call localVarCall = listSubAccountFuturesBalancesValidateBeforeCall(subUid, settle, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call getTotalBalanceAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getTotalBalanceValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + private okhttp3.Call listSubAccountFuturesBalancesAsync(String subUid, String settle, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountFuturesBalancesValidateBeforeCall(subUid, settle, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - public class APIgetTotalBalanceRequest { - private String currency; + public class APIlistSubAccountFuturesBalancesRequest { + private String subUid; + private String settle; - private APIgetTotalBalanceRequest() { + private APIlistSubAccountFuturesBalancesRequest() { } /** - * Set currency - * @param currency Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. (optional, default to "USDT") - * @return APIgetTotalBalanceRequest + * Set subUid + * @param subUid Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional) + * @return APIlistSubAccountFuturesBalancesRequest */ - public APIgetTotalBalanceRequest currency(String currency) { - this.currency = currency; + public APIlistSubAccountFuturesBalancesRequest subUid(String subUid) { + this.subUid = subUid; return this; } /** - * Build call for getTotalBalance + * Set settle + * @param settle Query balance of specified settlement currency (optional) + * @return APIlistSubAccountFuturesBalancesRequest + */ + public APIlistSubAccountFuturesBalancesRequest settle(String settle) { + this.settle = settle; + return this; + } + + /** + * Build call for listSubAccountFuturesBalances * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 Request is valid and is successfully responded -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getTotalBalanceCall(currency, _callback); + return listSubAccountFuturesBalancesCall(subUid, settle, _callback); } /** - * Execute getTotalBalance request - * @return TotalBalance + * Execute listSubAccountFuturesBalances request + * @return List<SubAccountFuturesBalance> * @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 Request is valid and is successfully responded -
200 List retrieved successfully -
*/ - public TotalBalance execute() throws ApiException { - ApiResponse localVarResp = getTotalBalanceWithHttpInfo(currency); + public List execute() throws ApiException { + ApiResponse> localVarResp = listSubAccountFuturesBalancesWithHttpInfo(subUid, settle); return localVarResp.getData(); } /** - * Execute getTotalBalance request with HTTP info returned - * @return ApiResponse<TotalBalance> + * Execute listSubAccountFuturesBalances request with HTTP info returned + * @return ApiResponse<List<SubAccountFuturesBalance>> * @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 Request is valid and is successfully responded -
200 List retrieved successfully -
*/ - public ApiResponse executeWithHttpInfo() throws ApiException { - return getTotalBalanceWithHttpInfo(currency); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSubAccountFuturesBalancesWithHttpInfo(subUid, settle); } /** - * Execute getTotalBalance request (asynchronously) + * Execute listSubAccountFuturesBalances request (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 Request is valid and is successfully responded -
200 List retrieved successfully -
*/ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getTotalBalanceAsync(currency, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSubAccountFuturesBalancesAsync(subUid, settle, _callback); } } /** - * Retrieve user's total balances + * Query sub-account perpetual futures account balance information * - * @return APIgetTotalBalanceRequest + * @return APIlistSubAccountFuturesBalancesRequest * @http.response.details - +
Status Code Description Response Headers
200 Request is valid and is successfully responded -
200 List retrieved successfully -
*/ - public APIgetTotalBalanceRequest getTotalBalance() { - return new APIgetTotalBalanceRequest(); + public APIlistSubAccountFuturesBalancesRequest listSubAccountFuturesBalances() { + return new APIlistSubAccountFuturesBalancesRequest(); + } + + private okhttp3.Call listSubAccountCrossMarginBalancesCall(String subUid, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/sub_account_cross_margin_balances"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (subUid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sub_uid", subUid)); + } + + 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 listSubAccountCrossMarginBalancesValidateBeforeCall(String subUid, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountCrossMarginBalancesCall(subUid, _callback); + return localVarCall; + } + + + private ApiResponse> listSubAccountCrossMarginBalancesWithHttpInfo(String subUid) throws ApiException { + okhttp3.Call localVarCall = listSubAccountCrossMarginBalancesValidateBeforeCall(subUid, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listSubAccountCrossMarginBalancesAsync(String subUid, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSubAccountCrossMarginBalancesValidateBeforeCall(subUid, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistSubAccountCrossMarginBalancesRequest { + private String subUid; + + private APIlistSubAccountCrossMarginBalancesRequest() { + } + + /** + * Set subUid + * @param subUid Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional) + * @return APIlistSubAccountCrossMarginBalancesRequest + */ + public APIlistSubAccountCrossMarginBalancesRequest subUid(String subUid) { + this.subUid = subUid; + return this; + } + + /** + * Build call for listSubAccountCrossMarginBalances + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listSubAccountCrossMarginBalancesCall(subUid, _callback); + } + + /** + * Execute listSubAccountCrossMarginBalances request + * @return List<SubAccountCrossMarginBalance> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listSubAccountCrossMarginBalancesWithHttpInfo(subUid); + return localVarResp.getData(); + } + + /** + * Execute listSubAccountCrossMarginBalances request with HTTP info returned + * @return ApiResponse<List<SubAccountCrossMarginBalance>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSubAccountCrossMarginBalancesWithHttpInfo(subUid); + } + + /** + * Execute listSubAccountCrossMarginBalances request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSubAccountCrossMarginBalancesAsync(subUid, _callback); + } + } + + /** + * Query sub-account cross margin account balance information + * + * @return APIlistSubAccountCrossMarginBalancesRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistSubAccountCrossMarginBalancesRequest listSubAccountCrossMarginBalances() { + return new APIlistSubAccountCrossMarginBalancesRequest(); + } + + private okhttp3.Call listSavedAddressCall(String currency, String chain, String limit, Integer page, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/saved_address"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (chain != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("chain", chain)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + 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 listSavedAddressValidateBeforeCall(String currency, String chain, String limit, Integer page, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'currency' is set + if (currency == null) { + throw new ApiException("Missing the required parameter 'currency' when calling listSavedAddress(Async)"); + } + + okhttp3.Call localVarCall = listSavedAddressCall(currency, chain, limit, page, _callback); + return localVarCall; + } + + + private ApiResponse> listSavedAddressWithHttpInfo(String currency, String chain, String limit, Integer page) throws ApiException { + okhttp3.Call localVarCall = listSavedAddressValidateBeforeCall(currency, chain, limit, page, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listSavedAddressAsync(String currency, String chain, String limit, Integer page, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSavedAddressValidateBeforeCall(currency, chain, limit, page, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistSavedAddressRequest { + private final String currency; + private String chain; + private String limit; + private Integer page; + + private APIlistSavedAddressRequest(String currency) { + this.currency = currency; + } + + /** + * Set chain + * @param chain Chain name (optional, default to "") + * @return APIlistSavedAddressRequest + */ + public APIlistSavedAddressRequest chain(String chain) { + this.chain = chain; + return this; + } + + /** + * Set limit + * @param limit Maximum number returned, up to 100 (optional, default to "50") + * @return APIlistSavedAddressRequest + */ + public APIlistSavedAddressRequest limit(String limit) { + this.limit = limit; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistSavedAddressRequest + */ + public APIlistSavedAddressRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Build call for listSavedAddress + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listSavedAddressCall(currency, chain, limit, page, _callback); + } + + /** + * Execute listSavedAddress request + * @return List<SavedAddress> + * @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 List retrieved successfully -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listSavedAddressWithHttpInfo(currency, chain, limit, page); + return localVarResp.getData(); + } + + /** + * Execute listSavedAddress request with HTTP info returned + * @return ApiResponse<List<SavedAddress>> + * @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 List retrieved successfully -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSavedAddressWithHttpInfo(currency, chain, limit, page); + } + + /** + * Execute listSavedAddress request (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 List retrieved successfully -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSavedAddressAsync(currency, chain, limit, page, _callback); + } + } + + /** + * Query withdrawal address whitelist + * + * @param currency Currency (required) + * @return APIlistSavedAddressRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 List retrieved successfully -
+ */ + public APIlistSavedAddressRequest listSavedAddress(String currency) { + return new APIlistSavedAddressRequest(currency); + } + + private okhttp3.Call getTradeFeeCall(String currencyPair, String settle, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/fee"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currencyPair != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency_pair", currencyPair)); + } + + if (settle != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("settle", settle)); + } + + 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 getTradeFeeValidateBeforeCall(String currencyPair, String settle, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getTradeFeeCall(currencyPair, settle, _callback); + return localVarCall; + } + + + private ApiResponse getTradeFeeWithHttpInfo(String currencyPair, String settle) throws ApiException { + okhttp3.Call localVarCall = getTradeFeeValidateBeforeCall(currencyPair, settle, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getTradeFeeAsync(String currencyPair, String settle, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getTradeFeeValidateBeforeCall(currencyPair, settle, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetTradeFeeRequest { + private String currencyPair; + private String settle; + + private APIgetTradeFeeRequest() { + } + + /** + * Set currencyPair + * @param currencyPair 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 APIgetTradeFeeRequest + */ + public APIgetTradeFeeRequest currencyPair(String currencyPair) { + this.currencyPair = currencyPair; + return this; + } + + /** + * Set settle + * @param settle 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) + * @return APIgetTradeFeeRequest + */ + public APIgetTradeFeeRequest settle(String settle) { + this.settle = settle; + return this; + } + + /** + * Build call for getTradeFee + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTradeFeeCall(currencyPair, settle, _callback); + } + + /** + * Execute getTradeFee request + * @return TradeFee + * @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 Query successful -
+ */ + public TradeFee execute() throws ApiException { + ApiResponse localVarResp = getTradeFeeWithHttpInfo(currencyPair, settle); + return localVarResp.getData(); + } + + /** + * Execute getTradeFee request with HTTP info returned + * @return ApiResponse<TradeFee> + * @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 Query successful -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTradeFeeWithHttpInfo(currencyPair, settle); + } + + /** + * Execute getTradeFee request (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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTradeFeeAsync(currencyPair, settle, _callback); + } + } + + /** + * Query personal trading fees + * + * @return APIgetTradeFeeRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIgetTradeFeeRequest getTradeFee() { + return new APIgetTradeFeeRequest(); + } + + private okhttp3.Call getTotalBalanceCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/total_balance"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + 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 getTotalBalanceValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getTotalBalanceCall(currency, _callback); + return localVarCall; + } + + + private ApiResponse getTotalBalanceWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getTotalBalanceValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getTotalBalanceAsync(String currency, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getTotalBalanceValidateBeforeCall(currency, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetTotalBalanceRequest { + private String currency; + + private APIgetTotalBalanceRequest() { + } + + /** + * Set currency + * @param currency Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional, default to "USDT") + * @return APIgetTotalBalanceRequest + */ + public APIgetTotalBalanceRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Build call for getTotalBalance + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Request is valid and successfully returned -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTotalBalanceCall(currency, _callback); + } + + /** + * Execute getTotalBalance request + * @return TotalBalance + * @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 Request is valid and successfully returned -
+ */ + public TotalBalance execute() throws ApiException { + ApiResponse localVarResp = getTotalBalanceWithHttpInfo(currency); + return localVarResp.getData(); + } + + /** + * Execute getTotalBalance request with HTTP info returned + * @return ApiResponse<TotalBalance> + * @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 Request is valid and successfully returned -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTotalBalanceWithHttpInfo(currency); + } + + /** + * Execute getTotalBalance request (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 Request is valid and successfully returned -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTotalBalanceAsync(currency, _callback); + } + } + + /** + * 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 + * @return APIgetTotalBalanceRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Request is valid and successfully returned -
+ */ + public APIgetTotalBalanceRequest getTotalBalance() { + return new APIgetTotalBalanceRequest(); + } + + /** + * Build call for listSmallBalance + * @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 Success -
+ */ + public okhttp3.Call listSmallBalanceCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/small_balance"; + + 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 listSmallBalanceValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSmallBalanceCall(_callback); + return localVarCall; + } + + /** + * Get list of convertible small balance currencies + * + * @return List<SmallBalance> + * @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 Success -
+ */ + public List listSmallBalance() throws ApiException { + ApiResponse> localVarResp = listSmallBalanceWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get list of convertible small balance currencies + * + * @return ApiResponse<List<SmallBalance>> + * @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 Success -
+ */ + public ApiResponse> listSmallBalanceWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listSmallBalanceValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get list of convertible small balance currencies (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 Success -
+ */ + public okhttp3.Call listSmallBalanceAsync(final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSmallBalanceValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for convertSmallBalance + * @param convertSmallBalance (required) + * @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 Success -
+ */ + public okhttp3.Call convertSmallBalanceCall(ConvertSmallBalance convertSmallBalance, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = convertSmallBalance; + + // create path and map variables + String localVarPath = "/wallet/small_balance"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call convertSmallBalanceValidateBeforeCall(ConvertSmallBalance convertSmallBalance, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'convertSmallBalance' is set + if (convertSmallBalance == null) { + throw new ApiException("Missing the required parameter 'convertSmallBalance' when calling convertSmallBalance(Async)"); + } + + okhttp3.Call localVarCall = convertSmallBalanceCall(convertSmallBalance, _callback); + return localVarCall; + } + + /** + * Convert small balance currency + * + * @param convertSmallBalance (required) + * @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 Success -
+ */ + public void convertSmallBalance(ConvertSmallBalance convertSmallBalance) throws ApiException { + convertSmallBalanceWithHttpInfo(convertSmallBalance); + } + + /** + * Convert small balance currency + * + * @param convertSmallBalance (required) + * @return ApiResponse<Void> + * @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 Success -
+ */ + public ApiResponse convertSmallBalanceWithHttpInfo(ConvertSmallBalance convertSmallBalance) throws ApiException { + okhttp3.Call localVarCall = convertSmallBalanceValidateBeforeCall(convertSmallBalance, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Convert small balance currency (asynchronously) + * + * @param convertSmallBalance (required) + * @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 Success -
+ */ + public okhttp3.Call convertSmallBalanceAsync(ConvertSmallBalance convertSmallBalance, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = convertSmallBalanceValidateBeforeCall(convertSmallBalance, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + private okhttp3.Call listSmallBalanceHistoryCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/small_balance_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 listSmallBalanceHistoryValidateBeforeCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listSmallBalanceHistoryCall(currency, page, limit, _callback); + return localVarCall; + } + + + private ApiResponse> listSmallBalanceHistoryWithHttpInfo(String currency, Integer page, Integer limit) throws ApiException { + okhttp3.Call localVarCall = listSmallBalanceHistoryValidateBeforeCall(currency, page, limit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listSmallBalanceHistoryAsync(String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listSmallBalanceHistoryValidateBeforeCall(currency, page, limit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistSmallBalanceHistoryRequest { + private String currency; + private Integer page; + private Integer limit; + + private APIlistSmallBalanceHistoryRequest() { + } + + /** + * Set currency + * @param currency Currency to convert (optional) + * @return APIlistSmallBalanceHistoryRequest + */ + public APIlistSmallBalanceHistoryRequest currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Set page + * @param page Page number (optional, default to 1) + * @return APIlistSmallBalanceHistoryRequest + */ + public APIlistSmallBalanceHistoryRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) + * @return APIlistSmallBalanceHistoryRequest + */ + public APIlistSmallBalanceHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Build call for listSmallBalanceHistory + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listSmallBalanceHistoryCall(currency, page, limit, _callback); + } + + /** + * Execute listSmallBalanceHistory request + * @return List<SmallBalanceHistory> + * @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 Success -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listSmallBalanceHistoryWithHttpInfo(currency, page, limit); + return localVarResp.getData(); + } + + /** + * Execute listSmallBalanceHistory request with HTTP info returned + * @return ApiResponse<List<SmallBalanceHistory>> + * @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 Success -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listSmallBalanceHistoryWithHttpInfo(currency, page, limit); + } + + /** + * Execute listSmallBalanceHistory request (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 Success -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listSmallBalanceHistoryAsync(currency, page, limit, _callback); + } + } + + /** + * Get convertible small balance currency history + * + * @return APIlistSmallBalanceHistoryRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public APIlistSmallBalanceHistoryRequest listSmallBalanceHistory() { + return new APIlistSmallBalanceHistoryRequest(); + } + + private okhttp3.Call listPushOrdersCall(Integer id, Integer from, Integer to, Integer limit, Integer offset, String transactionType, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/wallet/push"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (id != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("id", id)); + } + + if (from != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + } + + if (to != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (transactionType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("transaction_type", transactionType)); + } + + 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 listPushOrdersValidateBeforeCall(Integer id, Integer from, Integer to, Integer limit, Integer offset, String transactionType, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listPushOrdersCall(id, from, to, limit, offset, transactionType, _callback); + return localVarCall; + } + + + private ApiResponse> listPushOrdersWithHttpInfo(Integer id, Integer from, Integer to, Integer limit, Integer offset, String transactionType) throws ApiException { + okhttp3.Call localVarCall = listPushOrdersValidateBeforeCall(id, from, to, limit, offset, transactionType, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listPushOrdersAsync(Integer id, Integer from, Integer to, Integer limit, Integer offset, String transactionType, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listPushOrdersValidateBeforeCall(id, from, to, limit, offset, transactionType, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistPushOrdersRequest { + private Integer id; + private Integer from; + private Integer to; + private Integer limit; + private Integer offset; + private String transactionType; + + private APIlistPushOrdersRequest() { + } + + /** + * Set id + * @param id Order ID (optional) + * @return APIlistPushOrdersRequest + */ + public APIlistPushOrdersRequest id(Integer id) { + this.id = id; + return this; + } + + /** + * Set from + * @param from Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional) + * @return APIlistPushOrdersRequest + */ + public APIlistPushOrdersRequest from(Integer from) { + this.from = from; + return this; + } + + /** + * Set to + * @param to End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional) + * @return APIlistPushOrdersRequest + */ + public APIlistPushOrdersRequest to(Integer to) { + this.to = to; + return this; + } + + /** + * Set limit + * @param limit Maximum number of items returned in the list, default value is 100 (optional, default to 100) + * @return APIlistPushOrdersRequest + */ + public APIlistPushOrdersRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistPushOrdersRequest + */ + public APIlistPushOrdersRequest offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set transactionType + * @param transactionType Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional, default to "withdraw") + * @return APIlistPushOrdersRequest + */ + public APIlistPushOrdersRequest transactionType(String transactionType) { + this.transactionType = transactionType; + return this; + } + + /** + * Build call for listPushOrders + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listPushOrdersCall(id, from, to, limit, offset, transactionType, _callback); + } + + /** + * Execute listPushOrders request + * @return List<UidPushOrder> + * @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 Success -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = listPushOrdersWithHttpInfo(id, from, to, limit, offset, transactionType); + return localVarResp.getData(); + } + + /** + * Execute listPushOrders request with HTTP info returned + * @return ApiResponse<List<UidPushOrder>> + * @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 Success -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listPushOrdersWithHttpInfo(id, from, to, limit, offset, transactionType); + } + + /** + * Execute listPushOrders request (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 Success -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listPushOrdersAsync(id, from, to, limit, offset, transactionType, _callback); + } + } + + /** + * Get UID transfer history + * + * @return APIlistPushOrdersRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public APIlistPushOrdersRequest listPushOrders() { + return new APIlistPushOrdersRequest(); } } diff --git a/src/main/java/io/gate/gateapi/api/WithdrawalApi.java b/src/main/java/io/gate/gateapi/api/WithdrawalApi.java index 0d80e9b..0d87ac1 100644 --- a/src/main/java/io/gate/gateapi/api/WithdrawalApi.java +++ b/src/main/java/io/gate/gateapi/api/WithdrawalApi.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 @@ -21,6 +21,8 @@ import io.gate.gateapi.models.LedgerRecord; +import io.gate.gateapi.models.UidPushWithdrawal; +import io.gate.gateapi.models.UidPushWithdrawalResp; import java.lang.reflect.Type; import java.util.ArrayList; @@ -56,7 +58,7 @@ public void setApiClient(ApiClient apiClient) { * @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 -
*/ public okhttp3.Call withdrawCall(LedgerRecord ledgerRecord, final ApiCallback _callback) throws ApiException { @@ -101,14 +103,14 @@ private okhttp3.Call withdrawValidateBeforeCall(LedgerRecord ledgerRecord, final /** * Withdraw - * + * If the recipient's on-chain address is also Gate, no transaction fee will be charged * @param ledgerRecord (required) * @return LedgerRecord * @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
202 Withdraw request is accepted. Refer to withdrawal records for status -
200 Withdrawal request accepted. Check withdrawal record status for processing result -
*/ public LedgerRecord withdraw(LedgerRecord ledgerRecord) throws ApiException { @@ -118,14 +120,14 @@ public LedgerRecord withdraw(LedgerRecord ledgerRecord) throws ApiException { /** * Withdraw - * + * If the recipient's on-chain address is also Gate, no transaction fee will be charged * @param ledgerRecord (required) * @return ApiResponse<LedgerRecord> * @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
202 Withdraw request is accepted. Refer to withdrawal records for status -
200 Withdrawal request accepted. Check withdrawal record status for processing result -
*/ public ApiResponse withdrawWithHttpInfo(LedgerRecord ledgerRecord) throws ApiException { @@ -136,7 +138,7 @@ public ApiResponse withdrawWithHttpInfo(LedgerRecord ledgerRecord) /** * Withdraw (asynchronously) - * + * If the recipient's on-chain address is also Gate, no transaction fee will be charged * @param ledgerRecord (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -144,7 +146,7 @@ public ApiResponse withdrawWithHttpInfo(LedgerRecord ledgerRecord) * @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 -
*/ public okhttp3.Call withdrawAsync(LedgerRecord ledgerRecord, final ApiCallback _callback) throws ApiException { @@ -154,6 +156,113 @@ public okhttp3.Call withdrawAsync(LedgerRecord ledgerRecord, final ApiCallback + Status Code Description Response Headers + 200 Request accepted. Check withdrawal record status for processing result - + + */ + public okhttp3.Call withdrawPushOrderCall(UidPushWithdrawal uidPushWithdrawal, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = uidPushWithdrawal; + + // create path and map variables + String localVarPath = "/withdrawals/push"; + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call withdrawPushOrderValidateBeforeCall(UidPushWithdrawal uidPushWithdrawal, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uidPushWithdrawal' is set + if (uidPushWithdrawal == null) { + throw new ApiException("Missing the required parameter 'uidPushWithdrawal' when calling withdrawPushOrder(Async)"); + } + + okhttp3.Call localVarCall = withdrawPushOrderCall(uidPushWithdrawal, _callback); + return localVarCall; + } + + /** + * UID transfer + * Transfers between main spot accounts. Both parties cannot be sub-accounts + * @param uidPushWithdrawal (required) + * @return UidPushWithdrawalResp + * @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 Request accepted. Check withdrawal record status for processing result -
+ */ + public UidPushWithdrawalResp withdrawPushOrder(UidPushWithdrawal uidPushWithdrawal) throws ApiException { + ApiResponse localVarResp = withdrawPushOrderWithHttpInfo(uidPushWithdrawal); + return localVarResp.getData(); + } + + /** + * UID transfer + * Transfers between main spot accounts. Both parties cannot be sub-accounts + * @param uidPushWithdrawal (required) + * @return ApiResponse<UidPushWithdrawalResp> + * @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 Request accepted. Check withdrawal record status for processing result -
+ */ + public ApiResponse withdrawPushOrderWithHttpInfo(UidPushWithdrawal uidPushWithdrawal) throws ApiException { + okhttp3.Call localVarCall = withdrawPushOrderValidateBeforeCall(uidPushWithdrawal, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * UID transfer (asynchronously) + * Transfers between main spot accounts. Both parties cannot be sub-accounts + * @param uidPushWithdrawal (required) + * @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 Request accepted. Check withdrawal record status for processing result -
+ */ + public okhttp3.Call withdrawPushOrderAsync(UidPushWithdrawal uidPushWithdrawal, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = withdrawPushOrderValidateBeforeCall(uidPushWithdrawal, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for cancelWithdrawal * @param withdrawalId (required) @@ -163,7 +272,7 @@ public okhttp3.Call withdrawAsync(LedgerRecord ledgerRecord, final ApiCallback 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 - */ public okhttp3.Call cancelWithdrawalCall(String withdrawalId, final ApiCallback _callback) throws ApiException { @@ -216,7 +325,7 @@ private okhttp3.Call cancelWithdrawalValidateBeforeCall(String withdrawalId, fin * @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 -
*/ public LedgerRecord cancelWithdrawal(String withdrawalId) throws ApiException { @@ -233,7 +342,7 @@ public LedgerRecord cancelWithdrawal(String withdrawalId) throws ApiException { * @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 -
*/ public ApiResponse cancelWithdrawalWithHttpInfo(String withdrawalId) throws ApiException { @@ -252,7 +361,7 @@ public ApiResponse cancelWithdrawalWithHttpInfo(String withdrawalI * @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 -
*/ public okhttp3.Call cancelWithdrawalAsync(String withdrawalId, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/io/gate/gateapi/auth/ApiKeyAuth.java b/src/main/java/io/gate/gateapi/auth/ApiKeyAuth.java index 2932a33..e60924a 100644 --- a/src/main/java/io/gate/gateapi/auth/ApiKeyAuth.java +++ b/src/main/java/io/gate/gateapi/auth/ApiKeyAuth.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/auth/Authentication.java b/src/main/java/io/gate/gateapi/auth/Authentication.java index f68efc6..6191f46 100644 --- a/src/main/java/io/gate/gateapi/auth/Authentication.java +++ b/src/main/java/io/gate/gateapi/auth/Authentication.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/auth/GateApiV4Auth.java b/src/main/java/io/gate/gateapi/auth/GateApiV4Auth.java index cd4f3cd..3eca118 100644 --- a/src/main/java/io/gate/gateapi/auth/GateApiV4Auth.java +++ b/src/main/java/io/gate/gateapi/auth/GateApiV4Auth.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/auth/HttpBasicAuth.java b/src/main/java/io/gate/gateapi/auth/HttpBasicAuth.java index 298cc17..6ea4fd8 100644 --- a/src/main/java/io/gate/gateapi/auth/HttpBasicAuth.java +++ b/src/main/java/io/gate/gateapi/auth/HttpBasicAuth.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/auth/HttpBearerAuth.java b/src/main/java/io/gate/gateapi/auth/HttpBearerAuth.java index f76b4c4..738e743 100644 --- a/src/main/java/io/gate/gateapi/auth/HttpBearerAuth.java +++ b/src/main/java/io/gate/gateapi/auth/HttpBearerAuth.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/models/AccountBalance.java b/src/main/java/io/gate/gateapi/models/AccountBalance.java index b4e2601..ce94690 100644 --- a/src/main/java/io/gate/gateapi/models/AccountBalance.java +++ b/src/main/java/io/gate/gateapi/models/AccountBalance.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 @@ -82,6 +82,14 @@ public CurrencyEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CURRENCY) private CurrencyEnum currency; + public static final String SERIALIZED_NAME_UNREALISED_PNL = "unrealised_pnl"; + @SerializedName(SERIALIZED_NAME_UNREALISED_PNL) + private String unrealisedPnl; + + public static final String SERIALIZED_NAME_BORROWED = "borrowed"; + @SerializedName(SERIALIZED_NAME_BORROWED) + private String borrowed; + public AccountBalance amount(String amount) { @@ -122,6 +130,46 @@ public CurrencyEnum getCurrency() { public void setCurrency(CurrencyEnum currency) { this.currency = currency; } + + public AccountBalance unrealisedPnl(String unrealisedPnl) { + + this.unrealisedPnl = unrealisedPnl; + return this; + } + + /** + * Unrealised_pnl, this field will only appear in futures, options, delivery, and total accounts + * @return unrealisedPnl + **/ + @javax.annotation.Nullable + public String getUnrealisedPnl() { + return unrealisedPnl; + } + + + public void setUnrealisedPnl(String unrealisedPnl) { + this.unrealisedPnl = unrealisedPnl; + } + + public AccountBalance borrowed(String borrowed) { + + this.borrowed = borrowed; + return this; + } + + /** + * Total borrowed amount, this field will only appear in margin and cross_margin accounts + * @return borrowed + **/ + @javax.annotation.Nullable + public String getBorrowed() { + return borrowed; + } + + + public void setBorrowed(String borrowed) { + this.borrowed = borrowed; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -132,12 +180,14 @@ public boolean equals(java.lang.Object o) { } AccountBalance accountBalance = (AccountBalance) o; return Objects.equals(this.amount, accountBalance.amount) && - Objects.equals(this.currency, accountBalance.currency); + Objects.equals(this.currency, accountBalance.currency) && + Objects.equals(this.unrealisedPnl, accountBalance.unrealisedPnl) && + Objects.equals(this.borrowed, accountBalance.borrowed); } @Override public int hashCode() { - return Objects.hash(amount, currency); + return Objects.hash(amount, currency, unrealisedPnl, borrowed); } @@ -147,6 +197,8 @@ public String toString() { sb.append("class AccountBalance {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" unrealisedPnl: ").append(toIndentedString(unrealisedPnl)).append("\n"); + sb.append(" borrowed: ").append(toIndentedString(borrowed)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/AccountDetail.java b/src/main/java/io/gate/gateapi/models/AccountDetail.java new file mode 100644 index 0000000..a54edce --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/AccountDetail.java @@ -0,0 +1,238 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.AccountDetailKey; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Account details + */ +public class AccountDetail { + public static final String SERIALIZED_NAME_IP_WHITELIST = "ip_whitelist"; + @SerializedName(SERIALIZED_NAME_IP_WHITELIST) + private List ipWhitelist = null; + + public static final String SERIALIZED_NAME_CURRENCY_PAIRS = "currency_pairs"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIRS) + private List currencyPairs = null; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + private Long tier; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private AccountDetailKey key; + + public static final String SERIALIZED_NAME_COPY_TRADING_ROLE = "copy_trading_role"; + @SerializedName(SERIALIZED_NAME_COPY_TRADING_ROLE) + private Integer copyTradingRole; + + + public AccountDetail ipWhitelist(List ipWhitelist) { + + this.ipWhitelist = ipWhitelist; + return this; + } + + public AccountDetail addIpWhitelistItem(String ipWhitelistItem) { + if (this.ipWhitelist == null) { + this.ipWhitelist = new ArrayList<>(); + } + this.ipWhitelist.add(ipWhitelistItem); + return this; + } + + /** + * IP Whitelist + * @return ipWhitelist + **/ + @javax.annotation.Nullable + public List getIpWhitelist() { + return ipWhitelist; + } + + + public void setIpWhitelist(List ipWhitelist) { + this.ipWhitelist = ipWhitelist; + } + + public AccountDetail currencyPairs(List currencyPairs) { + + this.currencyPairs = currencyPairs; + return this; + } + + public AccountDetail addCurrencyPairsItem(String currencyPairsItem) { + if (this.currencyPairs == null) { + this.currencyPairs = new ArrayList<>(); + } + this.currencyPairs.add(currencyPairsItem); + return this; + } + + /** + * Trading pair whitelist + * @return currencyPairs + **/ + @javax.annotation.Nullable + public List getCurrencyPairs() { + return currencyPairs; + } + + + public void setCurrencyPairs(List currencyPairs) { + this.currencyPairs = currencyPairs; + } + + public AccountDetail userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public AccountDetail tier(Long tier) { + + this.tier = tier; + return this; + } + + /** + * User VIP level + * @return tier + **/ + @javax.annotation.Nullable + public Long getTier() { + return tier; + } + + + public void setTier(Long tier) { + this.tier = tier; + } + + public AccountDetail key(AccountDetailKey key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + public AccountDetailKey getKey() { + return key; + } + + + public void setKey(AccountDetailKey key) { + this.key = key; + } + + public AccountDetail copyTradingRole(Integer copyTradingRole) { + + this.copyTradingRole = copyTradingRole; + return this; + } + + /** + * User role: 0 - Normal user, 1 - Copy trading leader, 2 - Follower, 3 - Both leader and follower + * @return copyTradingRole + **/ + @javax.annotation.Nullable + public Integer getCopyTradingRole() { + return copyTradingRole; + } + + + public void setCopyTradingRole(Integer copyTradingRole) { + this.copyTradingRole = copyTradingRole; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountDetail accountDetail = (AccountDetail) o; + return Objects.equals(this.ipWhitelist, accountDetail.ipWhitelist) && + Objects.equals(this.currencyPairs, accountDetail.currencyPairs) && + Objects.equals(this.userId, accountDetail.userId) && + Objects.equals(this.tier, accountDetail.tier) && + Objects.equals(this.key, accountDetail.key) && + Objects.equals(this.copyTradingRole, accountDetail.copyTradingRole); + } + + @Override + public int hashCode() { + return Objects.hash(ipWhitelist, currencyPairs, userId, tier, key, copyTradingRole); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountDetail {\n"); + sb.append(" ipWhitelist: ").append(toIndentedString(ipWhitelist)).append("\n"); + sb.append(" currencyPairs: ").append(toIndentedString(currencyPairs)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" copyTradingRole: ").append(toIndentedString(copyTradingRole)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/AccountDetailKey.java b/src/main/java/io/gate/gateapi/models/AccountDetailKey.java new file mode 100644 index 0000000..6a329b8 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/AccountDetailKey.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * API Key details + */ +public class AccountDetailKey { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private Integer mode; + + + public AccountDetailKey mode(Integer mode) { + + this.mode = mode; + return this; + } + + /** + * Mode: 1 - Classic mode, 2 - Legacy unified mode + * @return mode + **/ + @javax.annotation.Nullable + public Integer getMode() { + return mode; + } + + + public void setMode(Integer mode) { + this.mode = mode; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountDetailKey accountDetailKey = (AccountDetailKey) o; + return Objects.equals(this.mode, accountDetailKey.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountDetailKey {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/AccountRateLimit.java b/src/main/java/io/gate/gateapi/models/AccountRateLimit.java new file mode 100644 index 0000000..bdf68e8 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/AccountRateLimit.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * AccountRateLimit + */ +public class AccountRateLimit { + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + private String tier; + + public static final String SERIALIZED_NAME_RATIO = "ratio"; + @SerializedName(SERIALIZED_NAME_RATIO) + private String ratio; + + public static final String SERIALIZED_NAME_MAIN_RATIO = "main_ratio"; + @SerializedName(SERIALIZED_NAME_MAIN_RATIO) + private String mainRatio; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + + public AccountRateLimit tier(String tier) { + + this.tier = tier; + return this; + } + + /** + * Frequency limit level (For detailed frequency limit rules, see [Transaction ratio frequency limit](#rate-limit-based-on-fill-ratio)) + * @return tier + **/ + @javax.annotation.Nullable + public String getTier() { + return tier; + } + + + public void setTier(String tier) { + this.tier = tier; + } + + public AccountRateLimit ratio(String ratio) { + + this.ratio = ratio; + return this; + } + + /** + * Fill rate + * @return ratio + **/ + @javax.annotation.Nullable + public String getRatio() { + return ratio; + } + + + public void setRatio(String ratio) { + this.ratio = ratio; + } + + public AccountRateLimit mainRatio(String mainRatio) { + + this.mainRatio = mainRatio; + return this; + } + + /** + * Total fill ratio of main account + * @return mainRatio + **/ + @javax.annotation.Nullable + public String getMainRatio() { + return mainRatio; + } + + + public void setMainRatio(String mainRatio) { + this.mainRatio = mainRatio; + } + + public AccountRateLimit updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Update time + * @return updatedAt + **/ + @javax.annotation.Nullable + public String getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountRateLimit accountRateLimit = (AccountRateLimit) o; + return Objects.equals(this.tier, accountRateLimit.tier) && + Objects.equals(this.ratio, accountRateLimit.ratio) && + Objects.equals(this.mainRatio, accountRateLimit.mainRatio) && + Objects.equals(this.updatedAt, accountRateLimit.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(tier, ratio, mainRatio, updatedAt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountRateLimit {\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" ratio: ").append(toIndentedString(ratio)).append("\n"); + sb.append(" mainRatio: ").append(toIndentedString(mainRatio)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/AgencyCommission.java b/src/main/java/io/gate/gateapi/models/AgencyCommission.java new file mode 100644 index 0000000..787fe67 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/AgencyCommission.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * AgencyCommission + */ +public class AgencyCommission { + public static final String SERIALIZED_NAME_COMMISSION_TIME = "commission_time"; + @SerializedName(SERIALIZED_NAME_COMMISSION_TIME) + private Long commissionTime; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_GROUP_NAME = "group_name"; + @SerializedName(SERIALIZED_NAME_GROUP_NAME) + private String groupName; + + public static final String SERIALIZED_NAME_COMMISSION_AMOUNT = "commission_amount"; + @SerializedName(SERIALIZED_NAME_COMMISSION_AMOUNT) + private String commissionAmount; + + public static final String SERIALIZED_NAME_COMMISSION_ASSET = "commission_asset"; + @SerializedName(SERIALIZED_NAME_COMMISSION_ASSET) + private String commissionAsset; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + + public AgencyCommission commissionTime(Long commissionTime) { + + this.commissionTime = commissionTime; + return this; + } + + /** + * Commission time (Unix timestamp in seconds) + * @return commissionTime + **/ + @javax.annotation.Nullable + public Long getCommissionTime() { + return commissionTime; + } + + + public void setCommissionTime(Long commissionTime) { + this.commissionTime = commissionTime; + } + + public AgencyCommission userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public AgencyCommission groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * Group name + * @return groupName + **/ + @javax.annotation.Nullable + public String getGroupName() { + return groupName; + } + + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public AgencyCommission commissionAmount(String commissionAmount) { + + this.commissionAmount = commissionAmount; + return this; + } + + /** + * Transaction amount + * @return commissionAmount + **/ + @javax.annotation.Nullable + public String getCommissionAmount() { + return commissionAmount; + } + + + public void setCommissionAmount(String commissionAmount) { + this.commissionAmount = commissionAmount; + } + + public AgencyCommission commissionAsset(String commissionAsset) { + + this.commissionAsset = commissionAsset; + return this; + } + + /** + * Commission Asset + * @return commissionAsset + **/ + @javax.annotation.Nullable + public String getCommissionAsset() { + return commissionAsset; + } + + + public void setCommissionAsset(String commissionAsset) { + this.commissionAsset = commissionAsset; + } + + public AgencyCommission source(String source) { + + this.source = source; + return this; + } + + /** + * Commission source: SPOT - Spot commission, FUTURES - Futures commission + * @return source + **/ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + + public void setSource(String source) { + this.source = source; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgencyCommission agencyCommission = (AgencyCommission) o; + return Objects.equals(this.commissionTime, agencyCommission.commissionTime) && + Objects.equals(this.userId, agencyCommission.userId) && + Objects.equals(this.groupName, agencyCommission.groupName) && + Objects.equals(this.commissionAmount, agencyCommission.commissionAmount) && + Objects.equals(this.commissionAsset, agencyCommission.commissionAsset) && + Objects.equals(this.source, agencyCommission.source); + } + + @Override + public int hashCode() { + return Objects.hash(commissionTime, userId, groupName, commissionAmount, commissionAsset, source); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgencyCommission {\n"); + sb.append(" commissionTime: ").append(toIndentedString(commissionTime)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" commissionAmount: ").append(toIndentedString(commissionAmount)).append("\n"); + sb.append(" commissionAsset: ").append(toIndentedString(commissionAsset)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/AgencyCommissionHistory.java b/src/main/java/io/gate/gateapi/models/AgencyCommissionHistory.java new file mode 100644 index 0000000..957a770 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/AgencyCommissionHistory.java @@ -0,0 +1,152 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.AgencyCommission; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * AgencyCommissionHistory + */ +public class AgencyCommissionHistory { + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public AgencyCommissionHistory currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public AgencyCommissionHistory total(Long total) { + + this.total = total; + return this; + } + + /** + * Total + * @return total + **/ + @javax.annotation.Nullable + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + public AgencyCommissionHistory list(List list) { + + this.list = list; + return this; + } + + public AgencyCommissionHistory addListItem(AgencyCommission listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * List of commission history + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgencyCommissionHistory agencyCommissionHistory = (AgencyCommissionHistory) o; + return Objects.equals(this.currencyPair, agencyCommissionHistory.currencyPair) && + Objects.equals(this.total, agencyCommissionHistory.total) && + Objects.equals(this.list, agencyCommissionHistory.list); + } + + @Override + public int hashCode() { + return Objects.hash(currencyPair, total, list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgencyCommissionHistory {\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/AgencyTransaction.java b/src/main/java/io/gate/gateapi/models/AgencyTransaction.java new file mode 100644 index 0000000..56eb68c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/AgencyTransaction.java @@ -0,0 +1,297 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * AgencyTransaction + */ +public class AgencyTransaction { + public static final String SERIALIZED_NAME_TRANSACTION_TIME = "transaction_time"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_TIME) + private Long transactionTime; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_GROUP_NAME = "group_name"; + @SerializedName(SERIALIZED_NAME_GROUP_NAME) + private String groupName; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_FEE_ASSET = "fee_asset"; + @SerializedName(SERIALIZED_NAME_FEE_ASSET) + private String feeAsset; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_AMOUNT_ASSET = "amount_asset"; + @SerializedName(SERIALIZED_NAME_AMOUNT_ASSET) + private String amountAsset; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + + public AgencyTransaction transactionTime(Long transactionTime) { + + this.transactionTime = transactionTime; + return this; + } + + /** + * Transaction Time. (unix timestamp) + * @return transactionTime + **/ + @javax.annotation.Nullable + public Long getTransactionTime() { + return transactionTime; + } + + + public void setTransactionTime(Long transactionTime) { + this.transactionTime = transactionTime; + } + + public AgencyTransaction userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public AgencyTransaction groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * Group name + * @return groupName + **/ + @javax.annotation.Nullable + public String getGroupName() { + return groupName; + } + + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public AgencyTransaction fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * Fee + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public AgencyTransaction feeAsset(String feeAsset) { + + this.feeAsset = feeAsset; + return this; + } + + /** + * Fee currency + * @return feeAsset + **/ + @javax.annotation.Nullable + public String getFeeAsset() { + return feeAsset; + } + + + public void setFeeAsset(String feeAsset) { + this.feeAsset = feeAsset; + } + + public AgencyTransaction currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public AgencyTransaction amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Transaction amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public AgencyTransaction amountAsset(String amountAsset) { + + this.amountAsset = amountAsset; + return this; + } + + /** + * Commission Asset + * @return amountAsset + **/ + @javax.annotation.Nullable + public String getAmountAsset() { + return amountAsset; + } + + + public void setAmountAsset(String amountAsset) { + this.amountAsset = amountAsset; + } + + public AgencyTransaction source(String source) { + + this.source = source; + return this; + } + + /** + * Commission source: SPOT - Spot commission, FUTURES - Futures commission + * @return source + **/ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + + public void setSource(String source) { + this.source = source; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgencyTransaction agencyTransaction = (AgencyTransaction) o; + return Objects.equals(this.transactionTime, agencyTransaction.transactionTime) && + Objects.equals(this.userId, agencyTransaction.userId) && + Objects.equals(this.groupName, agencyTransaction.groupName) && + Objects.equals(this.fee, agencyTransaction.fee) && + Objects.equals(this.feeAsset, agencyTransaction.feeAsset) && + Objects.equals(this.currencyPair, agencyTransaction.currencyPair) && + Objects.equals(this.amount, agencyTransaction.amount) && + Objects.equals(this.amountAsset, agencyTransaction.amountAsset) && + Objects.equals(this.source, agencyTransaction.source); + } + + @Override + public int hashCode() { + return Objects.hash(transactionTime, userId, groupName, fee, feeAsset, currencyPair, amount, amountAsset, source); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgencyTransaction {\n"); + sb.append(" transactionTime: ").append(toIndentedString(transactionTime)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" feeAsset: ").append(toIndentedString(feeAsset)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" amountAsset: ").append(toIndentedString(amountAsset)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/AgencyTransactionHistory.java b/src/main/java/io/gate/gateapi/models/AgencyTransactionHistory.java new file mode 100644 index 0000000..6dce95a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/AgencyTransactionHistory.java @@ -0,0 +1,152 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.AgencyTransaction; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * AgencyTransactionHistory + */ +public class AgencyTransactionHistory { + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public AgencyTransactionHistory currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public AgencyTransactionHistory total(Long total) { + + this.total = total; + return this; + } + + /** + * Total + * @return total + **/ + @javax.annotation.Nullable + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + public AgencyTransactionHistory list(List list) { + + this.list = list; + return this; + } + + public AgencyTransactionHistory addListItem(AgencyTransaction listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * List of transaction history + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgencyTransactionHistory agencyTransactionHistory = (AgencyTransactionHistory) o; + return Objects.equals(this.currencyPair, agencyTransactionHistory.currencyPair) && + Objects.equals(this.total, agencyTransactionHistory.total) && + Objects.equals(this.list, agencyTransactionHistory.list); + } + + @Override + public int hashCode() { + return Objects.hash(currencyPair, total, list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgencyTransactionHistory {\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/AutoRepaySetting.java b/src/main/java/io/gate/gateapi/models/AutoRepaySetting.java index 815609e..9250647 100644 --- a/src/main/java/io/gate/gateapi/models/AutoRepaySetting.java +++ b/src/main/java/io/gate/gateapi/models/AutoRepaySetting.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 @@ -24,7 +24,7 @@ */ public class AutoRepaySetting { /** - * Auto repayment status. `on` - enabled, `off` - disabled + * Auto repayment status: `on` - enabled, `off` - disabled */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { @@ -82,7 +82,7 @@ public AutoRepaySetting status(StatusEnum status) { } /** - * Auto repayment status. `on` - enabled, `off` - disabled + * Auto repayment status: `on` - enabled, `off` - disabled * @return status **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/BatchAmendItem.java b/src/main/java/io/gate/gateapi/models/BatchAmendItem.java new file mode 100644 index 0000000..258e946 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BatchAmendItem.java @@ -0,0 +1,243 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Order information that needs to be modified + */ +public class BatchAmendItem { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private String orderId; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_ACCOUNT = "account"; + @SerializedName(SERIALIZED_NAME_ACCOUNT) + private String account; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + public static final String SERIALIZED_NAME_ACTION_MODE = "action_mode"; + @SerializedName(SERIALIZED_NAME_ACTION_MODE) + private String actionMode; + + + public BatchAmendItem orderId(String orderId) { + + this.orderId = orderId; + return this; + } + + /** + * The order ID returned upon successful creation or the custom ID specified by the user during creation (i.e., the 'text' field) + * @return orderId + **/ + public String getOrderId() { + return orderId; + } + + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public BatchAmendItem currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public BatchAmendItem account(String account) { + + this.account = account; + return this; + } + + /** + * Default spot, unified account and warehouse-by-store leverage account + * @return account + **/ + @javax.annotation.Nullable + public String getAccount() { + return account; + } + + + public void setAccount(String account) { + this.account = account; + } + + public BatchAmendItem amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Trading Quantity. Only one of `amount` or `price` can be specified + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public BatchAmendItem price(String price) { + + this.price = price; + return this; + } + + /** + * Trading Price. Only one of `amount` or `price` can be specified + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public BatchAmendItem amendText(String amendText) { + + this.amendText = amendText; + return this; + } + + /** + * Custom info during order amendment + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public void setAmendText(String amendText) { + this.amendText = amendText; + } + + public BatchAmendItem actionMode(String actionMode) { + + this.actionMode = actionMode; + return this; + } + + /** + * 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) + * @return actionMode + **/ + @javax.annotation.Nullable + public String getActionMode() { + return actionMode; + } + + + public void setActionMode(String actionMode) { + this.actionMode = actionMode; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchAmendItem batchAmendItem = (BatchAmendItem) o; + return Objects.equals(this.orderId, batchAmendItem.orderId) && + Objects.equals(this.currencyPair, batchAmendItem.currencyPair) && + Objects.equals(this.account, batchAmendItem.account) && + Objects.equals(this.amount, batchAmendItem.amount) && + Objects.equals(this.price, batchAmendItem.price) && + Objects.equals(this.amendText, batchAmendItem.amendText) && + Objects.equals(this.actionMode, batchAmendItem.actionMode); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, currencyPair, account, amount, price, amendText, actionMode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchAmendItem {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append(" actionMode: ").append(toIndentedString(actionMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BatchAmendOrderReq.java b/src/main/java/io/gate/gateapi/models/BatchAmendOrderReq.java new file mode 100644 index 0000000..2a29ac1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BatchAmendOrderReq.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Modify contract order parameters + */ +public class BatchAmendOrderReq { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + + public BatchAmendOrderReq orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order id, order_id and text must contain at least one + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public BatchAmendOrderReq text(String text) { + + this.text = text; + return this; + } + + /** + * User-defined order text, at least one of order_id and text must be passed + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + public BatchAmendOrderReq size(Long size) { + + this.size = size; + return this; + } + + /** + * 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. + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public BatchAmendOrderReq price(String price) { + + this.price = price; + return this; + } + + /** + * New order price + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public BatchAmendOrderReq amendText(String amendText) { + + this.amendText = amendText; + return this; + } + + /** + * Custom info during order amendment + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public void setAmendText(String amendText) { + this.amendText = amendText; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchAmendOrderReq batchAmendOrderReq = (BatchAmendOrderReq) o; + return Objects.equals(this.orderId, batchAmendOrderReq.orderId) && + Objects.equals(this.text, batchAmendOrderReq.text) && + Objects.equals(this.size, batchAmendOrderReq.size) && + Objects.equals(this.price, batchAmendOrderReq.price) && + Objects.equals(this.amendText, batchAmendOrderReq.amendText); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, text, size, price, amendText); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchAmendOrderReq {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BatchFuturesOrder.java b/src/main/java/io/gate/gateapi/models/BatchFuturesOrder.java new file mode 100644 index 0000000..15649ba --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BatchFuturesOrder.java @@ -0,0 +1,898 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Futures order details + */ +public class BatchFuturesOrder { + public static final String SERIALIZED_NAME_SUCCEEDED = "succeeded"; + @SerializedName(SERIALIZED_NAME_SUCCEEDED) + private Boolean succeeded; + + public static final String SERIALIZED_NAME_LABEL = "label"; + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; + + public static final String SERIALIZED_NAME_DETAIL = "detail"; + @SerializedName(SERIALIZED_NAME_DETAIL) + private String detail; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private Integer user; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Double createTime; + + public static final String SERIALIZED_NAME_FINISH_TIME = "finish_time"; + @SerializedName(SERIALIZED_NAME_FINISH_TIME) + private Double finishTime; + + /** + * 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 + */ + @JsonAdapter(FinishAsEnum.Adapter.class) + public enum FinishAsEnum { + 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"); + + private String value; + + FinishAsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FinishAsEnum fromValue(String value) { + for (FinishAsEnum b : FinishAsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FinishAsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FinishAsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FinishAsEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_FINISH_AS = "finish_as"; + @SerializedName(SERIALIZED_NAME_FINISH_AS) + private FinishAsEnum finishAs; + + /** + * Order status - `open`: Pending - `finished`: Completed + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("open"), + + FINISHED("finished"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_ICEBERG = "iceberg"; + @SerializedName(SERIALIZED_NAME_ICEBERG) + private Long iceberg; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_CLOSE = "close"; + @SerializedName(SERIALIZED_NAME_CLOSE) + private Boolean close = false; + + public static final String SERIALIZED_NAME_IS_CLOSE = "is_close"; + @SerializedName(SERIALIZED_NAME_IS_CLOSE) + private Boolean isClose; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduce_only"; + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + private Boolean reduceOnly = false; + + public static final String SERIALIZED_NAME_IS_REDUCE_ONLY = "is_reduce_only"; + @SerializedName(SERIALIZED_NAME_IS_REDUCE_ONLY) + private Boolean isReduceOnly; + + public static final String SERIALIZED_NAME_IS_LIQ = "is_liq"; + @SerializedName(SERIALIZED_NAME_IS_LIQ) + private Boolean isLiq; + + /** + * 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 + */ + @JsonAdapter(TifEnum.Adapter.class) + public enum TifEnum { + GTC("gtc"), + + IOC("ioc"), + + POC("poc"), + + FOK("fok"); + + private String value; + + TifEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TifEnum fromValue(String value) { + for (TifEnum b : TifEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TifEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TifEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TifEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TIF = "tif"; + @SerializedName(SERIALIZED_NAME_TIF) + private TifEnum tif = TifEnum.GTC; + + public static final String SERIALIZED_NAME_LEFT = "left"; + @SerializedName(SERIALIZED_NAME_LEFT) + private Long left; + + public static final String SERIALIZED_NAME_FILL_PRICE = "fill_price"; + @SerializedName(SERIALIZED_NAME_FILL_PRICE) + private String fillPrice; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_TKFR = "tkfr"; + @SerializedName(SERIALIZED_NAME_TKFR) + private String tkfr; + + public static final String SERIALIZED_NAME_MKFR = "mkfr"; + @SerializedName(SERIALIZED_NAME_MKFR) + private String mkfr; + + public static final String SERIALIZED_NAME_REFU = "refu"; + @SerializedName(SERIALIZED_NAME_REFU) + private Integer refu; + + /** + * 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 + */ + @JsonAdapter(AutoSizeEnum.Adapter.class) + public enum AutoSizeEnum { + LONG("close_long"), + + SHORT("close_short"); + + private String value; + + AutoSizeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AutoSizeEnum fromValue(String value) { + for (AutoSizeEnum b : AutoSizeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AutoSizeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AutoSizeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AutoSizeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUTO_SIZE = "auto_size"; + @SerializedName(SERIALIZED_NAME_AUTO_SIZE) + private AutoSizeEnum autoSize; + + /** + * 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 + */ + @JsonAdapter(StpActEnum.Adapter.class) + public enum StpActEnum { + CO("co"), + + CN("cn"), + + CB("cb"), + + MINUS("-"); + + private String value; + + StpActEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StpActEnum fromValue(String value) { + for (StpActEnum b : StpActEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StpActEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StpActEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StpActEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STP_ACT = "stp_act"; + @SerializedName(SERIALIZED_NAME_STP_ACT) + private StpActEnum stpAct; + + public static final String SERIALIZED_NAME_STP_ID = "stp_id"; + @SerializedName(SERIALIZED_NAME_STP_ID) + private Integer stpId; + + + public BatchFuturesOrder succeeded(Boolean succeeded) { + + this.succeeded = succeeded; + return this; + } + + /** + * Request execution result + * @return succeeded + **/ + @javax.annotation.Nullable + public Boolean getSucceeded() { + return succeeded; + } + + + public void setSucceeded(Boolean succeeded) { + this.succeeded = succeeded; + } + + public BatchFuturesOrder label(String label) { + + this.label = label; + return this; + } + + /** + * Error label, only exists if execution fails + * @return label + **/ + @javax.annotation.Nullable + public String getLabel() { + return label; + } + + + public void setLabel(String label) { + this.label = label; + } + + public BatchFuturesOrder detail(String detail) { + + this.detail = detail; + return this; + } + + /** + * Error detail, only present if execution failed and details need to be given + * @return detail + **/ + @javax.annotation.Nullable + public String getDetail() { + return detail; + } + + + public void setDetail(String detail) { + this.detail = detail; + } + + /** + * Futures order ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + /** + * User ID + * @return user + **/ + @javax.annotation.Nullable + public Integer getUser() { + return user; + } + + + /** + * Creation time of order + * @return createTime + **/ + @javax.annotation.Nullable + public Double getCreateTime() { + return createTime; + } + + + /** + * Order finished time. Not returned if order is open + * @return finishTime + **/ + @javax.annotation.Nullable + public Double getFinishTime() { + return finishTime; + } + + + /** + * 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 + * @return finishAs + **/ + @javax.annotation.Nullable + public FinishAsEnum getFinishAs() { + return finishAs; + } + + + /** + * Order status - `open`: Pending - `finished`: Completed + * @return status + **/ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + + public BatchFuturesOrder contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures contract + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public BatchFuturesOrder size(Long size) { + + this.size = size; + return this; + } + + /** + * Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public BatchFuturesOrder iceberg(Long iceberg) { + + this.iceberg = iceberg; + return this; + } + + /** + * Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. + * @return iceberg + **/ + @javax.annotation.Nullable + public Long getIceberg() { + return iceberg; + } + + + public void setIceberg(Long iceberg) { + this.iceberg = iceberg; + } + + public BatchFuturesOrder price(String price) { + + this.price = price; + return this; + } + + /** + * Order price. Price of 0 with `tif` set to `ioc` represents a market order. + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public BatchFuturesOrder close(Boolean close) { + + this.close = close; + return this; + } + + /** + * Set as `true` to close the position, with `size` set to 0 + * @return close + **/ + @javax.annotation.Nullable + public Boolean getClose() { + return close; + } + + + public void setClose(Boolean close) { + this.close = close; + } + + /** + * Is the order to close position + * @return isClose + **/ + @javax.annotation.Nullable + public Boolean getIsClose() { + return isClose; + } + + + public BatchFuturesOrder reduceOnly(Boolean reduceOnly) { + + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Set as `true` to be reduce-only order + * @return reduceOnly + **/ + @javax.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + + public void setReduceOnly(Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + /** + * Is the order reduce-only + * @return isReduceOnly + **/ + @javax.annotation.Nullable + public Boolean getIsReduceOnly() { + return isReduceOnly; + } + + + /** + * Is the order for liquidation + * @return isLiq + **/ + @javax.annotation.Nullable + public Boolean getIsLiq() { + return isLiq; + } + + + public BatchFuturesOrder tif(TifEnum tif) { + + this.tif = tif; + return this; + } + + /** + * 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 + * @return tif + **/ + @javax.annotation.Nullable + public TifEnum getTif() { + return tif; + } + + + public void setTif(TifEnum tif) { + this.tif = tif; + } + + /** + * Unfilled quantity + * @return left + **/ + @javax.annotation.Nullable + public Long getLeft() { + return left; + } + + + /** + * Fill price + * @return fillPrice + **/ + @javax.annotation.Nullable + public String getFillPrice() { + return fillPrice; + } + + + public BatchFuturesOrder text(String text) { + + this.text = text; + return this; + } + + /** + * 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 + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + /** + * Taker fee + * @return tkfr + **/ + @javax.annotation.Nullable + public String getTkfr() { + return tkfr; + } + + + /** + * Maker fee + * @return mkfr + **/ + @javax.annotation.Nullable + public String getMkfr() { + return mkfr; + } + + + /** + * Referrer user ID + * @return refu + **/ + @javax.annotation.Nullable + public Integer getRefu() { + return refu; + } + + + public BatchFuturesOrder autoSize(AutoSizeEnum autoSize) { + + this.autoSize = autoSize; + return this; + } + + /** + * 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 + * @return autoSize + **/ + @javax.annotation.Nullable + public AutoSizeEnum getAutoSize() { + return autoSize; + } + + + public void setAutoSize(AutoSizeEnum autoSize) { + this.autoSize = autoSize; + } + + public BatchFuturesOrder stpAct(StpActEnum stpAct) { + + this.stpAct = stpAct; + return this; + } + + /** + * 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 + * @return stpAct + **/ + @javax.annotation.Nullable + public StpActEnum getStpAct() { + return stpAct; + } + + + public void setStpAct(StpActEnum stpAct) { + this.stpAct = stpAct; + } + + /** + * 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` + * @return stpId + **/ + @javax.annotation.Nullable + public Integer getStpId() { + return stpId; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchFuturesOrder batchFuturesOrder = (BatchFuturesOrder) o; + return Objects.equals(this.succeeded, batchFuturesOrder.succeeded) && + Objects.equals(this.label, batchFuturesOrder.label) && + Objects.equals(this.detail, batchFuturesOrder.detail) && + Objects.equals(this.id, batchFuturesOrder.id) && + Objects.equals(this.user, batchFuturesOrder.user) && + Objects.equals(this.createTime, batchFuturesOrder.createTime) && + Objects.equals(this.finishTime, batchFuturesOrder.finishTime) && + Objects.equals(this.finishAs, batchFuturesOrder.finishAs) && + Objects.equals(this.status, batchFuturesOrder.status) && + Objects.equals(this.contract, batchFuturesOrder.contract) && + Objects.equals(this.size, batchFuturesOrder.size) && + Objects.equals(this.iceberg, batchFuturesOrder.iceberg) && + Objects.equals(this.price, batchFuturesOrder.price) && + Objects.equals(this.close, batchFuturesOrder.close) && + Objects.equals(this.isClose, batchFuturesOrder.isClose) && + Objects.equals(this.reduceOnly, batchFuturesOrder.reduceOnly) && + Objects.equals(this.isReduceOnly, batchFuturesOrder.isReduceOnly) && + Objects.equals(this.isLiq, batchFuturesOrder.isLiq) && + Objects.equals(this.tif, batchFuturesOrder.tif) && + Objects.equals(this.left, batchFuturesOrder.left) && + Objects.equals(this.fillPrice, batchFuturesOrder.fillPrice) && + Objects.equals(this.text, batchFuturesOrder.text) && + Objects.equals(this.tkfr, batchFuturesOrder.tkfr) && + Objects.equals(this.mkfr, batchFuturesOrder.mkfr) && + Objects.equals(this.refu, batchFuturesOrder.refu) && + Objects.equals(this.autoSize, batchFuturesOrder.autoSize) && + Objects.equals(this.stpAct, batchFuturesOrder.stpAct) && + Objects.equals(this.stpId, batchFuturesOrder.stpId); + } + + @Override + public int hashCode() { + return Objects.hash(succeeded, label, detail, id, user, createTime, finishTime, finishAs, status, contract, size, iceberg, price, close, isClose, reduceOnly, isReduceOnly, isLiq, tif, left, fillPrice, text, tkfr, mkfr, refu, autoSize, stpAct, stpId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchFuturesOrder {\n"); + sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" finishTime: ").append(toIndentedString(finishTime)).append("\n"); + sb.append(" finishAs: ").append(toIndentedString(finishAs)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" iceberg: ").append(toIndentedString(iceberg)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" close: ").append(toIndentedString(close)).append("\n"); + sb.append(" isClose: ").append(toIndentedString(isClose)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" isReduceOnly: ").append(toIndentedString(isReduceOnly)).append("\n"); + sb.append(" isLiq: ").append(toIndentedString(isLiq)).append("\n"); + sb.append(" tif: ").append(toIndentedString(tif)).append("\n"); + sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append(" fillPrice: ").append(toIndentedString(fillPrice)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" tkfr: ").append(toIndentedString(tkfr)).append("\n"); + sb.append(" mkfr: ").append(toIndentedString(mkfr)).append("\n"); + sb.append(" refu: ").append(toIndentedString(refu)).append("\n"); + sb.append(" autoSize: ").append(toIndentedString(autoSize)).append("\n"); + sb.append(" stpAct: ").append(toIndentedString(stpAct)).append("\n"); + sb.append(" stpId: ").append(toIndentedString(stpId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BatchOrder.java b/src/main/java/io/gate/gateapi/models/BatchOrder.java index ac567c6..7c81ea1 100644 --- a/src/main/java/io/gate/gateapi/models/BatchOrder.java +++ b/src/main/java/io/gate/gateapi/models/BatchOrder.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 @@ -23,6 +23,14 @@ * Batch order details */ public class BatchOrder { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private String orderId; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) private String text; @@ -117,11 +125,13 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private String currencyPair; /** - * Order type. limit - limit order + * Order Type - limit : Limit Order - market : Market Order */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - LIMIT("limit"); + LIMIT("limit"), + + MARKET("market"); private String value; @@ -166,7 +176,7 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { private TypeEnum type = TypeEnum.LIMIT; /** - * Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account + * Account type, spot - spot account, margin - leveraged account, unified - unified account */ @JsonAdapter(AccountEnum.Adapter.class) public enum AccountEnum { @@ -174,7 +184,9 @@ public enum AccountEnum { MARGIN("margin"), - CROSS_MARGIN("cross_margin"); + CROSS_MARGIN("cross_margin"), + + UNIFIED("unified"); private String value; @@ -219,7 +231,7 @@ public AccountEnum read(final JsonReader jsonReader) throws IOException { private AccountEnum account = AccountEnum.SPOT; /** - * Order side + * Buy or sell order */ @JsonAdapter(SideEnum.Adapter.class) public enum SideEnum { @@ -278,7 +290,7 @@ public SideEnum read(final JsonReader jsonReader) throws IOException { private String price; /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee + * 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 */ @JsonAdapter(TimeInForceEnum.Adapter.class) public enum TimeInForceEnum { @@ -286,7 +298,9 @@ public enum TimeInForceEnum { IOC("ioc"), - POC("poc"); + POC("poc"), + + FOK("fok"); private String value; @@ -346,6 +360,10 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_LEFT) private String left; + public static final String SERIALIZED_NAME_FILLED_AMOUNT = "filled_amount"; + @SerializedName(SERIALIZED_NAME_FILLED_AMOUNT) + private String filledAmount; + public static final String SERIALIZED_NAME_FILL_PRICE = "fill_price"; @SerializedName(SERIALIZED_NAME_FILL_PRICE) private String fillPrice; @@ -354,6 +372,10 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_FILLED_TOTAL) private String filledTotal; + public static final String SERIALIZED_NAME_AVG_DEAL_PRICE = "avg_deal_price"; + @SerializedName(SERIALIZED_NAME_AVG_DEAL_PRICE) + private String avgDealPrice; + public static final String SERIALIZED_NAME_FEE = "fee"; @SerializedName(SERIALIZED_NAME_FEE) private String fee; @@ -382,6 +404,162 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REBATED_FEE_CURRENCY) private String rebatedFeeCurrency; + public static final String SERIALIZED_NAME_STP_ID = "stp_id"; + @SerializedName(SERIALIZED_NAME_STP_ID) + private Integer stpId; + + /** + * 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 + */ + @JsonAdapter(StpActEnum.Adapter.class) + public enum StpActEnum { + CN("cn"), + + CO("co"), + + CB("cb"), + + MINUS("-"); + + private String value; + + StpActEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StpActEnum fromValue(String value) { + for (StpActEnum b : StpActEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StpActEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StpActEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StpActEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STP_ACT = "stp_act"; + @SerializedName(SERIALIZED_NAME_STP_ACT) + private StpActEnum stpAct; + + /** + * 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 + */ + @JsonAdapter(FinishAsEnum.Adapter.class) + public enum FinishAsEnum { + OPEN("open"), + + FILLED("filled"), + + CANCELLED("cancelled"), + + IOC("ioc"), + + STP("stp"); + + private String value; + + FinishAsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FinishAsEnum fromValue(String value) { + for (FinishAsEnum b : FinishAsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FinishAsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FinishAsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FinishAsEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_FINISH_AS = "finish_as"; + @SerializedName(SERIALIZED_NAME_FINISH_AS) + private FinishAsEnum finishAs; + + + public BatchOrder orderId(String orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public String getOrderId() { + return orderId; + } + + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public BatchOrder amendText(String amendText) { + + this.amendText = amendText; + return this; + } + + /** + * The custom data that the user remarked when amending the order + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public void setAmendText(String amendText) { + this.amendText = amendText; + } public BatchOrder text(String text) { @@ -390,7 +568,7 @@ public BatchOrder text(String text) { } /** - * 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(.) + * 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(.) * @return text **/ @javax.annotation.Nullable @@ -410,7 +588,7 @@ public BatchOrder succeeded(Boolean succeeded) { } /** - * Whether the batch of orders succeeded + * Request execution result * @return succeeded **/ @javax.annotation.Nullable @@ -550,7 +728,7 @@ public BatchOrder type(TypeEnum type) { } /** - * Order type. limit - limit order + * Order Type - limit : Limit Order - market : Market Order * @return type **/ @javax.annotation.Nullable @@ -570,7 +748,7 @@ public BatchOrder account(AccountEnum account) { } /** - * Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account + * Account type, spot - spot account, margin - leveraged account, unified - unified account * @return account **/ @javax.annotation.Nullable @@ -590,7 +768,7 @@ public BatchOrder side(SideEnum side) { } /** - * Order side + * Buy or sell order * @return side **/ @javax.annotation.Nullable @@ -650,7 +828,7 @@ public BatchOrder timeInForce(TimeInForceEnum timeInForce) { } /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee + * 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 * @return timeInForce **/ @javax.annotation.Nullable @@ -670,7 +848,7 @@ public BatchOrder iceberg(String iceberg) { } /** - * Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely + * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported * @return iceberg **/ @javax.annotation.Nullable @@ -690,7 +868,7 @@ public BatchOrder autoBorrow(Boolean autoBorrow) { } /** - * Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. + * Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough * @return autoBorrow **/ @javax.annotation.Nullable @@ -710,7 +888,7 @@ public BatchOrder autoRepay(Boolean autoRepay) { } /** - * 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. + * 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 * @return autoRepay **/ @javax.annotation.Nullable @@ -733,6 +911,16 @@ public String getLeft() { } + /** + * Amount filled + * @return filledAmount + **/ + @javax.annotation.Nullable + public String getFilledAmount() { + return filledAmount; + } + + /** * Total filled in quote currency. Deprecated in favor of `filled_total` * @return fillPrice @@ -753,6 +941,16 @@ public String getFilledTotal() { } + /** + * Average fill price + * @return avgDealPrice + **/ + @javax.annotation.Nullable + public String getAvgDealPrice() { + return avgDealPrice; + } + + /** * Fee deducted * @return fee @@ -794,7 +992,7 @@ public String getGtFee() { /** - * Whether GT fee discount is used + * Whether GT fee deduction is enabled * @return gtDiscount **/ @javax.annotation.Nullable @@ -822,6 +1020,46 @@ public String getRebatedFeeCurrency() { return rebatedFeeCurrency; } + + /** + * 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` + * @return stpId + **/ + @javax.annotation.Nullable + public Integer getStpId() { + return stpId; + } + + + public BatchOrder stpAct(StpActEnum stpAct) { + + this.stpAct = stpAct; + return this; + } + + /** + * 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 + * @return stpAct + **/ + @javax.annotation.Nullable + public StpActEnum getStpAct() { + return stpAct; + } + + + public void setStpAct(StpActEnum stpAct) { + this.stpAct = stpAct; + } + + /** + * 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 + * @return finishAs + **/ + @javax.annotation.Nullable + public FinishAsEnum getFinishAs() { + return finishAs; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -831,7 +1069,9 @@ public boolean equals(java.lang.Object o) { return false; } BatchOrder batchOrder = (BatchOrder) o; - return Objects.equals(this.text, batchOrder.text) && + return Objects.equals(this.orderId, batchOrder.orderId) && + Objects.equals(this.amendText, batchOrder.amendText) && + Objects.equals(this.text, batchOrder.text) && Objects.equals(this.succeeded, batchOrder.succeeded) && Objects.equals(this.label, batchOrder.label) && Objects.equals(this.message, batchOrder.message) && @@ -852,20 +1092,25 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.autoBorrow, batchOrder.autoBorrow) && Objects.equals(this.autoRepay, batchOrder.autoRepay) && Objects.equals(this.left, batchOrder.left) && + Objects.equals(this.filledAmount, batchOrder.filledAmount) && Objects.equals(this.fillPrice, batchOrder.fillPrice) && Objects.equals(this.filledTotal, batchOrder.filledTotal) && + Objects.equals(this.avgDealPrice, batchOrder.avgDealPrice) && Objects.equals(this.fee, batchOrder.fee) && Objects.equals(this.feeCurrency, batchOrder.feeCurrency) && Objects.equals(this.pointFee, batchOrder.pointFee) && Objects.equals(this.gtFee, batchOrder.gtFee) && Objects.equals(this.gtDiscount, batchOrder.gtDiscount) && Objects.equals(this.rebatedFee, batchOrder.rebatedFee) && - Objects.equals(this.rebatedFeeCurrency, batchOrder.rebatedFeeCurrency); + Objects.equals(this.rebatedFeeCurrency, batchOrder.rebatedFeeCurrency) && + Objects.equals(this.stpId, batchOrder.stpId) && + Objects.equals(this.stpAct, batchOrder.stpAct) && + Objects.equals(this.finishAs, batchOrder.finishAs); } @Override public int hashCode() { - return Objects.hash(text, succeeded, label, message, id, createTime, updateTime, createTimeMs, updateTimeMs, status, currencyPair, type, account, side, amount, price, timeInForce, iceberg, autoBorrow, autoRepay, left, fillPrice, filledTotal, fee, feeCurrency, pointFee, gtFee, gtDiscount, rebatedFee, rebatedFeeCurrency); + return Objects.hash(orderId, amendText, text, succeeded, label, message, id, createTime, updateTime, createTimeMs, updateTimeMs, status, currencyPair, type, account, side, amount, price, timeInForce, iceberg, autoBorrow, autoRepay, left, filledAmount, fillPrice, filledTotal, avgDealPrice, fee, feeCurrency, pointFee, gtFee, gtDiscount, rebatedFee, rebatedFeeCurrency, stpId, stpAct, finishAs); } @@ -873,6 +1118,8 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BatchOrder {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); sb.append(" label: ").append(toIndentedString(label)).append("\n"); @@ -894,8 +1141,10 @@ public String toString() { sb.append(" autoBorrow: ").append(toIndentedString(autoBorrow)).append("\n"); sb.append(" autoRepay: ").append(toIndentedString(autoRepay)).append("\n"); sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append(" filledAmount: ").append(toIndentedString(filledAmount)).append("\n"); sb.append(" fillPrice: ").append(toIndentedString(fillPrice)).append("\n"); sb.append(" filledTotal: ").append(toIndentedString(filledTotal)).append("\n"); + sb.append(" avgDealPrice: ").append(toIndentedString(avgDealPrice)).append("\n"); sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" feeCurrency: ").append(toIndentedString(feeCurrency)).append("\n"); sb.append(" pointFee: ").append(toIndentedString(pointFee)).append("\n"); @@ -903,6 +1152,9 @@ public String toString() { sb.append(" gtDiscount: ").append(toIndentedString(gtDiscount)).append("\n"); sb.append(" rebatedFee: ").append(toIndentedString(rebatedFee)).append("\n"); sb.append(" rebatedFeeCurrency: ").append(toIndentedString(rebatedFeeCurrency)).append("\n"); + sb.append(" stpId: ").append(toIndentedString(stpId)).append("\n"); + sb.append(" stpAct: ").append(toIndentedString(stpAct)).append("\n"); + sb.append(" finishAs: ").append(toIndentedString(finishAs)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/BorrowCurrencyInfo.java b/src/main/java/io/gate/gateapi/models/BorrowCurrencyInfo.java new file mode 100644 index 0000000..644f7f4 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BorrowCurrencyInfo.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * BorrowCurrencyInfo + */ +public class BorrowCurrencyInfo { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_LEFT_REPAY_PRINCIPAL = "left_repay_principal"; + @SerializedName(SERIALIZED_NAME_LEFT_REPAY_PRINCIPAL) + private String leftRepayPrincipal; + + public static final String SERIALIZED_NAME_LEFT_REPAY_INTEREST = "left_repay_interest"; + @SerializedName(SERIALIZED_NAME_LEFT_REPAY_INTEREST) + private String leftRepayInterest; + + public static final String SERIALIZED_NAME_LEFT_REPAY_USDT = "left_repay_usdt"; + @SerializedName(SERIALIZED_NAME_LEFT_REPAY_USDT) + private String leftRepayUsdt; + + + public BorrowCurrencyInfo currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public BorrowCurrencyInfo indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public BorrowCurrencyInfo leftRepayPrincipal(String leftRepayPrincipal) { + + this.leftRepayPrincipal = leftRepayPrincipal; + return this; + } + + /** + * Outstanding principal + * @return leftRepayPrincipal + **/ + @javax.annotation.Nullable + public String getLeftRepayPrincipal() { + return leftRepayPrincipal; + } + + + public void setLeftRepayPrincipal(String leftRepayPrincipal) { + this.leftRepayPrincipal = leftRepayPrincipal; + } + + public BorrowCurrencyInfo leftRepayInterest(String leftRepayInterest) { + + this.leftRepayInterest = leftRepayInterest; + return this; + } + + /** + * Outstanding interest + * @return leftRepayInterest + **/ + @javax.annotation.Nullable + public String getLeftRepayInterest() { + return leftRepayInterest; + } + + + public void setLeftRepayInterest(String leftRepayInterest) { + this.leftRepayInterest = leftRepayInterest; + } + + public BorrowCurrencyInfo leftRepayUsdt(String leftRepayUsdt) { + + this.leftRepayUsdt = leftRepayUsdt; + return this; + } + + /** + * Remaining total outstanding value converted to USDT + * @return leftRepayUsdt + **/ + @javax.annotation.Nullable + public String getLeftRepayUsdt() { + return leftRepayUsdt; + } + + + public void setLeftRepayUsdt(String leftRepayUsdt) { + this.leftRepayUsdt = leftRepayUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BorrowCurrencyInfo borrowCurrencyInfo = (BorrowCurrencyInfo) o; + return Objects.equals(this.currency, borrowCurrencyInfo.currency) && + Objects.equals(this.indexPrice, borrowCurrencyInfo.indexPrice) && + Objects.equals(this.leftRepayPrincipal, borrowCurrencyInfo.leftRepayPrincipal) && + Objects.equals(this.leftRepayInterest, borrowCurrencyInfo.leftRepayInterest) && + Objects.equals(this.leftRepayUsdt, borrowCurrencyInfo.leftRepayUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, leftRepayPrincipal, leftRepayInterest, leftRepayUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BorrowCurrencyInfo {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" leftRepayPrincipal: ").append(toIndentedString(leftRepayPrincipal)).append("\n"); + sb.append(" leftRepayInterest: ").append(toIndentedString(leftRepayInterest)).append("\n"); + sb.append(" leftRepayUsdt: ").append(toIndentedString(leftRepayUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BrokerCommission.java b/src/main/java/io/gate/gateapi/models/BrokerCommission.java new file mode 100644 index 0000000..7ba6e12 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BrokerCommission.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.BrokerCommission1; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * BrokerCommission + */ +public class BrokerCommission { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public BrokerCommission total(Long total) { + + this.total = total; + return this; + } + + /** + * Total + * @return total + **/ + @javax.annotation.Nullable + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + public BrokerCommission list(List list) { + + this.list = list; + return this; + } + + public BrokerCommission addListItem(BrokerCommission1 listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * List of commission history + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrokerCommission brokerCommission = (BrokerCommission) o; + return Objects.equals(this.total, brokerCommission.total) && + Objects.equals(this.list, brokerCommission.list); + } + + @Override + public int hashCode() { + return Objects.hash(total, list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrokerCommission {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BrokerCommission1.java b/src/main/java/io/gate/gateapi/models/BrokerCommission1.java new file mode 100644 index 0000000..3d11d7a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BrokerCommission1.java @@ -0,0 +1,350 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.BrokerCommissionSubBrokerInfo; +import java.io.IOException; + +/** + * BrokerCommission1 + */ +public class BrokerCommission1 { + public static final String SERIALIZED_NAME_COMMISSION_TIME = "commission_time"; + @SerializedName(SERIALIZED_NAME_COMMISSION_TIME) + private Long commissionTime; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_GROUP_NAME = "group_name"; + @SerializedName(SERIALIZED_NAME_GROUP_NAME) + private String groupName; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_FEE_ASSET = "fee_asset"; + @SerializedName(SERIALIZED_NAME_FEE_ASSET) + private String feeAsset; + + public static final String SERIALIZED_NAME_REBATE_FEE = "rebate_fee"; + @SerializedName(SERIALIZED_NAME_REBATE_FEE) + private String rebateFee; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_SUB_BROKER_INFO = "sub_broker_info"; + @SerializedName(SERIALIZED_NAME_SUB_BROKER_INFO) + private BrokerCommissionSubBrokerInfo subBrokerInfo; + + public static final String SERIALIZED_NAME_ALPHA_CONTRACT_ADDR = "alpha_contract_addr"; + @SerializedName(SERIALIZED_NAME_ALPHA_CONTRACT_ADDR) + private String alphaContractAddr; + + + public BrokerCommission1 commissionTime(Long commissionTime) { + + this.commissionTime = commissionTime; + return this; + } + + /** + * Commission time (Unix timestamp in seconds) + * @return commissionTime + **/ + @javax.annotation.Nullable + public Long getCommissionTime() { + return commissionTime; + } + + + public void setCommissionTime(Long commissionTime) { + this.commissionTime = commissionTime; + } + + public BrokerCommission1 userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public BrokerCommission1 groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * Group name + * @return groupName + **/ + @javax.annotation.Nullable + public String getGroupName() { + return groupName; + } + + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public BrokerCommission1 amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * The amount of commission rebates + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public BrokerCommission1 fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * Fee + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public BrokerCommission1 feeAsset(String feeAsset) { + + this.feeAsset = feeAsset; + return this; + } + + /** + * Fee currency + * @return feeAsset + **/ + @javax.annotation.Nullable + public String getFeeAsset() { + return feeAsset; + } + + + public void setFeeAsset(String feeAsset) { + this.feeAsset = feeAsset; + } + + public BrokerCommission1 rebateFee(String rebateFee) { + + this.rebateFee = rebateFee; + return this; + } + + /** + * The income from rebates, converted to USDT + * @return rebateFee + **/ + @javax.annotation.Nullable + public String getRebateFee() { + return rebateFee; + } + + + public void setRebateFee(String rebateFee) { + this.rebateFee = rebateFee; + } + + public BrokerCommission1 source(String source) { + + this.source = source; + return this; + } + + /** + * Commission transaction type: Spot, Futures, Options, Alpha + * @return source + **/ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + + public void setSource(String source) { + this.source = source; + } + + public BrokerCommission1 currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public BrokerCommission1 subBrokerInfo(BrokerCommissionSubBrokerInfo subBrokerInfo) { + + this.subBrokerInfo = subBrokerInfo; + return this; + } + + /** + * Get subBrokerInfo + * @return subBrokerInfo + **/ + @javax.annotation.Nullable + public BrokerCommissionSubBrokerInfo getSubBrokerInfo() { + return subBrokerInfo; + } + + + public void setSubBrokerInfo(BrokerCommissionSubBrokerInfo subBrokerInfo) { + this.subBrokerInfo = subBrokerInfo; + } + + public BrokerCommission1 alphaContractAddr(String alphaContractAddr) { + + this.alphaContractAddr = alphaContractAddr; + return this; + } + + /** + * Alpha contract address + * @return alphaContractAddr + **/ + @javax.annotation.Nullable + public String getAlphaContractAddr() { + return alphaContractAddr; + } + + + public void setAlphaContractAddr(String alphaContractAddr) { + this.alphaContractAddr = alphaContractAddr; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrokerCommission1 brokerCommission1 = (BrokerCommission1) o; + return Objects.equals(this.commissionTime, brokerCommission1.commissionTime) && + Objects.equals(this.userId, brokerCommission1.userId) && + Objects.equals(this.groupName, brokerCommission1.groupName) && + Objects.equals(this.amount, brokerCommission1.amount) && + Objects.equals(this.fee, brokerCommission1.fee) && + Objects.equals(this.feeAsset, brokerCommission1.feeAsset) && + Objects.equals(this.rebateFee, brokerCommission1.rebateFee) && + Objects.equals(this.source, brokerCommission1.source) && + Objects.equals(this.currencyPair, brokerCommission1.currencyPair) && + Objects.equals(this.subBrokerInfo, brokerCommission1.subBrokerInfo) && + Objects.equals(this.alphaContractAddr, brokerCommission1.alphaContractAddr); + } + + @Override + public int hashCode() { + return Objects.hash(commissionTime, userId, groupName, amount, fee, feeAsset, rebateFee, source, currencyPair, subBrokerInfo, alphaContractAddr); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrokerCommission1 {\n"); + sb.append(" commissionTime: ").append(toIndentedString(commissionTime)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" feeAsset: ").append(toIndentedString(feeAsset)).append("\n"); + sb.append(" rebateFee: ").append(toIndentedString(rebateFee)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" subBrokerInfo: ").append(toIndentedString(subBrokerInfo)).append("\n"); + sb.append(" alphaContractAddr: ").append(toIndentedString(alphaContractAddr)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BrokerCommissionSubBrokerInfo.java b/src/main/java/io/gate/gateapi/models/BrokerCommissionSubBrokerInfo.java new file mode 100644 index 0000000..11b720c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BrokerCommissionSubBrokerInfo.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Sub-broker information + */ +public class BrokerCommissionSubBrokerInfo { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_ORIGINAL_COMMISSION_RATE = "original_commission_rate"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_COMMISSION_RATE) + private String originalCommissionRate; + + public static final String SERIALIZED_NAME_RELATIVE_COMMISSION_RATE = "relative_commission_rate"; + @SerializedName(SERIALIZED_NAME_RELATIVE_COMMISSION_RATE) + private String relativeCommissionRate; + + public static final String SERIALIZED_NAME_COMMISSION_RATE = "commission_rate"; + @SerializedName(SERIALIZED_NAME_COMMISSION_RATE) + private String commissionRate; + + + public BrokerCommissionSubBrokerInfo userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * Sub-broker user ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public BrokerCommissionSubBrokerInfo originalCommissionRate(String originalCommissionRate) { + + this.originalCommissionRate = originalCommissionRate; + return this; + } + + /** + * Sub-broker original commission rate + * @return originalCommissionRate + **/ + @javax.annotation.Nullable + public String getOriginalCommissionRate() { + return originalCommissionRate; + } + + + public void setOriginalCommissionRate(String originalCommissionRate) { + this.originalCommissionRate = originalCommissionRate; + } + + public BrokerCommissionSubBrokerInfo relativeCommissionRate(String relativeCommissionRate) { + + this.relativeCommissionRate = relativeCommissionRate; + return this; + } + + /** + * Sub-broker relative commission rate + * @return relativeCommissionRate + **/ + @javax.annotation.Nullable + public String getRelativeCommissionRate() { + return relativeCommissionRate; + } + + + public void setRelativeCommissionRate(String relativeCommissionRate) { + this.relativeCommissionRate = relativeCommissionRate; + } + + public BrokerCommissionSubBrokerInfo commissionRate(String commissionRate) { + + this.commissionRate = commissionRate; + return this; + } + + /** + * Sub-broker actual commission rate + * @return commissionRate + **/ + @javax.annotation.Nullable + public String getCommissionRate() { + return commissionRate; + } + + + public void setCommissionRate(String commissionRate) { + this.commissionRate = commissionRate; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrokerCommissionSubBrokerInfo brokerCommissionSubBrokerInfo = (BrokerCommissionSubBrokerInfo) o; + return Objects.equals(this.userId, brokerCommissionSubBrokerInfo.userId) && + Objects.equals(this.originalCommissionRate, brokerCommissionSubBrokerInfo.originalCommissionRate) && + Objects.equals(this.relativeCommissionRate, brokerCommissionSubBrokerInfo.relativeCommissionRate) && + Objects.equals(this.commissionRate, brokerCommissionSubBrokerInfo.commissionRate); + } + + @Override + public int hashCode() { + return Objects.hash(userId, originalCommissionRate, relativeCommissionRate, commissionRate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrokerCommissionSubBrokerInfo {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" originalCommissionRate: ").append(toIndentedString(originalCommissionRate)).append("\n"); + sb.append(" relativeCommissionRate: ").append(toIndentedString(relativeCommissionRate)).append("\n"); + sb.append(" commissionRate: ").append(toIndentedString(commissionRate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BrokerTransaction.java b/src/main/java/io/gate/gateapi/models/BrokerTransaction.java new file mode 100644 index 0000000..73886cb --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BrokerTransaction.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.BrokerTransaction1; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * BrokerTransaction + */ +public class BrokerTransaction { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public BrokerTransaction total(Long total) { + + this.total = total; + return this; + } + + /** + * Total + * @return total + **/ + @javax.annotation.Nullable + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + public BrokerTransaction list(List list) { + + this.list = list; + return this; + } + + public BrokerTransaction addListItem(BrokerTransaction1 listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * List of transaction history + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrokerTransaction brokerTransaction = (BrokerTransaction) o; + return Objects.equals(this.total, brokerTransaction.total) && + Objects.equals(this.list, brokerTransaction.list); + } + + @Override + public int hashCode() { + return Objects.hash(total, list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrokerTransaction {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/BrokerTransaction1.java b/src/main/java/io/gate/gateapi/models/BrokerTransaction1.java new file mode 100644 index 0000000..b76e252 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/BrokerTransaction1.java @@ -0,0 +1,324 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.BrokerCommissionSubBrokerInfo; +import java.io.IOException; + +/** + * BrokerTransaction1 + */ +public class BrokerTransaction1 { + public static final String SERIALIZED_NAME_TRANSACTION_TIME = "transaction_time"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_TIME) + private Long transactionTime; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_GROUP_NAME = "group_name"; + @SerializedName(SERIALIZED_NAME_GROUP_NAME) + private String groupName; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_FEE_ASSET = "fee_asset"; + @SerializedName(SERIALIZED_NAME_FEE_ASSET) + private String feeAsset; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public static final String SERIALIZED_NAME_SUB_BROKER_INFO = "sub_broker_info"; + @SerializedName(SERIALIZED_NAME_SUB_BROKER_INFO) + private BrokerCommissionSubBrokerInfo subBrokerInfo; + + public static final String SERIALIZED_NAME_ALPHA_CONTRACT_ADDR = "alpha_contract_addr"; + @SerializedName(SERIALIZED_NAME_ALPHA_CONTRACT_ADDR) + private String alphaContractAddr; + + + public BrokerTransaction1 transactionTime(Long transactionTime) { + + this.transactionTime = transactionTime; + return this; + } + + /** + * Transaction Time. (unix timestamp) + * @return transactionTime + **/ + @javax.annotation.Nullable + public Long getTransactionTime() { + return transactionTime; + } + + + public void setTransactionTime(Long transactionTime) { + this.transactionTime = transactionTime; + } + + public BrokerTransaction1 userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public BrokerTransaction1 groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * Group name + * @return groupName + **/ + @javax.annotation.Nullable + public String getGroupName() { + return groupName; + } + + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public BrokerTransaction1 fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * Fee amount (USDT) + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public BrokerTransaction1 currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public BrokerTransaction1 amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Transaction amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public BrokerTransaction1 feeAsset(String feeAsset) { + + this.feeAsset = feeAsset; + return this; + } + + /** + * Fee currency + * @return feeAsset + **/ + @javax.annotation.Nullable + public String getFeeAsset() { + return feeAsset; + } + + + public void setFeeAsset(String feeAsset) { + this.feeAsset = feeAsset; + } + + public BrokerTransaction1 source(String source) { + + this.source = source; + return this; + } + + /** + * Commission transaction type: Spot, Futures, Options, Alpha + * @return source + **/ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + + public void setSource(String source) { + this.source = source; + } + + public BrokerTransaction1 subBrokerInfo(BrokerCommissionSubBrokerInfo subBrokerInfo) { + + this.subBrokerInfo = subBrokerInfo; + return this; + } + + /** + * Get subBrokerInfo + * @return subBrokerInfo + **/ + @javax.annotation.Nullable + public BrokerCommissionSubBrokerInfo getSubBrokerInfo() { + return subBrokerInfo; + } + + + public void setSubBrokerInfo(BrokerCommissionSubBrokerInfo subBrokerInfo) { + this.subBrokerInfo = subBrokerInfo; + } + + public BrokerTransaction1 alphaContractAddr(String alphaContractAddr) { + + this.alphaContractAddr = alphaContractAddr; + return this; + } + + /** + * Alpha contract address + * @return alphaContractAddr + **/ + @javax.annotation.Nullable + public String getAlphaContractAddr() { + return alphaContractAddr; + } + + + public void setAlphaContractAddr(String alphaContractAddr) { + this.alphaContractAddr = alphaContractAddr; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrokerTransaction1 brokerTransaction1 = (BrokerTransaction1) o; + return Objects.equals(this.transactionTime, brokerTransaction1.transactionTime) && + Objects.equals(this.userId, brokerTransaction1.userId) && + Objects.equals(this.groupName, brokerTransaction1.groupName) && + Objects.equals(this.fee, brokerTransaction1.fee) && + Objects.equals(this.currencyPair, brokerTransaction1.currencyPair) && + Objects.equals(this.amount, brokerTransaction1.amount) && + Objects.equals(this.feeAsset, brokerTransaction1.feeAsset) && + Objects.equals(this.source, brokerTransaction1.source) && + Objects.equals(this.subBrokerInfo, brokerTransaction1.subBrokerInfo) && + Objects.equals(this.alphaContractAddr, brokerTransaction1.alphaContractAddr); + } + + @Override + public int hashCode() { + return Objects.hash(transactionTime, userId, groupName, fee, currencyPair, amount, feeAsset, source, subBrokerInfo, alphaContractAddr); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrokerTransaction1 {\n"); + sb.append(" transactionTime: ").append(toIndentedString(transactionTime)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" feeAsset: ").append(toIndentedString(feeAsset)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" subBrokerInfo: ").append(toIndentedString(subBrokerInfo)).append("\n"); + sb.append(" alphaContractAddr: ").append(toIndentedString(alphaContractAddr)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CancelOrder.java b/src/main/java/io/gate/gateapi/models/CancelBatchOrder.java similarity index 59% rename from src/main/java/io/gate/gateapi/models/CancelOrder.java rename to src/main/java/io/gate/gateapi/models/CancelBatchOrder.java index 0354afe..fd2ba0c 100644 --- a/src/main/java/io/gate/gateapi/models/CancelOrder.java +++ b/src/main/java/io/gate/gateapi/models/CancelBatchOrder.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 @@ -22,7 +22,7 @@ /** * Info of order to be cancelled */ -public class CancelOrder { +public class CancelBatchOrder { public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) private String currencyPair; @@ -35,8 +35,12 @@ public class CancelOrder { @SerializedName(SERIALIZED_NAME_ACCOUNT) private String account; + public static final String SERIALIZED_NAME_ACTION_MODE = "action_mode"; + @SerializedName(SERIALIZED_NAME_ACTION_MODE) + private String actionMode; - public CancelOrder currencyPair(String currencyPair) { + + public CancelBatchOrder currencyPair(String currencyPair) { this.currencyPair = currencyPair; return this; @@ -55,7 +59,7 @@ public void setCurrencyPair(String currencyPair) { this.currencyPair = currencyPair; } - public CancelOrder id(String id) { + public CancelBatchOrder id(String id) { this.id = id; return this; @@ -74,14 +78,14 @@ public void setId(String id) { this.id = id; } - public CancelOrder account(String account) { + public CancelBatchOrder account(String account) { this.account = account; return this; } /** - * If cancelled order is cross margin order, this field must be set and can only be `cross_margin` + * If the canceled order is a unified account apikey, this field must be specified and set to `unified` * @return account **/ @javax.annotation.Nullable @@ -93,6 +97,26 @@ public String getAccount() { public void setAccount(String account) { this.account = account; } + + public CancelBatchOrder actionMode(String actionMode) { + + this.actionMode = actionMode; + return this; + } + + /** + * 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) + * @return actionMode + **/ + @javax.annotation.Nullable + public String getActionMode() { + return actionMode; + } + + + public void setActionMode(String actionMode) { + this.actionMode = actionMode; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -101,25 +125,27 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CancelOrder cancelOrder = (CancelOrder) o; - return Objects.equals(this.currencyPair, cancelOrder.currencyPair) && - Objects.equals(this.id, cancelOrder.id) && - Objects.equals(this.account, cancelOrder.account); + CancelBatchOrder cancelBatchOrder = (CancelBatchOrder) o; + return Objects.equals(this.currencyPair, cancelBatchOrder.currencyPair) && + Objects.equals(this.id, cancelBatchOrder.id) && + Objects.equals(this.account, cancelBatchOrder.account) && + Objects.equals(this.actionMode, cancelBatchOrder.actionMode); } @Override public int hashCode() { - return Objects.hash(currencyPair, id, account); + return Objects.hash(currencyPair, id, account, actionMode); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CancelOrder {\n"); + sb.append("class CancelBatchOrder {\n"); sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" actionMode: ").append(toIndentedString(actionMode)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/CancelOrderResult.java b/src/main/java/io/gate/gateapi/models/CancelOrderResult.java index 0a73882..7871575 100644 --- a/src/main/java/io/gate/gateapi/models/CancelOrderResult.java +++ b/src/main/java/io/gate/gateapi/models/CancelOrderResult.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 @@ -31,6 +31,10 @@ public class CancelOrderResult { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + public static final String SERIALIZED_NAME_SUCCEEDED = "succeeded"; @SerializedName(SERIALIZED_NAME_SUCCEEDED) private Boolean succeeded; @@ -88,6 +92,26 @@ public void setId(String id) { this.id = id; } + public CancelOrderResult text(String text) { + + this.text = text; + return this; + } + + /** + * Custom order information + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + public CancelOrderResult succeeded(Boolean succeeded) { this.succeeded = succeeded; @@ -135,7 +159,7 @@ public CancelOrderResult message(String message) { } /** - * Error message when failed to cancel the order; empty if succeeded + * Error description when cancellation fails, empty if successful * @return message **/ @javax.annotation.Nullable @@ -155,7 +179,7 @@ public CancelOrderResult account(String account) { } /** - * Empty by default. If cancelled order is cross margin order, this field is set to `cross_margin` + * Default is empty (deprecated) * @return account **/ @javax.annotation.Nullable @@ -178,6 +202,7 @@ public boolean equals(java.lang.Object o) { CancelOrderResult cancelOrderResult = (CancelOrderResult) o; return Objects.equals(this.currencyPair, cancelOrderResult.currencyPair) && Objects.equals(this.id, cancelOrderResult.id) && + Objects.equals(this.text, cancelOrderResult.text) && Objects.equals(this.succeeded, cancelOrderResult.succeeded) && Objects.equals(this.label, cancelOrderResult.label) && Objects.equals(this.message, cancelOrderResult.message) && @@ -186,7 +211,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(currencyPair, id, succeeded, label, message, account); + return Objects.hash(currencyPair, id, text, succeeded, label, message, account); } @@ -196,6 +221,7 @@ public String toString() { sb.append("class CancelOrderResult {\n"); sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); sb.append(" label: ").append(toIndentedString(label)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); diff --git a/src/main/java/io/gate/gateapi/models/CollateralAdjust.java b/src/main/java/io/gate/gateapi/models/CollateralAdjust.java new file mode 100644 index 0000000..74855e8 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralAdjust.java @@ -0,0 +1,150 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.CollateralCurrency; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * CollateralAdjust + */ +public class CollateralAdjust { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_COLLATERALS = "collaterals"; + @SerializedName(SERIALIZED_NAME_COLLATERALS) + private List collaterals = null; + + + public CollateralAdjust orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public CollateralAdjust type(String type) { + + this.type = type; + return this; + } + + /** + * Operation type: append - add collateral, redeem - withdraw collateral + * @return type + **/ + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + public CollateralAdjust collaterals(List collaterals) { + + this.collaterals = collaterals; + return this; + } + + public CollateralAdjust addCollateralsItem(CollateralCurrency collateralsItem) { + if (this.collaterals == null) { + this.collaterals = new ArrayList<>(); + } + this.collaterals.add(collateralsItem); + return this; + } + + /** + * Collateral currency list + * @return collaterals + **/ + @javax.annotation.Nullable + public List getCollaterals() { + return collaterals; + } + + + public void setCollaterals(List collaterals) { + this.collaterals = collaterals; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralAdjust collateralAdjust = (CollateralAdjust) o; + return Objects.equals(this.orderId, collateralAdjust.orderId) && + Objects.equals(this.type, collateralAdjust.type) && + Objects.equals(this.collaterals, collateralAdjust.collaterals); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, type, collaterals); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralAdjust {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" collaterals: ").append(toIndentedString(collaterals)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralAdjustRes.java b/src/main/java/io/gate/gateapi/models/CollateralAdjustRes.java new file mode 100644 index 0000000..89d4326 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralAdjustRes.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.CollateralCurrencyRes; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Multi-collateral adjustment result + */ +public class CollateralAdjustRes { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCIES = "collateral_currencies"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCIES) + private List collateralCurrencies = null; + + + public CollateralAdjustRes orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public CollateralAdjustRes collateralCurrencies(List collateralCurrencies) { + + this.collateralCurrencies = collateralCurrencies; + return this; + } + + public CollateralAdjustRes addCollateralCurrenciesItem(CollateralCurrencyRes collateralCurrenciesItem) { + if (this.collateralCurrencies == null) { + this.collateralCurrencies = new ArrayList<>(); + } + this.collateralCurrencies.add(collateralCurrenciesItem); + return this; + } + + /** + * Collateral currency information + * @return collateralCurrencies + **/ + @javax.annotation.Nullable + public List getCollateralCurrencies() { + return collateralCurrencies; + } + + + public void setCollateralCurrencies(List collateralCurrencies) { + this.collateralCurrencies = collateralCurrencies; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralAdjustRes collateralAdjustRes = (CollateralAdjustRes) o; + return Objects.equals(this.orderId, collateralAdjustRes.orderId) && + Objects.equals(this.collateralCurrencies, collateralAdjustRes.collateralCurrencies); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, collateralCurrencies); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralAdjustRes {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" collateralCurrencies: ").append(toIndentedString(collateralCurrencies)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralAlign.java b/src/main/java/io/gate/gateapi/models/CollateralAlign.java new file mode 100644 index 0000000..19c02b9 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralAlign.java @@ -0,0 +1,163 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * CollateralAlign + */ +public class CollateralAlign { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCY = "collateral_currency"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCY) + private String collateralCurrency; + + public static final String SERIALIZED_NAME_COLLATERAL_AMOUNT = "collateral_amount"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_AMOUNT) + private String collateralAmount; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + + public CollateralAlign orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public CollateralAlign collateralCurrency(String collateralCurrency) { + + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Collateral currency + * @return collateralCurrency + **/ + public String getCollateralCurrency() { + return collateralCurrency; + } + + + public void setCollateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + } + + public CollateralAlign collateralAmount(String collateralAmount) { + + this.collateralAmount = collateralAmount; + return this; + } + + /** + * Collateral amount + * @return collateralAmount + **/ + public String getCollateralAmount() { + return collateralAmount; + } + + + public void setCollateralAmount(String collateralAmount) { + this.collateralAmount = collateralAmount; + } + + public CollateralAlign type(String type) { + + this.type = type; + return this; + } + + /** + * Operation type: append - add collateral, redeem - withdraw collateral + * @return type + **/ + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralAlign collateralAlign = (CollateralAlign) o; + return Objects.equals(this.orderId, collateralAlign.orderId) && + Objects.equals(this.collateralCurrency, collateralAlign.collateralCurrency) && + Objects.equals(this.collateralAmount, collateralAlign.collateralAmount) && + Objects.equals(this.type, collateralAlign.type); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, collateralCurrency, collateralAmount, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralAlign {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" collateralCurrency: ").append(toIndentedString(collateralCurrency)).append("\n"); + sb.append(" collateralAmount: ").append(toIndentedString(collateralAmount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginRepayRequest.java b/src/main/java/io/gate/gateapi/models/CollateralCurrency.java similarity index 74% rename from src/main/java/io/gate/gateapi/models/CrossMarginRepayRequest.java rename to src/main/java/io/gate/gateapi/models/CollateralCurrency.java index e471264..734c4bc 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginRepayRequest.java +++ b/src/main/java/io/gate/gateapi/models/CollateralCurrency.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 @@ -20,9 +20,9 @@ import java.io.IOException; /** - * CrossMarginRepayRequest + * CollateralCurrency */ -public class CrossMarginRepayRequest { +public class CollateralCurrency { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; @@ -32,16 +32,17 @@ public class CrossMarginRepayRequest { private String amount; - public CrossMarginRepayRequest currency(String currency) { + public CollateralCurrency currency(String currency) { this.currency = currency; return this; } /** - * Repayment currency + * Currency * @return currency **/ + @javax.annotation.Nullable public String getCurrency() { return currency; } @@ -51,16 +52,17 @@ public void setCurrency(String currency) { this.currency = currency; } - public CrossMarginRepayRequest amount(String amount) { + public CollateralCurrency amount(String amount) { this.amount = amount; return this; } /** - * Repayment amount + * Size * @return amount **/ + @javax.annotation.Nullable public String getAmount() { return amount; } @@ -77,9 +79,9 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CrossMarginRepayRequest crossMarginRepayRequest = (CrossMarginRepayRequest) o; - return Objects.equals(this.currency, crossMarginRepayRequest.currency) && - Objects.equals(this.amount, crossMarginRepayRequest.amount); + CollateralCurrency collateralCurrency = (CollateralCurrency) o; + return Objects.equals(this.currency, collateralCurrency.currency) && + Objects.equals(this.amount, collateralCurrency.amount); } @Override @@ -91,7 +93,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginRepayRequest {\n"); + sb.append("class CollateralCurrency {\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append("}"); diff --git a/src/main/java/io/gate/gateapi/models/CollateralCurrencyInfo.java b/src/main/java/io/gate/gateapi/models/CollateralCurrencyInfo.java new file mode 100644 index 0000000..25c5dc6 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralCurrencyInfo.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * CollateralCurrencyInfo + */ +public class CollateralCurrencyInfo { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_LEFT_COLLATERAL = "left_collateral"; + @SerializedName(SERIALIZED_NAME_LEFT_COLLATERAL) + private String leftCollateral; + + public static final String SERIALIZED_NAME_LEFT_COLLATERAL_USDT = "left_collateral_usdt"; + @SerializedName(SERIALIZED_NAME_LEFT_COLLATERAL_USDT) + private String leftCollateralUsdt; + + + public CollateralCurrencyInfo currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public CollateralCurrencyInfo indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public CollateralCurrencyInfo leftCollateral(String leftCollateral) { + + this.leftCollateral = leftCollateral; + return this; + } + + /** + * Remaining collateral amount + * @return leftCollateral + **/ + @javax.annotation.Nullable + public String getLeftCollateral() { + return leftCollateral; + } + + + public void setLeftCollateral(String leftCollateral) { + this.leftCollateral = leftCollateral; + } + + public CollateralCurrencyInfo leftCollateralUsdt(String leftCollateralUsdt) { + + this.leftCollateralUsdt = leftCollateralUsdt; + return this; + } + + /** + * Remaining collateral value converted to USDT + * @return leftCollateralUsdt + **/ + @javax.annotation.Nullable + public String getLeftCollateralUsdt() { + return leftCollateralUsdt; + } + + + public void setLeftCollateralUsdt(String leftCollateralUsdt) { + this.leftCollateralUsdt = leftCollateralUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralCurrencyInfo collateralCurrencyInfo = (CollateralCurrencyInfo) o; + return Objects.equals(this.currency, collateralCurrencyInfo.currency) && + Objects.equals(this.indexPrice, collateralCurrencyInfo.indexPrice) && + Objects.equals(this.leftCollateral, collateralCurrencyInfo.leftCollateral) && + Objects.equals(this.leftCollateralUsdt, collateralCurrencyInfo.leftCollateralUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, leftCollateral, leftCollateralUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralCurrencyInfo {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" leftCollateral: ").append(toIndentedString(leftCollateral)).append("\n"); + sb.append(" leftCollateralUsdt: ").append(toIndentedString(leftCollateralUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralCurrencyRes.java b/src/main/java/io/gate/gateapi/models/CollateralCurrencyRes.java new file mode 100644 index 0000000..59862a6 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralCurrencyRes.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * CollateralCurrencyRes + */ +public class CollateralCurrencyRes { + public static final String SERIALIZED_NAME_SUCCEEDED = "succeeded"; + @SerializedName(SERIALIZED_NAME_SUCCEEDED) + private Boolean succeeded; + + public static final String SERIALIZED_NAME_LABEL = "label"; + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + + public CollateralCurrencyRes succeeded(Boolean succeeded) { + + this.succeeded = succeeded; + return this; + } + + /** + * Update success status + * @return succeeded + **/ + @javax.annotation.Nullable + public Boolean getSucceeded() { + return succeeded; + } + + + public void setSucceeded(Boolean succeeded) { + this.succeeded = succeeded; + } + + public CollateralCurrencyRes label(String label) { + + this.label = label; + return this; + } + + /** + * Error identifier for failed operations; empty when successful + * @return label + **/ + @javax.annotation.Nullable + public String getLabel() { + return label; + } + + + public void setLabel(String label) { + this.label = label; + } + + public CollateralCurrencyRes message(String message) { + + this.message = message; + return this; + } + + /** + * Error description for failed operations; empty when successful + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + public CollateralCurrencyRes currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public CollateralCurrencyRes amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Successfully operated collateral quantity; 0 if operation fails + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralCurrencyRes collateralCurrencyRes = (CollateralCurrencyRes) o; + return Objects.equals(this.succeeded, collateralCurrencyRes.succeeded) && + Objects.equals(this.label, collateralCurrencyRes.label) && + Objects.equals(this.message, collateralCurrencyRes.message) && + Objects.equals(this.currency, collateralCurrencyRes.currency) && + Objects.equals(this.amount, collateralCurrencyRes.amount); + } + + @Override + public int hashCode() { + return Objects.hash(succeeded, label, message, currency, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralCurrencyRes {\n"); + sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralCurrentRate.java b/src/main/java/io/gate/gateapi/models/CollateralCurrentRate.java new file mode 100644 index 0000000..265b86d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralCurrentRate.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Multi-collateral current interest rate + */ +public class CollateralCurrentRate { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_CURRENT_RATE = "current_rate"; + @SerializedName(SERIALIZED_NAME_CURRENT_RATE) + private String currentRate; + + + public CollateralCurrentRate currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public CollateralCurrentRate currentRate(String currentRate) { + + this.currentRate = currentRate; + return this; + } + + /** + * Currency current interest rate + * @return currentRate + **/ + @javax.annotation.Nullable + public String getCurrentRate() { + return currentRate; + } + + + public void setCurrentRate(String currentRate) { + this.currentRate = currentRate; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralCurrentRate collateralCurrentRate = (CollateralCurrentRate) o; + return Objects.equals(this.currency, collateralCurrentRate.currency) && + Objects.equals(this.currentRate, collateralCurrentRate.currentRate); + } + + @Override + public int hashCode() { + return Objects.hash(currency, currentRate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralCurrentRate {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" currentRate: ").append(toIndentedString(currentRate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralFixRate.java b/src/main/java/io/gate/gateapi/models/CollateralFixRate.java new file mode 100644 index 0000000..5dbf7e7 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralFixRate.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Multi-collateral fixed interest rate + */ +public class CollateralFixRate { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_RATE7D = "rate_7d"; + @SerializedName(SERIALIZED_NAME_RATE7D) + private String rate7d; + + public static final String SERIALIZED_NAME_RATE30D = "rate_30d"; + @SerializedName(SERIALIZED_NAME_RATE30D) + private String rate30d; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private Long updateTime; + + + public CollateralFixRate currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public CollateralFixRate rate7d(String rate7d) { + + this.rate7d = rate7d; + return this; + } + + /** + * Fixed interest rate for 7-day lending period + * @return rate7d + **/ + @javax.annotation.Nullable + public String getRate7d() { + return rate7d; + } + + + public void setRate7d(String rate7d) { + this.rate7d = rate7d; + } + + public CollateralFixRate rate30d(String rate30d) { + + this.rate30d = rate30d; + return this; + } + + /** + * Fixed interest rate for 30-day lending period + * @return rate30d + **/ + @javax.annotation.Nullable + public String getRate30d() { + return rate30d; + } + + + public void setRate30d(String rate30d) { + this.rate30d = rate30d; + } + + public CollateralFixRate updateTime(Long updateTime) { + + this.updateTime = updateTime; + return this; + } + + /** + * Update time, timestamp in seconds + * @return updateTime + **/ + @javax.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + + public void setUpdateTime(Long updateTime) { + this.updateTime = updateTime; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralFixRate collateralFixRate = (CollateralFixRate) o; + return Objects.equals(this.currency, collateralFixRate.currency) && + Objects.equals(this.rate7d, collateralFixRate.rate7d) && + Objects.equals(this.rate30d, collateralFixRate.rate30d) && + Objects.equals(this.updateTime, collateralFixRate.updateTime); + } + + @Override + public int hashCode() { + return Objects.hash(currency, rate7d, rate30d, updateTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralFixRate {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" rate7d: ").append(toIndentedString(rate7d)).append("\n"); + sb.append(" rate30d: ").append(toIndentedString(rate30d)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralLoanCurrency.java b/src/main/java/io/gate/gateapi/models/CollateralLoanCurrency.java new file mode 100644 index 0000000..19b216d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralLoanCurrency.java @@ -0,0 +1,125 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Supported borrowing and collateral currencies + */ +public class CollateralLoanCurrency { + public static final String SERIALIZED_NAME_LOAN_CURRENCY = "loan_currency"; + @SerializedName(SERIALIZED_NAME_LOAN_CURRENCY) + private String loanCurrency; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCY = "collateral_currency"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCY) + private List collateralCurrency = null; + + + public CollateralLoanCurrency loanCurrency(String loanCurrency) { + + this.loanCurrency = loanCurrency; + return this; + } + + /** + * Borrowed currency + * @return loanCurrency + **/ + @javax.annotation.Nullable + public String getLoanCurrency() { + return loanCurrency; + } + + + public void setLoanCurrency(String loanCurrency) { + this.loanCurrency = loanCurrency; + } + + public CollateralLoanCurrency collateralCurrency(List collateralCurrency) { + + this.collateralCurrency = collateralCurrency; + return this; + } + + public CollateralLoanCurrency addCollateralCurrencyItem(String collateralCurrencyItem) { + if (this.collateralCurrency == null) { + this.collateralCurrency = new ArrayList<>(); + } + this.collateralCurrency.add(collateralCurrencyItem); + return this; + } + + /** + * List of supported collateral currencies + * @return collateralCurrency + **/ + @javax.annotation.Nullable + public List getCollateralCurrency() { + return collateralCurrency; + } + + + public void setCollateralCurrency(List collateralCurrency) { + this.collateralCurrency = collateralCurrency; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralLoanCurrency collateralLoanCurrency = (CollateralLoanCurrency) o; + return Objects.equals(this.loanCurrency, collateralLoanCurrency.loanCurrency) && + Objects.equals(this.collateralCurrency, collateralLoanCurrency.collateralCurrency); + } + + @Override + public int hashCode() { + return Objects.hash(loanCurrency, collateralCurrency); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralLoanCurrency {\n"); + sb.append(" loanCurrency: ").append(toIndentedString(loanCurrency)).append("\n"); + sb.append(" collateralCurrency: ").append(toIndentedString(collateralCurrency)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralLtv.java b/src/main/java/io/gate/gateapi/models/CollateralLtv.java new file mode 100644 index 0000000..641342b --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralLtv.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Multi-collateral ratio + */ +public class CollateralLtv { + public static final String SERIALIZED_NAME_INIT_LTV = "init_ltv"; + @SerializedName(SERIALIZED_NAME_INIT_LTV) + private String initLtv; + + public static final String SERIALIZED_NAME_ALERT_LTV = "alert_ltv"; + @SerializedName(SERIALIZED_NAME_ALERT_LTV) + private String alertLtv; + + public static final String SERIALIZED_NAME_LIQUIDATE_LTV = "liquidate_ltv"; + @SerializedName(SERIALIZED_NAME_LIQUIDATE_LTV) + private String liquidateLtv; + + + public CollateralLtv initLtv(String initLtv) { + + this.initLtv = initLtv; + return this; + } + + /** + * Initial collateralization rate + * @return initLtv + **/ + @javax.annotation.Nullable + public String getInitLtv() { + return initLtv; + } + + + public void setInitLtv(String initLtv) { + this.initLtv = initLtv; + } + + public CollateralLtv alertLtv(String alertLtv) { + + this.alertLtv = alertLtv; + return this; + } + + /** + * Warning collateralization rate + * @return alertLtv + **/ + @javax.annotation.Nullable + public String getAlertLtv() { + return alertLtv; + } + + + public void setAlertLtv(String alertLtv) { + this.alertLtv = alertLtv; + } + + public CollateralLtv liquidateLtv(String liquidateLtv) { + + this.liquidateLtv = liquidateLtv; + return this; + } + + /** + * Liquidation collateralization rate + * @return liquidateLtv + **/ + @javax.annotation.Nullable + public String getLiquidateLtv() { + return liquidateLtv; + } + + + public void setLiquidateLtv(String liquidateLtv) { + this.liquidateLtv = liquidateLtv; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralLtv collateralLtv = (CollateralLtv) o; + return Objects.equals(this.initLtv, collateralLtv.initLtv) && + Objects.equals(this.alertLtv, collateralLtv.alertLtv) && + Objects.equals(this.liquidateLtv, collateralLtv.liquidateLtv); + } + + @Override + public int hashCode() { + return Objects.hash(initLtv, alertLtv, liquidateLtv); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralLtv {\n"); + sb.append(" initLtv: ").append(toIndentedString(initLtv)).append("\n"); + sb.append(" alertLtv: ").append(toIndentedString(alertLtv)).append("\n"); + sb.append(" liquidateLtv: ").append(toIndentedString(liquidateLtv)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralOrder.java b/src/main/java/io/gate/gateapi/models/CollateralOrder.java new file mode 100644 index 0000000..f707431 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralOrder.java @@ -0,0 +1,479 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Collateral order + */ +public class CollateralOrder { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCY = "collateral_currency"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCY) + private String collateralCurrency; + + public static final String SERIALIZED_NAME_COLLATERAL_AMOUNT = "collateral_amount"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_AMOUNT) + private String collateralAmount; + + public static final String SERIALIZED_NAME_BORROW_CURRENCY = "borrow_currency"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCY) + private String borrowCurrency; + + public static final String SERIALIZED_NAME_BORROW_AMOUNT = "borrow_amount"; + @SerializedName(SERIALIZED_NAME_BORROW_AMOUNT) + private String borrowAmount; + + public static final String SERIALIZED_NAME_REPAID_AMOUNT = "repaid_amount"; + @SerializedName(SERIALIZED_NAME_REPAID_AMOUNT) + private String repaidAmount; + + public static final String SERIALIZED_NAME_REPAID_PRINCIPAL = "repaid_principal"; + @SerializedName(SERIALIZED_NAME_REPAID_PRINCIPAL) + private String repaidPrincipal; + + public static final String SERIALIZED_NAME_REPAID_INTEREST = "repaid_interest"; + @SerializedName(SERIALIZED_NAME_REPAID_INTEREST) + private String repaidInterest; + + public static final String SERIALIZED_NAME_INIT_LTV = "init_ltv"; + @SerializedName(SERIALIZED_NAME_INIT_LTV) + private String initLtv; + + public static final String SERIALIZED_NAME_CURRENT_LTV = "current_ltv"; + @SerializedName(SERIALIZED_NAME_CURRENT_LTV) + private String currentLtv; + + public static final String SERIALIZED_NAME_LIQUIDATE_LTV = "liquidate_ltv"; + @SerializedName(SERIALIZED_NAME_LIQUIDATE_LTV) + private String liquidateLtv; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_BORROW_TIME = "borrow_time"; + @SerializedName(SERIALIZED_NAME_BORROW_TIME) + private Long borrowTime; + + public static final String SERIALIZED_NAME_LEFT_REPAY_TOTAL = "left_repay_total"; + @SerializedName(SERIALIZED_NAME_LEFT_REPAY_TOTAL) + private String leftRepayTotal; + + public static final String SERIALIZED_NAME_LEFT_REPAY_PRINCIPAL = "left_repay_principal"; + @SerializedName(SERIALIZED_NAME_LEFT_REPAY_PRINCIPAL) + private String leftRepayPrincipal; + + public static final String SERIALIZED_NAME_LEFT_REPAY_INTEREST = "left_repay_interest"; + @SerializedName(SERIALIZED_NAME_LEFT_REPAY_INTEREST) + private String leftRepayInterest; + + + public CollateralOrder orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public CollateralOrder collateralCurrency(String collateralCurrency) { + + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Collateral currency + * @return collateralCurrency + **/ + @javax.annotation.Nullable + public String getCollateralCurrency() { + return collateralCurrency; + } + + + public void setCollateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + } + + public CollateralOrder collateralAmount(String collateralAmount) { + + this.collateralAmount = collateralAmount; + return this; + } + + /** + * Collateral amount + * @return collateralAmount + **/ + @javax.annotation.Nullable + public String getCollateralAmount() { + return collateralAmount; + } + + + public void setCollateralAmount(String collateralAmount) { + this.collateralAmount = collateralAmount; + } + + public CollateralOrder borrowCurrency(String borrowCurrency) { + + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Borrowed currency + * @return borrowCurrency + **/ + @javax.annotation.Nullable + public String getBorrowCurrency() { + return borrowCurrency; + } + + + public void setBorrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + } + + public CollateralOrder borrowAmount(String borrowAmount) { + + this.borrowAmount = borrowAmount; + return this; + } + + /** + * Borrowed amount + * @return borrowAmount + **/ + @javax.annotation.Nullable + public String getBorrowAmount() { + return borrowAmount; + } + + + public void setBorrowAmount(String borrowAmount) { + this.borrowAmount = borrowAmount; + } + + public CollateralOrder repaidAmount(String repaidAmount) { + + this.repaidAmount = repaidAmount; + return this; + } + + /** + * Repaid amount + * @return repaidAmount + **/ + @javax.annotation.Nullable + public String getRepaidAmount() { + return repaidAmount; + } + + + public void setRepaidAmount(String repaidAmount) { + this.repaidAmount = repaidAmount; + } + + public CollateralOrder repaidPrincipal(String repaidPrincipal) { + + this.repaidPrincipal = repaidPrincipal; + return this; + } + + /** + * Repaid principal + * @return repaidPrincipal + **/ + @javax.annotation.Nullable + public String getRepaidPrincipal() { + return repaidPrincipal; + } + + + public void setRepaidPrincipal(String repaidPrincipal) { + this.repaidPrincipal = repaidPrincipal; + } + + public CollateralOrder repaidInterest(String repaidInterest) { + + this.repaidInterest = repaidInterest; + return this; + } + + /** + * Repaid interest + * @return repaidInterest + **/ + @javax.annotation.Nullable + public String getRepaidInterest() { + return repaidInterest; + } + + + public void setRepaidInterest(String repaidInterest) { + this.repaidInterest = repaidInterest; + } + + public CollateralOrder initLtv(String initLtv) { + + this.initLtv = initLtv; + return this; + } + + /** + * Initial collateralization rate + * @return initLtv + **/ + @javax.annotation.Nullable + public String getInitLtv() { + return initLtv; + } + + + public void setInitLtv(String initLtv) { + this.initLtv = initLtv; + } + + public CollateralOrder currentLtv(String currentLtv) { + + this.currentLtv = currentLtv; + return this; + } + + /** + * Current collateralization rate + * @return currentLtv + **/ + @javax.annotation.Nullable + public String getCurrentLtv() { + return currentLtv; + } + + + public void setCurrentLtv(String currentLtv) { + this.currentLtv = currentLtv; + } + + public CollateralOrder liquidateLtv(String liquidateLtv) { + + this.liquidateLtv = liquidateLtv; + return this; + } + + /** + * Liquidation collateralization rate + * @return liquidateLtv + **/ + @javax.annotation.Nullable + public String getLiquidateLtv() { + return liquidateLtv; + } + + + public void setLiquidateLtv(String liquidateLtv) { + this.liquidateLtv = liquidateLtv; + } + + public CollateralOrder status(String status) { + + this.status = status; + return this; + } + + /** + * 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 + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + public CollateralOrder borrowTime(Long borrowTime) { + + this.borrowTime = borrowTime; + return this; + } + + /** + * Borrowing time, timestamp in seconds + * @return borrowTime + **/ + @javax.annotation.Nullable + public Long getBorrowTime() { + return borrowTime; + } + + + public void setBorrowTime(Long borrowTime) { + this.borrowTime = borrowTime; + } + + public CollateralOrder leftRepayTotal(String leftRepayTotal) { + + this.leftRepayTotal = leftRepayTotal; + return this; + } + + /** + * Outstanding principal and interest (outstanding principal + outstanding interest) + * @return leftRepayTotal + **/ + @javax.annotation.Nullable + public String getLeftRepayTotal() { + return leftRepayTotal; + } + + + public void setLeftRepayTotal(String leftRepayTotal) { + this.leftRepayTotal = leftRepayTotal; + } + + public CollateralOrder leftRepayPrincipal(String leftRepayPrincipal) { + + this.leftRepayPrincipal = leftRepayPrincipal; + return this; + } + + /** + * Outstanding principal + * @return leftRepayPrincipal + **/ + @javax.annotation.Nullable + public String getLeftRepayPrincipal() { + return leftRepayPrincipal; + } + + + public void setLeftRepayPrincipal(String leftRepayPrincipal) { + this.leftRepayPrincipal = leftRepayPrincipal; + } + + public CollateralOrder leftRepayInterest(String leftRepayInterest) { + + this.leftRepayInterest = leftRepayInterest; + return this; + } + + /** + * Outstanding interest + * @return leftRepayInterest + **/ + @javax.annotation.Nullable + public String getLeftRepayInterest() { + return leftRepayInterest; + } + + + public void setLeftRepayInterest(String leftRepayInterest) { + this.leftRepayInterest = leftRepayInterest; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralOrder collateralOrder = (CollateralOrder) o; + return Objects.equals(this.orderId, collateralOrder.orderId) && + Objects.equals(this.collateralCurrency, collateralOrder.collateralCurrency) && + Objects.equals(this.collateralAmount, collateralOrder.collateralAmount) && + Objects.equals(this.borrowCurrency, collateralOrder.borrowCurrency) && + Objects.equals(this.borrowAmount, collateralOrder.borrowAmount) && + Objects.equals(this.repaidAmount, collateralOrder.repaidAmount) && + Objects.equals(this.repaidPrincipal, collateralOrder.repaidPrincipal) && + Objects.equals(this.repaidInterest, collateralOrder.repaidInterest) && + Objects.equals(this.initLtv, collateralOrder.initLtv) && + Objects.equals(this.currentLtv, collateralOrder.currentLtv) && + Objects.equals(this.liquidateLtv, collateralOrder.liquidateLtv) && + Objects.equals(this.status, collateralOrder.status) && + Objects.equals(this.borrowTime, collateralOrder.borrowTime) && + Objects.equals(this.leftRepayTotal, collateralOrder.leftRepayTotal) && + Objects.equals(this.leftRepayPrincipal, collateralOrder.leftRepayPrincipal) && + Objects.equals(this.leftRepayInterest, collateralOrder.leftRepayInterest); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, collateralCurrency, collateralAmount, borrowCurrency, borrowAmount, repaidAmount, repaidPrincipal, repaidInterest, initLtv, currentLtv, liquidateLtv, status, borrowTime, leftRepayTotal, leftRepayPrincipal, leftRepayInterest); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralOrder {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" collateralCurrency: ").append(toIndentedString(collateralCurrency)).append("\n"); + sb.append(" collateralAmount: ").append(toIndentedString(collateralAmount)).append("\n"); + sb.append(" borrowCurrency: ").append(toIndentedString(borrowCurrency)).append("\n"); + sb.append(" borrowAmount: ").append(toIndentedString(borrowAmount)).append("\n"); + sb.append(" repaidAmount: ").append(toIndentedString(repaidAmount)).append("\n"); + sb.append(" repaidPrincipal: ").append(toIndentedString(repaidPrincipal)).append("\n"); + sb.append(" repaidInterest: ").append(toIndentedString(repaidInterest)).append("\n"); + sb.append(" initLtv: ").append(toIndentedString(initLtv)).append("\n"); + sb.append(" currentLtv: ").append(toIndentedString(currentLtv)).append("\n"); + sb.append(" liquidateLtv: ").append(toIndentedString(liquidateLtv)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" borrowTime: ").append(toIndentedString(borrowTime)).append("\n"); + sb.append(" leftRepayTotal: ").append(toIndentedString(leftRepayTotal)).append("\n"); + sb.append(" leftRepayPrincipal: ").append(toIndentedString(leftRepayPrincipal)).append("\n"); + sb.append(" leftRepayInterest: ").append(toIndentedString(leftRepayInterest)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CollateralRecord.java b/src/main/java/io/gate/gateapi/models/CollateralRecord.java new file mode 100644 index 0000000..58d2288 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralRecord.java @@ -0,0 +1,323 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Collateral record + */ +public class CollateralRecord { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_RECORD_ID = "record_id"; + @SerializedName(SERIALIZED_NAME_RECORD_ID) + private Long recordId; + + public static final String SERIALIZED_NAME_BORROW_CURRENCY = "borrow_currency"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCY) + private String borrowCurrency; + + public static final String SERIALIZED_NAME_BORROW_AMOUNT = "borrow_amount"; + @SerializedName(SERIALIZED_NAME_BORROW_AMOUNT) + private String borrowAmount; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCY = "collateral_currency"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCY) + private String collateralCurrency; + + public static final String SERIALIZED_NAME_BEFORE_COLLATERAL = "before_collateral"; + @SerializedName(SERIALIZED_NAME_BEFORE_COLLATERAL) + private String beforeCollateral; + + public static final String SERIALIZED_NAME_AFTER_COLLATERAL = "after_collateral"; + @SerializedName(SERIALIZED_NAME_AFTER_COLLATERAL) + private String afterCollateral; + + public static final String SERIALIZED_NAME_BEFORE_LTV = "before_ltv"; + @SerializedName(SERIALIZED_NAME_BEFORE_LTV) + private String beforeLtv; + + public static final String SERIALIZED_NAME_AFTER_LTV = "after_ltv"; + @SerializedName(SERIALIZED_NAME_AFTER_LTV) + private String afterLtv; + + public static final String SERIALIZED_NAME_OPERATE_TIME = "operate_time"; + @SerializedName(SERIALIZED_NAME_OPERATE_TIME) + private Long operateTime; + + + public CollateralRecord orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public CollateralRecord recordId(Long recordId) { + + this.recordId = recordId; + return this; + } + + /** + * Collateral record ID + * @return recordId + **/ + @javax.annotation.Nullable + public Long getRecordId() { + return recordId; + } + + + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + public CollateralRecord borrowCurrency(String borrowCurrency) { + + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Borrowed currency + * @return borrowCurrency + **/ + @javax.annotation.Nullable + public String getBorrowCurrency() { + return borrowCurrency; + } + + + public void setBorrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + } + + public CollateralRecord borrowAmount(String borrowAmount) { + + this.borrowAmount = borrowAmount; + return this; + } + + /** + * Borrowed amount + * @return borrowAmount + **/ + @javax.annotation.Nullable + public String getBorrowAmount() { + return borrowAmount; + } + + + public void setBorrowAmount(String borrowAmount) { + this.borrowAmount = borrowAmount; + } + + public CollateralRecord collateralCurrency(String collateralCurrency) { + + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Collateral currency + * @return collateralCurrency + **/ + @javax.annotation.Nullable + public String getCollateralCurrency() { + return collateralCurrency; + } + + + public void setCollateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + } + + public CollateralRecord beforeCollateral(String beforeCollateral) { + + this.beforeCollateral = beforeCollateral; + return this; + } + + /** + * Collateral amount before adjustment + * @return beforeCollateral + **/ + @javax.annotation.Nullable + public String getBeforeCollateral() { + return beforeCollateral; + } + + + public void setBeforeCollateral(String beforeCollateral) { + this.beforeCollateral = beforeCollateral; + } + + public CollateralRecord afterCollateral(String afterCollateral) { + + this.afterCollateral = afterCollateral; + return this; + } + + /** + * Collateral amount after adjustment + * @return afterCollateral + **/ + @javax.annotation.Nullable + public String getAfterCollateral() { + return afterCollateral; + } + + + public void setAfterCollateral(String afterCollateral) { + this.afterCollateral = afterCollateral; + } + + public CollateralRecord beforeLtv(String beforeLtv) { + + this.beforeLtv = beforeLtv; + return this; + } + + /** + * Collateral ratio before adjustment + * @return beforeLtv + **/ + @javax.annotation.Nullable + public String getBeforeLtv() { + return beforeLtv; + } + + + public void setBeforeLtv(String beforeLtv) { + this.beforeLtv = beforeLtv; + } + + public CollateralRecord afterLtv(String afterLtv) { + + this.afterLtv = afterLtv; + return this; + } + + /** + * Collateral ratio after adjustment + * @return afterLtv + **/ + @javax.annotation.Nullable + public String getAfterLtv() { + return afterLtv; + } + + + public void setAfterLtv(String afterLtv) { + this.afterLtv = afterLtv; + } + + public CollateralRecord operateTime(Long operateTime) { + + this.operateTime = operateTime; + return this; + } + + /** + * Operation time, timestamp in seconds + * @return operateTime + **/ + @javax.annotation.Nullable + public Long getOperateTime() { + return operateTime; + } + + + public void setOperateTime(Long operateTime) { + this.operateTime = operateTime; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollateralRecord collateralRecord = (CollateralRecord) o; + return Objects.equals(this.orderId, collateralRecord.orderId) && + Objects.equals(this.recordId, collateralRecord.recordId) && + Objects.equals(this.borrowCurrency, collateralRecord.borrowCurrency) && + Objects.equals(this.borrowAmount, collateralRecord.borrowAmount) && + Objects.equals(this.collateralCurrency, collateralRecord.collateralCurrency) && + Objects.equals(this.beforeCollateral, collateralRecord.beforeCollateral) && + Objects.equals(this.afterCollateral, collateralRecord.afterCollateral) && + Objects.equals(this.beforeLtv, collateralRecord.beforeLtv) && + Objects.equals(this.afterLtv, collateralRecord.afterLtv) && + Objects.equals(this.operateTime, collateralRecord.operateTime); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, recordId, borrowCurrency, borrowAmount, collateralCurrency, beforeCollateral, afterCollateral, beforeLtv, afterLtv, operateTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralRecord {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" recordId: ").append(toIndentedString(recordId)).append("\n"); + sb.append(" borrowCurrency: ").append(toIndentedString(borrowCurrency)).append("\n"); + sb.append(" borrowAmount: ").append(toIndentedString(borrowAmount)).append("\n"); + sb.append(" collateralCurrency: ").append(toIndentedString(collateralCurrency)).append("\n"); + sb.append(" beforeCollateral: ").append(toIndentedString(beforeCollateral)).append("\n"); + sb.append(" afterCollateral: ").append(toIndentedString(afterCollateral)).append("\n"); + sb.append(" beforeLtv: ").append(toIndentedString(beforeLtv)).append("\n"); + sb.append(" afterLtv: ").append(toIndentedString(afterLtv)).append("\n"); + sb.append(" operateTime: ").append(toIndentedString(operateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/Contract.java b/src/main/java/io/gate/gateapi/models/Contract.java index 6d743c3..f61545c 100644 --- a/src/main/java/io/gate/gateapi/models/Contract.java +++ b/src/main/java/io/gate/gateapi/models/Contract.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 @@ -20,7 +20,7 @@ import java.io.IOException; /** - * 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 */ public class Contract { public static final String SERIALIZED_NAME_NAME = "name"; @@ -28,7 +28,7 @@ public class Contract { private String name; /** - * Futures contract type + * Contract type: inverse - inverse contract, direct - direct contract */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -95,7 +95,7 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { private String maintenanceRate; /** - * Mark price type, internal - based on internal trading, index - based on external index price + * Mark price type: internal - internal trading price, index - external index price */ @JsonAdapter(MarkTypeEnum.Adapter.class) public enum MarkTypeEnum { @@ -245,6 +245,38 @@ public MarkTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ORDERS_LIMIT) private Integer ordersLimit; + public static final String SERIALIZED_NAME_ENABLE_BONUS = "enable_bonus"; + @SerializedName(SERIALIZED_NAME_ENABLE_BONUS) + private Boolean enableBonus; + + public static final String SERIALIZED_NAME_ENABLE_CREDIT = "enable_credit"; + @SerializedName(SERIALIZED_NAME_ENABLE_CREDIT) + private Boolean enableCredit; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Double createTime; + + public static final String SERIALIZED_NAME_FUNDING_CAP_RATIO = "funding_cap_ratio"; + @SerializedName(SERIALIZED_NAME_FUNDING_CAP_RATIO) + private String fundingCapRatio; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_LAUNCH_TIME = "launch_time"; + @SerializedName(SERIALIZED_NAME_LAUNCH_TIME) + private Long launchTime; + + public static final String SERIALIZED_NAME_DELISTING_TIME = "delisting_time"; + @SerializedName(SERIALIZED_NAME_DELISTING_TIME) + private Long delistingTime; + + public static final String SERIALIZED_NAME_DELISTED_TIME = "delisted_time"; + @SerializedName(SERIALIZED_NAME_DELISTED_TIME) + private Long delistedTime; + public Contract name(String name) { @@ -273,7 +305,7 @@ public Contract type(TypeEnum type) { } /** - * Futures contract type + * Contract type: inverse - inverse contract, direct - direct contract * @return type **/ @javax.annotation.Nullable @@ -373,7 +405,7 @@ public Contract markType(MarkTypeEnum markType) { } /** - * Mark price type, internal - based on internal trading, index - based on external index price + * Mark price type: internal - internal trading price, index - external index price * @return markType **/ @javax.annotation.Nullable @@ -453,7 +485,7 @@ public Contract makerFeeRate(String makerFeeRate) { } /** - * Maker fee rate, where negative means rebate + * Maker fee rate, negative values indicate rebates * @return makerFeeRate **/ @javax.annotation.Nullable @@ -593,7 +625,7 @@ public Contract riskLimitBase(String riskLimitBase) { } /** - * Risk limit base + * Base risk limit (deprecated) * @return riskLimitBase **/ @javax.annotation.Nullable @@ -613,7 +645,7 @@ public Contract riskLimitStep(String riskLimitStep) { } /** - * Step of adjusting risk limit + * Risk limit adjustment step (deprecated) * @return riskLimitStep **/ @javax.annotation.Nullable @@ -633,7 +665,7 @@ public Contract riskLimitMax(String riskLimitMax) { } /** - * Maximum risk limit the contract allowed + * Maximum risk limit allowed by the contract (deprecated). It is recommended to use /futures/{settle}/risk_limit_tiers to query risk limits * @return riskLimitMax **/ @javax.annotation.Nullable @@ -653,7 +685,7 @@ public Contract orderSizeMin(Long orderSizeMin) { } /** - * Minimum order size the contract allowed + * Minimum order size allowed by the contract * @return orderSizeMin **/ @javax.annotation.Nullable @@ -673,7 +705,7 @@ public Contract orderSizeMax(Long orderSizeMax) { } /** - * Maximum order size the contract allowed + * Maximum order size allowed by the contract * @return orderSizeMax **/ @javax.annotation.Nullable @@ -693,7 +725,7 @@ public Contract orderPriceDeviate(String orderPriceDeviate) { } /** - * 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 + * 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 * @return orderPriceDeviate **/ @javax.annotation.Nullable @@ -713,7 +745,7 @@ public Contract refDiscountRate(String refDiscountRate) { } /** - * Referral fee rate discount + * Trading fee discount for referred users * @return refDiscountRate **/ @javax.annotation.Nullable @@ -733,7 +765,7 @@ public Contract refRebateRate(String refRebateRate) { } /** - * Referrer commission rate + * Commission rate for referrers * @return refRebateRate **/ @javax.annotation.Nullable @@ -753,7 +785,7 @@ public Contract orderbookId(Long orderbookId) { } /** - * Current orderbook ID + * Orderbook update ID * @return orderbookId **/ @javax.annotation.Nullable @@ -793,7 +825,7 @@ public Contract tradeSize(Long tradeSize) { } /** - * Historical accumulated trade size + * Historical cumulative trading volume * @return tradeSize **/ @javax.annotation.Nullable @@ -833,7 +865,7 @@ public Contract configChangeTime(Double configChangeTime) { } /** - * Last changed time of configuration + * Last configuration update time * @return configChangeTime **/ @javax.annotation.Nullable @@ -853,7 +885,7 @@ public Contract inDelisting(Boolean inDelisting) { } /** - * Contract is delisting + * `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 * @return inDelisting **/ @javax.annotation.Nullable @@ -873,7 +905,7 @@ public Contract ordersLimit(Integer ordersLimit) { } /** - * Maximum number of open orders + * Maximum number of pending orders * @return ordersLimit **/ @javax.annotation.Nullable @@ -885,6 +917,166 @@ public Integer getOrdersLimit() { public void setOrdersLimit(Integer ordersLimit) { this.ordersLimit = ordersLimit; } + + public Contract enableBonus(Boolean enableBonus) { + + this.enableBonus = enableBonus; + return this; + } + + /** + * Whether bonus is enabled + * @return enableBonus + **/ + @javax.annotation.Nullable + public Boolean getEnableBonus() { + return enableBonus; + } + + + public void setEnableBonus(Boolean enableBonus) { + this.enableBonus = enableBonus; + } + + public Contract enableCredit(Boolean enableCredit) { + + this.enableCredit = enableCredit; + return this; + } + + /** + * Whether portfolio margin account is enabled + * @return enableCredit + **/ + @javax.annotation.Nullable + public Boolean getEnableCredit() { + return enableCredit; + } + + + public void setEnableCredit(Boolean enableCredit) { + this.enableCredit = enableCredit; + } + + public Contract createTime(Double createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Created time of the contract + * @return createTime + **/ + @javax.annotation.Nullable + public Double getCreateTime() { + return createTime; + } + + + public void setCreateTime(Double createTime) { + this.createTime = createTime; + } + + public Contract fundingCapRatio(String fundingCapRatio) { + + this.fundingCapRatio = fundingCapRatio; + return this; + } + + /** + * The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio + * @return fundingCapRatio + **/ + @javax.annotation.Nullable + public String getFundingCapRatio() { + return fundingCapRatio; + } + + + public void setFundingCapRatio(String fundingCapRatio) { + this.fundingCapRatio = fundingCapRatio; + } + + public Contract status(String status) { + + this.status = status; + return this; + } + + /** + * Contract status types include: prelaunch (pre-launch), trading (active), delisting (delisting), delisted (delisted), circuit_breaker (circuit breaker) + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + public Contract launchTime(Long launchTime) { + + this.launchTime = launchTime; + return this; + } + + /** + * Contract expiry timestamp + * @return launchTime + **/ + @javax.annotation.Nullable + public Long getLaunchTime() { + return launchTime; + } + + + public void setLaunchTime(Long launchTime) { + this.launchTime = launchTime; + } + + public Contract delistingTime(Long delistingTime) { + + this.delistingTime = delistingTime; + return this; + } + + /** + * Timestamp when contract enters reduce-only state + * @return delistingTime + **/ + @javax.annotation.Nullable + public Long getDelistingTime() { + return delistingTime; + } + + + public void setDelistingTime(Long delistingTime) { + this.delistingTime = delistingTime; + } + + public Contract delistedTime(Long delistedTime) { + + this.delistedTime = delistedTime; + return this; + } + + /** + * Contract delisting time + * @return delistedTime + **/ + @javax.annotation.Nullable + public Long getDelistedTime() { + return delistedTime; + } + + + public void setDelistedTime(Long delistedTime) { + this.delistedTime = delistedTime; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -925,12 +1117,20 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.positionSize, contract.positionSize) && Objects.equals(this.configChangeTime, contract.configChangeTime) && Objects.equals(this.inDelisting, contract.inDelisting) && - Objects.equals(this.ordersLimit, contract.ordersLimit); + Objects.equals(this.ordersLimit, contract.ordersLimit) && + Objects.equals(this.enableBonus, contract.enableBonus) && + Objects.equals(this.enableCredit, contract.enableCredit) && + Objects.equals(this.createTime, contract.createTime) && + Objects.equals(this.fundingCapRatio, contract.fundingCapRatio) && + Objects.equals(this.status, contract.status) && + Objects.equals(this.launchTime, contract.launchTime) && + Objects.equals(this.delistingTime, contract.delistingTime) && + Objects.equals(this.delistedTime, contract.delistedTime); } @Override public int hashCode() { - return Objects.hash(name, type, quantoMultiplier, leverageMin, leverageMax, maintenanceRate, markType, markPrice, indexPrice, lastPrice, makerFeeRate, takerFeeRate, orderPriceRound, markPriceRound, fundingRate, fundingInterval, fundingNextApply, riskLimitBase, riskLimitStep, riskLimitMax, orderSizeMin, orderSizeMax, orderPriceDeviate, refDiscountRate, refRebateRate, orderbookId, tradeId, tradeSize, positionSize, configChangeTime, inDelisting, ordersLimit); + return Objects.hash(name, type, quantoMultiplier, leverageMin, leverageMax, maintenanceRate, markType, markPrice, indexPrice, lastPrice, makerFeeRate, takerFeeRate, orderPriceRound, markPriceRound, fundingRate, fundingInterval, fundingNextApply, riskLimitBase, riskLimitStep, riskLimitMax, orderSizeMin, orderSizeMax, orderPriceDeviate, refDiscountRate, refRebateRate, orderbookId, tradeId, tradeSize, positionSize, configChangeTime, inDelisting, ordersLimit, enableBonus, enableCredit, createTime, fundingCapRatio, status, launchTime, delistingTime, delistedTime); } @@ -970,6 +1170,14 @@ public String toString() { sb.append(" configChangeTime: ").append(toIndentedString(configChangeTime)).append("\n"); sb.append(" inDelisting: ").append(toIndentedString(inDelisting)).append("\n"); sb.append(" ordersLimit: ").append(toIndentedString(ordersLimit)).append("\n"); + sb.append(" enableBonus: ").append(toIndentedString(enableBonus)).append("\n"); + sb.append(" enableCredit: ").append(toIndentedString(enableCredit)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" fundingCapRatio: ").append(toIndentedString(fundingCapRatio)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" launchTime: ").append(toIndentedString(launchTime)).append("\n"); + sb.append(" delistingTime: ").append(toIndentedString(delistingTime)).append("\n"); + sb.append(" delistedTime: ").append(toIndentedString(delistedTime)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/ContractStat.java b/src/main/java/io/gate/gateapi/models/ContractStat.java index 837805c..2d948b9 100644 --- a/src/main/java/io/gate/gateapi/models/ContractStat.java +++ b/src/main/java/io/gate/gateapi/models/ContractStat.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 @@ -76,6 +76,10 @@ public class ContractStat { @SerializedName(SERIALIZED_NAME_TOP_LSR_SIZE) private Double topLsrSize; + public static final String SERIALIZED_NAME_MARK_PRICE = "mark_price"; + @SerializedName(SERIALIZED_NAME_MARK_PRICE) + private Double markPrice; + public ContractStat time(Long time) { @@ -104,7 +108,7 @@ public ContractStat lsrTaker(BigDecimal lsrTaker) { } /** - * Long/short account number ratio + * Long/short taker ratio * @return lsrTaker **/ @javax.annotation.Nullable @@ -124,7 +128,7 @@ public ContractStat lsrAccount(BigDecimal lsrAccount) { } /** - * Long/short taker size ratio + * Long/short position user ratio * @return lsrAccount **/ @javax.annotation.Nullable @@ -144,7 +148,7 @@ public ContractStat longLiqSize(Long longLiqSize) { } /** - * Long liquidation size + * Long liquidation size (contracts) * @return longLiqSize **/ @javax.annotation.Nullable @@ -164,7 +168,7 @@ public ContractStat longLiqAmount(Double longLiqAmount) { } /** - * Long liquidation amount(base currency) + * Long liquidation amount (base currency) * @return longLiqAmount **/ @javax.annotation.Nullable @@ -184,7 +188,7 @@ public ContractStat longLiqUsd(Double longLiqUsd) { } /** - * Long liquidation volume(quote currency) + * Long liquidation volume (quote currency) * @return longLiqUsd **/ @javax.annotation.Nullable @@ -204,7 +208,7 @@ public ContractStat shortLiqSize(Long shortLiqSize) { } /** - * Short liquidation size + * Short liquidation size (contracts) * @return shortLiqSize **/ @javax.annotation.Nullable @@ -224,7 +228,7 @@ public ContractStat shortLiqAmount(Double shortLiqAmount) { } /** - * Short liquidation amount(base currency) + * Short liquidation amount (base currency) * @return shortLiqAmount **/ @javax.annotation.Nullable @@ -244,7 +248,7 @@ public ContractStat shortLiqUsd(Double shortLiqUsd) { } /** - * Short liquidation volume(quote currency) + * Short liquidation volume (quote currency) * @return shortLiqUsd **/ @javax.annotation.Nullable @@ -264,7 +268,7 @@ public ContractStat openInterest(Long openInterest) { } /** - * Open interest size + * Total open interest size (contracts) * @return openInterest **/ @javax.annotation.Nullable @@ -284,7 +288,7 @@ public ContractStat openInterestUsd(Double openInterestUsd) { } /** - * Open interest volume(quote currency) + * Total open interest volume (quote currency) * @return openInterestUsd **/ @javax.annotation.Nullable @@ -336,6 +340,26 @@ public Double getTopLsrSize() { public void setTopLsrSize(Double topLsrSize) { this.topLsrSize = topLsrSize; } + + public ContractStat markPrice(Double markPrice) { + + this.markPrice = markPrice; + return this; + } + + /** + * Mark price + * @return markPrice + **/ + @javax.annotation.Nullable + public Double getMarkPrice() { + return markPrice; + } + + + public void setMarkPrice(Double markPrice) { + this.markPrice = markPrice; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -357,12 +381,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.openInterest, contractStat.openInterest) && Objects.equals(this.openInterestUsd, contractStat.openInterestUsd) && Objects.equals(this.topLsrAccount, contractStat.topLsrAccount) && - Objects.equals(this.topLsrSize, contractStat.topLsrSize); + Objects.equals(this.topLsrSize, contractStat.topLsrSize) && + Objects.equals(this.markPrice, contractStat.markPrice); } @Override public int hashCode() { - return Objects.hash(time, lsrTaker, lsrAccount, longLiqSize, longLiqAmount, longLiqUsd, shortLiqSize, shortLiqAmount, shortLiqUsd, openInterest, openInterestUsd, topLsrAccount, topLsrSize); + return Objects.hash(time, lsrTaker, lsrAccount, longLiqSize, longLiqAmount, longLiqUsd, shortLiqSize, shortLiqAmount, shortLiqUsd, openInterest, openInterestUsd, topLsrAccount, topLsrSize, markPrice); } @@ -383,6 +408,7 @@ public String toString() { sb.append(" openInterestUsd: ").append(toIndentedString(openInterestUsd)).append("\n"); sb.append(" topLsrAccount: ").append(toIndentedString(topLsrAccount)).append("\n"); sb.append(" topLsrSize: ").append(toIndentedString(topLsrSize)).append("\n"); + sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/ConvertSmallBalance.java b/src/main/java/io/gate/gateapi/models/ConvertSmallBalance.java new file mode 100644 index 0000000..5e85852 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/ConvertSmallBalance.java @@ -0,0 +1,125 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Small Balance Conversion + */ +public class ConvertSmallBalance { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private List currency = null; + + public static final String SERIALIZED_NAME_IS_ALL = "is_all"; + @SerializedName(SERIALIZED_NAME_IS_ALL) + private Boolean isAll; + + + public ConvertSmallBalance currency(List currency) { + + this.currency = currency; + return this; + } + + public ConvertSmallBalance addCurrencyItem(String currencyItem) { + if (this.currency == null) { + this.currency = new ArrayList<>(); + } + this.currency.add(currencyItem); + return this; + } + + /** + * Currency to be converted + * @return currency + **/ + @javax.annotation.Nullable + public List getCurrency() { + return currency; + } + + + public void setCurrency(List currency) { + this.currency = currency; + } + + public ConvertSmallBalance isAll(Boolean isAll) { + + this.isAll = isAll; + return this; + } + + /** + * Whether to convert all + * @return isAll + **/ + @javax.annotation.Nullable + public Boolean getIsAll() { + return isAll; + } + + + public void setIsAll(Boolean isAll) { + this.isAll = isAll; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConvertSmallBalance convertSmallBalance = (ConvertSmallBalance) o; + return Objects.equals(this.currency, convertSmallBalance.currency) && + Objects.equals(this.isAll, convertSmallBalance.isAll); + } + + @Override + public int hashCode() { + return Objects.hash(currency, isAll); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConvertSmallBalance {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" isAll: ").append(toIndentedString(isAll)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CountdownCancelAllFuturesTask.java b/src/main/java/io/gate/gateapi/models/CountdownCancelAllFuturesTask.java new file mode 100644 index 0000000..235f681 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CountdownCancelAllFuturesTask.java @@ -0,0 +1,114 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Countdown cancel task details + */ +public class CountdownCancelAllFuturesTask { + public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; + @SerializedName(SERIALIZED_NAME_TIMEOUT) + private Integer timeout; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + + public CountdownCancelAllFuturesTask timeout(Integer timeout) { + + this.timeout = timeout; + return this; + } + + /** + * Countdown time in seconds At least 5 seconds, 0 means cancel countdown + * @return timeout + **/ + public Integer getTimeout() { + return timeout; + } + + + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public CountdownCancelAllFuturesTask contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures contract + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountdownCancelAllFuturesTask countdownCancelAllFuturesTask = (CountdownCancelAllFuturesTask) o; + return Objects.equals(this.timeout, countdownCancelAllFuturesTask.timeout) && + Objects.equals(this.contract, countdownCancelAllFuturesTask.contract); + } + + @Override + public int hashCode() { + return Objects.hash(timeout, contract); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountdownCancelAllFuturesTask {\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CountdownCancelAllOptionsTask.java b/src/main/java/io/gate/gateapi/models/CountdownCancelAllOptionsTask.java new file mode 100644 index 0000000..978411e --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CountdownCancelAllOptionsTask.java @@ -0,0 +1,140 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Countdown cancel task details + */ +public class CountdownCancelAllOptionsTask { + public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; + @SerializedName(SERIALIZED_NAME_TIMEOUT) + private Integer timeout; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; + @SerializedName(SERIALIZED_NAME_UNDERLYING) + private String underlying; + + + public CountdownCancelAllOptionsTask timeout(Integer timeout) { + + this.timeout = timeout; + return this; + } + + /** + * Countdown time in seconds At least 5 seconds, 0 means cancel countdown + * @return timeout + **/ + public Integer getTimeout() { + return timeout; + } + + + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public CountdownCancelAllOptionsTask contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Options contract name + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public CountdownCancelAllOptionsTask underlying(String underlying) { + + this.underlying = underlying; + return this; + } + + /** + * Underlying + * @return underlying + **/ + @javax.annotation.Nullable + public String getUnderlying() { + return underlying; + } + + + public void setUnderlying(String underlying) { + this.underlying = underlying; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountdownCancelAllOptionsTask countdownCancelAllOptionsTask = (CountdownCancelAllOptionsTask) o; + return Objects.equals(this.timeout, countdownCancelAllOptionsTask.timeout) && + Objects.equals(this.contract, countdownCancelAllOptionsTask.contract) && + Objects.equals(this.underlying, countdownCancelAllOptionsTask.underlying); + } + + @Override + public int hashCode() { + return Objects.hash(timeout, contract, underlying); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountdownCancelAllOptionsTask {\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CountdownCancelAllSpotTask.java b/src/main/java/io/gate/gateapi/models/CountdownCancelAllSpotTask.java new file mode 100644 index 0000000..feb268e --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CountdownCancelAllSpotTask.java @@ -0,0 +1,114 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Countdown cancel task details + */ +public class CountdownCancelAllSpotTask { + public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; + @SerializedName(SERIALIZED_NAME_TIMEOUT) + private Integer timeout; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + + public CountdownCancelAllSpotTask timeout(Integer timeout) { + + this.timeout = timeout; + return this; + } + + /** + * Countdown time in seconds At least 5 seconds, 0 means cancel countdown + * @return timeout + **/ + public Integer getTimeout() { + return timeout; + } + + + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public CountdownCancelAllSpotTask currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountdownCancelAllSpotTask countdownCancelAllSpotTask = (CountdownCancelAllSpotTask) o; + return Objects.equals(this.timeout, countdownCancelAllSpotTask.timeout) && + Objects.equals(this.currencyPair, countdownCancelAllSpotTask.currencyPair); + } + + @Override + public int hashCode() { + return Objects.hash(timeout, currencyPair); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountdownCancelAllSpotTask {\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CreateCollateralOrder.java b/src/main/java/io/gate/gateapi/models/CreateCollateralOrder.java new file mode 100644 index 0000000..1535e79 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CreateCollateralOrder.java @@ -0,0 +1,163 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * CreateCollateralOrder + */ +public class CreateCollateralOrder { + public static final String SERIALIZED_NAME_COLLATERAL_AMOUNT = "collateral_amount"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_AMOUNT) + private String collateralAmount; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCY = "collateral_currency"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCY) + private String collateralCurrency; + + public static final String SERIALIZED_NAME_BORROW_AMOUNT = "borrow_amount"; + @SerializedName(SERIALIZED_NAME_BORROW_AMOUNT) + private String borrowAmount; + + public static final String SERIALIZED_NAME_BORROW_CURRENCY = "borrow_currency"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCY) + private String borrowCurrency; + + + public CreateCollateralOrder collateralAmount(String collateralAmount) { + + this.collateralAmount = collateralAmount; + return this; + } + + /** + * Collateral amount + * @return collateralAmount + **/ + public String getCollateralAmount() { + return collateralAmount; + } + + + public void setCollateralAmount(String collateralAmount) { + this.collateralAmount = collateralAmount; + } + + public CreateCollateralOrder collateralCurrency(String collateralCurrency) { + + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Collateral currency + * @return collateralCurrency + **/ + public String getCollateralCurrency() { + return collateralCurrency; + } + + + public void setCollateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + } + + public CreateCollateralOrder borrowAmount(String borrowAmount) { + + this.borrowAmount = borrowAmount; + return this; + } + + /** + * Borrowed amount + * @return borrowAmount + **/ + public String getBorrowAmount() { + return borrowAmount; + } + + + public void setBorrowAmount(String borrowAmount) { + this.borrowAmount = borrowAmount; + } + + public CreateCollateralOrder borrowCurrency(String borrowCurrency) { + + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Borrowed currency + * @return borrowCurrency + **/ + public String getBorrowCurrency() { + return borrowCurrency; + } + + + public void setBorrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCollateralOrder createCollateralOrder = (CreateCollateralOrder) o; + return Objects.equals(this.collateralAmount, createCollateralOrder.collateralAmount) && + Objects.equals(this.collateralCurrency, createCollateralOrder.collateralCurrency) && + Objects.equals(this.borrowAmount, createCollateralOrder.borrowAmount) && + Objects.equals(this.borrowCurrency, createCollateralOrder.borrowCurrency); + } + + @Override + public int hashCode() { + return Objects.hash(collateralAmount, collateralCurrency, borrowAmount, borrowCurrency); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCollateralOrder {\n"); + sb.append(" collateralAmount: ").append(toIndentedString(collateralAmount)).append("\n"); + sb.append(" collateralCurrency: ").append(toIndentedString(collateralCurrency)).append("\n"); + sb.append(" borrowAmount: ").append(toIndentedString(borrowAmount)).append("\n"); + sb.append(" borrowCurrency: ").append(toIndentedString(borrowCurrency)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CreateMultiCollateralOrder.java b/src/main/java/io/gate/gateapi/models/CreateMultiCollateralOrder.java new file mode 100644 index 0000000..724ad1d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CreateMultiCollateralOrder.java @@ -0,0 +1,306 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.CollateralCurrency; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * CreateMultiCollateralOrder + */ +public class CreateMultiCollateralOrder { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private String orderId; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "order_type"; + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + private String orderType; + + public static final String SERIALIZED_NAME_FIXED_TYPE = "fixed_type"; + @SerializedName(SERIALIZED_NAME_FIXED_TYPE) + private String fixedType; + + public static final String SERIALIZED_NAME_FIXED_RATE = "fixed_rate"; + @SerializedName(SERIALIZED_NAME_FIXED_RATE) + private String fixedRate; + + public static final String SERIALIZED_NAME_AUTO_RENEW = "auto_renew"; + @SerializedName(SERIALIZED_NAME_AUTO_RENEW) + private Boolean autoRenew; + + public static final String SERIALIZED_NAME_AUTO_REPAY = "auto_repay"; + @SerializedName(SERIALIZED_NAME_AUTO_REPAY) + private Boolean autoRepay; + + public static final String SERIALIZED_NAME_BORROW_CURRENCY = "borrow_currency"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCY) + private String borrowCurrency; + + public static final String SERIALIZED_NAME_BORROW_AMOUNT = "borrow_amount"; + @SerializedName(SERIALIZED_NAME_BORROW_AMOUNT) + private String borrowAmount; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCIES = "collateral_currencies"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCIES) + private List collateralCurrencies = null; + + + public CreateMultiCollateralOrder orderId(String orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public String getOrderId() { + return orderId; + } + + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public CreateMultiCollateralOrder orderType(String orderType) { + + this.orderType = orderType; + return this; + } + + /** + * current - current rate, fixed - fixed rate, defaults to current if not specified + * @return orderType + **/ + @javax.annotation.Nullable + public String getOrderType() { + return orderType; + } + + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public CreateMultiCollateralOrder fixedType(String fixedType) { + + this.fixedType = fixedType; + return this; + } + + /** + * Fixed interest rate lending period: 7d - 7 days, 30d - 30 days. Required for fixed rate + * @return fixedType + **/ + @javax.annotation.Nullable + public String getFixedType() { + return fixedType; + } + + + public void setFixedType(String fixedType) { + this.fixedType = fixedType; + } + + public CreateMultiCollateralOrder fixedRate(String fixedRate) { + + this.fixedRate = fixedRate; + return this; + } + + /** + * Fixed interest rate, required for fixed rate + * @return fixedRate + **/ + @javax.annotation.Nullable + public String getFixedRate() { + return fixedRate; + } + + + public void setFixedRate(String fixedRate) { + this.fixedRate = fixedRate; + } + + public CreateMultiCollateralOrder autoRenew(Boolean autoRenew) { + + this.autoRenew = autoRenew; + return this; + } + + /** + * Fixed interest rate, auto-renewal + * @return autoRenew + **/ + @javax.annotation.Nullable + public Boolean getAutoRenew() { + return autoRenew; + } + + + public void setAutoRenew(Boolean autoRenew) { + this.autoRenew = autoRenew; + } + + public CreateMultiCollateralOrder autoRepay(Boolean autoRepay) { + + this.autoRepay = autoRepay; + return this; + } + + /** + * Fixed interest rate, auto-repayment + * @return autoRepay + **/ + @javax.annotation.Nullable + public Boolean getAutoRepay() { + return autoRepay; + } + + + public void setAutoRepay(Boolean autoRepay) { + this.autoRepay = autoRepay; + } + + public CreateMultiCollateralOrder borrowCurrency(String borrowCurrency) { + + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Borrowed currency + * @return borrowCurrency + **/ + public String getBorrowCurrency() { + return borrowCurrency; + } + + + public void setBorrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + } + + public CreateMultiCollateralOrder borrowAmount(String borrowAmount) { + + this.borrowAmount = borrowAmount; + return this; + } + + /** + * Borrowed amount + * @return borrowAmount + **/ + public String getBorrowAmount() { + return borrowAmount; + } + + + public void setBorrowAmount(String borrowAmount) { + this.borrowAmount = borrowAmount; + } + + public CreateMultiCollateralOrder collateralCurrencies(List collateralCurrencies) { + + this.collateralCurrencies = collateralCurrencies; + return this; + } + + public CreateMultiCollateralOrder addCollateralCurrenciesItem(CollateralCurrency collateralCurrenciesItem) { + if (this.collateralCurrencies == null) { + this.collateralCurrencies = new ArrayList<>(); + } + this.collateralCurrencies.add(collateralCurrenciesItem); + return this; + } + + /** + * Collateral currency and amount + * @return collateralCurrencies + **/ + @javax.annotation.Nullable + public List getCollateralCurrencies() { + return collateralCurrencies; + } + + + public void setCollateralCurrencies(List collateralCurrencies) { + this.collateralCurrencies = collateralCurrencies; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMultiCollateralOrder createMultiCollateralOrder = (CreateMultiCollateralOrder) o; + return Objects.equals(this.orderId, createMultiCollateralOrder.orderId) && + Objects.equals(this.orderType, createMultiCollateralOrder.orderType) && + Objects.equals(this.fixedType, createMultiCollateralOrder.fixedType) && + Objects.equals(this.fixedRate, createMultiCollateralOrder.fixedRate) && + Objects.equals(this.autoRenew, createMultiCollateralOrder.autoRenew) && + Objects.equals(this.autoRepay, createMultiCollateralOrder.autoRepay) && + Objects.equals(this.borrowCurrency, createMultiCollateralOrder.borrowCurrency) && + Objects.equals(this.borrowAmount, createMultiCollateralOrder.borrowAmount) && + Objects.equals(this.collateralCurrencies, createMultiCollateralOrder.collateralCurrencies); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, orderType, fixedType, fixedRate, autoRenew, autoRepay, borrowCurrency, borrowAmount, collateralCurrencies); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateMultiCollateralOrder {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" fixedType: ").append(toIndentedString(fixedType)).append("\n"); + sb.append(" fixedRate: ").append(toIndentedString(fixedRate)).append("\n"); + sb.append(" autoRenew: ").append(toIndentedString(autoRenew)).append("\n"); + sb.append(" autoRepay: ").append(toIndentedString(autoRepay)).append("\n"); + sb.append(" borrowCurrency: ").append(toIndentedString(borrowCurrency)).append("\n"); + sb.append(" borrowAmount: ").append(toIndentedString(borrowAmount)).append("\n"); + sb.append(" collateralCurrencies: ").append(toIndentedString(collateralCurrencies)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CreateUniLend.java b/src/main/java/io/gate/gateapi/models/CreateUniLend.java new file mode 100644 index 0000000..73974c1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CreateUniLend.java @@ -0,0 +1,211 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Create lending or redemption + */ +public class CreateUniLend { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + /** + * Operation type: lend - Lend, redeem - Redeem + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + LEND("lend"), + + REDEEM("redeem"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_MIN_RATE = "min_rate"; + @SerializedName(SERIALIZED_NAME_MIN_RATE) + private String minRate; + + + public CreateUniLend currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public CreateUniLend amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Amount to deposit into lending pool + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public CreateUniLend type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Operation type: lend - Lend, redeem - Redeem + * @return type + **/ + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + public CreateUniLend minRate(String minRate) { + + this.minRate = minRate; + return this; + } + + /** + * Minimum interest rate. If set too high, lending may fail and no interest will be earned. Required for lending operations. + * @return minRate + **/ + @javax.annotation.Nullable + public String getMinRate() { + return minRate; + } + + + public void setMinRate(String minRate) { + this.minRate = minRate; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUniLend createUniLend = (CreateUniLend) o; + return Objects.equals(this.currency, createUniLend.currency) && + Objects.equals(this.amount, createUniLend.amount) && + Objects.equals(this.type, createUniLend.type) && + Objects.equals(this.minRate, createUniLend.minRate); + } + + @Override + public int hashCode() { + return Objects.hash(currency, amount, type, minRate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUniLend {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" minRate: ").append(toIndentedString(minRate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayRequest.java b/src/main/java/io/gate/gateapi/models/CreateUniLoan.java similarity index 57% rename from src/main/java/io/gate/gateapi/models/RepayRequest.java rename to src/main/java/io/gate/gateapi/models/CreateUniLoan.java index 8c83520..f11bf67 100644 --- a/src/main/java/io/gate/gateapi/models/RepayRequest.java +++ b/src/main/java/io/gate/gateapi/models/CreateUniLoan.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 @@ -20,29 +20,25 @@ import java.io.IOException; /** - * RepayRequest + * Borrow or repay */ -public class RepayRequest { - public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; - @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) - private String currencyPair; - +public class CreateUniLoan { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; /** - * Repay mode. all - repay all; partial - repay only some portion + * Type: `borrow` - borrow, `repay` - repay */ - @JsonAdapter(ModeEnum.Adapter.class) - public enum ModeEnum { - ALL("all"), + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BORROW("borrow"), - PARTIAL("partial"); + REPAY("repay"); private String value; - ModeEnum(String value) { + TypeEnum(String value) { this.value = value; } @@ -55,8 +51,8 @@ public String toString() { return String.valueOf(value); } - public static ModeEnum fromValue(String value) { - for (ModeEnum b : ModeEnum.values()) { + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } @@ -64,56 +60,45 @@ public static ModeEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final ModeEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public ModeEnum read(final JsonReader jsonReader) throws IOException { + public TypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return ModeEnum.fromValue(value); + return TypeEnum.fromValue(value); } } } - public static final String SERIALIZED_NAME_MODE = "mode"; - @SerializedName(SERIALIZED_NAME_MODE) - private ModeEnum mode; + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; public static final String SERIALIZED_NAME_AMOUNT = "amount"; @SerializedName(SERIALIZED_NAME_AMOUNT) private String amount; + public static final String SERIALIZED_NAME_REPAID_ALL = "repaid_all"; + @SerializedName(SERIALIZED_NAME_REPAID_ALL) + private Boolean repaidAll; - public RepayRequest currencyPair(String currencyPair) { - - this.currencyPair = currencyPair; - return this; - } - - /** - * Currency pair - * @return currencyPair - **/ - public String getCurrencyPair() { - return currencyPair; - } - + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; - public void setCurrencyPair(String currencyPair) { - this.currencyPair = currencyPair; - } - public RepayRequest currency(String currency) { + public CreateUniLoan currency(String currency) { this.currency = currency; return this; } /** - * Loan currency + * Currency * @return currency **/ public String getCurrency() { @@ -125,36 +110,35 @@ public void setCurrency(String currency) { this.currency = currency; } - public RepayRequest mode(ModeEnum mode) { + public CreateUniLoan type(TypeEnum type) { - this.mode = mode; + this.type = type; return this; } /** - * Repay mode. all - repay all; partial - repay only some portion - * @return mode + * Type: `borrow` - borrow, `repay` - repay + * @return type **/ - public ModeEnum getMode() { - return mode; + public TypeEnum getType() { + return type; } - public void setMode(ModeEnum mode) { - this.mode = mode; + public void setType(TypeEnum type) { + this.type = type; } - public RepayRequest amount(String amount) { + public CreateUniLoan amount(String amount) { this.amount = amount; return this; } /** - * Repay amount. Required in `partial` mode + * Borrow or repayment amount * @return amount **/ - @javax.annotation.Nullable public String getAmount() { return amount; } @@ -163,6 +147,45 @@ public String getAmount() { public void setAmount(String amount) { this.amount = amount; } + + public CreateUniLoan repaidAll(Boolean repaidAll) { + + this.repaidAll = repaidAll; + return this; + } + + /** + * Full repayment. For repayment operations only. When `true`, overrides `amount` and repays the full amount + * @return repaidAll + **/ + @javax.annotation.Nullable + public Boolean getRepaidAll() { + return repaidAll; + } + + + public void setRepaidAll(Boolean repaidAll) { + this.repaidAll = repaidAll; + } + + public CreateUniLoan currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -171,27 +194,29 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - RepayRequest repayRequest = (RepayRequest) o; - return Objects.equals(this.currencyPair, repayRequest.currencyPair) && - Objects.equals(this.currency, repayRequest.currency) && - Objects.equals(this.mode, repayRequest.mode) && - Objects.equals(this.amount, repayRequest.amount); + CreateUniLoan createUniLoan = (CreateUniLoan) o; + return Objects.equals(this.currency, createUniLoan.currency) && + Objects.equals(this.type, createUniLoan.type) && + Objects.equals(this.amount, createUniLoan.amount) && + Objects.equals(this.repaidAll, createUniLoan.repaidAll) && + Objects.equals(this.currencyPair, createUniLoan.currencyPair); } @Override public int hashCode() { - return Objects.hash(currencyPair, currency, mode, amount); + return Objects.hash(currency, type, amount, repaidAll, currencyPair); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class RepayRequest {\n"); - sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append("class CreateUniLoan {\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" repaidAll: ").append(toIndentedString(repaidAll)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginAccount.java b/src/main/java/io/gate/gateapi/models/CrossMarginAccount.java deleted file mode 100644 index b205b1f..0000000 --- a/src/main/java/io/gate/gateapi/models/CrossMarginAccount.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * 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. - * - * 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.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.gate.gateapi.models.CrossMarginBalance; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * CrossMarginAccount - */ -public class CrossMarginAccount { - public static final String SERIALIZED_NAME_USER_ID = "user_id"; - @SerializedName(SERIALIZED_NAME_USER_ID) - private Long userId; - - public static final String SERIALIZED_NAME_LOCKED = "locked"; - @SerializedName(SERIALIZED_NAME_LOCKED) - private Boolean locked; - - public static final String SERIALIZED_NAME_BALANCES = "balances"; - @SerializedName(SERIALIZED_NAME_BALANCES) - private Map balances = null; - - public static final String SERIALIZED_NAME_TOTAL = "total"; - @SerializedName(SERIALIZED_NAME_TOTAL) - private String total; - - public static final String SERIALIZED_NAME_BORROWED = "borrowed"; - @SerializedName(SERIALIZED_NAME_BORROWED) - private String borrowed; - - public static final String SERIALIZED_NAME_INTEREST = "interest"; - @SerializedName(SERIALIZED_NAME_INTEREST) - private String interest; - - public static final String SERIALIZED_NAME_RISK = "risk"; - @SerializedName(SERIALIZED_NAME_RISK) - private String risk; - - - public CrossMarginAccount userId(Long userId) { - - this.userId = userId; - return this; - } - - /** - * User ID - * @return userId - **/ - @javax.annotation.Nullable - public Long getUserId() { - return userId; - } - - - public void setUserId(Long userId) { - this.userId = userId; - } - - public CrossMarginAccount locked(Boolean locked) { - - this.locked = locked; - return this; - } - - /** - * Whether account is locked - * @return locked - **/ - @javax.annotation.Nullable - public Boolean getLocked() { - return locked; - } - - - public void setLocked(Boolean locked) { - this.locked = locked; - } - - public CrossMarginAccount balances(Map balances) { - - this.balances = balances; - return this; - } - - public CrossMarginAccount putBalancesItem(String key, CrossMarginBalance balancesItem) { - if (this.balances == null) { - this.balances = new HashMap<>(); - } - this.balances.put(key, balancesItem); - return this; - } - - /** - * Get balances - * @return balances - **/ - @javax.annotation.Nullable - public Map getBalances() { - return balances; - } - - - public void setBalances(Map balances) { - this.balances = balances; - } - - public CrossMarginAccount total(String total) { - - this.total = total; - return this; - } - - /** - * Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` - * @return total - **/ - @javax.annotation.Nullable - public String getTotal() { - return total; - } - - - public void setTotal(String total) { - this.total = total; - } - - public CrossMarginAccount borrowed(String borrowed) { - - this.borrowed = borrowed; - return this; - } - - /** - * Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` - * @return borrowed - **/ - @javax.annotation.Nullable - public String getBorrowed() { - return borrowed; - } - - - public void setBorrowed(String borrowed) { - this.borrowed = borrowed; - } - - public CrossMarginAccount interest(String interest) { - - this.interest = interest; - return this; - } - - /** - * Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` - * @return interest - **/ - @javax.annotation.Nullable - public String getInterest() { - return interest; - } - - - public void setInterest(String interest) { - this.interest = interest; - } - - public CrossMarginAccount risk(String risk) { - - this.risk = risk; - return this; - } - - /** - * Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` - * @return risk - **/ - @javax.annotation.Nullable - public String getRisk() { - return risk; - } - - - public void setRisk(String risk) { - this.risk = risk; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CrossMarginAccount crossMarginAccount = (CrossMarginAccount) o; - return Objects.equals(this.userId, crossMarginAccount.userId) && - Objects.equals(this.locked, crossMarginAccount.locked) && - Objects.equals(this.balances, crossMarginAccount.balances) && - Objects.equals(this.total, crossMarginAccount.total) && - Objects.equals(this.borrowed, crossMarginAccount.borrowed) && - Objects.equals(this.interest, crossMarginAccount.interest) && - Objects.equals(this.risk, crossMarginAccount.risk); - } - - @Override - public int hashCode() { - return Objects.hash(userId, locked, balances, total, borrowed, interest, risk); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginAccount {\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); - sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); - sb.append(" total: ").append(toIndentedString(total)).append("\n"); - sb.append(" borrowed: ").append(toIndentedString(borrowed)).append("\n"); - sb.append(" interest: ").append(toIndentedString(interest)).append("\n"); - sb.append(" risk: ").append(toIndentedString(risk)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginBalance.java b/src/main/java/io/gate/gateapi/models/CrossMarginBalance.java index 23d4ab2..e98877f 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginBalance.java +++ b/src/main/java/io/gate/gateapi/models/CrossMarginBalance.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 @@ -47,7 +47,7 @@ public CrossMarginBalance available(String available) { } /** - * Available amount + * Available balance * @return available **/ @javax.annotation.Nullable @@ -67,7 +67,7 @@ public CrossMarginBalance freeze(String freeze) { } /** - * Locked amount + * Locked balance * @return freeze **/ @javax.annotation.Nullable @@ -87,7 +87,7 @@ public CrossMarginBalance borrowed(String borrowed) { } /** - * Borrowed amount + * Borrowed balance * @return borrowed **/ @javax.annotation.Nullable @@ -107,7 +107,7 @@ public CrossMarginBalance interest(String interest) { } /** - * Unpaid interests + * Unpaid interest * @return interest **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginLoan.java b/src/main/java/io/gate/gateapi/models/CrossMarginLoan.java index 08c7d9a..cb2862d 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginLoan.java +++ b/src/main/java/io/gate/gateapi/models/CrossMarginLoan.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 @@ -48,7 +48,7 @@ public class CrossMarginLoan { private String text; /** - * Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete + * 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 */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { @@ -114,7 +114,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { /** - * Borrow loan ID + * Loan record ID * @return id **/ @javax.annotation.Nullable @@ -202,7 +202,7 @@ public void setText(String text) { } /** - * Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete + * 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 * @return status **/ @javax.annotation.Nullable @@ -232,7 +232,7 @@ public String getRepaidInterest() { /** - * Outstanding interest yet to be paid + * Unpaid interest * @return unpaidInterest **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginRepayment.java b/src/main/java/io/gate/gateapi/models/CrossMarginRepayment.java index f9083c1..8a390af 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginRepayment.java +++ b/src/main/java/io/gate/gateapi/models/CrossMarginRepayment.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 @@ -47,6 +47,10 @@ public class CrossMarginRepayment { @SerializedName(SERIALIZED_NAME_INTEREST) private String interest; + public static final String SERIALIZED_NAME_REPAYMENT_TYPE = "repayment_type"; + @SerializedName(SERIALIZED_NAME_REPAYMENT_TYPE) + private String repaymentType; + public CrossMarginRepayment id(String id) { @@ -95,7 +99,7 @@ public CrossMarginRepayment loanId(String loanId) { } /** - * Borrow loan ID + * Loan record ID * @return loanId **/ @javax.annotation.Nullable @@ -167,6 +171,16 @@ public String getInterest() { public void setInterest(String interest) { this.interest = interest; } + + /** + * Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment after cancellation + * @return repaymentType + **/ + @javax.annotation.Nullable + public String getRepaymentType() { + return repaymentType; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,12 +195,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.loanId, crossMarginRepayment.loanId) && Objects.equals(this.currency, crossMarginRepayment.currency) && Objects.equals(this.principal, crossMarginRepayment.principal) && - Objects.equals(this.interest, crossMarginRepayment.interest); + Objects.equals(this.interest, crossMarginRepayment.interest) && + Objects.equals(this.repaymentType, crossMarginRepayment.repaymentType); } @Override public int hashCode() { - return Objects.hash(id, createTime, loanId, currency, principal, interest); + return Objects.hash(id, createTime, loanId, currency, principal, interest, repaymentType); } @@ -200,6 +215,7 @@ public String toString() { sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" principal: ").append(toIndentedString(principal)).append("\n"); sb.append(" interest: ").append(toIndentedString(interest)).append("\n"); + sb.append(" repaymentType: ").append(toIndentedString(repaymentType)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/Currency.java b/src/main/java/io/gate/gateapi/models/Currency.java index d46bdfe..89b2eda 100644 --- a/src/main/java/io/gate/gateapi/models/Currency.java +++ b/src/main/java/io/gate/gateapi/models/Currency.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 @@ -17,7 +17,10 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.SpotCurrencyChain; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; /** * Currency @@ -27,6 +30,10 @@ public class Currency { @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + public static final String SERIALIZED_NAME_DELISTED = "delisted"; @SerializedName(SERIALIZED_NAME_DELISTED) private Boolean delisted; @@ -47,6 +54,18 @@ public class Currency { @SerializedName(SERIALIZED_NAME_TRADE_DISABLED) private Boolean tradeDisabled; + public static final String SERIALIZED_NAME_FIXED_RATE = "fixed_rate"; + @SerializedName(SERIALIZED_NAME_FIXED_RATE) + private String fixedRate; + + public static final String SERIALIZED_NAME_CHAIN = "chain"; + @SerializedName(SERIALIZED_NAME_CHAIN) + private String chain; + + public static final String SERIALIZED_NAME_CHAINS = "chains"; + @SerializedName(SERIALIZED_NAME_CHAINS) + private List chains = null; + public Currency currency(String currency) { @@ -55,7 +74,7 @@ public Currency currency(String currency) { } /** - * Currency name + * Currency symbol * @return currency **/ @javax.annotation.Nullable @@ -68,6 +87,26 @@ public void setCurrency(String currency) { this.currency = currency; } + public Currency name(String name) { + + this.name = name; + return this; + } + + /** + * Currency name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + public Currency delisted(Boolean delisted) { this.delisted = delisted; @@ -95,7 +134,7 @@ public Currency withdrawDisabled(Boolean withdrawDisabled) { } /** - * Whether currency's withdrawal is disabled + * Whether currency's withdrawal is disabled (deprecated) * @return withdrawDisabled **/ @javax.annotation.Nullable @@ -115,7 +154,7 @@ public Currency withdrawDelayed(Boolean withdrawDelayed) { } /** - * Whether currency's withdrawal is delayed + * Whether currency's withdrawal is delayed (deprecated) * @return withdrawDelayed **/ @javax.annotation.Nullable @@ -135,7 +174,7 @@ public Currency depositDisabled(Boolean depositDisabled) { } /** - * Whether currency's deposit is disabled + * Whether currency's deposit is disabled (deprecated) * @return depositDisabled **/ @javax.annotation.Nullable @@ -167,6 +206,74 @@ public Boolean getTradeDisabled() { public void setTradeDisabled(Boolean tradeDisabled) { this.tradeDisabled = tradeDisabled; } + + public Currency fixedRate(String fixedRate) { + + this.fixedRate = fixedRate; + return this; + } + + /** + * Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies + * @return fixedRate + **/ + @javax.annotation.Nullable + public String getFixedRate() { + return fixedRate; + } + + + public void setFixedRate(String fixedRate) { + this.fixedRate = fixedRate; + } + + public Currency chain(String chain) { + + this.chain = chain; + return this; + } + + /** + * The main chain corresponding to the coin + * @return chain + **/ + @javax.annotation.Nullable + public String getChain() { + return chain; + } + + + public void setChain(String chain) { + this.chain = chain; + } + + public Currency chains(List chains) { + + this.chains = chains; + return this; + } + + public Currency addChainsItem(SpotCurrencyChain chainsItem) { + if (this.chains == null) { + this.chains = new ArrayList<>(); + } + this.chains.add(chainsItem); + return this; + } + + /** + * All links corresponding to coins + * @return chains + **/ + @javax.annotation.Nullable + public List getChains() { + return chains; + } + + + public void setChains(List chains) { + this.chains = chains; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -177,16 +284,20 @@ public boolean equals(java.lang.Object o) { } Currency currency = (Currency) o; return Objects.equals(this.currency, currency.currency) && + Objects.equals(this.name, currency.name) && Objects.equals(this.delisted, currency.delisted) && Objects.equals(this.withdrawDisabled, currency.withdrawDisabled) && Objects.equals(this.withdrawDelayed, currency.withdrawDelayed) && Objects.equals(this.depositDisabled, currency.depositDisabled) && - Objects.equals(this.tradeDisabled, currency.tradeDisabled); + Objects.equals(this.tradeDisabled, currency.tradeDisabled) && + Objects.equals(this.fixedRate, currency.fixedRate) && + Objects.equals(this.chain, currency.chain) && + Objects.equals(this.chains, currency.chains); } @Override public int hashCode() { - return Objects.hash(currency, delisted, withdrawDisabled, withdrawDelayed, depositDisabled, tradeDisabled); + return Objects.hash(currency, name, delisted, withdrawDisabled, withdrawDelayed, depositDisabled, tradeDisabled, fixedRate, chain, chains); } @@ -195,11 +306,15 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Currency {\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" delisted: ").append(toIndentedString(delisted)).append("\n"); sb.append(" withdrawDisabled: ").append(toIndentedString(withdrawDisabled)).append("\n"); sb.append(" withdrawDelayed: ").append(toIndentedString(withdrawDelayed)).append("\n"); sb.append(" depositDisabled: ").append(toIndentedString(depositDisabled)).append("\n"); sb.append(" tradeDisabled: ").append(toIndentedString(tradeDisabled)).append("\n"); + sb.append(" fixedRate: ").append(toIndentedString(fixedRate)).append("\n"); + sb.append(" chain: ").append(toIndentedString(chain)).append("\n"); + sb.append(" chains: ").append(toIndentedString(chains)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/CurrencyChain.java b/src/main/java/io/gate/gateapi/models/CurrencyChain.java new file mode 100644 index 0000000..6abbb94 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CurrencyChain.java @@ -0,0 +1,271 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * CurrencyChain + */ +public class CurrencyChain { + public static final String SERIALIZED_NAME_CHAIN = "chain"; + @SerializedName(SERIALIZED_NAME_CHAIN) + private String chain; + + public static final String SERIALIZED_NAME_NAME_CN = "name_cn"; + @SerializedName(SERIALIZED_NAME_NAME_CN) + private String nameCn; + + public static final String SERIALIZED_NAME_NAME_EN = "name_en"; + @SerializedName(SERIALIZED_NAME_NAME_EN) + private String nameEn; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contract_address"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_IS_DISABLED = "is_disabled"; + @SerializedName(SERIALIZED_NAME_IS_DISABLED) + private Integer isDisabled; + + public static final String SERIALIZED_NAME_IS_DEPOSIT_DISABLED = "is_deposit_disabled"; + @SerializedName(SERIALIZED_NAME_IS_DEPOSIT_DISABLED) + private Integer isDepositDisabled; + + public static final String SERIALIZED_NAME_IS_WITHDRAW_DISABLED = "is_withdraw_disabled"; + @SerializedName(SERIALIZED_NAME_IS_WITHDRAW_DISABLED) + private Integer isWithdrawDisabled; + + public static final String SERIALIZED_NAME_DECIMAL = "decimal"; + @SerializedName(SERIALIZED_NAME_DECIMAL) + private String decimal; + + + public CurrencyChain chain(String chain) { + + this.chain = chain; + return this; + } + + /** + * Chain name + * @return chain + **/ + @javax.annotation.Nullable + public String getChain() { + return chain; + } + + + public void setChain(String chain) { + this.chain = chain; + } + + public CurrencyChain nameCn(String nameCn) { + + this.nameCn = nameCn; + return this; + } + + /** + * Chain name in Chinese + * @return nameCn + **/ + @javax.annotation.Nullable + public String getNameCn() { + return nameCn; + } + + + public void setNameCn(String nameCn) { + this.nameCn = nameCn; + } + + public CurrencyChain nameEn(String nameEn) { + + this.nameEn = nameEn; + return this; + } + + /** + * Chain name in English + * @return nameEn + **/ + @javax.annotation.Nullable + public String getNameEn() { + return nameEn; + } + + + public void setNameEn(String nameEn) { + this.nameEn = nameEn; + } + + public CurrencyChain contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Smart contract address for the currency; if no address is available, it will be an empty string + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + public CurrencyChain isDisabled(Integer isDisabled) { + + this.isDisabled = isDisabled; + return this; + } + + /** + * If it is disabled. 0 means NOT being disabled + * @return isDisabled + **/ + @javax.annotation.Nullable + public Integer getIsDisabled() { + return isDisabled; + } + + + public void setIsDisabled(Integer isDisabled) { + this.isDisabled = isDisabled; + } + + public CurrencyChain isDepositDisabled(Integer isDepositDisabled) { + + this.isDepositDisabled = isDepositDisabled; + return this; + } + + /** + * Is deposit disabled. 0 means not disabled + * @return isDepositDisabled + **/ + @javax.annotation.Nullable + public Integer getIsDepositDisabled() { + return isDepositDisabled; + } + + + public void setIsDepositDisabled(Integer isDepositDisabled) { + this.isDepositDisabled = isDepositDisabled; + } + + public CurrencyChain isWithdrawDisabled(Integer isWithdrawDisabled) { + + this.isWithdrawDisabled = isWithdrawDisabled; + return this; + } + + /** + * Is withdrawal disabled. 0 means not disabled + * @return isWithdrawDisabled + **/ + @javax.annotation.Nullable + public Integer getIsWithdrawDisabled() { + return isWithdrawDisabled; + } + + + public void setIsWithdrawDisabled(Integer isWithdrawDisabled) { + this.isWithdrawDisabled = isWithdrawDisabled; + } + + public CurrencyChain decimal(String decimal) { + + this.decimal = decimal; + return this; + } + + /** + * Withdrawal precision + * @return decimal + **/ + @javax.annotation.Nullable + public String getDecimal() { + return decimal; + } + + + public void setDecimal(String decimal) { + this.decimal = decimal; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CurrencyChain currencyChain = (CurrencyChain) o; + return Objects.equals(this.chain, currencyChain.chain) && + Objects.equals(this.nameCn, currencyChain.nameCn) && + Objects.equals(this.nameEn, currencyChain.nameEn) && + Objects.equals(this.contractAddress, currencyChain.contractAddress) && + Objects.equals(this.isDisabled, currencyChain.isDisabled) && + Objects.equals(this.isDepositDisabled, currencyChain.isDepositDisabled) && + Objects.equals(this.isWithdrawDisabled, currencyChain.isWithdrawDisabled) && + Objects.equals(this.decimal, currencyChain.decimal); + } + + @Override + public int hashCode() { + return Objects.hash(chain, nameCn, nameEn, contractAddress, isDisabled, isDepositDisabled, isWithdrawDisabled, decimal); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CurrencyChain {\n"); + sb.append(" chain: ").append(toIndentedString(chain)).append("\n"); + sb.append(" nameCn: ").append(toIndentedString(nameCn)).append("\n"); + sb.append(" nameEn: ").append(toIndentedString(nameEn)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" isDepositDisabled: ").append(toIndentedString(isDepositDisabled)).append("\n"); + sb.append(" isWithdrawDisabled: ").append(toIndentedString(isWithdrawDisabled)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CurrencyPair.java b/src/main/java/io/gate/gateapi/models/CurrencyPair.java index 4cd6e7a..90ff0fb 100644 --- a/src/main/java/io/gate/gateapi/models/CurrencyPair.java +++ b/src/main/java/io/gate/gateapi/models/CurrencyPair.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 @@ -31,10 +31,18 @@ public class CurrencyPair { @SerializedName(SERIALIZED_NAME_BASE) private String base; + public static final String SERIALIZED_NAME_BASE_NAME = "base_name"; + @SerializedName(SERIALIZED_NAME_BASE_NAME) + private String baseName; + public static final String SERIALIZED_NAME_QUOTE = "quote"; @SerializedName(SERIALIZED_NAME_QUOTE) private String quote; + public static final String SERIALIZED_NAME_QUOTE_NAME = "quote_name"; + @SerializedName(SERIALIZED_NAME_QUOTE_NAME) + private String quoteName; + public static final String SERIALIZED_NAME_FEE = "fee"; @SerializedName(SERIALIZED_NAME_FEE) private String fee; @@ -47,6 +55,14 @@ public class CurrencyPair { @SerializedName(SERIALIZED_NAME_MIN_QUOTE_AMOUNT) private String minQuoteAmount; + public static final String SERIALIZED_NAME_MAX_BASE_AMOUNT = "max_base_amount"; + @SerializedName(SERIALIZED_NAME_MAX_BASE_AMOUNT) + private String maxBaseAmount; + + public static final String SERIALIZED_NAME_MAX_QUOTE_AMOUNT = "max_quote_amount"; + @SerializedName(SERIALIZED_NAME_MAX_QUOTE_AMOUNT) + private String maxQuoteAmount; + public static final String SERIALIZED_NAME_AMOUNT_PRECISION = "amount_precision"; @SerializedName(SERIALIZED_NAME_AMOUNT_PRECISION) private Integer amountPrecision; @@ -56,7 +72,7 @@ public class CurrencyPair { private Integer precision; /** - * 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 + * Trading status - untradable: cannot be traded - buyable: can be bought - sellable: can be sold - tradable: can be bought and sold */ @JsonAdapter(TradeStatusEnum.Adapter.class) public enum TradeStatusEnum { @@ -118,6 +134,22 @@ public TradeStatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_BUY_START) private Long buyStart; + public static final String SERIALIZED_NAME_DELISTING_TIME = "delisting_time"; + @SerializedName(SERIALIZED_NAME_DELISTING_TIME) + private Long delistingTime; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_TRADE_URL = "trade_url"; + @SerializedName(SERIALIZED_NAME_TRADE_URL) + private String tradeUrl; + + public static final String SERIALIZED_NAME_ST_TAG = "st_tag"; + @SerializedName(SERIALIZED_NAME_ST_TAG) + private Boolean stTag; + public CurrencyPair id(String id) { @@ -159,6 +191,26 @@ public void setBase(String base) { this.base = base; } + public CurrencyPair baseName(String baseName) { + + this.baseName = baseName; + return this; + } + + /** + * Base currency name + * @return baseName + **/ + @javax.annotation.Nullable + public String getBaseName() { + return baseName; + } + + + public void setBaseName(String baseName) { + this.baseName = baseName; + } + public CurrencyPair quote(String quote) { this.quote = quote; @@ -179,6 +231,26 @@ public void setQuote(String quote) { this.quote = quote; } + public CurrencyPair quoteName(String quoteName) { + + this.quoteName = quoteName; + return this; + } + + /** + * Quote currency name + * @return quoteName + **/ + @javax.annotation.Nullable + public String getQuoteName() { + return quoteName; + } + + + public void setQuoteName(String quoteName) { + this.quoteName = quoteName; + } + public CurrencyPair fee(String fee) { this.fee = fee; @@ -186,7 +258,7 @@ public CurrencyPair fee(String fee) { } /** - * Trading fee + * Trading fee rate * @return fee **/ @javax.annotation.Nullable @@ -239,6 +311,46 @@ public void setMinQuoteAmount(String minQuoteAmount) { this.minQuoteAmount = minQuoteAmount; } + public CurrencyPair maxBaseAmount(String maxBaseAmount) { + + this.maxBaseAmount = maxBaseAmount; + return this; + } + + /** + * Maximum amount of base currency to trade, `null` means no limit + * @return maxBaseAmount + **/ + @javax.annotation.Nullable + public String getMaxBaseAmount() { + return maxBaseAmount; + } + + + public void setMaxBaseAmount(String maxBaseAmount) { + this.maxBaseAmount = maxBaseAmount; + } + + public CurrencyPair maxQuoteAmount(String maxQuoteAmount) { + + this.maxQuoteAmount = maxQuoteAmount; + return this; + } + + /** + * Maximum amount of quote currency to trade, `null` means no limit + * @return maxQuoteAmount + **/ + @javax.annotation.Nullable + public String getMaxQuoteAmount() { + return maxQuoteAmount; + } + + + public void setMaxQuoteAmount(String maxQuoteAmount) { + this.maxQuoteAmount = maxQuoteAmount; + } + public CurrencyPair amountPrecision(Integer amountPrecision) { this.amountPrecision = amountPrecision; @@ -286,7 +398,7 @@ public CurrencyPair tradeStatus(TradeStatusEnum tradeStatus) { } /** - * 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 + * Trading status - untradable: cannot be traded - buyable: can be bought - sellable: can be sold - tradable: can be bought and sold * @return tradeStatus **/ @javax.annotation.Nullable @@ -338,6 +450,86 @@ public Long getBuyStart() { public void setBuyStart(Long buyStart) { this.buyStart = buyStart; } + + public CurrencyPair delistingTime(Long delistingTime) { + + this.delistingTime = delistingTime; + return this; + } + + /** + * Expected time to remove the shelves, Unix timestamp in seconds + * @return delistingTime + **/ + @javax.annotation.Nullable + public Long getDelistingTime() { + return delistingTime; + } + + + public void setDelistingTime(Long delistingTime) { + this.delistingTime = delistingTime; + } + + public CurrencyPair type(String type) { + + this.type = type; + return this; + } + + /** + * Trading pair type, normal: normal, premarket: pre-market + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + public CurrencyPair tradeUrl(String tradeUrl) { + + this.tradeUrl = tradeUrl; + return this; + } + + /** + * Transaction link + * @return tradeUrl + **/ + @javax.annotation.Nullable + public String getTradeUrl() { + return tradeUrl; + } + + + public void setTradeUrl(String tradeUrl) { + this.tradeUrl = tradeUrl; + } + + public CurrencyPair stTag(Boolean stTag) { + + this.stTag = stTag; + return this; + } + + /** + * Whether the trading pair is in ST risk assessment, false - No, true - Yes + * @return stTag + **/ + @javax.annotation.Nullable + public Boolean getStTag() { + return stTag; + } + + + public void setStTag(Boolean stTag) { + this.stTag = stTag; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -349,20 +541,28 @@ public boolean equals(java.lang.Object o) { CurrencyPair currencyPair = (CurrencyPair) o; return Objects.equals(this.id, currencyPair.id) && Objects.equals(this.base, currencyPair.base) && + Objects.equals(this.baseName, currencyPair.baseName) && Objects.equals(this.quote, currencyPair.quote) && + Objects.equals(this.quoteName, currencyPair.quoteName) && Objects.equals(this.fee, currencyPair.fee) && Objects.equals(this.minBaseAmount, currencyPair.minBaseAmount) && Objects.equals(this.minQuoteAmount, currencyPair.minQuoteAmount) && + Objects.equals(this.maxBaseAmount, currencyPair.maxBaseAmount) && + Objects.equals(this.maxQuoteAmount, currencyPair.maxQuoteAmount) && Objects.equals(this.amountPrecision, currencyPair.amountPrecision) && Objects.equals(this.precision, currencyPair.precision) && Objects.equals(this.tradeStatus, currencyPair.tradeStatus) && Objects.equals(this.sellStart, currencyPair.sellStart) && - Objects.equals(this.buyStart, currencyPair.buyStart); + Objects.equals(this.buyStart, currencyPair.buyStart) && + Objects.equals(this.delistingTime, currencyPair.delistingTime) && + Objects.equals(this.type, currencyPair.type) && + Objects.equals(this.tradeUrl, currencyPair.tradeUrl) && + Objects.equals(this.stTag, currencyPair.stTag); } @Override public int hashCode() { - return Objects.hash(id, base, quote, fee, minBaseAmount, minQuoteAmount, amountPrecision, precision, tradeStatus, sellStart, buyStart); + return Objects.hash(id, base, baseName, quote, quoteName, fee, minBaseAmount, minQuoteAmount, maxBaseAmount, maxQuoteAmount, amountPrecision, precision, tradeStatus, sellStart, buyStart, delistingTime, type, tradeUrl, stTag); } @@ -372,15 +572,23 @@ public String toString() { sb.append("class CurrencyPair {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" base: ").append(toIndentedString(base)).append("\n"); + sb.append(" baseName: ").append(toIndentedString(baseName)).append("\n"); sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); + sb.append(" quoteName: ").append(toIndentedString(quoteName)).append("\n"); sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" minBaseAmount: ").append(toIndentedString(minBaseAmount)).append("\n"); sb.append(" minQuoteAmount: ").append(toIndentedString(minQuoteAmount)).append("\n"); + sb.append(" maxBaseAmount: ").append(toIndentedString(maxBaseAmount)).append("\n"); + sb.append(" maxQuoteAmount: ").append(toIndentedString(maxQuoteAmount)).append("\n"); sb.append(" amountPrecision: ").append(toIndentedString(amountPrecision)).append("\n"); sb.append(" precision: ").append(toIndentedString(precision)).append("\n"); sb.append(" tradeStatus: ").append(toIndentedString(tradeStatus)).append("\n"); sb.append(" sellStart: ").append(toIndentedString(sellStart)).append("\n"); sb.append(" buyStart: ").append(toIndentedString(buyStart)).append("\n"); + sb.append(" delistingTime: ").append(toIndentedString(delistingTime)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" tradeUrl: ").append(toIndentedString(tradeUrl)).append("\n"); + sb.append(" stTag: ").append(toIndentedString(stTag)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/CurrencyQuota.java b/src/main/java/io/gate/gateapi/models/CurrencyQuota.java new file mode 100644 index 0000000..cbf31f1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CurrencyQuota.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Currency Quota + */ +public class CurrencyQuota { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_MIN_QUOTA = "min_quota"; + @SerializedName(SERIALIZED_NAME_MIN_QUOTA) + private String minQuota; + + public static final String SERIALIZED_NAME_LEFT_QUOTA = "left_quota"; + @SerializedName(SERIALIZED_NAME_LEFT_QUOTA) + private String leftQuota; + + public static final String SERIALIZED_NAME_LEFT_QUOTE_USDT = "left_quote_usdt"; + @SerializedName(SERIALIZED_NAME_LEFT_QUOTE_USDT) + private String leftQuoteUsdt; + + + public CurrencyQuota currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public CurrencyQuota indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public CurrencyQuota minQuota(String minQuota) { + + this.minQuota = minQuota; + return this; + } + + /** + * Minimum borrowing/collateral limit for the currency + * @return minQuota + **/ + @javax.annotation.Nullable + public String getMinQuota() { + return minQuota; + } + + + public void setMinQuota(String minQuota) { + this.minQuota = minQuota; + } + + public CurrencyQuota leftQuota(String leftQuota) { + + this.leftQuota = leftQuota; + return this; + } + + /** + * Remaining borrowing/collateral quota for the currency + * @return leftQuota + **/ + @javax.annotation.Nullable + public String getLeftQuota() { + return leftQuota; + } + + + public void setLeftQuota(String leftQuota) { + this.leftQuota = leftQuota; + } + + public CurrencyQuota leftQuoteUsdt(String leftQuoteUsdt) { + + this.leftQuoteUsdt = leftQuoteUsdt; + return this; + } + + /** + * Remaining currency limit converted to USDT + * @return leftQuoteUsdt + **/ + @javax.annotation.Nullable + public String getLeftQuoteUsdt() { + return leftQuoteUsdt; + } + + + public void setLeftQuoteUsdt(String leftQuoteUsdt) { + this.leftQuoteUsdt = leftQuoteUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CurrencyQuota currencyQuota = (CurrencyQuota) o; + return Objects.equals(this.currency, currencyQuota.currency) && + Objects.equals(this.indexPrice, currencyQuota.indexPrice) && + Objects.equals(this.minQuota, currencyQuota.minQuota) && + Objects.equals(this.leftQuota, currencyQuota.leftQuota) && + Objects.equals(this.leftQuoteUsdt, currencyQuota.leftQuoteUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, minQuota, leftQuota, leftQuoteUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CurrencyQuota {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" minQuota: ").append(toIndentedString(minQuota)).append("\n"); + sb.append(" leftQuota: ").append(toIndentedString(leftQuota)).append("\n"); + sb.append(" leftQuoteUsdt: ").append(toIndentedString(leftQuoteUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/DebitFee.java b/src/main/java/io/gate/gateapi/models/DebitFee.java new file mode 100644 index 0000000..ce575cb --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/DebitFee.java @@ -0,0 +1,88 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * DebitFee + */ +public class DebitFee { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + + public DebitFee enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether GT fee deduction is enabled + * @return enabled + **/ + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DebitFee debitFee = (DebitFee) o; + return Objects.equals(this.enabled, debitFee.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(enabled); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DebitFee {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/DeliveryCandlestick.java b/src/main/java/io/gate/gateapi/models/DeliveryCandlestick.java new file mode 100644 index 0000000..bd66a5c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/DeliveryCandlestick.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * data point in every timestamp + */ +public class DeliveryCandlestick { + public static final String SERIALIZED_NAME_T = "t"; + @SerializedName(SERIALIZED_NAME_T) + private Double t; + + public static final String SERIALIZED_NAME_V = "v"; + @SerializedName(SERIALIZED_NAME_V) + private Long v; + + public static final String SERIALIZED_NAME_C = "c"; + @SerializedName(SERIALIZED_NAME_C) + private String c; + + public static final String SERIALIZED_NAME_H = "h"; + @SerializedName(SERIALIZED_NAME_H) + private String h; + + public static final String SERIALIZED_NAME_L = "l"; + @SerializedName(SERIALIZED_NAME_L) + private String l; + + public static final String SERIALIZED_NAME_O = "o"; + @SerializedName(SERIALIZED_NAME_O) + private String o; + + + public DeliveryCandlestick t(Double t) { + + this.t = t; + return this; + } + + /** + * Unix timestamp in seconds + * @return t + **/ + @javax.annotation.Nullable + public Double getT() { + return t; + } + + + public void setT(Double t) { + this.t = t; + } + + public DeliveryCandlestick v(Long v) { + + this.v = v; + return this; + } + + /** + * size volume (contract size). Only returned if `contract` is not prefixed + * @return v + **/ + @javax.annotation.Nullable + public Long getV() { + return v; + } + + + public void setV(Long v) { + this.v = v; + } + + public DeliveryCandlestick c(String c) { + + this.c = c; + return this; + } + + /** + * Close price (quote currency) + * @return c + **/ + @javax.annotation.Nullable + public String getC() { + return c; + } + + + public void setC(String c) { + this.c = c; + } + + public DeliveryCandlestick h(String h) { + + this.h = h; + return this; + } + + /** + * Highest price (quote currency) + * @return h + **/ + @javax.annotation.Nullable + public String getH() { + return h; + } + + + public void setH(String h) { + this.h = h; + } + + public DeliveryCandlestick l(String l) { + + this.l = l; + return this; + } + + /** + * Lowest price (quote currency) + * @return l + **/ + @javax.annotation.Nullable + public String getL() { + return l; + } + + + public void setL(String l) { + this.l = l; + } + + public DeliveryCandlestick o(String o) { + + this.o = o; + return this; + } + + /** + * Open price (quote currency) + * @return o + **/ + @javax.annotation.Nullable + public String getO() { + return o; + } + + + public void setO(String o) { + this.o = o; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeliveryCandlestick deliveryCandlestick = (DeliveryCandlestick) o; + return Objects.equals(this.t, deliveryCandlestick.t) && + Objects.equals(this.v, deliveryCandlestick.v) && + Objects.equals(this.c, deliveryCandlestick.c) && + Objects.equals(this.h, deliveryCandlestick.h) && + Objects.equals(this.l, deliveryCandlestick.l) && + Objects.equals(this.o, deliveryCandlestick.o); + } + + @Override + public int hashCode() { + return Objects.hash(t, v, c, h, l, o); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryCandlestick {\n"); + sb.append(" t: ").append(toIndentedString(t)).append("\n"); + sb.append(" v: ").append(toIndentedString(v)).append("\n"); + sb.append(" c: ").append(toIndentedString(c)).append("\n"); + sb.append(" h: ").append(toIndentedString(h)).append("\n"); + sb.append(" l: ").append(toIndentedString(l)).append("\n"); + sb.append(" o: ").append(toIndentedString(o)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/DeliveryContract.java b/src/main/java/io/gate/gateapi/models/DeliveryContract.java index 641a6a2..73962bb 100644 --- a/src/main/java/io/gate/gateapi/models/DeliveryContract.java +++ b/src/main/java/io/gate/gateapi/models/DeliveryContract.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 @@ -87,7 +87,7 @@ public CycleEnum read(final JsonReader jsonReader) throws IOException { private CycleEnum cycle; /** - * Futures contract type + * Contract type: inverse - inverse contract, direct - direct contract */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -154,7 +154,7 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { private String maintenanceRate; /** - * Mark price type, internal - based on internal trading, index - based on external index price + * Mark price type: internal - internal trading price, index - external index price */ @JsonAdapter(MarkTypeEnum.Adapter.class) public enum MarkTypeEnum { @@ -388,7 +388,7 @@ public DeliveryContract type(TypeEnum type) { } /** - * Futures contract type + * Contract type: inverse - inverse contract, direct - direct contract * @return type **/ @javax.annotation.Nullable @@ -488,7 +488,7 @@ public DeliveryContract markType(MarkTypeEnum markType) { } /** - * Mark price type, internal - based on internal trading, index - based on external index price + * Mark price type: internal - internal trading price, index - external index price * @return markType **/ @javax.annotation.Nullable @@ -568,7 +568,7 @@ public DeliveryContract makerFeeRate(String makerFeeRate) { } /** - * Maker fee rate, where negative means rebate + * Maker fee rate, negative values indicate rebates * @return makerFeeRate **/ @javax.annotation.Nullable @@ -848,7 +848,7 @@ public DeliveryContract orderSizeMin(Long orderSizeMin) { } /** - * Minimum order size the contract allowed + * Minimum order size allowed by the contract * @return orderSizeMin **/ @javax.annotation.Nullable @@ -868,7 +868,7 @@ public DeliveryContract orderSizeMax(Long orderSizeMax) { } /** - * Maximum order size the contract allowed + * Maximum order size allowed by the contract * @return orderSizeMax **/ @javax.annotation.Nullable @@ -888,7 +888,7 @@ public DeliveryContract orderPriceDeviate(String orderPriceDeviate) { } /** - * 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 + * 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 * @return orderPriceDeviate **/ @javax.annotation.Nullable @@ -908,7 +908,7 @@ public DeliveryContract refDiscountRate(String refDiscountRate) { } /** - * Referral fee rate discount + * Trading fee discount for referred users * @return refDiscountRate **/ @javax.annotation.Nullable @@ -928,7 +928,7 @@ public DeliveryContract refRebateRate(String refRebateRate) { } /** - * Referrer commission rate + * Commission rate for referrers * @return refRebateRate **/ @javax.annotation.Nullable @@ -948,7 +948,7 @@ public DeliveryContract orderbookId(Long orderbookId) { } /** - * Current orderbook ID + * Orderbook update ID * @return orderbookId **/ @javax.annotation.Nullable @@ -988,7 +988,7 @@ public DeliveryContract tradeSize(Long tradeSize) { } /** - * Historical accumulated trade size + * Historical cumulative trading volume * @return tradeSize **/ @javax.annotation.Nullable @@ -1028,7 +1028,7 @@ public DeliveryContract configChangeTime(Double configChangeTime) { } /** - * Last changed time of configuration + * Last configuration update time * @return configChangeTime **/ @javax.annotation.Nullable @@ -1068,7 +1068,7 @@ public DeliveryContract ordersLimit(Integer ordersLimit) { } /** - * Maximum number of open orders + * Maximum number of pending orders * @return ordersLimit **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/DeliverySettlement.java b/src/main/java/io/gate/gateapi/models/DeliverySettlement.java index 5bd34c2..d2c68c8 100644 --- a/src/main/java/io/gate/gateapi/models/DeliverySettlement.java +++ b/src/main/java/io/gate/gateapi/models/DeliverySettlement.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/models/DeliveryTicker.java b/src/main/java/io/gate/gateapi/models/DeliveryTicker.java new file mode 100644 index 0000000..e67f322 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/DeliveryTicker.java @@ -0,0 +1,661 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * DeliveryTicker + */ +public class DeliveryTicker { + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_LAST = "last"; + @SerializedName(SERIALIZED_NAME_LAST) + private String last; + + public static final String SERIALIZED_NAME_CHANGE_PERCENTAGE = "change_percentage"; + @SerializedName(SERIALIZED_NAME_CHANGE_PERCENTAGE) + private String changePercentage; + + public static final String SERIALIZED_NAME_TOTAL_SIZE = "total_size"; + @SerializedName(SERIALIZED_NAME_TOTAL_SIZE) + private String totalSize; + + public static final String SERIALIZED_NAME_LOW24H = "low_24h"; + @SerializedName(SERIALIZED_NAME_LOW24H) + private String low24h; + + public static final String SERIALIZED_NAME_HIGH24H = "high_24h"; + @SerializedName(SERIALIZED_NAME_HIGH24H) + private String high24h; + + public static final String SERIALIZED_NAME_VOLUME24H = "volume_24h"; + @SerializedName(SERIALIZED_NAME_VOLUME24H) + private String volume24h; + + public static final String SERIALIZED_NAME_VOLUME24H_BTC = "volume_24h_btc"; + @SerializedName(SERIALIZED_NAME_VOLUME24H_BTC) + private String volume24hBtc; + + public static final String SERIALIZED_NAME_VOLUME24H_USD = "volume_24h_usd"; + @SerializedName(SERIALIZED_NAME_VOLUME24H_USD) + private String volume24hUsd; + + public static final String SERIALIZED_NAME_VOLUME24H_BASE = "volume_24h_base"; + @SerializedName(SERIALIZED_NAME_VOLUME24H_BASE) + private String volume24hBase; + + public static final String SERIALIZED_NAME_VOLUME24H_QUOTE = "volume_24h_quote"; + @SerializedName(SERIALIZED_NAME_VOLUME24H_QUOTE) + private String volume24hQuote; + + public static final String SERIALIZED_NAME_VOLUME24H_SETTLE = "volume_24h_settle"; + @SerializedName(SERIALIZED_NAME_VOLUME24H_SETTLE) + private String volume24hSettle; + + public static final String SERIALIZED_NAME_MARK_PRICE = "mark_price"; + @SerializedName(SERIALIZED_NAME_MARK_PRICE) + private String markPrice; + + public static final String SERIALIZED_NAME_FUNDING_RATE = "funding_rate"; + @SerializedName(SERIALIZED_NAME_FUNDING_RATE) + private String fundingRate; + + public static final String SERIALIZED_NAME_FUNDING_RATE_INDICATIVE = "funding_rate_indicative"; + @SerializedName(SERIALIZED_NAME_FUNDING_RATE_INDICATIVE) + private String fundingRateIndicative; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_QUANTO_BASE_RATE = "quanto_base_rate"; + @SerializedName(SERIALIZED_NAME_QUANTO_BASE_RATE) + private String quantoBaseRate; + + public static final String SERIALIZED_NAME_BASIS_RATE = "basis_rate"; + @SerializedName(SERIALIZED_NAME_BASIS_RATE) + private String basisRate; + + public static final String SERIALIZED_NAME_BASIS_VALUE = "basis_value"; + @SerializedName(SERIALIZED_NAME_BASIS_VALUE) + private String basisValue; + + public static final String SERIALIZED_NAME_LOWEST_ASK = "lowest_ask"; + @SerializedName(SERIALIZED_NAME_LOWEST_ASK) + private String lowestAsk; + + public static final String SERIALIZED_NAME_LOWEST_SIZE = "lowest_size"; + @SerializedName(SERIALIZED_NAME_LOWEST_SIZE) + private String lowestSize; + + public static final String SERIALIZED_NAME_HIGHEST_BID = "highest_bid"; + @SerializedName(SERIALIZED_NAME_HIGHEST_BID) + private String highestBid; + + public static final String SERIALIZED_NAME_HIGHEST_SIZE = "highest_size"; + @SerializedName(SERIALIZED_NAME_HIGHEST_SIZE) + private String highestSize; + + + public DeliveryTicker contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures contract + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public DeliveryTicker last(String last) { + + this.last = last; + return this; + } + + /** + * Last trading price + * @return last + **/ + @javax.annotation.Nullable + public String getLast() { + return last; + } + + + public void setLast(String last) { + this.last = last; + } + + public DeliveryTicker changePercentage(String changePercentage) { + + this.changePercentage = changePercentage; + return this; + } + + /** + * Price change percentage. Negative values indicate price decrease, e.g. -7.45 + * @return changePercentage + **/ + @javax.annotation.Nullable + public String getChangePercentage() { + return changePercentage; + } + + + public void setChangePercentage(String changePercentage) { + this.changePercentage = changePercentage; + } + + public DeliveryTicker totalSize(String totalSize) { + + this.totalSize = totalSize; + return this; + } + + /** + * Contract total size + * @return totalSize + **/ + @javax.annotation.Nullable + public String getTotalSize() { + return totalSize; + } + + + public void setTotalSize(String totalSize) { + this.totalSize = totalSize; + } + + public DeliveryTicker low24h(String low24h) { + + this.low24h = low24h; + return this; + } + + /** + * 24-hour lowest price + * @return low24h + **/ + @javax.annotation.Nullable + public String getLow24h() { + return low24h; + } + + + public void setLow24h(String low24h) { + this.low24h = low24h; + } + + public DeliveryTicker high24h(String high24h) { + + this.high24h = high24h; + return this; + } + + /** + * 24-hour highest price + * @return high24h + **/ + @javax.annotation.Nullable + public String getHigh24h() { + return high24h; + } + + + public void setHigh24h(String high24h) { + this.high24h = high24h; + } + + public DeliveryTicker volume24h(String volume24h) { + + this.volume24h = volume24h; + return this; + } + + /** + * 24-hour trading volume + * @return volume24h + **/ + @javax.annotation.Nullable + public String getVolume24h() { + return volume24h; + } + + + public void setVolume24h(String volume24h) { + this.volume24h = volume24h; + } + + public DeliveryTicker volume24hBtc(String volume24hBtc) { + + this.volume24hBtc = volume24hBtc; + return this; + } + + /** + * 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) + * @return volume24hBtc + **/ + @javax.annotation.Nullable + public String getVolume24hBtc() { + return volume24hBtc; + } + + + public void setVolume24hBtc(String volume24hBtc) { + this.volume24hBtc = volume24hBtc; + } + + public DeliveryTicker volume24hUsd(String volume24hUsd) { + + this.volume24hUsd = volume24hUsd; + return this; + } + + /** + * 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) + * @return volume24hUsd + **/ + @javax.annotation.Nullable + public String getVolume24hUsd() { + return volume24hUsd; + } + + + public void setVolume24hUsd(String volume24hUsd) { + this.volume24hUsd = volume24hUsd; + } + + public DeliveryTicker volume24hBase(String volume24hBase) { + + this.volume24hBase = volume24hBase; + return this; + } + + /** + * 24-hour trading volume in base currency + * @return volume24hBase + **/ + @javax.annotation.Nullable + public String getVolume24hBase() { + return volume24hBase; + } + + + public void setVolume24hBase(String volume24hBase) { + this.volume24hBase = volume24hBase; + } + + public DeliveryTicker volume24hQuote(String volume24hQuote) { + + this.volume24hQuote = volume24hQuote; + return this; + } + + /** + * 24-hour trading volume in quote currency + * @return volume24hQuote + **/ + @javax.annotation.Nullable + public String getVolume24hQuote() { + return volume24hQuote; + } + + + public void setVolume24hQuote(String volume24hQuote) { + this.volume24hQuote = volume24hQuote; + } + + public DeliveryTicker volume24hSettle(String volume24hSettle) { + + this.volume24hSettle = volume24hSettle; + return this; + } + + /** + * 24-hour trading volume in settle currency + * @return volume24hSettle + **/ + @javax.annotation.Nullable + public String getVolume24hSettle() { + return volume24hSettle; + } + + + public void setVolume24hSettle(String volume24hSettle) { + this.volume24hSettle = volume24hSettle; + } + + public DeliveryTicker markPrice(String markPrice) { + + this.markPrice = markPrice; + return this; + } + + /** + * Recent mark price + * @return markPrice + **/ + @javax.annotation.Nullable + public String getMarkPrice() { + return markPrice; + } + + + public void setMarkPrice(String markPrice) { + this.markPrice = markPrice; + } + + public DeliveryTicker fundingRate(String fundingRate) { + + this.fundingRate = fundingRate; + return this; + } + + /** + * Funding rate + * @return fundingRate + **/ + @javax.annotation.Nullable + public String getFundingRate() { + return fundingRate; + } + + + public void setFundingRate(String fundingRate) { + this.fundingRate = fundingRate; + } + + public DeliveryTicker fundingRateIndicative(String fundingRateIndicative) { + + this.fundingRateIndicative = fundingRateIndicative; + return this; + } + + /** + * Indicative Funding rate in next period. (deprecated. use `funding_rate`) + * @return fundingRateIndicative + **/ + @javax.annotation.Nullable + public String getFundingRateIndicative() { + return fundingRateIndicative; + } + + + public void setFundingRateIndicative(String fundingRateIndicative) { + this.fundingRateIndicative = fundingRateIndicative; + } + + public DeliveryTicker indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Index price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public DeliveryTicker quantoBaseRate(String quantoBaseRate) { + + this.quantoBaseRate = quantoBaseRate; + return this; + } + + /** + * Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types + * @return quantoBaseRate + **/ + @javax.annotation.Nullable + public String getQuantoBaseRate() { + return quantoBaseRate; + } + + + public void setQuantoBaseRate(String quantoBaseRate) { + this.quantoBaseRate = quantoBaseRate; + } + + public DeliveryTicker basisRate(String basisRate) { + + this.basisRate = basisRate; + return this; + } + + /** + * Basis rate + * @return basisRate + **/ + @javax.annotation.Nullable + public String getBasisRate() { + return basisRate; + } + + + public void setBasisRate(String basisRate) { + this.basisRate = basisRate; + } + + public DeliveryTicker basisValue(String basisValue) { + + this.basisValue = basisValue; + return this; + } + + /** + * Basis value + * @return basisValue + **/ + @javax.annotation.Nullable + public String getBasisValue() { + return basisValue; + } + + + public void setBasisValue(String basisValue) { + this.basisValue = basisValue; + } + + public DeliveryTicker lowestAsk(String lowestAsk) { + + this.lowestAsk = lowestAsk; + return this; + } + + /** + * Recent lowest ask + * @return lowestAsk + **/ + @javax.annotation.Nullable + public String getLowestAsk() { + return lowestAsk; + } + + + public void setLowestAsk(String lowestAsk) { + this.lowestAsk = lowestAsk; + } + + public DeliveryTicker lowestSize(String lowestSize) { + + this.lowestSize = lowestSize; + return this; + } + + /** + * The latest seller's lowest price order quantity + * @return lowestSize + **/ + @javax.annotation.Nullable + public String getLowestSize() { + return lowestSize; + } + + + public void setLowestSize(String lowestSize) { + this.lowestSize = lowestSize; + } + + public DeliveryTicker highestBid(String highestBid) { + + this.highestBid = highestBid; + return this; + } + + /** + * Recent highest bid + * @return highestBid + **/ + @javax.annotation.Nullable + public String getHighestBid() { + return highestBid; + } + + + public void setHighestBid(String highestBid) { + this.highestBid = highestBid; + } + + public DeliveryTicker highestSize(String highestSize) { + + this.highestSize = highestSize; + return this; + } + + /** + * The latest buyer's highest price order volume + * @return highestSize + **/ + @javax.annotation.Nullable + public String getHighestSize() { + return highestSize; + } + + + public void setHighestSize(String highestSize) { + this.highestSize = highestSize; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeliveryTicker deliveryTicker = (DeliveryTicker) o; + return Objects.equals(this.contract, deliveryTicker.contract) && + Objects.equals(this.last, deliveryTicker.last) && + Objects.equals(this.changePercentage, deliveryTicker.changePercentage) && + Objects.equals(this.totalSize, deliveryTicker.totalSize) && + Objects.equals(this.low24h, deliveryTicker.low24h) && + Objects.equals(this.high24h, deliveryTicker.high24h) && + Objects.equals(this.volume24h, deliveryTicker.volume24h) && + Objects.equals(this.volume24hBtc, deliveryTicker.volume24hBtc) && + Objects.equals(this.volume24hUsd, deliveryTicker.volume24hUsd) && + Objects.equals(this.volume24hBase, deliveryTicker.volume24hBase) && + Objects.equals(this.volume24hQuote, deliveryTicker.volume24hQuote) && + Objects.equals(this.volume24hSettle, deliveryTicker.volume24hSettle) && + Objects.equals(this.markPrice, deliveryTicker.markPrice) && + Objects.equals(this.fundingRate, deliveryTicker.fundingRate) && + Objects.equals(this.fundingRateIndicative, deliveryTicker.fundingRateIndicative) && + Objects.equals(this.indexPrice, deliveryTicker.indexPrice) && + Objects.equals(this.quantoBaseRate, deliveryTicker.quantoBaseRate) && + Objects.equals(this.basisRate, deliveryTicker.basisRate) && + Objects.equals(this.basisValue, deliveryTicker.basisValue) && + Objects.equals(this.lowestAsk, deliveryTicker.lowestAsk) && + Objects.equals(this.lowestSize, deliveryTicker.lowestSize) && + Objects.equals(this.highestBid, deliveryTicker.highestBid) && + Objects.equals(this.highestSize, deliveryTicker.highestSize); + } + + @Override + public int hashCode() { + return Objects.hash(contract, last, changePercentage, totalSize, low24h, high24h, volume24h, volume24hBtc, volume24hUsd, volume24hBase, volume24hQuote, volume24hSettle, markPrice, fundingRate, fundingRateIndicative, indexPrice, quantoBaseRate, basisRate, basisValue, lowestAsk, lowestSize, highestBid, highestSize); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryTicker {\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" last: ").append(toIndentedString(last)).append("\n"); + sb.append(" changePercentage: ").append(toIndentedString(changePercentage)).append("\n"); + sb.append(" totalSize: ").append(toIndentedString(totalSize)).append("\n"); + sb.append(" low24h: ").append(toIndentedString(low24h)).append("\n"); + sb.append(" high24h: ").append(toIndentedString(high24h)).append("\n"); + sb.append(" volume24h: ").append(toIndentedString(volume24h)).append("\n"); + sb.append(" volume24hBtc: ").append(toIndentedString(volume24hBtc)).append("\n"); + sb.append(" volume24hUsd: ").append(toIndentedString(volume24hUsd)).append("\n"); + sb.append(" volume24hBase: ").append(toIndentedString(volume24hBase)).append("\n"); + sb.append(" volume24hQuote: ").append(toIndentedString(volume24hQuote)).append("\n"); + sb.append(" volume24hSettle: ").append(toIndentedString(volume24hSettle)).append("\n"); + sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); + sb.append(" fundingRate: ").append(toIndentedString(fundingRate)).append("\n"); + sb.append(" fundingRateIndicative: ").append(toIndentedString(fundingRateIndicative)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" quantoBaseRate: ").append(toIndentedString(quantoBaseRate)).append("\n"); + sb.append(" basisRate: ").append(toIndentedString(basisRate)).append("\n"); + sb.append(" basisValue: ").append(toIndentedString(basisValue)).append("\n"); + sb.append(" lowestAsk: ").append(toIndentedString(lowestAsk)).append("\n"); + sb.append(" lowestSize: ").append(toIndentedString(lowestSize)).append("\n"); + sb.append(" highestBid: ").append(toIndentedString(highestBid)).append("\n"); + sb.append(" highestSize: ").append(toIndentedString(highestSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/DepositAddress.java b/src/main/java/io/gate/gateapi/models/DepositAddress.java index 738a18d..1228957 100644 --- a/src/main/java/io/gate/gateapi/models/DepositAddress.java +++ b/src/main/java/io/gate/gateapi/models/DepositAddress.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/models/DepositRecord.java b/src/main/java/io/gate/gateapi/models/DepositRecord.java new file mode 100644 index 0000000..83408ea --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/DepositRecord.java @@ -0,0 +1,280 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * DepositRecord + */ +public class DepositRecord { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TXID = "txid"; + @SerializedName(SERIALIZED_NAME_TXID) + private String txid; + + public static final String SERIALIZED_NAME_WITHDRAW_ORDER_ID = "withdraw_order_id"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_ORDER_ID) + private String withdrawOrderId; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_MEMO = "memo"; + @SerializedName(SERIALIZED_NAME_MEMO) + private String memo; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CHAIN = "chain"; + @SerializedName(SERIALIZED_NAME_CHAIN) + private String chain; + + + /** + * Record ID + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + /** + * Hash record of the withdrawal + * @return txid + **/ + @javax.annotation.Nullable + public String getTxid() { + return txid; + } + + + public DepositRecord withdrawOrderId(String withdrawOrderId) { + + this.withdrawOrderId = withdrawOrderId; + return this; + } + + /** + * Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * @return withdrawOrderId + **/ + @javax.annotation.Nullable + public String getWithdrawOrderId() { + return withdrawOrderId; + } + + + public void setWithdrawOrderId(String withdrawOrderId) { + this.withdrawOrderId = withdrawOrderId; + } + + /** + * Operation time + * @return timestamp + **/ + @javax.annotation.Nullable + public String getTimestamp() { + return timestamp; + } + + + public DepositRecord amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Token amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public DepositRecord currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public DepositRecord address(String address) { + + this.address = address; + return this; + } + + /** + * Withdrawal address. Required for withdrawals + * @return address + **/ + @javax.annotation.Nullable + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + public DepositRecord memo(String memo) { + + this.memo = memo; + return this; + } + + /** + * Additional remarks with regards to the withdrawal + * @return memo + **/ + @javax.annotation.Nullable + public String getMemo() { + return memo; + } + + + public void setMemo(String memo) { + this.memo = memo; + } + + /** + * 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 + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public DepositRecord chain(String chain) { + + this.chain = chain; + return this; + } + + /** + * Name of the chain used in withdrawals + * @return chain + **/ + public String getChain() { + return chain; + } + + + public void setChain(String chain) { + this.chain = chain; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DepositRecord depositRecord = (DepositRecord) o; + return Objects.equals(this.id, depositRecord.id) && + Objects.equals(this.txid, depositRecord.txid) && + Objects.equals(this.withdrawOrderId, depositRecord.withdrawOrderId) && + Objects.equals(this.timestamp, depositRecord.timestamp) && + Objects.equals(this.amount, depositRecord.amount) && + Objects.equals(this.currency, depositRecord.currency) && + Objects.equals(this.address, depositRecord.address) && + Objects.equals(this.memo, depositRecord.memo) && + Objects.equals(this.status, depositRecord.status) && + Objects.equals(this.chain, depositRecord.chain); + } + + @Override + public int hashCode() { + return Objects.hash(id, txid, withdrawOrderId, timestamp, amount, currency, address, memo, status, chain); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DepositRecord {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" txid: ").append(toIndentedString(txid)).append("\n"); + sb.append(" withdrawOrderId: ").append(toIndentedString(withdrawOrderId)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" memo: ").append(toIndentedString(memo)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" chain: ").append(toIndentedString(chain)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/DualGetOrders.java b/src/main/java/io/gate/gateapi/models/DualGetOrders.java new file mode 100644 index 0000000..615ffb1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/DualGetOrders.java @@ -0,0 +1,505 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * DualGetOrders + */ +public class DualGetOrders { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Integer id; + + public static final String SERIALIZED_NAME_PLAN_ID = "plan_id"; + @SerializedName(SERIALIZED_NAME_PLAN_ID) + private Integer planId; + + public static final String SERIALIZED_NAME_COPIES = "copies"; + @SerializedName(SERIALIZED_NAME_COPIES) + private String copies; + + public static final String SERIALIZED_NAME_INVEST_AMOUNT = "invest_amount"; + @SerializedName(SERIALIZED_NAME_INVEST_AMOUNT) + private String investAmount; + + public static final String SERIALIZED_NAME_SETTLEMENT_AMOUNT = "settlement_amount"; + @SerializedName(SERIALIZED_NAME_SETTLEMENT_AMOUNT) + private String settlementAmount; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Integer createTime; + + public static final String SERIALIZED_NAME_COMPLETE_TIME = "complete_time"; + @SerializedName(SERIALIZED_NAME_COMPLETE_TIME) + private Integer completeTime; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_INVEST_CURRENCY = "invest_currency"; + @SerializedName(SERIALIZED_NAME_INVEST_CURRENCY) + private String investCurrency; + + public static final String SERIALIZED_NAME_EXERCISE_CURRENCY = "exercise_currency"; + @SerializedName(SERIALIZED_NAME_EXERCISE_CURRENCY) + private String exerciseCurrency; + + public static final String SERIALIZED_NAME_EXERCISE_PRICE = "exercise_price"; + @SerializedName(SERIALIZED_NAME_EXERCISE_PRICE) + private String exercisePrice; + + public static final String SERIALIZED_NAME_SETTLEMENT_PRICE = "settlement_price"; + @SerializedName(SERIALIZED_NAME_SETTLEMENT_PRICE) + private String settlementPrice; + + public static final String SERIALIZED_NAME_SETTLEMENT_CURRENCY = "settlement_currency"; + @SerializedName(SERIALIZED_NAME_SETTLEMENT_CURRENCY) + private String settlementCurrency; + + public static final String SERIALIZED_NAME_APY_DISPLAY = "apy_display"; + @SerializedName(SERIALIZED_NAME_APY_DISPLAY) + private String apyDisplay; + + public static final String SERIALIZED_NAME_APY_SETTLEMENT = "apy_settlement"; + @SerializedName(SERIALIZED_NAME_APY_SETTLEMENT) + private String apySettlement; + + public static final String SERIALIZED_NAME_DELIVERY_TIME = "delivery_time"; + @SerializedName(SERIALIZED_NAME_DELIVERY_TIME) + private Integer deliveryTime; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + + public DualGetOrders id(Integer id) { + + this.id = id; + return this; + } + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + + public void setId(Integer id) { + this.id = id; + } + + public DualGetOrders planId(Integer planId) { + + this.planId = planId; + return this; + } + + /** + * Product ID + * @return planId + **/ + @javax.annotation.Nullable + public Integer getPlanId() { + return planId; + } + + + public void setPlanId(Integer planId) { + this.planId = planId; + } + + public DualGetOrders copies(String copies) { + + this.copies = copies; + return this; + } + + /** + * Units + * @return copies + **/ + @javax.annotation.Nullable + public String getCopies() { + return copies; + } + + + public void setCopies(String copies) { + this.copies = copies; + } + + public DualGetOrders investAmount(String investAmount) { + + this.investAmount = investAmount; + return this; + } + + /** + * Investment Quantity + * @return investAmount + **/ + @javax.annotation.Nullable + public String getInvestAmount() { + return investAmount; + } + + + public void setInvestAmount(String investAmount) { + this.investAmount = investAmount; + } + + public DualGetOrders settlementAmount(String settlementAmount) { + + this.settlementAmount = settlementAmount; + return this; + } + + /** + * Settlement Quantity + * @return settlementAmount + **/ + @javax.annotation.Nullable + public String getSettlementAmount() { + return settlementAmount; + } + + + public void setSettlementAmount(String settlementAmount) { + this.settlementAmount = settlementAmount; + } + + public DualGetOrders createTime(Integer createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Integer getCreateTime() { + return createTime; + } + + + public void setCreateTime(Integer createTime) { + this.createTime = createTime; + } + + public DualGetOrders completeTime(Integer completeTime) { + + this.completeTime = completeTime; + return this; + } + + /** + * Completed Time + * @return completeTime + **/ + @javax.annotation.Nullable + public Integer getCompleteTime() { + return completeTime; + } + + + public void setCompleteTime(Integer completeTime) { + this.completeTime = completeTime; + } + + public DualGetOrders status(String status) { + + this.status = status; + return this; + } + + /** + * Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + public DualGetOrders investCurrency(String investCurrency) { + + this.investCurrency = investCurrency; + return this; + } + + /** + * Investment Token + * @return investCurrency + **/ + @javax.annotation.Nullable + public String getInvestCurrency() { + return investCurrency; + } + + + public void setInvestCurrency(String investCurrency) { + this.investCurrency = investCurrency; + } + + public DualGetOrders exerciseCurrency(String exerciseCurrency) { + + this.exerciseCurrency = exerciseCurrency; + return this; + } + + /** + * Strike Token + * @return exerciseCurrency + **/ + @javax.annotation.Nullable + public String getExerciseCurrency() { + return exerciseCurrency; + } + + + public void setExerciseCurrency(String exerciseCurrency) { + this.exerciseCurrency = exerciseCurrency; + } + + public DualGetOrders exercisePrice(String exercisePrice) { + + this.exercisePrice = exercisePrice; + return this; + } + + /** + * Strike price + * @return exercisePrice + **/ + @javax.annotation.Nullable + public String getExercisePrice() { + return exercisePrice; + } + + + public void setExercisePrice(String exercisePrice) { + this.exercisePrice = exercisePrice; + } + + public DualGetOrders settlementPrice(String settlementPrice) { + + this.settlementPrice = settlementPrice; + return this; + } + + /** + * Settlement price + * @return settlementPrice + **/ + @javax.annotation.Nullable + public String getSettlementPrice() { + return settlementPrice; + } + + + public void setSettlementPrice(String settlementPrice) { + this.settlementPrice = settlementPrice; + } + + public DualGetOrders settlementCurrency(String settlementCurrency) { + + this.settlementCurrency = settlementCurrency; + return this; + } + + /** + * Settlement currency + * @return settlementCurrency + **/ + @javax.annotation.Nullable + public String getSettlementCurrency() { + return settlementCurrency; + } + + + public void setSettlementCurrency(String settlementCurrency) { + this.settlementCurrency = settlementCurrency; + } + + public DualGetOrders apyDisplay(String apyDisplay) { + + this.apyDisplay = apyDisplay; + return this; + } + + /** + * Annual Yield + * @return apyDisplay + **/ + @javax.annotation.Nullable + public String getApyDisplay() { + return apyDisplay; + } + + + public void setApyDisplay(String apyDisplay) { + this.apyDisplay = apyDisplay; + } + + public DualGetOrders apySettlement(String apySettlement) { + + this.apySettlement = apySettlement; + return this; + } + + /** + * Settlement Annual Yield + * @return apySettlement + **/ + @javax.annotation.Nullable + public String getApySettlement() { + return apySettlement; + } + + + public void setApySettlement(String apySettlement) { + this.apySettlement = apySettlement; + } + + public DualGetOrders deliveryTime(Integer deliveryTime) { + + this.deliveryTime = deliveryTime; + return this; + } + + /** + * Settlement time + * @return deliveryTime + **/ + @javax.annotation.Nullable + public Integer getDeliveryTime() { + return deliveryTime; + } + + + public void setDeliveryTime(Integer deliveryTime) { + this.deliveryTime = deliveryTime; + } + + public DualGetOrders text(String text) { + + this.text = text; + return this; + } + + /** + * Custom order information + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DualGetOrders dualGetOrders = (DualGetOrders) o; + return Objects.equals(this.id, dualGetOrders.id) && + Objects.equals(this.planId, dualGetOrders.planId) && + Objects.equals(this.copies, dualGetOrders.copies) && + Objects.equals(this.investAmount, dualGetOrders.investAmount) && + Objects.equals(this.settlementAmount, dualGetOrders.settlementAmount) && + Objects.equals(this.createTime, dualGetOrders.createTime) && + Objects.equals(this.completeTime, dualGetOrders.completeTime) && + Objects.equals(this.status, dualGetOrders.status) && + Objects.equals(this.investCurrency, dualGetOrders.investCurrency) && + Objects.equals(this.exerciseCurrency, dualGetOrders.exerciseCurrency) && + Objects.equals(this.exercisePrice, dualGetOrders.exercisePrice) && + Objects.equals(this.settlementPrice, dualGetOrders.settlementPrice) && + Objects.equals(this.settlementCurrency, dualGetOrders.settlementCurrency) && + Objects.equals(this.apyDisplay, dualGetOrders.apyDisplay) && + Objects.equals(this.apySettlement, dualGetOrders.apySettlement) && + Objects.equals(this.deliveryTime, dualGetOrders.deliveryTime) && + Objects.equals(this.text, dualGetOrders.text); + } + + @Override + public int hashCode() { + return Objects.hash(id, planId, copies, investAmount, settlementAmount, createTime, completeTime, status, investCurrency, exerciseCurrency, exercisePrice, settlementPrice, settlementCurrency, apyDisplay, apySettlement, deliveryTime, text); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DualGetOrders {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); + sb.append(" copies: ").append(toIndentedString(copies)).append("\n"); + sb.append(" investAmount: ").append(toIndentedString(investAmount)).append("\n"); + sb.append(" settlementAmount: ").append(toIndentedString(settlementAmount)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" completeTime: ").append(toIndentedString(completeTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" investCurrency: ").append(toIndentedString(investCurrency)).append("\n"); + sb.append(" exerciseCurrency: ").append(toIndentedString(exerciseCurrency)).append("\n"); + sb.append(" exercisePrice: ").append(toIndentedString(exercisePrice)).append("\n"); + sb.append(" settlementPrice: ").append(toIndentedString(settlementPrice)).append("\n"); + sb.append(" settlementCurrency: ").append(toIndentedString(settlementCurrency)).append("\n"); + sb.append(" apyDisplay: ").append(toIndentedString(apyDisplay)).append("\n"); + sb.append(" apySettlement: ").append(toIndentedString(apySettlement)).append("\n"); + sb.append(" deliveryTime: ").append(toIndentedString(deliveryTime)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/DualGetPlans.java b/src/main/java/io/gate/gateapi/models/DualGetPlans.java new file mode 100644 index 0000000..5d61961 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/DualGetPlans.java @@ -0,0 +1,401 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * DualGetPlans + */ +public class DualGetPlans { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Integer id; + + public static final String SERIALIZED_NAME_INSTRUMENT_NAME = "instrument_name"; + @SerializedName(SERIALIZED_NAME_INSTRUMENT_NAME) + private String instrumentName; + + public static final String SERIALIZED_NAME_INVEST_CURRENCY = "invest_currency"; + @SerializedName(SERIALIZED_NAME_INVEST_CURRENCY) + private String investCurrency; + + public static final String SERIALIZED_NAME_EXERCISE_CURRENCY = "exercise_currency"; + @SerializedName(SERIALIZED_NAME_EXERCISE_CURRENCY) + private String exerciseCurrency; + + public static final String SERIALIZED_NAME_EXERCISE_PRICE = "exercise_price"; + @SerializedName(SERIALIZED_NAME_EXERCISE_PRICE) + private Double exercisePrice; + + public static final String SERIALIZED_NAME_DELIVERY_TIME = "delivery_time"; + @SerializedName(SERIALIZED_NAME_DELIVERY_TIME) + private Integer deliveryTime; + + public static final String SERIALIZED_NAME_MIN_COPIES = "min_copies"; + @SerializedName(SERIALIZED_NAME_MIN_COPIES) + private Integer minCopies; + + public static final String SERIALIZED_NAME_MAX_COPIES = "max_copies"; + @SerializedName(SERIALIZED_NAME_MAX_COPIES) + private Integer maxCopies; + + public static final String SERIALIZED_NAME_PER_VALUE = "per_value"; + @SerializedName(SERIALIZED_NAME_PER_VALUE) + private String perValue; + + public static final String SERIALIZED_NAME_APY_DISPLAY = "apy_display"; + @SerializedName(SERIALIZED_NAME_APY_DISPLAY) + private String apyDisplay; + + public static final String SERIALIZED_NAME_START_TIME = "start_time"; + @SerializedName(SERIALIZED_NAME_START_TIME) + private Integer startTime; + + public static final String SERIALIZED_NAME_END_TIME = "end_time"; + @SerializedName(SERIALIZED_NAME_END_TIME) + private Integer endTime; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + + public DualGetPlans id(Integer id) { + + this.id = id; + return this; + } + + /** + * Product ID + * @return id + **/ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + + public void setId(Integer id) { + this.id = id; + } + + public DualGetPlans instrumentName(String instrumentName) { + + this.instrumentName = instrumentName; + return this; + } + + /** + * Product Name + * @return instrumentName + **/ + @javax.annotation.Nullable + public String getInstrumentName() { + return instrumentName; + } + + + public void setInstrumentName(String instrumentName) { + this.instrumentName = instrumentName; + } + + public DualGetPlans investCurrency(String investCurrency) { + + this.investCurrency = investCurrency; + return this; + } + + /** + * Investment Token + * @return investCurrency + **/ + @javax.annotation.Nullable + public String getInvestCurrency() { + return investCurrency; + } + + + public void setInvestCurrency(String investCurrency) { + this.investCurrency = investCurrency; + } + + public DualGetPlans exerciseCurrency(String exerciseCurrency) { + + this.exerciseCurrency = exerciseCurrency; + return this; + } + + /** + * Strike Token + * @return exerciseCurrency + **/ + @javax.annotation.Nullable + public String getExerciseCurrency() { + return exerciseCurrency; + } + + + public void setExerciseCurrency(String exerciseCurrency) { + this.exerciseCurrency = exerciseCurrency; + } + + public DualGetPlans exercisePrice(Double exercisePrice) { + + this.exercisePrice = exercisePrice; + return this; + } + + /** + * Strike price + * @return exercisePrice + **/ + @javax.annotation.Nullable + public Double getExercisePrice() { + return exercisePrice; + } + + + public void setExercisePrice(Double exercisePrice) { + this.exercisePrice = exercisePrice; + } + + public DualGetPlans deliveryTime(Integer deliveryTime) { + + this.deliveryTime = deliveryTime; + return this; + } + + /** + * Settlement time + * @return deliveryTime + **/ + @javax.annotation.Nullable + public Integer getDeliveryTime() { + return deliveryTime; + } + + + public void setDeliveryTime(Integer deliveryTime) { + this.deliveryTime = deliveryTime; + } + + public DualGetPlans minCopies(Integer minCopies) { + + this.minCopies = minCopies; + return this; + } + + /** + * Minimum Units + * @return minCopies + **/ + @javax.annotation.Nullable + public Integer getMinCopies() { + return minCopies; + } + + + public void setMinCopies(Integer minCopies) { + this.minCopies = minCopies; + } + + public DualGetPlans maxCopies(Integer maxCopies) { + + this.maxCopies = maxCopies; + return this; + } + + /** + * Maximum Units + * @return maxCopies + **/ + @javax.annotation.Nullable + public Integer getMaxCopies() { + return maxCopies; + } + + + public void setMaxCopies(Integer maxCopies) { + this.maxCopies = maxCopies; + } + + public DualGetPlans perValue(String perValue) { + + this.perValue = perValue; + return this; + } + + /** + * Value Per Unit + * @return perValue + **/ + @javax.annotation.Nullable + public String getPerValue() { + return perValue; + } + + + public void setPerValue(String perValue) { + this.perValue = perValue; + } + + public DualGetPlans apyDisplay(String apyDisplay) { + + this.apyDisplay = apyDisplay; + return this; + } + + /** + * Annual Yield + * @return apyDisplay + **/ + @javax.annotation.Nullable + public String getApyDisplay() { + return apyDisplay; + } + + + public void setApyDisplay(String apyDisplay) { + this.apyDisplay = apyDisplay; + } + + public DualGetPlans startTime(Integer startTime) { + + this.startTime = startTime; + return this; + } + + /** + * Start Time + * @return startTime + **/ + @javax.annotation.Nullable + public Integer getStartTime() { + return startTime; + } + + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public DualGetPlans endTime(Integer endTime) { + + this.endTime = endTime; + return this; + } + + /** + * End time + * @return endTime + **/ + @javax.annotation.Nullable + public Integer getEndTime() { + return endTime; + } + + + public void setEndTime(Integer endTime) { + this.endTime = endTime; + } + + public DualGetPlans status(String status) { + + this.status = status; + return this; + } + + /** + * Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DualGetPlans dualGetPlans = (DualGetPlans) o; + return Objects.equals(this.id, dualGetPlans.id) && + Objects.equals(this.instrumentName, dualGetPlans.instrumentName) && + Objects.equals(this.investCurrency, dualGetPlans.investCurrency) && + Objects.equals(this.exerciseCurrency, dualGetPlans.exerciseCurrency) && + Objects.equals(this.exercisePrice, dualGetPlans.exercisePrice) && + Objects.equals(this.deliveryTime, dualGetPlans.deliveryTime) && + Objects.equals(this.minCopies, dualGetPlans.minCopies) && + Objects.equals(this.maxCopies, dualGetPlans.maxCopies) && + Objects.equals(this.perValue, dualGetPlans.perValue) && + Objects.equals(this.apyDisplay, dualGetPlans.apyDisplay) && + Objects.equals(this.startTime, dualGetPlans.startTime) && + Objects.equals(this.endTime, dualGetPlans.endTime) && + Objects.equals(this.status, dualGetPlans.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, instrumentName, investCurrency, exerciseCurrency, exercisePrice, deliveryTime, minCopies, maxCopies, perValue, apyDisplay, startTime, endTime, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DualGetPlans {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" instrumentName: ").append(toIndentedString(instrumentName)).append("\n"); + sb.append(" investCurrency: ").append(toIndentedString(investCurrency)).append("\n"); + sb.append(" exerciseCurrency: ").append(toIndentedString(exerciseCurrency)).append("\n"); + sb.append(" exercisePrice: ").append(toIndentedString(exercisePrice)).append("\n"); + sb.append(" deliveryTime: ").append(toIndentedString(deliveryTime)).append("\n"); + sb.append(" minCopies: ").append(toIndentedString(minCopies)).append("\n"); + sb.append(" maxCopies: ").append(toIndentedString(maxCopies)).append("\n"); + sb.append(" perValue: ").append(toIndentedString(perValue)).append("\n"); + sb.append(" apyDisplay: ").append(toIndentedString(apyDisplay)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FundingBookItem.java b/src/main/java/io/gate/gateapi/models/Eth2RateList.java similarity index 53% rename from src/main/java/io/gate/gateapi/models/FundingBookItem.java rename to src/main/java/io/gate/gateapi/models/Eth2RateList.java index dca18b0..91e764f 100644 --- a/src/main/java/io/gate/gateapi/models/FundingBookItem.java +++ b/src/main/java/io/gate/gateapi/models/Eth2RateList.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 @@ -20,80 +20,80 @@ import java.io.IOException; /** - * FundingBookItem + * Eth2RateList */ -public class FundingBookItem { +public class Eth2RateList { + public static final String SERIALIZED_NAME_DATE_TIME = "date_time"; + @SerializedName(SERIALIZED_NAME_DATE_TIME) + private Long dateTime; + + public static final String SERIALIZED_NAME_DATE = "date"; + @SerializedName(SERIALIZED_NAME_DATE) + private String date; + public static final String SERIALIZED_NAME_RATE = "rate"; @SerializedName(SERIALIZED_NAME_RATE) private String rate; - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private String amount; - - public static final String SERIALIZED_NAME_DAYS = "days"; - @SerializedName(SERIALIZED_NAME_DAYS) - private Integer days; - - public FundingBookItem rate(String rate) { + public Eth2RateList dateTime(Long dateTime) { - this.rate = rate; + this.dateTime = dateTime; return this; } /** - * Loan rate - * @return rate + * Date Timestamp + * @return dateTime **/ @javax.annotation.Nullable - public String getRate() { - return rate; + public Long getDateTime() { + return dateTime; } - public void setRate(String rate) { - this.rate = rate; + public void setDateTime(Long dateTime) { + this.dateTime = dateTime; } - public FundingBookItem amount(String amount) { + public Eth2RateList date(String date) { - this.amount = amount; + this.date = date; return this; } /** - * Borrowable amount - * @return amount + * Date + * @return date **/ @javax.annotation.Nullable - public String getAmount() { - return amount; + public String getDate() { + return date; } - public void setAmount(String amount) { - this.amount = amount; + public void setDate(String date) { + this.date = date; } - public FundingBookItem days(Integer days) { + public Eth2RateList rate(String rate) { - this.days = days; + this.rate = rate; return this; } /** - * The number of days till the loan repayment's dateline - * @return days + * Percentage Rate + * @return rate **/ @javax.annotation.Nullable - public Integer getDays() { - return days; + public String getRate() { + return rate; } - public void setDays(Integer days) { - this.days = days; + public void setRate(String rate) { + this.rate = rate; } @Override public boolean equals(java.lang.Object o) { @@ -103,25 +103,25 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - FundingBookItem fundingBookItem = (FundingBookItem) o; - return Objects.equals(this.rate, fundingBookItem.rate) && - Objects.equals(this.amount, fundingBookItem.amount) && - Objects.equals(this.days, fundingBookItem.days); + Eth2RateList eth2RateList = (Eth2RateList) o; + return Objects.equals(this.dateTime, eth2RateList.dateTime) && + Objects.equals(this.date, eth2RateList.date) && + Objects.equals(this.rate, eth2RateList.rate); } @Override public int hashCode() { - return Objects.hash(rate, amount, days); + return Objects.hash(dateTime, date, rate); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FundingBookItem {\n"); + sb.append("class Eth2RateList {\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" days: ").append(toIndentedString(days)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/Eth2Swap.java b/src/main/java/io/gate/gateapi/models/Eth2Swap.java new file mode 100644 index 0000000..0e9ec91 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/Eth2Swap.java @@ -0,0 +1,113 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * ETH2 Mining + */ +public class Eth2Swap { + public static final String SERIALIZED_NAME_SIDE = "side"; + @SerializedName(SERIALIZED_NAME_SIDE) + private String side; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + + public Eth2Swap side(String side) { + + this.side = side; + return this; + } + + /** + * 1-Forward Swap (ETH -> ETH2), 2-Reverse Swap (ETH2 -> ETH) + * @return side + **/ + public String getSide() { + return side; + } + + + public void setSide(String side) { + this.side = side; + } + + public Eth2Swap amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Swap Amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Eth2Swap eth2Swap = (Eth2Swap) o; + return Objects.equals(this.side, eth2Swap.side) && + Objects.equals(this.amount, eth2Swap.amount); + } + + @Override + public int hashCode() { + return Objects.hash(side, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Eth2Swap {\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FindCoin.java b/src/main/java/io/gate/gateapi/models/FindCoin.java new file mode 100644 index 0000000..829f1d4 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FindCoin.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * FindCoin + */ +public class FindCoin { + public static final String SERIALIZED_NAME_COINTYPE = "cointype"; + @SerializedName(SERIALIZED_NAME_COINTYPE) + private String cointype; + + + public FindCoin cointype(String cointype) { + + this.cointype = cointype; + return this; + } + + /** + * Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. + * @return cointype + **/ + @javax.annotation.Nullable + public String getCointype() { + return cointype; + } + + + public void setCointype(String cointype) { + this.cointype = cointype; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindCoin findCoin = (FindCoin) o; + return Objects.equals(this.cointype, findCoin.cointype); + } + + @Override + public int hashCode() { + return Objects.hash(cointype); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindCoin {\n"); + sb.append(" cointype: ").append(toIndentedString(cointype)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapCurrencyPair.java b/src/main/java/io/gate/gateapi/models/FlashSwapCurrencyPair.java new file mode 100644 index 0000000..a54725a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FlashSwapCurrencyPair.java @@ -0,0 +1,175 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * List all supported currencies in flash swap + */ +public class FlashSwapCurrencyPair { + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_SELL_CURRENCY = "sell_currency"; + @SerializedName(SERIALIZED_NAME_SELL_CURRENCY) + private String sellCurrency; + + public static final String SERIALIZED_NAME_BUY_CURRENCY = "buy_currency"; + @SerializedName(SERIALIZED_NAME_BUY_CURRENCY) + private String buyCurrency; + + public static final String SERIALIZED_NAME_SELL_MIN_AMOUNT = "sell_min_amount"; + @SerializedName(SERIALIZED_NAME_SELL_MIN_AMOUNT) + private String sellMinAmount; + + public static final String SERIALIZED_NAME_SELL_MAX_AMOUNT = "sell_max_amount"; + @SerializedName(SERIALIZED_NAME_SELL_MAX_AMOUNT) + private String sellMaxAmount; + + public static final String SERIALIZED_NAME_BUY_MIN_AMOUNT = "buy_min_amount"; + @SerializedName(SERIALIZED_NAME_BUY_MIN_AMOUNT) + private String buyMinAmount; + + public static final String SERIALIZED_NAME_BUY_MAX_AMOUNT = "buy_max_amount"; + @SerializedName(SERIALIZED_NAME_BUY_MAX_AMOUNT) + private String buyMaxAmount; + + + /** + * Currency pair, `BTC_USDT` represents selling `BTC` and buying `USDT` + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + /** + * Currency to sell + * @return sellCurrency + **/ + @javax.annotation.Nullable + public String getSellCurrency() { + return sellCurrency; + } + + + /** + * Currency to buy + * @return buyCurrency + **/ + @javax.annotation.Nullable + public String getBuyCurrency() { + return buyCurrency; + } + + + /** + * Minimum sell quantity + * @return sellMinAmount + **/ + @javax.annotation.Nullable + public String getSellMinAmount() { + return sellMinAmount; + } + + + /** + * Maximum sell quantity + * @return sellMaxAmount + **/ + @javax.annotation.Nullable + public String getSellMaxAmount() { + return sellMaxAmount; + } + + + /** + * Minimum buy quantity + * @return buyMinAmount + **/ + @javax.annotation.Nullable + public String getBuyMinAmount() { + return buyMinAmount; + } + + + /** + * Maximum buy quantity + * @return buyMaxAmount + **/ + @javax.annotation.Nullable + public String getBuyMaxAmount() { + return buyMaxAmount; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FlashSwapCurrencyPair flashSwapCurrencyPair = (FlashSwapCurrencyPair) o; + return Objects.equals(this.currencyPair, flashSwapCurrencyPair.currencyPair) && + Objects.equals(this.sellCurrency, flashSwapCurrencyPair.sellCurrency) && + Objects.equals(this.buyCurrency, flashSwapCurrencyPair.buyCurrency) && + Objects.equals(this.sellMinAmount, flashSwapCurrencyPair.sellMinAmount) && + Objects.equals(this.sellMaxAmount, flashSwapCurrencyPair.sellMaxAmount) && + Objects.equals(this.buyMinAmount, flashSwapCurrencyPair.buyMinAmount) && + Objects.equals(this.buyMaxAmount, flashSwapCurrencyPair.buyMaxAmount); + } + + @Override + public int hashCode() { + return Objects.hash(currencyPair, sellCurrency, buyCurrency, sellMinAmount, sellMaxAmount, buyMinAmount, buyMaxAmount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FlashSwapCurrencyPair {\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" sellCurrency: ").append(toIndentedString(sellCurrency)).append("\n"); + sb.append(" buyCurrency: ").append(toIndentedString(buyCurrency)).append("\n"); + sb.append(" sellMinAmount: ").append(toIndentedString(sellMinAmount)).append("\n"); + sb.append(" sellMaxAmount: ").append(toIndentedString(sellMaxAmount)).append("\n"); + sb.append(" buyMinAmount: ").append(toIndentedString(buyMinAmount)).append("\n"); + sb.append(" buyMaxAmount: ").append(toIndentedString(buyMaxAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapOrder.java b/src/main/java/io/gate/gateapi/models/FlashSwapOrder.java new file mode 100644 index 0000000..3985804 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FlashSwapOrder.java @@ -0,0 +1,207 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Flash swap order + */ +public class FlashSwapOrder { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_SELL_CURRENCY = "sell_currency"; + @SerializedName(SERIALIZED_NAME_SELL_CURRENCY) + private String sellCurrency; + + public static final String SERIALIZED_NAME_SELL_AMOUNT = "sell_amount"; + @SerializedName(SERIALIZED_NAME_SELL_AMOUNT) + private String sellAmount; + + public static final String SERIALIZED_NAME_BUY_CURRENCY = "buy_currency"; + @SerializedName(SERIALIZED_NAME_BUY_CURRENCY) + private String buyCurrency; + + public static final String SERIALIZED_NAME_BUY_AMOUNT = "buy_amount"; + @SerializedName(SERIALIZED_NAME_BUY_AMOUNT) + private String buyAmount; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + + /** + * Flash swap order ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + /** + * Creation time of order (in milliseconds) + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + /** + * Currency to sell + * @return sellCurrency + **/ + @javax.annotation.Nullable + public String getSellCurrency() { + return sellCurrency; + } + + + /** + * Amount to sell + * @return sellAmount + **/ + @javax.annotation.Nullable + public String getSellAmount() { + return sellAmount; + } + + + /** + * Currency to buy + * @return buyCurrency + **/ + @javax.annotation.Nullable + public String getBuyCurrency() { + return buyCurrency; + } + + + /** + * Amount to buy + * @return buyAmount + **/ + @javax.annotation.Nullable + public String getBuyAmount() { + return buyAmount; + } + + + /** + * Price + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + /** + * Flash swap order status `1` - success `2` - failure + * @return status + **/ + @javax.annotation.Nullable + public Integer getStatus() { + return status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FlashSwapOrder flashSwapOrder = (FlashSwapOrder) o; + return Objects.equals(this.id, flashSwapOrder.id) && + Objects.equals(this.createTime, flashSwapOrder.createTime) && + Objects.equals(this.userId, flashSwapOrder.userId) && + Objects.equals(this.sellCurrency, flashSwapOrder.sellCurrency) && + Objects.equals(this.sellAmount, flashSwapOrder.sellAmount) && + Objects.equals(this.buyCurrency, flashSwapOrder.buyCurrency) && + Objects.equals(this.buyAmount, flashSwapOrder.buyAmount) && + Objects.equals(this.price, flashSwapOrder.price) && + Objects.equals(this.status, flashSwapOrder.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, createTime, userId, sellCurrency, sellAmount, buyCurrency, buyAmount, price, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FlashSwapOrder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" sellCurrency: ").append(toIndentedString(sellCurrency)).append("\n"); + sb.append(" sellAmount: ").append(toIndentedString(sellAmount)).append("\n"); + sb.append(" buyCurrency: ").append(toIndentedString(buyCurrency)).append("\n"); + sb.append(" buyAmount: ").append(toIndentedString(buyAmount)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapOrderPreview.java b/src/main/java/io/gate/gateapi/models/FlashSwapOrderPreview.java new file mode 100644 index 0000000..00f49a4 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FlashSwapOrderPreview.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Flash swap order preview + */ +public class FlashSwapOrderPreview { + public static final String SERIALIZED_NAME_PREVIEW_ID = "preview_id"; + @SerializedName(SERIALIZED_NAME_PREVIEW_ID) + private String previewId; + + public static final String SERIALIZED_NAME_SELL_CURRENCY = "sell_currency"; + @SerializedName(SERIALIZED_NAME_SELL_CURRENCY) + private String sellCurrency; + + public static final String SERIALIZED_NAME_SELL_AMOUNT = "sell_amount"; + @SerializedName(SERIALIZED_NAME_SELL_AMOUNT) + private String sellAmount; + + public static final String SERIALIZED_NAME_BUY_CURRENCY = "buy_currency"; + @SerializedName(SERIALIZED_NAME_BUY_CURRENCY) + private String buyCurrency; + + public static final String SERIALIZED_NAME_BUY_AMOUNT = "buy_amount"; + @SerializedName(SERIALIZED_NAME_BUY_AMOUNT) + private String buyAmount; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + + public FlashSwapOrderPreview previewId(String previewId) { + + this.previewId = previewId; + return this; + } + + /** + * Preview result ID + * @return previewId + **/ + @javax.annotation.Nullable + public String getPreviewId() { + return previewId; + } + + + public void setPreviewId(String previewId) { + this.previewId = previewId; + } + + public FlashSwapOrderPreview sellCurrency(String sellCurrency) { + + this.sellCurrency = sellCurrency; + return this; + } + + /** + * Name of the sold asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain + * @return sellCurrency + **/ + @javax.annotation.Nullable + public String getSellCurrency() { + return sellCurrency; + } + + + public void setSellCurrency(String sellCurrency) { + this.sellCurrency = sellCurrency; + } + + public FlashSwapOrderPreview sellAmount(String sellAmount) { + + this.sellAmount = sellAmount; + return this; + } + + /** + * Amount to sell + * @return sellAmount + **/ + @javax.annotation.Nullable + public String getSellAmount() { + return sellAmount; + } + + + public void setSellAmount(String sellAmount) { + this.sellAmount = sellAmount; + } + + public FlashSwapOrderPreview buyCurrency(String buyCurrency) { + + this.buyCurrency = buyCurrency; + return this; + } + + /** + * Name of the purchased asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain + * @return buyCurrency + **/ + @javax.annotation.Nullable + public String getBuyCurrency() { + return buyCurrency; + } + + + public void setBuyCurrency(String buyCurrency) { + this.buyCurrency = buyCurrency; + } + + public FlashSwapOrderPreview buyAmount(String buyAmount) { + + this.buyAmount = buyAmount; + return this; + } + + /** + * Amount to buy + * @return buyAmount + **/ + @javax.annotation.Nullable + public String getBuyAmount() { + return buyAmount; + } + + + public void setBuyAmount(String buyAmount) { + this.buyAmount = buyAmount; + } + + public FlashSwapOrderPreview price(String price) { + + this.price = price; + return this; + } + + /** + * Price + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FlashSwapOrderPreview flashSwapOrderPreview = (FlashSwapOrderPreview) o; + return Objects.equals(this.previewId, flashSwapOrderPreview.previewId) && + Objects.equals(this.sellCurrency, flashSwapOrderPreview.sellCurrency) && + Objects.equals(this.sellAmount, flashSwapOrderPreview.sellAmount) && + Objects.equals(this.buyCurrency, flashSwapOrderPreview.buyCurrency) && + Objects.equals(this.buyAmount, flashSwapOrderPreview.buyAmount) && + Objects.equals(this.price, flashSwapOrderPreview.price); + } + + @Override + public int hashCode() { + return Objects.hash(previewId, sellCurrency, sellAmount, buyCurrency, buyAmount, price); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FlashSwapOrderPreview {\n"); + sb.append(" previewId: ").append(toIndentedString(previewId)).append("\n"); + sb.append(" sellCurrency: ").append(toIndentedString(sellCurrency)).append("\n"); + sb.append(" sellAmount: ").append(toIndentedString(sellAmount)).append("\n"); + sb.append(" buyCurrency: ").append(toIndentedString(buyCurrency)).append("\n"); + sb.append(" buyAmount: ").append(toIndentedString(buyAmount)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapOrderRequest.java b/src/main/java/io/gate/gateapi/models/FlashSwapOrderRequest.java new file mode 100644 index 0000000..da58ff1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FlashSwapOrderRequest.java @@ -0,0 +1,188 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Parameters of flash swap order creation + */ +public class FlashSwapOrderRequest { + public static final String SERIALIZED_NAME_PREVIEW_ID = "preview_id"; + @SerializedName(SERIALIZED_NAME_PREVIEW_ID) + private String previewId; + + public static final String SERIALIZED_NAME_SELL_CURRENCY = "sell_currency"; + @SerializedName(SERIALIZED_NAME_SELL_CURRENCY) + private String sellCurrency; + + public static final String SERIALIZED_NAME_SELL_AMOUNT = "sell_amount"; + @SerializedName(SERIALIZED_NAME_SELL_AMOUNT) + private String sellAmount; + + public static final String SERIALIZED_NAME_BUY_CURRENCY = "buy_currency"; + @SerializedName(SERIALIZED_NAME_BUY_CURRENCY) + private String buyCurrency; + + public static final String SERIALIZED_NAME_BUY_AMOUNT = "buy_amount"; + @SerializedName(SERIALIZED_NAME_BUY_AMOUNT) + private String buyAmount; + + + public FlashSwapOrderRequest previewId(String previewId) { + + this.previewId = previewId; + return this; + } + + /** + * Preview result ID + * @return previewId + **/ + public String getPreviewId() { + return previewId; + } + + + public void setPreviewId(String previewId) { + this.previewId = previewId; + } + + public FlashSwapOrderRequest sellCurrency(String sellCurrency) { + + this.sellCurrency = sellCurrency; + return this; + } + + /** + * 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 + * @return sellCurrency + **/ + public String getSellCurrency() { + return sellCurrency; + } + + + public void setSellCurrency(String sellCurrency) { + this.sellCurrency = sellCurrency; + } + + public FlashSwapOrderRequest sellAmount(String sellAmount) { + + this.sellAmount = sellAmount; + return this; + } + + /** + * Amount to sell (based on the preview result) + * @return sellAmount + **/ + public String getSellAmount() { + return sellAmount; + } + + + public void setSellAmount(String sellAmount) { + this.sellAmount = sellAmount; + } + + public FlashSwapOrderRequest buyCurrency(String buyCurrency) { + + this.buyCurrency = buyCurrency; + return this; + } + + /** + * 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 + * @return buyCurrency + **/ + public String getBuyCurrency() { + return buyCurrency; + } + + + public void setBuyCurrency(String buyCurrency) { + this.buyCurrency = buyCurrency; + } + + public FlashSwapOrderRequest buyAmount(String buyAmount) { + + this.buyAmount = buyAmount; + return this; + } + + /** + * Amount to buy (based on the preview result) + * @return buyAmount + **/ + public String getBuyAmount() { + return buyAmount; + } + + + public void setBuyAmount(String buyAmount) { + this.buyAmount = buyAmount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FlashSwapOrderRequest flashSwapOrderRequest = (FlashSwapOrderRequest) o; + return Objects.equals(this.previewId, flashSwapOrderRequest.previewId) && + Objects.equals(this.sellCurrency, flashSwapOrderRequest.sellCurrency) && + Objects.equals(this.sellAmount, flashSwapOrderRequest.sellAmount) && + Objects.equals(this.buyCurrency, flashSwapOrderRequest.buyCurrency) && + Objects.equals(this.buyAmount, flashSwapOrderRequest.buyAmount); + } + + @Override + public int hashCode() { + return Objects.hash(previewId, sellCurrency, sellAmount, buyCurrency, buyAmount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FlashSwapOrderRequest {\n"); + sb.append(" previewId: ").append(toIndentedString(previewId)).append("\n"); + sb.append(" sellCurrency: ").append(toIndentedString(sellCurrency)).append("\n"); + sb.append(" sellAmount: ").append(toIndentedString(sellAmount)).append("\n"); + sb.append(" buyCurrency: ").append(toIndentedString(buyCurrency)).append("\n"); + sb.append(" buyAmount: ").append(toIndentedString(buyAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapPreviewRequest.java b/src/main/java/io/gate/gateapi/models/FlashSwapPreviewRequest.java new file mode 100644 index 0000000..3f3de68 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FlashSwapPreviewRequest.java @@ -0,0 +1,165 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Parameters of flash swap order creation + */ +public class FlashSwapPreviewRequest { + public static final String SERIALIZED_NAME_SELL_CURRENCY = "sell_currency"; + @SerializedName(SERIALIZED_NAME_SELL_CURRENCY) + private String sellCurrency; + + public static final String SERIALIZED_NAME_SELL_AMOUNT = "sell_amount"; + @SerializedName(SERIALIZED_NAME_SELL_AMOUNT) + private String sellAmount; + + public static final String SERIALIZED_NAME_BUY_CURRENCY = "buy_currency"; + @SerializedName(SERIALIZED_NAME_BUY_CURRENCY) + private String buyCurrency; + + public static final String SERIALIZED_NAME_BUY_AMOUNT = "buy_amount"; + @SerializedName(SERIALIZED_NAME_BUY_AMOUNT) + private String buyAmount; + + + public FlashSwapPreviewRequest sellCurrency(String sellCurrency) { + + this.sellCurrency = sellCurrency; + return this; + } + + /** + * 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 + * @return sellCurrency + **/ + public String getSellCurrency() { + return sellCurrency; + } + + + public void setSellCurrency(String sellCurrency) { + this.sellCurrency = sellCurrency; + } + + public FlashSwapPreviewRequest sellAmount(String sellAmount) { + + this.sellAmount = sellAmount; + return this; + } + + /** + * Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` + * @return sellAmount + **/ + @javax.annotation.Nullable + public String getSellAmount() { + return sellAmount; + } + + + public void setSellAmount(String sellAmount) { + this.sellAmount = sellAmount; + } + + public FlashSwapPreviewRequest buyCurrency(String buyCurrency) { + + this.buyCurrency = buyCurrency; + return this; + } + + /** + * 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 + * @return buyCurrency + **/ + public String getBuyCurrency() { + return buyCurrency; + } + + + public void setBuyCurrency(String buyCurrency) { + this.buyCurrency = buyCurrency; + } + + public FlashSwapPreviewRequest buyAmount(String buyAmount) { + + this.buyAmount = buyAmount; + return this; + } + + /** + * Amount to buy. It is required to choose one parameter between `sell_amount` and `buy_amount` + * @return buyAmount + **/ + @javax.annotation.Nullable + public String getBuyAmount() { + return buyAmount; + } + + + public void setBuyAmount(String buyAmount) { + this.buyAmount = buyAmount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FlashSwapPreviewRequest flashSwapPreviewRequest = (FlashSwapPreviewRequest) o; + return Objects.equals(this.sellCurrency, flashSwapPreviewRequest.sellCurrency) && + Objects.equals(this.sellAmount, flashSwapPreviewRequest.sellAmount) && + Objects.equals(this.buyCurrency, flashSwapPreviewRequest.buyCurrency) && + Objects.equals(this.buyAmount, flashSwapPreviewRequest.buyAmount); + } + + @Override + public int hashCode() { + return Objects.hash(sellCurrency, sellAmount, buyCurrency, buyAmount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FlashSwapPreviewRequest {\n"); + sb.append(" sellCurrency: ").append(toIndentedString(sellCurrency)).append("\n"); + sb.append(" sellAmount: ").append(toIndentedString(sellAmount)).append("\n"); + sb.append(" buyCurrency: ").append(toIndentedString(buyCurrency)).append("\n"); + sb.append(" buyAmount: ").append(toIndentedString(buyAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FundingAccount.java b/src/main/java/io/gate/gateapi/models/FundingAccount.java index 0d875ff..6255c12 100644 --- a/src/main/java/io/gate/gateapi/models/FundingAccount.java +++ b/src/main/java/io/gate/gateapi/models/FundingAccount.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/models/FundingRateRecord.java b/src/main/java/io/gate/gateapi/models/FundingRateRecord.java index 9c0d773..4c8bdc7 100644 --- a/src/main/java/io/gate/gateapi/models/FundingRateRecord.java +++ b/src/main/java/io/gate/gateapi/models/FundingRateRecord.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/models/FutureCancelOrderResult.java b/src/main/java/io/gate/gateapi/models/FutureCancelOrderResult.java new file mode 100644 index 0000000..45ef9e3 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FutureCancelOrderResult.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Order cancellation result + */ +public class FutureCancelOrderResult { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_SUCCEEDED = "succeeded"; + @SerializedName(SERIALIZED_NAME_SUCCEEDED) + private Boolean succeeded; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + + public FutureCancelOrderResult id(String id) { + + this.id = id; + return this; + } + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + public FutureCancelOrderResult userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public FutureCancelOrderResult succeeded(Boolean succeeded) { + + this.succeeded = succeeded; + return this; + } + + /** + * Whether cancellation succeeded + * @return succeeded + **/ + @javax.annotation.Nullable + public Boolean getSucceeded() { + return succeeded; + } + + + public void setSucceeded(Boolean succeeded) { + this.succeeded = succeeded; + } + + public FutureCancelOrderResult message(String message) { + + this.message = message; + return this; + } + + /** + * Error description when cancellation fails, empty if successful + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FutureCancelOrderResult futureCancelOrderResult = (FutureCancelOrderResult) o; + return Objects.equals(this.id, futureCancelOrderResult.id) && + Objects.equals(this.userId, futureCancelOrderResult.userId) && + Objects.equals(this.succeeded, futureCancelOrderResult.succeeded) && + Objects.equals(this.message, futureCancelOrderResult.message); + } + + @Override + public int hashCode() { + return Objects.hash(id, userId, succeeded, message); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FutureCancelOrderResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesAccount.java b/src/main/java/io/gate/gateapi/models/FuturesAccount.java index de04c7f..ca7395d 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesAccount.java +++ b/src/main/java/io/gate/gateapi/models/FuturesAccount.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 @@ -17,6 +17,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.FuturesAccountHistory; import java.io.IOException; /** @@ -55,6 +56,82 @@ public class FuturesAccount { @SerializedName(SERIALIZED_NAME_IN_DUAL_MODE) private Boolean inDualMode; + public static final String SERIALIZED_NAME_POSITION_MODE = "position_mode"; + @SerializedName(SERIALIZED_NAME_POSITION_MODE) + private String positionMode; + + public static final String SERIALIZED_NAME_ENABLE_CREDIT = "enable_credit"; + @SerializedName(SERIALIZED_NAME_ENABLE_CREDIT) + private Boolean enableCredit; + + public static final String SERIALIZED_NAME_POSITION_INITIAL_MARGIN = "position_initial_margin"; + @SerializedName(SERIALIZED_NAME_POSITION_INITIAL_MARGIN) + private String positionInitialMargin; + + public static final String SERIALIZED_NAME_MAINTENANCE_MARGIN = "maintenance_margin"; + @SerializedName(SERIALIZED_NAME_MAINTENANCE_MARGIN) + private String maintenanceMargin; + + public static final String SERIALIZED_NAME_BONUS = "bonus"; + @SerializedName(SERIALIZED_NAME_BONUS) + private String bonus; + + public static final String SERIALIZED_NAME_ENABLE_EVOLVED_CLASSIC = "enable_evolved_classic"; + @SerializedName(SERIALIZED_NAME_ENABLE_EVOLVED_CLASSIC) + private Boolean enableEvolvedClassic; + + public static final String SERIALIZED_NAME_CROSS_ORDER_MARGIN = "cross_order_margin"; + @SerializedName(SERIALIZED_NAME_CROSS_ORDER_MARGIN) + private String crossOrderMargin; + + public static final String SERIALIZED_NAME_CROSS_INITIAL_MARGIN = "cross_initial_margin"; + @SerializedName(SERIALIZED_NAME_CROSS_INITIAL_MARGIN) + private String crossInitialMargin; + + public static final String SERIALIZED_NAME_CROSS_MAINTENANCE_MARGIN = "cross_maintenance_margin"; + @SerializedName(SERIALIZED_NAME_CROSS_MAINTENANCE_MARGIN) + private String crossMaintenanceMargin; + + public static final String SERIALIZED_NAME_CROSS_UNREALISED_PNL = "cross_unrealised_pnl"; + @SerializedName(SERIALIZED_NAME_CROSS_UNREALISED_PNL) + private String crossUnrealisedPnl; + + public static final String SERIALIZED_NAME_CROSS_AVAILABLE = "cross_available"; + @SerializedName(SERIALIZED_NAME_CROSS_AVAILABLE) + private String crossAvailable; + + public static final String SERIALIZED_NAME_CROSS_MARGIN_BALANCE = "cross_margin_balance"; + @SerializedName(SERIALIZED_NAME_CROSS_MARGIN_BALANCE) + private String crossMarginBalance; + + public static final String SERIALIZED_NAME_CROSS_MMR = "cross_mmr"; + @SerializedName(SERIALIZED_NAME_CROSS_MMR) + private String crossMmr; + + public static final String SERIALIZED_NAME_CROSS_IMR = "cross_imr"; + @SerializedName(SERIALIZED_NAME_CROSS_IMR) + private String crossImr; + + public static final String SERIALIZED_NAME_ISOLATED_POSITION_MARGIN = "isolated_position_margin"; + @SerializedName(SERIALIZED_NAME_ISOLATED_POSITION_MARGIN) + private String isolatedPositionMargin; + + public static final String SERIALIZED_NAME_ENABLE_NEW_DUAL_MODE = "enable_new_dual_mode"; + @SerializedName(SERIALIZED_NAME_ENABLE_NEW_DUAL_MODE) + private Boolean enableNewDualMode; + + public static final String SERIALIZED_NAME_MARGIN_MODE = "margin_mode"; + @SerializedName(SERIALIZED_NAME_MARGIN_MODE) + private Integer marginMode; + + public static final String SERIALIZED_NAME_ENABLE_TIERED_MM = "enable_tiered_mm"; + @SerializedName(SERIALIZED_NAME_ENABLE_TIERED_MM) + private Boolean enableTieredMm; + + public static final String SERIALIZED_NAME_HISTORY = "history"; + @SerializedName(SERIALIZED_NAME_HISTORY) + private FuturesAccountHistory history; + public FuturesAccount total(String total) { @@ -63,7 +140,7 @@ public FuturesAccount total(String total) { } /** - * Total assets, total = position_margin + order_margin + available + * total is the balance after the user's accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) * @return total **/ @javax.annotation.Nullable @@ -143,7 +220,7 @@ public FuturesAccount available(String available) { } /** - * Available balance to transfer out or trade + * Available balance for transferring or trading (including bonus. Bonus cannot be withdrawn, so transfer amount needs to deduct bonus) * @return available **/ @javax.annotation.Nullable @@ -163,7 +240,7 @@ public FuturesAccount point(String point) { } /** - * POINT amount + * Point card amount * @return point **/ @javax.annotation.Nullable @@ -183,7 +260,7 @@ public FuturesAccount currency(String currency) { } /** - * Settle currency + * Settlement currency * @return currency **/ @javax.annotation.Nullable @@ -215,6 +292,386 @@ public Boolean getInDualMode() { public void setInDualMode(Boolean inDualMode) { this.inDualMode = inDualMode; } + + public FuturesAccount positionMode(String positionMode) { + + this.positionMode = positionMode; + return this; + } + + /** + * Position mode: single - one-way, dual - dual-side, split - sub-positions (in_dual_mode is deprecated) + * @return positionMode + **/ + @javax.annotation.Nullable + public String getPositionMode() { + return positionMode; + } + + + public void setPositionMode(String positionMode) { + this.positionMode = positionMode; + } + + public FuturesAccount enableCredit(Boolean enableCredit) { + + this.enableCredit = enableCredit; + return this; + } + + /** + * Whether portfolio margin account mode is enabled + * @return enableCredit + **/ + @javax.annotation.Nullable + public Boolean getEnableCredit() { + return enableCredit; + } + + + public void setEnableCredit(Boolean enableCredit) { + this.enableCredit = enableCredit; + } + + public FuturesAccount positionInitialMargin(String positionInitialMargin) { + + this.positionInitialMargin = positionInitialMargin; + return this; + } + + /** + * Initial margin occupied by positions, applicable to unified account mode + * @return positionInitialMargin + **/ + @javax.annotation.Nullable + public String getPositionInitialMargin() { + return positionInitialMargin; + } + + + public void setPositionInitialMargin(String positionInitialMargin) { + this.positionInitialMargin = positionInitialMargin; + } + + public FuturesAccount maintenanceMargin(String maintenanceMargin) { + + this.maintenanceMargin = maintenanceMargin; + return this; + } + + /** + * Maintenance margin occupied by positions, applicable to new classic account margin mode and unified account mode + * @return maintenanceMargin + **/ + @javax.annotation.Nullable + public String getMaintenanceMargin() { + return maintenanceMargin; + } + + + public void setMaintenanceMargin(String maintenanceMargin) { + this.maintenanceMargin = maintenanceMargin; + } + + public FuturesAccount bonus(String bonus) { + + this.bonus = bonus; + return this; + } + + /** + * Bonus + * @return bonus + **/ + @javax.annotation.Nullable + public String getBonus() { + return bonus; + } + + + public void setBonus(String bonus) { + this.bonus = bonus; + } + + public FuturesAccount enableEvolvedClassic(Boolean enableEvolvedClassic) { + + this.enableEvolvedClassic = enableEvolvedClassic; + return this; + } + + /** + * Classic account margin mode, true-new mode, false-old mode + * @return enableEvolvedClassic + **/ + @javax.annotation.Nullable + public Boolean getEnableEvolvedClassic() { + return enableEvolvedClassic; + } + + + public void setEnableEvolvedClassic(Boolean enableEvolvedClassic) { + this.enableEvolvedClassic = enableEvolvedClassic; + } + + public FuturesAccount crossOrderMargin(String crossOrderMargin) { + + this.crossOrderMargin = crossOrderMargin; + return this; + } + + /** + * Cross margin order margin, applicable to new classic account margin mode + * @return crossOrderMargin + **/ + @javax.annotation.Nullable + public String getCrossOrderMargin() { + return crossOrderMargin; + } + + + public void setCrossOrderMargin(String crossOrderMargin) { + this.crossOrderMargin = crossOrderMargin; + } + + public FuturesAccount crossInitialMargin(String crossInitialMargin) { + + this.crossInitialMargin = crossInitialMargin; + return this; + } + + /** + * Cross margin initial margin, applicable to new classic account margin mode + * @return crossInitialMargin + **/ + @javax.annotation.Nullable + public String getCrossInitialMargin() { + return crossInitialMargin; + } + + + public void setCrossInitialMargin(String crossInitialMargin) { + this.crossInitialMargin = crossInitialMargin; + } + + public FuturesAccount crossMaintenanceMargin(String crossMaintenanceMargin) { + + this.crossMaintenanceMargin = crossMaintenanceMargin; + return this; + } + + /** + * Cross margin maintenance margin, applicable to new classic account margin mode + * @return crossMaintenanceMargin + **/ + @javax.annotation.Nullable + public String getCrossMaintenanceMargin() { + return crossMaintenanceMargin; + } + + + public void setCrossMaintenanceMargin(String crossMaintenanceMargin) { + this.crossMaintenanceMargin = crossMaintenanceMargin; + } + + public FuturesAccount crossUnrealisedPnl(String crossUnrealisedPnl) { + + this.crossUnrealisedPnl = crossUnrealisedPnl; + return this; + } + + /** + * Cross margin unrealized P&L, applicable to new classic account margin mode + * @return crossUnrealisedPnl + **/ + @javax.annotation.Nullable + public String getCrossUnrealisedPnl() { + return crossUnrealisedPnl; + } + + + public void setCrossUnrealisedPnl(String crossUnrealisedPnl) { + this.crossUnrealisedPnl = crossUnrealisedPnl; + } + + public FuturesAccount crossAvailable(String crossAvailable) { + + this.crossAvailable = crossAvailable; + return this; + } + + /** + * Cross margin available balance, applicable to new classic account margin mode + * @return crossAvailable + **/ + @javax.annotation.Nullable + public String getCrossAvailable() { + return crossAvailable; + } + + + public void setCrossAvailable(String crossAvailable) { + this.crossAvailable = crossAvailable; + } + + public FuturesAccount crossMarginBalance(String crossMarginBalance) { + + this.crossMarginBalance = crossMarginBalance; + return this; + } + + /** + * Cross margin balance, applicable to new classic account margin mode + * @return crossMarginBalance + **/ + @javax.annotation.Nullable + public String getCrossMarginBalance() { + return crossMarginBalance; + } + + + public void setCrossMarginBalance(String crossMarginBalance) { + this.crossMarginBalance = crossMarginBalance; + } + + public FuturesAccount crossMmr(String crossMmr) { + + this.crossMmr = crossMmr; + return this; + } + + /** + * Cross margin maintenance margin rate, applicable to new classic account margin mode + * @return crossMmr + **/ + @javax.annotation.Nullable + public String getCrossMmr() { + return crossMmr; + } + + + public void setCrossMmr(String crossMmr) { + this.crossMmr = crossMmr; + } + + public FuturesAccount crossImr(String crossImr) { + + this.crossImr = crossImr; + return this; + } + + /** + * Cross margin initial margin rate, applicable to new classic account margin mode + * @return crossImr + **/ + @javax.annotation.Nullable + public String getCrossImr() { + return crossImr; + } + + + public void setCrossImr(String crossImr) { + this.crossImr = crossImr; + } + + public FuturesAccount isolatedPositionMargin(String isolatedPositionMargin) { + + this.isolatedPositionMargin = isolatedPositionMargin; + return this; + } + + /** + * Isolated position margin, applicable to new classic account margin mode + * @return isolatedPositionMargin + **/ + @javax.annotation.Nullable + public String getIsolatedPositionMargin() { + return isolatedPositionMargin; + } + + + public void setIsolatedPositionMargin(String isolatedPositionMargin) { + this.isolatedPositionMargin = isolatedPositionMargin; + } + + public FuturesAccount enableNewDualMode(Boolean enableNewDualMode) { + + this.enableNewDualMode = enableNewDualMode; + return this; + } + + /** + * Whether to open a new two-way position mode + * @return enableNewDualMode + **/ + @javax.annotation.Nullable + public Boolean getEnableNewDualMode() { + return enableNewDualMode; + } + + + public void setEnableNewDualMode(Boolean enableNewDualMode) { + this.enableNewDualMode = enableNewDualMode; + } + + public FuturesAccount marginMode(Integer marginMode) { + + this.marginMode = marginMode; + return this; + } + + /** + * Margin mode, 0-classic margin mode, 1-cross-currency margin mode, 2-combined margin mode + * @return marginMode + **/ + @javax.annotation.Nullable + public Integer getMarginMode() { + return marginMode; + } + + + public void setMarginMode(Integer marginMode) { + this.marginMode = marginMode; + } + + public FuturesAccount enableTieredMm(Boolean enableTieredMm) { + + this.enableTieredMm = enableTieredMm; + return this; + } + + /** + * Whether to enable tiered maintenance margin calculation + * @return enableTieredMm + **/ + @javax.annotation.Nullable + public Boolean getEnableTieredMm() { + return enableTieredMm; + } + + + public void setEnableTieredMm(Boolean enableTieredMm) { + this.enableTieredMm = enableTieredMm; + } + + public FuturesAccount history(FuturesAccountHistory history) { + + this.history = history; + return this; + } + + /** + * Get history + * @return history + **/ + @javax.annotation.Nullable + public FuturesAccountHistory getHistory() { + return history; + } + + + public void setHistory(FuturesAccountHistory history) { + this.history = history; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,12 +688,31 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.available, futuresAccount.available) && Objects.equals(this.point, futuresAccount.point) && Objects.equals(this.currency, futuresAccount.currency) && - Objects.equals(this.inDualMode, futuresAccount.inDualMode); + Objects.equals(this.inDualMode, futuresAccount.inDualMode) && + Objects.equals(this.positionMode, futuresAccount.positionMode) && + Objects.equals(this.enableCredit, futuresAccount.enableCredit) && + Objects.equals(this.positionInitialMargin, futuresAccount.positionInitialMargin) && + Objects.equals(this.maintenanceMargin, futuresAccount.maintenanceMargin) && + Objects.equals(this.bonus, futuresAccount.bonus) && + Objects.equals(this.enableEvolvedClassic, futuresAccount.enableEvolvedClassic) && + Objects.equals(this.crossOrderMargin, futuresAccount.crossOrderMargin) && + Objects.equals(this.crossInitialMargin, futuresAccount.crossInitialMargin) && + Objects.equals(this.crossMaintenanceMargin, futuresAccount.crossMaintenanceMargin) && + Objects.equals(this.crossUnrealisedPnl, futuresAccount.crossUnrealisedPnl) && + Objects.equals(this.crossAvailable, futuresAccount.crossAvailable) && + Objects.equals(this.crossMarginBalance, futuresAccount.crossMarginBalance) && + Objects.equals(this.crossMmr, futuresAccount.crossMmr) && + Objects.equals(this.crossImr, futuresAccount.crossImr) && + Objects.equals(this.isolatedPositionMargin, futuresAccount.isolatedPositionMargin) && + Objects.equals(this.enableNewDualMode, futuresAccount.enableNewDualMode) && + Objects.equals(this.marginMode, futuresAccount.marginMode) && + Objects.equals(this.enableTieredMm, futuresAccount.enableTieredMm) && + Objects.equals(this.history, futuresAccount.history); } @Override public int hashCode() { - return Objects.hash(total, unrealisedPnl, positionMargin, orderMargin, available, point, currency, inDualMode); + return Objects.hash(total, unrealisedPnl, positionMargin, orderMargin, available, point, currency, inDualMode, positionMode, enableCredit, positionInitialMargin, maintenanceMargin, bonus, enableEvolvedClassic, crossOrderMargin, crossInitialMargin, crossMaintenanceMargin, crossUnrealisedPnl, crossAvailable, crossMarginBalance, crossMmr, crossImr, isolatedPositionMargin, enableNewDualMode, marginMode, enableTieredMm, history); } @@ -252,6 +728,25 @@ public String toString() { sb.append(" point: ").append(toIndentedString(point)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" inDualMode: ").append(toIndentedString(inDualMode)).append("\n"); + sb.append(" positionMode: ").append(toIndentedString(positionMode)).append("\n"); + sb.append(" enableCredit: ").append(toIndentedString(enableCredit)).append("\n"); + sb.append(" positionInitialMargin: ").append(toIndentedString(positionInitialMargin)).append("\n"); + sb.append(" maintenanceMargin: ").append(toIndentedString(maintenanceMargin)).append("\n"); + sb.append(" bonus: ").append(toIndentedString(bonus)).append("\n"); + sb.append(" enableEvolvedClassic: ").append(toIndentedString(enableEvolvedClassic)).append("\n"); + sb.append(" crossOrderMargin: ").append(toIndentedString(crossOrderMargin)).append("\n"); + sb.append(" crossInitialMargin: ").append(toIndentedString(crossInitialMargin)).append("\n"); + sb.append(" crossMaintenanceMargin: ").append(toIndentedString(crossMaintenanceMargin)).append("\n"); + sb.append(" crossUnrealisedPnl: ").append(toIndentedString(crossUnrealisedPnl)).append("\n"); + sb.append(" crossAvailable: ").append(toIndentedString(crossAvailable)).append("\n"); + sb.append(" crossMarginBalance: ").append(toIndentedString(crossMarginBalance)).append("\n"); + sb.append(" crossMmr: ").append(toIndentedString(crossMmr)).append("\n"); + sb.append(" crossImr: ").append(toIndentedString(crossImr)).append("\n"); + sb.append(" isolatedPositionMargin: ").append(toIndentedString(isolatedPositionMargin)).append("\n"); + sb.append(" enableNewDualMode: ").append(toIndentedString(enableNewDualMode)).append("\n"); + sb.append(" marginMode: ").append(toIndentedString(marginMode)).append("\n"); + sb.append(" enableTieredMm: ").append(toIndentedString(enableTieredMm)).append("\n"); + sb.append(" history: ").append(toIndentedString(history)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/FuturesAccountBook.java b/src/main/java/io/gate/gateapi/models/FuturesAccountBook.java index a9e8963..bcf6332 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesAccountBook.java +++ b/src/main/java/io/gate/gateapi/models/FuturesAccountBook.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 @@ -36,7 +36,7 @@ public class FuturesAccountBook { private String balance; /** - * 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 + * 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 */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -54,7 +54,9 @@ public enum TypeEnum { POINT_FEE("point_fee"), - POINT_REFR("point_refr"); + POINT_REFR("point_refr"), + + BONUS_OFFSET("bonus_offset"); private String value; @@ -102,6 +104,18 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TEXT) private String text; + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_TRADE_ID = "trade_id"; + @SerializedName(SERIALIZED_NAME_TRADE_ID) + private String tradeId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + public FuturesAccountBook time(Double time) { @@ -170,7 +184,7 @@ public FuturesAccountBook type(TypeEnum type) { } /** - * Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate + * 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 * @return type **/ @javax.annotation.Nullable @@ -202,6 +216,66 @@ public String getText() { public void setText(String text) { this.text = text; } + + public FuturesAccountBook contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures contract, the field is only available for data after 2023-10-30 + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public FuturesAccountBook tradeId(String tradeId) { + + this.tradeId = tradeId; + return this; + } + + /** + * trade id + * @return tradeId + **/ + @javax.annotation.Nullable + public String getTradeId() { + return tradeId; + } + + + public void setTradeId(String tradeId) { + this.tradeId = tradeId; + } + + public FuturesAccountBook id(String id) { + + this.id = id; + return this; + } + + /** + * Account change record ID + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -215,12 +289,15 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.change, futuresAccountBook.change) && Objects.equals(this.balance, futuresAccountBook.balance) && Objects.equals(this.type, futuresAccountBook.type) && - Objects.equals(this.text, futuresAccountBook.text); + Objects.equals(this.text, futuresAccountBook.text) && + Objects.equals(this.contract, futuresAccountBook.contract) && + Objects.equals(this.tradeId, futuresAccountBook.tradeId) && + Objects.equals(this.id, futuresAccountBook.id); } @Override public int hashCode() { - return Objects.hash(time, change, balance, type, text); + return Objects.hash(time, change, balance, type, text, contract, tradeId, id); } @@ -233,6 +310,9 @@ public String toString() { sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" tradeId: ").append(toIndentedString(tradeId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/FuturesAccountHistory.java b/src/main/java/io/gate/gateapi/models/FuturesAccountHistory.java new file mode 100644 index 0000000..0b76d2d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesAccountHistory.java @@ -0,0 +1,323 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Statistical data + */ +public class FuturesAccountHistory { + public static final String SERIALIZED_NAME_DNW = "dnw"; + @SerializedName(SERIALIZED_NAME_DNW) + private String dnw; + + public static final String SERIALIZED_NAME_PNL = "pnl"; + @SerializedName(SERIALIZED_NAME_PNL) + private String pnl; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_REFR = "refr"; + @SerializedName(SERIALIZED_NAME_REFR) + private String refr; + + public static final String SERIALIZED_NAME_FUND = "fund"; + @SerializedName(SERIALIZED_NAME_FUND) + private String fund; + + public static final String SERIALIZED_NAME_POINT_DNW = "point_dnw"; + @SerializedName(SERIALIZED_NAME_POINT_DNW) + private String pointDnw; + + public static final String SERIALIZED_NAME_POINT_FEE = "point_fee"; + @SerializedName(SERIALIZED_NAME_POINT_FEE) + private String pointFee; + + public static final String SERIALIZED_NAME_POINT_REFR = "point_refr"; + @SerializedName(SERIALIZED_NAME_POINT_REFR) + private String pointRefr; + + public static final String SERIALIZED_NAME_BONUS_DNW = "bonus_dnw"; + @SerializedName(SERIALIZED_NAME_BONUS_DNW) + private String bonusDnw; + + public static final String SERIALIZED_NAME_BONUS_OFFSET = "bonus_offset"; + @SerializedName(SERIALIZED_NAME_BONUS_OFFSET) + private String bonusOffset; + + + public FuturesAccountHistory dnw(String dnw) { + + this.dnw = dnw; + return this; + } + + /** + * total amount of deposit and withdraw + * @return dnw + **/ + @javax.annotation.Nullable + public String getDnw() { + return dnw; + } + + + public void setDnw(String dnw) { + this.dnw = dnw; + } + + public FuturesAccountHistory pnl(String pnl) { + + this.pnl = pnl; + return this; + } + + /** + * total amount of trading profit and loss + * @return pnl + **/ + @javax.annotation.Nullable + public String getPnl() { + return pnl; + } + + + public void setPnl(String pnl) { + this.pnl = pnl; + } + + public FuturesAccountHistory fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * total amount of fee + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public FuturesAccountHistory refr(String refr) { + + this.refr = refr; + return this; + } + + /** + * total amount of referrer rebates + * @return refr + **/ + @javax.annotation.Nullable + public String getRefr() { + return refr; + } + + + public void setRefr(String refr) { + this.refr = refr; + } + + public FuturesAccountHistory fund(String fund) { + + this.fund = fund; + return this; + } + + /** + * total amount of funding costs + * @return fund + **/ + @javax.annotation.Nullable + public String getFund() { + return fund; + } + + + public void setFund(String fund) { + this.fund = fund; + } + + public FuturesAccountHistory pointDnw(String pointDnw) { + + this.pointDnw = pointDnw; + return this; + } + + /** + * total amount of point deposit and withdraw + * @return pointDnw + **/ + @javax.annotation.Nullable + public String getPointDnw() { + return pointDnw; + } + + + public void setPointDnw(String pointDnw) { + this.pointDnw = pointDnw; + } + + public FuturesAccountHistory pointFee(String pointFee) { + + this.pointFee = pointFee; + return this; + } + + /** + * total amount of point fee + * @return pointFee + **/ + @javax.annotation.Nullable + public String getPointFee() { + return pointFee; + } + + + public void setPointFee(String pointFee) { + this.pointFee = pointFee; + } + + public FuturesAccountHistory pointRefr(String pointRefr) { + + this.pointRefr = pointRefr; + return this; + } + + /** + * total amount of referrer rebates of point fee + * @return pointRefr + **/ + @javax.annotation.Nullable + public String getPointRefr() { + return pointRefr; + } + + + public void setPointRefr(String pointRefr) { + this.pointRefr = pointRefr; + } + + public FuturesAccountHistory bonusDnw(String bonusDnw) { + + this.bonusDnw = bonusDnw; + return this; + } + + /** + * total amount of perpetual contract bonus transfer + * @return bonusDnw + **/ + @javax.annotation.Nullable + public String getBonusDnw() { + return bonusDnw; + } + + + public void setBonusDnw(String bonusDnw) { + this.bonusDnw = bonusDnw; + } + + public FuturesAccountHistory bonusOffset(String bonusOffset) { + + this.bonusOffset = bonusOffset; + return this; + } + + /** + * total amount of perpetual contract bonus deduction + * @return bonusOffset + **/ + @javax.annotation.Nullable + public String getBonusOffset() { + return bonusOffset; + } + + + public void setBonusOffset(String bonusOffset) { + this.bonusOffset = bonusOffset; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesAccountHistory futuresAccountHistory = (FuturesAccountHistory) o; + return Objects.equals(this.dnw, futuresAccountHistory.dnw) && + Objects.equals(this.pnl, futuresAccountHistory.pnl) && + Objects.equals(this.fee, futuresAccountHistory.fee) && + Objects.equals(this.refr, futuresAccountHistory.refr) && + Objects.equals(this.fund, futuresAccountHistory.fund) && + Objects.equals(this.pointDnw, futuresAccountHistory.pointDnw) && + Objects.equals(this.pointFee, futuresAccountHistory.pointFee) && + Objects.equals(this.pointRefr, futuresAccountHistory.pointRefr) && + Objects.equals(this.bonusDnw, futuresAccountHistory.bonusDnw) && + Objects.equals(this.bonusOffset, futuresAccountHistory.bonusOffset); + } + + @Override + public int hashCode() { + return Objects.hash(dnw, pnl, fee, refr, fund, pointDnw, pointFee, pointRefr, bonusDnw, bonusOffset); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesAccountHistory {\n"); + sb.append(" dnw: ").append(toIndentedString(dnw)).append("\n"); + sb.append(" pnl: ").append(toIndentedString(pnl)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" refr: ").append(toIndentedString(refr)).append("\n"); + sb.append(" fund: ").append(toIndentedString(fund)).append("\n"); + sb.append(" pointDnw: ").append(toIndentedString(pointDnw)).append("\n"); + sb.append(" pointFee: ").append(toIndentedString(pointFee)).append("\n"); + sb.append(" pointRefr: ").append(toIndentedString(pointRefr)).append("\n"); + sb.append(" bonusDnw: ").append(toIndentedString(bonusDnw)).append("\n"); + sb.append(" bonusOffset: ").append(toIndentedString(bonusOffset)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesAutoDeleverage.java b/src/main/java/io/gate/gateapi/models/FuturesAutoDeleverage.java new file mode 100644 index 0000000..9ac4f6b --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesAutoDeleverage.java @@ -0,0 +1,223 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * FuturesAutoDeleverage + */ +public class FuturesAutoDeleverage { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Long time; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private Long user; + + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + public static final String SERIALIZED_NAME_CROSS_LEVERAGE_LIMIT = "cross_leverage_limit"; + @SerializedName(SERIALIZED_NAME_CROSS_LEVERAGE_LIMIT) + private String crossLeverageLimit; + + public static final String SERIALIZED_NAME_ENTRY_PRICE = "entry_price"; + @SerializedName(SERIALIZED_NAME_ENTRY_PRICE) + private String entryPrice; + + public static final String SERIALIZED_NAME_FILL_PRICE = "fill_price"; + @SerializedName(SERIALIZED_NAME_FILL_PRICE) + private String fillPrice; + + public static final String SERIALIZED_NAME_TRADE_SIZE = "trade_size"; + @SerializedName(SERIALIZED_NAME_TRADE_SIZE) + private Long tradeSize; + + public static final String SERIALIZED_NAME_POSITION_SIZE = "position_size"; + @SerializedName(SERIALIZED_NAME_POSITION_SIZE) + private Long positionSize; + + + /** + * Automatic deleveraging time + * @return time + **/ + @javax.annotation.Nullable + public Long getTime() { + return time; + } + + + /** + * User ID + * @return user + **/ + @javax.annotation.Nullable + public Long getUser() { + return user; + } + + + /** + * Order ID. Order IDs before 2023-02-20 are null + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + /** + * Futures contract + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + /** + * Position leverage + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + /** + * Cross margin leverage (valid only when `leverage` is 0) + * @return crossLeverageLimit + **/ + @javax.annotation.Nullable + public String getCrossLeverageLimit() { + return crossLeverageLimit; + } + + + /** + * Average entry price + * @return entryPrice + **/ + @javax.annotation.Nullable + public String getEntryPrice() { + return entryPrice; + } + + + /** + * Average fill price + * @return fillPrice + **/ + @javax.annotation.Nullable + public String getFillPrice() { + return fillPrice; + } + + + /** + * Trading size + * @return tradeSize + **/ + @javax.annotation.Nullable + public Long getTradeSize() { + return tradeSize; + } + + + /** + * Positions after auto-deleveraging + * @return positionSize + **/ + @javax.annotation.Nullable + public Long getPositionSize() { + return positionSize; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesAutoDeleverage futuresAutoDeleverage = (FuturesAutoDeleverage) o; + return Objects.equals(this.time, futuresAutoDeleverage.time) && + Objects.equals(this.user, futuresAutoDeleverage.user) && + Objects.equals(this.orderId, futuresAutoDeleverage.orderId) && + Objects.equals(this.contract, futuresAutoDeleverage.contract) && + Objects.equals(this.leverage, futuresAutoDeleverage.leverage) && + Objects.equals(this.crossLeverageLimit, futuresAutoDeleverage.crossLeverageLimit) && + Objects.equals(this.entryPrice, futuresAutoDeleverage.entryPrice) && + Objects.equals(this.fillPrice, futuresAutoDeleverage.fillPrice) && + Objects.equals(this.tradeSize, futuresAutoDeleverage.tradeSize) && + Objects.equals(this.positionSize, futuresAutoDeleverage.positionSize); + } + + @Override + public int hashCode() { + return Objects.hash(time, user, orderId, contract, leverage, crossLeverageLimit, entryPrice, fillPrice, tradeSize, positionSize); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesAutoDeleverage {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append(" crossLeverageLimit: ").append(toIndentedString(crossLeverageLimit)).append("\n"); + sb.append(" entryPrice: ").append(toIndentedString(entryPrice)).append("\n"); + sb.append(" fillPrice: ").append(toIndentedString(fillPrice)).append("\n"); + sb.append(" tradeSize: ").append(toIndentedString(tradeSize)).append("\n"); + sb.append(" positionSize: ").append(toIndentedString(positionSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesBatchAmendOrderRequest.java b/src/main/java/io/gate/gateapi/models/FuturesBatchAmendOrderRequest.java new file mode 100644 index 0000000..0d96319 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesBatchAmendOrderRequest.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Modify contract order parameters + */ +public class FuturesBatchAmendOrderRequest { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + + public FuturesBatchAmendOrderRequest orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order id, order_id and text must contain at least one + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public FuturesBatchAmendOrderRequest text(String text) { + + this.text = text; + return this; + } + + /** + * User-defined order text, at least one of order_id and text must be passed + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + public FuturesBatchAmendOrderRequest size(Long size) { + + this.size = size; + return this; + } + + /** + * 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. + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public FuturesBatchAmendOrderRequest price(String price) { + + this.price = price; + return this; + } + + /** + * New order price + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public FuturesBatchAmendOrderRequest amendText(String amendText) { + + this.amendText = amendText; + return this; + } + + /** + * Custom info during order amendment + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public void setAmendText(String amendText) { + this.amendText = amendText; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesBatchAmendOrderRequest futuresBatchAmendOrderRequest = (FuturesBatchAmendOrderRequest) o; + return Objects.equals(this.orderId, futuresBatchAmendOrderRequest.orderId) && + Objects.equals(this.text, futuresBatchAmendOrderRequest.text) && + Objects.equals(this.size, futuresBatchAmendOrderRequest.size) && + Objects.equals(this.price, futuresBatchAmendOrderRequest.price) && + Objects.equals(this.amendText, futuresBatchAmendOrderRequest.amendText); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, text, size, price, amendText); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesBatchAmendOrderRequest {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesCandlestick.java b/src/main/java/io/gate/gateapi/models/FuturesCandlestick.java index bfa396d..e454844 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesCandlestick.java +++ b/src/main/java/io/gate/gateapi/models/FuturesCandlestick.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 @@ -47,6 +47,10 @@ public class FuturesCandlestick { @SerializedName(SERIALIZED_NAME_O) private String o; + public static final String SERIALIZED_NAME_SUM = "sum"; + @SerializedName(SERIALIZED_NAME_SUM) + private String sum; + public FuturesCandlestick t(Double t) { @@ -75,7 +79,7 @@ public FuturesCandlestick v(Long v) { } /** - * size volume. Only returned if `contract` is not prefixed + * size volume (contract size). Only returned if `contract` is not prefixed * @return v **/ @javax.annotation.Nullable @@ -95,7 +99,7 @@ public FuturesCandlestick c(String c) { } /** - * Close price + * Close price (quote currency) * @return c **/ @javax.annotation.Nullable @@ -115,7 +119,7 @@ public FuturesCandlestick h(String h) { } /** - * Highest price + * Highest price (quote currency) * @return h **/ @javax.annotation.Nullable @@ -135,7 +139,7 @@ public FuturesCandlestick l(String l) { } /** - * Lowest price + * Lowest price (quote currency) * @return l **/ @javax.annotation.Nullable @@ -155,7 +159,7 @@ public FuturesCandlestick o(String o) { } /** - * Open price + * Open price (quote currency) * @return o **/ @javax.annotation.Nullable @@ -167,6 +171,26 @@ public String getO() { public void setO(String o) { this.o = o; } + + public FuturesCandlestick sum(String sum) { + + this.sum = sum; + return this; + } + + /** + * Trading volume (unit: Quote currency) + * @return sum + **/ + @javax.annotation.Nullable + public String getSum() { + return sum; + } + + + public void setSum(String sum) { + this.sum = sum; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,12 +205,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.c, futuresCandlestick.c) && Objects.equals(this.h, futuresCandlestick.h) && Objects.equals(this.l, futuresCandlestick.l) && - Objects.equals(this.o, futuresCandlestick.o); + Objects.equals(this.o, futuresCandlestick.o) && + Objects.equals(this.sum, futuresCandlestick.sum); } @Override public int hashCode() { - return Objects.hash(t, v, c, h, l, o); + return Objects.hash(t, v, c, h, l, o, sum); } @@ -200,6 +225,7 @@ public String toString() { sb.append(" h: ").append(toIndentedString(h)).append("\n"); sb.append(" l: ").append(toIndentedString(l)).append("\n"); sb.append(" o: ").append(toIndentedString(o)).append("\n"); + sb.append(" sum: ").append(toIndentedString(sum)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/FuturesFee.java b/src/main/java/io/gate/gateapi/models/FuturesFee.java new file mode 100644 index 0000000..37690a3 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesFee.java @@ -0,0 +1,95 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * The returned result is a map type, where the key represents the market and taker and maker fee rates + */ +public class FuturesFee { + public static final String SERIALIZED_NAME_TAKER_FEE = "taker_fee"; + @SerializedName(SERIALIZED_NAME_TAKER_FEE) + private String takerFee; + + public static final String SERIALIZED_NAME_MAKER_FEE = "maker_fee"; + @SerializedName(SERIALIZED_NAME_MAKER_FEE) + private String makerFee; + + + /** + * Taker fee + * @return takerFee + **/ + @javax.annotation.Nullable + public String getTakerFee() { + return takerFee; + } + + + /** + * maker fee + * @return makerFee + **/ + @javax.annotation.Nullable + public String getMakerFee() { + return makerFee; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesFee futuresFee = (FuturesFee) o; + return Objects.equals(this.takerFee, futuresFee.takerFee) && + Objects.equals(this.makerFee, futuresFee.makerFee); + } + + @Override + public int hashCode() { + return Objects.hash(takerFee, makerFee); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesFee {\n"); + sb.append(" takerFee: ").append(toIndentedString(takerFee)).append("\n"); + sb.append(" makerFee: ").append(toIndentedString(makerFee)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesIndexConstituents.java b/src/main/java/io/gate/gateapi/models/FuturesIndexConstituents.java new file mode 100644 index 0000000..1453045 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesIndexConstituents.java @@ -0,0 +1,98 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.IndexConstituent; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * FuturesIndexConstituents + */ +public class FuturesIndexConstituents { + public static final String SERIALIZED_NAME_INDEX = "index"; + @SerializedName(SERIALIZED_NAME_INDEX) + private String index; + + public static final String SERIALIZED_NAME_CONSTITUENTS = "constituents"; + @SerializedName(SERIALIZED_NAME_CONSTITUENTS) + private List constituents = null; + + + /** + * Index name + * @return index + **/ + @javax.annotation.Nullable + public String getIndex() { + return index; + } + + + /** + * Constituents + * @return constituents + **/ + @javax.annotation.Nullable + public List getConstituents() { + return constituents; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesIndexConstituents futuresIndexConstituents = (FuturesIndexConstituents) o; + return Objects.equals(this.index, futuresIndexConstituents.index) && + Objects.equals(this.constituents, futuresIndexConstituents.constituents); + } + + @Override + public int hashCode() { + return Objects.hash(index, constituents); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesIndexConstituents {\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" constituents: ").append(toIndentedString(constituents)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesInitialOrder.java b/src/main/java/io/gate/gateapi/models/FuturesInitialOrder.java index 6f5dc1b..86311ab 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesInitialOrder.java +++ b/src/main/java/io/gate/gateapi/models/FuturesInitialOrder.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 @@ -40,7 +40,7 @@ public class FuturesInitialOrder { private Boolean close = false; /** - * Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled + * Time in force strategy, default is gtc, market orders currently only support ioc mode - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled */ @JsonAdapter(TifEnum.Adapter.class) public enum TifEnum { @@ -98,6 +98,10 @@ public TifEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) private Boolean reduceOnly = false; + public static final String SERIALIZED_NAME_AUTO_SIZE = "auto_size"; + @SerializedName(SERIALIZED_NAME_AUTO_SIZE) + private String autoSize; + public static final String SERIALIZED_NAME_IS_REDUCE_ONLY = "is_reduce_only"; @SerializedName(SERIALIZED_NAME_IS_REDUCE_ONLY) private Boolean isReduceOnly; @@ -133,7 +137,7 @@ public FuturesInitialOrder size(Long size) { } /** - * Order size. Positive size means to buy, while negative one means to sell. Set to 0 to close the position + * 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 * @return size **/ @javax.annotation.Nullable @@ -172,7 +176,7 @@ public FuturesInitialOrder close(Boolean close) { } /** - * Set to true if trying to close the position + * 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 * @return close **/ @javax.annotation.Nullable @@ -192,7 +196,7 @@ public FuturesInitialOrder tif(TifEnum tif) { } /** - * Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled + * Time in force strategy, default is gtc, market orders currently only support ioc mode - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled * @return tif **/ @javax.annotation.Nullable @@ -212,7 +216,7 @@ public FuturesInitialOrder text(String text) { } /** - * How the order is created. Possible values are: web, api and app + * The source of the order, including: - web: Web - api: API call - app: Mobile app * @return text **/ @javax.annotation.Nullable @@ -232,7 +236,7 @@ public FuturesInitialOrder reduceOnly(Boolean reduceOnly) { } /** - * Set to true to create a reduce-only order + * 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 * @return reduceOnly **/ @javax.annotation.Nullable @@ -245,6 +249,26 @@ public void setReduceOnly(Boolean reduceOnly) { this.reduceOnly = reduceOnly; } + public FuturesInitialOrder autoSize(String autoSize) { + + this.autoSize = autoSize; + return this; + } + + /** + * 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 + * @return autoSize + **/ + @javax.annotation.Nullable + public String getAutoSize() { + return autoSize; + } + + + public void setAutoSize(String autoSize) { + this.autoSize = autoSize; + } + /** * Is the order reduce-only * @return isReduceOnly @@ -280,13 +304,14 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.tif, futuresInitialOrder.tif) && Objects.equals(this.text, futuresInitialOrder.text) && Objects.equals(this.reduceOnly, futuresInitialOrder.reduceOnly) && + Objects.equals(this.autoSize, futuresInitialOrder.autoSize) && Objects.equals(this.isReduceOnly, futuresInitialOrder.isReduceOnly) && Objects.equals(this.isClose, futuresInitialOrder.isClose); } @Override public int hashCode() { - return Objects.hash(contract, size, price, close, tif, text, reduceOnly, isReduceOnly, isClose); + return Objects.hash(contract, size, price, close, tif, text, reduceOnly, autoSize, isReduceOnly, isClose); } @@ -301,6 +326,7 @@ public String toString() { sb.append(" tif: ").append(toIndentedString(tif)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" autoSize: ").append(toIndentedString(autoSize)).append("\n"); sb.append(" isReduceOnly: ").append(toIndentedString(isReduceOnly)).append("\n"); sb.append(" isClose: ").append(toIndentedString(isClose)).append("\n"); sb.append("}"); diff --git a/src/main/java/io/gate/gateapi/models/FuturesLimitRiskTiers.java b/src/main/java/io/gate/gateapi/models/FuturesLimitRiskTiers.java new file mode 100644 index 0000000..7c23377 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesLimitRiskTiers.java @@ -0,0 +1,245 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Retrieve risk limit configurations for different tiers under a specified contract + */ +public class FuturesLimitRiskTiers { + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + private Integer tier; + + public static final String SERIALIZED_NAME_RISK_LIMIT = "risk_limit"; + @SerializedName(SERIALIZED_NAME_RISK_LIMIT) + private String riskLimit; + + public static final String SERIALIZED_NAME_INITIAL_RATE = "initial_rate"; + @SerializedName(SERIALIZED_NAME_INITIAL_RATE) + private String initialRate; + + public static final String SERIALIZED_NAME_MAINTENANCE_RATE = "maintenance_rate"; + @SerializedName(SERIALIZED_NAME_MAINTENANCE_RATE) + private String maintenanceRate; + + public static final String SERIALIZED_NAME_LEVERAGE_MAX = "leverage_max"; + @SerializedName(SERIALIZED_NAME_LEVERAGE_MAX) + private String leverageMax; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_DEDUCTION = "deduction"; + @SerializedName(SERIALIZED_NAME_DEDUCTION) + private String deduction; + + + public FuturesLimitRiskTiers tier(Integer tier) { + + this.tier = tier; + return this; + } + + /** + * Tier + * @return tier + **/ + @javax.annotation.Nullable + public Integer getTier() { + return tier; + } + + + public void setTier(Integer tier) { + this.tier = tier; + } + + public FuturesLimitRiskTiers riskLimit(String riskLimit) { + + this.riskLimit = riskLimit; + return this; + } + + /** + * Position risk limit + * @return riskLimit + **/ + @javax.annotation.Nullable + public String getRiskLimit() { + return riskLimit; + } + + + public void setRiskLimit(String riskLimit) { + this.riskLimit = riskLimit; + } + + public FuturesLimitRiskTiers initialRate(String initialRate) { + + this.initialRate = initialRate; + return this; + } + + /** + * Initial margin rate + * @return initialRate + **/ + @javax.annotation.Nullable + public String getInitialRate() { + return initialRate; + } + + + public void setInitialRate(String initialRate) { + this.initialRate = initialRate; + } + + public FuturesLimitRiskTiers maintenanceRate(String maintenanceRate) { + + this.maintenanceRate = maintenanceRate; + return this; + } + + /** + * Maintenance margin rate + * @return maintenanceRate + **/ + @javax.annotation.Nullable + public String getMaintenanceRate() { + return maintenanceRate; + } + + + public void setMaintenanceRate(String maintenanceRate) { + this.maintenanceRate = maintenanceRate; + } + + public FuturesLimitRiskTiers leverageMax(String leverageMax) { + + this.leverageMax = leverageMax; + return this; + } + + /** + * Maximum leverage + * @return leverageMax + **/ + @javax.annotation.Nullable + public String getLeverageMax() { + return leverageMax; + } + + + public void setLeverageMax(String leverageMax) { + this.leverageMax = leverageMax; + } + + public FuturesLimitRiskTiers contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Market, only visible when market pagination is requested + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public FuturesLimitRiskTiers deduction(String deduction) { + + this.deduction = deduction; + return this; + } + + /** + * Maintenance margin quick calculation deduction amount + * @return deduction + **/ + @javax.annotation.Nullable + public String getDeduction() { + return deduction; + } + + + public void setDeduction(String deduction) { + this.deduction = deduction; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesLimitRiskTiers futuresLimitRiskTiers = (FuturesLimitRiskTiers) o; + return Objects.equals(this.tier, futuresLimitRiskTiers.tier) && + Objects.equals(this.riskLimit, futuresLimitRiskTiers.riskLimit) && + Objects.equals(this.initialRate, futuresLimitRiskTiers.initialRate) && + Objects.equals(this.maintenanceRate, futuresLimitRiskTiers.maintenanceRate) && + Objects.equals(this.leverageMax, futuresLimitRiskTiers.leverageMax) && + Objects.equals(this.contract, futuresLimitRiskTiers.contract) && + Objects.equals(this.deduction, futuresLimitRiskTiers.deduction); + } + + @Override + public int hashCode() { + return Objects.hash(tier, riskLimit, initialRate, maintenanceRate, leverageMax, contract, deduction); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesLimitRiskTiers {\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" riskLimit: ").append(toIndentedString(riskLimit)).append("\n"); + sb.append(" initialRate: ").append(toIndentedString(initialRate)).append("\n"); + sb.append(" maintenanceRate: ").append(toIndentedString(maintenanceRate)).append("\n"); + sb.append(" leverageMax: ").append(toIndentedString(leverageMax)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" deduction: ").append(toIndentedString(deduction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesLiqOrder.java b/src/main/java/io/gate/gateapi/models/FuturesLiqOrder.java new file mode 100644 index 0000000..fc632db --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesLiqOrder.java @@ -0,0 +1,175 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * FuturesLiqOrder + */ +public class FuturesLiqOrder { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Long time; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_ORDER_SIZE = "order_size"; + @SerializedName(SERIALIZED_NAME_ORDER_SIZE) + private Long orderSize; + + public static final String SERIALIZED_NAME_ORDER_PRICE = "order_price"; + @SerializedName(SERIALIZED_NAME_ORDER_PRICE) + private String orderPrice; + + public static final String SERIALIZED_NAME_FILL_PRICE = "fill_price"; + @SerializedName(SERIALIZED_NAME_FILL_PRICE) + private String fillPrice; + + public static final String SERIALIZED_NAME_LEFT = "left"; + @SerializedName(SERIALIZED_NAME_LEFT) + private Long left; + + + /** + * Liquidation time + * @return time + **/ + @javax.annotation.Nullable + public Long getTime() { + return time; + } + + + /** + * Futures contract + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + /** + * User position size + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + /** + * Number of forced liquidation orders + * @return orderSize + **/ + @javax.annotation.Nullable + public Long getOrderSize() { + return orderSize; + } + + + /** + * Liquidation order price + * @return orderPrice + **/ + @javax.annotation.Nullable + public String getOrderPrice() { + return orderPrice; + } + + + /** + * Liquidation order average taker price + * @return fillPrice + **/ + @javax.annotation.Nullable + public String getFillPrice() { + return fillPrice; + } + + + /** + * System liquidation order maker size + * @return left + **/ + @javax.annotation.Nullable + public Long getLeft() { + return left; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesLiqOrder futuresLiqOrder = (FuturesLiqOrder) o; + return Objects.equals(this.time, futuresLiqOrder.time) && + Objects.equals(this.contract, futuresLiqOrder.contract) && + Objects.equals(this.size, futuresLiqOrder.size) && + Objects.equals(this.orderSize, futuresLiqOrder.orderSize) && + Objects.equals(this.orderPrice, futuresLiqOrder.orderPrice) && + Objects.equals(this.fillPrice, futuresLiqOrder.fillPrice) && + Objects.equals(this.left, futuresLiqOrder.left); + } + + @Override + public int hashCode() { + return Objects.hash(time, contract, size, orderSize, orderPrice, fillPrice, left); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesLiqOrder {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" orderSize: ").append(toIndentedString(orderSize)).append("\n"); + sb.append(" orderPrice: ").append(toIndentedString(orderPrice)).append("\n"); + sb.append(" fillPrice: ").append(toIndentedString(fillPrice)).append("\n"); + sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesLiquidate.java b/src/main/java/io/gate/gateapi/models/FuturesLiquidate.java index 64371db..bc39c5e 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesLiquidate.java +++ b/src/main/java/io/gate/gateapi/models/FuturesLiquidate.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 @@ -93,7 +93,7 @@ public String getContract() { /** - * Position leverage. Not returned in public endpoints. + * Position leverage. Not returned in public endpoints * @return leverage **/ @javax.annotation.Nullable @@ -113,7 +113,7 @@ public Long getSize() { /** - * Position margin. Not returned in public endpoints. + * Position margin. Not returned in public endpoints * @return margin **/ @javax.annotation.Nullable @@ -123,7 +123,7 @@ public String getMargin() { /** - * Average entry price. Not returned in public endpoints. + * Average entry price. Not returned in public endpoints * @return entryPrice **/ @javax.annotation.Nullable @@ -133,7 +133,7 @@ public String getEntryPrice() { /** - * Liquidation price. Not returned in public endpoints. + * Liquidation price. Not returned in public endpoints * @return liqPrice **/ @javax.annotation.Nullable @@ -143,7 +143,7 @@ public String getLiqPrice() { /** - * Mark price. Not returned in public endpoints. + * Mark price. Not returned in public endpoints * @return markPrice **/ @javax.annotation.Nullable @@ -153,7 +153,7 @@ public String getMarkPrice() { /** - * Liquidation order ID. Not returned in public endpoints. + * Liquidation order ID. Not returned in public endpoints * @return orderId **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/FuturesOrder.java b/src/main/java/io/gate/gateapi/models/FuturesOrder.java index 1471352..2dcef73 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesOrder.java +++ b/src/main/java/io/gate/gateapi/models/FuturesOrder.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 @@ -35,12 +35,16 @@ public class FuturesOrder { @SerializedName(SERIALIZED_NAME_CREATE_TIME) private Double createTime; + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private Double updateTime; + public static final String SERIALIZED_NAME_FINISH_TIME = "finish_time"; @SerializedName(SERIALIZED_NAME_FINISH_TIME) private Double finishTime; /** - * 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 + * 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 */ @JsonAdapter(FinishAsEnum.Adapter.class) public enum FinishAsEnum { @@ -58,7 +62,9 @@ public enum FinishAsEnum { POSITION_CLOSED("position_closed"), - REDUCE_OUT("reduce_out"); + REDUCE_OUT("reduce_out"), + + STP("stp"); private String value; @@ -103,7 +109,7 @@ public FinishAsEnum read(final JsonReader jsonReader) throws IOException { private FinishAsEnum finishAs; /** - * Order status - `open`: waiting to be traded - `finished`: finished + * Order status - `open`: Pending - `finished`: Completed */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { @@ -190,7 +196,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private Boolean isLiq; /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only + * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none */ @JsonAdapter(TifEnum.Adapter.class) public enum TifEnum { @@ -198,7 +204,9 @@ public enum TifEnum { IOC("ioc"), - POC("poc"); + POC("poc"), + + FOK("fok"); private String value; @@ -317,6 +325,77 @@ public AutoSizeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_AUTO_SIZE) private AutoSizeEnum autoSize; + public static final String SERIALIZED_NAME_STP_ID = "stp_id"; + @SerializedName(SERIALIZED_NAME_STP_ID) + private Integer stpId; + + /** + * 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 + */ + @JsonAdapter(StpActEnum.Adapter.class) + public enum StpActEnum { + CO("co"), + + CN("cn"), + + CB("cb"), + + MINUS("-"); + + private String value; + + StpActEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StpActEnum fromValue(String value) { + for (StpActEnum b : StpActEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StpActEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StpActEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StpActEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STP_ACT = "stp_act"; + @SerializedName(SERIALIZED_NAME_STP_ACT) + private StpActEnum stpAct; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + public static final String SERIALIZED_NAME_LIMIT_VIP = "limit_vip"; + @SerializedName(SERIALIZED_NAME_LIMIT_VIP) + private Long limitVip; + + public static final String SERIALIZED_NAME_PID = "pid"; + @SerializedName(SERIALIZED_NAME_PID) + private Long pid; + /** * Futures order ID @@ -348,6 +427,16 @@ public Double getCreateTime() { } + /** + * OrderUpdateTime + * @return updateTime + **/ + @javax.annotation.Nullable + public Double getUpdateTime() { + return updateTime; + } + + /** * Order finished time. Not returned if order is open * @return finishTime @@ -359,7 +448,7 @@ public Double getFinishTime() { /** - * 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 + * 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 * @return finishAs **/ @javax.annotation.Nullable @@ -369,7 +458,7 @@ public FinishAsEnum getFinishAs() { /** - * Order status - `open`: waiting to be traded - `finished`: finished + * Order status - `open`: Pending - `finished`: Completed * @return status **/ @javax.annotation.Nullable @@ -404,7 +493,7 @@ public FuturesOrder size(Long size) { } /** - * Order size. Specify positive number to make a bid, and negative number to ask + * Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. * @return size **/ public Long getSize() { @@ -423,7 +512,7 @@ public FuturesOrder iceberg(Long iceberg) { } /** - * Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size + * Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. * @return iceberg **/ @javax.annotation.Nullable @@ -443,7 +532,7 @@ public FuturesOrder price(String price) { } /** - * Order price. 0 for market order with `tif` set as `ioc` + * Order price. Price of 0 with `tif` set to `ioc` represents a market order. * @return price **/ @javax.annotation.Nullable @@ -533,7 +622,7 @@ public FuturesOrder tif(TifEnum tif) { } /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only + * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none * @return tif **/ @javax.annotation.Nullable @@ -547,7 +636,7 @@ public void setTif(TifEnum tif) { } /** - * Size left to be traded + * Unfilled quantity * @return left **/ @javax.annotation.Nullable @@ -557,7 +646,7 @@ public Long getLeft() { /** - * Fill price of the order + * Fill price * @return fillPrice **/ @javax.annotation.Nullable @@ -573,7 +662,7 @@ public FuturesOrder text(String text) { } /** - * 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 + * 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 * @return text **/ @javax.annotation.Nullable @@ -607,7 +696,7 @@ public String getMkfr() { /** - * Reference user ID + * Referrer user ID * @return refu **/ @javax.annotation.Nullable @@ -635,6 +724,86 @@ public AutoSizeEnum getAutoSize() { public void setAutoSize(AutoSizeEnum autoSize) { this.autoSize = autoSize; } + + /** + * 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` + * @return stpId + **/ + @javax.annotation.Nullable + public Integer getStpId() { + return stpId; + } + + + public FuturesOrder stpAct(StpActEnum stpAct) { + + this.stpAct = stpAct; + return this; + } + + /** + * 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 + * @return stpAct + **/ + @javax.annotation.Nullable + public StpActEnum getStpAct() { + return stpAct; + } + + + public void setStpAct(StpActEnum stpAct) { + this.stpAct = stpAct; + } + + /** + * The custom data that the user remarked when amending the order + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public FuturesOrder limitVip(Long limitVip) { + + this.limitVip = limitVip; + return this; + } + + /** + * 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 + * @return limitVip + **/ + @javax.annotation.Nullable + public Long getLimitVip() { + return limitVip; + } + + + public void setLimitVip(Long limitVip) { + this.limitVip = limitVip; + } + + public FuturesOrder pid(Long pid) { + + this.pid = pid; + return this; + } + + /** + * Position ID + * @return pid + **/ + @javax.annotation.Nullable + public Long getPid() { + return pid; + } + + + public void setPid(Long pid) { + this.pid = pid; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -647,6 +816,7 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.id, futuresOrder.id) && Objects.equals(this.user, futuresOrder.user) && Objects.equals(this.createTime, futuresOrder.createTime) && + Objects.equals(this.updateTime, futuresOrder.updateTime) && Objects.equals(this.finishTime, futuresOrder.finishTime) && Objects.equals(this.finishAs, futuresOrder.finishAs) && Objects.equals(this.status, futuresOrder.status) && @@ -666,12 +836,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.tkfr, futuresOrder.tkfr) && Objects.equals(this.mkfr, futuresOrder.mkfr) && Objects.equals(this.refu, futuresOrder.refu) && - Objects.equals(this.autoSize, futuresOrder.autoSize); + Objects.equals(this.autoSize, futuresOrder.autoSize) && + Objects.equals(this.stpId, futuresOrder.stpId) && + Objects.equals(this.stpAct, futuresOrder.stpAct) && + Objects.equals(this.amendText, futuresOrder.amendText) && + Objects.equals(this.limitVip, futuresOrder.limitVip) && + Objects.equals(this.pid, futuresOrder.pid); } @Override public int hashCode() { - return Objects.hash(id, user, createTime, finishTime, finishAs, status, contract, size, iceberg, price, close, isClose, reduceOnly, isReduceOnly, isLiq, tif, left, fillPrice, text, tkfr, mkfr, refu, autoSize); + return Objects.hash(id, user, createTime, updateTime, finishTime, finishAs, status, contract, size, iceberg, price, close, isClose, reduceOnly, isReduceOnly, isLiq, tif, left, fillPrice, text, tkfr, mkfr, refu, autoSize, stpId, stpAct, amendText, limitVip, pid); } @@ -682,6 +857,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" user: ").append(toIndentedString(user)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" finishTime: ").append(toIndentedString(finishTime)).append("\n"); sb.append(" finishAs: ").append(toIndentedString(finishAs)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -702,6 +878,11 @@ public String toString() { sb.append(" mkfr: ").append(toIndentedString(mkfr)).append("\n"); sb.append(" refu: ").append(toIndentedString(refu)).append("\n"); sb.append(" autoSize: ").append(toIndentedString(autoSize)).append("\n"); + sb.append(" stpId: ").append(toIndentedString(stpId)).append("\n"); + sb.append(" stpAct: ").append(toIndentedString(stpAct)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append(" limitVip: ").append(toIndentedString(limitVip)).append("\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/FuturesOrderAmendment.java b/src/main/java/io/gate/gateapi/models/FuturesOrderAmendment.java new file mode 100644 index 0000000..32f273c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesOrderAmendment.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * FuturesOrderAmendment + */ +public class FuturesOrderAmendment { + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + + public FuturesOrderAmendment size(Long size) { + + this.size = size; + return this; + } + + /** + * 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. + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public FuturesOrderAmendment price(String price) { + + this.price = price; + return this; + } + + /** + * New order price + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public FuturesOrderAmendment amendText(String amendText) { + + this.amendText = amendText; + return this; + } + + /** + * Custom info during order amendment + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public void setAmendText(String amendText) { + this.amendText = amendText; + } + + public FuturesOrderAmendment text(String text) { + + this.text = text; + return this; + } + + /** + * Internal users can modify information in the text field. + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesOrderAmendment futuresOrderAmendment = (FuturesOrderAmendment) o; + return Objects.equals(this.size, futuresOrderAmendment.size) && + Objects.equals(this.price, futuresOrderAmendment.price) && + Objects.equals(this.amendText, futuresOrderAmendment.amendText) && + Objects.equals(this.text, futuresOrderAmendment.text); + } + + @Override + public int hashCode() { + return Objects.hash(size, price, amendText, text); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesOrderAmendment {\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesOrderBook.java b/src/main/java/io/gate/gateapi/models/FuturesOrderBook.java index bec9f03..1978042 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesOrderBook.java +++ b/src/main/java/io/gate/gateapi/models/FuturesOrderBook.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 @@ -119,7 +119,7 @@ public FuturesOrderBook addAsksItem(FuturesOrderBookItem asksItem) { } /** - * Asks order depth + * Ask Depth * @return asks **/ public List getAsks() { @@ -143,7 +143,7 @@ public FuturesOrderBook addBidsItem(FuturesOrderBookItem bidsItem) { } /** - * Bids order depth + * Bid Depth * @return bids **/ public List getBids() { diff --git a/src/main/java/io/gate/gateapi/models/FuturesOrderBookItem.java b/src/main/java/io/gate/gateapi/models/FuturesOrderBookItem.java index 7c3b665..962c4cf 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesOrderBookItem.java +++ b/src/main/java/io/gate/gateapi/models/FuturesOrderBookItem.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 @@ -39,7 +39,7 @@ public FuturesOrderBookItem p(String p) { } /** - * Price + * Price (quote currency) * @return p **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/FuturesPositionCrossMode.java b/src/main/java/io/gate/gateapi/models/FuturesPositionCrossMode.java new file mode 100644 index 0000000..36cb173 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesPositionCrossMode.java @@ -0,0 +1,113 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * FuturesPositionCrossMode + */ +public class FuturesPositionCrossMode { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + + public FuturesPositionCrossMode mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode + * @return mode + **/ + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + + public FuturesPositionCrossMode contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures market + * @return contract + **/ + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesPositionCrossMode futuresPositionCrossMode = (FuturesPositionCrossMode) o; + return Objects.equals(this.mode, futuresPositionCrossMode.mode) && + Objects.equals(this.contract, futuresPositionCrossMode.contract); + } + + @Override + public int hashCode() { + return Objects.hash(mode, contract); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesPositionCrossMode {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesPremiumIndex.java b/src/main/java/io/gate/gateapi/models/FuturesPremiumIndex.java new file mode 100644 index 0000000..cd1b743 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesPremiumIndex.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * data point in every timestamp + */ +public class FuturesPremiumIndex { + public static final String SERIALIZED_NAME_T = "t"; + @SerializedName(SERIALIZED_NAME_T) + private Double t; + + public static final String SERIALIZED_NAME_C = "c"; + @SerializedName(SERIALIZED_NAME_C) + private String c; + + public static final String SERIALIZED_NAME_H = "h"; + @SerializedName(SERIALIZED_NAME_H) + private String h; + + public static final String SERIALIZED_NAME_L = "l"; + @SerializedName(SERIALIZED_NAME_L) + private String l; + + public static final String SERIALIZED_NAME_O = "o"; + @SerializedName(SERIALIZED_NAME_O) + private String o; + + + public FuturesPremiumIndex t(Double t) { + + this.t = t; + return this; + } + + /** + * Unix timestamp in seconds + * @return t + **/ + @javax.annotation.Nullable + public Double getT() { + return t; + } + + + public void setT(Double t) { + this.t = t; + } + + public FuturesPremiumIndex c(String c) { + + this.c = c; + return this; + } + + /** + * Close price + * @return c + **/ + @javax.annotation.Nullable + public String getC() { + return c; + } + + + public void setC(String c) { + this.c = c; + } + + public FuturesPremiumIndex h(String h) { + + this.h = h; + return this; + } + + /** + * Highest price + * @return h + **/ + @javax.annotation.Nullable + public String getH() { + return h; + } + + + public void setH(String h) { + this.h = h; + } + + public FuturesPremiumIndex l(String l) { + + this.l = l; + return this; + } + + /** + * Lowest price + * @return l + **/ + @javax.annotation.Nullable + public String getL() { + return l; + } + + + public void setL(String l) { + this.l = l; + } + + public FuturesPremiumIndex o(String o) { + + this.o = o; + return this; + } + + /** + * Open price + * @return o + **/ + @javax.annotation.Nullable + public String getO() { + return o; + } + + + public void setO(String o) { + this.o = o; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesPremiumIndex futuresPremiumIndex = (FuturesPremiumIndex) o; + return Objects.equals(this.t, futuresPremiumIndex.t) && + Objects.equals(this.c, futuresPremiumIndex.c) && + Objects.equals(this.h, futuresPremiumIndex.h) && + Objects.equals(this.l, futuresPremiumIndex.l) && + Objects.equals(this.o, futuresPremiumIndex.o); + } + + @Override + public int hashCode() { + return Objects.hash(t, c, h, l, o); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesPremiumIndex {\n"); + sb.append(" t: ").append(toIndentedString(t)).append("\n"); + sb.append(" c: ").append(toIndentedString(c)).append("\n"); + sb.append(" h: ").append(toIndentedString(h)).append("\n"); + sb.append(" l: ").append(toIndentedString(l)).append("\n"); + sb.append(" o: ").append(toIndentedString(o)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesPriceTrigger.java b/src/main/java/io/gate/gateapi/models/FuturesPriceTrigger.java index fb0e77a..543d436 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesPriceTrigger.java +++ b/src/main/java/io/gate/gateapi/models/FuturesPriceTrigger.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 @@ -24,7 +24,7 @@ */ public class FuturesPriceTrigger { /** - * 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 + * 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) */ @JsonAdapter(StrategyTypeEnum.Adapter.class) public enum StrategyTypeEnum { @@ -75,7 +75,7 @@ public StrategyTypeEnum read(final JsonReader jsonReader) throws IOException { private StrategyTypeEnum strategyType; /** - * Price type. 0 - latest deal price, 1 - mark price, 2 - index price + * Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price */ @JsonAdapter(PriceTypeEnum.Adapter.class) public enum PriceTypeEnum { @@ -132,7 +132,7 @@ public PriceTypeEnum read(final JsonReader jsonReader) throws IOException { private String price; /** - * 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` + * 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 */ @JsonAdapter(RuleEnum.Adapter.class) public enum RuleEnum { @@ -194,7 +194,7 @@ public FuturesPriceTrigger strategyType(StrategyTypeEnum strategyType) { } /** - * 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 + * 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) * @return strategyType **/ @javax.annotation.Nullable @@ -214,7 +214,7 @@ public FuturesPriceTrigger priceType(PriceTypeEnum priceType) { } /** - * Price type. 0 - latest deal price, 1 - mark price, 2 - index price + * Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price * @return priceType **/ @javax.annotation.Nullable @@ -234,7 +234,7 @@ public FuturesPriceTrigger price(String price) { } /** - * Value of price on price triggered, or price gap on price gap triggered + * Price value for price trigger, or spread value for spread trigger * @return price **/ @javax.annotation.Nullable @@ -254,7 +254,7 @@ public FuturesPriceTrigger rule(RuleEnum rule) { } /** - * 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` + * 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 * @return rule **/ @javax.annotation.Nullable @@ -274,7 +274,7 @@ public FuturesPriceTrigger expiration(Integer expiration) { } /** - * How long (in seconds) to wait for the condition to be triggered before cancelling the order. + * Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout * @return expiration **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/FuturesPriceTriggeredOrder.java b/src/main/java/io/gate/gateapi/models/FuturesPriceTriggeredOrder.java index 0b36993..c1daa6d 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesPriceTriggeredOrder.java +++ b/src/main/java/io/gate/gateapi/models/FuturesPriceTriggeredOrder.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 @@ -22,7 +22,7 @@ import java.io.IOException; /** - * Futures order details + * Futures price-triggered order details */ public class FuturesPriceTriggeredOrder { public static final String SERIALIZED_NAME_INITIAL = "initial"; @@ -54,13 +54,17 @@ public class FuturesPriceTriggeredOrder { private Long tradeId; /** - * Order status. + * 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 */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { OPEN("open"), - FINISHED("finished"); + FINISHED("finished"), + + INACTIVE("inactive"), + + INVALID("invalid"); private String value; @@ -105,7 +109,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private StatusEnum status; /** - * How order is finished + * Finish status: cancelled - Cancelled; succeeded - Succeeded; failed - Failed; expired - Expired */ @JsonAdapter(FinishAsEnum.Adapter.class) public enum FinishAsEnum { @@ -163,6 +167,14 @@ public FinishAsEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REASON) private String reason; + public static final String SERIALIZED_NAME_ORDER_TYPE = "order_type"; + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + private String orderType; + + public static final String SERIALIZED_NAME_ME_ORDER_ID = "me_order_id"; + @SerializedName(SERIALIZED_NAME_ME_ORDER_ID) + private Long meOrderId; + public FuturesPriceTriggeredOrder initial(FuturesInitialOrder initial) { @@ -223,7 +235,7 @@ public Integer getUser() { /** - * Creation time + * Created time * @return createTime **/ @javax.annotation.Nullable @@ -233,7 +245,7 @@ public Double getCreateTime() { /** - * Finished time + * End time * @return finishTime **/ @javax.annotation.Nullable @@ -243,7 +255,7 @@ public Double getFinishTime() { /** - * ID of the newly created order on condition triggered + * ID of the order created after trigger * @return tradeId **/ @javax.annotation.Nullable @@ -253,7 +265,7 @@ public Long getTradeId() { /** - * Order status. + * 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 * @return status **/ @javax.annotation.Nullable @@ -263,7 +275,7 @@ public StatusEnum getStatus() { /** - * How order is finished + * Finish status: cancelled - Cancelled; succeeded - Succeeded; failed - Failed; expired - Expired * @return finishAs **/ @javax.annotation.Nullable @@ -273,7 +285,7 @@ public FinishAsEnum getFinishAs() { /** - * Additional remarks on how the order was finished + * Additional description of how the order was completed * @return reason **/ @javax.annotation.Nullable @@ -281,6 +293,36 @@ public String getReason() { return reason; } + + public FuturesPriceTriggeredOrder orderType(String orderType) { + + this.orderType = orderType; + return this; + } + + /** + * 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 + * @return orderType + **/ + @javax.annotation.Nullable + public String getOrderType() { + return orderType; + } + + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + /** + * Corresponding order ID for order take-profit/stop-loss orders + * @return meOrderId + **/ + @javax.annotation.Nullable + public Long getMeOrderId() { + return meOrderId; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -299,12 +341,14 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.tradeId, futuresPriceTriggeredOrder.tradeId) && Objects.equals(this.status, futuresPriceTriggeredOrder.status) && Objects.equals(this.finishAs, futuresPriceTriggeredOrder.finishAs) && - Objects.equals(this.reason, futuresPriceTriggeredOrder.reason); + Objects.equals(this.reason, futuresPriceTriggeredOrder.reason) && + Objects.equals(this.orderType, futuresPriceTriggeredOrder.orderType) && + Objects.equals(this.meOrderId, futuresPriceTriggeredOrder.meOrderId); } @Override public int hashCode() { - return Objects.hash(initial, trigger, id, user, createTime, finishTime, tradeId, status, finishAs, reason); + return Objects.hash(initial, trigger, id, user, createTime, finishTime, tradeId, status, finishAs, reason, orderType, meOrderId); } @@ -322,6 +366,8 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" finishAs: ").append(toIndentedString(finishAs)).append("\n"); sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" meOrderId: ").append(toIndentedString(meOrderId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/FuturesRiskLimitTier.java b/src/main/java/io/gate/gateapi/models/FuturesRiskLimitTier.java new file mode 100644 index 0000000..9b5f387 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/FuturesRiskLimitTier.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Information for each tier of the gradient risk limit table + */ +public class FuturesRiskLimitTier { + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + private Integer tier; + + public static final String SERIALIZED_NAME_RISK_LIMIT = "risk_limit"; + @SerializedName(SERIALIZED_NAME_RISK_LIMIT) + private String riskLimit; + + public static final String SERIALIZED_NAME_INITIAL_RATE = "initial_rate"; + @SerializedName(SERIALIZED_NAME_INITIAL_RATE) + private String initialRate; + + public static final String SERIALIZED_NAME_MAINTENANCE_RATE = "maintenance_rate"; + @SerializedName(SERIALIZED_NAME_MAINTENANCE_RATE) + private String maintenanceRate; + + public static final String SERIALIZED_NAME_LEVERAGE_MAX = "leverage_max"; + @SerializedName(SERIALIZED_NAME_LEVERAGE_MAX) + private String leverageMax; + + public static final String SERIALIZED_NAME_DEDUCTION = "deduction"; + @SerializedName(SERIALIZED_NAME_DEDUCTION) + private String deduction; + + + public FuturesRiskLimitTier tier(Integer tier) { + + this.tier = tier; + return this; + } + + /** + * Tier + * @return tier + **/ + @javax.annotation.Nullable + public Integer getTier() { + return tier; + } + + + public void setTier(Integer tier) { + this.tier = tier; + } + + public FuturesRiskLimitTier riskLimit(String riskLimit) { + + this.riskLimit = riskLimit; + return this; + } + + /** + * Position risk limit + * @return riskLimit + **/ + @javax.annotation.Nullable + public String getRiskLimit() { + return riskLimit; + } + + + public void setRiskLimit(String riskLimit) { + this.riskLimit = riskLimit; + } + + public FuturesRiskLimitTier initialRate(String initialRate) { + + this.initialRate = initialRate; + return this; + } + + /** + * Initial margin rate + * @return initialRate + **/ + @javax.annotation.Nullable + public String getInitialRate() { + return initialRate; + } + + + public void setInitialRate(String initialRate) { + this.initialRate = initialRate; + } + + public FuturesRiskLimitTier maintenanceRate(String maintenanceRate) { + + this.maintenanceRate = maintenanceRate; + return this; + } + + /** + * Maintenance margin rate + * @return maintenanceRate + **/ + @javax.annotation.Nullable + public String getMaintenanceRate() { + return maintenanceRate; + } + + + public void setMaintenanceRate(String maintenanceRate) { + this.maintenanceRate = maintenanceRate; + } + + public FuturesRiskLimitTier leverageMax(String leverageMax) { + + this.leverageMax = leverageMax; + return this; + } + + /** + * Maximum leverage + * @return leverageMax + **/ + @javax.annotation.Nullable + public String getLeverageMax() { + return leverageMax; + } + + + public void setLeverageMax(String leverageMax) { + this.leverageMax = leverageMax; + } + + public FuturesRiskLimitTier deduction(String deduction) { + + this.deduction = deduction; + return this; + } + + /** + * Maintenance margin quick calculation deduction amount + * @return deduction + **/ + @javax.annotation.Nullable + public String getDeduction() { + return deduction; + } + + + public void setDeduction(String deduction) { + this.deduction = deduction; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesRiskLimitTier futuresRiskLimitTier = (FuturesRiskLimitTier) o; + return Objects.equals(this.tier, futuresRiskLimitTier.tier) && + Objects.equals(this.riskLimit, futuresRiskLimitTier.riskLimit) && + Objects.equals(this.initialRate, futuresRiskLimitTier.initialRate) && + Objects.equals(this.maintenanceRate, futuresRiskLimitTier.maintenanceRate) && + Objects.equals(this.leverageMax, futuresRiskLimitTier.leverageMax) && + Objects.equals(this.deduction, futuresRiskLimitTier.deduction); + } + + @Override + public int hashCode() { + return Objects.hash(tier, riskLimit, initialRate, maintenanceRate, leverageMax, deduction); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesRiskLimitTier {\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" riskLimit: ").append(toIndentedString(riskLimit)).append("\n"); + sb.append(" initialRate: ").append(toIndentedString(initialRate)).append("\n"); + sb.append(" maintenanceRate: ").append(toIndentedString(maintenanceRate)).append("\n"); + sb.append(" leverageMax: ").append(toIndentedString(leverageMax)).append("\n"); + sb.append(" deduction: ").append(toIndentedString(deduction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/FuturesTicker.java b/src/main/java/io/gate/gateapi/models/FuturesTicker.java index 4d95e9e..b2ae960 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesTicker.java +++ b/src/main/java/io/gate/gateapi/models/FuturesTicker.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 @@ -91,6 +91,42 @@ public class FuturesTicker { @SerializedName(SERIALIZED_NAME_QUANTO_BASE_RATE) private String quantoBaseRate; + public static final String SERIALIZED_NAME_LOWEST_ASK = "lowest_ask"; + @SerializedName(SERIALIZED_NAME_LOWEST_ASK) + private String lowestAsk; + + public static final String SERIALIZED_NAME_LOWEST_SIZE = "lowest_size"; + @SerializedName(SERIALIZED_NAME_LOWEST_SIZE) + private String lowestSize; + + public static final String SERIALIZED_NAME_HIGHEST_BID = "highest_bid"; + @SerializedName(SERIALIZED_NAME_HIGHEST_BID) + private String highestBid; + + public static final String SERIALIZED_NAME_HIGHEST_SIZE = "highest_size"; + @SerializedName(SERIALIZED_NAME_HIGHEST_SIZE) + private String highestSize; + + public static final String SERIALIZED_NAME_CHANGE_UTC0 = "change_utc0"; + @SerializedName(SERIALIZED_NAME_CHANGE_UTC0) + private String changeUtc0; + + public static final String SERIALIZED_NAME_CHANGE_UTC8 = "change_utc8"; + @SerializedName(SERIALIZED_NAME_CHANGE_UTC8) + private String changeUtc8; + + public static final String SERIALIZED_NAME_CHANGE_PRICE = "change_price"; + @SerializedName(SERIALIZED_NAME_CHANGE_PRICE) + private String changePrice; + + public static final String SERIALIZED_NAME_CHANGE_UTC0_PRICE = "change_utc0_price"; + @SerializedName(SERIALIZED_NAME_CHANGE_UTC0_PRICE) + private String changeUtc0Price; + + public static final String SERIALIZED_NAME_CHANGE_UTC8_PRICE = "change_utc8_price"; + @SerializedName(SERIALIZED_NAME_CHANGE_UTC8_PRICE) + private String changeUtc8Price; + public FuturesTicker contract(String contract) { @@ -139,7 +175,7 @@ public FuturesTicker changePercentage(String changePercentage) { } /** - * Change percentage. + * Price change percentage. Negative values indicate price decrease, e.g. -7.45 * @return changePercentage **/ @javax.annotation.Nullable @@ -179,7 +215,7 @@ public FuturesTicker low24h(String low24h) { } /** - * Lowest trading price in recent 24h + * 24-hour lowest price * @return low24h **/ @javax.annotation.Nullable @@ -199,7 +235,7 @@ public FuturesTicker high24h(String high24h) { } /** - * Highest trading price in recent 24h + * 24-hour highest price * @return high24h **/ @javax.annotation.Nullable @@ -219,7 +255,7 @@ public FuturesTicker volume24h(String volume24h) { } /** - * Trade size in recent 24h + * 24-hour trading volume * @return volume24h **/ @javax.annotation.Nullable @@ -239,7 +275,7 @@ public FuturesTicker volume24hBtc(String volume24hBtc) { } /** - * Trade volumes in recent 24h in BTC(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) + * 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) * @return volume24hBtc **/ @javax.annotation.Nullable @@ -259,7 +295,7 @@ public FuturesTicker volume24hUsd(String volume24hUsd) { } /** - * Trade volumes in recent 24h in USD(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) + * 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) * @return volume24hUsd **/ @javax.annotation.Nullable @@ -279,7 +315,7 @@ public FuturesTicker volume24hBase(String volume24hBase) { } /** - * Trade volume in recent 24h, in base currency + * 24-hour trading volume in base currency * @return volume24hBase **/ @javax.annotation.Nullable @@ -299,7 +335,7 @@ public FuturesTicker volume24hQuote(String volume24hQuote) { } /** - * Trade volume in recent 24h, in quote currency + * 24-hour trading volume in quote currency * @return volume24hQuote **/ @javax.annotation.Nullable @@ -319,7 +355,7 @@ public FuturesTicker volume24hSettle(String volume24hSettle) { } /** - * Trade volume in recent 24h, in settle currency + * 24-hour trading volume in settle currency * @return volume24hSettle **/ @javax.annotation.Nullable @@ -379,7 +415,7 @@ public FuturesTicker fundingRateIndicative(String fundingRateIndicative) { } /** - * Indicative Funding rate in next period + * Indicative Funding rate in next period. (deprecated. use `funding_rate`) * @return fundingRateIndicative **/ @javax.annotation.Nullable @@ -431,6 +467,186 @@ public String getQuantoBaseRate() { public void setQuantoBaseRate(String quantoBaseRate) { this.quantoBaseRate = quantoBaseRate; } + + public FuturesTicker lowestAsk(String lowestAsk) { + + this.lowestAsk = lowestAsk; + return this; + } + + /** + * Recent lowest ask + * @return lowestAsk + **/ + @javax.annotation.Nullable + public String getLowestAsk() { + return lowestAsk; + } + + + public void setLowestAsk(String lowestAsk) { + this.lowestAsk = lowestAsk; + } + + public FuturesTicker lowestSize(String lowestSize) { + + this.lowestSize = lowestSize; + return this; + } + + /** + * The latest seller's lowest price order quantity + * @return lowestSize + **/ + @javax.annotation.Nullable + public String getLowestSize() { + return lowestSize; + } + + + public void setLowestSize(String lowestSize) { + this.lowestSize = lowestSize; + } + + public FuturesTicker highestBid(String highestBid) { + + this.highestBid = highestBid; + return this; + } + + /** + * Recent highest bid + * @return highestBid + **/ + @javax.annotation.Nullable + public String getHighestBid() { + return highestBid; + } + + + public void setHighestBid(String highestBid) { + this.highestBid = highestBid; + } + + public FuturesTicker highestSize(String highestSize) { + + this.highestSize = highestSize; + return this; + } + + /** + * The latest buyer's highest price order volume + * @return highestSize + **/ + @javax.annotation.Nullable + public String getHighestSize() { + return highestSize; + } + + + public void setHighestSize(String highestSize) { + this.highestSize = highestSize; + } + + public FuturesTicker changeUtc0(String changeUtc0) { + + this.changeUtc0 = changeUtc0; + return this; + } + + /** + * Percentage change at utc0. Negative values indicate a drop, e.g., -7.45% + * @return changeUtc0 + **/ + @javax.annotation.Nullable + public String getChangeUtc0() { + return changeUtc0; + } + + + public void setChangeUtc0(String changeUtc0) { + this.changeUtc0 = changeUtc0; + } + + public FuturesTicker changeUtc8(String changeUtc8) { + + this.changeUtc8 = changeUtc8; + return this; + } + + /** + * Percentage change at utc8. Negative values indicate a drop, e.g., -7.45% + * @return changeUtc8 + **/ + @javax.annotation.Nullable + public String getChangeUtc8() { + return changeUtc8; + } + + + public void setChangeUtc8(String changeUtc8) { + this.changeUtc8 = changeUtc8; + } + + public FuturesTicker changePrice(String changePrice) { + + this.changePrice = changePrice; + return this; + } + + /** + * 24h change amount. Negative values indicate a drop, e.g., -7.45 + * @return changePrice + **/ + @javax.annotation.Nullable + public String getChangePrice() { + return changePrice; + } + + + public void setChangePrice(String changePrice) { + this.changePrice = changePrice; + } + + public FuturesTicker changeUtc0Price(String changeUtc0Price) { + + this.changeUtc0Price = changeUtc0Price; + return this; + } + + /** + * Change amount at utc0. Negative values indicate a drop, e.g., -7.45 + * @return changeUtc0Price + **/ + @javax.annotation.Nullable + public String getChangeUtc0Price() { + return changeUtc0Price; + } + + + public void setChangeUtc0Price(String changeUtc0Price) { + this.changeUtc0Price = changeUtc0Price; + } + + public FuturesTicker changeUtc8Price(String changeUtc8Price) { + + this.changeUtc8Price = changeUtc8Price; + return this; + } + + /** + * Change amount at utc8. Negative values indicate a drop, e.g., -7.45 + * @return changeUtc8Price + **/ + @javax.annotation.Nullable + public String getChangeUtc8Price() { + return changeUtc8Price; + } + + + public void setChangeUtc8Price(String changeUtc8Price) { + this.changeUtc8Price = changeUtc8Price; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -456,12 +672,21 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.fundingRate, futuresTicker.fundingRate) && Objects.equals(this.fundingRateIndicative, futuresTicker.fundingRateIndicative) && Objects.equals(this.indexPrice, futuresTicker.indexPrice) && - Objects.equals(this.quantoBaseRate, futuresTicker.quantoBaseRate); + Objects.equals(this.quantoBaseRate, futuresTicker.quantoBaseRate) && + Objects.equals(this.lowestAsk, futuresTicker.lowestAsk) && + Objects.equals(this.lowestSize, futuresTicker.lowestSize) && + Objects.equals(this.highestBid, futuresTicker.highestBid) && + Objects.equals(this.highestSize, futuresTicker.highestSize) && + Objects.equals(this.changeUtc0, futuresTicker.changeUtc0) && + Objects.equals(this.changeUtc8, futuresTicker.changeUtc8) && + Objects.equals(this.changePrice, futuresTicker.changePrice) && + Objects.equals(this.changeUtc0Price, futuresTicker.changeUtc0Price) && + Objects.equals(this.changeUtc8Price, futuresTicker.changeUtc8Price); } @Override public int hashCode() { - return Objects.hash(contract, last, changePercentage, totalSize, low24h, high24h, volume24h, volume24hBtc, volume24hUsd, volume24hBase, volume24hQuote, volume24hSettle, markPrice, fundingRate, fundingRateIndicative, indexPrice, quantoBaseRate); + return Objects.hash(contract, last, changePercentage, totalSize, low24h, high24h, volume24h, volume24hBtc, volume24hUsd, volume24hBase, volume24hQuote, volume24hSettle, markPrice, fundingRate, fundingRateIndicative, indexPrice, quantoBaseRate, lowestAsk, lowestSize, highestBid, highestSize, changeUtc0, changeUtc8, changePrice, changeUtc0Price, changeUtc8Price); } @@ -486,6 +711,15 @@ public String toString() { sb.append(" fundingRateIndicative: ").append(toIndentedString(fundingRateIndicative)).append("\n"); sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); sb.append(" quantoBaseRate: ").append(toIndentedString(quantoBaseRate)).append("\n"); + sb.append(" lowestAsk: ").append(toIndentedString(lowestAsk)).append("\n"); + sb.append(" lowestSize: ").append(toIndentedString(lowestSize)).append("\n"); + sb.append(" highestBid: ").append(toIndentedString(highestBid)).append("\n"); + sb.append(" highestSize: ").append(toIndentedString(highestSize)).append("\n"); + sb.append(" changeUtc0: ").append(toIndentedString(changeUtc0)).append("\n"); + sb.append(" changeUtc8: ").append(toIndentedString(changeUtc8)).append("\n"); + sb.append(" changePrice: ").append(toIndentedString(changePrice)).append("\n"); + sb.append(" changeUtc0Price: ").append(toIndentedString(changeUtc0Price)).append("\n"); + sb.append(" changeUtc8Price: ").append(toIndentedString(changeUtc8Price)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/FuturesTrade.java b/src/main/java/io/gate/gateapi/models/FuturesTrade.java index 4b91f95..21c29f8 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesTrade.java +++ b/src/main/java/io/gate/gateapi/models/FuturesTrade.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 @@ -47,6 +47,10 @@ public class FuturesTrade { @SerializedName(SERIALIZED_NAME_PRICE) private String price; + public static final String SERIALIZED_NAME_IS_INTERNAL = "is_internal"; + @SerializedName(SERIALIZED_NAME_IS_INTERNAL) + private Boolean isInternal; + public FuturesTrade id(Long id) { @@ -55,7 +59,7 @@ public FuturesTrade id(Long id) { } /** - * Trade ID + * Fill ID * @return id **/ @javax.annotation.Nullable @@ -75,7 +79,7 @@ public FuturesTrade createTime(Double createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -95,7 +99,7 @@ public FuturesTrade createTimeMs(Double createTimeMs) { } /** - * Trading time, with milliseconds set to 3 decimal places. + * Trade time, with millisecond precision to 3 decimal places * @return createTimeMs **/ @javax.annotation.Nullable @@ -155,7 +159,7 @@ public FuturesTrade price(String price) { } /** - * Trading price + * Trade price (quote currency) * @return price **/ @javax.annotation.Nullable @@ -167,6 +171,26 @@ public String getPrice() { public void setPrice(String price) { this.price = price; } + + public FuturesTrade isInternal(Boolean isInternal) { + + this.isInternal = isInternal; + return this; + } + + /** + * 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 + * @return isInternal + **/ + @javax.annotation.Nullable + public Boolean getIsInternal() { + return isInternal; + } + + + public void setIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,12 +205,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.createTimeMs, futuresTrade.createTimeMs) && Objects.equals(this.contract, futuresTrade.contract) && Objects.equals(this.size, futuresTrade.size) && - Objects.equals(this.price, futuresTrade.price); + Objects.equals(this.price, futuresTrade.price) && + Objects.equals(this.isInternal, futuresTrade.isInternal); } @Override public int hashCode() { - return Objects.hash(id, createTime, createTimeMs, contract, size, price); + return Objects.hash(id, createTime, createTimeMs, contract, size, price, isInternal); } @@ -200,6 +225,7 @@ public String toString() { sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" isInternal: ").append(toIndentedString(isInternal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/IndexConstituent.java b/src/main/java/io/gate/gateapi/models/IndexConstituent.java new file mode 100644 index 0000000..02170af --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/IndexConstituent.java @@ -0,0 +1,125 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * IndexConstituent + */ +public class IndexConstituent { + public static final String SERIALIZED_NAME_EXCHANGE = "exchange"; + @SerializedName(SERIALIZED_NAME_EXCHANGE) + private String exchange; + + public static final String SERIALIZED_NAME_SYMBOLS = "symbols"; + @SerializedName(SERIALIZED_NAME_SYMBOLS) + private List symbols = null; + + + public IndexConstituent exchange(String exchange) { + + this.exchange = exchange; + return this; + } + + /** + * Exchange + * @return exchange + **/ + @javax.annotation.Nullable + public String getExchange() { + return exchange; + } + + + public void setExchange(String exchange) { + this.exchange = exchange; + } + + public IndexConstituent symbols(List symbols) { + + this.symbols = symbols; + return this; + } + + public IndexConstituent addSymbolsItem(String symbolsItem) { + if (this.symbols == null) { + this.symbols = new ArrayList<>(); + } + this.symbols.add(symbolsItem); + return this; + } + + /** + * Symbol list + * @return symbols + **/ + @javax.annotation.Nullable + public List getSymbols() { + return symbols; + } + + + public void setSymbols(List symbols) { + this.symbols = symbols; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexConstituent indexConstituent = (IndexConstituent) o; + return Objects.equals(this.exchange, indexConstituent.exchange) && + Objects.equals(this.symbols, indexConstituent.symbols); + } + + @Override + public int hashCode() { + return Objects.hash(exchange, symbols); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexConstituent {\n"); + sb.append(" exchange: ").append(toIndentedString(exchange)).append("\n"); + sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/InlineObject.java b/src/main/java/io/gate/gateapi/models/InlineObject.java new file mode 100644 index 0000000..359efaf --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/InlineObject.java @@ -0,0 +1,113 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * InlineObject + */ +public class InlineObject { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + + public InlineObject mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode + * @return mode + **/ + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + + public InlineObject contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures market + * @return contract + **/ + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject inlineObject = (InlineObject) o; + return Objects.equals(this.mode, inlineObject.mode) && + Objects.equals(this.contract, inlineObject.contract); + } + + @Override + public int hashCode() { + return Objects.hash(mode, contract); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/InlineResponse200.java b/src/main/java/io/gate/gateapi/models/InlineResponse200.java new file mode 100644 index 0000000..7d6f3e7 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/InlineResponse200.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * InlineResponse200 + */ +public class InlineResponse200 { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Long time; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + + public InlineResponse200 time(Long time) { + + this.time = time; + return this; + } + + /** + * Get time + * @return time + **/ + @javax.annotation.Nullable + public Long getTime() { + return time; + } + + + public void setTime(Long time) { + this.time = time; + } + + public InlineResponse200 value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse200 inlineResponse200 = (InlineResponse200) o; + return Objects.equals(this.time, inlineResponse200.time) && + Objects.equals(this.value, inlineResponse200.value); + } + + @Override + public int hashCode() { + return Objects.hash(time, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse200 {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/InlineResponse2001.java b/src/main/java/io/gate/gateapi/models/InlineResponse2001.java new file mode 100644 index 0000000..c30ea78 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/InlineResponse2001.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * InlineResponse2001 + */ +public class InlineResponse2001 { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_EST_RATE = "est_rate"; + @SerializedName(SERIALIZED_NAME_EST_RATE) + private String estRate; + + + public InlineResponse2001 currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public InlineResponse2001 estRate(String estRate) { + + this.estRate = estRate; + return this; + } + + /** + * Unconverted percentage + * @return estRate + **/ + @javax.annotation.Nullable + public String getEstRate() { + return estRate; + } + + + public void setEstRate(String estRate) { + this.estRate = estRate; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2001 inlineResponse2001 = (InlineResponse2001) o; + return Objects.equals(this.currency, inlineResponse2001.currency) && + Objects.equals(this.estRate, inlineResponse2001.estRate); + } + + @Override + public int hashCode() { + return Objects.hash(currency, estRate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2001 {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" estRate: ").append(toIndentedString(estRate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/InsuranceRecord.java b/src/main/java/io/gate/gateapi/models/InsuranceRecord.java index 2a5397e..1a3846b 100644 --- a/src/main/java/io/gate/gateapi/models/InsuranceRecord.java +++ b/src/main/java/io/gate/gateapi/models/InsuranceRecord.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/models/LedgerRecord.java b/src/main/java/io/gate/gateapi/models/LedgerRecord.java index aaa66eb..86a4a6a 100644 --- a/src/main/java/io/gate/gateapi/models/LedgerRecord.java +++ b/src/main/java/io/gate/gateapi/models/LedgerRecord.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 @@ -31,6 +31,10 @@ public class LedgerRecord { @SerializedName(SERIALIZED_NAME_TXID) private String txid; + public static final String SERIALIZED_NAME_WITHDRAW_ORDER_ID = "withdraw_order_id"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_ORDER_ID) + private String withdrawOrderId; + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; @SerializedName(SERIALIZED_NAME_TIMESTAMP) private String timestamp; @@ -51,66 +55,17 @@ public class LedgerRecord { @SerializedName(SERIALIZED_NAME_MEMO) private String memo; - /** - * 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 - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - DONE("DONE"), - - CANCEL("CANCEL"), - - REQUEST("REQUEST"), - - MANUAL("MANUAL"), - - BCODE("BCODE"), - - EXTPEND("EXTPEND"), - - FAIL("FAIL"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_WITHDRAW_ID = "withdraw_id"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_ID) + private String withdrawId; - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_ASSET_CLASS = "asset_class"; + @SerializedName(SERIALIZED_NAME_ASSET_CLASS) + private String assetClass; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + private String status; public static final String SERIALIZED_NAME_CHAIN = "chain"; @SerializedName(SERIALIZED_NAME_CHAIN) @@ -137,6 +92,26 @@ public String getTxid() { } + public LedgerRecord withdrawOrderId(String withdrawOrderId) { + + this.withdrawOrderId = withdrawOrderId; + return this; + } + + /** + * User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried + * @return withdrawOrderId + **/ + @javax.annotation.Nullable + public String getWithdrawOrderId() { + return withdrawOrderId; + } + + + public void setWithdrawOrderId(String withdrawOrderId) { + this.withdrawOrderId = withdrawOrderId; + } + /** * Operation time * @return timestamp @@ -154,7 +129,7 @@ public LedgerRecord amount(String amount) { } /** - * Currency amount + * Token amount * @return amount **/ public String getAmount() { @@ -225,12 +200,52 @@ public void setMemo(String memo) { this.memo = memo; } + public LedgerRecord withdrawId(String withdrawId) { + + this.withdrawId = withdrawId; + return this; + } + + /** + * 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 + * @return withdrawId + **/ + @javax.annotation.Nullable + public String getWithdrawId() { + return withdrawId; + } + + + public void setWithdrawId(String withdrawId) { + this.withdrawId = withdrawId; + } + + public LedgerRecord assetClass(String assetClass) { + + this.assetClass = assetClass; + return this; + } + + /** + * 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 + * @return assetClass + **/ + @javax.annotation.Nullable + public String getAssetClass() { + return assetClass; + } + + + public void setAssetClass(String assetClass) { + this.assetClass = assetClass; + } + /** - * 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 + * 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 * @return status **/ @javax.annotation.Nullable - public StatusEnum getStatus() { + public String getStatus() { return status; } @@ -245,7 +260,6 @@ public LedgerRecord chain(String chain) { * Name of the chain used in withdrawals * @return chain **/ - @javax.annotation.Nullable public String getChain() { return chain; } @@ -265,18 +279,21 @@ public boolean equals(java.lang.Object o) { LedgerRecord ledgerRecord = (LedgerRecord) o; return Objects.equals(this.id, ledgerRecord.id) && Objects.equals(this.txid, ledgerRecord.txid) && + Objects.equals(this.withdrawOrderId, ledgerRecord.withdrawOrderId) && Objects.equals(this.timestamp, ledgerRecord.timestamp) && Objects.equals(this.amount, ledgerRecord.amount) && Objects.equals(this.currency, ledgerRecord.currency) && Objects.equals(this.address, ledgerRecord.address) && Objects.equals(this.memo, ledgerRecord.memo) && + Objects.equals(this.withdrawId, ledgerRecord.withdrawId) && + Objects.equals(this.assetClass, ledgerRecord.assetClass) && Objects.equals(this.status, ledgerRecord.status) && Objects.equals(this.chain, ledgerRecord.chain); } @Override public int hashCode() { - return Objects.hash(id, txid, timestamp, amount, currency, address, memo, status, chain); + return Objects.hash(id, txid, withdrawOrderId, timestamp, amount, currency, address, memo, withdrawId, assetClass, status, chain); } @@ -286,11 +303,14 @@ public String toString() { sb.append("class LedgerRecord {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" txid: ").append(toIndentedString(txid)).append("\n"); + sb.append(" withdrawOrderId: ").append(toIndentedString(withdrawOrderId)).append("\n"); sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" memo: ").append(toIndentedString(memo)).append("\n"); + sb.append(" withdrawId: ").append(toIndentedString(withdrawId)).append("\n"); + sb.append(" assetClass: ").append(toIndentedString(assetClass)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" chain: ").append(toIndentedString(chain)).append("\n"); sb.append("}"); diff --git a/src/main/java/io/gate/gateapi/models/LiquidateOrder.java b/src/main/java/io/gate/gateapi/models/LiquidateOrder.java new file mode 100644 index 0000000..de18094 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/LiquidateOrder.java @@ -0,0 +1,190 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Spot liquidation order details + */ +public class LiquidateOrder { + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_ACTION_MODE = "action_mode"; + @SerializedName(SERIALIZED_NAME_ACTION_MODE) + private String actionMode; + + + public LiquidateOrder text(String text) { + + this.text = text; + return this; + } + + /** + * 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(.) + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + public LiquidateOrder currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public LiquidateOrder amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Trade amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public LiquidateOrder price(String price) { + + this.price = price; + return this; + } + + /** + * Order price + * @return price + **/ + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public LiquidateOrder actionMode(String actionMode) { + + this.actionMode = actionMode; + return this; + } + + /** + * 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) + * @return actionMode + **/ + @javax.annotation.Nullable + public String getActionMode() { + return actionMode; + } + + + public void setActionMode(String actionMode) { + this.actionMode = actionMode; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiquidateOrder liquidateOrder = (LiquidateOrder) o; + return Objects.equals(this.text, liquidateOrder.text) && + Objects.equals(this.currencyPair, liquidateOrder.currencyPair) && + Objects.equals(this.amount, liquidateOrder.amount) && + Objects.equals(this.price, liquidateOrder.price) && + Objects.equals(this.actionMode, liquidateOrder.actionMode); + } + + @Override + public int hashCode() { + return Objects.hash(text, currencyPair, amount, price, actionMode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiquidateOrder {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" actionMode: ").append(toIndentedString(actionMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/Loan.java b/src/main/java/io/gate/gateapi/models/Loan.java deleted file mode 100644 index ac86fe0..0000000 --- a/src/main/java/io/gate/gateapi/models/Loan.java +++ /dev/null @@ -1,546 +0,0 @@ -/* - * 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. - * - * 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.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** - * Margin loan details - */ -public class Loan { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; - @SerializedName(SERIALIZED_NAME_CREATE_TIME) - private String createTime; - - public static final String SERIALIZED_NAME_EXPIRE_TIME = "expire_time"; - @SerializedName(SERIALIZED_NAME_EXPIRE_TIME) - private String expireTime; - - /** - * 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 - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - OPEN("open"), - - LOANED("loaned"), - - FINISHED("finished"), - - AUTO_REPAID("auto_repaid"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - /** - * Loan side - */ - @JsonAdapter(SideEnum.Adapter.class) - public enum SideEnum { - LEND("lend"), - - BORROW("borrow"); - - private String value; - - SideEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SideEnum fromValue(String value) { - for (SideEnum b : SideEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SideEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SideEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SideEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_SIDE = "side"; - @SerializedName(SERIALIZED_NAME_SIDE) - private SideEnum side; - - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_RATE = "rate"; - @SerializedName(SERIALIZED_NAME_RATE) - private String rate; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private String amount; - - public static final String SERIALIZED_NAME_DAYS = "days"; - @SerializedName(SERIALIZED_NAME_DAYS) - private Integer days; - - public static final String SERIALIZED_NAME_AUTO_RENEW = "auto_renew"; - @SerializedName(SERIALIZED_NAME_AUTO_RENEW) - private Boolean autoRenew = false; - - public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; - @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) - private String currencyPair; - - public static final String SERIALIZED_NAME_LEFT = "left"; - @SerializedName(SERIALIZED_NAME_LEFT) - private String left; - - public static final String SERIALIZED_NAME_REPAID = "repaid"; - @SerializedName(SERIALIZED_NAME_REPAID) - private String repaid; - - public static final String SERIALIZED_NAME_PAID_INTEREST = "paid_interest"; - @SerializedName(SERIALIZED_NAME_PAID_INTEREST) - private String paidInterest; - - public static final String SERIALIZED_NAME_UNPAID_INTEREST = "unpaid_interest"; - @SerializedName(SERIALIZED_NAME_UNPAID_INTEREST) - private String unpaidInterest; - - public static final String SERIALIZED_NAME_FEE_RATE = "fee_rate"; - @SerializedName(SERIALIZED_NAME_FEE_RATE) - private String feeRate; - - public static final String SERIALIZED_NAME_ORIG_ID = "orig_id"; - @SerializedName(SERIALIZED_NAME_ORIG_ID) - private String origId; - - public static final String SERIALIZED_NAME_TEXT = "text"; - @SerializedName(SERIALIZED_NAME_TEXT) - private String text; - - - /** - * Loan ID - * @return id - **/ - @javax.annotation.Nullable - public String getId() { - return id; - } - - - /** - * Creation time - * @return createTime - **/ - @javax.annotation.Nullable - public String getCreateTime() { - return createTime; - } - - - /** - * Repay time of the loan. No value will be returned for lending loan - * @return expireTime - **/ - @javax.annotation.Nullable - public String getExpireTime() { - return expireTime; - } - - - /** - * 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 - * @return status - **/ - @javax.annotation.Nullable - public StatusEnum getStatus() { - return status; - } - - - public Loan side(SideEnum side) { - - this.side = side; - return this; - } - - /** - * Loan side - * @return side - **/ - public SideEnum getSide() { - return side; - } - - - public void setSide(SideEnum side) { - this.side = side; - } - - public Loan currency(String currency) { - - this.currency = currency; - return this; - } - - /** - * Loan currency - * @return currency - **/ - public String getCurrency() { - return currency; - } - - - public void setCurrency(String currency) { - this.currency = currency; - } - - public Loan rate(String rate) { - - this.rate = rate; - return this; - } - - /** - * 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 - * @return rate - **/ - @javax.annotation.Nullable - public String getRate() { - return rate; - } - - - public void setRate(String rate) { - this.rate = rate; - } - - public Loan amount(String amount) { - - this.amount = amount; - return this; - } - - /** - * Loan amount - * @return amount - **/ - public String getAmount() { - return amount; - } - - - public void setAmount(String amount) { - this.amount = amount; - } - - public Loan days(Integer days) { - - this.days = days; - return this; - } - - /** - * Loan days. Only 10 is supported for now - * @return days - **/ - @javax.annotation.Nullable - public Integer getDays() { - return days; - } - - - public void setDays(Integer days) { - this.days = days; - } - - public Loan autoRenew(Boolean autoRenew) { - - this.autoRenew = autoRenew; - return this; - } - - /** - * Whether to auto renew the loan upon expiration - * @return autoRenew - **/ - @javax.annotation.Nullable - public Boolean getAutoRenew() { - return autoRenew; - } - - - public void setAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - } - - public Loan currencyPair(String currencyPair) { - - this.currencyPair = currencyPair; - return this; - } - - /** - * Currency pair. Required if borrowing - * @return currencyPair - **/ - @javax.annotation.Nullable - public String getCurrencyPair() { - return currencyPair; - } - - - public void setCurrencyPair(String currencyPair) { - this.currencyPair = currencyPair; - } - - /** - * Amount not lent out yet - * @return left - **/ - @javax.annotation.Nullable - public String getLeft() { - return left; - } - - - /** - * Repaid amount - * @return repaid - **/ - @javax.annotation.Nullable - public String getRepaid() { - return repaid; - } - - - /** - * Repaid interest - * @return paidInterest - **/ - @javax.annotation.Nullable - public String getPaidInterest() { - return paidInterest; - } - - - /** - * Outstanding interest yet to be paid - * @return unpaidInterest - **/ - @javax.annotation.Nullable - public String getUnpaidInterest() { - return unpaidInterest; - } - - - public Loan feeRate(String feeRate) { - - this.feeRate = feeRate; - return this; - } - - /** - * Loan fee rate - * @return feeRate - **/ - @javax.annotation.Nullable - public String getFeeRate() { - return feeRate; - } - - - public void setFeeRate(String feeRate) { - this.feeRate = feeRate; - } - - public Loan origId(String origId) { - - this.origId = origId; - return this; - } - - /** - * Original loan ID of the loan if auto-renewed, otherwise equals to id - * @return origId - **/ - @javax.annotation.Nullable - public String getOrigId() { - return origId; - } - - - public void setOrigId(String origId) { - this.origId = origId; - } - - public Loan text(String text) { - - this.text = text; - return this; - } - - /** - * User defined custom ID - * @return text - **/ - @javax.annotation.Nullable - public String getText() { - return text; - } - - - public void setText(String text) { - this.text = text; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Loan loan = (Loan) o; - return Objects.equals(this.id, loan.id) && - Objects.equals(this.createTime, loan.createTime) && - Objects.equals(this.expireTime, loan.expireTime) && - Objects.equals(this.status, loan.status) && - Objects.equals(this.side, loan.side) && - Objects.equals(this.currency, loan.currency) && - Objects.equals(this.rate, loan.rate) && - Objects.equals(this.amount, loan.amount) && - Objects.equals(this.days, loan.days) && - Objects.equals(this.autoRenew, loan.autoRenew) && - Objects.equals(this.currencyPair, loan.currencyPair) && - Objects.equals(this.left, loan.left) && - Objects.equals(this.repaid, loan.repaid) && - Objects.equals(this.paidInterest, loan.paidInterest) && - Objects.equals(this.unpaidInterest, loan.unpaidInterest) && - Objects.equals(this.feeRate, loan.feeRate) && - Objects.equals(this.origId, loan.origId) && - Objects.equals(this.text, loan.text); - } - - @Override - public int hashCode() { - return Objects.hash(id, createTime, expireTime, status, side, currency, rate, amount, days, autoRenew, currencyPair, left, repaid, paidInterest, unpaidInterest, feeRate, origId, text); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Loan {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); - sb.append(" expireTime: ").append(toIndentedString(expireTime)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" days: ").append(toIndentedString(days)).append("\n"); - sb.append(" autoRenew: ").append(toIndentedString(autoRenew)).append("\n"); - sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); - sb.append(" left: ").append(toIndentedString(left)).append("\n"); - sb.append(" repaid: ").append(toIndentedString(repaid)).append("\n"); - sb.append(" paidInterest: ").append(toIndentedString(paidInterest)).append("\n"); - sb.append(" unpaidInterest: ").append(toIndentedString(unpaidInterest)).append("\n"); - sb.append(" feeRate: ").append(toIndentedString(feeRate)).append("\n"); - sb.append(" origId: ").append(toIndentedString(origId)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/io/gate/gateapi/models/LoanPatch.java b/src/main/java/io/gate/gateapi/models/LoanPatch.java deleted file mode 100644 index 8b3ac90..0000000 --- a/src/main/java/io/gate/gateapi/models/LoanPatch.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * 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. - * - * 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.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** - * LoanPatch - */ -public class LoanPatch { - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - /** - * Loan side. Possible values are `lend` and `borrow`. For `LoanRecord` patching, only `lend` is supported - */ - @JsonAdapter(SideEnum.Adapter.class) - public enum SideEnum { - LEND("lend"), - - BORROW("borrow"); - - private String value; - - SideEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SideEnum fromValue(String value) { - for (SideEnum b : SideEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SideEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SideEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SideEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_SIDE = "side"; - @SerializedName(SERIALIZED_NAME_SIDE) - private SideEnum side; - - public static final String SERIALIZED_NAME_AUTO_RENEW = "auto_renew"; - @SerializedName(SERIALIZED_NAME_AUTO_RENEW) - private Boolean autoRenew; - - public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; - @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) - private String currencyPair; - - public static final String SERIALIZED_NAME_LOAN_ID = "loan_id"; - @SerializedName(SERIALIZED_NAME_LOAN_ID) - private String loanId; - - - public LoanPatch currency(String currency) { - - this.currency = currency; - return this; - } - - /** - * Loan currency - * @return currency - **/ - public String getCurrency() { - return currency; - } - - - public void setCurrency(String currency) { - this.currency = currency; - } - - public LoanPatch side(SideEnum side) { - - this.side = side; - return this; - } - - /** - * Loan side. Possible values are `lend` and `borrow`. For `LoanRecord` patching, only `lend` is supported - * @return side - **/ - public SideEnum getSide() { - return side; - } - - - public void setSide(SideEnum side) { - this.side = side; - } - - public LoanPatch autoRenew(Boolean autoRenew) { - - this.autoRenew = autoRenew; - return this; - } - - /** - * Auto renew - * @return autoRenew - **/ - public Boolean getAutoRenew() { - return autoRenew; - } - - - public void setAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - } - - public LoanPatch currencyPair(String currencyPair) { - - this.currencyPair = currencyPair; - return this; - } - - /** - * Currency pair. Required if borrowing - * @return currencyPair - **/ - @javax.annotation.Nullable - public String getCurrencyPair() { - return currencyPair; - } - - - public void setCurrencyPair(String currencyPair) { - this.currencyPair = currencyPair; - } - - public LoanPatch loanId(String loanId) { - - this.loanId = loanId; - return this; - } - - /** - * Loan ID. Required for `LoanRecord` patching - * @return loanId - **/ - @javax.annotation.Nullable - public String getLoanId() { - return loanId; - } - - - public void setLoanId(String loanId) { - this.loanId = loanId; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LoanPatch loanPatch = (LoanPatch) o; - return Objects.equals(this.currency, loanPatch.currency) && - Objects.equals(this.side, loanPatch.side) && - Objects.equals(this.autoRenew, loanPatch.autoRenew) && - Objects.equals(this.currencyPair, loanPatch.currencyPair) && - Objects.equals(this.loanId, loanPatch.loanId); - } - - @Override - public int hashCode() { - return Objects.hash(currency, side, autoRenew, currencyPair, loanId); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LoanPatch {\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" autoRenew: ").append(toIndentedString(autoRenew)).append("\n"); - sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); - sb.append(" loanId: ").append(toIndentedString(loanId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/io/gate/gateapi/models/LoanRecord.java b/src/main/java/io/gate/gateapi/models/LoanRecord.java deleted file mode 100644 index d103e99..0000000 --- a/src/main/java/io/gate/gateapi/models/LoanRecord.java +++ /dev/null @@ -1,454 +0,0 @@ -/* - * 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. - * - * 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.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** - * Margin loaned record details - */ -public class LoanRecord { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_LOAN_ID = "loan_id"; - @SerializedName(SERIALIZED_NAME_LOAN_ID) - private String loanId; - - public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; - @SerializedName(SERIALIZED_NAME_CREATE_TIME) - private String createTime; - - public static final String SERIALIZED_NAME_EXPIRE_TIME = "expire_time"; - @SerializedName(SERIALIZED_NAME_EXPIRE_TIME) - private String expireTime; - - /** - * Loan record status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - LOANED("loaned"), - - FINISHED("finished"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_BORROW_USER_ID = "borrow_user_id"; - @SerializedName(SERIALIZED_NAME_BORROW_USER_ID) - private String borrowUserId; - - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_RATE = "rate"; - @SerializedName(SERIALIZED_NAME_RATE) - private String rate; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private String amount; - - public static final String SERIALIZED_NAME_DAYS = "days"; - @SerializedName(SERIALIZED_NAME_DAYS) - private Integer days; - - public static final String SERIALIZED_NAME_AUTO_RENEW = "auto_renew"; - @SerializedName(SERIALIZED_NAME_AUTO_RENEW) - private Boolean autoRenew = false; - - public static final String SERIALIZED_NAME_REPAID = "repaid"; - @SerializedName(SERIALIZED_NAME_REPAID) - private String repaid; - - public static final String SERIALIZED_NAME_PAID_INTEREST = "paid_interest"; - @SerializedName(SERIALIZED_NAME_PAID_INTEREST) - private String paidInterest; - - public static final String SERIALIZED_NAME_UNPAID_INTEREST = "unpaid_interest"; - @SerializedName(SERIALIZED_NAME_UNPAID_INTEREST) - private String unpaidInterest; - - - public LoanRecord id(String id) { - - this.id = id; - return this; - } - - /** - * Loan record ID - * @return id - **/ - @javax.annotation.Nullable - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - public LoanRecord loanId(String loanId) { - - this.loanId = loanId; - return this; - } - - /** - * Loan ID the record belongs to - * @return loanId - **/ - @javax.annotation.Nullable - public String getLoanId() { - return loanId; - } - - - public void setLoanId(String loanId) { - this.loanId = loanId; - } - - public LoanRecord createTime(String createTime) { - - this.createTime = createTime; - return this; - } - - /** - * Loan time - * @return createTime - **/ - @javax.annotation.Nullable - public String getCreateTime() { - return createTime; - } - - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public LoanRecord expireTime(String expireTime) { - - this.expireTime = expireTime; - return this; - } - - /** - * Expiration time - * @return expireTime - **/ - @javax.annotation.Nullable - public String getExpireTime() { - return expireTime; - } - - - public void setExpireTime(String expireTime) { - this.expireTime = expireTime; - } - - public LoanRecord status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Loan record status - * @return status - **/ - @javax.annotation.Nullable - public StatusEnum getStatus() { - return status; - } - - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public LoanRecord borrowUserId(String borrowUserId) { - - this.borrowUserId = borrowUserId; - return this; - } - - /** - * Garbled user ID - * @return borrowUserId - **/ - @javax.annotation.Nullable - public String getBorrowUserId() { - return borrowUserId; - } - - - public void setBorrowUserId(String borrowUserId) { - this.borrowUserId = borrowUserId; - } - - public LoanRecord currency(String currency) { - - this.currency = currency; - return this; - } - - /** - * Loan currency - * @return currency - **/ - @javax.annotation.Nullable - public String getCurrency() { - return currency; - } - - - public void setCurrency(String currency) { - this.currency = currency; - } - - public LoanRecord rate(String rate) { - - this.rate = rate; - return this; - } - - /** - * Loan rate - * @return rate - **/ - @javax.annotation.Nullable - public String getRate() { - return rate; - } - - - public void setRate(String rate) { - this.rate = rate; - } - - public LoanRecord amount(String amount) { - - this.amount = amount; - return this; - } - - /** - * Loan amount - * @return amount - **/ - @javax.annotation.Nullable - public String getAmount() { - return amount; - } - - - public void setAmount(String amount) { - this.amount = amount; - } - - public LoanRecord days(Integer days) { - - this.days = days; - return this; - } - - /** - * Loan days - * @return days - **/ - @javax.annotation.Nullable - public Integer getDays() { - return days; - } - - - public void setDays(Integer days) { - this.days = days; - } - - public LoanRecord autoRenew(Boolean autoRenew) { - - this.autoRenew = autoRenew; - return this; - } - - /** - * Whether the record will auto renew on expiration - * @return autoRenew - **/ - @javax.annotation.Nullable - public Boolean getAutoRenew() { - return autoRenew; - } - - - public void setAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - } - - public LoanRecord repaid(String repaid) { - - this.repaid = repaid; - return this; - } - - /** - * Repaid amount - * @return repaid - **/ - @javax.annotation.Nullable - public String getRepaid() { - return repaid; - } - - - public void setRepaid(String repaid) { - this.repaid = repaid; - } - - /** - * Repaid interest - * @return paidInterest - **/ - @javax.annotation.Nullable - public String getPaidInterest() { - return paidInterest; - } - - - /** - * Outstanding interest yet to be paid - * @return unpaidInterest - **/ - @javax.annotation.Nullable - public String getUnpaidInterest() { - return unpaidInterest; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LoanRecord loanRecord = (LoanRecord) o; - return Objects.equals(this.id, loanRecord.id) && - Objects.equals(this.loanId, loanRecord.loanId) && - Objects.equals(this.createTime, loanRecord.createTime) && - Objects.equals(this.expireTime, loanRecord.expireTime) && - Objects.equals(this.status, loanRecord.status) && - Objects.equals(this.borrowUserId, loanRecord.borrowUserId) && - Objects.equals(this.currency, loanRecord.currency) && - Objects.equals(this.rate, loanRecord.rate) && - Objects.equals(this.amount, loanRecord.amount) && - Objects.equals(this.days, loanRecord.days) && - Objects.equals(this.autoRenew, loanRecord.autoRenew) && - Objects.equals(this.repaid, loanRecord.repaid) && - Objects.equals(this.paidInterest, loanRecord.paidInterest) && - Objects.equals(this.unpaidInterest, loanRecord.unpaidInterest); - } - - @Override - public int hashCode() { - return Objects.hash(id, loanId, createTime, expireTime, status, borrowUserId, currency, rate, amount, days, autoRenew, repaid, paidInterest, unpaidInterest); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LoanRecord {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" loanId: ").append(toIndentedString(loanId)).append("\n"); - sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); - sb.append(" expireTime: ").append(toIndentedString(expireTime)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" borrowUserId: ").append(toIndentedString(borrowUserId)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" days: ").append(toIndentedString(days)).append("\n"); - sb.append(" autoRenew: ").append(toIndentedString(autoRenew)).append("\n"); - sb.append(" repaid: ").append(toIndentedString(repaid)).append("\n"); - sb.append(" paidInterest: ").append(toIndentedString(paidInterest)).append("\n"); - sb.append(" unpaidInterest: ").append(toIndentedString(unpaidInterest)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/io/gate/gateapi/models/MarginAccount.java b/src/main/java/io/gate/gateapi/models/MarginAccount.java index 3e738c4..d744e56 100644 --- a/src/main/java/io/gate/gateapi/models/MarginAccount.java +++ b/src/main/java/io/gate/gateapi/models/MarginAccount.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 @@ -21,13 +21,21 @@ import java.io.IOException; /** - * 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 */ public class MarginAccount { public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) private String currencyPair; + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "account_type"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + private String accountType; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + public static final String SERIALIZED_NAME_LOCKED = "locked"; @SerializedName(SERIALIZED_NAME_LOCKED) private Boolean locked; @@ -36,6 +44,10 @@ public class MarginAccount { @SerializedName(SERIALIZED_NAME_RISK) private String risk; + public static final String SERIALIZED_NAME_MMR = "mmr"; + @SerializedName(SERIALIZED_NAME_MMR) + private String mmr; + public static final String SERIALIZED_NAME_BASE = "base"; @SerializedName(SERIALIZED_NAME_BASE) private MarginAccountCurrency base; @@ -65,6 +77,46 @@ public void setCurrencyPair(String currencyPair) { this.currencyPair = currencyPair; } + public MarginAccount accountType(String accountType) { + + this.accountType = accountType; + return this; + } + + /** + * Account type: risk - risk rate account, mmr - maintenance margin rate account, inactive - market not activated + * @return accountType + **/ + @javax.annotation.Nullable + public String getAccountType() { + return accountType; + } + + + public void setAccountType(String accountType) { + this.accountType = accountType; + } + + public MarginAccount leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * User's current market leverage multiplier + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + public MarginAccount locked(Boolean locked) { this.locked = locked; @@ -72,7 +124,7 @@ public MarginAccount locked(Boolean locked) { } /** - * Whether account is locked + * Whether the account is locked * @return locked **/ @javax.annotation.Nullable @@ -92,7 +144,7 @@ public MarginAccount risk(String risk) { } /** - * Current risk rate of margin account + * Current risk rate of the margin account (returned when the account is a risk rate account) * @return risk **/ @javax.annotation.Nullable @@ -105,6 +157,26 @@ public void setRisk(String risk) { this.risk = risk; } + public MarginAccount mmr(String mmr) { + + this.mmr = mmr; + return this; + } + + /** + * Leveraged Account Current Maintenance Margin Rate (returned when the Account is Account) + * @return mmr + **/ + @javax.annotation.Nullable + public String getMmr() { + return mmr; + } + + + public void setMmr(String mmr) { + this.mmr = mmr; + } + public MarginAccount base(MarginAccountCurrency base) { this.base = base; @@ -154,15 +226,18 @@ public boolean equals(java.lang.Object o) { } MarginAccount marginAccount = (MarginAccount) o; return Objects.equals(this.currencyPair, marginAccount.currencyPair) && + Objects.equals(this.accountType, marginAccount.accountType) && + Objects.equals(this.leverage, marginAccount.leverage) && Objects.equals(this.locked, marginAccount.locked) && Objects.equals(this.risk, marginAccount.risk) && + Objects.equals(this.mmr, marginAccount.mmr) && Objects.equals(this.base, marginAccount.base) && Objects.equals(this.quote, marginAccount.quote); } @Override public int hashCode() { - return Objects.hash(currencyPair, locked, risk, base, quote); + return Objects.hash(currencyPair, accountType, leverage, locked, risk, mmr, base, quote); } @@ -171,8 +246,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MarginAccount {\n"); sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); sb.append(" risk: ").append(toIndentedString(risk)).append("\n"); + sb.append(" mmr: ").append(toIndentedString(mmr)).append("\n"); sb.append(" base: ").append(toIndentedString(base)).append("\n"); sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); sb.append("}"); diff --git a/src/main/java/io/gate/gateapi/models/MarginAccountBook.java b/src/main/java/io/gate/gateapi/models/MarginAccountBook.java index f8ab8bd..365e6ba 100644 --- a/src/main/java/io/gate/gateapi/models/MarginAccountBook.java +++ b/src/main/java/io/gate/gateapi/models/MarginAccountBook.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 @@ -51,6 +51,10 @@ public class MarginAccountBook { @SerializedName(SERIALIZED_NAME_BALANCE) private String balance; + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + public MarginAccountBook id(String id) { @@ -79,7 +83,7 @@ public MarginAccountBook time(String time) { } /** - * Balance changed timestamp + * Account change timestamp * @return time **/ @javax.annotation.Nullable @@ -139,7 +143,7 @@ public MarginAccountBook currencyPair(String currencyPair) { } /** - * Account currency pair + * Account trading pair * @return currencyPair **/ @javax.annotation.Nullable @@ -191,6 +195,26 @@ public String getBalance() { public void setBalance(String balance) { this.balance = balance; } + + public MarginAccountBook type(String type) { + + this.type = type; + return this; + } + + /** + * Account book type. Please refer to [account book type](#accountbook-type) for more detail + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -206,12 +230,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.currency, marginAccountBook.currency) && Objects.equals(this.currencyPair, marginAccountBook.currencyPair) && Objects.equals(this.change, marginAccountBook.change) && - Objects.equals(this.balance, marginAccountBook.balance); + Objects.equals(this.balance, marginAccountBook.balance) && + Objects.equals(this.type, marginAccountBook.type); } @Override public int hashCode() { - return Objects.hash(id, time, timeMs, currency, currencyPair, change, balance); + return Objects.hash(id, time, timeMs, currency, currencyPair, change, balance, type); } @@ -226,6 +251,7 @@ public String toString() { sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); sb.append(" change: ").append(toIndentedString(change)).append("\n"); sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/MarginAccountCurrency.java b/src/main/java/io/gate/gateapi/models/MarginAccountCurrency.java index a0ebc5d..9087032 100644 --- a/src/main/java/io/gate/gateapi/models/MarginAccountCurrency.java +++ b/src/main/java/io/gate/gateapi/models/MarginAccountCurrency.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 @@ -20,7 +20,7 @@ import java.io.IOException; /** - * Account currency details + * Currency account information */ public class MarginAccountCurrency { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @@ -71,7 +71,7 @@ public MarginAccountCurrency available(String available) { } /** - * Amount suitable for margin trading. + * Amount available for margin trading, available = margin + borrowed * @return available **/ @javax.annotation.Nullable @@ -91,7 +91,7 @@ public MarginAccountCurrency locked(String locked) { } /** - * Locked amount, used in margin trading + * Frozen funds, such as amounts already placed in margin market for order trading * @return locked **/ @javax.annotation.Nullable @@ -111,7 +111,7 @@ public MarginAccountCurrency borrowed(String borrowed) { } /** - * Borrowed amount + * Borrowed funds * @return borrowed **/ @javax.annotation.Nullable @@ -131,7 +131,7 @@ public MarginAccountCurrency interest(String interest) { } /** - * Unpaid interests + * Unpaid interest * @return interest **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/MarginCurrencyPair.java b/src/main/java/io/gate/gateapi/models/MarginCurrencyPair.java deleted file mode 100644 index 08eb404..0000000 --- a/src/main/java/io/gate/gateapi/models/MarginCurrencyPair.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 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. - * - * 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.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -/** - * MarginCurrencyPair - */ -public class MarginCurrencyPair { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_BASE = "base"; - @SerializedName(SERIALIZED_NAME_BASE) - private String base; - - public static final String SERIALIZED_NAME_QUOTE = "quote"; - @SerializedName(SERIALIZED_NAME_QUOTE) - private String quote; - - public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; - @SerializedName(SERIALIZED_NAME_LEVERAGE) - private Integer leverage; - - public static final String SERIALIZED_NAME_MIN_BASE_AMOUNT = "min_base_amount"; - @SerializedName(SERIALIZED_NAME_MIN_BASE_AMOUNT) - private String minBaseAmount; - - public static final String SERIALIZED_NAME_MIN_QUOTE_AMOUNT = "min_quote_amount"; - @SerializedName(SERIALIZED_NAME_MIN_QUOTE_AMOUNT) - private String minQuoteAmount; - - public static final String SERIALIZED_NAME_MAX_QUOTE_AMOUNT = "max_quote_amount"; - @SerializedName(SERIALIZED_NAME_MAX_QUOTE_AMOUNT) - private String maxQuoteAmount; - - - public MarginCurrencyPair id(String id) { - - this.id = id; - return this; - } - - /** - * Currency pair - * @return id - **/ - @javax.annotation.Nullable - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - public MarginCurrencyPair base(String base) { - - this.base = base; - return this; - } - - /** - * Base currency - * @return base - **/ - @javax.annotation.Nullable - public String getBase() { - return base; - } - - - public void setBase(String base) { - this.base = base; - } - - public MarginCurrencyPair quote(String quote) { - - this.quote = quote; - return this; - } - - /** - * Quote currency - * @return quote - **/ - @javax.annotation.Nullable - public String getQuote() { - return quote; - } - - - public void setQuote(String quote) { - this.quote = quote; - } - - public MarginCurrencyPair leverage(Integer leverage) { - - this.leverage = leverage; - return this; - } - - /** - * Leverage - * @return leverage - **/ - @javax.annotation.Nullable - public Integer getLeverage() { - return leverage; - } - - - public void setLeverage(Integer leverage) { - this.leverage = leverage; - } - - public MarginCurrencyPair minBaseAmount(String minBaseAmount) { - - this.minBaseAmount = minBaseAmount; - return this; - } - - /** - * Minimum base currency to loan, `null` means no limit - * @return minBaseAmount - **/ - @javax.annotation.Nullable - public String getMinBaseAmount() { - return minBaseAmount; - } - - - public void setMinBaseAmount(String minBaseAmount) { - this.minBaseAmount = minBaseAmount; - } - - public MarginCurrencyPair minQuoteAmount(String minQuoteAmount) { - - this.minQuoteAmount = minQuoteAmount; - return this; - } - - /** - * Minimum quote currency to loan, `null` means no limit - * @return minQuoteAmount - **/ - @javax.annotation.Nullable - public String getMinQuoteAmount() { - return minQuoteAmount; - } - - - public void setMinQuoteAmount(String minQuoteAmount) { - this.minQuoteAmount = minQuoteAmount; - } - - public MarginCurrencyPair maxQuoteAmount(String maxQuoteAmount) { - - this.maxQuoteAmount = maxQuoteAmount; - return this; - } - - /** - * Maximum borrowable amount for quote currency. Base currency limit is calculated by quote maximum and market price. `null` means no limit - * @return maxQuoteAmount - **/ - @javax.annotation.Nullable - public String getMaxQuoteAmount() { - return maxQuoteAmount; - } - - - public void setMaxQuoteAmount(String maxQuoteAmount) { - this.maxQuoteAmount = maxQuoteAmount; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MarginCurrencyPair marginCurrencyPair = (MarginCurrencyPair) o; - return Objects.equals(this.id, marginCurrencyPair.id) && - Objects.equals(this.base, marginCurrencyPair.base) && - Objects.equals(this.quote, marginCurrencyPair.quote) && - Objects.equals(this.leverage, marginCurrencyPair.leverage) && - Objects.equals(this.minBaseAmount, marginCurrencyPair.minBaseAmount) && - Objects.equals(this.minQuoteAmount, marginCurrencyPair.minQuoteAmount) && - Objects.equals(this.maxQuoteAmount, marginCurrencyPair.maxQuoteAmount); - } - - @Override - public int hashCode() { - return Objects.hash(id, base, quote, leverage, minBaseAmount, minQuoteAmount, maxQuoteAmount); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MarginCurrencyPair {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" base: ").append(toIndentedString(base)).append("\n"); - sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); - sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); - sb.append(" minBaseAmount: ").append(toIndentedString(minBaseAmount)).append("\n"); - sb.append(" minQuoteAmount: ").append(toIndentedString(minQuoteAmount)).append("\n"); - sb.append(" maxQuoteAmount: ").append(toIndentedString(maxQuoteAmount)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/io/gate/gateapi/models/MarginLeverageTier.java b/src/main/java/io/gate/gateapi/models/MarginLeverageTier.java new file mode 100644 index 0000000..ef20fa7 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MarginLeverageTier.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Market gradient information + */ +public class MarginLeverageTier { + public static final String SERIALIZED_NAME_UPPER_LIMIT = "upper_limit"; + @SerializedName(SERIALIZED_NAME_UPPER_LIMIT) + private String upperLimit; + + public static final String SERIALIZED_NAME_MMR = "mmr"; + @SerializedName(SERIALIZED_NAME_MMR) + private String mmr; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + + public MarginLeverageTier upperLimit(String upperLimit) { + + this.upperLimit = upperLimit; + return this; + } + + /** + * Maximum loan limit + * @return upperLimit + **/ + @javax.annotation.Nullable + public String getUpperLimit() { + return upperLimit; + } + + + public void setUpperLimit(String upperLimit) { + this.upperLimit = upperLimit; + } + + public MarginLeverageTier mmr(String mmr) { + + this.mmr = mmr; + return this; + } + + /** + * Maintenance margin rate + * @return mmr + **/ + @javax.annotation.Nullable + public String getMmr() { + return mmr; + } + + + public void setMmr(String mmr) { + this.mmr = mmr; + } + + public MarginLeverageTier leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * Maximum leverage multiple + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginLeverageTier marginLeverageTier = (MarginLeverageTier) o; + return Objects.equals(this.upperLimit, marginLeverageTier.upperLimit) && + Objects.equals(this.mmr, marginLeverageTier.mmr) && + Objects.equals(this.leverage, marginLeverageTier.leverage); + } + + @Override + public int hashCode() { + return Objects.hash(upperLimit, mmr, leverage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginLeverageTier {\n"); + sb.append(" upperLimit: ").append(toIndentedString(upperLimit)).append("\n"); + sb.append(" mmr: ").append(toIndentedString(mmr)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MarginMarketLeverage.java b/src/main/java/io/gate/gateapi/models/MarginMarketLeverage.java new file mode 100644 index 0000000..a379beb --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MarginMarketLeverage.java @@ -0,0 +1,114 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Market leverage settings + */ +public class MarginMarketLeverage { + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + + public MarginMarketLeverage currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Market + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public MarginMarketLeverage leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * Position leverage + * @return leverage + **/ + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginMarketLeverage marginMarketLeverage = (MarginMarketLeverage) o; + return Objects.equals(this.currencyPair, marginMarketLeverage.currencyPair) && + Objects.equals(this.leverage, marginMarketLeverage.leverage); + } + + @Override + public int hashCode() { + return Objects.hash(currencyPair, leverage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginMarketLeverage {\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MarginTiers.java b/src/main/java/io/gate/gateapi/models/MarginTiers.java new file mode 100644 index 0000000..436d011 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MarginTiers.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MarginTiers + */ +public class MarginTiers { + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + private String tier; + + public static final String SERIALIZED_NAME_MARGIN_RATE = "margin_rate"; + @SerializedName(SERIALIZED_NAME_MARGIN_RATE) + private String marginRate; + + public static final String SERIALIZED_NAME_LOWER_LIMIT = "lower_limit"; + @SerializedName(SERIALIZED_NAME_LOWER_LIMIT) + private String lowerLimit; + + public static final String SERIALIZED_NAME_UPPER_LIMIT = "upper_limit"; + @SerializedName(SERIALIZED_NAME_UPPER_LIMIT) + private String upperLimit; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + + public MarginTiers tier(String tier) { + + this.tier = tier; + return this; + } + + /** + * Tier + * @return tier + **/ + @javax.annotation.Nullable + public String getTier() { + return tier; + } + + + public void setTier(String tier) { + this.tier = tier; + } + + public MarginTiers marginRate(String marginRate) { + + this.marginRate = marginRate; + return this; + } + + /** + * Discount + * @return marginRate + **/ + @javax.annotation.Nullable + public String getMarginRate() { + return marginRate; + } + + + public void setMarginRate(String marginRate) { + this.marginRate = marginRate; + } + + public MarginTiers lowerLimit(String lowerLimit) { + + this.lowerLimit = lowerLimit; + return this; + } + + /** + * Lower limit + * @return lowerLimit + **/ + @javax.annotation.Nullable + public String getLowerLimit() { + return lowerLimit; + } + + + public void setLowerLimit(String lowerLimit) { + this.lowerLimit = lowerLimit; + } + + public MarginTiers upperLimit(String upperLimit) { + + this.upperLimit = upperLimit; + return this; + } + + /** + * Upper limit, \"\" indicates greater than (the last tier) + * @return upperLimit + **/ + @javax.annotation.Nullable + public String getUpperLimit() { + return upperLimit; + } + + + public void setUpperLimit(String upperLimit) { + this.upperLimit = upperLimit; + } + + public MarginTiers leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * Position leverage + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarginTiers marginTiers = (MarginTiers) o; + return Objects.equals(this.tier, marginTiers.tier) && + Objects.equals(this.marginRate, marginTiers.marginRate) && + Objects.equals(this.lowerLimit, marginTiers.lowerLimit) && + Objects.equals(this.upperLimit, marginTiers.upperLimit) && + Objects.equals(this.leverage, marginTiers.leverage); + } + + @Override + public int hashCode() { + return Objects.hash(tier, marginRate, lowerLimit, upperLimit, leverage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarginTiers {\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" marginRate: ").append(toIndentedString(marginRate)).append("\n"); + sb.append(" lowerLimit: ").append(toIndentedString(lowerLimit)).append("\n"); + sb.append(" upperLimit: ").append(toIndentedString(upperLimit)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MarginTransferable.java b/src/main/java/io/gate/gateapi/models/MarginTransferable.java index 65b8fdd..aa9dc33 100644 --- a/src/main/java/io/gate/gateapi/models/MarginTransferable.java +++ b/src/main/java/io/gate/gateapi/models/MarginTransferable.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/models/MaxUniBorrowable.java b/src/main/java/io/gate/gateapi/models/MaxUniBorrowable.java new file mode 100644 index 0000000..7c03c11 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MaxUniBorrowable.java @@ -0,0 +1,109 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MaxUniBorrowable + */ +public class MaxUniBorrowable { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_BORROWABLE = "borrowable"; + @SerializedName(SERIALIZED_NAME_BORROWABLE) + private String borrowable; + + + /** + * Currency + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + /** + * Maximum borrowable + * @return borrowable + **/ + public String getBorrowable() { + return borrowable; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxUniBorrowable maxUniBorrowable = (MaxUniBorrowable) o; + return Objects.equals(this.currency, maxUniBorrowable.currency) && + Objects.equals(this.currencyPair, maxUniBorrowable.currencyPair) && + Objects.equals(this.borrowable, maxUniBorrowable.borrowable); + } + + @Override + public int hashCode() { + return Objects.hash(currency, currencyPair, borrowable); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxUniBorrowable {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" borrowable: ").append(toIndentedString(borrowable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockFuturesOrder.java b/src/main/java/io/gate/gateapi/models/MockFuturesOrder.java new file mode 100644 index 0000000..9d13c33 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockFuturesOrder.java @@ -0,0 +1,138 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Futures order + */ +public class MockFuturesOrder { + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private String size; + + public static final String SERIALIZED_NAME_LEFT = "left"; + @SerializedName(SERIALIZED_NAME_LEFT) + private String left; + + + public MockFuturesOrder contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures name, currently only supports USDT perpetual contracts for BTC and ETH + * @return contract + **/ + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public MockFuturesOrder size(String size) { + + this.size = size; + return this; + } + + /** + * Contract quantity, representing the initial order quantity, not involved in actual settlement + * @return size + **/ + public String getSize() { + return size; + } + + + public void setSize(String size) { + this.size = size; + } + + public MockFuturesOrder left(String left) { + + this.left = left; + return this; + } + + /** + * Unfilled contract quantity, involved in actual calculation + * @return left + **/ + public String getLeft() { + return left; + } + + + public void setLeft(String left) { + this.left = left; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockFuturesOrder mockFuturesOrder = (MockFuturesOrder) o; + return Objects.equals(this.contract, mockFuturesOrder.contract) && + Objects.equals(this.size, mockFuturesOrder.size) && + Objects.equals(this.left, mockFuturesOrder.left); + } + + @Override + public int hashCode() { + return Objects.hash(contract, size, left); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockFuturesOrder {\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockFuturesPosition.java b/src/main/java/io/gate/gateapi/models/MockFuturesPosition.java new file mode 100644 index 0000000..3db4e9d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockFuturesPosition.java @@ -0,0 +1,113 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Futures positions + */ +public class MockFuturesPosition { + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private String size; + + + public MockFuturesPosition contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures name, currently only supports USDT perpetual contracts for BTC and ETH + * @return contract + **/ + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public MockFuturesPosition size(String size) { + + this.size = size; + return this; + } + + /** + * Position size, measured in contract quantity + * @return size + **/ + public String getSize() { + return size; + } + + + public void setSize(String size) { + this.size = size; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockFuturesPosition mockFuturesPosition = (MockFuturesPosition) o; + return Objects.equals(this.contract, mockFuturesPosition.contract) && + Objects.equals(this.size, mockFuturesPosition.size); + } + + @Override + public int hashCode() { + return Objects.hash(contract, size); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockFuturesPosition {\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockMarginResult.java b/src/main/java/io/gate/gateapi/models/MockMarginResult.java new file mode 100644 index 0000000..d8cf32d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockMarginResult.java @@ -0,0 +1,256 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.ProfitLossRange; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Margin result + */ +public class MockMarginResult { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_PROFIT_LOSS_RANGES = "profit_loss_ranges"; + @SerializedName(SERIALIZED_NAME_PROFIT_LOSS_RANGES) + private List profitLossRanges = null; + + public static final String SERIALIZED_NAME_MAX_LOSS = "max_loss"; + @SerializedName(SERIALIZED_NAME_MAX_LOSS) + private ProfitLossRange maxLoss; + + public static final String SERIALIZED_NAME_MR1 = "mr1"; + @SerializedName(SERIALIZED_NAME_MR1) + private String mr1; + + public static final String SERIALIZED_NAME_MR2 = "mr2"; + @SerializedName(SERIALIZED_NAME_MR2) + private String mr2; + + public static final String SERIALIZED_NAME_MR3 = "mr3"; + @SerializedName(SERIALIZED_NAME_MR3) + private String mr3; + + public static final String SERIALIZED_NAME_MR4 = "mr4"; + @SerializedName(SERIALIZED_NAME_MR4) + private String mr4; + + + public MockMarginResult type(String type) { + + this.type = type; + return this; + } + + /** + * Position combination type `original_position` - Original position `long_delta_original_position` - Positive delta + Original position `short_delta_original_position` - Negative delta + Original position + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + public MockMarginResult profitLossRanges(List profitLossRanges) { + + this.profitLossRanges = profitLossRanges; + return this; + } + + public MockMarginResult addProfitLossRangesItem(ProfitLossRange profitLossRangesItem) { + if (this.profitLossRanges == null) { + this.profitLossRanges = new ArrayList<>(); + } + this.profitLossRanges.add(profitLossRangesItem); + return this; + } + + /** + * Results of 33 stress scenarios for MR1 + * @return profitLossRanges + **/ + @javax.annotation.Nullable + public List getProfitLossRanges() { + return profitLossRanges; + } + + + public void setProfitLossRanges(List profitLossRanges) { + this.profitLossRanges = profitLossRanges; + } + + public MockMarginResult maxLoss(ProfitLossRange maxLoss) { + + this.maxLoss = maxLoss; + return this; + } + + /** + * 最大损失 + * @return maxLoss + **/ + @javax.annotation.Nullable + public ProfitLossRange getMaxLoss() { + return maxLoss; + } + + + public void setMaxLoss(ProfitLossRange maxLoss) { + this.maxLoss = maxLoss; + } + + public MockMarginResult mr1(String mr1) { + + this.mr1 = mr1; + return this; + } + + /** + * Stress testing + * @return mr1 + **/ + @javax.annotation.Nullable + public String getMr1() { + return mr1; + } + + + public void setMr1(String mr1) { + this.mr1 = mr1; + } + + public MockMarginResult mr2(String mr2) { + + this.mr2 = mr2; + return this; + } + + /** + * Basis spread risk + * @return mr2 + **/ + @javax.annotation.Nullable + public String getMr2() { + return mr2; + } + + + public void setMr2(String mr2) { + this.mr2 = mr2; + } + + public MockMarginResult mr3(String mr3) { + + this.mr3 = mr3; + return this; + } + + /** + * Volatility spread risk + * @return mr3 + **/ + @javax.annotation.Nullable + public String getMr3() { + return mr3; + } + + + public void setMr3(String mr3) { + this.mr3 = mr3; + } + + public MockMarginResult mr4(String mr4) { + + this.mr4 = mr4; + return this; + } + + /** + * Option short risk + * @return mr4 + **/ + @javax.annotation.Nullable + public String getMr4() { + return mr4; + } + + + public void setMr4(String mr4) { + this.mr4 = mr4; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockMarginResult mockMarginResult = (MockMarginResult) o; + return Objects.equals(this.type, mockMarginResult.type) && + Objects.equals(this.profitLossRanges, mockMarginResult.profitLossRanges) && + Objects.equals(this.maxLoss, mockMarginResult.maxLoss) && + Objects.equals(this.mr1, mockMarginResult.mr1) && + Objects.equals(this.mr2, mockMarginResult.mr2) && + Objects.equals(this.mr3, mockMarginResult.mr3) && + Objects.equals(this.mr4, mockMarginResult.mr4); + } + + @Override + public int hashCode() { + return Objects.hash(type, profitLossRanges, maxLoss, mr1, mr2, mr3, mr4); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockMarginResult {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" profitLossRanges: ").append(toIndentedString(profitLossRanges)).append("\n"); + sb.append(" maxLoss: ").append(toIndentedString(maxLoss)).append("\n"); + sb.append(" mr1: ").append(toIndentedString(mr1)).append("\n"); + sb.append(" mr2: ").append(toIndentedString(mr2)).append("\n"); + sb.append(" mr3: ").append(toIndentedString(mr3)).append("\n"); + sb.append(" mr4: ").append(toIndentedString(mr4)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockOptionsOrder.java b/src/main/java/io/gate/gateapi/models/MockOptionsOrder.java new file mode 100644 index 0000000..f59652d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockOptionsOrder.java @@ -0,0 +1,138 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Option orders + */ +public class MockOptionsOrder { + public static final String SERIALIZED_NAME_OPTIONS_NAME = "options_name"; + @SerializedName(SERIALIZED_NAME_OPTIONS_NAME) + private String optionsName; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private String size; + + public static final String SERIALIZED_NAME_LEFT = "left"; + @SerializedName(SERIALIZED_NAME_LEFT) + private String left; + + + public MockOptionsOrder optionsName(String optionsName) { + + this.optionsName = optionsName; + return this; + } + + /** + * Option name, currently only supports USDT options for BTC and ETH + * @return optionsName + **/ + public String getOptionsName() { + return optionsName; + } + + + public void setOptionsName(String optionsName) { + this.optionsName = optionsName; + } + + public MockOptionsOrder size(String size) { + + this.size = size; + return this; + } + + /** + * Initial order quantity, not involved in actual calculation + * @return size + **/ + public String getSize() { + return size; + } + + + public void setSize(String size) { + this.size = size; + } + + public MockOptionsOrder left(String left) { + + this.left = left; + return this; + } + + /** + * Unfilled contract quantity, involved in actual calculation + * @return left + **/ + public String getLeft() { + return left; + } + + + public void setLeft(String left) { + this.left = left; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockOptionsOrder mockOptionsOrder = (MockOptionsOrder) o; + return Objects.equals(this.optionsName, mockOptionsOrder.optionsName) && + Objects.equals(this.size, mockOptionsOrder.size) && + Objects.equals(this.left, mockOptionsOrder.left); + } + + @Override + public int hashCode() { + return Objects.hash(optionsName, size, left); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockOptionsOrder {\n"); + sb.append(" optionsName: ").append(toIndentedString(optionsName)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockOptionsPosition.java b/src/main/java/io/gate/gateapi/models/MockOptionsPosition.java new file mode 100644 index 0000000..69d9e55 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockOptionsPosition.java @@ -0,0 +1,113 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Options positions + */ +public class MockOptionsPosition { + public static final String SERIALIZED_NAME_OPTIONS_NAME = "options_name"; + @SerializedName(SERIALIZED_NAME_OPTIONS_NAME) + private String optionsName; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private String size; + + + public MockOptionsPosition optionsName(String optionsName) { + + this.optionsName = optionsName; + return this; + } + + /** + * Option name, currently only supports USDT options for BTC and ETH + * @return optionsName + **/ + public String getOptionsName() { + return optionsName; + } + + + public void setOptionsName(String optionsName) { + this.optionsName = optionsName; + } + + public MockOptionsPosition size(String size) { + + this.size = size; + return this; + } + + /** + * Position size, measured in contract quantity + * @return size + **/ + public String getSize() { + return size; + } + + + public void setSize(String size) { + this.size = size; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockOptionsPosition mockOptionsPosition = (MockOptionsPosition) o; + return Objects.equals(this.optionsName, mockOptionsPosition.optionsName) && + Objects.equals(this.size, mockOptionsPosition.size); + } + + @Override + public int hashCode() { + return Objects.hash(optionsName, size); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockOptionsPosition {\n"); + sb.append(" optionsName: ").append(toIndentedString(optionsName)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockRiskUnit.java b/src/main/java/io/gate/gateapi/models/MockRiskUnit.java new file mode 100644 index 0000000..4770f74 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockRiskUnit.java @@ -0,0 +1,308 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MockMarginResult; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Risk unit + */ +public class MockRiskUnit { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + @SerializedName(SERIALIZED_NAME_SYMBOL) + private String symbol; + + public static final String SERIALIZED_NAME_SPOT_IN_USE = "spot_in_use"; + @SerializedName(SERIALIZED_NAME_SPOT_IN_USE) + private String spotInUse; + + public static final String SERIALIZED_NAME_MAINTAIN_MARGIN = "maintain_margin"; + @SerializedName(SERIALIZED_NAME_MAINTAIN_MARGIN) + private String maintainMargin; + + public static final String SERIALIZED_NAME_INITIAL_MARGIN = "initial_margin"; + @SerializedName(SERIALIZED_NAME_INITIAL_MARGIN) + private String initialMargin; + + public static final String SERIALIZED_NAME_MARGIN_RESULT = "margin_result"; + @SerializedName(SERIALIZED_NAME_MARGIN_RESULT) + private List marginResult = null; + + public static final String SERIALIZED_NAME_DELTA = "delta"; + @SerializedName(SERIALIZED_NAME_DELTA) + private String delta; + + public static final String SERIALIZED_NAME_GAMMA = "gamma"; + @SerializedName(SERIALIZED_NAME_GAMMA) + private String gamma; + + public static final String SERIALIZED_NAME_THETA = "theta"; + @SerializedName(SERIALIZED_NAME_THETA) + private String theta; + + public static final String SERIALIZED_NAME_VEGA = "vega"; + @SerializedName(SERIALIZED_NAME_VEGA) + private String vega; + + + public MockRiskUnit symbol(String symbol) { + + this.symbol = symbol; + return this; + } + + /** + * Risk unit name + * @return symbol + **/ + @javax.annotation.Nullable + public String getSymbol() { + return symbol; + } + + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public MockRiskUnit spotInUse(String spotInUse) { + + this.spotInUse = spotInUse; + return this; + } + + /** + * Spot hedge usage + * @return spotInUse + **/ + @javax.annotation.Nullable + public String getSpotInUse() { + return spotInUse; + } + + + public void setSpotInUse(String spotInUse) { + this.spotInUse = spotInUse; + } + + public MockRiskUnit maintainMargin(String maintainMargin) { + + this.maintainMargin = maintainMargin; + return this; + } + + /** + * Maintenance margin + * @return maintainMargin + **/ + @javax.annotation.Nullable + public String getMaintainMargin() { + return maintainMargin; + } + + + public void setMaintainMargin(String maintainMargin) { + this.maintainMargin = maintainMargin; + } + + public MockRiskUnit initialMargin(String initialMargin) { + + this.initialMargin = initialMargin; + return this; + } + + /** + * Initial margin + * @return initialMargin + **/ + @javax.annotation.Nullable + public String getInitialMargin() { + return initialMargin; + } + + + public void setInitialMargin(String initialMargin) { + this.initialMargin = initialMargin; + } + + public MockRiskUnit marginResult(List marginResult) { + + this.marginResult = marginResult; + return this; + } + + public MockRiskUnit addMarginResultItem(MockMarginResult marginResultItem) { + if (this.marginResult == null) { + this.marginResult = new ArrayList<>(); + } + this.marginResult.add(marginResultItem); + return this; + } + + /** + * Margin result + * @return marginResult + **/ + @javax.annotation.Nullable + public List getMarginResult() { + return marginResult; + } + + + public void setMarginResult(List marginResult) { + this.marginResult = marginResult; + } + + public MockRiskUnit delta(String delta) { + + this.delta = delta; + return this; + } + + /** + * Total Delta of risk unit + * @return delta + **/ + @javax.annotation.Nullable + public String getDelta() { + return delta; + } + + + public void setDelta(String delta) { + this.delta = delta; + } + + public MockRiskUnit gamma(String gamma) { + + this.gamma = gamma; + return this; + } + + /** + * Total Gamma of risk unit + * @return gamma + **/ + @javax.annotation.Nullable + public String getGamma() { + return gamma; + } + + + public void setGamma(String gamma) { + this.gamma = gamma; + } + + public MockRiskUnit theta(String theta) { + + this.theta = theta; + return this; + } + + /** + * Total Theta of risk unit + * @return theta + **/ + @javax.annotation.Nullable + public String getTheta() { + return theta; + } + + + public void setTheta(String theta) { + this.theta = theta; + } + + public MockRiskUnit vega(String vega) { + + this.vega = vega; + return this; + } + + /** + * Total Vega of risk unit + * @return vega + **/ + @javax.annotation.Nullable + public String getVega() { + return vega; + } + + + public void setVega(String vega) { + this.vega = vega; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockRiskUnit mockRiskUnit = (MockRiskUnit) o; + return Objects.equals(this.symbol, mockRiskUnit.symbol) && + Objects.equals(this.spotInUse, mockRiskUnit.spotInUse) && + Objects.equals(this.maintainMargin, mockRiskUnit.maintainMargin) && + Objects.equals(this.initialMargin, mockRiskUnit.initialMargin) && + Objects.equals(this.marginResult, mockRiskUnit.marginResult) && + Objects.equals(this.delta, mockRiskUnit.delta) && + Objects.equals(this.gamma, mockRiskUnit.gamma) && + Objects.equals(this.theta, mockRiskUnit.theta) && + Objects.equals(this.vega, mockRiskUnit.vega); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, spotInUse, maintainMargin, initialMargin, marginResult, delta, gamma, theta, vega); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockRiskUnit {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" spotInUse: ").append(toIndentedString(spotInUse)).append("\n"); + sb.append(" maintainMargin: ").append(toIndentedString(maintainMargin)).append("\n"); + sb.append(" initialMargin: ").append(toIndentedString(initialMargin)).append("\n"); + sb.append(" marginResult: ").append(toIndentedString(marginResult)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" gamma: ").append(toIndentedString(gamma)).append("\n"); + sb.append(" theta: ").append(toIndentedString(theta)).append("\n"); + sb.append(" vega: ").append(toIndentedString(vega)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockSpotBalance.java b/src/main/java/io/gate/gateapi/models/MockSpotBalance.java new file mode 100644 index 0000000..f7b8389 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockSpotBalance.java @@ -0,0 +1,113 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Spot + */ +public class MockSpotBalance { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_EQUITY = "equity"; + @SerializedName(SERIALIZED_NAME_EQUITY) + private String equity; + + + public MockSpotBalance currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public MockSpotBalance equity(String equity) { + + this.equity = equity; + return this; + } + + /** + * 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 + * @return equity + **/ + public String getEquity() { + return equity; + } + + + public void setEquity(String equity) { + this.equity = equity; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockSpotBalance mockSpotBalance = (MockSpotBalance) o; + return Objects.equals(this.currency, mockSpotBalance.currency) && + Objects.equals(this.equity, mockSpotBalance.equity); + } + + @Override + public int hashCode() { + return Objects.hash(currency, equity); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockSpotBalance {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" equity: ").append(toIndentedString(equity)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MockSpotOrder.java b/src/main/java/io/gate/gateapi/models/MockSpotOrder.java new file mode 100644 index 0000000..29c20e5 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MockSpotOrder.java @@ -0,0 +1,189 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Spot orders + */ +public class MockSpotOrder { + public static final String SERIALIZED_NAME_CURRENCY_PAIRS = "currency_pairs"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIRS) + private String currencyPairs; + + public static final String SERIALIZED_NAME_ORDER_PRICE = "order_price"; + @SerializedName(SERIALIZED_NAME_ORDER_PRICE) + private String orderPrice; + + public static final String SERIALIZED_NAME_COUNT = "count"; + @SerializedName(SERIALIZED_NAME_COUNT) + private String count; + + public static final String SERIALIZED_NAME_LEFT = "left"; + @SerializedName(SERIALIZED_NAME_LEFT) + private String left; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + + public MockSpotOrder currencyPairs(String currencyPairs) { + + this.currencyPairs = currencyPairs; + return this; + } + + /** + * Market + * @return currencyPairs + **/ + public String getCurrencyPairs() { + return currencyPairs; + } + + + public void setCurrencyPairs(String currencyPairs) { + this.currencyPairs = currencyPairs; + } + + public MockSpotOrder orderPrice(String orderPrice) { + + this.orderPrice = orderPrice; + return this; + } + + /** + * Price + * @return orderPrice + **/ + public String getOrderPrice() { + return orderPrice; + } + + + public void setOrderPrice(String orderPrice) { + this.orderPrice = orderPrice; + } + + public MockSpotOrder count(String count) { + + this.count = count; + return this; + } + + /** + * 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 + * @return count + **/ + @javax.annotation.Nullable + public String getCount() { + return count; + } + + + public void setCount(String count) { + this.count = count; + } + + public MockSpotOrder left(String left) { + + this.left = left; + return this; + } + + /** + * Unfilled quantity, involved in actual calculation + * @return left + **/ + public String getLeft() { + return left; + } + + + public void setLeft(String left) { + this.left = left; + } + + public MockSpotOrder type(String type) { + + this.type = type; + return this; + } + + /** + * Order type, sell - sell order, buy - buy order + * @return type + **/ + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MockSpotOrder mockSpotOrder = (MockSpotOrder) o; + return Objects.equals(this.currencyPairs, mockSpotOrder.currencyPairs) && + Objects.equals(this.orderPrice, mockSpotOrder.orderPrice) && + Objects.equals(this.count, mockSpotOrder.count) && + Objects.equals(this.left, mockSpotOrder.left) && + Objects.equals(this.type, mockSpotOrder.type); + } + + @Override + public int hashCode() { + return Objects.hash(currencyPairs, orderPrice, count, left, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MockSpotOrder {\n"); + sb.append(" currencyPairs: ").append(toIndentedString(currencyPairs)).append("\n"); + sb.append(" orderPrice: ").append(toIndentedString(orderPrice)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MultiChainAddressItem.java b/src/main/java/io/gate/gateapi/models/MultiChainAddressItem.java index d6c1ed5..8152c82 100644 --- a/src/main/java/io/gate/gateapi/models/MultiChainAddressItem.java +++ b/src/main/java/io/gate/gateapi/models/MultiChainAddressItem.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/models/MultiCollateralCurrency.java b/src/main/java/io/gate/gateapi/models/MultiCollateralCurrency.java new file mode 100644 index 0000000..646c2b4 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiCollateralCurrency.java @@ -0,0 +1,135 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MultiCollateralItem; +import io.gate.gateapi.models.MultiLoanItem; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Borrowing and collateral currencies supported for Multi-Collateral + */ +public class MultiCollateralCurrency { + public static final String SERIALIZED_NAME_LOAN_CURRENCIES = "loan_currencies"; + @SerializedName(SERIALIZED_NAME_LOAN_CURRENCIES) + private List loanCurrencies = null; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCIES = "collateral_currencies"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCIES) + private List collateralCurrencies = null; + + + public MultiCollateralCurrency loanCurrencies(List loanCurrencies) { + + this.loanCurrencies = loanCurrencies; + return this; + } + + public MultiCollateralCurrency addLoanCurrenciesItem(MultiLoanItem loanCurrenciesItem) { + if (this.loanCurrencies == null) { + this.loanCurrencies = new ArrayList<>(); + } + this.loanCurrencies.add(loanCurrenciesItem); + return this; + } + + /** + * List of supported borrowing currencies + * @return loanCurrencies + **/ + @javax.annotation.Nullable + public List getLoanCurrencies() { + return loanCurrencies; + } + + + public void setLoanCurrencies(List loanCurrencies) { + this.loanCurrencies = loanCurrencies; + } + + public MultiCollateralCurrency collateralCurrencies(List collateralCurrencies) { + + this.collateralCurrencies = collateralCurrencies; + return this; + } + + public MultiCollateralCurrency addCollateralCurrenciesItem(MultiCollateralItem collateralCurrenciesItem) { + if (this.collateralCurrencies == null) { + this.collateralCurrencies = new ArrayList<>(); + } + this.collateralCurrencies.add(collateralCurrenciesItem); + return this; + } + + /** + * List of supported collateral currencies + * @return collateralCurrencies + **/ + @javax.annotation.Nullable + public List getCollateralCurrencies() { + return collateralCurrencies; + } + + + public void setCollateralCurrencies(List collateralCurrencies) { + this.collateralCurrencies = collateralCurrencies; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiCollateralCurrency multiCollateralCurrency = (MultiCollateralCurrency) o; + return Objects.equals(this.loanCurrencies, multiCollateralCurrency.loanCurrencies) && + Objects.equals(this.collateralCurrencies, multiCollateralCurrency.collateralCurrencies); + } + + @Override + public int hashCode() { + return Objects.hash(loanCurrencies, collateralCurrencies); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiCollateralCurrency {\n"); + sb.append(" loanCurrencies: ").append(toIndentedString(loanCurrencies)).append("\n"); + sb.append(" collateralCurrencies: ").append(toIndentedString(collateralCurrencies)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MultiCollateralItem.java b/src/main/java/io/gate/gateapi/models/MultiCollateralItem.java new file mode 100644 index 0000000..14a372e --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiCollateralItem.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MultiCollateralItem + */ +public class MultiCollateralItem { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_DISCOUNT = "discount"; + @SerializedName(SERIALIZED_NAME_DISCOUNT) + private String discount; + + + public MultiCollateralItem currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public MultiCollateralItem indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public MultiCollateralItem discount(String discount) { + + this.discount = discount; + return this; + } + + /** + * Discount + * @return discount + **/ + @javax.annotation.Nullable + public String getDiscount() { + return discount; + } + + + public void setDiscount(String discount) { + this.discount = discount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiCollateralItem multiCollateralItem = (MultiCollateralItem) o; + return Objects.equals(this.currency, multiCollateralItem.currency) && + Objects.equals(this.indexPrice, multiCollateralItem.indexPrice) && + Objects.equals(this.discount, multiCollateralItem.discount); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, discount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiCollateralItem {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" discount: ").append(toIndentedString(discount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MultiCollateralOrder.java b/src/main/java/io/gate/gateapi/models/MultiCollateralOrder.java new file mode 100644 index 0000000..863c40a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiCollateralOrder.java @@ -0,0 +1,447 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.BorrowCurrencyInfo; +import io.gate.gateapi.models.CollateralCurrencyInfo; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Multi-Collateral Order + */ +public class MultiCollateralOrder { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private String orderId; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "order_type"; + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + private String orderType; + + public static final String SERIALIZED_NAME_FIXED_TYPE = "fixed_type"; + @SerializedName(SERIALIZED_NAME_FIXED_TYPE) + private String fixedType; + + public static final String SERIALIZED_NAME_FIXED_RATE = "fixed_rate"; + @SerializedName(SERIALIZED_NAME_FIXED_RATE) + private String fixedRate; + + public static final String SERIALIZED_NAME_EXPIRE_TIME = "expire_time"; + @SerializedName(SERIALIZED_NAME_EXPIRE_TIME) + private Long expireTime; + + public static final String SERIALIZED_NAME_AUTO_RENEW = "auto_renew"; + @SerializedName(SERIALIZED_NAME_AUTO_RENEW) + private Boolean autoRenew; + + public static final String SERIALIZED_NAME_AUTO_REPAY = "auto_repay"; + @SerializedName(SERIALIZED_NAME_AUTO_REPAY) + private Boolean autoRepay; + + public static final String SERIALIZED_NAME_CURRENT_LTV = "current_ltv"; + @SerializedName(SERIALIZED_NAME_CURRENT_LTV) + private String currentLtv; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_BORROW_TIME = "borrow_time"; + @SerializedName(SERIALIZED_NAME_BORROW_TIME) + private Long borrowTime; + + public static final String SERIALIZED_NAME_TOTAL_LEFT_REPAY_USDT = "total_left_repay_usdt"; + @SerializedName(SERIALIZED_NAME_TOTAL_LEFT_REPAY_USDT) + private String totalLeftRepayUsdt; + + public static final String SERIALIZED_NAME_TOTAL_LEFT_COLLATERAL_USDT = "total_left_collateral_usdt"; + @SerializedName(SERIALIZED_NAME_TOTAL_LEFT_COLLATERAL_USDT) + private String totalLeftCollateralUsdt; + + public static final String SERIALIZED_NAME_BORROW_CURRENCIES = "borrow_currencies"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCIES) + private List borrowCurrencies = null; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCIES = "collateral_currencies"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCIES) + private List collateralCurrencies = null; + + + public MultiCollateralOrder orderId(String orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public String getOrderId() { + return orderId; + } + + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public MultiCollateralOrder orderType(String orderType) { + + this.orderType = orderType; + return this; + } + + /** + * current - current, fixed - fixed + * @return orderType + **/ + @javax.annotation.Nullable + public String getOrderType() { + return orderType; + } + + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public MultiCollateralOrder fixedType(String fixedType) { + + this.fixedType = fixedType; + return this; + } + + /** + * Fixed interest rate loan periods: 7d - 7 days, 30d - 30 days + * @return fixedType + **/ + @javax.annotation.Nullable + public String getFixedType() { + return fixedType; + } + + + public void setFixedType(String fixedType) { + this.fixedType = fixedType; + } + + public MultiCollateralOrder fixedRate(String fixedRate) { + + this.fixedRate = fixedRate; + return this; + } + + /** + * Fixed interest rate + * @return fixedRate + **/ + @javax.annotation.Nullable + public String getFixedRate() { + return fixedRate; + } + + + public void setFixedRate(String fixedRate) { + this.fixedRate = fixedRate; + } + + public MultiCollateralOrder expireTime(Long expireTime) { + + this.expireTime = expireTime; + return this; + } + + /** + * Expiration time, timestamp, unit in seconds + * @return expireTime + **/ + @javax.annotation.Nullable + public Long getExpireTime() { + return expireTime; + } + + + public void setExpireTime(Long expireTime) { + this.expireTime = expireTime; + } + + public MultiCollateralOrder autoRenew(Boolean autoRenew) { + + this.autoRenew = autoRenew; + return this; + } + + /** + * Fixed interest rate, auto-renewal + * @return autoRenew + **/ + @javax.annotation.Nullable + public Boolean getAutoRenew() { + return autoRenew; + } + + + public void setAutoRenew(Boolean autoRenew) { + this.autoRenew = autoRenew; + } + + public MultiCollateralOrder autoRepay(Boolean autoRepay) { + + this.autoRepay = autoRepay; + return this; + } + + /** + * Fixed interest rate, auto-repayment + * @return autoRepay + **/ + @javax.annotation.Nullable + public Boolean getAutoRepay() { + return autoRepay; + } + + + public void setAutoRepay(Boolean autoRepay) { + this.autoRepay = autoRepay; + } + + public MultiCollateralOrder currentLtv(String currentLtv) { + + this.currentLtv = currentLtv; + return this; + } + + /** + * Current collateralization rate + * @return currentLtv + **/ + @javax.annotation.Nullable + public String getCurrentLtv() { + return currentLtv; + } + + + public void setCurrentLtv(String currentLtv) { + this.currentLtv = currentLtv; + } + + public MultiCollateralOrder status(String status) { + + this.status = status; + return this; + } + + /** + * 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 + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + public MultiCollateralOrder borrowTime(Long borrowTime) { + + this.borrowTime = borrowTime; + return this; + } + + /** + * Borrowing time, timestamp in seconds + * @return borrowTime + **/ + @javax.annotation.Nullable + public Long getBorrowTime() { + return borrowTime; + } + + + public void setBorrowTime(Long borrowTime) { + this.borrowTime = borrowTime; + } + + public MultiCollateralOrder totalLeftRepayUsdt(String totalLeftRepayUsdt) { + + this.totalLeftRepayUsdt = totalLeftRepayUsdt; + return this; + } + + /** + * Total outstanding value converted to USDT + * @return totalLeftRepayUsdt + **/ + @javax.annotation.Nullable + public String getTotalLeftRepayUsdt() { + return totalLeftRepayUsdt; + } + + + public void setTotalLeftRepayUsdt(String totalLeftRepayUsdt) { + this.totalLeftRepayUsdt = totalLeftRepayUsdt; + } + + public MultiCollateralOrder totalLeftCollateralUsdt(String totalLeftCollateralUsdt) { + + this.totalLeftCollateralUsdt = totalLeftCollateralUsdt; + return this; + } + + /** + * Total collateral value converted to USDT + * @return totalLeftCollateralUsdt + **/ + @javax.annotation.Nullable + public String getTotalLeftCollateralUsdt() { + return totalLeftCollateralUsdt; + } + + + public void setTotalLeftCollateralUsdt(String totalLeftCollateralUsdt) { + this.totalLeftCollateralUsdt = totalLeftCollateralUsdt; + } + + public MultiCollateralOrder borrowCurrencies(List borrowCurrencies) { + + this.borrowCurrencies = borrowCurrencies; + return this; + } + + public MultiCollateralOrder addBorrowCurrenciesItem(BorrowCurrencyInfo borrowCurrenciesItem) { + if (this.borrowCurrencies == null) { + this.borrowCurrencies = new ArrayList<>(); + } + this.borrowCurrencies.add(borrowCurrenciesItem); + return this; + } + + /** + * Borrowing Currency List + * @return borrowCurrencies + **/ + @javax.annotation.Nullable + public List getBorrowCurrencies() { + return borrowCurrencies; + } + + + public void setBorrowCurrencies(List borrowCurrencies) { + this.borrowCurrencies = borrowCurrencies; + } + + public MultiCollateralOrder collateralCurrencies(List collateralCurrencies) { + + this.collateralCurrencies = collateralCurrencies; + return this; + } + + public MultiCollateralOrder addCollateralCurrenciesItem(CollateralCurrencyInfo collateralCurrenciesItem) { + if (this.collateralCurrencies == null) { + this.collateralCurrencies = new ArrayList<>(); + } + this.collateralCurrencies.add(collateralCurrenciesItem); + return this; + } + + /** + * Collateral Currency List + * @return collateralCurrencies + **/ + @javax.annotation.Nullable + public List getCollateralCurrencies() { + return collateralCurrencies; + } + + + public void setCollateralCurrencies(List collateralCurrencies) { + this.collateralCurrencies = collateralCurrencies; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiCollateralOrder multiCollateralOrder = (MultiCollateralOrder) o; + return Objects.equals(this.orderId, multiCollateralOrder.orderId) && + Objects.equals(this.orderType, multiCollateralOrder.orderType) && + Objects.equals(this.fixedType, multiCollateralOrder.fixedType) && + Objects.equals(this.fixedRate, multiCollateralOrder.fixedRate) && + Objects.equals(this.expireTime, multiCollateralOrder.expireTime) && + Objects.equals(this.autoRenew, multiCollateralOrder.autoRenew) && + Objects.equals(this.autoRepay, multiCollateralOrder.autoRepay) && + Objects.equals(this.currentLtv, multiCollateralOrder.currentLtv) && + Objects.equals(this.status, multiCollateralOrder.status) && + Objects.equals(this.borrowTime, multiCollateralOrder.borrowTime) && + Objects.equals(this.totalLeftRepayUsdt, multiCollateralOrder.totalLeftRepayUsdt) && + Objects.equals(this.totalLeftCollateralUsdt, multiCollateralOrder.totalLeftCollateralUsdt) && + Objects.equals(this.borrowCurrencies, multiCollateralOrder.borrowCurrencies) && + Objects.equals(this.collateralCurrencies, multiCollateralOrder.collateralCurrencies); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, orderType, fixedType, fixedRate, expireTime, autoRenew, autoRepay, currentLtv, status, borrowTime, totalLeftRepayUsdt, totalLeftCollateralUsdt, borrowCurrencies, collateralCurrencies); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiCollateralOrder {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" fixedType: ").append(toIndentedString(fixedType)).append("\n"); + sb.append(" fixedRate: ").append(toIndentedString(fixedRate)).append("\n"); + sb.append(" expireTime: ").append(toIndentedString(expireTime)).append("\n"); + sb.append(" autoRenew: ").append(toIndentedString(autoRenew)).append("\n"); + sb.append(" autoRepay: ").append(toIndentedString(autoRepay)).append("\n"); + sb.append(" currentLtv: ").append(toIndentedString(currentLtv)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" borrowTime: ").append(toIndentedString(borrowTime)).append("\n"); + sb.append(" totalLeftRepayUsdt: ").append(toIndentedString(totalLeftRepayUsdt)).append("\n"); + sb.append(" totalLeftCollateralUsdt: ").append(toIndentedString(totalLeftCollateralUsdt)).append("\n"); + sb.append(" borrowCurrencies: ").append(toIndentedString(borrowCurrencies)).append("\n"); + sb.append(" collateralCurrencies: ").append(toIndentedString(collateralCurrencies)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MultiCollateralRecord.java b/src/main/java/io/gate/gateapi/models/MultiCollateralRecord.java new file mode 100644 index 0000000..b5e8601 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiCollateralRecord.java @@ -0,0 +1,264 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MultiCollateralRecordCurrency; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Multi-Collateral adjustment record + */ +public class MultiCollateralRecord { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_RECORD_ID = "record_id"; + @SerializedName(SERIALIZED_NAME_RECORD_ID) + private Long recordId; + + public static final String SERIALIZED_NAME_BEFORE_LTV = "before_ltv"; + @SerializedName(SERIALIZED_NAME_BEFORE_LTV) + private String beforeLtv; + + public static final String SERIALIZED_NAME_AFTER_LTV = "after_ltv"; + @SerializedName(SERIALIZED_NAME_AFTER_LTV) + private String afterLtv; + + public static final String SERIALIZED_NAME_OPERATE_TIME = "operate_time"; + @SerializedName(SERIALIZED_NAME_OPERATE_TIME) + private Long operateTime; + + public static final String SERIALIZED_NAME_BORROW_CURRENCIES = "borrow_currencies"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCIES) + private List borrowCurrencies = null; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCIES = "collateral_currencies"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCIES) + private List collateralCurrencies = null; + + + public MultiCollateralRecord orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public MultiCollateralRecord recordId(Long recordId) { + + this.recordId = recordId; + return this; + } + + /** + * Collateral record ID + * @return recordId + **/ + @javax.annotation.Nullable + public Long getRecordId() { + return recordId; + } + + + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + public MultiCollateralRecord beforeLtv(String beforeLtv) { + + this.beforeLtv = beforeLtv; + return this; + } + + /** + * Collateral ratio before adjustment + * @return beforeLtv + **/ + @javax.annotation.Nullable + public String getBeforeLtv() { + return beforeLtv; + } + + + public void setBeforeLtv(String beforeLtv) { + this.beforeLtv = beforeLtv; + } + + public MultiCollateralRecord afterLtv(String afterLtv) { + + this.afterLtv = afterLtv; + return this; + } + + /** + * Collateral ratio before adjustment + * @return afterLtv + **/ + @javax.annotation.Nullable + public String getAfterLtv() { + return afterLtv; + } + + + public void setAfterLtv(String afterLtv) { + this.afterLtv = afterLtv; + } + + public MultiCollateralRecord operateTime(Long operateTime) { + + this.operateTime = operateTime; + return this; + } + + /** + * Operation time, timestamp in seconds + * @return operateTime + **/ + @javax.annotation.Nullable + public Long getOperateTime() { + return operateTime; + } + + + public void setOperateTime(Long operateTime) { + this.operateTime = operateTime; + } + + public MultiCollateralRecord borrowCurrencies(List borrowCurrencies) { + + this.borrowCurrencies = borrowCurrencies; + return this; + } + + public MultiCollateralRecord addBorrowCurrenciesItem(MultiCollateralRecordCurrency borrowCurrenciesItem) { + if (this.borrowCurrencies == null) { + this.borrowCurrencies = new ArrayList<>(); + } + this.borrowCurrencies.add(borrowCurrenciesItem); + return this; + } + + /** + * Borrowing Currency List + * @return borrowCurrencies + **/ + @javax.annotation.Nullable + public List getBorrowCurrencies() { + return borrowCurrencies; + } + + + public void setBorrowCurrencies(List borrowCurrencies) { + this.borrowCurrencies = borrowCurrencies; + } + + public MultiCollateralRecord collateralCurrencies(List collateralCurrencies) { + + this.collateralCurrencies = collateralCurrencies; + return this; + } + + public MultiCollateralRecord addCollateralCurrenciesItem(MultiCollateralRecordCurrency collateralCurrenciesItem) { + if (this.collateralCurrencies == null) { + this.collateralCurrencies = new ArrayList<>(); + } + this.collateralCurrencies.add(collateralCurrenciesItem); + return this; + } + + /** + * Collateral Currency List + * @return collateralCurrencies + **/ + @javax.annotation.Nullable + public List getCollateralCurrencies() { + return collateralCurrencies; + } + + + public void setCollateralCurrencies(List collateralCurrencies) { + this.collateralCurrencies = collateralCurrencies; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiCollateralRecord multiCollateralRecord = (MultiCollateralRecord) o; + return Objects.equals(this.orderId, multiCollateralRecord.orderId) && + Objects.equals(this.recordId, multiCollateralRecord.recordId) && + Objects.equals(this.beforeLtv, multiCollateralRecord.beforeLtv) && + Objects.equals(this.afterLtv, multiCollateralRecord.afterLtv) && + Objects.equals(this.operateTime, multiCollateralRecord.operateTime) && + Objects.equals(this.borrowCurrencies, multiCollateralRecord.borrowCurrencies) && + Objects.equals(this.collateralCurrencies, multiCollateralRecord.collateralCurrencies); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, recordId, beforeLtv, afterLtv, operateTime, borrowCurrencies, collateralCurrencies); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiCollateralRecord {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" recordId: ").append(toIndentedString(recordId)).append("\n"); + sb.append(" beforeLtv: ").append(toIndentedString(beforeLtv)).append("\n"); + sb.append(" afterLtv: ").append(toIndentedString(afterLtv)).append("\n"); + sb.append(" operateTime: ").append(toIndentedString(operateTime)).append("\n"); + sb.append(" borrowCurrencies: ").append(toIndentedString(borrowCurrencies)).append("\n"); + sb.append(" collateralCurrencies: ").append(toIndentedString(collateralCurrencies)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MultiCollateralRecordCurrency.java b/src/main/java/io/gate/gateapi/models/MultiCollateralRecordCurrency.java new file mode 100644 index 0000000..2ed3adf --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiCollateralRecordCurrency.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MultiCollateralRecordCurrency + */ +public class MultiCollateralRecordCurrency { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_BEFORE_AMOUNT = "before_amount"; + @SerializedName(SERIALIZED_NAME_BEFORE_AMOUNT) + private String beforeAmount; + + public static final String SERIALIZED_NAME_BEFORE_AMOUNT_USDT = "before_amount_usdt"; + @SerializedName(SERIALIZED_NAME_BEFORE_AMOUNT_USDT) + private String beforeAmountUsdt; + + public static final String SERIALIZED_NAME_AFTER_AMOUNT = "after_amount"; + @SerializedName(SERIALIZED_NAME_AFTER_AMOUNT) + private String afterAmount; + + public static final String SERIALIZED_NAME_AFTER_AMOUNT_USDT = "after_amount_usdt"; + @SerializedName(SERIALIZED_NAME_AFTER_AMOUNT_USDT) + private String afterAmountUsdt; + + + public MultiCollateralRecordCurrency currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public MultiCollateralRecordCurrency indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public MultiCollateralRecordCurrency beforeAmount(String beforeAmount) { + + this.beforeAmount = beforeAmount; + return this; + } + + /** + * Amount before the operation + * @return beforeAmount + **/ + @javax.annotation.Nullable + public String getBeforeAmount() { + return beforeAmount; + } + + + public void setBeforeAmount(String beforeAmount) { + this.beforeAmount = beforeAmount; + } + + public MultiCollateralRecordCurrency beforeAmountUsdt(String beforeAmountUsdt) { + + this.beforeAmountUsdt = beforeAmountUsdt; + return this; + } + + /** + * USDT Amount before the operation + * @return beforeAmountUsdt + **/ + @javax.annotation.Nullable + public String getBeforeAmountUsdt() { + return beforeAmountUsdt; + } + + + public void setBeforeAmountUsdt(String beforeAmountUsdt) { + this.beforeAmountUsdt = beforeAmountUsdt; + } + + public MultiCollateralRecordCurrency afterAmount(String afterAmount) { + + this.afterAmount = afterAmount; + return this; + } + + /** + * Amount after the operation + * @return afterAmount + **/ + @javax.annotation.Nullable + public String getAfterAmount() { + return afterAmount; + } + + + public void setAfterAmount(String afterAmount) { + this.afterAmount = afterAmount; + } + + public MultiCollateralRecordCurrency afterAmountUsdt(String afterAmountUsdt) { + + this.afterAmountUsdt = afterAmountUsdt; + return this; + } + + /** + * USDT Amount after the operation + * @return afterAmountUsdt + **/ + @javax.annotation.Nullable + public String getAfterAmountUsdt() { + return afterAmountUsdt; + } + + + public void setAfterAmountUsdt(String afterAmountUsdt) { + this.afterAmountUsdt = afterAmountUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiCollateralRecordCurrency multiCollateralRecordCurrency = (MultiCollateralRecordCurrency) o; + return Objects.equals(this.currency, multiCollateralRecordCurrency.currency) && + Objects.equals(this.indexPrice, multiCollateralRecordCurrency.indexPrice) && + Objects.equals(this.beforeAmount, multiCollateralRecordCurrency.beforeAmount) && + Objects.equals(this.beforeAmountUsdt, multiCollateralRecordCurrency.beforeAmountUsdt) && + Objects.equals(this.afterAmount, multiCollateralRecordCurrency.afterAmount) && + Objects.equals(this.afterAmountUsdt, multiCollateralRecordCurrency.afterAmountUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, beforeAmount, beforeAmountUsdt, afterAmount, afterAmountUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiCollateralRecordCurrency {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" beforeAmount: ").append(toIndentedString(beforeAmount)).append("\n"); + sb.append(" beforeAmountUsdt: ").append(toIndentedString(beforeAmountUsdt)).append("\n"); + sb.append(" afterAmount: ").append(toIndentedString(afterAmount)).append("\n"); + sb.append(" afterAmountUsdt: ").append(toIndentedString(afterAmountUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MultiLoanItem.java b/src/main/java/io/gate/gateapi/models/MultiLoanItem.java new file mode 100644 index 0000000..0231292 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiLoanItem.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MultiLoanItem + */ +public class MultiLoanItem { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + + public MultiLoanItem currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public MultiLoanItem price(String price) { + + this.price = price; + return this; + } + + /** + * Latest price of the currency + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiLoanItem multiLoanItem = (MultiLoanItem) o; + return Objects.equals(this.currency, multiLoanItem.currency) && + Objects.equals(this.price, multiLoanItem.price); + } + + @Override + public int hashCode() { + return Objects.hash(currency, price); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiLoanItem {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MarginBorrowable.java b/src/main/java/io/gate/gateapi/models/MultiLoanRepayItem.java similarity index 61% rename from src/main/java/io/gate/gateapi/models/MarginBorrowable.java rename to src/main/java/io/gate/gateapi/models/MultiLoanRepayItem.java index 896aafd..3490e27 100644 --- a/src/main/java/io/gate/gateapi/models/MarginBorrowable.java +++ b/src/main/java/io/gate/gateapi/models/MultiLoanRepayItem.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 @@ -20,30 +20,30 @@ import java.io.IOException; /** - * MarginBorrowable + * MultiLoanRepayItem */ -public class MarginBorrowable { +public class MultiLoanRepayItem { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; - public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; - @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) - private String currencyPair; - public static final String SERIALIZED_NAME_AMOUNT = "amount"; @SerializedName(SERIALIZED_NAME_AMOUNT) private String amount; + public static final String SERIALIZED_NAME_REPAID_ALL = "repaid_all"; + @SerializedName(SERIALIZED_NAME_REPAID_ALL) + private Boolean repaidAll; + - public MarginBorrowable currency(String currency) { + public MultiLoanRepayItem currency(String currency) { this.currency = currency; return this; } /** - * Currency detail + * Repayment currency * @return currency **/ @javax.annotation.Nullable @@ -56,44 +56,43 @@ public void setCurrency(String currency) { this.currency = currency; } - public MarginBorrowable currencyPair(String currencyPair) { + public MultiLoanRepayItem amount(String amount) { - this.currencyPair = currencyPair; + this.amount = amount; return this; } /** - * Currency pair - * @return currencyPair + * Size + * @return amount **/ @javax.annotation.Nullable - public String getCurrencyPair() { - return currencyPair; + public String getAmount() { + return amount; } - public void setCurrencyPair(String currencyPair) { - this.currencyPair = currencyPair; + public void setAmount(String amount) { + this.amount = amount; } - public MarginBorrowable amount(String amount) { + public MultiLoanRepayItem repaidAll(Boolean repaidAll) { - this.amount = amount; + this.repaidAll = repaidAll; return this; } /** - * Max borrowable amount - * @return amount + * Repayment method, set to true for full repayment, false for partial repayment + * @return repaidAll **/ - @javax.annotation.Nullable - public String getAmount() { - return amount; + public Boolean getRepaidAll() { + return repaidAll; } - public void setAmount(String amount) { - this.amount = amount; + public void setRepaidAll(Boolean repaidAll) { + this.repaidAll = repaidAll; } @Override public boolean equals(java.lang.Object o) { @@ -103,25 +102,25 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - MarginBorrowable marginBorrowable = (MarginBorrowable) o; - return Objects.equals(this.currency, marginBorrowable.currency) && - Objects.equals(this.currencyPair, marginBorrowable.currencyPair) && - Objects.equals(this.amount, marginBorrowable.amount); + MultiLoanRepayItem multiLoanRepayItem = (MultiLoanRepayItem) o; + return Objects.equals(this.currency, multiLoanRepayItem.currency) && + Objects.equals(this.amount, multiLoanRepayItem.amount) && + Objects.equals(this.repaidAll, multiLoanRepayItem.repaidAll); } @Override public int hashCode() { - return Objects.hash(currency, currencyPair, amount); + return Objects.hash(currency, amount, repaidAll); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class MarginBorrowable {\n"); + sb.append("class MultiLoanRepayItem {\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" repaidAll: ").append(toIndentedString(repaidAll)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/MultiRepayRecord.java b/src/main/java/io/gate/gateapi/models/MultiRepayRecord.java new file mode 100644 index 0000000..51b8d2a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiRepayRecord.java @@ -0,0 +1,421 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.RepayRecordCurrency; +import io.gate.gateapi.models.RepayRecordLeftInterest; +import io.gate.gateapi.models.RepayRecordRepaidCurrency; +import io.gate.gateapi.models.RepayRecordTotalInterest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Multi-Collateral Repayment Record + */ +public class MultiRepayRecord { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_RECORD_ID = "record_id"; + @SerializedName(SERIALIZED_NAME_RECORD_ID) + private Long recordId; + + public static final String SERIALIZED_NAME_INIT_LTV = "init_ltv"; + @SerializedName(SERIALIZED_NAME_INIT_LTV) + private String initLtv; + + public static final String SERIALIZED_NAME_BEFORE_LTV = "before_ltv"; + @SerializedName(SERIALIZED_NAME_BEFORE_LTV) + private String beforeLtv; + + public static final String SERIALIZED_NAME_AFTER_LTV = "after_ltv"; + @SerializedName(SERIALIZED_NAME_AFTER_LTV) + private String afterLtv; + + public static final String SERIALIZED_NAME_BORROW_TIME = "borrow_time"; + @SerializedName(SERIALIZED_NAME_BORROW_TIME) + private Long borrowTime; + + public static final String SERIALIZED_NAME_REPAY_TIME = "repay_time"; + @SerializedName(SERIALIZED_NAME_REPAY_TIME) + private Long repayTime; + + public static final String SERIALIZED_NAME_BORROW_CURRENCIES = "borrow_currencies"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCIES) + private List borrowCurrencies = null; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCIES = "collateral_currencies"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCIES) + private List collateralCurrencies = null; + + public static final String SERIALIZED_NAME_REPAID_CURRENCIES = "repaid_currencies"; + @SerializedName(SERIALIZED_NAME_REPAID_CURRENCIES) + private List repaidCurrencies = null; + + public static final String SERIALIZED_NAME_TOTAL_INTEREST_LIST = "total_interest_list"; + @SerializedName(SERIALIZED_NAME_TOTAL_INTEREST_LIST) + private List totalInterestList = null; + + public static final String SERIALIZED_NAME_LEFT_REPAY_INTEREST_LIST = "left_repay_interest_list"; + @SerializedName(SERIALIZED_NAME_LEFT_REPAY_INTEREST_LIST) + private List leftRepayInterestList = null; + + + public MultiRepayRecord orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public MultiRepayRecord recordId(Long recordId) { + + this.recordId = recordId; + return this; + } + + /** + * Repayment record ID + * @return recordId + **/ + @javax.annotation.Nullable + public Long getRecordId() { + return recordId; + } + + + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + public MultiRepayRecord initLtv(String initLtv) { + + this.initLtv = initLtv; + return this; + } + + /** + * Initial collateralization rate + * @return initLtv + **/ + @javax.annotation.Nullable + public String getInitLtv() { + return initLtv; + } + + + public void setInitLtv(String initLtv) { + this.initLtv = initLtv; + } + + public MultiRepayRecord beforeLtv(String beforeLtv) { + + this.beforeLtv = beforeLtv; + return this; + } + + /** + * Ltv before the operation + * @return beforeLtv + **/ + @javax.annotation.Nullable + public String getBeforeLtv() { + return beforeLtv; + } + + + public void setBeforeLtv(String beforeLtv) { + this.beforeLtv = beforeLtv; + } + + public MultiRepayRecord afterLtv(String afterLtv) { + + this.afterLtv = afterLtv; + return this; + } + + /** + * Ltv after the operation + * @return afterLtv + **/ + @javax.annotation.Nullable + public String getAfterLtv() { + return afterLtv; + } + + + public void setAfterLtv(String afterLtv) { + this.afterLtv = afterLtv; + } + + public MultiRepayRecord borrowTime(Long borrowTime) { + + this.borrowTime = borrowTime; + return this; + } + + /** + * Borrowing time, timestamp in seconds + * @return borrowTime + **/ + @javax.annotation.Nullable + public Long getBorrowTime() { + return borrowTime; + } + + + public void setBorrowTime(Long borrowTime) { + this.borrowTime = borrowTime; + } + + public MultiRepayRecord repayTime(Long repayTime) { + + this.repayTime = repayTime; + return this; + } + + /** + * Repayment time, timestamp in seconds + * @return repayTime + **/ + @javax.annotation.Nullable + public Long getRepayTime() { + return repayTime; + } + + + public void setRepayTime(Long repayTime) { + this.repayTime = repayTime; + } + + public MultiRepayRecord borrowCurrencies(List borrowCurrencies) { + + this.borrowCurrencies = borrowCurrencies; + return this; + } + + public MultiRepayRecord addBorrowCurrenciesItem(RepayRecordCurrency borrowCurrenciesItem) { + if (this.borrowCurrencies == null) { + this.borrowCurrencies = new ArrayList<>(); + } + this.borrowCurrencies.add(borrowCurrenciesItem); + return this; + } + + /** + * List of borrowing information + * @return borrowCurrencies + **/ + @javax.annotation.Nullable + public List getBorrowCurrencies() { + return borrowCurrencies; + } + + + public void setBorrowCurrencies(List borrowCurrencies) { + this.borrowCurrencies = borrowCurrencies; + } + + public MultiRepayRecord collateralCurrencies(List collateralCurrencies) { + + this.collateralCurrencies = collateralCurrencies; + return this; + } + + public MultiRepayRecord addCollateralCurrenciesItem(RepayRecordCurrency collateralCurrenciesItem) { + if (this.collateralCurrencies == null) { + this.collateralCurrencies = new ArrayList<>(); + } + this.collateralCurrencies.add(collateralCurrenciesItem); + return this; + } + + /** + * List of collateral information + * @return collateralCurrencies + **/ + @javax.annotation.Nullable + public List getCollateralCurrencies() { + return collateralCurrencies; + } + + + public void setCollateralCurrencies(List collateralCurrencies) { + this.collateralCurrencies = collateralCurrencies; + } + + public MultiRepayRecord repaidCurrencies(List repaidCurrencies) { + + this.repaidCurrencies = repaidCurrencies; + return this; + } + + public MultiRepayRecord addRepaidCurrenciesItem(RepayRecordRepaidCurrency repaidCurrenciesItem) { + if (this.repaidCurrencies == null) { + this.repaidCurrencies = new ArrayList<>(); + } + this.repaidCurrencies.add(repaidCurrenciesItem); + return this; + } + + /** + * Repay Currency List + * @return repaidCurrencies + **/ + @javax.annotation.Nullable + public List getRepaidCurrencies() { + return repaidCurrencies; + } + + + public void setRepaidCurrencies(List repaidCurrencies) { + this.repaidCurrencies = repaidCurrencies; + } + + public MultiRepayRecord totalInterestList(List totalInterestList) { + + this.totalInterestList = totalInterestList; + return this; + } + + public MultiRepayRecord addTotalInterestListItem(RepayRecordTotalInterest totalInterestListItem) { + if (this.totalInterestList == null) { + this.totalInterestList = new ArrayList<>(); + } + this.totalInterestList.add(totalInterestListItem); + return this; + } + + /** + * Total Interest List + * @return totalInterestList + **/ + @javax.annotation.Nullable + public List getTotalInterestList() { + return totalInterestList; + } + + + public void setTotalInterestList(List totalInterestList) { + this.totalInterestList = totalInterestList; + } + + public MultiRepayRecord leftRepayInterestList(List leftRepayInterestList) { + + this.leftRepayInterestList = leftRepayInterestList; + return this; + } + + public MultiRepayRecord addLeftRepayInterestListItem(RepayRecordLeftInterest leftRepayInterestListItem) { + if (this.leftRepayInterestList == null) { + this.leftRepayInterestList = new ArrayList<>(); + } + this.leftRepayInterestList.add(leftRepayInterestListItem); + return this; + } + + /** + * List of remaining interest to be repaid + * @return leftRepayInterestList + **/ + @javax.annotation.Nullable + public List getLeftRepayInterestList() { + return leftRepayInterestList; + } + + + public void setLeftRepayInterestList(List leftRepayInterestList) { + this.leftRepayInterestList = leftRepayInterestList; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiRepayRecord multiRepayRecord = (MultiRepayRecord) o; + return Objects.equals(this.orderId, multiRepayRecord.orderId) && + Objects.equals(this.recordId, multiRepayRecord.recordId) && + Objects.equals(this.initLtv, multiRepayRecord.initLtv) && + Objects.equals(this.beforeLtv, multiRepayRecord.beforeLtv) && + Objects.equals(this.afterLtv, multiRepayRecord.afterLtv) && + Objects.equals(this.borrowTime, multiRepayRecord.borrowTime) && + Objects.equals(this.repayTime, multiRepayRecord.repayTime) && + Objects.equals(this.borrowCurrencies, multiRepayRecord.borrowCurrencies) && + Objects.equals(this.collateralCurrencies, multiRepayRecord.collateralCurrencies) && + Objects.equals(this.repaidCurrencies, multiRepayRecord.repaidCurrencies) && + Objects.equals(this.totalInterestList, multiRepayRecord.totalInterestList) && + Objects.equals(this.leftRepayInterestList, multiRepayRecord.leftRepayInterestList); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, recordId, initLtv, beforeLtv, afterLtv, borrowTime, repayTime, borrowCurrencies, collateralCurrencies, repaidCurrencies, totalInterestList, leftRepayInterestList); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiRepayRecord {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" recordId: ").append(toIndentedString(recordId)).append("\n"); + sb.append(" initLtv: ").append(toIndentedString(initLtv)).append("\n"); + sb.append(" beforeLtv: ").append(toIndentedString(beforeLtv)).append("\n"); + sb.append(" afterLtv: ").append(toIndentedString(afterLtv)).append("\n"); + sb.append(" borrowTime: ").append(toIndentedString(borrowTime)).append("\n"); + sb.append(" repayTime: ").append(toIndentedString(repayTime)).append("\n"); + sb.append(" borrowCurrencies: ").append(toIndentedString(borrowCurrencies)).append("\n"); + sb.append(" collateralCurrencies: ").append(toIndentedString(collateralCurrencies)).append("\n"); + sb.append(" repaidCurrencies: ").append(toIndentedString(repaidCurrencies)).append("\n"); + sb.append(" totalInterestList: ").append(toIndentedString(totalInterestList)).append("\n"); + sb.append(" leftRepayInterestList: ").append(toIndentedString(leftRepayInterestList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MultiRepayResp.java b/src/main/java/io/gate/gateapi/models/MultiRepayResp.java new file mode 100644 index 0000000..6b76091 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MultiRepayResp.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.RepayCurrencyRes; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Multi-currency collateral repayment + */ +public class MultiRepayResp { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_REPAID_CURRENCIES = "repaid_currencies"; + @SerializedName(SERIALIZED_NAME_REPAID_CURRENCIES) + private List repaidCurrencies = null; + + + public MultiRepayResp orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public MultiRepayResp repaidCurrencies(List repaidCurrencies) { + + this.repaidCurrencies = repaidCurrencies; + return this; + } + + public MultiRepayResp addRepaidCurrenciesItem(RepayCurrencyRes repaidCurrenciesItem) { + if (this.repaidCurrencies == null) { + this.repaidCurrencies = new ArrayList<>(); + } + this.repaidCurrencies.add(repaidCurrenciesItem); + return this; + } + + /** + * Repay Currency List + * @return repaidCurrencies + **/ + @javax.annotation.Nullable + public List getRepaidCurrencies() { + return repaidCurrencies; + } + + + public void setRepaidCurrencies(List repaidCurrencies) { + this.repaidCurrencies = repaidCurrencies; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiRepayResp multiRepayResp = (MultiRepayResp) o; + return Objects.equals(this.orderId, multiRepayResp.orderId) && + Objects.equals(this.repaidCurrencies, multiRepayResp.repaidCurrencies); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, repaidCurrencies); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiRepayResp {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" repaidCurrencies: ").append(toIndentedString(repaidCurrencies)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/MyFuturesTrade.java b/src/main/java/io/gate/gateapi/models/MyFuturesTrade.java index 34167b3..9d97fad 100644 --- a/src/main/java/io/gate/gateapi/models/MyFuturesTrade.java +++ b/src/main/java/io/gate/gateapi/models/MyFuturesTrade.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 @@ -43,12 +43,16 @@ public class MyFuturesTrade { @SerializedName(SERIALIZED_NAME_SIZE) private Long size; + public static final String SERIALIZED_NAME_CLOSE_SIZE = "close_size"; + @SerializedName(SERIALIZED_NAME_CLOSE_SIZE) + private Long closeSize; + public static final String SERIALIZED_NAME_PRICE = "price"; @SerializedName(SERIALIZED_NAME_PRICE) private String price; /** - * Trade role. Available values are `taker` and `maker` + * Trade role. taker - taker, maker - maker */ @JsonAdapter(RoleEnum.Adapter.class) public enum RoleEnum { @@ -98,6 +102,18 @@ public RoleEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ROLE) private RoleEnum role; + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_POINT_FEE = "point_fee"; + @SerializedName(SERIALIZED_NAME_POINT_FEE) + private String pointFee; + public MyFuturesTrade id(Long id) { @@ -106,7 +122,7 @@ public MyFuturesTrade id(Long id) { } /** - * Trade ID + * Fill ID * @return id **/ @javax.annotation.Nullable @@ -126,7 +142,7 @@ public MyFuturesTrade createTime(Double createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -166,7 +182,7 @@ public MyFuturesTrade orderId(String orderId) { } /** - * Order ID related + * Related order ID * @return orderId **/ @javax.annotation.Nullable @@ -199,6 +215,26 @@ public void setSize(Long size) { this.size = size; } + public MyFuturesTrade closeSize(Long closeSize) { + + this.closeSize = closeSize; + return this; + } + + /** + * 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 + * @return closeSize + **/ + @javax.annotation.Nullable + public Long getCloseSize() { + return closeSize; + } + + + public void setCloseSize(Long closeSize) { + this.closeSize = closeSize; + } + public MyFuturesTrade price(String price) { this.price = price; @@ -206,7 +242,7 @@ public MyFuturesTrade price(String price) { } /** - * Trading price + * Fill Price * @return price **/ @javax.annotation.Nullable @@ -226,7 +262,7 @@ public MyFuturesTrade role(RoleEnum role) { } /** - * Trade role. Available values are `taker` and `maker` + * Trade role. taker - taker, maker - maker * @return role **/ @javax.annotation.Nullable @@ -238,6 +274,66 @@ public RoleEnum getRole() { public void setRole(RoleEnum role) { this.role = role; } + + public MyFuturesTrade text(String text) { + + this.text = text; + return this; + } + + /** + * Order custom information + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + public MyFuturesTrade fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * Trade fee + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public MyFuturesTrade pointFee(String pointFee) { + + this.pointFee = pointFee; + return this; + } + + /** + * Points used to deduct trade fee + * @return pointFee + **/ + @javax.annotation.Nullable + public String getPointFee() { + return pointFee; + } + + + public void setPointFee(String pointFee) { + this.pointFee = pointFee; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -252,13 +348,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.contract, myFuturesTrade.contract) && Objects.equals(this.orderId, myFuturesTrade.orderId) && Objects.equals(this.size, myFuturesTrade.size) && + Objects.equals(this.closeSize, myFuturesTrade.closeSize) && Objects.equals(this.price, myFuturesTrade.price) && - Objects.equals(this.role, myFuturesTrade.role); + Objects.equals(this.role, myFuturesTrade.role) && + Objects.equals(this.text, myFuturesTrade.text) && + Objects.equals(this.fee, myFuturesTrade.fee) && + Objects.equals(this.pointFee, myFuturesTrade.pointFee); } @Override public int hashCode() { - return Objects.hash(id, createTime, contract, orderId, size, price, role); + return Objects.hash(id, createTime, contract, orderId, size, closeSize, price, role, text, fee, pointFee); } @@ -271,8 +371,12 @@ public String toString() { sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" closeSize: ").append(toIndentedString(closeSize)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" pointFee: ").append(toIndentedString(pointFee)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/MyFuturesTradeTimeRange.java b/src/main/java/io/gate/gateapi/models/MyFuturesTradeTimeRange.java new file mode 100644 index 0000000..9364731 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/MyFuturesTradeTimeRange.java @@ -0,0 +1,396 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MyFuturesTradeTimeRange + */ +public class MyFuturesTradeTimeRange { + public static final String SERIALIZED_NAME_TRADE_ID = "trade_id"; + @SerializedName(SERIALIZED_NAME_TRADE_ID) + private String tradeId; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Double createTime; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private String orderId; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_CLOSE_SIZE = "close_size"; + @SerializedName(SERIALIZED_NAME_CLOSE_SIZE) + private Long closeSize; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + /** + * Trade role. taker - taker, maker - maker + */ + @JsonAdapter(RoleEnum.Adapter.class) + public enum RoleEnum { + TAKER("taker"), + + MAKER("maker"); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RoleEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RoleEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RoleEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + private RoleEnum role; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_POINT_FEE = "point_fee"; + @SerializedName(SERIALIZED_NAME_POINT_FEE) + private String pointFee; + + + public MyFuturesTradeTimeRange tradeId(String tradeId) { + + this.tradeId = tradeId; + return this; + } + + /** + * Fill ID + * @return tradeId + **/ + @javax.annotation.Nullable + public String getTradeId() { + return tradeId; + } + + + public void setTradeId(String tradeId) { + this.tradeId = tradeId; + } + + public MyFuturesTradeTimeRange createTime(Double createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Fill Time + * @return createTime + **/ + @javax.annotation.Nullable + public Double getCreateTime() { + return createTime; + } + + + public void setCreateTime(Double createTime) { + this.createTime = createTime; + } + + public MyFuturesTradeTimeRange contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Futures contract + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public MyFuturesTradeTimeRange orderId(String orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Related order ID + * @return orderId + **/ + @javax.annotation.Nullable + public String getOrderId() { + return orderId; + } + + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public MyFuturesTradeTimeRange size(Long size) { + + this.size = size; + return this; + } + + /** + * Trading size + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public MyFuturesTradeTimeRange closeSize(Long closeSize) { + + this.closeSize = closeSize; + return this; + } + + /** + * 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 + * @return closeSize + **/ + @javax.annotation.Nullable + public Long getCloseSize() { + return closeSize; + } + + + public void setCloseSize(Long closeSize) { + this.closeSize = closeSize; + } + + public MyFuturesTradeTimeRange price(String price) { + + this.price = price; + return this; + } + + /** + * Fill Price + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public MyFuturesTradeTimeRange role(RoleEnum role) { + + this.role = role; + return this; + } + + /** + * Trade role. taker - taker, maker - maker + * @return role + **/ + @javax.annotation.Nullable + public RoleEnum getRole() { + return role; + } + + + public void setRole(RoleEnum role) { + this.role = role; + } + + public MyFuturesTradeTimeRange text(String text) { + + this.text = text; + return this; + } + + /** + * Order custom information + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + public MyFuturesTradeTimeRange fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * Trade fee + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public MyFuturesTradeTimeRange pointFee(String pointFee) { + + this.pointFee = pointFee; + return this; + } + + /** + * Points used to deduct trade fee + * @return pointFee + **/ + @javax.annotation.Nullable + public String getPointFee() { + return pointFee; + } + + + public void setPointFee(String pointFee) { + this.pointFee = pointFee; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MyFuturesTradeTimeRange myFuturesTradeTimeRange = (MyFuturesTradeTimeRange) o; + return Objects.equals(this.tradeId, myFuturesTradeTimeRange.tradeId) && + Objects.equals(this.createTime, myFuturesTradeTimeRange.createTime) && + Objects.equals(this.contract, myFuturesTradeTimeRange.contract) && + Objects.equals(this.orderId, myFuturesTradeTimeRange.orderId) && + Objects.equals(this.size, myFuturesTradeTimeRange.size) && + Objects.equals(this.closeSize, myFuturesTradeTimeRange.closeSize) && + Objects.equals(this.price, myFuturesTradeTimeRange.price) && + Objects.equals(this.role, myFuturesTradeTimeRange.role) && + Objects.equals(this.text, myFuturesTradeTimeRange.text) && + Objects.equals(this.fee, myFuturesTradeTimeRange.fee) && + Objects.equals(this.pointFee, myFuturesTradeTimeRange.pointFee); + } + + @Override + public int hashCode() { + return Objects.hash(tradeId, createTime, contract, orderId, size, closeSize, price, role, text, fee, pointFee); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MyFuturesTradeTimeRange {\n"); + sb.append(" tradeId: ").append(toIndentedString(tradeId)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" closeSize: ").append(toIndentedString(closeSize)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" pointFee: ").append(toIndentedString(pointFee)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OpenOrders.java b/src/main/java/io/gate/gateapi/models/OpenOrders.java index 0fcd9ec..39708aa 100644 --- a/src/main/java/io/gate/gateapi/models/OpenOrders.java +++ b/src/main/java/io/gate/gateapi/models/OpenOrders.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 @@ -66,7 +66,7 @@ public OpenOrders total(Integer total) { } /** - * Total open orders in this currency pair + * Total number of open orders for this trading pair on the current page * @return total **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsAccount.java b/src/main/java/io/gate/gateapi/models/OptionsAccount.java new file mode 100644 index 0000000..535c794 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsAccount.java @@ -0,0 +1,606 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OptionsAccount + */ +public class OptionsAccount { + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private Long user; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private String total; + + public static final String SERIALIZED_NAME_POSITION_VALUE = "position_value"; + @SerializedName(SERIALIZED_NAME_POSITION_VALUE) + private String positionValue; + + public static final String SERIALIZED_NAME_EQUITY = "equity"; + @SerializedName(SERIALIZED_NAME_EQUITY) + private String equity; + + public static final String SERIALIZED_NAME_SHORT_ENABLED = "short_enabled"; + @SerializedName(SERIALIZED_NAME_SHORT_ENABLED) + private Boolean shortEnabled; + + public static final String SERIALIZED_NAME_MMP_ENABLED = "mmp_enabled"; + @SerializedName(SERIALIZED_NAME_MMP_ENABLED) + private Boolean mmpEnabled; + + public static final String SERIALIZED_NAME_LIQ_TRIGGERED = "liq_triggered"; + @SerializedName(SERIALIZED_NAME_LIQ_TRIGGERED) + private Boolean liqTriggered; + + /** + * | 保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 + */ + @JsonAdapter(MarginModeEnum.Adapter.class) + public enum MarginModeEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + MarginModeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static MarginModeEnum fromValue(Integer value) { + for (MarginModeEnum b : MarginModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MarginModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MarginModeEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return MarginModeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_MARGIN_MODE = "margin_mode"; + @SerializedName(SERIALIZED_NAME_MARGIN_MODE) + private MarginModeEnum marginMode; + + public static final String SERIALIZED_NAME_UNREALISED_PNL = "unrealised_pnl"; + @SerializedName(SERIALIZED_NAME_UNREALISED_PNL) + private String unrealisedPnl; + + public static final String SERIALIZED_NAME_INIT_MARGIN = "init_margin"; + @SerializedName(SERIALIZED_NAME_INIT_MARGIN) + private String initMargin; + + public static final String SERIALIZED_NAME_MAINT_MARGIN = "maint_margin"; + @SerializedName(SERIALIZED_NAME_MAINT_MARGIN) + private String maintMargin; + + public static final String SERIALIZED_NAME_ORDER_MARGIN = "order_margin"; + @SerializedName(SERIALIZED_NAME_ORDER_MARGIN) + private String orderMargin; + + public static final String SERIALIZED_NAME_ASK_ORDER_MARGIN = "ask_order_margin"; + @SerializedName(SERIALIZED_NAME_ASK_ORDER_MARGIN) + private String askOrderMargin; + + public static final String SERIALIZED_NAME_BID_ORDER_MARGIN = "bid_order_margin"; + @SerializedName(SERIALIZED_NAME_BID_ORDER_MARGIN) + private String bidOrderMargin; + + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private String available; + + public static final String SERIALIZED_NAME_POINT = "point"; + @SerializedName(SERIALIZED_NAME_POINT) + private String point; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_ORDERS_LIMIT = "orders_limit"; + @SerializedName(SERIALIZED_NAME_ORDERS_LIMIT) + private Integer ordersLimit; + + public static final String SERIALIZED_NAME_POSITION_NOTIONAL_LIMIT = "position_notional_limit"; + @SerializedName(SERIALIZED_NAME_POSITION_NOTIONAL_LIMIT) + private Long positionNotionalLimit; + + + public OptionsAccount user(Long user) { + + this.user = user; + return this; + } + + /** + * User ID + * @return user + **/ + @javax.annotation.Nullable + public Long getUser() { + return user; + } + + + public void setUser(Long user) { + this.user = user; + } + + public OptionsAccount total(String total) { + + this.total = total; + return this; + } + + /** + * Account Balance + * @return total + **/ + @javax.annotation.Nullable + public String getTotal() { + return total; + } + + + public void setTotal(String total) { + this.total = total; + } + + public OptionsAccount positionValue(String positionValue) { + + this.positionValue = positionValue; + return this; + } + + /** + * Position value, long position value is positive, short position value is negative + * @return positionValue + **/ + @javax.annotation.Nullable + public String getPositionValue() { + return positionValue; + } + + + public void setPositionValue(String positionValue) { + this.positionValue = positionValue; + } + + public OptionsAccount equity(String equity) { + + this.equity = equity; + return this; + } + + /** + * Account equity, the sum of account balance and position value + * @return equity + **/ + @javax.annotation.Nullable + public String getEquity() { + return equity; + } + + + public void setEquity(String equity) { + this.equity = equity; + } + + public OptionsAccount shortEnabled(Boolean shortEnabled) { + + this.shortEnabled = shortEnabled; + return this; + } + + /** + * If the account is allowed to short + * @return shortEnabled + **/ + @javax.annotation.Nullable + public Boolean getShortEnabled() { + return shortEnabled; + } + + + public void setShortEnabled(Boolean shortEnabled) { + this.shortEnabled = shortEnabled; + } + + public OptionsAccount mmpEnabled(Boolean mmpEnabled) { + + this.mmpEnabled = mmpEnabled; + return this; + } + + /** + * Whether to enable MMP + * @return mmpEnabled + **/ + @javax.annotation.Nullable + public Boolean getMmpEnabled() { + return mmpEnabled; + } + + + public void setMmpEnabled(Boolean mmpEnabled) { + this.mmpEnabled = mmpEnabled; + } + + public OptionsAccount liqTriggered(Boolean liqTriggered) { + + this.liqTriggered = liqTriggered; + return this; + } + + /** + * Whether to trigger position liquidation + * @return liqTriggered + **/ + @javax.annotation.Nullable + public Boolean getLiqTriggered() { + return liqTriggered; + } + + + public void setLiqTriggered(Boolean liqTriggered) { + this.liqTriggered = liqTriggered; + } + + public OptionsAccount marginMode(MarginModeEnum marginMode) { + + this.marginMode = marginMode; + return this; + } + + /** + * | 保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 + * @return marginMode + **/ + @javax.annotation.Nullable + public MarginModeEnum getMarginMode() { + return marginMode; + } + + + public void setMarginMode(MarginModeEnum marginMode) { + this.marginMode = marginMode; + } + + public OptionsAccount unrealisedPnl(String unrealisedPnl) { + + this.unrealisedPnl = unrealisedPnl; + return this; + } + + /** + * Unrealized PNL + * @return unrealisedPnl + **/ + @javax.annotation.Nullable + public String getUnrealisedPnl() { + return unrealisedPnl; + } + + + public void setUnrealisedPnl(String unrealisedPnl) { + this.unrealisedPnl = unrealisedPnl; + } + + public OptionsAccount initMargin(String initMargin) { + + this.initMargin = initMargin; + return this; + } + + /** + * Initial position margin + * @return initMargin + **/ + @javax.annotation.Nullable + public String getInitMargin() { + return initMargin; + } + + + public void setInitMargin(String initMargin) { + this.initMargin = initMargin; + } + + public OptionsAccount maintMargin(String maintMargin) { + + this.maintMargin = maintMargin; + return this; + } + + /** + * Position maintenance margin + * @return maintMargin + **/ + @javax.annotation.Nullable + public String getMaintMargin() { + return maintMargin; + } + + + public void setMaintMargin(String maintMargin) { + this.maintMargin = maintMargin; + } + + public OptionsAccount orderMargin(String orderMargin) { + + this.orderMargin = orderMargin; + return this; + } + + /** + * Order margin of unfinished orders + * @return orderMargin + **/ + @javax.annotation.Nullable + public String getOrderMargin() { + return orderMargin; + } + + + public void setOrderMargin(String orderMargin) { + this.orderMargin = orderMargin; + } + + public OptionsAccount askOrderMargin(String askOrderMargin) { + + this.askOrderMargin = askOrderMargin; + return this; + } + + /** + * Margin for outstanding sell orders + * @return askOrderMargin + **/ + @javax.annotation.Nullable + public String getAskOrderMargin() { + return askOrderMargin; + } + + + public void setAskOrderMargin(String askOrderMargin) { + this.askOrderMargin = askOrderMargin; + } + + public OptionsAccount bidOrderMargin(String bidOrderMargin) { + + this.bidOrderMargin = bidOrderMargin; + return this; + } + + /** + * Margin for outstanding buy orders + * @return bidOrderMargin + **/ + @javax.annotation.Nullable + public String getBidOrderMargin() { + return bidOrderMargin; + } + + + public void setBidOrderMargin(String bidOrderMargin) { + this.bidOrderMargin = bidOrderMargin; + } + + public OptionsAccount available(String available) { + + this.available = available; + return this; + } + + /** + * Available balance to transfer out or trade + * @return available + **/ + @javax.annotation.Nullable + public String getAvailable() { + return available; + } + + + public void setAvailable(String available) { + this.available = available; + } + + public OptionsAccount point(String point) { + + this.point = point; + return this; + } + + /** + * Point card amount + * @return point + **/ + @javax.annotation.Nullable + public String getPoint() { + return point; + } + + + public void setPoint(String point) { + this.point = point; + } + + public OptionsAccount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Settlement currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public OptionsAccount ordersLimit(Integer ordersLimit) { + + this.ordersLimit = ordersLimit; + return this; + } + + /** + * Maximum number of outstanding orders + * @return ordersLimit + **/ + @javax.annotation.Nullable + public Integer getOrdersLimit() { + return ordersLimit; + } + + + public void setOrdersLimit(Integer ordersLimit) { + this.ordersLimit = ordersLimit; + } + + public OptionsAccount positionNotionalLimit(Long positionNotionalLimit) { + + this.positionNotionalLimit = positionNotionalLimit; + return this; + } + + /** + * Notional value upper limit, including the nominal value of positions and outstanding orders + * @return positionNotionalLimit + **/ + @javax.annotation.Nullable + public Long getPositionNotionalLimit() { + return positionNotionalLimit; + } + + + public void setPositionNotionalLimit(Long positionNotionalLimit) { + this.positionNotionalLimit = positionNotionalLimit; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsAccount optionsAccount = (OptionsAccount) o; + return Objects.equals(this.user, optionsAccount.user) && + Objects.equals(this.total, optionsAccount.total) && + Objects.equals(this.positionValue, optionsAccount.positionValue) && + Objects.equals(this.equity, optionsAccount.equity) && + Objects.equals(this.shortEnabled, optionsAccount.shortEnabled) && + Objects.equals(this.mmpEnabled, optionsAccount.mmpEnabled) && + Objects.equals(this.liqTriggered, optionsAccount.liqTriggered) && + Objects.equals(this.marginMode, optionsAccount.marginMode) && + Objects.equals(this.unrealisedPnl, optionsAccount.unrealisedPnl) && + Objects.equals(this.initMargin, optionsAccount.initMargin) && + Objects.equals(this.maintMargin, optionsAccount.maintMargin) && + Objects.equals(this.orderMargin, optionsAccount.orderMargin) && + Objects.equals(this.askOrderMargin, optionsAccount.askOrderMargin) && + Objects.equals(this.bidOrderMargin, optionsAccount.bidOrderMargin) && + Objects.equals(this.available, optionsAccount.available) && + Objects.equals(this.point, optionsAccount.point) && + Objects.equals(this.currency, optionsAccount.currency) && + Objects.equals(this.ordersLimit, optionsAccount.ordersLimit) && + Objects.equals(this.positionNotionalLimit, optionsAccount.positionNotionalLimit); + } + + @Override + public int hashCode() { + return Objects.hash(user, total, positionValue, equity, shortEnabled, mmpEnabled, liqTriggered, marginMode, unrealisedPnl, initMargin, maintMargin, orderMargin, askOrderMargin, bidOrderMargin, available, point, currency, ordersLimit, positionNotionalLimit); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsAccount {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" positionValue: ").append(toIndentedString(positionValue)).append("\n"); + sb.append(" equity: ").append(toIndentedString(equity)).append("\n"); + sb.append(" shortEnabled: ").append(toIndentedString(shortEnabled)).append("\n"); + sb.append(" mmpEnabled: ").append(toIndentedString(mmpEnabled)).append("\n"); + sb.append(" liqTriggered: ").append(toIndentedString(liqTriggered)).append("\n"); + sb.append(" marginMode: ").append(toIndentedString(marginMode)).append("\n"); + sb.append(" unrealisedPnl: ").append(toIndentedString(unrealisedPnl)).append("\n"); + sb.append(" initMargin: ").append(toIndentedString(initMargin)).append("\n"); + sb.append(" maintMargin: ").append(toIndentedString(maintMargin)).append("\n"); + sb.append(" orderMargin: ").append(toIndentedString(orderMargin)).append("\n"); + sb.append(" askOrderMargin: ").append(toIndentedString(askOrderMargin)).append("\n"); + sb.append(" bidOrderMargin: ").append(toIndentedString(bidOrderMargin)).append("\n"); + sb.append(" available: ").append(toIndentedString(available)).append("\n"); + sb.append(" point: ").append(toIndentedString(point)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" ordersLimit: ").append(toIndentedString(ordersLimit)).append("\n"); + sb.append(" positionNotionalLimit: ").append(toIndentedString(positionNotionalLimit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsAccountBook.java b/src/main/java/io/gate/gateapi/models/OptionsAccountBook.java new file mode 100644 index 0000000..0e71a07 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsAccountBook.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OptionsAccountBook + */ +public class OptionsAccountBook { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Double time; + + public static final String SERIALIZED_NAME_CHANGE = "change"; + @SerializedName(SERIALIZED_NAME_CHANGE) + private String change; + + public static final String SERIALIZED_NAME_BALANCE = "balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private String balance; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + + public OptionsAccountBook time(Double time) { + + this.time = time; + return this; + } + + /** + * Change time + * @return time + **/ + @javax.annotation.Nullable + public Double getTime() { + return time; + } + + + public void setTime(Double time) { + this.time = time; + } + + public OptionsAccountBook change(String change) { + + this.change = change; + return this; + } + + /** + * Amount changed (USDT) + * @return change + **/ + @javax.annotation.Nullable + public String getChange() { + return change; + } + + + public void setChange(String change) { + this.change = change; + } + + public OptionsAccountBook balance(String balance) { + + this.balance = balance; + return this; + } + + /** + * Account total balance after change (USDT) + * @return balance + **/ + @javax.annotation.Nullable + public String getBalance() { + return balance; + } + + + public void setBalance(String balance) { + this.balance = balance; + } + + public OptionsAccountBook type(String type) { + + this.type = type; + return this; + } + + /** + * 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 + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + public OptionsAccountBook text(String text) { + + this.text = text; + return this; + } + + /** + * Remark + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsAccountBook optionsAccountBook = (OptionsAccountBook) o; + return Objects.equals(this.time, optionsAccountBook.time) && + Objects.equals(this.change, optionsAccountBook.change) && + Objects.equals(this.balance, optionsAccountBook.balance) && + Objects.equals(this.type, optionsAccountBook.type) && + Objects.equals(this.text, optionsAccountBook.text); + } + + @Override + public int hashCode() { + return Objects.hash(time, change, balance, type, text); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsAccountBook {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" change: ").append(toIndentedString(change)).append("\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsCandlestick.java b/src/main/java/io/gate/gateapi/models/OptionsCandlestick.java new file mode 100644 index 0000000..247eee0 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsCandlestick.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * data point in every timestamp + */ +public class OptionsCandlestick { + public static final String SERIALIZED_NAME_T = "t"; + @SerializedName(SERIALIZED_NAME_T) + private Double t; + + public static final String SERIALIZED_NAME_V = "v"; + @SerializedName(SERIALIZED_NAME_V) + private Long v; + + public static final String SERIALIZED_NAME_C = "c"; + @SerializedName(SERIALIZED_NAME_C) + private String c; + + public static final String SERIALIZED_NAME_H = "h"; + @SerializedName(SERIALIZED_NAME_H) + private String h; + + public static final String SERIALIZED_NAME_L = "l"; + @SerializedName(SERIALIZED_NAME_L) + private String l; + + public static final String SERIALIZED_NAME_O = "o"; + @SerializedName(SERIALIZED_NAME_O) + private String o; + + + public OptionsCandlestick t(Double t) { + + this.t = t; + return this; + } + + /** + * Unix timestamp in seconds + * @return t + **/ + @javax.annotation.Nullable + public Double getT() { + return t; + } + + + public void setT(Double t) { + this.t = t; + } + + public OptionsCandlestick v(Long v) { + + this.v = v; + return this; + } + + /** + * size volume (contract size). Only returned if `contract` is not prefixed + * @return v + **/ + @javax.annotation.Nullable + public Long getV() { + return v; + } + + + public void setV(Long v) { + this.v = v; + } + + public OptionsCandlestick c(String c) { + + this.c = c; + return this; + } + + /** + * Close price (quote currency, unit: underlying corresponding option price) + * @return c + **/ + @javax.annotation.Nullable + public String getC() { + return c; + } + + + public void setC(String c) { + this.c = c; + } + + public OptionsCandlestick h(String h) { + + this.h = h; + return this; + } + + /** + * Highest price (quote currency, unit: underlying corresponding option price) + * @return h + **/ + @javax.annotation.Nullable + public String getH() { + return h; + } + + + public void setH(String h) { + this.h = h; + } + + public OptionsCandlestick l(String l) { + + this.l = l; + return this; + } + + /** + * Lowest price (quote currency, unit: underlying corresponding option price) + * @return l + **/ + @javax.annotation.Nullable + public String getL() { + return l; + } + + + public void setL(String l) { + this.l = l; + } + + public OptionsCandlestick o(String o) { + + this.o = o; + return this; + } + + /** + * Open price (quote currency, unit: underlying corresponding option price) + * @return o + **/ + @javax.annotation.Nullable + public String getO() { + return o; + } + + + public void setO(String o) { + this.o = o; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsCandlestick optionsCandlestick = (OptionsCandlestick) o; + return Objects.equals(this.t, optionsCandlestick.t) && + Objects.equals(this.v, optionsCandlestick.v) && + Objects.equals(this.c, optionsCandlestick.c) && + Objects.equals(this.h, optionsCandlestick.h) && + Objects.equals(this.l, optionsCandlestick.l) && + Objects.equals(this.o, optionsCandlestick.o); + } + + @Override + public int hashCode() { + return Objects.hash(t, v, c, h, l, o); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsCandlestick {\n"); + sb.append(" t: ").append(toIndentedString(t)).append("\n"); + sb.append(" v: ").append(toIndentedString(v)).append("\n"); + sb.append(" c: ").append(toIndentedString(c)).append("\n"); + sb.append(" h: ").append(toIndentedString(h)).append("\n"); + sb.append(" l: ").append(toIndentedString(l)).append("\n"); + sb.append(" o: ").append(toIndentedString(o)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsContract.java b/src/main/java/io/gate/gateapi/models/OptionsContract.java new file mode 100644 index 0000000..827a036 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsContract.java @@ -0,0 +1,713 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Options contract details + */ +public class OptionsContract { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + private String tag; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Double createTime; + + public static final String SERIALIZED_NAME_EXPIRATION_TIME = "expiration_time"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIME) + private Double expirationTime; + + public static final String SERIALIZED_NAME_IS_CALL = "is_call"; + @SerializedName(SERIALIZED_NAME_IS_CALL) + private Boolean isCall; + + public static final String SERIALIZED_NAME_MULTIPLIER = "multiplier"; + @SerializedName(SERIALIZED_NAME_MULTIPLIER) + private String multiplier; + + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; + @SerializedName(SERIALIZED_NAME_UNDERLYING) + private String underlying; + + public static final String SERIALIZED_NAME_UNDERLYING_PRICE = "underlying_price"; + @SerializedName(SERIALIZED_NAME_UNDERLYING_PRICE) + private String underlyingPrice; + + public static final String SERIALIZED_NAME_LAST_PRICE = "last_price"; + @SerializedName(SERIALIZED_NAME_LAST_PRICE) + private String lastPrice; + + public static final String SERIALIZED_NAME_MARK_PRICE = "mark_price"; + @SerializedName(SERIALIZED_NAME_MARK_PRICE) + private String markPrice; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_MAKER_FEE_RATE = "maker_fee_rate"; + @SerializedName(SERIALIZED_NAME_MAKER_FEE_RATE) + private String makerFeeRate; + + public static final String SERIALIZED_NAME_TAKER_FEE_RATE = "taker_fee_rate"; + @SerializedName(SERIALIZED_NAME_TAKER_FEE_RATE) + private String takerFeeRate; + + public static final String SERIALIZED_NAME_ORDER_PRICE_ROUND = "order_price_round"; + @SerializedName(SERIALIZED_NAME_ORDER_PRICE_ROUND) + private String orderPriceRound; + + public static final String SERIALIZED_NAME_MARK_PRICE_ROUND = "mark_price_round"; + @SerializedName(SERIALIZED_NAME_MARK_PRICE_ROUND) + private String markPriceRound; + + public static final String SERIALIZED_NAME_ORDER_SIZE_MIN = "order_size_min"; + @SerializedName(SERIALIZED_NAME_ORDER_SIZE_MIN) + private Long orderSizeMin; + + public static final String SERIALIZED_NAME_ORDER_SIZE_MAX = "order_size_max"; + @SerializedName(SERIALIZED_NAME_ORDER_SIZE_MAX) + private Long orderSizeMax; + + public static final String SERIALIZED_NAME_ORDER_PRICE_DEVIATE = "order_price_deviate"; + @SerializedName(SERIALIZED_NAME_ORDER_PRICE_DEVIATE) + private String orderPriceDeviate; + + public static final String SERIALIZED_NAME_REF_DISCOUNT_RATE = "ref_discount_rate"; + @SerializedName(SERIALIZED_NAME_REF_DISCOUNT_RATE) + private String refDiscountRate; + + public static final String SERIALIZED_NAME_REF_REBATE_RATE = "ref_rebate_rate"; + @SerializedName(SERIALIZED_NAME_REF_REBATE_RATE) + private String refRebateRate; + + public static final String SERIALIZED_NAME_ORDERBOOK_ID = "orderbook_id"; + @SerializedName(SERIALIZED_NAME_ORDERBOOK_ID) + private Long orderbookId; + + public static final String SERIALIZED_NAME_TRADE_ID = "trade_id"; + @SerializedName(SERIALIZED_NAME_TRADE_ID) + private Long tradeId; + + public static final String SERIALIZED_NAME_TRADE_SIZE = "trade_size"; + @SerializedName(SERIALIZED_NAME_TRADE_SIZE) + private Long tradeSize; + + public static final String SERIALIZED_NAME_POSITION_SIZE = "position_size"; + @SerializedName(SERIALIZED_NAME_POSITION_SIZE) + private Long positionSize; + + public static final String SERIALIZED_NAME_ORDERS_LIMIT = "orders_limit"; + @SerializedName(SERIALIZED_NAME_ORDERS_LIMIT) + private Integer ordersLimit; + + + public OptionsContract name(String name) { + + this.name = name; + return this; + } + + /** + * Options contract name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public OptionsContract tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag + * @return tag + **/ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + + public void setTag(String tag) { + this.tag = tag; + } + + public OptionsContract createTime(Double createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Double getCreateTime() { + return createTime; + } + + + public void setCreateTime(Double createTime) { + this.createTime = createTime; + } + + public OptionsContract expirationTime(Double expirationTime) { + + this.expirationTime = expirationTime; + return this; + } + + /** + * Expiration time + * @return expirationTime + **/ + @javax.annotation.Nullable + public Double getExpirationTime() { + return expirationTime; + } + + + public void setExpirationTime(Double expirationTime) { + this.expirationTime = expirationTime; + } + + public OptionsContract isCall(Boolean isCall) { + + this.isCall = isCall; + return this; + } + + /** + * `true` means call options, `false` means put options + * @return isCall + **/ + @javax.annotation.Nullable + public Boolean getIsCall() { + return isCall; + } + + + public void setIsCall(Boolean isCall) { + this.isCall = isCall; + } + + public OptionsContract multiplier(String multiplier) { + + this.multiplier = multiplier; + return this; + } + + /** + * Multiplier used in converting from invoicing to settlement currency + * @return multiplier + **/ + @javax.annotation.Nullable + public String getMultiplier() { + return multiplier; + } + + + public void setMultiplier(String multiplier) { + this.multiplier = multiplier; + } + + public OptionsContract underlying(String underlying) { + + this.underlying = underlying; + return this; + } + + /** + * Underlying + * @return underlying + **/ + @javax.annotation.Nullable + public String getUnderlying() { + return underlying; + } + + + public void setUnderlying(String underlying) { + this.underlying = underlying; + } + + public OptionsContract underlyingPrice(String underlyingPrice) { + + this.underlyingPrice = underlyingPrice; + return this; + } + + /** + * Underlying price (quote currency) + * @return underlyingPrice + **/ + @javax.annotation.Nullable + public String getUnderlyingPrice() { + return underlyingPrice; + } + + + public void setUnderlyingPrice(String underlyingPrice) { + this.underlyingPrice = underlyingPrice; + } + + public OptionsContract lastPrice(String lastPrice) { + + this.lastPrice = lastPrice; + return this; + } + + /** + * Last trading price + * @return lastPrice + **/ + @javax.annotation.Nullable + public String getLastPrice() { + return lastPrice; + } + + + public void setLastPrice(String lastPrice) { + this.lastPrice = lastPrice; + } + + public OptionsContract markPrice(String markPrice) { + + this.markPrice = markPrice; + return this; + } + + /** + * Current mark price (quote currency) + * @return markPrice + **/ + @javax.annotation.Nullable + public String getMarkPrice() { + return markPrice; + } + + + public void setMarkPrice(String markPrice) { + this.markPrice = markPrice; + } + + public OptionsContract indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Current index price (quote currency) + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public OptionsContract makerFeeRate(String makerFeeRate) { + + this.makerFeeRate = makerFeeRate; + return this; + } + + /** + * Maker fee rate, negative values indicate rebates + * @return makerFeeRate + **/ + @javax.annotation.Nullable + public String getMakerFeeRate() { + return makerFeeRate; + } + + + public void setMakerFeeRate(String makerFeeRate) { + this.makerFeeRate = makerFeeRate; + } + + public OptionsContract takerFeeRate(String takerFeeRate) { + + this.takerFeeRate = takerFeeRate; + return this; + } + + /** + * Taker fee rate + * @return takerFeeRate + **/ + @javax.annotation.Nullable + public String getTakerFeeRate() { + return takerFeeRate; + } + + + public void setTakerFeeRate(String takerFeeRate) { + this.takerFeeRate = takerFeeRate; + } + + public OptionsContract orderPriceRound(String orderPriceRound) { + + this.orderPriceRound = orderPriceRound; + return this; + } + + /** + * Minimum order price increment + * @return orderPriceRound + **/ + @javax.annotation.Nullable + public String getOrderPriceRound() { + return orderPriceRound; + } + + + public void setOrderPriceRound(String orderPriceRound) { + this.orderPriceRound = orderPriceRound; + } + + public OptionsContract markPriceRound(String markPriceRound) { + + this.markPriceRound = markPriceRound; + return this; + } + + /** + * Minimum mark price increment + * @return markPriceRound + **/ + @javax.annotation.Nullable + public String getMarkPriceRound() { + return markPriceRound; + } + + + public void setMarkPriceRound(String markPriceRound) { + this.markPriceRound = markPriceRound; + } + + public OptionsContract orderSizeMin(Long orderSizeMin) { + + this.orderSizeMin = orderSizeMin; + return this; + } + + /** + * Minimum order size allowed by the contract + * @return orderSizeMin + **/ + @javax.annotation.Nullable + public Long getOrderSizeMin() { + return orderSizeMin; + } + + + public void setOrderSizeMin(Long orderSizeMin) { + this.orderSizeMin = orderSizeMin; + } + + public OptionsContract orderSizeMax(Long orderSizeMax) { + + this.orderSizeMax = orderSizeMax; + return this; + } + + /** + * Maximum order size allowed by the contract + * @return orderSizeMax + **/ + @javax.annotation.Nullable + public Long getOrderSizeMax() { + return orderSizeMax; + } + + + public void setOrderSizeMax(Long orderSizeMax) { + this.orderSizeMax = orderSizeMax; + } + + public OptionsContract orderPriceDeviate(String orderPriceDeviate) { + + this.orderPriceDeviate = orderPriceDeviate; + return this; + } + + /** + * 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 + * @return orderPriceDeviate + **/ + @javax.annotation.Nullable + public String getOrderPriceDeviate() { + return orderPriceDeviate; + } + + + public void setOrderPriceDeviate(String orderPriceDeviate) { + this.orderPriceDeviate = orderPriceDeviate; + } + + public OptionsContract refDiscountRate(String refDiscountRate) { + + this.refDiscountRate = refDiscountRate; + return this; + } + + /** + * Trading fee discount for referred users + * @return refDiscountRate + **/ + @javax.annotation.Nullable + public String getRefDiscountRate() { + return refDiscountRate; + } + + + public void setRefDiscountRate(String refDiscountRate) { + this.refDiscountRate = refDiscountRate; + } + + public OptionsContract refRebateRate(String refRebateRate) { + + this.refRebateRate = refRebateRate; + return this; + } + + /** + * Commission rate for referrers + * @return refRebateRate + **/ + @javax.annotation.Nullable + public String getRefRebateRate() { + return refRebateRate; + } + + + public void setRefRebateRate(String refRebateRate) { + this.refRebateRate = refRebateRate; + } + + public OptionsContract orderbookId(Long orderbookId) { + + this.orderbookId = orderbookId; + return this; + } + + /** + * Orderbook update ID + * @return orderbookId + **/ + @javax.annotation.Nullable + public Long getOrderbookId() { + return orderbookId; + } + + + public void setOrderbookId(Long orderbookId) { + this.orderbookId = orderbookId; + } + + public OptionsContract tradeId(Long tradeId) { + + this.tradeId = tradeId; + return this; + } + + /** + * Current trade ID + * @return tradeId + **/ + @javax.annotation.Nullable + public Long getTradeId() { + return tradeId; + } + + + public void setTradeId(Long tradeId) { + this.tradeId = tradeId; + } + + public OptionsContract tradeSize(Long tradeSize) { + + this.tradeSize = tradeSize; + return this; + } + + /** + * Historical cumulative trading volume + * @return tradeSize + **/ + @javax.annotation.Nullable + public Long getTradeSize() { + return tradeSize; + } + + + public void setTradeSize(Long tradeSize) { + this.tradeSize = tradeSize; + } + + public OptionsContract positionSize(Long positionSize) { + + this.positionSize = positionSize; + return this; + } + + /** + * Current total long position size + * @return positionSize + **/ + @javax.annotation.Nullable + public Long getPositionSize() { + return positionSize; + } + + + public void setPositionSize(Long positionSize) { + this.positionSize = positionSize; + } + + public OptionsContract ordersLimit(Integer ordersLimit) { + + this.ordersLimit = ordersLimit; + return this; + } + + /** + * Maximum number of pending orders + * @return ordersLimit + **/ + @javax.annotation.Nullable + public Integer getOrdersLimit() { + return ordersLimit; + } + + + public void setOrdersLimit(Integer ordersLimit) { + this.ordersLimit = ordersLimit; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsContract optionsContract = (OptionsContract) o; + return Objects.equals(this.name, optionsContract.name) && + Objects.equals(this.tag, optionsContract.tag) && + Objects.equals(this.createTime, optionsContract.createTime) && + Objects.equals(this.expirationTime, optionsContract.expirationTime) && + Objects.equals(this.isCall, optionsContract.isCall) && + Objects.equals(this.multiplier, optionsContract.multiplier) && + Objects.equals(this.underlying, optionsContract.underlying) && + Objects.equals(this.underlyingPrice, optionsContract.underlyingPrice) && + Objects.equals(this.lastPrice, optionsContract.lastPrice) && + Objects.equals(this.markPrice, optionsContract.markPrice) && + Objects.equals(this.indexPrice, optionsContract.indexPrice) && + Objects.equals(this.makerFeeRate, optionsContract.makerFeeRate) && + Objects.equals(this.takerFeeRate, optionsContract.takerFeeRate) && + Objects.equals(this.orderPriceRound, optionsContract.orderPriceRound) && + Objects.equals(this.markPriceRound, optionsContract.markPriceRound) && + Objects.equals(this.orderSizeMin, optionsContract.orderSizeMin) && + Objects.equals(this.orderSizeMax, optionsContract.orderSizeMax) && + Objects.equals(this.orderPriceDeviate, optionsContract.orderPriceDeviate) && + Objects.equals(this.refDiscountRate, optionsContract.refDiscountRate) && + Objects.equals(this.refRebateRate, optionsContract.refRebateRate) && + Objects.equals(this.orderbookId, optionsContract.orderbookId) && + Objects.equals(this.tradeId, optionsContract.tradeId) && + Objects.equals(this.tradeSize, optionsContract.tradeSize) && + Objects.equals(this.positionSize, optionsContract.positionSize) && + Objects.equals(this.ordersLimit, optionsContract.ordersLimit); + } + + @Override + public int hashCode() { + return Objects.hash(name, tag, createTime, expirationTime, isCall, multiplier, underlying, underlyingPrice, lastPrice, markPrice, indexPrice, makerFeeRate, takerFeeRate, orderPriceRound, markPriceRound, orderSizeMin, orderSizeMax, orderPriceDeviate, refDiscountRate, refRebateRate, orderbookId, tradeId, tradeSize, positionSize, ordersLimit); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsContract {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" expirationTime: ").append(toIndentedString(expirationTime)).append("\n"); + sb.append(" isCall: ").append(toIndentedString(isCall)).append("\n"); + sb.append(" multiplier: ").append(toIndentedString(multiplier)).append("\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); + sb.append(" underlyingPrice: ").append(toIndentedString(underlyingPrice)).append("\n"); + sb.append(" lastPrice: ").append(toIndentedString(lastPrice)).append("\n"); + sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" makerFeeRate: ").append(toIndentedString(makerFeeRate)).append("\n"); + sb.append(" takerFeeRate: ").append(toIndentedString(takerFeeRate)).append("\n"); + sb.append(" orderPriceRound: ").append(toIndentedString(orderPriceRound)).append("\n"); + sb.append(" markPriceRound: ").append(toIndentedString(markPriceRound)).append("\n"); + sb.append(" orderSizeMin: ").append(toIndentedString(orderSizeMin)).append("\n"); + sb.append(" orderSizeMax: ").append(toIndentedString(orderSizeMax)).append("\n"); + sb.append(" orderPriceDeviate: ").append(toIndentedString(orderPriceDeviate)).append("\n"); + sb.append(" refDiscountRate: ").append(toIndentedString(refDiscountRate)).append("\n"); + sb.append(" refRebateRate: ").append(toIndentedString(refRebateRate)).append("\n"); + sb.append(" orderbookId: ").append(toIndentedString(orderbookId)).append("\n"); + sb.append(" tradeId: ").append(toIndentedString(tradeId)).append("\n"); + sb.append(" tradeSize: ").append(toIndentedString(tradeSize)).append("\n"); + sb.append(" positionSize: ").append(toIndentedString(positionSize)).append("\n"); + sb.append(" ordersLimit: ").append(toIndentedString(ordersLimit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsMMP.java b/src/main/java/io/gate/gateapi/models/OptionsMMP.java new file mode 100644 index 0000000..7bae71b --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsMMP.java @@ -0,0 +1,220 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MMP Settings + */ +public class OptionsMMP { + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; + @SerializedName(SERIALIZED_NAME_UNDERLYING) + private String underlying; + + public static final String SERIALIZED_NAME_WINDOW = "window"; + @SerializedName(SERIALIZED_NAME_WINDOW) + private Integer window; + + public static final String SERIALIZED_NAME_FROZEN_PERIOD = "frozen_period"; + @SerializedName(SERIALIZED_NAME_FROZEN_PERIOD) + private Integer frozenPeriod; + + public static final String SERIALIZED_NAME_QTY_LIMIT = "qty_limit"; + @SerializedName(SERIALIZED_NAME_QTY_LIMIT) + private String qtyLimit; + + public static final String SERIALIZED_NAME_DELTA_LIMIT = "delta_limit"; + @SerializedName(SERIALIZED_NAME_DELTA_LIMIT) + private String deltaLimit; + + public static final String SERIALIZED_NAME_TRIGGER_TIME_MS = "trigger_time_ms"; + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME_MS) + private Long triggerTimeMs; + + public static final String SERIALIZED_NAME_FROZEN_UNTIL_MS = "frozen_until_ms"; + @SerializedName(SERIALIZED_NAME_FROZEN_UNTIL_MS) + private Long frozenUntilMs; + + + public OptionsMMP underlying(String underlying) { + + this.underlying = underlying; + return this; + } + + /** + * Underlying + * @return underlying + **/ + public String getUnderlying() { + return underlying; + } + + + public void setUnderlying(String underlying) { + this.underlying = underlying; + } + + public OptionsMMP window(Integer window) { + + this.window = window; + return this; + } + + /** + * Time window (milliseconds), between 1-5000, 0 means disable MMP + * @return window + **/ + public Integer getWindow() { + return window; + } + + + public void setWindow(Integer window) { + this.window = window; + } + + public OptionsMMP frozenPeriod(Integer frozenPeriod) { + + this.frozenPeriod = frozenPeriod; + return this; + } + + /** + * Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze + * @return frozenPeriod + **/ + public Integer getFrozenPeriod() { + return frozenPeriod; + } + + + public void setFrozenPeriod(Integer frozenPeriod) { + this.frozenPeriod = frozenPeriod; + } + + public OptionsMMP qtyLimit(String qtyLimit) { + + this.qtyLimit = qtyLimit; + return this; + } + + /** + * Trading volume upper limit (positive number, up to 2 decimal places) + * @return qtyLimit + **/ + public String getQtyLimit() { + return qtyLimit; + } + + + public void setQtyLimit(String qtyLimit) { + this.qtyLimit = qtyLimit; + } + + public OptionsMMP deltaLimit(String deltaLimit) { + + this.deltaLimit = deltaLimit; + return this; + } + + /** + * Upper limit of net delta value (positive number, up to 2 decimal places) + * @return deltaLimit + **/ + public String getDeltaLimit() { + return deltaLimit; + } + + + public void setDeltaLimit(String deltaLimit) { + this.deltaLimit = deltaLimit; + } + + /** + * Trigger freeze time (milliseconds), 0 means no freeze is triggered + * @return triggerTimeMs + **/ + @javax.annotation.Nullable + public Long getTriggerTimeMs() { + return triggerTimeMs; + } + + + /** + * Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered + * @return frozenUntilMs + **/ + @javax.annotation.Nullable + public Long getFrozenUntilMs() { + return frozenUntilMs; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsMMP optionsMMP = (OptionsMMP) o; + return Objects.equals(this.underlying, optionsMMP.underlying) && + Objects.equals(this.window, optionsMMP.window) && + Objects.equals(this.frozenPeriod, optionsMMP.frozenPeriod) && + Objects.equals(this.qtyLimit, optionsMMP.qtyLimit) && + Objects.equals(this.deltaLimit, optionsMMP.deltaLimit) && + Objects.equals(this.triggerTimeMs, optionsMMP.triggerTimeMs) && + Objects.equals(this.frozenUntilMs, optionsMMP.frozenUntilMs); + } + + @Override + public int hashCode() { + return Objects.hash(underlying, window, frozenPeriod, qtyLimit, deltaLimit, triggerTimeMs, frozenUntilMs); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsMMP {\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); + sb.append(" window: ").append(toIndentedString(window)).append("\n"); + sb.append(" frozenPeriod: ").append(toIndentedString(frozenPeriod)).append("\n"); + sb.append(" qtyLimit: ").append(toIndentedString(qtyLimit)).append("\n"); + sb.append(" deltaLimit: ").append(toIndentedString(deltaLimit)).append("\n"); + sb.append(" triggerTimeMs: ").append(toIndentedString(triggerTimeMs)).append("\n"); + sb.append(" frozenUntilMs: ").append(toIndentedString(frozenUntilMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsMMPReset.java b/src/main/java/io/gate/gateapi/models/OptionsMMPReset.java new file mode 100644 index 0000000..73a9157 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsMMPReset.java @@ -0,0 +1,184 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * MMP Reset + */ +public class OptionsMMPReset { + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; + @SerializedName(SERIALIZED_NAME_UNDERLYING) + private String underlying; + + public static final String SERIALIZED_NAME_WINDOW = "window"; + @SerializedName(SERIALIZED_NAME_WINDOW) + private Integer window; + + public static final String SERIALIZED_NAME_FROZEN_PERIOD = "frozen_period"; + @SerializedName(SERIALIZED_NAME_FROZEN_PERIOD) + private Integer frozenPeriod; + + public static final String SERIALIZED_NAME_QTY_LIMIT = "qty_limit"; + @SerializedName(SERIALIZED_NAME_QTY_LIMIT) + private String qtyLimit; + + public static final String SERIALIZED_NAME_DELTA_LIMIT = "delta_limit"; + @SerializedName(SERIALIZED_NAME_DELTA_LIMIT) + private String deltaLimit; + + public static final String SERIALIZED_NAME_TRIGGER_TIME_MS = "trigger_time_ms"; + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME_MS) + private Long triggerTimeMs; + + public static final String SERIALIZED_NAME_FROZEN_UNTIL_MS = "frozen_until_ms"; + @SerializedName(SERIALIZED_NAME_FROZEN_UNTIL_MS) + private Long frozenUntilMs; + + + public OptionsMMPReset underlying(String underlying) { + + this.underlying = underlying; + return this; + } + + /** + * Underlying + * @return underlying + **/ + public String getUnderlying() { + return underlying; + } + + + public void setUnderlying(String underlying) { + this.underlying = underlying; + } + + /** + * Time window (milliseconds), between 1-5000, 0 means disable MMP + * @return window + **/ + @javax.annotation.Nullable + public Integer getWindow() { + return window; + } + + + /** + * Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze + * @return frozenPeriod + **/ + @javax.annotation.Nullable + public Integer getFrozenPeriod() { + return frozenPeriod; + } + + + /** + * Trading volume upper limit (positive number, up to 2 decimal places) + * @return qtyLimit + **/ + @javax.annotation.Nullable + public String getQtyLimit() { + return qtyLimit; + } + + + /** + * Upper limit of net delta value (positive number, up to 2 decimal places) + * @return deltaLimit + **/ + @javax.annotation.Nullable + public String getDeltaLimit() { + return deltaLimit; + } + + + /** + * Trigger freeze time (milliseconds), 0 means no freeze is triggered + * @return triggerTimeMs + **/ + @javax.annotation.Nullable + public Long getTriggerTimeMs() { + return triggerTimeMs; + } + + + /** + * Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered + * @return frozenUntilMs + **/ + @javax.annotation.Nullable + public Long getFrozenUntilMs() { + return frozenUntilMs; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsMMPReset optionsMMPReset = (OptionsMMPReset) o; + return Objects.equals(this.underlying, optionsMMPReset.underlying) && + Objects.equals(this.window, optionsMMPReset.window) && + Objects.equals(this.frozenPeriod, optionsMMPReset.frozenPeriod) && + Objects.equals(this.qtyLimit, optionsMMPReset.qtyLimit) && + Objects.equals(this.deltaLimit, optionsMMPReset.deltaLimit) && + Objects.equals(this.triggerTimeMs, optionsMMPReset.triggerTimeMs) && + Objects.equals(this.frozenUntilMs, optionsMMPReset.frozenUntilMs); + } + + @Override + public int hashCode() { + return Objects.hash(underlying, window, frozenPeriod, qtyLimit, deltaLimit, triggerTimeMs, frozenUntilMs); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsMMPReset {\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); + sb.append(" window: ").append(toIndentedString(window)).append("\n"); + sb.append(" frozenPeriod: ").append(toIndentedString(frozenPeriod)).append("\n"); + sb.append(" qtyLimit: ").append(toIndentedString(qtyLimit)).append("\n"); + sb.append(" deltaLimit: ").append(toIndentedString(deltaLimit)).append("\n"); + sb.append(" triggerTimeMs: ").append(toIndentedString(triggerTimeMs)).append("\n"); + sb.append(" frozenUntilMs: ").append(toIndentedString(frozenUntilMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsMySettlements.java b/src/main/java/io/gate/gateapi/models/OptionsMySettlements.java new file mode 100644 index 0000000..4f46613 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsMySettlements.java @@ -0,0 +1,297 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OptionsMySettlements + */ +public class OptionsMySettlements { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Double time; + + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; + @SerializedName(SERIALIZED_NAME_UNDERLYING) + private String underlying; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_STRIKE_PRICE = "strike_price"; + @SerializedName(SERIALIZED_NAME_STRIKE_PRICE) + private String strikePrice; + + public static final String SERIALIZED_NAME_SETTLE_PRICE = "settle_price"; + @SerializedName(SERIALIZED_NAME_SETTLE_PRICE) + private String settlePrice; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_SETTLE_PROFIT = "settle_profit"; + @SerializedName(SERIALIZED_NAME_SETTLE_PROFIT) + private String settleProfit; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_REALISED_PNL = "realised_pnl"; + @SerializedName(SERIALIZED_NAME_REALISED_PNL) + private String realisedPnl; + + + public OptionsMySettlements time(Double time) { + + this.time = time; + return this; + } + + /** + * Settlement time + * @return time + **/ + @javax.annotation.Nullable + public Double getTime() { + return time; + } + + + public void setTime(Double time) { + this.time = time; + } + + public OptionsMySettlements underlying(String underlying) { + + this.underlying = underlying; + return this; + } + + /** + * Underlying + * @return underlying + **/ + @javax.annotation.Nullable + public String getUnderlying() { + return underlying; + } + + + public void setUnderlying(String underlying) { + this.underlying = underlying; + } + + public OptionsMySettlements contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Options contract name + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public OptionsMySettlements strikePrice(String strikePrice) { + + this.strikePrice = strikePrice; + return this; + } + + /** + * Strike price (quote currency) + * @return strikePrice + **/ + @javax.annotation.Nullable + public String getStrikePrice() { + return strikePrice; + } + + + public void setStrikePrice(String strikePrice) { + this.strikePrice = strikePrice; + } + + public OptionsMySettlements settlePrice(String settlePrice) { + + this.settlePrice = settlePrice; + return this; + } + + /** + * Settlement price (quote currency) + * @return settlePrice + **/ + @javax.annotation.Nullable + public String getSettlePrice() { + return settlePrice; + } + + + public void setSettlePrice(String settlePrice) { + this.settlePrice = settlePrice; + } + + public OptionsMySettlements size(Long size) { + + this.size = size; + return this; + } + + /** + * Settlement size + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public OptionsMySettlements settleProfit(String settleProfit) { + + this.settleProfit = settleProfit; + return this; + } + + /** + * Settlement profit (quote currency) + * @return settleProfit + **/ + @javax.annotation.Nullable + public String getSettleProfit() { + return settleProfit; + } + + + public void setSettleProfit(String settleProfit) { + this.settleProfit = settleProfit; + } + + public OptionsMySettlements fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * Settlement fee (quote currency) + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public OptionsMySettlements realisedPnl(String realisedPnl) { + + this.realisedPnl = realisedPnl; + return this; + } + + /** + * Accumulated profit and loss from opening positions, including premium, fees, settlement profit, etc. (quote currency) + * @return realisedPnl + **/ + @javax.annotation.Nullable + public String getRealisedPnl() { + return realisedPnl; + } + + + public void setRealisedPnl(String realisedPnl) { + this.realisedPnl = realisedPnl; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsMySettlements optionsMySettlements = (OptionsMySettlements) o; + return Objects.equals(this.time, optionsMySettlements.time) && + Objects.equals(this.underlying, optionsMySettlements.underlying) && + Objects.equals(this.contract, optionsMySettlements.contract) && + Objects.equals(this.strikePrice, optionsMySettlements.strikePrice) && + Objects.equals(this.settlePrice, optionsMySettlements.settlePrice) && + Objects.equals(this.size, optionsMySettlements.size) && + Objects.equals(this.settleProfit, optionsMySettlements.settleProfit) && + Objects.equals(this.fee, optionsMySettlements.fee) && + Objects.equals(this.realisedPnl, optionsMySettlements.realisedPnl); + } + + @Override + public int hashCode() { + return Objects.hash(time, underlying, contract, strikePrice, settlePrice, size, settleProfit, fee, realisedPnl); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsMySettlements {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" strikePrice: ").append(toIndentedString(strikePrice)).append("\n"); + sb.append(" settlePrice: ").append(toIndentedString(settlePrice)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" settleProfit: ").append(toIndentedString(settleProfit)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" realisedPnl: ").append(toIndentedString(realisedPnl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsMyTrade.java b/src/main/java/io/gate/gateapi/models/OptionsMyTrade.java new file mode 100644 index 0000000..dd22f1f --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsMyTrade.java @@ -0,0 +1,318 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OptionsMyTrade + */ +public class OptionsMyTrade { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Double createTime; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Integer orderId; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_UNDERLYING_PRICE = "underlying_price"; + @SerializedName(SERIALIZED_NAME_UNDERLYING_PRICE) + private String underlyingPrice; + + /** + * Trade role. taker - taker, maker - maker + */ + @JsonAdapter(RoleEnum.Adapter.class) + public enum RoleEnum { + TAKER("taker"), + + MAKER("maker"); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RoleEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RoleEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RoleEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + private RoleEnum role; + + + public OptionsMyTrade id(Long id) { + + this.id = id; + return this; + } + + /** + * Fill ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + public OptionsMyTrade createTime(Double createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Fill Time + * @return createTime + **/ + @javax.annotation.Nullable + public Double getCreateTime() { + return createTime; + } + + + public void setCreateTime(Double createTime) { + this.createTime = createTime; + } + + public OptionsMyTrade contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Options contract name + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public OptionsMyTrade orderId(Integer orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Related order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Integer getOrderId() { + return orderId; + } + + + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + + public OptionsMyTrade size(Long size) { + + this.size = size; + return this; + } + + /** + * Trading size + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public OptionsMyTrade price(String price) { + + this.price = price; + return this; + } + + /** + * Trade price (quote currency) + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public OptionsMyTrade underlyingPrice(String underlyingPrice) { + + this.underlyingPrice = underlyingPrice; + return this; + } + + /** + * Underlying price (quote currency) + * @return underlyingPrice + **/ + @javax.annotation.Nullable + public String getUnderlyingPrice() { + return underlyingPrice; + } + + + public void setUnderlyingPrice(String underlyingPrice) { + this.underlyingPrice = underlyingPrice; + } + + public OptionsMyTrade role(RoleEnum role) { + + this.role = role; + return this; + } + + /** + * Trade role. taker - taker, maker - maker + * @return role + **/ + @javax.annotation.Nullable + public RoleEnum getRole() { + return role; + } + + + public void setRole(RoleEnum role) { + this.role = role; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsMyTrade optionsMyTrade = (OptionsMyTrade) o; + return Objects.equals(this.id, optionsMyTrade.id) && + Objects.equals(this.createTime, optionsMyTrade.createTime) && + Objects.equals(this.contract, optionsMyTrade.contract) && + Objects.equals(this.orderId, optionsMyTrade.orderId) && + Objects.equals(this.size, optionsMyTrade.size) && + Objects.equals(this.price, optionsMyTrade.price) && + Objects.equals(this.underlyingPrice, optionsMyTrade.underlyingPrice) && + Objects.equals(this.role, optionsMyTrade.role); + } + + @Override + public int hashCode() { + return Objects.hash(id, createTime, contract, orderId, size, price, underlyingPrice, role); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsMyTrade {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" underlyingPrice: ").append(toIndentedString(underlyingPrice)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsOrder.java b/src/main/java/io/gate/gateapi/models/OptionsOrder.java new file mode 100644 index 0000000..e6616ac --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsOrder.java @@ -0,0 +1,708 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Options order details + */ +public class OptionsOrder { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private Integer user; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Double createTime; + + public static final String SERIALIZED_NAME_FINISH_TIME = "finish_time"; + @SerializedName(SERIALIZED_NAME_FINISH_TIME) + private Double finishTime; + + /** + * 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 + */ + @JsonAdapter(FinishAsEnum.Adapter.class) + public enum FinishAsEnum { + 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"); + + private String value; + + FinishAsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FinishAsEnum fromValue(String value) { + for (FinishAsEnum b : FinishAsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FinishAsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FinishAsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FinishAsEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_FINISH_AS = "finish_as"; + @SerializedName(SERIALIZED_NAME_FINISH_AS) + private FinishAsEnum finishAs; + + /** + * Order status - `open`: Pending - `finished`: Completed + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("open"), + + FINISHED("finished"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_ICEBERG = "iceberg"; + @SerializedName(SERIALIZED_NAME_ICEBERG) + private Long iceberg; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_CLOSE = "close"; + @SerializedName(SERIALIZED_NAME_CLOSE) + private Boolean close = false; + + public static final String SERIALIZED_NAME_IS_CLOSE = "is_close"; + @SerializedName(SERIALIZED_NAME_IS_CLOSE) + private Boolean isClose; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduce_only"; + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + private Boolean reduceOnly = false; + + public static final String SERIALIZED_NAME_IS_REDUCE_ONLY = "is_reduce_only"; + @SerializedName(SERIALIZED_NAME_IS_REDUCE_ONLY) + private Boolean isReduceOnly; + + public static final String SERIALIZED_NAME_IS_LIQ = "is_liq"; + @SerializedName(SERIALIZED_NAME_IS_LIQ) + private Boolean isLiq; + + public static final String SERIALIZED_NAME_MMP = "mmp"; + @SerializedName(SERIALIZED_NAME_MMP) + private Boolean mmp = false; + + public static final String SERIALIZED_NAME_IS_MMP = "is_mmp"; + @SerializedName(SERIALIZED_NAME_IS_MMP) + private Boolean isMmp; + + /** + * 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 + */ + @JsonAdapter(TifEnum.Adapter.class) + public enum TifEnum { + GTC("gtc"), + + IOC("ioc"), + + POC("poc"); + + private String value; + + TifEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TifEnum fromValue(String value) { + for (TifEnum b : TifEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TifEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TifEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TifEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TIF = "tif"; + @SerializedName(SERIALIZED_NAME_TIF) + private TifEnum tif = TifEnum.GTC; + + public static final String SERIALIZED_NAME_LEFT = "left"; + @SerializedName(SERIALIZED_NAME_LEFT) + private Long left; + + public static final String SERIALIZED_NAME_FILL_PRICE = "fill_price"; + @SerializedName(SERIALIZED_NAME_FILL_PRICE) + private String fillPrice; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_TKFR = "tkfr"; + @SerializedName(SERIALIZED_NAME_TKFR) + private String tkfr; + + public static final String SERIALIZED_NAME_MKFR = "mkfr"; + @SerializedName(SERIALIZED_NAME_MKFR) + private String mkfr; + + public static final String SERIALIZED_NAME_REFU = "refu"; + @SerializedName(SERIALIZED_NAME_REFU) + private Integer refu; + + public static final String SERIALIZED_NAME_REFR = "refr"; + @SerializedName(SERIALIZED_NAME_REFR) + private String refr; + + + /** + * Options order ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + /** + * User ID + * @return user + **/ + @javax.annotation.Nullable + public Integer getUser() { + return user; + } + + + /** + * Creation time of order + * @return createTime + **/ + @javax.annotation.Nullable + public Double getCreateTime() { + return createTime; + } + + + /** + * Order finished time. Not returned if order is open + * @return finishTime + **/ + @javax.annotation.Nullable + public Double getFinishTime() { + return finishTime; + } + + + /** + * 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 + * @return finishAs + **/ + @javax.annotation.Nullable + public FinishAsEnum getFinishAs() { + return finishAs; + } + + + /** + * Order status - `open`: Pending - `finished`: Completed + * @return status + **/ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + + public OptionsOrder contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Options identifier + * @return contract + **/ + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public OptionsOrder size(Long size) { + + this.size = size; + return this; + } + + /** + * Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. + * @return size + **/ + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + public OptionsOrder iceberg(Long iceberg) { + + this.iceberg = iceberg; + return this; + } + + /** + * Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. + * @return iceberg + **/ + @javax.annotation.Nullable + public Long getIceberg() { + return iceberg; + } + + + public void setIceberg(Long iceberg) { + this.iceberg = iceberg; + } + + public OptionsOrder price(String price) { + + this.price = price; + return this; + } + + /** + * Order price. Price of 0 with `tif` set as `ioc` represents market order (quote currency) + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public OptionsOrder close(Boolean close) { + + this.close = close; + return this; + } + + /** + * Set as `true` to close the position, with `size` set to 0 + * @return close + **/ + @javax.annotation.Nullable + public Boolean getClose() { + return close; + } + + + public void setClose(Boolean close) { + this.close = close; + } + + /** + * Is the order to close position + * @return isClose + **/ + @javax.annotation.Nullable + public Boolean getIsClose() { + return isClose; + } + + + public OptionsOrder reduceOnly(Boolean reduceOnly) { + + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Set as `true` to be reduce-only order + * @return reduceOnly + **/ + @javax.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + + public void setReduceOnly(Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + /** + * Is the order reduce-only + * @return isReduceOnly + **/ + @javax.annotation.Nullable + public Boolean getIsReduceOnly() { + return isReduceOnly; + } + + + /** + * Is the order for liquidation + * @return isLiq + **/ + @javax.annotation.Nullable + public Boolean getIsLiq() { + return isLiq; + } + + + public OptionsOrder mmp(Boolean mmp) { + + this.mmp = mmp; + return this; + } + + /** + * When set to true, it is an MMP order + * @return mmp + **/ + @javax.annotation.Nullable + public Boolean getMmp() { + return mmp; + } + + + public void setMmp(Boolean mmp) { + this.mmp = mmp; + } + + /** + * Whether it is an MMP order. Corresponds to `mmp` in the request + * @return isMmp + **/ + @javax.annotation.Nullable + public Boolean getIsMmp() { + return isMmp; + } + + + public OptionsOrder tif(TifEnum tif) { + + this.tif = tif; + return this; + } + + /** + * 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 + * @return tif + **/ + @javax.annotation.Nullable + public TifEnum getTif() { + return tif; + } + + + public void setTif(TifEnum tif) { + this.tif = tif; + } + + /** + * Unfilled quantity + * @return left + **/ + @javax.annotation.Nullable + public Long getLeft() { + return left; + } + + + /** + * Fill price + * @return fillPrice + **/ + @javax.annotation.Nullable + public String getFillPrice() { + return fillPrice; + } + + + public OptionsOrder text(String text) { + + this.text = text; + return this; + } + + /** + * 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 + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + /** + * Taker fee + * @return tkfr + **/ + @javax.annotation.Nullable + public String getTkfr() { + return tkfr; + } + + + /** + * Maker fee + * @return mkfr + **/ + @javax.annotation.Nullable + public String getMkfr() { + return mkfr; + } + + + /** + * Referrer user ID + * @return refu + **/ + @javax.annotation.Nullable + public Integer getRefu() { + return refu; + } + + + /** + * Referrer rebate + * @return refr + **/ + @javax.annotation.Nullable + public String getRefr() { + return refr; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsOrder optionsOrder = (OptionsOrder) o; + return Objects.equals(this.id, optionsOrder.id) && + Objects.equals(this.user, optionsOrder.user) && + Objects.equals(this.createTime, optionsOrder.createTime) && + Objects.equals(this.finishTime, optionsOrder.finishTime) && + Objects.equals(this.finishAs, optionsOrder.finishAs) && + Objects.equals(this.status, optionsOrder.status) && + Objects.equals(this.contract, optionsOrder.contract) && + Objects.equals(this.size, optionsOrder.size) && + Objects.equals(this.iceberg, optionsOrder.iceberg) && + Objects.equals(this.price, optionsOrder.price) && + Objects.equals(this.close, optionsOrder.close) && + Objects.equals(this.isClose, optionsOrder.isClose) && + Objects.equals(this.reduceOnly, optionsOrder.reduceOnly) && + Objects.equals(this.isReduceOnly, optionsOrder.isReduceOnly) && + Objects.equals(this.isLiq, optionsOrder.isLiq) && + Objects.equals(this.mmp, optionsOrder.mmp) && + Objects.equals(this.isMmp, optionsOrder.isMmp) && + Objects.equals(this.tif, optionsOrder.tif) && + Objects.equals(this.left, optionsOrder.left) && + Objects.equals(this.fillPrice, optionsOrder.fillPrice) && + Objects.equals(this.text, optionsOrder.text) && + Objects.equals(this.tkfr, optionsOrder.tkfr) && + Objects.equals(this.mkfr, optionsOrder.mkfr) && + Objects.equals(this.refu, optionsOrder.refu) && + Objects.equals(this.refr, optionsOrder.refr); + } + + @Override + public int hashCode() { + return Objects.hash(id, user, createTime, finishTime, finishAs, status, contract, size, iceberg, price, close, isClose, reduceOnly, isReduceOnly, isLiq, mmp, isMmp, tif, left, fillPrice, text, tkfr, mkfr, refu, refr); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsOrder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" finishTime: ").append(toIndentedString(finishTime)).append("\n"); + sb.append(" finishAs: ").append(toIndentedString(finishAs)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" iceberg: ").append(toIndentedString(iceberg)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" close: ").append(toIndentedString(close)).append("\n"); + sb.append(" isClose: ").append(toIndentedString(isClose)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" isReduceOnly: ").append(toIndentedString(isReduceOnly)).append("\n"); + sb.append(" isLiq: ").append(toIndentedString(isLiq)).append("\n"); + sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); + sb.append(" isMmp: ").append(toIndentedString(isMmp)).append("\n"); + sb.append(" tif: ").append(toIndentedString(tif)).append("\n"); + sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append(" fillPrice: ").append(toIndentedString(fillPrice)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" tkfr: ").append(toIndentedString(tkfr)).append("\n"); + sb.append(" mkfr: ").append(toIndentedString(mkfr)).append("\n"); + sb.append(" refu: ").append(toIndentedString(refu)).append("\n"); + sb.append(" refr: ").append(toIndentedString(refr)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsPosition.java b/src/main/java/io/gate/gateapi/models/OptionsPosition.java new file mode 100644 index 0000000..edf15aa --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsPosition.java @@ -0,0 +1,330 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.OptionsPositionCloseOrder; +import java.io.IOException; + +/** + * Options contract position details + */ +public class OptionsPosition { + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private Integer user; + + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; + @SerializedName(SERIALIZED_NAME_UNDERLYING) + private String underlying; + + public static final String SERIALIZED_NAME_UNDERLYING_PRICE = "underlying_price"; + @SerializedName(SERIALIZED_NAME_UNDERLYING_PRICE) + private String underlyingPrice; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Long size; + + public static final String SERIALIZED_NAME_ENTRY_PRICE = "entry_price"; + @SerializedName(SERIALIZED_NAME_ENTRY_PRICE) + private String entryPrice; + + public static final String SERIALIZED_NAME_MARK_PRICE = "mark_price"; + @SerializedName(SERIALIZED_NAME_MARK_PRICE) + private String markPrice; + + public static final String SERIALIZED_NAME_MARK_IV = "mark_iv"; + @SerializedName(SERIALIZED_NAME_MARK_IV) + private String markIv; + + public static final String SERIALIZED_NAME_REALISED_PNL = "realised_pnl"; + @SerializedName(SERIALIZED_NAME_REALISED_PNL) + private String realisedPnl; + + public static final String SERIALIZED_NAME_UNREALISED_PNL = "unrealised_pnl"; + @SerializedName(SERIALIZED_NAME_UNREALISED_PNL) + private String unrealisedPnl; + + public static final String SERIALIZED_NAME_PENDING_ORDERS = "pending_orders"; + @SerializedName(SERIALIZED_NAME_PENDING_ORDERS) + private Integer pendingOrders; + + public static final String SERIALIZED_NAME_CLOSE_ORDER = "close_order"; + @SerializedName(SERIALIZED_NAME_CLOSE_ORDER) + private OptionsPositionCloseOrder closeOrder; + + public static final String SERIALIZED_NAME_DELTA = "delta"; + @SerializedName(SERIALIZED_NAME_DELTA) + private String delta; + + public static final String SERIALIZED_NAME_GAMMA = "gamma"; + @SerializedName(SERIALIZED_NAME_GAMMA) + private String gamma; + + public static final String SERIALIZED_NAME_VEGA = "vega"; + @SerializedName(SERIALIZED_NAME_VEGA) + private String vega; + + public static final String SERIALIZED_NAME_THETA = "theta"; + @SerializedName(SERIALIZED_NAME_THETA) + private String theta; + + + /** + * User ID + * @return user + **/ + @javax.annotation.Nullable + public Integer getUser() { + return user; + } + + + /** + * Underlying + * @return underlying + **/ + @javax.annotation.Nullable + public String getUnderlying() { + return underlying; + } + + + /** + * Underlying price (quote currency) + * @return underlyingPrice + **/ + @javax.annotation.Nullable + public String getUnderlyingPrice() { + return underlyingPrice; + } + + + /** + * Options contract name + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + /** + * Position size (contract quantity) + * @return size + **/ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + + /** + * Entry size (quote currency) + * @return entryPrice + **/ + @javax.annotation.Nullable + public String getEntryPrice() { + return entryPrice; + } + + + /** + * Current mark price (quote currency) + * @return markPrice + **/ + @javax.annotation.Nullable + public String getMarkPrice() { + return markPrice; + } + + + /** + * Implied volatility + * @return markIv + **/ + @javax.annotation.Nullable + public String getMarkIv() { + return markIv; + } + + + /** + * Realized PnL + * @return realisedPnl + **/ + @javax.annotation.Nullable + public String getRealisedPnl() { + return realisedPnl; + } + + + /** + * Unrealized PNL + * @return unrealisedPnl + **/ + @javax.annotation.Nullable + public String getUnrealisedPnl() { + return unrealisedPnl; + } + + + /** + * Current pending order quantity + * @return pendingOrders + **/ + @javax.annotation.Nullable + public Integer getPendingOrders() { + return pendingOrders; + } + + + public OptionsPosition closeOrder(OptionsPositionCloseOrder closeOrder) { + + this.closeOrder = closeOrder; + return this; + } + + /** + * Get closeOrder + * @return closeOrder + **/ + @javax.annotation.Nullable + public OptionsPositionCloseOrder getCloseOrder() { + return closeOrder; + } + + + public void setCloseOrder(OptionsPositionCloseOrder closeOrder) { + this.closeOrder = closeOrder; + } + + /** + * Greek letter delta + * @return delta + **/ + @javax.annotation.Nullable + public String getDelta() { + return delta; + } + + + /** + * Greek letter gamma + * @return gamma + **/ + @javax.annotation.Nullable + public String getGamma() { + return gamma; + } + + + /** + * Greek letter vega + * @return vega + **/ + @javax.annotation.Nullable + public String getVega() { + return vega; + } + + + /** + * Greek letter theta + * @return theta + **/ + @javax.annotation.Nullable + public String getTheta() { + return theta; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsPosition optionsPosition = (OptionsPosition) o; + return Objects.equals(this.user, optionsPosition.user) && + Objects.equals(this.underlying, optionsPosition.underlying) && + Objects.equals(this.underlyingPrice, optionsPosition.underlyingPrice) && + Objects.equals(this.contract, optionsPosition.contract) && + Objects.equals(this.size, optionsPosition.size) && + Objects.equals(this.entryPrice, optionsPosition.entryPrice) && + Objects.equals(this.markPrice, optionsPosition.markPrice) && + Objects.equals(this.markIv, optionsPosition.markIv) && + Objects.equals(this.realisedPnl, optionsPosition.realisedPnl) && + Objects.equals(this.unrealisedPnl, optionsPosition.unrealisedPnl) && + Objects.equals(this.pendingOrders, optionsPosition.pendingOrders) && + Objects.equals(this.closeOrder, optionsPosition.closeOrder) && + Objects.equals(this.delta, optionsPosition.delta) && + Objects.equals(this.gamma, optionsPosition.gamma) && + Objects.equals(this.vega, optionsPosition.vega) && + Objects.equals(this.theta, optionsPosition.theta); + } + + @Override + public int hashCode() { + return Objects.hash(user, underlying, underlyingPrice, contract, size, entryPrice, markPrice, markIv, realisedPnl, unrealisedPnl, pendingOrders, closeOrder, delta, gamma, vega, theta); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsPosition {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); + sb.append(" underlyingPrice: ").append(toIndentedString(underlyingPrice)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" entryPrice: ").append(toIndentedString(entryPrice)).append("\n"); + sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); + sb.append(" markIv: ").append(toIndentedString(markIv)).append("\n"); + sb.append(" realisedPnl: ").append(toIndentedString(realisedPnl)).append("\n"); + sb.append(" unrealisedPnl: ").append(toIndentedString(unrealisedPnl)).append("\n"); + sb.append(" pendingOrders: ").append(toIndentedString(pendingOrders)).append("\n"); + sb.append(" closeOrder: ").append(toIndentedString(closeOrder)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" gamma: ").append(toIndentedString(gamma)).append("\n"); + sb.append(" vega: ").append(toIndentedString(vega)).append("\n"); + sb.append(" theta: ").append(toIndentedString(theta)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsPositionClose.java b/src/main/java/io/gate/gateapi/models/OptionsPositionClose.java new file mode 100644 index 0000000..b381613 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsPositionClose.java @@ -0,0 +1,206 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OptionsPositionClose + */ +public class OptionsPositionClose { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Double time; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + /** + * Position side - `long`: Long position - `short`: Short position + */ + @JsonAdapter(SideEnum.Adapter.class) + public enum SideEnum { + LONG("long"), + + SHORT("short"); + + private String value; + + SideEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SideEnum fromValue(String value) { + for (SideEnum b : SideEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SideEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SideEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SideEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SIDE = "side"; + @SerializedName(SERIALIZED_NAME_SIDE) + private SideEnum side; + + public static final String SERIALIZED_NAME_PNL = "pnl"; + @SerializedName(SERIALIZED_NAME_PNL) + private String pnl; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_SETTLE_SIZE = "settle_size"; + @SerializedName(SERIALIZED_NAME_SETTLE_SIZE) + private String settleSize; + + + /** + * Position close time + * @return time + **/ + @javax.annotation.Nullable + public Double getTime() { + return time; + } + + + /** + * Options contract name + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + /** + * Position side - `long`: Long position - `short`: Short position + * @return side + **/ + @javax.annotation.Nullable + public SideEnum getSide() { + return side; + } + + + /** + * PnL + * @return pnl + **/ + @javax.annotation.Nullable + public String getPnl() { + return pnl; + } + + + /** + * Source of close order. See `order.text` field for specific values + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + /** + * Settlement size + * @return settleSize + **/ + @javax.annotation.Nullable + public String getSettleSize() { + return settleSize; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsPositionClose optionsPositionClose = (OptionsPositionClose) o; + return Objects.equals(this.time, optionsPositionClose.time) && + Objects.equals(this.contract, optionsPositionClose.contract) && + Objects.equals(this.side, optionsPositionClose.side) && + Objects.equals(this.pnl, optionsPositionClose.pnl) && + Objects.equals(this.text, optionsPositionClose.text) && + Objects.equals(this.settleSize, optionsPositionClose.settleSize); + } + + @Override + public int hashCode() { + return Objects.hash(time, contract, side, pnl, text, settleSize); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsPositionClose {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" pnl: ").append(toIndentedString(pnl)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" settleSize: ").append(toIndentedString(settleSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsPositionCloseOrder.java b/src/main/java/io/gate/gateapi/models/OptionsPositionCloseOrder.java new file mode 100644 index 0000000..0661e85 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsPositionCloseOrder.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Current close order information, or `null` if no close order + */ +public class OptionsPositionCloseOrder { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_IS_LIQ = "is_liq"; + @SerializedName(SERIALIZED_NAME_IS_LIQ) + private Boolean isLiq; + + + public OptionsPositionCloseOrder id(Long id) { + + this.id = id; + return this; + } + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + public OptionsPositionCloseOrder price(String price) { + + this.price = price; + return this; + } + + /** + * Order price (quote currency) + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public OptionsPositionCloseOrder isLiq(Boolean isLiq) { + + this.isLiq = isLiq; + return this; + } + + /** + * Whether the close order is from liquidation + * @return isLiq + **/ + @javax.annotation.Nullable + public Boolean getIsLiq() { + return isLiq; + } + + + public void setIsLiq(Boolean isLiq) { + this.isLiq = isLiq; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsPositionCloseOrder optionsPositionCloseOrder = (OptionsPositionCloseOrder) o; + return Objects.equals(this.id, optionsPositionCloseOrder.id) && + Objects.equals(this.price, optionsPositionCloseOrder.price) && + Objects.equals(this.isLiq, optionsPositionCloseOrder.isLiq); + } + + @Override + public int hashCode() { + return Objects.hash(id, price, isLiq); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsPositionCloseOrder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" isLiq: ").append(toIndentedString(isLiq)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsSettlement.java b/src/main/java/io/gate/gateapi/models/OptionsSettlement.java new file mode 100644 index 0000000..dc34021 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsSettlement.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OptionsSettlement + */ +public class OptionsSettlement { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Double time; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private String contract; + + public static final String SERIALIZED_NAME_PROFIT = "profit"; + @SerializedName(SERIALIZED_NAME_PROFIT) + private String profit; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_STRIKE_PRICE = "strike_price"; + @SerializedName(SERIALIZED_NAME_STRIKE_PRICE) + private String strikePrice; + + public static final String SERIALIZED_NAME_SETTLE_PRICE = "settle_price"; + @SerializedName(SERIALIZED_NAME_SETTLE_PRICE) + private String settlePrice; + + + public OptionsSettlement time(Double time) { + + this.time = time; + return this; + } + + /** + * Last configuration update time + * @return time + **/ + @javax.annotation.Nullable + public Double getTime() { + return time; + } + + + public void setTime(Double time) { + this.time = time; + } + + public OptionsSettlement contract(String contract) { + + this.contract = contract; + return this; + } + + /** + * Options contract name + * @return contract + **/ + @javax.annotation.Nullable + public String getContract() { + return contract; + } + + + public void setContract(String contract) { + this.contract = contract; + } + + public OptionsSettlement profit(String profit) { + + this.profit = profit; + return this; + } + + /** + * Settlement profit per contract (quote currency) + * @return profit + **/ + @javax.annotation.Nullable + public String getProfit() { + return profit; + } + + + public void setProfit(String profit) { + this.profit = profit; + } + + public OptionsSettlement fee(String fee) { + + this.fee = fee; + return this; + } + + /** + * Settlement fee per contract (quote currency) + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public void setFee(String fee) { + this.fee = fee; + } + + public OptionsSettlement strikePrice(String strikePrice) { + + this.strikePrice = strikePrice; + return this; + } + + /** + * Strike price (quote currency) + * @return strikePrice + **/ + @javax.annotation.Nullable + public String getStrikePrice() { + return strikePrice; + } + + + public void setStrikePrice(String strikePrice) { + this.strikePrice = strikePrice; + } + + public OptionsSettlement settlePrice(String settlePrice) { + + this.settlePrice = settlePrice; + return this; + } + + /** + * Settlement price (quote currency) + * @return settlePrice + **/ + @javax.annotation.Nullable + public String getSettlePrice() { + return settlePrice; + } + + + public void setSettlePrice(String settlePrice) { + this.settlePrice = settlePrice; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsSettlement optionsSettlement = (OptionsSettlement) o; + return Objects.equals(this.time, optionsSettlement.time) && + Objects.equals(this.contract, optionsSettlement.contract) && + Objects.equals(this.profit, optionsSettlement.profit) && + Objects.equals(this.fee, optionsSettlement.fee) && + Objects.equals(this.strikePrice, optionsSettlement.strikePrice) && + Objects.equals(this.settlePrice, optionsSettlement.settlePrice); + } + + @Override + public int hashCode() { + return Objects.hash(time, contract, profit, fee, strikePrice, settlePrice); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsSettlement {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" profit: ").append(toIndentedString(profit)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" strikePrice: ").append(toIndentedString(strikePrice)).append("\n"); + sb.append(" settlePrice: ").append(toIndentedString(settlePrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsTicker.java b/src/main/java/io/gate/gateapi/models/OptionsTicker.java new file mode 100644 index 0000000..e04290f --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsTicker.java @@ -0,0 +1,531 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Options contract details + */ +public class OptionsTicker { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_LAST_PRICE = "last_price"; + @SerializedName(SERIALIZED_NAME_LAST_PRICE) + private String lastPrice; + + public static final String SERIALIZED_NAME_MARK_PRICE = "mark_price"; + @SerializedName(SERIALIZED_NAME_MARK_PRICE) + private String markPrice; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_ASK1_SIZE = "ask1_size"; + @SerializedName(SERIALIZED_NAME_ASK1_SIZE) + private Long ask1Size; + + public static final String SERIALIZED_NAME_ASK1_PRICE = "ask1_price"; + @SerializedName(SERIALIZED_NAME_ASK1_PRICE) + private String ask1Price; + + public static final String SERIALIZED_NAME_BID1_SIZE = "bid1_size"; + @SerializedName(SERIALIZED_NAME_BID1_SIZE) + private Long bid1Size; + + public static final String SERIALIZED_NAME_BID1_PRICE = "bid1_price"; + @SerializedName(SERIALIZED_NAME_BID1_PRICE) + private String bid1Price; + + public static final String SERIALIZED_NAME_POSITION_SIZE = "position_size"; + @SerializedName(SERIALIZED_NAME_POSITION_SIZE) + private Long positionSize; + + public static final String SERIALIZED_NAME_MARK_IV = "mark_iv"; + @SerializedName(SERIALIZED_NAME_MARK_IV) + private String markIv; + + public static final String SERIALIZED_NAME_BID_IV = "bid_iv"; + @SerializedName(SERIALIZED_NAME_BID_IV) + private String bidIv; + + public static final String SERIALIZED_NAME_ASK_IV = "ask_iv"; + @SerializedName(SERIALIZED_NAME_ASK_IV) + private String askIv; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + public static final String SERIALIZED_NAME_DELTA = "delta"; + @SerializedName(SERIALIZED_NAME_DELTA) + private String delta; + + public static final String SERIALIZED_NAME_GAMMA = "gamma"; + @SerializedName(SERIALIZED_NAME_GAMMA) + private String gamma; + + public static final String SERIALIZED_NAME_VEGA = "vega"; + @SerializedName(SERIALIZED_NAME_VEGA) + private String vega; + + public static final String SERIALIZED_NAME_THETA = "theta"; + @SerializedName(SERIALIZED_NAME_THETA) + private String theta; + + public static final String SERIALIZED_NAME_RHO = "rho"; + @SerializedName(SERIALIZED_NAME_RHO) + private String rho; + + + public OptionsTicker name(String name) { + + this.name = name; + return this; + } + + /** + * Options contract name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public OptionsTicker lastPrice(String lastPrice) { + + this.lastPrice = lastPrice; + return this; + } + + /** + * Last trade price (quote currency) + * @return lastPrice + **/ + @javax.annotation.Nullable + public String getLastPrice() { + return lastPrice; + } + + + public void setLastPrice(String lastPrice) { + this.lastPrice = lastPrice; + } + + public OptionsTicker markPrice(String markPrice) { + + this.markPrice = markPrice; + return this; + } + + /** + * Current mark price (quote currency) + * @return markPrice + **/ + @javax.annotation.Nullable + public String getMarkPrice() { + return markPrice; + } + + + public void setMarkPrice(String markPrice) { + this.markPrice = markPrice; + } + + public OptionsTicker indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Current index price (quote currency) + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public OptionsTicker ask1Size(Long ask1Size) { + + this.ask1Size = ask1Size; + return this; + } + + /** + * Best ask size + * @return ask1Size + **/ + @javax.annotation.Nullable + public Long getAsk1Size() { + return ask1Size; + } + + + public void setAsk1Size(Long ask1Size) { + this.ask1Size = ask1Size; + } + + public OptionsTicker ask1Price(String ask1Price) { + + this.ask1Price = ask1Price; + return this; + } + + /** + * Best ask price + * @return ask1Price + **/ + @javax.annotation.Nullable + public String getAsk1Price() { + return ask1Price; + } + + + public void setAsk1Price(String ask1Price) { + this.ask1Price = ask1Price; + } + + public OptionsTicker bid1Size(Long bid1Size) { + + this.bid1Size = bid1Size; + return this; + } + + /** + * Best bid size + * @return bid1Size + **/ + @javax.annotation.Nullable + public Long getBid1Size() { + return bid1Size; + } + + + public void setBid1Size(Long bid1Size) { + this.bid1Size = bid1Size; + } + + public OptionsTicker bid1Price(String bid1Price) { + + this.bid1Price = bid1Price; + return this; + } + + /** + * Best bid price + * @return bid1Price + **/ + @javax.annotation.Nullable + public String getBid1Price() { + return bid1Price; + } + + + public void setBid1Price(String bid1Price) { + this.bid1Price = bid1Price; + } + + public OptionsTicker positionSize(Long positionSize) { + + this.positionSize = positionSize; + return this; + } + + /** + * Current total long position size + * @return positionSize + **/ + @javax.annotation.Nullable + public Long getPositionSize() { + return positionSize; + } + + + public void setPositionSize(Long positionSize) { + this.positionSize = positionSize; + } + + public OptionsTicker markIv(String markIv) { + + this.markIv = markIv; + return this; + } + + /** + * Implied volatility + * @return markIv + **/ + @javax.annotation.Nullable + public String getMarkIv() { + return markIv; + } + + + public void setMarkIv(String markIv) { + this.markIv = markIv; + } + + public OptionsTicker bidIv(String bidIv) { + + this.bidIv = bidIv; + return this; + } + + /** + * Bid side implied volatility + * @return bidIv + **/ + @javax.annotation.Nullable + public String getBidIv() { + return bidIv; + } + + + public void setBidIv(String bidIv) { + this.bidIv = bidIv; + } + + public OptionsTicker askIv(String askIv) { + + this.askIv = askIv; + return this; + } + + /** + * Ask side implied volatility + * @return askIv + **/ + @javax.annotation.Nullable + public String getAskIv() { + return askIv; + } + + + public void setAskIv(String askIv) { + this.askIv = askIv; + } + + public OptionsTicker leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * Current leverage. Formula: underlying_price / mark_price * delta + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + + public OptionsTicker delta(String delta) { + + this.delta = delta; + return this; + } + + /** + * Greek letter delta + * @return delta + **/ + @javax.annotation.Nullable + public String getDelta() { + return delta; + } + + + public void setDelta(String delta) { + this.delta = delta; + } + + public OptionsTicker gamma(String gamma) { + + this.gamma = gamma; + return this; + } + + /** + * Greek letter gamma + * @return gamma + **/ + @javax.annotation.Nullable + public String getGamma() { + return gamma; + } + + + public void setGamma(String gamma) { + this.gamma = gamma; + } + + public OptionsTicker vega(String vega) { + + this.vega = vega; + return this; + } + + /** + * Greek letter vega + * @return vega + **/ + @javax.annotation.Nullable + public String getVega() { + return vega; + } + + + public void setVega(String vega) { + this.vega = vega; + } + + public OptionsTicker theta(String theta) { + + this.theta = theta; + return this; + } + + /** + * Greek letter theta + * @return theta + **/ + @javax.annotation.Nullable + public String getTheta() { + return theta; + } + + + public void setTheta(String theta) { + this.theta = theta; + } + + public OptionsTicker rho(String rho) { + + this.rho = rho; + return this; + } + + /** + * Rho + * @return rho + **/ + @javax.annotation.Nullable + public String getRho() { + return rho; + } + + + public void setRho(String rho) { + this.rho = rho; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsTicker optionsTicker = (OptionsTicker) o; + return Objects.equals(this.name, optionsTicker.name) && + Objects.equals(this.lastPrice, optionsTicker.lastPrice) && + Objects.equals(this.markPrice, optionsTicker.markPrice) && + Objects.equals(this.indexPrice, optionsTicker.indexPrice) && + Objects.equals(this.ask1Size, optionsTicker.ask1Size) && + Objects.equals(this.ask1Price, optionsTicker.ask1Price) && + Objects.equals(this.bid1Size, optionsTicker.bid1Size) && + Objects.equals(this.bid1Price, optionsTicker.bid1Price) && + Objects.equals(this.positionSize, optionsTicker.positionSize) && + Objects.equals(this.markIv, optionsTicker.markIv) && + Objects.equals(this.bidIv, optionsTicker.bidIv) && + Objects.equals(this.askIv, optionsTicker.askIv) && + Objects.equals(this.leverage, optionsTicker.leverage) && + Objects.equals(this.delta, optionsTicker.delta) && + Objects.equals(this.gamma, optionsTicker.gamma) && + Objects.equals(this.vega, optionsTicker.vega) && + Objects.equals(this.theta, optionsTicker.theta) && + Objects.equals(this.rho, optionsTicker.rho); + } + + @Override + public int hashCode() { + return Objects.hash(name, lastPrice, markPrice, indexPrice, ask1Size, ask1Price, bid1Size, bid1Price, positionSize, markIv, bidIv, askIv, leverage, delta, gamma, vega, theta, rho); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsTicker {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" lastPrice: ").append(toIndentedString(lastPrice)).append("\n"); + sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" ask1Size: ").append(toIndentedString(ask1Size)).append("\n"); + sb.append(" ask1Price: ").append(toIndentedString(ask1Price)).append("\n"); + sb.append(" bid1Size: ").append(toIndentedString(bid1Size)).append("\n"); + sb.append(" bid1Price: ").append(toIndentedString(bid1Price)).append("\n"); + sb.append(" positionSize: ").append(toIndentedString(positionSize)).append("\n"); + sb.append(" markIv: ").append(toIndentedString(markIv)).append("\n"); + sb.append(" bidIv: ").append(toIndentedString(bidIv)).append("\n"); + sb.append(" askIv: ").append(toIndentedString(askIv)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" gamma: ").append(toIndentedString(gamma)).append("\n"); + sb.append(" vega: ").append(toIndentedString(vega)).append("\n"); + sb.append(" theta: ").append(toIndentedString(theta)).append("\n"); + sb.append(" rho: ").append(toIndentedString(rho)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsUnderlying.java b/src/main/java/io/gate/gateapi/models/OptionsUnderlying.java new file mode 100644 index 0000000..883ff74 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsUnderlying.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OptionsUnderlying + */ +public class OptionsUnderlying { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + + public OptionsUnderlying name(String name) { + + this.name = name; + return this; + } + + /** + * Underlying name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public OptionsUnderlying indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Spot index price (quote currency) + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsUnderlying optionsUnderlying = (OptionsUnderlying) o; + return Objects.equals(this.name, optionsUnderlying.name) && + Objects.equals(this.indexPrice, optionsUnderlying.indexPrice); + } + + @Override + public int hashCode() { + return Objects.hash(name, indexPrice); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsUnderlying {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OptionsUnderlyingTicker.java b/src/main/java/io/gate/gateapi/models/OptionsUnderlyingTicker.java new file mode 100644 index 0000000..d77ea4b --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OptionsUnderlyingTicker.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Options underlying detail + */ +public class OptionsUnderlyingTicker { + public static final String SERIALIZED_NAME_TRADE_PUT = "trade_put"; + @SerializedName(SERIALIZED_NAME_TRADE_PUT) + private Long tradePut; + + public static final String SERIALIZED_NAME_TRADE_CALL = "trade_call"; + @SerializedName(SERIALIZED_NAME_TRADE_CALL) + private Long tradeCall; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + + public OptionsUnderlyingTicker tradePut(Long tradePut) { + + this.tradePut = tradePut; + return this; + } + + /** + * Total put options trades amount in last 24h + * @return tradePut + **/ + @javax.annotation.Nullable + public Long getTradePut() { + return tradePut; + } + + + public void setTradePut(Long tradePut) { + this.tradePut = tradePut; + } + + public OptionsUnderlyingTicker tradeCall(Long tradeCall) { + + this.tradeCall = tradeCall; + return this; + } + + /** + * Total call options trades amount in last 24h + * @return tradeCall + **/ + @javax.annotation.Nullable + public Long getTradeCall() { + return tradeCall; + } + + + public void setTradeCall(Long tradeCall) { + this.tradeCall = tradeCall; + } + + public OptionsUnderlyingTicker indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Index price (quote currency) + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptionsUnderlyingTicker optionsUnderlyingTicker = (OptionsUnderlyingTicker) o; + return Objects.equals(this.tradePut, optionsUnderlyingTicker.tradePut) && + Objects.equals(this.tradeCall, optionsUnderlyingTicker.tradeCall) && + Objects.equals(this.indexPrice, optionsUnderlyingTicker.indexPrice); + } + + @Override + public int hashCode() { + return Objects.hash(tradePut, tradeCall, indexPrice); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptionsUnderlyingTicker {\n"); + sb.append(" tradePut: ").append(toIndentedString(tradePut)).append("\n"); + sb.append(" tradeCall: ").append(toIndentedString(tradeCall)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/Order.java b/src/main/java/io/gate/gateapi/models/Order.java index 92cd0bc..267009e 100644 --- a/src/main/java/io/gate/gateapi/models/Order.java +++ b/src/main/java/io/gate/gateapi/models/Order.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 @@ -31,6 +31,10 @@ public class Order { @SerializedName(SERIALIZED_NAME_TEXT) private String text; + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; @SerializedName(SERIALIZED_NAME_CREATE_TIME) private String createTime; @@ -105,11 +109,13 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private String currencyPair; /** - * Order type. limit - limit order + * Order Type - limit : Limit Order - market : Market Order */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - LIMIT("limit"); + LIMIT("limit"), + + MARKET("market"); private String value; @@ -153,61 +159,12 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type = TypeEnum.LIMIT; - /** - * Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account - */ - @JsonAdapter(AccountEnum.Adapter.class) - public enum AccountEnum { - SPOT("spot"), - - MARGIN("margin"), - - CROSS_MARGIN("cross_margin"); - - private String value; - - AccountEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AccountEnum fromValue(String value) { - for (AccountEnum b : AccountEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AccountEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AccountEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AccountEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_ACCOUNT = "account"; @SerializedName(SERIALIZED_NAME_ACCOUNT) - private AccountEnum account = AccountEnum.SPOT; + private String account = "spot"; /** - * Order side + * Buy or sell order */ @JsonAdapter(SideEnum.Adapter.class) public enum SideEnum { @@ -266,7 +223,7 @@ public SideEnum read(final JsonReader jsonReader) throws IOException { private String price; /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee + * 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` */ @JsonAdapter(TimeInForceEnum.Adapter.class) public enum TimeInForceEnum { @@ -274,7 +231,9 @@ public enum TimeInForceEnum { IOC("ioc"), - POC("poc"); + POC("poc"), + + FOK("fok"); private String value; @@ -334,6 +293,10 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_LEFT) private String left; + public static final String SERIALIZED_NAME_FILLED_AMOUNT = "filled_amount"; + @SerializedName(SERIALIZED_NAME_FILLED_AMOUNT) + private String filledAmount; + public static final String SERIALIZED_NAME_FILL_PRICE = "fill_price"; @SerializedName(SERIALIZED_NAME_FILL_PRICE) private String fillPrice; @@ -342,6 +305,10 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_FILLED_TOTAL) private String filledTotal; + public static final String SERIALIZED_NAME_AVG_DEAL_PRICE = "avg_deal_price"; + @SerializedName(SERIALIZED_NAME_AVG_DEAL_PRICE) + private String avgDealPrice; + public static final String SERIALIZED_NAME_FEE = "fee"; @SerializedName(SERIALIZED_NAME_FEE) private String fee; @@ -358,6 +325,14 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_GT_FEE) private String gtFee; + public static final String SERIALIZED_NAME_GT_MAKER_FEE = "gt_maker_fee"; + @SerializedName(SERIALIZED_NAME_GT_MAKER_FEE) + private String gtMakerFee; + + public static final String SERIALIZED_NAME_GT_TAKER_FEE = "gt_taker_fee"; + @SerializedName(SERIALIZED_NAME_GT_TAKER_FEE) + private String gtTakerFee; + public static final String SERIALIZED_NAME_GT_DISCOUNT = "gt_discount"; @SerializedName(SERIALIZED_NAME_GT_DISCOUNT) private Boolean gtDiscount; @@ -370,6 +345,140 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REBATED_FEE_CURRENCY) private String rebatedFeeCurrency; + public static final String SERIALIZED_NAME_STP_ID = "stp_id"; + @SerializedName(SERIALIZED_NAME_STP_ID) + private Integer stpId; + + /** + * 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 + */ + @JsonAdapter(StpActEnum.Adapter.class) + public enum StpActEnum { + CN("cn"), + + CO("co"), + + CB("cb"), + + MINUS("-"); + + private String value; + + StpActEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StpActEnum fromValue(String value) { + for (StpActEnum b : StpActEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StpActEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StpActEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StpActEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STP_ACT = "stp_act"; + @SerializedName(SERIALIZED_NAME_STP_ACT) + private StpActEnum stpAct; + + /** + * 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 + */ + @JsonAdapter(FinishAsEnum.Adapter.class) + public enum FinishAsEnum { + 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"); + + private String value; + + FinishAsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FinishAsEnum fromValue(String value) { + for (FinishAsEnum b : FinishAsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FinishAsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FinishAsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FinishAsEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_FINISH_AS = "finish_as"; + @SerializedName(SERIALIZED_NAME_FINISH_AS) + private FinishAsEnum finishAs; + + public static final String SERIALIZED_NAME_ACTION_MODE = "action_mode"; + @SerializedName(SERIALIZED_NAME_ACTION_MODE) + private String actionMode; + /** * Order ID @@ -388,7 +497,7 @@ public Order text(String text) { } /** - * User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 * @return text **/ @javax.annotation.Nullable @@ -401,6 +510,16 @@ public void setText(String text) { this.text = text; } + /** + * The custom data that the user remarked when amending the order + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + /** * Creation time of order * @return createTime @@ -477,7 +596,7 @@ public Order type(TypeEnum type) { } /** - * Order type. limit - limit order + * Order Type - limit : Limit Order - market : Market Order * @return type **/ @javax.annotation.Nullable @@ -490,23 +609,23 @@ public void setType(TypeEnum type) { this.type = type; } - public Order account(AccountEnum account) { + public Order account(String account) { this.account = account; return this; } /** - * Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account + * Account type, spot - spot account, margin - leveraged account, unified - unified account * @return account **/ @javax.annotation.Nullable - public AccountEnum getAccount() { + public String getAccount() { return account; } - public void setAccount(AccountEnum account) { + public void setAccount(String account) { this.account = account; } @@ -517,7 +636,7 @@ public Order side(SideEnum side) { } /** - * Order side + * Buy or sell order * @return side **/ public SideEnum getSide() { @@ -536,7 +655,7 @@ public Order amount(String amount) { } /** - * Trade amount + * 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` * @return amount **/ public String getAmount() { @@ -555,9 +674,10 @@ public Order price(String price) { } /** - * Order price + * Trading price, required when `type`=`limit` * @return price **/ + @javax.annotation.Nullable public String getPrice() { return price; } @@ -574,7 +694,7 @@ public Order timeInForce(TimeInForceEnum timeInForce) { } /** - * Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee + * 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` * @return timeInForce **/ @javax.annotation.Nullable @@ -594,7 +714,7 @@ public Order iceberg(String iceberg) { } /** - * Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely + * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported * @return iceberg **/ @javax.annotation.Nullable @@ -614,7 +734,7 @@ public Order autoBorrow(Boolean autoBorrow) { } /** - * Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. + * Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough * @return autoBorrow **/ @javax.annotation.Nullable @@ -634,7 +754,7 @@ public Order autoRepay(Boolean autoRepay) { } /** - * 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. + * 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 * @return autoRepay **/ @javax.annotation.Nullable @@ -657,6 +777,16 @@ public String getLeft() { } + /** + * Amount filled + * @return filledAmount + **/ + @javax.annotation.Nullable + public String getFilledAmount() { + return filledAmount; + } + + /** * Total filled in quote currency. Deprecated in favor of `filled_total` * @return fillPrice @@ -677,6 +807,16 @@ public String getFilledTotal() { } + /** + * Average fill price + * @return avgDealPrice + **/ + @javax.annotation.Nullable + public String getAvgDealPrice() { + return avgDealPrice; + } + + /** * Fee deducted * @return fee @@ -718,7 +858,27 @@ public String getGtFee() { /** - * Whether GT fee discount is used + * GT amount used to deduct maker fee + * @return gtMakerFee + **/ + @javax.annotation.Nullable + public String getGtMakerFee() { + return gtMakerFee; + } + + + /** + * GT amount used to deduct taker fee + * @return gtTakerFee + **/ + @javax.annotation.Nullable + public String getGtTakerFee() { + return gtTakerFee; + } + + + /** + * Whether GT fee deduction is enabled * @return gtDiscount **/ @javax.annotation.Nullable @@ -746,6 +906,66 @@ public String getRebatedFeeCurrency() { return rebatedFeeCurrency; } + + /** + * 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` + * @return stpId + **/ + @javax.annotation.Nullable + public Integer getStpId() { + return stpId; + } + + + public Order stpAct(StpActEnum stpAct) { + + this.stpAct = stpAct; + return this; + } + + /** + * 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 + * @return stpAct + **/ + @javax.annotation.Nullable + public StpActEnum getStpAct() { + return stpAct; + } + + + public void setStpAct(StpActEnum stpAct) { + this.stpAct = stpAct; + } + + /** + * 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 + * @return finishAs + **/ + @javax.annotation.Nullable + public FinishAsEnum getFinishAs() { + return finishAs; + } + + + public Order actionMode(String actionMode) { + + this.actionMode = actionMode; + return this; + } + + /** + * 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) + * @return actionMode + **/ + @javax.annotation.Nullable + public String getActionMode() { + return actionMode; + } + + + public void setActionMode(String actionMode) { + this.actionMode = actionMode; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -757,6 +977,7 @@ public boolean equals(java.lang.Object o) { Order order = (Order) o; return Objects.equals(this.id, order.id) && Objects.equals(this.text, order.text) && + Objects.equals(this.amendText, order.amendText) && Objects.equals(this.createTime, order.createTime) && Objects.equals(this.updateTime, order.updateTime) && Objects.equals(this.createTimeMs, order.createTimeMs) && @@ -773,20 +994,28 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.autoBorrow, order.autoBorrow) && Objects.equals(this.autoRepay, order.autoRepay) && Objects.equals(this.left, order.left) && + Objects.equals(this.filledAmount, order.filledAmount) && Objects.equals(this.fillPrice, order.fillPrice) && Objects.equals(this.filledTotal, order.filledTotal) && + Objects.equals(this.avgDealPrice, order.avgDealPrice) && Objects.equals(this.fee, order.fee) && Objects.equals(this.feeCurrency, order.feeCurrency) && Objects.equals(this.pointFee, order.pointFee) && Objects.equals(this.gtFee, order.gtFee) && + Objects.equals(this.gtMakerFee, order.gtMakerFee) && + Objects.equals(this.gtTakerFee, order.gtTakerFee) && Objects.equals(this.gtDiscount, order.gtDiscount) && Objects.equals(this.rebatedFee, order.rebatedFee) && - Objects.equals(this.rebatedFeeCurrency, order.rebatedFeeCurrency); + Objects.equals(this.rebatedFeeCurrency, order.rebatedFeeCurrency) && + Objects.equals(this.stpId, order.stpId) && + Objects.equals(this.stpAct, order.stpAct) && + Objects.equals(this.finishAs, order.finishAs) && + Objects.equals(this.actionMode, order.actionMode); } @Override public int hashCode() { - return Objects.hash(id, text, createTime, updateTime, createTimeMs, updateTimeMs, status, currencyPair, type, account, side, amount, price, timeInForce, iceberg, autoBorrow, autoRepay, left, fillPrice, filledTotal, fee, feeCurrency, pointFee, gtFee, gtDiscount, rebatedFee, rebatedFeeCurrency); + return Objects.hash(id, text, amendText, createTime, updateTime, createTimeMs, updateTimeMs, status, currencyPair, type, account, side, amount, price, timeInForce, iceberg, autoBorrow, autoRepay, left, filledAmount, fillPrice, filledTotal, avgDealPrice, fee, feeCurrency, pointFee, gtFee, gtMakerFee, gtTakerFee, gtDiscount, rebatedFee, rebatedFeeCurrency, stpId, stpAct, finishAs, actionMode); } @@ -796,6 +1025,7 @@ public String toString() { sb.append("class Order {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" createTimeMs: ").append(toIndentedString(createTimeMs)).append("\n"); @@ -812,15 +1042,23 @@ public String toString() { sb.append(" autoBorrow: ").append(toIndentedString(autoBorrow)).append("\n"); sb.append(" autoRepay: ").append(toIndentedString(autoRepay)).append("\n"); sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append(" filledAmount: ").append(toIndentedString(filledAmount)).append("\n"); sb.append(" fillPrice: ").append(toIndentedString(fillPrice)).append("\n"); sb.append(" filledTotal: ").append(toIndentedString(filledTotal)).append("\n"); + sb.append(" avgDealPrice: ").append(toIndentedString(avgDealPrice)).append("\n"); sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" feeCurrency: ").append(toIndentedString(feeCurrency)).append("\n"); sb.append(" pointFee: ").append(toIndentedString(pointFee)).append("\n"); sb.append(" gtFee: ").append(toIndentedString(gtFee)).append("\n"); + sb.append(" gtMakerFee: ").append(toIndentedString(gtMakerFee)).append("\n"); + sb.append(" gtTakerFee: ").append(toIndentedString(gtTakerFee)).append("\n"); sb.append(" gtDiscount: ").append(toIndentedString(gtDiscount)).append("\n"); sb.append(" rebatedFee: ").append(toIndentedString(rebatedFee)).append("\n"); sb.append(" rebatedFeeCurrency: ").append(toIndentedString(rebatedFeeCurrency)).append("\n"); + sb.append(" stpId: ").append(toIndentedString(stpId)).append("\n"); + sb.append(" stpAct: ").append(toIndentedString(stpAct)).append("\n"); + sb.append(" finishAs: ").append(toIndentedString(finishAs)).append("\n"); + sb.append(" actionMode: ").append(toIndentedString(actionMode)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/OrderBook.java b/src/main/java/io/gate/gateapi/models/OrderBook.java index e7c0974..7eb383a 100644 --- a/src/main/java/io/gate/gateapi/models/OrderBook.java +++ b/src/main/java/io/gate/gateapi/models/OrderBook.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 @@ -118,7 +118,7 @@ public OrderBook addAsksItem(List asksItem) { } /** - * Asks order depth + * Ask Depth * @return asks **/ public List> getAsks() { @@ -142,7 +142,7 @@ public OrderBook addBidsItem(List bidsItem) { } /** - * Bids order depth + * Bid Depth * @return bids **/ public List> getBids() { diff --git a/src/main/java/io/gate/gateapi/models/OrderCancel.java b/src/main/java/io/gate/gateapi/models/OrderCancel.java new file mode 100644 index 0000000..63a6ada --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OrderCancel.java @@ -0,0 +1,1142 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Spot order details + */ +public class OrderCancel { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + public static final String SERIALIZED_NAME_SUCCEEDED = "succeeded"; + @SerializedName(SERIALIZED_NAME_SUCCEEDED) + private Boolean succeeded; + + public static final String SERIALIZED_NAME_LABEL = "label"; + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private String createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private String updateTime; + + public static final String SERIALIZED_NAME_CREATE_TIME_MS = "create_time_ms"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME_MS) + private Long createTimeMs; + + public static final String SERIALIZED_NAME_UPDATE_TIME_MS = "update_time_ms"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME_MS) + private Long updateTimeMs; + + /** + * Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + OPEN("open"), + + CLOSED("closed"), + + CANCELLED("cancelled"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + /** + * Order Type - limit : Limit Order - market : Market Order + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + LIMIT("limit"), + + MARKET("market"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.LIMIT; + + public static final String SERIALIZED_NAME_ACCOUNT = "account"; + @SerializedName(SERIALIZED_NAME_ACCOUNT) + private String account = "spot"; + + /** + * Buy or sell order + */ + @JsonAdapter(SideEnum.Adapter.class) + public enum SideEnum { + BUY("buy"), + + SELL("sell"); + + private String value; + + SideEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SideEnum fromValue(String value) { + for (SideEnum b : SideEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SideEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SideEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SideEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SIDE = "side"; + @SerializedName(SERIALIZED_NAME_SIDE) + private SideEnum side; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + /** + * 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` + */ + @JsonAdapter(TimeInForceEnum.Adapter.class) + public enum TimeInForceEnum { + GTC("gtc"), + + IOC("ioc"), + + POC("poc"), + + FOK("fok"); + + private String value; + + TimeInForceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TimeInForceEnum fromValue(String value) { + for (TimeInForceEnum b : TimeInForceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TimeInForceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TimeInForceEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "time_in_force"; + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + private TimeInForceEnum timeInForce = TimeInForceEnum.GTC; + + public static final String SERIALIZED_NAME_ICEBERG = "iceberg"; + @SerializedName(SERIALIZED_NAME_ICEBERG) + private String iceberg; + + public static final String SERIALIZED_NAME_AUTO_BORROW = "auto_borrow"; + @SerializedName(SERIALIZED_NAME_AUTO_BORROW) + private Boolean autoBorrow; + + public static final String SERIALIZED_NAME_AUTO_REPAY = "auto_repay"; + @SerializedName(SERIALIZED_NAME_AUTO_REPAY) + private Boolean autoRepay; + + public static final String SERIALIZED_NAME_LEFT = "left"; + @SerializedName(SERIALIZED_NAME_LEFT) + private String left; + + public static final String SERIALIZED_NAME_FILLED_AMOUNT = "filled_amount"; + @SerializedName(SERIALIZED_NAME_FILLED_AMOUNT) + private String filledAmount; + + public static final String SERIALIZED_NAME_FILL_PRICE = "fill_price"; + @SerializedName(SERIALIZED_NAME_FILL_PRICE) + private String fillPrice; + + public static final String SERIALIZED_NAME_FILLED_TOTAL = "filled_total"; + @SerializedName(SERIALIZED_NAME_FILLED_TOTAL) + private String filledTotal; + + public static final String SERIALIZED_NAME_AVG_DEAL_PRICE = "avg_deal_price"; + @SerializedName(SERIALIZED_NAME_AVG_DEAL_PRICE) + private String avgDealPrice; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_FEE_CURRENCY = "fee_currency"; + @SerializedName(SERIALIZED_NAME_FEE_CURRENCY) + private String feeCurrency; + + public static final String SERIALIZED_NAME_POINT_FEE = "point_fee"; + @SerializedName(SERIALIZED_NAME_POINT_FEE) + private String pointFee; + + public static final String SERIALIZED_NAME_GT_FEE = "gt_fee"; + @SerializedName(SERIALIZED_NAME_GT_FEE) + private String gtFee; + + public static final String SERIALIZED_NAME_GT_MAKER_FEE = "gt_maker_fee"; + @SerializedName(SERIALIZED_NAME_GT_MAKER_FEE) + private String gtMakerFee; + + public static final String SERIALIZED_NAME_GT_TAKER_FEE = "gt_taker_fee"; + @SerializedName(SERIALIZED_NAME_GT_TAKER_FEE) + private String gtTakerFee; + + public static final String SERIALIZED_NAME_GT_DISCOUNT = "gt_discount"; + @SerializedName(SERIALIZED_NAME_GT_DISCOUNT) + private Boolean gtDiscount; + + public static final String SERIALIZED_NAME_REBATED_FEE = "rebated_fee"; + @SerializedName(SERIALIZED_NAME_REBATED_FEE) + private String rebatedFee; + + public static final String SERIALIZED_NAME_REBATED_FEE_CURRENCY = "rebated_fee_currency"; + @SerializedName(SERIALIZED_NAME_REBATED_FEE_CURRENCY) + private String rebatedFeeCurrency; + + public static final String SERIALIZED_NAME_STP_ID = "stp_id"; + @SerializedName(SERIALIZED_NAME_STP_ID) + private Integer stpId; + + /** + * 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 + */ + @JsonAdapter(StpActEnum.Adapter.class) + public enum StpActEnum { + CN("cn"), + + CO("co"), + + CB("cb"), + + MINUS("-"); + + private String value; + + StpActEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StpActEnum fromValue(String value) { + for (StpActEnum b : StpActEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StpActEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StpActEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StpActEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STP_ACT = "stp_act"; + @SerializedName(SERIALIZED_NAME_STP_ACT) + private StpActEnum stpAct; + + /** + * 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 + */ + @JsonAdapter(FinishAsEnum.Adapter.class) + public enum FinishAsEnum { + OPEN("open"), + + FILLED("filled"), + + CANCELLED("cancelled"), + + IOC("ioc"), + + STP("stp"); + + private String value; + + FinishAsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FinishAsEnum fromValue(String value) { + for (FinishAsEnum b : FinishAsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FinishAsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FinishAsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FinishAsEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_FINISH_AS = "finish_as"; + @SerializedName(SERIALIZED_NAME_FINISH_AS) + private FinishAsEnum finishAs; + + public static final String SERIALIZED_NAME_ACTION_MODE = "action_mode"; + @SerializedName(SERIALIZED_NAME_ACTION_MODE) + private String actionMode; + + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + public OrderCancel text(String text) { + + this.text = text; + return this; + } + + /** + * 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 + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + /** + * The custom data that the user remarked when amending the order + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public OrderCancel succeeded(Boolean succeeded) { + + this.succeeded = succeeded; + return this; + } + + /** + * Request execution result + * @return succeeded + **/ + @javax.annotation.Nullable + public Boolean getSucceeded() { + return succeeded; + } + + + public void setSucceeded(Boolean succeeded) { + this.succeeded = succeeded; + } + + public OrderCancel label(String label) { + + this.label = label; + return this; + } + + /** + * Error label, if any, otherwise an empty string + * @return label + **/ + @javax.annotation.Nullable + public String getLabel() { + return label; + } + + + public void setLabel(String label) { + this.label = label; + } + + public OrderCancel message(String message) { + + this.message = message; + return this; + } + + /** + * Detailed error message, if any, otherwise an empty string + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + /** + * Creation time of order + * @return createTime + **/ + @javax.annotation.Nullable + public String getCreateTime() { + return createTime; + } + + + /** + * Last modification time of order + * @return updateTime + **/ + @javax.annotation.Nullable + public String getUpdateTime() { + return updateTime; + } + + + /** + * Creation time of order (in milliseconds) + * @return createTimeMs + **/ + @javax.annotation.Nullable + public Long getCreateTimeMs() { + return createTimeMs; + } + + + /** + * Last modification time of order (in milliseconds) + * @return updateTimeMs + **/ + @javax.annotation.Nullable + public Long getUpdateTimeMs() { + return updateTimeMs; + } + + + /** + * Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled + * @return status + **/ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + + public OrderCancel currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public OrderCancel type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Order Type - limit : Limit Order - market : Market Order + * @return type + **/ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + public OrderCancel account(String account) { + + this.account = account; + return this; + } + + /** + * Account type, spot - spot account, margin - leveraged account, unified - unified account + * @return account + **/ + @javax.annotation.Nullable + public String getAccount() { + return account; + } + + + public void setAccount(String account) { + this.account = account; + } + + public OrderCancel side(SideEnum side) { + + this.side = side; + return this; + } + + /** + * Buy or sell order + * @return side + **/ + public SideEnum getSide() { + return side; + } + + + public void setSide(SideEnum side) { + this.side = side; + } + + public OrderCancel amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * 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` + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public OrderCancel price(String price) { + + this.price = price; + return this; + } + + /** + * Trading price, required when `type`=`limit` + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public OrderCancel timeInForce(TimeInForceEnum timeInForce) { + + this.timeInForce = timeInForce; + return this; + } + + /** + * 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` + * @return timeInForce + **/ + @javax.annotation.Nullable + public TimeInForceEnum getTimeInForce() { + return timeInForce; + } + + + public void setTimeInForce(TimeInForceEnum timeInForce) { + this.timeInForce = timeInForce; + } + + public OrderCancel iceberg(String iceberg) { + + this.iceberg = iceberg; + return this; + } + + /** + * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported + * @return iceberg + **/ + @javax.annotation.Nullable + public String getIceberg() { + return iceberg; + } + + + public void setIceberg(String iceberg) { + this.iceberg = iceberg; + } + + public OrderCancel autoBorrow(Boolean autoBorrow) { + + this.autoBorrow = autoBorrow; + return this; + } + + /** + * Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough + * @return autoBorrow + **/ + @javax.annotation.Nullable + public Boolean getAutoBorrow() { + return autoBorrow; + } + + + public void setAutoBorrow(Boolean autoBorrow) { + this.autoBorrow = autoBorrow; + } + + public OrderCancel autoRepay(Boolean autoRepay) { + + this.autoRepay = autoRepay; + return this; + } + + /** + * 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 + * @return autoRepay + **/ + @javax.annotation.Nullable + public Boolean getAutoRepay() { + return autoRepay; + } + + + public void setAutoRepay(Boolean autoRepay) { + this.autoRepay = autoRepay; + } + + /** + * Amount left to fill + * @return left + **/ + @javax.annotation.Nullable + public String getLeft() { + return left; + } + + + /** + * Amount filled + * @return filledAmount + **/ + @javax.annotation.Nullable + public String getFilledAmount() { + return filledAmount; + } + + + /** + * Total filled in quote currency. Deprecated in favor of `filled_total` + * @return fillPrice + **/ + @javax.annotation.Nullable + public String getFillPrice() { + return fillPrice; + } + + + /** + * Total filled in quote currency + * @return filledTotal + **/ + @javax.annotation.Nullable + public String getFilledTotal() { + return filledTotal; + } + + + /** + * Average fill price + * @return avgDealPrice + **/ + @javax.annotation.Nullable + public String getAvgDealPrice() { + return avgDealPrice; + } + + + /** + * Fee deducted + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + /** + * Fee currency unit + * @return feeCurrency + **/ + @javax.annotation.Nullable + public String getFeeCurrency() { + return feeCurrency; + } + + + /** + * Points used to deduct fee + * @return pointFee + **/ + @javax.annotation.Nullable + public String getPointFee() { + return pointFee; + } + + + /** + * GT used to deduct fee + * @return gtFee + **/ + @javax.annotation.Nullable + public String getGtFee() { + return gtFee; + } + + + /** + * GT amount used to deduct maker fee + * @return gtMakerFee + **/ + @javax.annotation.Nullable + public String getGtMakerFee() { + return gtMakerFee; + } + + + /** + * GT amount used to deduct taker fee + * @return gtTakerFee + **/ + @javax.annotation.Nullable + public String getGtTakerFee() { + return gtTakerFee; + } + + + /** + * Whether GT fee deduction is enabled + * @return gtDiscount + **/ + @javax.annotation.Nullable + public Boolean getGtDiscount() { + return gtDiscount; + } + + + /** + * Rebated fee + * @return rebatedFee + **/ + @javax.annotation.Nullable + public String getRebatedFee() { + return rebatedFee; + } + + + /** + * Rebated fee currency unit + * @return rebatedFeeCurrency + **/ + @javax.annotation.Nullable + public String getRebatedFeeCurrency() { + return rebatedFeeCurrency; + } + + + /** + * 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` + * @return stpId + **/ + @javax.annotation.Nullable + public Integer getStpId() { + return stpId; + } + + + public OrderCancel stpAct(StpActEnum stpAct) { + + this.stpAct = stpAct; + return this; + } + + /** + * 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 + * @return stpAct + **/ + @javax.annotation.Nullable + public StpActEnum getStpAct() { + return stpAct; + } + + + public void setStpAct(StpActEnum stpAct) { + this.stpAct = stpAct; + } + + /** + * 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 + * @return finishAs + **/ + @javax.annotation.Nullable + public FinishAsEnum getFinishAs() { + return finishAs; + } + + + public OrderCancel actionMode(String actionMode) { + + this.actionMode = actionMode; + return this; + } + + /** + * 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) + * @return actionMode + **/ + @javax.annotation.Nullable + public String getActionMode() { + return actionMode; + } + + + public void setActionMode(String actionMode) { + this.actionMode = actionMode; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderCancel orderCancel = (OrderCancel) o; + return Objects.equals(this.id, orderCancel.id) && + Objects.equals(this.text, orderCancel.text) && + Objects.equals(this.amendText, orderCancel.amendText) && + Objects.equals(this.succeeded, orderCancel.succeeded) && + Objects.equals(this.label, orderCancel.label) && + Objects.equals(this.message, orderCancel.message) && + Objects.equals(this.createTime, orderCancel.createTime) && + Objects.equals(this.updateTime, orderCancel.updateTime) && + Objects.equals(this.createTimeMs, orderCancel.createTimeMs) && + Objects.equals(this.updateTimeMs, orderCancel.updateTimeMs) && + Objects.equals(this.status, orderCancel.status) && + Objects.equals(this.currencyPair, orderCancel.currencyPair) && + Objects.equals(this.type, orderCancel.type) && + Objects.equals(this.account, orderCancel.account) && + Objects.equals(this.side, orderCancel.side) && + Objects.equals(this.amount, orderCancel.amount) && + Objects.equals(this.price, orderCancel.price) && + Objects.equals(this.timeInForce, orderCancel.timeInForce) && + Objects.equals(this.iceberg, orderCancel.iceberg) && + Objects.equals(this.autoBorrow, orderCancel.autoBorrow) && + Objects.equals(this.autoRepay, orderCancel.autoRepay) && + Objects.equals(this.left, orderCancel.left) && + Objects.equals(this.filledAmount, orderCancel.filledAmount) && + Objects.equals(this.fillPrice, orderCancel.fillPrice) && + Objects.equals(this.filledTotal, orderCancel.filledTotal) && + Objects.equals(this.avgDealPrice, orderCancel.avgDealPrice) && + Objects.equals(this.fee, orderCancel.fee) && + Objects.equals(this.feeCurrency, orderCancel.feeCurrency) && + Objects.equals(this.pointFee, orderCancel.pointFee) && + Objects.equals(this.gtFee, orderCancel.gtFee) && + Objects.equals(this.gtMakerFee, orderCancel.gtMakerFee) && + Objects.equals(this.gtTakerFee, orderCancel.gtTakerFee) && + Objects.equals(this.gtDiscount, orderCancel.gtDiscount) && + Objects.equals(this.rebatedFee, orderCancel.rebatedFee) && + Objects.equals(this.rebatedFeeCurrency, orderCancel.rebatedFeeCurrency) && + Objects.equals(this.stpId, orderCancel.stpId) && + Objects.equals(this.stpAct, orderCancel.stpAct) && + Objects.equals(this.finishAs, orderCancel.finishAs) && + Objects.equals(this.actionMode, orderCancel.actionMode); + } + + @Override + public int hashCode() { + return Objects.hash(id, text, amendText, succeeded, label, message, createTime, updateTime, createTimeMs, updateTimeMs, status, currencyPair, type, account, side, amount, price, timeInForce, iceberg, autoBorrow, autoRepay, left, filledAmount, fillPrice, filledTotal, avgDealPrice, fee, feeCurrency, pointFee, gtFee, gtMakerFee, gtTakerFee, gtDiscount, rebatedFee, rebatedFeeCurrency, stpId, stpAct, finishAs, actionMode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderCancel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" createTimeMs: ").append(toIndentedString(createTimeMs)).append("\n"); + sb.append(" updateTimeMs: ").append(toIndentedString(updateTimeMs)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" iceberg: ").append(toIndentedString(iceberg)).append("\n"); + sb.append(" autoBorrow: ").append(toIndentedString(autoBorrow)).append("\n"); + sb.append(" autoRepay: ").append(toIndentedString(autoRepay)).append("\n"); + sb.append(" left: ").append(toIndentedString(left)).append("\n"); + sb.append(" filledAmount: ").append(toIndentedString(filledAmount)).append("\n"); + sb.append(" fillPrice: ").append(toIndentedString(fillPrice)).append("\n"); + sb.append(" filledTotal: ").append(toIndentedString(filledTotal)).append("\n"); + sb.append(" avgDealPrice: ").append(toIndentedString(avgDealPrice)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" feeCurrency: ").append(toIndentedString(feeCurrency)).append("\n"); + sb.append(" pointFee: ").append(toIndentedString(pointFee)).append("\n"); + sb.append(" gtFee: ").append(toIndentedString(gtFee)).append("\n"); + sb.append(" gtMakerFee: ").append(toIndentedString(gtMakerFee)).append("\n"); + sb.append(" gtTakerFee: ").append(toIndentedString(gtTakerFee)).append("\n"); + sb.append(" gtDiscount: ").append(toIndentedString(gtDiscount)).append("\n"); + sb.append(" rebatedFee: ").append(toIndentedString(rebatedFee)).append("\n"); + sb.append(" rebatedFeeCurrency: ").append(toIndentedString(rebatedFeeCurrency)).append("\n"); + sb.append(" stpId: ").append(toIndentedString(stpId)).append("\n"); + sb.append(" stpAct: ").append(toIndentedString(stpAct)).append("\n"); + sb.append(" finishAs: ").append(toIndentedString(finishAs)).append("\n"); + sb.append(" actionMode: ").append(toIndentedString(actionMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OrderPatch.java b/src/main/java/io/gate/gateapi/models/OrderPatch.java new file mode 100644 index 0000000..da8eeb3 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OrderPatch.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Spot order details + */ +public class OrderPatch { + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_ACCOUNT = "account"; + @SerializedName(SERIALIZED_NAME_ACCOUNT) + private String account; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; + + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + public static final String SERIALIZED_NAME_ACTION_MODE = "action_mode"; + @SerializedName(SERIALIZED_NAME_ACTION_MODE) + private String actionMode; + + + public OrderPatch currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public OrderPatch account(String account) { + + this.account = account; + return this; + } + + /** + * Specify query account + * @return account + **/ + @javax.annotation.Nullable + public String getAccount() { + return account; + } + + + public void setAccount(String account) { + this.account = account; + } + + public OrderPatch amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Trading quantity. Either `amount` or `price` must be specified + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public OrderPatch price(String price) { + + this.price = price; + return this; + } + + /** + * Trading price. Either `amount` or `price` must be specified + * @return price + **/ + @javax.annotation.Nullable + public String getPrice() { + return price; + } + + + public void setPrice(String price) { + this.price = price; + } + + public OrderPatch amendText(String amendText) { + + this.amendText = amendText; + return this; + } + + /** + * Custom info during order amendment + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public void setAmendText(String amendText) { + this.amendText = amendText; + } + + public OrderPatch actionMode(String actionMode) { + + this.actionMode = actionMode; + return this; + } + + /** + * 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) + * @return actionMode + **/ + @javax.annotation.Nullable + public String getActionMode() { + return actionMode; + } + + + public void setActionMode(String actionMode) { + this.actionMode = actionMode; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderPatch orderPatch = (OrderPatch) o; + return Objects.equals(this.currencyPair, orderPatch.currencyPair) && + Objects.equals(this.account, orderPatch.account) && + Objects.equals(this.amount, orderPatch.amount) && + Objects.equals(this.price, orderPatch.price) && + Objects.equals(this.amendText, orderPatch.amendText) && + Objects.equals(this.actionMode, orderPatch.actionMode); + } + + @Override + public int hashCode() { + return Objects.hash(currencyPair, account, amount, price, amendText, actionMode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderPatch {\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append(" actionMode: ").append(toIndentedString(actionMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/OrderResp.java b/src/main/java/io/gate/gateapi/models/OrderResp.java new file mode 100644 index 0000000..024ca14 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/OrderResp.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * OrderResp + */ +public class OrderResp { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + + public OrderResp orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderResp orderResp = (OrderResp) o; + return Objects.equals(this.orderId, orderResp.orderId); + } + + @Override + public int hashCode() { + return Objects.hash(orderId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderResp {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/PartnerCommissionHistory.java b/src/main/java/io/gate/gateapi/models/PartnerCommissionHistory.java new file mode 100644 index 0000000..ee4d1d9 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/PartnerCommissionHistory.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.AgencyCommission; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * PartnerCommissionHistory + */ +public class PartnerCommissionHistory { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public PartnerCommissionHistory total(Long total) { + + this.total = total; + return this; + } + + /** + * Total + * @return total + **/ + @javax.annotation.Nullable + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + public PartnerCommissionHistory list(List list) { + + this.list = list; + return this; + } + + public PartnerCommissionHistory addListItem(AgencyCommission listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * List of commission history + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartnerCommissionHistory partnerCommissionHistory = (PartnerCommissionHistory) o; + return Objects.equals(this.total, partnerCommissionHistory.total) && + Objects.equals(this.list, partnerCommissionHistory.list); + } + + @Override + public int hashCode() { + return Objects.hash(total, list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PartnerCommissionHistory {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/PartnerSub.java b/src/main/java/io/gate/gateapi/models/PartnerSub.java new file mode 100644 index 0000000..0a823f9 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/PartnerSub.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * PartnerSub + */ +public class PartnerSub { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_USER_JOIN_TIME = "user_join_time"; + @SerializedName(SERIALIZED_NAME_USER_JOIN_TIME) + private Long userJoinTime; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Long type; + + + public PartnerSub userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public PartnerSub userJoinTime(Long userJoinTime) { + + this.userJoinTime = userJoinTime; + return this; + } + + /** + * Time when user joined the system, Unix timestamp in seconds + * @return userJoinTime + **/ + @javax.annotation.Nullable + public Long getUserJoinTime() { + return userJoinTime; + } + + + public void setUserJoinTime(Long userJoinTime) { + this.userJoinTime = userJoinTime; + } + + public PartnerSub type(Long type) { + + this.type = type; + return this; + } + + /** + * Type (1-Sub-agent 2-Indirect direct customer 3-Direct direct customer) + * @return type + **/ + @javax.annotation.Nullable + public Long getType() { + return type; + } + + + public void setType(Long type) { + this.type = type; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartnerSub partnerSub = (PartnerSub) o; + return Objects.equals(this.userId, partnerSub.userId) && + Objects.equals(this.userJoinTime, partnerSub.userJoinTime) && + Objects.equals(this.type, partnerSub.type); + } + + @Override + public int hashCode() { + return Objects.hash(userId, userJoinTime, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PartnerSub {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userJoinTime: ").append(toIndentedString(userJoinTime)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/PartnerSubList.java b/src/main/java/io/gate/gateapi/models/PartnerSubList.java new file mode 100644 index 0000000..d316678 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/PartnerSubList.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.PartnerSub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * PartnerSubList + */ +public class PartnerSubList { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public PartnerSubList total(Long total) { + + this.total = total; + return this; + } + + /** + * Total + * @return total + **/ + @javax.annotation.Nullable + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + public PartnerSubList list(List list) { + + this.list = list; + return this; + } + + public PartnerSubList addListItem(PartnerSub listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * Subordinate list + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartnerSubList partnerSubList = (PartnerSubList) o; + return Objects.equals(this.total, partnerSubList.total) && + Objects.equals(this.list, partnerSubList.list); + } + + @Override + public int hashCode() { + return Objects.hash(total, list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PartnerSubList {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/PartnerTransactionHistory.java b/src/main/java/io/gate/gateapi/models/PartnerTransactionHistory.java new file mode 100644 index 0000000..0562ee3 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/PartnerTransactionHistory.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.AgencyTransaction; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * PartnerTransactionHistory + */ +public class PartnerTransactionHistory { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public PartnerTransactionHistory total(Long total) { + + this.total = total; + return this; + } + + /** + * Total + * @return total + **/ + @javax.annotation.Nullable + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + public PartnerTransactionHistory list(List list) { + + this.list = list; + return this; + } + + public PartnerTransactionHistory addListItem(AgencyTransaction listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * List of transaction history + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartnerTransactionHistory partnerTransactionHistory = (PartnerTransactionHistory) o; + return Objects.equals(this.total, partnerTransactionHistory.total) && + Objects.equals(this.list, partnerTransactionHistory.list); + } + + @Override + public int hashCode() { + return Objects.hash(total, list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PartnerTransactionHistory {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/PatchUniLend.java b/src/main/java/io/gate/gateapi/models/PatchUniLend.java new file mode 100644 index 0000000..5015c6b --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/PatchUniLend.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * PatchUniLend + */ +public class PatchUniLend { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_MIN_RATE = "min_rate"; + @SerializedName(SERIALIZED_NAME_MIN_RATE) + private String minRate; + + + public PatchUniLend currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public PatchUniLend minRate(String minRate) { + + this.minRate = minRate; + return this; + } + + /** + * Minimum interest rate + * @return minRate + **/ + @javax.annotation.Nullable + public String getMinRate() { + return minRate; + } + + + public void setMinRate(String minRate) { + this.minRate = minRate; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchUniLend patchUniLend = (PatchUniLend) o; + return Objects.equals(this.currency, patchUniLend.currency) && + Objects.equals(this.minRate, patchUniLend.minRate); + } + + @Override + public int hashCode() { + return Objects.hash(currency, minRate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchUniLend {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" minRate: ").append(toIndentedString(minRate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/PlaceDualInvestmentOrder.java b/src/main/java/io/gate/gateapi/models/PlaceDualInvestmentOrder.java new file mode 100644 index 0000000..5fdd9da --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/PlaceDualInvestmentOrder.java @@ -0,0 +1,139 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Dual Investment Order + */ +public class PlaceDualInvestmentOrder { + public static final String SERIALIZED_NAME_PLAN_ID = "plan_id"; + @SerializedName(SERIALIZED_NAME_PLAN_ID) + private String planId; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + + public PlaceDualInvestmentOrder planId(String planId) { + + this.planId = planId; + return this; + } + + /** + * Product ID + * @return planId + **/ + public String getPlanId() { + return planId; + } + + + public void setPlanId(String planId) { + this.planId = planId; + } + + public PlaceDualInvestmentOrder amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Subscription amount, mutually exclusive with copies field + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public PlaceDualInvestmentOrder text(String text) { + + this.text = text; + return this; + } + + /** + * 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(.) + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaceDualInvestmentOrder placeDualInvestmentOrder = (PlaceDualInvestmentOrder) o; + return Objects.equals(this.planId, placeDualInvestmentOrder.planId) && + Objects.equals(this.amount, placeDualInvestmentOrder.amount) && + Objects.equals(this.text, placeDualInvestmentOrder.text); + } + + @Override + public int hashCode() { + return Objects.hash(planId, amount, text); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaceDualInvestmentOrder {\n"); + sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/Position.java b/src/main/java/io/gate/gateapi/models/Position.java index 949d6ae..ea48a8b 100644 --- a/src/main/java/io/gate/gateapi/models/Position.java +++ b/src/main/java/io/gate/gateapi/models/Position.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 @@ -72,6 +72,14 @@ public class Position { @SerializedName(SERIALIZED_NAME_MARK_PRICE) private String markPrice; + public static final String SERIALIZED_NAME_INITIAL_MARGIN = "initial_margin"; + @SerializedName(SERIALIZED_NAME_INITIAL_MARGIN) + private String initialMargin; + + public static final String SERIALIZED_NAME_MAINTENANCE_MARGIN = "maintenance_margin"; + @SerializedName(SERIALIZED_NAME_MAINTENANCE_MARGIN) + private String maintenanceMargin; + public static final String SERIALIZED_NAME_UNREALISED_PNL = "unrealised_pnl"; @SerializedName(SERIALIZED_NAME_UNREALISED_PNL) private String unrealisedPnl; @@ -80,6 +88,18 @@ public class Position { @SerializedName(SERIALIZED_NAME_REALISED_PNL) private String realisedPnl; + public static final String SERIALIZED_NAME_PNL_PNL = "pnl_pnl"; + @SerializedName(SERIALIZED_NAME_PNL_PNL) + private String pnlPnl; + + public static final String SERIALIZED_NAME_PNL_FUND = "pnl_fund"; + @SerializedName(SERIALIZED_NAME_PNL_FUND) + private String pnlFund; + + public static final String SERIALIZED_NAME_PNL_FEE = "pnl_fee"; + @SerializedName(SERIALIZED_NAME_PNL_FEE) + private String pnlFee; + public static final String SERIALIZED_NAME_HISTORY_PNL = "history_pnl"; @SerializedName(SERIALIZED_NAME_HISTORY_PNL) private String historyPnl; @@ -109,7 +129,7 @@ public class Position { private PositionCloseOrder closeOrder; /** - * Position mode, including: - `single`: dual mode is not enabled- `dual_long`: long position in dual mode- `dual_short`: short position in dual mode + * Position mode, including: - `single`: Single position mode - `dual_long`: Long position in dual position mode - `dual_short`: Short position in dual position mode */ @JsonAdapter(ModeEnum.Adapter.class) public enum ModeEnum { @@ -165,6 +185,30 @@ public ModeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CROSS_LEVERAGE_LIMIT) private String crossLeverageLimit; + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private Long updateTime; + + public static final String SERIALIZED_NAME_UPDATE_ID = "update_id"; + @SerializedName(SERIALIZED_NAME_UPDATE_ID) + private Long updateId; + + public static final String SERIALIZED_NAME_OPEN_TIME = "open_time"; + @SerializedName(SERIALIZED_NAME_OPEN_TIME) + private Long openTime; + + public static final String SERIALIZED_NAME_RISK_LIMIT_TABLE = "risk_limit_table"; + @SerializedName(SERIALIZED_NAME_RISK_LIMIT_TABLE) + private String riskLimitTable; + + public static final String SERIALIZED_NAME_AVERAGE_MAINTENANCE_RATE = "average_maintenance_rate"; + @SerializedName(SERIALIZED_NAME_AVERAGE_MAINTENANCE_RATE) + private String averageMaintenanceRate; + + public static final String SERIALIZED_NAME_PID = "pid"; + @SerializedName(SERIALIZED_NAME_PID) + private Long pid; + /** * User ID @@ -316,6 +360,26 @@ public String getMarkPrice() { } + /** + * The initial margin occupied by the position, applicable to the portfolio margin account + * @return initialMargin + **/ + @javax.annotation.Nullable + public String getInitialMargin() { + return initialMargin; + } + + + /** + * Maintenance margin required for the position, applicable to portfolio margin account + * @return maintenanceMargin + **/ + @javax.annotation.Nullable + public String getMaintenanceMargin() { + return maintenanceMargin; + } + + /** * Unrealized PNL * @return unrealisedPnl @@ -327,7 +391,7 @@ public String getUnrealisedPnl() { /** - * Realized PNL + * Realized PnL * @return realisedPnl **/ @javax.annotation.Nullable @@ -337,7 +401,37 @@ public String getRealisedPnl() { /** - * History realized PNL + * Realized PNL - Position P/L + * @return pnlPnl + **/ + @javax.annotation.Nullable + public String getPnlPnl() { + return pnlPnl; + } + + + /** + * Realized PNL - Funding Fees + * @return pnlFund + **/ + @javax.annotation.Nullable + public String getPnlFund() { + return pnlFund; + } + + + /** + * Realized PNL - Transaction Fees + * @return pnlFee + **/ + @javax.annotation.Nullable + public String getPnlFee() { + return pnlFee; + } + + + /** + * Total realized PnL from closed positions * @return historyPnl **/ @javax.annotation.Nullable @@ -377,7 +471,7 @@ public String getHistoryPoint() { /** - * ADL ranking, ranging from 1 to 5 + * 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 * @return adlRanking **/ @javax.annotation.Nullable @@ -387,7 +481,7 @@ public Integer getAdlRanking() { /** - * Current open orders + * Current pending order quantity * @return pendingOrders **/ @javax.annotation.Nullable @@ -423,7 +517,7 @@ public Position mode(ModeEnum mode) { } /** - * Position mode, including: - `single`: dual mode is not enabled- `dual_long`: long position in dual mode- `dual_short`: short position in dual mode + * Position mode, including: - `single`: Single position mode - `dual_long`: Long position in dual position mode - `dual_short`: Short position in dual position mode * @return mode **/ @javax.annotation.Nullable @@ -443,7 +537,7 @@ public Position crossLeverageLimit(String crossLeverageLimit) { } /** - * Cross margin leverage(valid only when `leverage` is 0) + * Cross margin leverage (valid only when `leverage` is 0) * @return crossLeverageLimit **/ @javax.annotation.Nullable @@ -455,6 +549,76 @@ public String getCrossLeverageLimit() { public void setCrossLeverageLimit(String crossLeverageLimit) { this.crossLeverageLimit = crossLeverageLimit; } + + /** + * Last update time + * @return updateTime + **/ + @javax.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + + /** + * Update ID. The value increments by 1 each time the position is updated + * @return updateId + **/ + @javax.annotation.Nullable + public Long getUpdateId() { + return updateId; + } + + + public Position openTime(Long openTime) { + + this.openTime = openTime; + return this; + } + + /** + * First Open Time + * @return openTime + **/ + @javax.annotation.Nullable + public Long getOpenTime() { + return openTime; + } + + + public void setOpenTime(Long openTime) { + this.openTime = openTime; + } + + /** + * Risk limit table ID + * @return riskLimitTable + **/ + @javax.annotation.Nullable + public String getRiskLimitTable() { + return riskLimitTable; + } + + + /** + * Average maintenance margin rate + * @return averageMaintenanceRate + **/ + @javax.annotation.Nullable + public String getAverageMaintenanceRate() { + return averageMaintenanceRate; + } + + + /** + * Sub-account position ID + * @return pid + **/ + @javax.annotation.Nullable + public Long getPid() { + return pid; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -476,8 +640,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.entryPrice, position.entryPrice) && Objects.equals(this.liqPrice, position.liqPrice) && Objects.equals(this.markPrice, position.markPrice) && + Objects.equals(this.initialMargin, position.initialMargin) && + Objects.equals(this.maintenanceMargin, position.maintenanceMargin) && Objects.equals(this.unrealisedPnl, position.unrealisedPnl) && Objects.equals(this.realisedPnl, position.realisedPnl) && + Objects.equals(this.pnlPnl, position.pnlPnl) && + Objects.equals(this.pnlFund, position.pnlFund) && + Objects.equals(this.pnlFee, position.pnlFee) && Objects.equals(this.historyPnl, position.historyPnl) && Objects.equals(this.lastClosePnl, position.lastClosePnl) && Objects.equals(this.realisedPoint, position.realisedPoint) && @@ -486,12 +655,18 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.pendingOrders, position.pendingOrders) && Objects.equals(this.closeOrder, position.closeOrder) && Objects.equals(this.mode, position.mode) && - Objects.equals(this.crossLeverageLimit, position.crossLeverageLimit); + Objects.equals(this.crossLeverageLimit, position.crossLeverageLimit) && + Objects.equals(this.updateTime, position.updateTime) && + Objects.equals(this.updateId, position.updateId) && + Objects.equals(this.openTime, position.openTime) && + Objects.equals(this.riskLimitTable, position.riskLimitTable) && + Objects.equals(this.averageMaintenanceRate, position.averageMaintenanceRate) && + Objects.equals(this.pid, position.pid); } @Override public int hashCode() { - return Objects.hash(user, contract, size, leverage, riskLimit, leverageMax, maintenanceRate, value, margin, entryPrice, liqPrice, markPrice, unrealisedPnl, realisedPnl, historyPnl, lastClosePnl, realisedPoint, historyPoint, adlRanking, pendingOrders, closeOrder, mode, crossLeverageLimit); + return Objects.hash(user, contract, size, leverage, riskLimit, leverageMax, maintenanceRate, value, margin, entryPrice, liqPrice, markPrice, initialMargin, maintenanceMargin, unrealisedPnl, realisedPnl, pnlPnl, pnlFund, pnlFee, historyPnl, lastClosePnl, realisedPoint, historyPoint, adlRanking, pendingOrders, closeOrder, mode, crossLeverageLimit, updateTime, updateId, openTime, riskLimitTable, averageMaintenanceRate, pid); } @@ -511,8 +686,13 @@ public String toString() { sb.append(" entryPrice: ").append(toIndentedString(entryPrice)).append("\n"); sb.append(" liqPrice: ").append(toIndentedString(liqPrice)).append("\n"); sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); + sb.append(" initialMargin: ").append(toIndentedString(initialMargin)).append("\n"); + sb.append(" maintenanceMargin: ").append(toIndentedString(maintenanceMargin)).append("\n"); sb.append(" unrealisedPnl: ").append(toIndentedString(unrealisedPnl)).append("\n"); sb.append(" realisedPnl: ").append(toIndentedString(realisedPnl)).append("\n"); + sb.append(" pnlPnl: ").append(toIndentedString(pnlPnl)).append("\n"); + sb.append(" pnlFund: ").append(toIndentedString(pnlFund)).append("\n"); + sb.append(" pnlFee: ").append(toIndentedString(pnlFee)).append("\n"); sb.append(" historyPnl: ").append(toIndentedString(historyPnl)).append("\n"); sb.append(" lastClosePnl: ").append(toIndentedString(lastClosePnl)).append("\n"); sb.append(" realisedPoint: ").append(toIndentedString(realisedPoint)).append("\n"); @@ -522,6 +702,12 @@ public String toString() { sb.append(" closeOrder: ").append(toIndentedString(closeOrder)).append("\n"); sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); sb.append(" crossLeverageLimit: ").append(toIndentedString(crossLeverageLimit)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" updateId: ").append(toIndentedString(updateId)).append("\n"); + sb.append(" openTime: ").append(toIndentedString(openTime)).append("\n"); + sb.append(" riskLimitTable: ").append(toIndentedString(riskLimitTable)).append("\n"); + sb.append(" averageMaintenanceRate: ").append(toIndentedString(averageMaintenanceRate)).append("\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/PositionClose.java b/src/main/java/io/gate/gateapi/models/PositionClose.java index 1db595d..aacd6a0 100644 --- a/src/main/java/io/gate/gateapi/models/PositionClose.java +++ b/src/main/java/io/gate/gateapi/models/PositionClose.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 @@ -32,7 +32,7 @@ public class PositionClose { private String contract; /** - * Position side, long or short + * Position side - `long`: Long position - `short`: Short position */ @JsonAdapter(SideEnum.Adapter.class) public enum SideEnum { @@ -86,10 +86,42 @@ public SideEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_PNL) private String pnl; + public static final String SERIALIZED_NAME_PNL_PNL = "pnl_pnl"; + @SerializedName(SERIALIZED_NAME_PNL_PNL) + private String pnlPnl; + + public static final String SERIALIZED_NAME_PNL_FUND = "pnl_fund"; + @SerializedName(SERIALIZED_NAME_PNL_FUND) + private String pnlFund; + + public static final String SERIALIZED_NAME_PNL_FEE = "pnl_fee"; + @SerializedName(SERIALIZED_NAME_PNL_FEE) + private String pnlFee; + public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) private String text; + public static final String SERIALIZED_NAME_MAX_SIZE = "max_size"; + @SerializedName(SERIALIZED_NAME_MAX_SIZE) + private String maxSize; + + public static final String SERIALIZED_NAME_ACCUM_SIZE = "accum_size"; + @SerializedName(SERIALIZED_NAME_ACCUM_SIZE) + private String accumSize; + + public static final String SERIALIZED_NAME_FIRST_OPEN_TIME = "first_open_time"; + @SerializedName(SERIALIZED_NAME_FIRST_OPEN_TIME) + private Long firstOpenTime; + + public static final String SERIALIZED_NAME_LONG_PRICE = "long_price"; + @SerializedName(SERIALIZED_NAME_LONG_PRICE) + private String longPrice; + + public static final String SERIALIZED_NAME_SHORT_PRICE = "short_price"; + @SerializedName(SERIALIZED_NAME_SHORT_PRICE) + private String shortPrice; + /** * Position close time @@ -112,7 +144,7 @@ public String getContract() { /** - * Position side, long or short + * Position side - `long`: Long position - `short`: Short position * @return side **/ @javax.annotation.Nullable @@ -122,7 +154,7 @@ public SideEnum getSide() { /** - * PNL + * PnL * @return pnl **/ @javax.annotation.Nullable @@ -132,7 +164,37 @@ public String getPnl() { /** - * Text of close order + * PNL - Position P/L + * @return pnlPnl + **/ + @javax.annotation.Nullable + public String getPnlPnl() { + return pnlPnl; + } + + + /** + * PNL - Funding Fees + * @return pnlFund + **/ + @javax.annotation.Nullable + public String getPnlFund() { + return pnlFund; + } + + + /** + * PNL - Transaction Fees + * @return pnlFee + **/ + @javax.annotation.Nullable + public String getPnlFee() { + return pnlFee; + } + + + /** + * Source of close order. See `order.text` field for specific values * @return text **/ @javax.annotation.Nullable @@ -140,6 +202,56 @@ public String getText() { return text; } + + /** + * Max Trade Size + * @return maxSize + **/ + @javax.annotation.Nullable + public String getMaxSize() { + return maxSize; + } + + + /** + * Cumulative closed position volume + * @return accumSize + **/ + @javax.annotation.Nullable + public String getAccumSize() { + return accumSize; + } + + + /** + * First Open Time + * @return firstOpenTime + **/ + @javax.annotation.Nullable + public Long getFirstOpenTime() { + return firstOpenTime; + } + + + /** + * When side is 'long', it indicates the opening average price; when side is 'short', it indicates the closing average price + * @return longPrice + **/ + @javax.annotation.Nullable + public String getLongPrice() { + return longPrice; + } + + + /** + * When side is 'long', it indicates the closing average price; when side is 'short', it indicates the opening average price + * @return shortPrice + **/ + @javax.annotation.Nullable + public String getShortPrice() { + return shortPrice; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -153,12 +265,20 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.contract, positionClose.contract) && Objects.equals(this.side, positionClose.side) && Objects.equals(this.pnl, positionClose.pnl) && - Objects.equals(this.text, positionClose.text); + Objects.equals(this.pnlPnl, positionClose.pnlPnl) && + Objects.equals(this.pnlFund, positionClose.pnlFund) && + Objects.equals(this.pnlFee, positionClose.pnlFee) && + Objects.equals(this.text, positionClose.text) && + Objects.equals(this.maxSize, positionClose.maxSize) && + Objects.equals(this.accumSize, positionClose.accumSize) && + Objects.equals(this.firstOpenTime, positionClose.firstOpenTime) && + Objects.equals(this.longPrice, positionClose.longPrice) && + Objects.equals(this.shortPrice, positionClose.shortPrice); } @Override public int hashCode() { - return Objects.hash(time, contract, side, pnl, text); + return Objects.hash(time, contract, side, pnl, pnlPnl, pnlFund, pnlFee, text, maxSize, accumSize, firstOpenTime, longPrice, shortPrice); } @@ -170,7 +290,15 @@ public String toString() { sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" pnl: ").append(toIndentedString(pnl)).append("\n"); + sb.append(" pnlPnl: ").append(toIndentedString(pnlPnl)).append("\n"); + sb.append(" pnlFund: ").append(toIndentedString(pnlFund)).append("\n"); + sb.append(" pnlFee: ").append(toIndentedString(pnlFee)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" maxSize: ").append(toIndentedString(maxSize)).append("\n"); + sb.append(" accumSize: ").append(toIndentedString(accumSize)).append("\n"); + sb.append(" firstOpenTime: ").append(toIndentedString(firstOpenTime)).append("\n"); + sb.append(" longPrice: ").append(toIndentedString(longPrice)).append("\n"); + sb.append(" shortPrice: ").append(toIndentedString(shortPrice)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/PositionCloseOrder.java b/src/main/java/io/gate/gateapi/models/PositionCloseOrder.java index ecb1f4f..b771436 100644 --- a/src/main/java/io/gate/gateapi/models/PositionCloseOrder.java +++ b/src/main/java/io/gate/gateapi/models/PositionCloseOrder.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 @@ -20,7 +20,7 @@ import java.io.IOException; /** - * Current close order if any, or `null` + * Current close order information, or `null` if no close order */ public class PositionCloseOrder { public static final String SERIALIZED_NAME_ID = "id"; @@ -43,7 +43,7 @@ public PositionCloseOrder id(Long id) { } /** - * Close order ID + * Order ID * @return id **/ @javax.annotation.Nullable @@ -63,7 +63,7 @@ public PositionCloseOrder price(String price) { } /** - * Close order price + * Order price * @return price **/ @javax.annotation.Nullable @@ -83,7 +83,7 @@ public PositionCloseOrder isLiq(Boolean isLiq) { } /** - * Is the close order from liquidation + * Whether the close order is from liquidation * @return isLiq **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/ProfitLossRange.java b/src/main/java/io/gate/gateapi/models/ProfitLossRange.java new file mode 100644 index 0000000..55b7200 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/ProfitLossRange.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Profit and loss range + */ +public class ProfitLossRange { + public static final String SERIALIZED_NAME_PRICE_PERCENTAGE = "price_percentage"; + @SerializedName(SERIALIZED_NAME_PRICE_PERCENTAGE) + private String pricePercentage; + + public static final String SERIALIZED_NAME_IMPLIED_VOLATILITY_PERCENTAGE = "implied_volatility_percentage"; + @SerializedName(SERIALIZED_NAME_IMPLIED_VOLATILITY_PERCENTAGE) + private String impliedVolatilityPercentage; + + public static final String SERIALIZED_NAME_PROFIT_LOSS = "profit_loss"; + @SerializedName(SERIALIZED_NAME_PROFIT_LOSS) + private String profitLoss; + + + public ProfitLossRange pricePercentage(String pricePercentage) { + + this.pricePercentage = pricePercentage; + return this; + } + + /** + * Percentage change in price + * @return pricePercentage + **/ + @javax.annotation.Nullable + public String getPricePercentage() { + return pricePercentage; + } + + + public void setPricePercentage(String pricePercentage) { + this.pricePercentage = pricePercentage; + } + + public ProfitLossRange impliedVolatilityPercentage(String impliedVolatilityPercentage) { + + this.impliedVolatilityPercentage = impliedVolatilityPercentage; + return this; + } + + /** + * Percentage change in implied volatility + * @return impliedVolatilityPercentage + **/ + @javax.annotation.Nullable + public String getImpliedVolatilityPercentage() { + return impliedVolatilityPercentage; + } + + + public void setImpliedVolatilityPercentage(String impliedVolatilityPercentage) { + this.impliedVolatilityPercentage = impliedVolatilityPercentage; + } + + public ProfitLossRange profitLoss(String profitLoss) { + + this.profitLoss = profitLoss; + return this; + } + + /** + * PnL + * @return profitLoss + **/ + @javax.annotation.Nullable + public String getProfitLoss() { + return profitLoss; + } + + + public void setProfitLoss(String profitLoss) { + this.profitLoss = profitLoss; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfitLossRange profitLossRange = (ProfitLossRange) o; + return Objects.equals(this.pricePercentage, profitLossRange.pricePercentage) && + Objects.equals(this.impliedVolatilityPercentage, profitLossRange.impliedVolatilityPercentage) && + Objects.equals(this.profitLoss, profitLossRange.profitLoss); + } + + @Override + public int hashCode() { + return Objects.hash(pricePercentage, impliedVolatilityPercentage, profitLoss); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfitLossRange {\n"); + sb.append(" pricePercentage: ").append(toIndentedString(pricePercentage)).append("\n"); + sb.append(" impliedVolatilityPercentage: ").append(toIndentedString(impliedVolatilityPercentage)).append("\n"); + sb.append(" profitLoss: ").append(toIndentedString(profitLoss)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RebateUserInfo.java b/src/main/java/io/gate/gateapi/models/RebateUserInfo.java new file mode 100644 index 0000000..f30b2ed --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RebateUserInfo.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Retrieve user rebate information + */ +public class RebateUserInfo { + public static final String SERIALIZED_NAME_INVITE_UID = "invite_uid"; + @SerializedName(SERIALIZED_NAME_INVITE_UID) + private Long inviteUid; + + + public RebateUserInfo inviteUid(Long inviteUid) { + + this.inviteUid = inviteUid; + return this; + } + + /** + * My inviter's UID + * @return inviteUid + **/ + @javax.annotation.Nullable + public Long getInviteUid() { + return inviteUid; + } + + + public void setInviteUid(Long inviteUid) { + this.inviteUid = inviteUid; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RebateUserInfo rebateUserInfo = (RebateUserInfo) o; + return Objects.equals(this.inviteUid, rebateUserInfo.inviteUid); + } + + @Override + public int hashCode() { + return Objects.hash(inviteUid); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RebateUserInfo {\n"); + sb.append(" inviteUid: ").append(toIndentedString(inviteUid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayCurrencyRes.java b/src/main/java/io/gate/gateapi/models/RepayCurrencyRes.java new file mode 100644 index 0000000..a0a4f3b --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayCurrencyRes.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * RepayCurrencyRes + */ +public class RepayCurrencyRes { + public static final String SERIALIZED_NAME_SUCCEEDED = "succeeded"; + @SerializedName(SERIALIZED_NAME_SUCCEEDED) + private Boolean succeeded; + + public static final String SERIALIZED_NAME_LABEL = "label"; + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_REPAID_PRINCIPAL = "repaid_principal"; + @SerializedName(SERIALIZED_NAME_REPAID_PRINCIPAL) + private String repaidPrincipal; + + public static final String SERIALIZED_NAME_REPAID_INTEREST = "repaid_interest"; + @SerializedName(SERIALIZED_NAME_REPAID_INTEREST) + private String repaidInterest; + + + public RepayCurrencyRes succeeded(Boolean succeeded) { + + this.succeeded = succeeded; + return this; + } + + /** + * Whether the repayment was successful + * @return succeeded + **/ + @javax.annotation.Nullable + public Boolean getSucceeded() { + return succeeded; + } + + + public void setSucceeded(Boolean succeeded) { + this.succeeded = succeeded; + } + + public RepayCurrencyRes label(String label) { + + this.label = label; + return this; + } + + /** + * Error identifier for failed operations; empty when successful + * @return label + **/ + @javax.annotation.Nullable + public String getLabel() { + return label; + } + + + public void setLabel(String label) { + this.label = label; + } + + public RepayCurrencyRes message(String message) { + + this.message = message; + return this; + } + + /** + * Error description for failed operations; empty when successful + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + public RepayCurrencyRes currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Repayment currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public RepayCurrencyRes repaidPrincipal(String repaidPrincipal) { + + this.repaidPrincipal = repaidPrincipal; + return this; + } + + /** + * Principal + * @return repaidPrincipal + **/ + @javax.annotation.Nullable + public String getRepaidPrincipal() { + return repaidPrincipal; + } + + + public void setRepaidPrincipal(String repaidPrincipal) { + this.repaidPrincipal = repaidPrincipal; + } + + public RepayCurrencyRes repaidInterest(String repaidInterest) { + + this.repaidInterest = repaidInterest; + return this; + } + + /** + * Principal + * @return repaidInterest + **/ + @javax.annotation.Nullable + public String getRepaidInterest() { + return repaidInterest; + } + + + public void setRepaidInterest(String repaidInterest) { + this.repaidInterest = repaidInterest; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayCurrencyRes repayCurrencyRes = (RepayCurrencyRes) o; + return Objects.equals(this.succeeded, repayCurrencyRes.succeeded) && + Objects.equals(this.label, repayCurrencyRes.label) && + Objects.equals(this.message, repayCurrencyRes.message) && + Objects.equals(this.currency, repayCurrencyRes.currency) && + Objects.equals(this.repaidPrincipal, repayCurrencyRes.repaidPrincipal) && + Objects.equals(this.repaidInterest, repayCurrencyRes.repaidInterest); + } + + @Override + public int hashCode() { + return Objects.hash(succeeded, label, message, currency, repaidPrincipal, repaidInterest); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayCurrencyRes {\n"); + sb.append(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" repaidPrincipal: ").append(toIndentedString(repaidPrincipal)).append("\n"); + sb.append(" repaidInterest: ").append(toIndentedString(repaidInterest)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayLoan.java b/src/main/java/io/gate/gateapi/models/RepayLoan.java new file mode 100644 index 0000000..a1ab151 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayLoan.java @@ -0,0 +1,138 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Repay + */ +public class RepayLoan { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_REPAY_AMOUNT = "repay_amount"; + @SerializedName(SERIALIZED_NAME_REPAY_AMOUNT) + private String repayAmount; + + public static final String SERIALIZED_NAME_REPAID_ALL = "repaid_all"; + @SerializedName(SERIALIZED_NAME_REPAID_ALL) + private Boolean repaidAll; + + + public RepayLoan orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public RepayLoan repayAmount(String repayAmount) { + + this.repayAmount = repayAmount; + return this; + } + + /** + * Repayment amount, it is mandatory when making partial repayments + * @return repayAmount + **/ + public String getRepayAmount() { + return repayAmount; + } + + + public void setRepayAmount(String repayAmount) { + this.repayAmount = repayAmount; + } + + public RepayLoan repaidAll(Boolean repaidAll) { + + this.repaidAll = repaidAll; + return this; + } + + /** + * 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. + * @return repaidAll + **/ + public Boolean getRepaidAll() { + return repaidAll; + } + + + public void setRepaidAll(Boolean repaidAll) { + this.repaidAll = repaidAll; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayLoan repayLoan = (RepayLoan) o; + return Objects.equals(this.orderId, repayLoan.orderId) && + Objects.equals(this.repayAmount, repayLoan.repayAmount) && + Objects.equals(this.repaidAll, repayLoan.repaidAll); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, repayAmount, repaidAll); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayLoan {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" repayAmount: ").append(toIndentedString(repayAmount)).append("\n"); + sb.append(" repaidAll: ").append(toIndentedString(repaidAll)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayMultiLoan.java b/src/main/java/io/gate/gateapi/models/RepayMultiLoan.java new file mode 100644 index 0000000..7cb7157 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayMultiLoan.java @@ -0,0 +1,121 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MultiLoanRepayItem; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Multi-currency collateral repayment + */ +public class RepayMultiLoan { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_REPAY_ITEMS = "repay_items"; + @SerializedName(SERIALIZED_NAME_REPAY_ITEMS) + private List repayItems = new ArrayList<>(); + + + public RepayMultiLoan orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public RepayMultiLoan repayItems(List repayItems) { + + this.repayItems = repayItems; + return this; + } + + public RepayMultiLoan addRepayItemsItem(MultiLoanRepayItem repayItemsItem) { + this.repayItems.add(repayItemsItem); + return this; + } + + /** + * Repay Currency Item + * @return repayItems + **/ + public List getRepayItems() { + return repayItems; + } + + + public void setRepayItems(List repayItems) { + this.repayItems = repayItems; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayMultiLoan repayMultiLoan = (RepayMultiLoan) o; + return Objects.equals(this.orderId, repayMultiLoan.orderId) && + Objects.equals(this.repayItems, repayMultiLoan.repayItems); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, repayItems); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayMultiLoan {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" repayItems: ").append(toIndentedString(repayItems)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayRecord.java b/src/main/java/io/gate/gateapi/models/RepayRecord.java new file mode 100644 index 0000000..ca9dee6 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayRecord.java @@ -0,0 +1,401 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Repayment record + */ +public class RepayRecord { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private Long orderId; + + public static final String SERIALIZED_NAME_RECORD_ID = "record_id"; + @SerializedName(SERIALIZED_NAME_RECORD_ID) + private Long recordId; + + public static final String SERIALIZED_NAME_REPAID_AMOUNT = "repaid_amount"; + @SerializedName(SERIALIZED_NAME_REPAID_AMOUNT) + private String repaidAmount; + + public static final String SERIALIZED_NAME_BORROW_CURRENCY = "borrow_currency"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCY) + private String borrowCurrency; + + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCY = "collateral_currency"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCY) + private String collateralCurrency; + + public static final String SERIALIZED_NAME_INIT_LTV = "init_ltv"; + @SerializedName(SERIALIZED_NAME_INIT_LTV) + private String initLtv; + + public static final String SERIALIZED_NAME_BORROW_TIME = "borrow_time"; + @SerializedName(SERIALIZED_NAME_BORROW_TIME) + private Long borrowTime; + + public static final String SERIALIZED_NAME_REPAY_TIME = "repay_time"; + @SerializedName(SERIALIZED_NAME_REPAY_TIME) + private Long repayTime; + + public static final String SERIALIZED_NAME_TOTAL_INTEREST = "total_interest"; + @SerializedName(SERIALIZED_NAME_TOTAL_INTEREST) + private String totalInterest; + + public static final String SERIALIZED_NAME_BEFORE_LEFT_PRINCIPAL = "before_left_principal"; + @SerializedName(SERIALIZED_NAME_BEFORE_LEFT_PRINCIPAL) + private String beforeLeftPrincipal; + + public static final String SERIALIZED_NAME_AFTER_LEFT_PRINCIPAL = "after_left_principal"; + @SerializedName(SERIALIZED_NAME_AFTER_LEFT_PRINCIPAL) + private String afterLeftPrincipal; + + public static final String SERIALIZED_NAME_BEFORE_LEFT_COLLATERAL = "before_left_collateral"; + @SerializedName(SERIALIZED_NAME_BEFORE_LEFT_COLLATERAL) + private String beforeLeftCollateral; + + public static final String SERIALIZED_NAME_AFTER_LEFT_COLLATERAL = "after_left_collateral"; + @SerializedName(SERIALIZED_NAME_AFTER_LEFT_COLLATERAL) + private String afterLeftCollateral; + + + public RepayRecord orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * Order ID + * @return orderId + **/ + @javax.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public RepayRecord recordId(Long recordId) { + + this.recordId = recordId; + return this; + } + + /** + * Repayment record ID + * @return recordId + **/ + @javax.annotation.Nullable + public Long getRecordId() { + return recordId; + } + + + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + public RepayRecord repaidAmount(String repaidAmount) { + + this.repaidAmount = repaidAmount; + return this; + } + + /** + * Repayment amount + * @return repaidAmount + **/ + @javax.annotation.Nullable + public String getRepaidAmount() { + return repaidAmount; + } + + + public void setRepaidAmount(String repaidAmount) { + this.repaidAmount = repaidAmount; + } + + public RepayRecord borrowCurrency(String borrowCurrency) { + + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Borrowed currency + * @return borrowCurrency + **/ + @javax.annotation.Nullable + public String getBorrowCurrency() { + return borrowCurrency; + } + + + public void setBorrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + } + + public RepayRecord collateralCurrency(String collateralCurrency) { + + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Collateral currency + * @return collateralCurrency + **/ + @javax.annotation.Nullable + public String getCollateralCurrency() { + return collateralCurrency; + } + + + public void setCollateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + } + + public RepayRecord initLtv(String initLtv) { + + this.initLtv = initLtv; + return this; + } + + /** + * Initial collateralization rate + * @return initLtv + **/ + @javax.annotation.Nullable + public String getInitLtv() { + return initLtv; + } + + + public void setInitLtv(String initLtv) { + this.initLtv = initLtv; + } + + public RepayRecord borrowTime(Long borrowTime) { + + this.borrowTime = borrowTime; + return this; + } + + /** + * Borrowing time, timestamp + * @return borrowTime + **/ + @javax.annotation.Nullable + public Long getBorrowTime() { + return borrowTime; + } + + + public void setBorrowTime(Long borrowTime) { + this.borrowTime = borrowTime; + } + + public RepayRecord repayTime(Long repayTime) { + + this.repayTime = repayTime; + return this; + } + + /** + * Repayment time, timestamp + * @return repayTime + **/ + @javax.annotation.Nullable + public Long getRepayTime() { + return repayTime; + } + + + public void setRepayTime(Long repayTime) { + this.repayTime = repayTime; + } + + public RepayRecord totalInterest(String totalInterest) { + + this.totalInterest = totalInterest; + return this; + } + + /** + * Total interest + * @return totalInterest + **/ + @javax.annotation.Nullable + public String getTotalInterest() { + return totalInterest; + } + + + public void setTotalInterest(String totalInterest) { + this.totalInterest = totalInterest; + } + + public RepayRecord beforeLeftPrincipal(String beforeLeftPrincipal) { + + this.beforeLeftPrincipal = beforeLeftPrincipal; + return this; + } + + /** + * Principal to be repaid before repayment + * @return beforeLeftPrincipal + **/ + @javax.annotation.Nullable + public String getBeforeLeftPrincipal() { + return beforeLeftPrincipal; + } + + + public void setBeforeLeftPrincipal(String beforeLeftPrincipal) { + this.beforeLeftPrincipal = beforeLeftPrincipal; + } + + public RepayRecord afterLeftPrincipal(String afterLeftPrincipal) { + + this.afterLeftPrincipal = afterLeftPrincipal; + return this; + } + + /** + * Principal to be repaid after repayment + * @return afterLeftPrincipal + **/ + @javax.annotation.Nullable + public String getAfterLeftPrincipal() { + return afterLeftPrincipal; + } + + + public void setAfterLeftPrincipal(String afterLeftPrincipal) { + this.afterLeftPrincipal = afterLeftPrincipal; + } + + public RepayRecord beforeLeftCollateral(String beforeLeftCollateral) { + + this.beforeLeftCollateral = beforeLeftCollateral; + return this; + } + + /** + * Collateral amount before repayment + * @return beforeLeftCollateral + **/ + @javax.annotation.Nullable + public String getBeforeLeftCollateral() { + return beforeLeftCollateral; + } + + + public void setBeforeLeftCollateral(String beforeLeftCollateral) { + this.beforeLeftCollateral = beforeLeftCollateral; + } + + public RepayRecord afterLeftCollateral(String afterLeftCollateral) { + + this.afterLeftCollateral = afterLeftCollateral; + return this; + } + + /** + * Collateral amount after repayment + * @return afterLeftCollateral + **/ + @javax.annotation.Nullable + public String getAfterLeftCollateral() { + return afterLeftCollateral; + } + + + public void setAfterLeftCollateral(String afterLeftCollateral) { + this.afterLeftCollateral = afterLeftCollateral; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayRecord repayRecord = (RepayRecord) o; + return Objects.equals(this.orderId, repayRecord.orderId) && + Objects.equals(this.recordId, repayRecord.recordId) && + Objects.equals(this.repaidAmount, repayRecord.repaidAmount) && + Objects.equals(this.borrowCurrency, repayRecord.borrowCurrency) && + Objects.equals(this.collateralCurrency, repayRecord.collateralCurrency) && + Objects.equals(this.initLtv, repayRecord.initLtv) && + Objects.equals(this.borrowTime, repayRecord.borrowTime) && + Objects.equals(this.repayTime, repayRecord.repayTime) && + Objects.equals(this.totalInterest, repayRecord.totalInterest) && + Objects.equals(this.beforeLeftPrincipal, repayRecord.beforeLeftPrincipal) && + Objects.equals(this.afterLeftPrincipal, repayRecord.afterLeftPrincipal) && + Objects.equals(this.beforeLeftCollateral, repayRecord.beforeLeftCollateral) && + Objects.equals(this.afterLeftCollateral, repayRecord.afterLeftCollateral); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, recordId, repaidAmount, borrowCurrency, collateralCurrency, initLtv, borrowTime, repayTime, totalInterest, beforeLeftPrincipal, afterLeftPrincipal, beforeLeftCollateral, afterLeftCollateral); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayRecord {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" recordId: ").append(toIndentedString(recordId)).append("\n"); + sb.append(" repaidAmount: ").append(toIndentedString(repaidAmount)).append("\n"); + sb.append(" borrowCurrency: ").append(toIndentedString(borrowCurrency)).append("\n"); + sb.append(" collateralCurrency: ").append(toIndentedString(collateralCurrency)).append("\n"); + sb.append(" initLtv: ").append(toIndentedString(initLtv)).append("\n"); + sb.append(" borrowTime: ").append(toIndentedString(borrowTime)).append("\n"); + sb.append(" repayTime: ").append(toIndentedString(repayTime)).append("\n"); + sb.append(" totalInterest: ").append(toIndentedString(totalInterest)).append("\n"); + sb.append(" beforeLeftPrincipal: ").append(toIndentedString(beforeLeftPrincipal)).append("\n"); + sb.append(" afterLeftPrincipal: ").append(toIndentedString(afterLeftPrincipal)).append("\n"); + sb.append(" beforeLeftCollateral: ").append(toIndentedString(beforeLeftCollateral)).append("\n"); + sb.append(" afterLeftCollateral: ").append(toIndentedString(afterLeftCollateral)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayRecordCurrency.java b/src/main/java/io/gate/gateapi/models/RepayRecordCurrency.java new file mode 100644 index 0000000..e579cce --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayRecordCurrency.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * RepayRecordCurrency + */ +public class RepayRecordCurrency { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_BEFORE_AMOUNT = "before_amount"; + @SerializedName(SERIALIZED_NAME_BEFORE_AMOUNT) + private String beforeAmount; + + public static final String SERIALIZED_NAME_BEFORE_AMOUNT_USDT = "before_amount_usdt"; + @SerializedName(SERIALIZED_NAME_BEFORE_AMOUNT_USDT) + private String beforeAmountUsdt; + + public static final String SERIALIZED_NAME_AFTER_AMOUNT = "after_amount"; + @SerializedName(SERIALIZED_NAME_AFTER_AMOUNT) + private String afterAmount; + + public static final String SERIALIZED_NAME_AFTER_AMOUNT_USDT = "after_amount_usdt"; + @SerializedName(SERIALIZED_NAME_AFTER_AMOUNT_USDT) + private String afterAmountUsdt; + + + public RepayRecordCurrency currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public RepayRecordCurrency indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public RepayRecordCurrency beforeAmount(String beforeAmount) { + + this.beforeAmount = beforeAmount; + return this; + } + + /** + * Amount before the operation + * @return beforeAmount + **/ + @javax.annotation.Nullable + public String getBeforeAmount() { + return beforeAmount; + } + + + public void setBeforeAmount(String beforeAmount) { + this.beforeAmount = beforeAmount; + } + + public RepayRecordCurrency beforeAmountUsdt(String beforeAmountUsdt) { + + this.beforeAmountUsdt = beforeAmountUsdt; + return this; + } + + /** + * USDT Amount before the operation + * @return beforeAmountUsdt + **/ + @javax.annotation.Nullable + public String getBeforeAmountUsdt() { + return beforeAmountUsdt; + } + + + public void setBeforeAmountUsdt(String beforeAmountUsdt) { + this.beforeAmountUsdt = beforeAmountUsdt; + } + + public RepayRecordCurrency afterAmount(String afterAmount) { + + this.afterAmount = afterAmount; + return this; + } + + /** + * Amount after the operation + * @return afterAmount + **/ + @javax.annotation.Nullable + public String getAfterAmount() { + return afterAmount; + } + + + public void setAfterAmount(String afterAmount) { + this.afterAmount = afterAmount; + } + + public RepayRecordCurrency afterAmountUsdt(String afterAmountUsdt) { + + this.afterAmountUsdt = afterAmountUsdt; + return this; + } + + /** + * USDT Amount after the operation + * @return afterAmountUsdt + **/ + @javax.annotation.Nullable + public String getAfterAmountUsdt() { + return afterAmountUsdt; + } + + + public void setAfterAmountUsdt(String afterAmountUsdt) { + this.afterAmountUsdt = afterAmountUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayRecordCurrency repayRecordCurrency = (RepayRecordCurrency) o; + return Objects.equals(this.currency, repayRecordCurrency.currency) && + Objects.equals(this.indexPrice, repayRecordCurrency.indexPrice) && + Objects.equals(this.beforeAmount, repayRecordCurrency.beforeAmount) && + Objects.equals(this.beforeAmountUsdt, repayRecordCurrency.beforeAmountUsdt) && + Objects.equals(this.afterAmount, repayRecordCurrency.afterAmount) && + Objects.equals(this.afterAmountUsdt, repayRecordCurrency.afterAmountUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, beforeAmount, beforeAmountUsdt, afterAmount, afterAmountUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayRecordCurrency {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" beforeAmount: ").append(toIndentedString(beforeAmount)).append("\n"); + sb.append(" beforeAmountUsdt: ").append(toIndentedString(beforeAmountUsdt)).append("\n"); + sb.append(" afterAmount: ").append(toIndentedString(afterAmount)).append("\n"); + sb.append(" afterAmountUsdt: ").append(toIndentedString(afterAmountUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayRecordLeftInterest.java b/src/main/java/io/gate/gateapi/models/RepayRecordLeftInterest.java new file mode 100644 index 0000000..3c2660e --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayRecordLeftInterest.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * RepayRecordLeftInterest + */ +public class RepayRecordLeftInterest { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_BEFORE_AMOUNT = "before_amount"; + @SerializedName(SERIALIZED_NAME_BEFORE_AMOUNT) + private String beforeAmount; + + public static final String SERIALIZED_NAME_BEFORE_AMOUNT_USDT = "before_amount_usdt"; + @SerializedName(SERIALIZED_NAME_BEFORE_AMOUNT_USDT) + private String beforeAmountUsdt; + + public static final String SERIALIZED_NAME_AFTER_AMOUNT = "after_amount"; + @SerializedName(SERIALIZED_NAME_AFTER_AMOUNT) + private String afterAmount; + + public static final String SERIALIZED_NAME_AFTER_AMOUNT_USDT = "after_amount_usdt"; + @SerializedName(SERIALIZED_NAME_AFTER_AMOUNT_USDT) + private String afterAmountUsdt; + + + public RepayRecordLeftInterest currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public RepayRecordLeftInterest indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public RepayRecordLeftInterest beforeAmount(String beforeAmount) { + + this.beforeAmount = beforeAmount; + return this; + } + + /** + * Interest amount before repayment + * @return beforeAmount + **/ + @javax.annotation.Nullable + public String getBeforeAmount() { + return beforeAmount; + } + + + public void setBeforeAmount(String beforeAmount) { + this.beforeAmount = beforeAmount; + } + + public RepayRecordLeftInterest beforeAmountUsdt(String beforeAmountUsdt) { + + this.beforeAmountUsdt = beforeAmountUsdt; + return this; + } + + /** + * Converted value of interest before repayment in USDT + * @return beforeAmountUsdt + **/ + @javax.annotation.Nullable + public String getBeforeAmountUsdt() { + return beforeAmountUsdt; + } + + + public void setBeforeAmountUsdt(String beforeAmountUsdt) { + this.beforeAmountUsdt = beforeAmountUsdt; + } + + public RepayRecordLeftInterest afterAmount(String afterAmount) { + + this.afterAmount = afterAmount; + return this; + } + + /** + * Interest amount after repayment + * @return afterAmount + **/ + @javax.annotation.Nullable + public String getAfterAmount() { + return afterAmount; + } + + + public void setAfterAmount(String afterAmount) { + this.afterAmount = afterAmount; + } + + public RepayRecordLeftInterest afterAmountUsdt(String afterAmountUsdt) { + + this.afterAmountUsdt = afterAmountUsdt; + return this; + } + + /** + * Converted value of interest after repayment in USDT + * @return afterAmountUsdt + **/ + @javax.annotation.Nullable + public String getAfterAmountUsdt() { + return afterAmountUsdt; + } + + + public void setAfterAmountUsdt(String afterAmountUsdt) { + this.afterAmountUsdt = afterAmountUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayRecordLeftInterest repayRecordLeftInterest = (RepayRecordLeftInterest) o; + return Objects.equals(this.currency, repayRecordLeftInterest.currency) && + Objects.equals(this.indexPrice, repayRecordLeftInterest.indexPrice) && + Objects.equals(this.beforeAmount, repayRecordLeftInterest.beforeAmount) && + Objects.equals(this.beforeAmountUsdt, repayRecordLeftInterest.beforeAmountUsdt) && + Objects.equals(this.afterAmount, repayRecordLeftInterest.afterAmount) && + Objects.equals(this.afterAmountUsdt, repayRecordLeftInterest.afterAmountUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, beforeAmount, beforeAmountUsdt, afterAmount, afterAmountUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayRecordLeftInterest {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" beforeAmount: ").append(toIndentedString(beforeAmount)).append("\n"); + sb.append(" beforeAmountUsdt: ").append(toIndentedString(beforeAmountUsdt)).append("\n"); + sb.append(" afterAmount: ").append(toIndentedString(afterAmount)).append("\n"); + sb.append(" afterAmountUsdt: ").append(toIndentedString(afterAmountUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayRecordRepaidCurrency.java b/src/main/java/io/gate/gateapi/models/RepayRecordRepaidCurrency.java new file mode 100644 index 0000000..7c38ec2 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayRecordRepaidCurrency.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * RepayRecordRepaidCurrency + */ +public class RepayRecordRepaidCurrency { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_REPAID_AMOUNT = "repaid_amount"; + @SerializedName(SERIALIZED_NAME_REPAID_AMOUNT) + private String repaidAmount; + + public static final String SERIALIZED_NAME_REPAID_PRINCIPAL = "repaid_principal"; + @SerializedName(SERIALIZED_NAME_REPAID_PRINCIPAL) + private String repaidPrincipal; + + public static final String SERIALIZED_NAME_REPAID_INTEREST = "repaid_interest"; + @SerializedName(SERIALIZED_NAME_REPAID_INTEREST) + private String repaidInterest; + + public static final String SERIALIZED_NAME_REPAID_AMOUNT_USDT = "repaid_amount_usdt"; + @SerializedName(SERIALIZED_NAME_REPAID_AMOUNT_USDT) + private String repaidAmountUsdt; + + + public RepayRecordRepaidCurrency currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Repayment currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public RepayRecordRepaidCurrency indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public RepayRecordRepaidCurrency repaidAmount(String repaidAmount) { + + this.repaidAmount = repaidAmount; + return this; + } + + /** + * Repayment amount + * @return repaidAmount + **/ + @javax.annotation.Nullable + public String getRepaidAmount() { + return repaidAmount; + } + + + public void setRepaidAmount(String repaidAmount) { + this.repaidAmount = repaidAmount; + } + + public RepayRecordRepaidCurrency repaidPrincipal(String repaidPrincipal) { + + this.repaidPrincipal = repaidPrincipal; + return this; + } + + /** + * Principal + * @return repaidPrincipal + **/ + @javax.annotation.Nullable + public String getRepaidPrincipal() { + return repaidPrincipal; + } + + + public void setRepaidPrincipal(String repaidPrincipal) { + this.repaidPrincipal = repaidPrincipal; + } + + public RepayRecordRepaidCurrency repaidInterest(String repaidInterest) { + + this.repaidInterest = repaidInterest; + return this; + } + + /** + * Interest + * @return repaidInterest + **/ + @javax.annotation.Nullable + public String getRepaidInterest() { + return repaidInterest; + } + + + public void setRepaidInterest(String repaidInterest) { + this.repaidInterest = repaidInterest; + } + + public RepayRecordRepaidCurrency repaidAmountUsdt(String repaidAmountUsdt) { + + this.repaidAmountUsdt = repaidAmountUsdt; + return this; + } + + /** + * Repayment amount converted to USDT + * @return repaidAmountUsdt + **/ + @javax.annotation.Nullable + public String getRepaidAmountUsdt() { + return repaidAmountUsdt; + } + + + public void setRepaidAmountUsdt(String repaidAmountUsdt) { + this.repaidAmountUsdt = repaidAmountUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayRecordRepaidCurrency repayRecordRepaidCurrency = (RepayRecordRepaidCurrency) o; + return Objects.equals(this.currency, repayRecordRepaidCurrency.currency) && + Objects.equals(this.indexPrice, repayRecordRepaidCurrency.indexPrice) && + Objects.equals(this.repaidAmount, repayRecordRepaidCurrency.repaidAmount) && + Objects.equals(this.repaidPrincipal, repayRecordRepaidCurrency.repaidPrincipal) && + Objects.equals(this.repaidInterest, repayRecordRepaidCurrency.repaidInterest) && + Objects.equals(this.repaidAmountUsdt, repayRecordRepaidCurrency.repaidAmountUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, repaidAmount, repaidPrincipal, repaidInterest, repaidAmountUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayRecordRepaidCurrency {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" repaidAmount: ").append(toIndentedString(repaidAmount)).append("\n"); + sb.append(" repaidPrincipal: ").append(toIndentedString(repaidPrincipal)).append("\n"); + sb.append(" repaidInterest: ").append(toIndentedString(repaidInterest)).append("\n"); + sb.append(" repaidAmountUsdt: ").append(toIndentedString(repaidAmountUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayRecordTotalInterest.java b/src/main/java/io/gate/gateapi/models/RepayRecordTotalInterest.java new file mode 100644 index 0000000..1d03f57 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayRecordTotalInterest.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * RepayRecordTotalInterest + */ +public class RepayRecordTotalInterest { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "index_price"; + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + private String indexPrice; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_AMOUNT_USDT = "amount_usdt"; + @SerializedName(SERIALIZED_NAME_AMOUNT_USDT) + private String amountUsdt; + + + public RepayRecordTotalInterest currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public RepayRecordTotalInterest indexPrice(String indexPrice) { + + this.indexPrice = indexPrice; + return this; + } + + /** + * Currency Index Price + * @return indexPrice + **/ + @javax.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + + public void setIndexPrice(String indexPrice) { + this.indexPrice = indexPrice; + } + + public RepayRecordTotalInterest amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Interest Amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public RepayRecordTotalInterest amountUsdt(String amountUsdt) { + + this.amountUsdt = amountUsdt; + return this; + } + + /** + * Interest amount converted to USDT + * @return amountUsdt + **/ + @javax.annotation.Nullable + public String getAmountUsdt() { + return amountUsdt; + } + + + public void setAmountUsdt(String amountUsdt) { + this.amountUsdt = amountUsdt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayRecordTotalInterest repayRecordTotalInterest = (RepayRecordTotalInterest) o; + return Objects.equals(this.currency, repayRecordTotalInterest.currency) && + Objects.equals(this.indexPrice, repayRecordTotalInterest.indexPrice) && + Objects.equals(this.amount, repayRecordTotalInterest.amount) && + Objects.equals(this.amountUsdt, repayRecordTotalInterest.amountUsdt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, indexPrice, amount, amountUsdt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayRecordTotalInterest {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" amountUsdt: ").append(toIndentedString(amountUsdt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RepayResp.java b/src/main/java/io/gate/gateapi/models/RepayResp.java new file mode 100644 index 0000000..708657a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RepayResp.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Repay + */ +public class RepayResp { + public static final String SERIALIZED_NAME_REPAID_PRINCIPAL = "repaid_principal"; + @SerializedName(SERIALIZED_NAME_REPAID_PRINCIPAL) + private String repaidPrincipal; + + public static final String SERIALIZED_NAME_REPAID_INTEREST = "repaid_interest"; + @SerializedName(SERIALIZED_NAME_REPAID_INTEREST) + private String repaidInterest; + + + public RepayResp repaidPrincipal(String repaidPrincipal) { + + this.repaidPrincipal = repaidPrincipal; + return this; + } + + /** + * Principal + * @return repaidPrincipal + **/ + @javax.annotation.Nullable + public String getRepaidPrincipal() { + return repaidPrincipal; + } + + + public void setRepaidPrincipal(String repaidPrincipal) { + this.repaidPrincipal = repaidPrincipal; + } + + public RepayResp repaidInterest(String repaidInterest) { + + this.repaidInterest = repaidInterest; + return this; + } + + /** + * Interest + * @return repaidInterest + **/ + @javax.annotation.Nullable + public String getRepaidInterest() { + return repaidInterest; + } + + + public void setRepaidInterest(String repaidInterest) { + this.repaidInterest = repaidInterest; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepayResp repayResp = (RepayResp) o; + return Objects.equals(this.repaidPrincipal, repayResp.repaidPrincipal) && + Objects.equals(this.repaidInterest, repayResp.repaidInterest); + } + + @Override + public int hashCode() { + return Objects.hash(repaidPrincipal, repaidInterest); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepayResp {\n"); + sb.append(" repaidPrincipal: ").append(toIndentedString(repaidPrincipal)).append("\n"); + sb.append(" repaidInterest: ").append(toIndentedString(repaidInterest)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/RiskUnits.java b/src/main/java/io/gate/gateapi/models/RiskUnits.java new file mode 100644 index 0000000..852809f --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/RiskUnits.java @@ -0,0 +1,271 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * RiskUnits + */ +public class RiskUnits { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + @SerializedName(SERIALIZED_NAME_SYMBOL) + private String symbol; + + public static final String SERIALIZED_NAME_SPOT_IN_USE = "spot_in_use"; + @SerializedName(SERIALIZED_NAME_SPOT_IN_USE) + private String spotInUse; + + public static final String SERIALIZED_NAME_MAINTAIN_MARGIN = "maintain_margin"; + @SerializedName(SERIALIZED_NAME_MAINTAIN_MARGIN) + private String maintainMargin; + + public static final String SERIALIZED_NAME_INITIAL_MARGIN = "initial_margin"; + @SerializedName(SERIALIZED_NAME_INITIAL_MARGIN) + private String initialMargin; + + public static final String SERIALIZED_NAME_DELTA = "delta"; + @SerializedName(SERIALIZED_NAME_DELTA) + private String delta; + + public static final String SERIALIZED_NAME_GAMMA = "gamma"; + @SerializedName(SERIALIZED_NAME_GAMMA) + private String gamma; + + public static final String SERIALIZED_NAME_THETA = "theta"; + @SerializedName(SERIALIZED_NAME_THETA) + private String theta; + + public static final String SERIALIZED_NAME_VEGA = "vega"; + @SerializedName(SERIALIZED_NAME_VEGA) + private String vega; + + + public RiskUnits symbol(String symbol) { + + this.symbol = symbol; + return this; + } + + /** + * Risk unit flag + * @return symbol + **/ + @javax.annotation.Nullable + public String getSymbol() { + return symbol; + } + + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public RiskUnits spotInUse(String spotInUse) { + + this.spotInUse = spotInUse; + return this; + } + + /** + * Spot hedging occupied amount + * @return spotInUse + **/ + @javax.annotation.Nullable + public String getSpotInUse() { + return spotInUse; + } + + + public void setSpotInUse(String spotInUse) { + this.spotInUse = spotInUse; + } + + public RiskUnits maintainMargin(String maintainMargin) { + + this.maintainMargin = maintainMargin; + return this; + } + + /** + * Maintenance margin for risk unit + * @return maintainMargin + **/ + @javax.annotation.Nullable + public String getMaintainMargin() { + return maintainMargin; + } + + + public void setMaintainMargin(String maintainMargin) { + this.maintainMargin = maintainMargin; + } + + public RiskUnits initialMargin(String initialMargin) { + + this.initialMargin = initialMargin; + return this; + } + + /** + * Initial margin for risk unit + * @return initialMargin + **/ + @javax.annotation.Nullable + public String getInitialMargin() { + return initialMargin; + } + + + public void setInitialMargin(String initialMargin) { + this.initialMargin = initialMargin; + } + + public RiskUnits delta(String delta) { + + this.delta = delta; + return this; + } + + /** + * Total Delta of risk unit + * @return delta + **/ + @javax.annotation.Nullable + public String getDelta() { + return delta; + } + + + public void setDelta(String delta) { + this.delta = delta; + } + + public RiskUnits gamma(String gamma) { + + this.gamma = gamma; + return this; + } + + /** + * Total Gamma of risk unit + * @return gamma + **/ + @javax.annotation.Nullable + public String getGamma() { + return gamma; + } + + + public void setGamma(String gamma) { + this.gamma = gamma; + } + + public RiskUnits theta(String theta) { + + this.theta = theta; + return this; + } + + /** + * Total Theta of risk unit + * @return theta + **/ + @javax.annotation.Nullable + public String getTheta() { + return theta; + } + + + public void setTheta(String theta) { + this.theta = theta; + } + + public RiskUnits vega(String vega) { + + this.vega = vega; + return this; + } + + /** + * Total Vega of risk unit + * @return vega + **/ + @javax.annotation.Nullable + public String getVega() { + return vega; + } + + + public void setVega(String vega) { + this.vega = vega; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RiskUnits riskUnits = (RiskUnits) o; + return Objects.equals(this.symbol, riskUnits.symbol) && + Objects.equals(this.spotInUse, riskUnits.spotInUse) && + Objects.equals(this.maintainMargin, riskUnits.maintainMargin) && + Objects.equals(this.initialMargin, riskUnits.initialMargin) && + Objects.equals(this.delta, riskUnits.delta) && + Objects.equals(this.gamma, riskUnits.gamma) && + Objects.equals(this.theta, riskUnits.theta) && + Objects.equals(this.vega, riskUnits.vega); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, spotInUse, maintainMargin, initialMargin, delta, gamma, theta, vega); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RiskUnits {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" spotInUse: ").append(toIndentedString(spotInUse)).append("\n"); + sb.append(" maintainMargin: ").append(toIndentedString(maintainMargin)).append("\n"); + sb.append(" initialMargin: ").append(toIndentedString(initialMargin)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" gamma: ").append(toIndentedString(gamma)).append("\n"); + sb.append(" theta: ").append(toIndentedString(theta)).append("\n"); + sb.append(" vega: ").append(toIndentedString(vega)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SavedAddress.java b/src/main/java/io/gate/gateapi/models/SavedAddress.java new file mode 100644 index 0000000..5194f10 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SavedAddress.java @@ -0,0 +1,219 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SavedAddress + */ +public class SavedAddress { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_CHAIN = "chain"; + @SerializedName(SERIALIZED_NAME_CHAIN) + private String chain; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + private String tag; + + public static final String SERIALIZED_NAME_VERIFIED = "verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + private String verified; + + + public SavedAddress currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public SavedAddress chain(String chain) { + + this.chain = chain; + return this; + } + + /** + * Chain name + * @return chain + **/ + @javax.annotation.Nullable + public String getChain() { + return chain; + } + + + public void setChain(String chain) { + this.chain = chain; + } + + public SavedAddress address(String address) { + + this.address = address; + return this; + } + + /** + * Address + * @return address + **/ + @javax.annotation.Nullable + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + public SavedAddress name(String name) { + + this.name = name; + return this; + } + + /** + * Name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public SavedAddress tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag + * @return tag + **/ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + + public void setTag(String tag) { + this.tag = tag; + } + + public SavedAddress verified(String verified) { + + this.verified = verified; + return this; + } + + /** + * Whether to pass the verification 0-unverified, 1-verified + * @return verified + **/ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + + public void setVerified(String verified) { + this.verified = verified; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedAddress savedAddress = (SavedAddress) o; + return Objects.equals(this.currency, savedAddress.currency) && + Objects.equals(this.chain, savedAddress.chain) && + Objects.equals(this.address, savedAddress.address) && + Objects.equals(this.name, savedAddress.name) && + Objects.equals(this.tag, savedAddress.tag) && + Objects.equals(this.verified, savedAddress.verified); + } + + @Override + public int hashCode() { + return Objects.hash(currency, chain, address, name, tag, verified); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedAddress {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" chain: ").append(toIndentedString(chain)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SmallBalance.java b/src/main/java/io/gate/gateapi/models/SmallBalance.java new file mode 100644 index 0000000..64c9113 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SmallBalance.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Small Balance Conversion + */ +public class SmallBalance { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AVAILABLE_BALANCE = "available_balance"; + @SerializedName(SERIALIZED_NAME_AVAILABLE_BALANCE) + private String availableBalance; + + public static final String SERIALIZED_NAME_ESTIMATED_AS_BTC = "estimated_as_btc"; + @SerializedName(SERIALIZED_NAME_ESTIMATED_AS_BTC) + private String estimatedAsBtc; + + public static final String SERIALIZED_NAME_CONVERTIBLE_TO_GT = "convertible_to_gt"; + @SerializedName(SERIALIZED_NAME_CONVERTIBLE_TO_GT) + private String convertibleToGt; + + + public SmallBalance currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public SmallBalance availableBalance(String availableBalance) { + + this.availableBalance = availableBalance; + return this; + } + + /** + * Available balance + * @return availableBalance + **/ + @javax.annotation.Nullable + public String getAvailableBalance() { + return availableBalance; + } + + + public void setAvailableBalance(String availableBalance) { + this.availableBalance = availableBalance; + } + + public SmallBalance estimatedAsBtc(String estimatedAsBtc) { + + this.estimatedAsBtc = estimatedAsBtc; + return this; + } + + /** + * Estimated as BTC + * @return estimatedAsBtc + **/ + @javax.annotation.Nullable + public String getEstimatedAsBtc() { + return estimatedAsBtc; + } + + + public void setEstimatedAsBtc(String estimatedAsBtc) { + this.estimatedAsBtc = estimatedAsBtc; + } + + public SmallBalance convertibleToGt(String convertibleToGt) { + + this.convertibleToGt = convertibleToGt; + return this; + } + + /** + * Estimated conversion to GT + * @return convertibleToGt + **/ + @javax.annotation.Nullable + public String getConvertibleToGt() { + return convertibleToGt; + } + + + public void setConvertibleToGt(String convertibleToGt) { + this.convertibleToGt = convertibleToGt; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmallBalance smallBalance = (SmallBalance) o; + return Objects.equals(this.currency, smallBalance.currency) && + Objects.equals(this.availableBalance, smallBalance.availableBalance) && + Objects.equals(this.estimatedAsBtc, smallBalance.estimatedAsBtc) && + Objects.equals(this.convertibleToGt, smallBalance.convertibleToGt); + } + + @Override + public int hashCode() { + return Objects.hash(currency, availableBalance, estimatedAsBtc, convertibleToGt); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmallBalance {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" availableBalance: ").append(toIndentedString(availableBalance)).append("\n"); + sb.append(" estimatedAsBtc: ").append(toIndentedString(estimatedAsBtc)).append("\n"); + sb.append(" convertibleToGt: ").append(toIndentedString(convertibleToGt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SmallBalanceHistory.java b/src/main/java/io/gate/gateapi/models/SmallBalanceHistory.java new file mode 100644 index 0000000..e1de3e3 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SmallBalanceHistory.java @@ -0,0 +1,143 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Small Balance Conversion + */ +public class SmallBalanceHistory { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_GT_AMOUNT = "gt_amount"; + @SerializedName(SERIALIZED_NAME_GT_AMOUNT) + private String gtAmount; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Swap Amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + /** + * GT amount + * @return gtAmount + **/ + @javax.annotation.Nullable + public String getGtAmount() { + return gtAmount; + } + + + /** + * Exchange time (in seconds) + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmallBalanceHistory smallBalanceHistory = (SmallBalanceHistory) o; + return Objects.equals(this.id, smallBalanceHistory.id) && + Objects.equals(this.currency, smallBalanceHistory.currency) && + Objects.equals(this.amount, smallBalanceHistory.amount) && + Objects.equals(this.gtAmount, smallBalanceHistory.gtAmount) && + Objects.equals(this.createTime, smallBalanceHistory.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(id, currency, amount, gtAmount, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmallBalanceHistory {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" gtAmount: ").append(toIndentedString(gtAmount)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SpotAccount.java b/src/main/java/io/gate/gateapi/models/SpotAccount.java index dc631fe..6bff1ce 100644 --- a/src/main/java/io/gate/gateapi/models/SpotAccount.java +++ b/src/main/java/io/gate/gateapi/models/SpotAccount.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 @@ -35,6 +35,10 @@ public class SpotAccount { @SerializedName(SERIALIZED_NAME_LOCKED) private String locked; + public static final String SERIALIZED_NAME_UPDATE_ID = "update_id"; + @SerializedName(SERIALIZED_NAME_UPDATE_ID) + private Long updateId; + public SpotAccount currency(String currency) { @@ -95,6 +99,26 @@ public String getLocked() { public void setLocked(String locked) { this.locked = locked; } + + public SpotAccount updateId(Long updateId) { + + this.updateId = updateId; + return this; + } + + /** + * Version number + * @return updateId + **/ + @javax.annotation.Nullable + public Long getUpdateId() { + return updateId; + } + + + public void setUpdateId(Long updateId) { + this.updateId = updateId; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -106,12 +130,13 @@ public boolean equals(java.lang.Object o) { SpotAccount spotAccount = (SpotAccount) o; return Objects.equals(this.currency, spotAccount.currency) && Objects.equals(this.available, spotAccount.available) && - Objects.equals(this.locked, spotAccount.locked); + Objects.equals(this.locked, spotAccount.locked) && + Objects.equals(this.updateId, spotAccount.updateId); } @Override public int hashCode() { - return Objects.hash(currency, available, locked); + return Objects.hash(currency, available, locked, updateId); } @@ -122,6 +147,7 @@ public String toString() { sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" available: ").append(toIndentedString(available)).append("\n"); sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); + sb.append(" updateId: ").append(toIndentedString(updateId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginAccountBook.java b/src/main/java/io/gate/gateapi/models/SpotAccountBook.java similarity index 55% rename from src/main/java/io/gate/gateapi/models/CrossMarginAccountBook.java rename to src/main/java/io/gate/gateapi/models/SpotAccountBook.java index aaa5099..f4f618d 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginAccountBook.java +++ b/src/main/java/io/gate/gateapi/models/SpotAccountBook.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 @@ -20,9 +20,9 @@ import java.io.IOException; /** - * CrossMarginAccountBook + * SpotAccountBook */ -public class CrossMarginAccountBook { +public class SpotAccountBook { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; @@ -43,73 +43,20 @@ public class CrossMarginAccountBook { @SerializedName(SERIALIZED_NAME_BALANCE) private String balance; - /** - * 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 - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - 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"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + private String type; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; - public CrossMarginAccountBook id(String id) { + public SpotAccountBook id(String id) { this.id = id; return this; @@ -129,7 +76,7 @@ public void setId(String id) { this.id = id; } - public CrossMarginAccountBook time(Long time) { + public SpotAccountBook time(Long time) { this.time = time; return this; @@ -149,7 +96,7 @@ public void setTime(Long time) { this.time = time; } - public CrossMarginAccountBook currency(String currency) { + public SpotAccountBook currency(String currency) { this.currency = currency; return this; @@ -169,7 +116,7 @@ public void setCurrency(String currency) { this.currency = currency; } - public CrossMarginAccountBook change(String change) { + public SpotAccountBook change(String change) { this.change = change; return this; @@ -189,7 +136,7 @@ public void setChange(String change) { this.change = change; } - public CrossMarginAccountBook balance(String balance) { + public SpotAccountBook balance(String balance) { this.balance = balance; return this; @@ -209,25 +156,65 @@ public void setBalance(String balance) { this.balance = balance; } - public CrossMarginAccountBook type(TypeEnum type) { + public SpotAccountBook type(String type) { this.type = type; return this; } /** - * Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type + * Account book type. Please refer to [account book type](#accountbook-type) for more detail * @return type **/ @javax.annotation.Nullable - public TypeEnum getType() { + public String getType() { return type; } - public void setType(TypeEnum type) { + public void setType(String type) { this.type = type; } + + public SpotAccountBook code(String code) { + + this.code = code; + return this; + } + + /** + * Account change code, see [Asset Record Code] (Asset Record Code) + * @return code + **/ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + public SpotAccountBook text(String text) { + + this.text = text; + return this; + } + + /** + * Additional information + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -236,31 +223,35 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CrossMarginAccountBook crossMarginAccountBook = (CrossMarginAccountBook) o; - return Objects.equals(this.id, crossMarginAccountBook.id) && - Objects.equals(this.time, crossMarginAccountBook.time) && - Objects.equals(this.currency, crossMarginAccountBook.currency) && - Objects.equals(this.change, crossMarginAccountBook.change) && - Objects.equals(this.balance, crossMarginAccountBook.balance) && - Objects.equals(this.type, crossMarginAccountBook.type); + SpotAccountBook spotAccountBook = (SpotAccountBook) o; + return Objects.equals(this.id, spotAccountBook.id) && + Objects.equals(this.time, spotAccountBook.time) && + Objects.equals(this.currency, spotAccountBook.currency) && + Objects.equals(this.change, spotAccountBook.change) && + Objects.equals(this.balance, spotAccountBook.balance) && + Objects.equals(this.type, spotAccountBook.type) && + Objects.equals(this.code, spotAccountBook.code) && + Objects.equals(this.text, spotAccountBook.text); } @Override public int hashCode() { - return Objects.hash(id, time, currency, change, balance, type); + return Objects.hash(id, time, currency, change, balance, type, code, text); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginAccountBook {\n"); + sb.append("class SpotAccountBook {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" change: ").append(toIndentedString(change)).append("\n"); sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/SpotCurrencyChain.java b/src/main/java/io/gate/gateapi/models/SpotCurrencyChain.java new file mode 100644 index 0000000..057a732 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SpotCurrencyChain.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SpotCurrencyChain + */ +public class SpotCurrencyChain { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ADDR = "addr"; + @SerializedName(SERIALIZED_NAME_ADDR) + private String addr; + + public static final String SERIALIZED_NAME_WITHDRAW_DISABLED = "withdraw_disabled"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_DISABLED) + private Boolean withdrawDisabled; + + public static final String SERIALIZED_NAME_WITHDRAW_DELAYED = "withdraw_delayed"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_DELAYED) + private Boolean withdrawDelayed; + + public static final String SERIALIZED_NAME_DEPOSIT_DISABLED = "deposit_disabled"; + @SerializedName(SERIALIZED_NAME_DEPOSIT_DISABLED) + private Boolean depositDisabled; + + + public SpotCurrencyChain name(String name) { + + this.name = name; + return this; + } + + /** + * Blockchain name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public SpotCurrencyChain addr(String addr) { + + this.addr = addr; + return this; + } + + /** + * token address + * @return addr + **/ + @javax.annotation.Nullable + public String getAddr() { + return addr; + } + + + public void setAddr(String addr) { + this.addr = addr; + } + + public SpotCurrencyChain withdrawDisabled(Boolean withdrawDisabled) { + + this.withdrawDisabled = withdrawDisabled; + return this; + } + + /** + * Whether currency's withdrawal is disabled + * @return withdrawDisabled + **/ + @javax.annotation.Nullable + public Boolean getWithdrawDisabled() { + return withdrawDisabled; + } + + + public void setWithdrawDisabled(Boolean withdrawDisabled) { + this.withdrawDisabled = withdrawDisabled; + } + + public SpotCurrencyChain withdrawDelayed(Boolean withdrawDelayed) { + + this.withdrawDelayed = withdrawDelayed; + return this; + } + + /** + * Whether currency's withdrawal is delayed + * @return withdrawDelayed + **/ + @javax.annotation.Nullable + public Boolean getWithdrawDelayed() { + return withdrawDelayed; + } + + + public void setWithdrawDelayed(Boolean withdrawDelayed) { + this.withdrawDelayed = withdrawDelayed; + } + + public SpotCurrencyChain depositDisabled(Boolean depositDisabled) { + + this.depositDisabled = depositDisabled; + return this; + } + + /** + * Whether currency's deposit is disabled + * @return depositDisabled + **/ + @javax.annotation.Nullable + public Boolean getDepositDisabled() { + return depositDisabled; + } + + + public void setDepositDisabled(Boolean depositDisabled) { + this.depositDisabled = depositDisabled; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpotCurrencyChain spotCurrencyChain = (SpotCurrencyChain) o; + return Objects.equals(this.name, spotCurrencyChain.name) && + Objects.equals(this.addr, spotCurrencyChain.addr) && + Objects.equals(this.withdrawDisabled, spotCurrencyChain.withdrawDisabled) && + Objects.equals(this.withdrawDelayed, spotCurrencyChain.withdrawDelayed) && + Objects.equals(this.depositDisabled, spotCurrencyChain.depositDisabled); + } + + @Override + public int hashCode() { + return Objects.hash(name, addr, withdrawDisabled, withdrawDelayed, depositDisabled); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpotCurrencyChain {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); + sb.append(" withdrawDisabled: ").append(toIndentedString(withdrawDisabled)).append("\n"); + sb.append(" withdrawDelayed: ").append(toIndentedString(withdrawDelayed)).append("\n"); + sb.append(" depositDisabled: ").append(toIndentedString(depositDisabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SpotFee.java b/src/main/java/io/gate/gateapi/models/SpotFee.java new file mode 100644 index 0000000..d81a14e --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SpotFee.java @@ -0,0 +1,323 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SpotFee + */ +public class SpotFee { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_TAKER_FEE = "taker_fee"; + @SerializedName(SERIALIZED_NAME_TAKER_FEE) + private String takerFee; + + public static final String SERIALIZED_NAME_MAKER_FEE = "maker_fee"; + @SerializedName(SERIALIZED_NAME_MAKER_FEE) + private String makerFee; + + public static final String SERIALIZED_NAME_GT_DISCOUNT = "gt_discount"; + @SerializedName(SERIALIZED_NAME_GT_DISCOUNT) + private Boolean gtDiscount; + + public static final String SERIALIZED_NAME_GT_TAKER_FEE = "gt_taker_fee"; + @SerializedName(SERIALIZED_NAME_GT_TAKER_FEE) + private String gtTakerFee; + + public static final String SERIALIZED_NAME_GT_MAKER_FEE = "gt_maker_fee"; + @SerializedName(SERIALIZED_NAME_GT_MAKER_FEE) + private String gtMakerFee; + + public static final String SERIALIZED_NAME_LOAN_FEE = "loan_fee"; + @SerializedName(SERIALIZED_NAME_LOAN_FEE) + private String loanFee; + + public static final String SERIALIZED_NAME_POINT_TYPE = "point_type"; + @SerializedName(SERIALIZED_NAME_POINT_TYPE) + private String pointType; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_DEBIT_FEE = "debit_fee"; + @SerializedName(SERIALIZED_NAME_DEBIT_FEE) + private Integer debitFee; + + + public SpotFee userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public SpotFee takerFee(String takerFee) { + + this.takerFee = takerFee; + return this; + } + + /** + * taker fee rate + * @return takerFee + **/ + @javax.annotation.Nullable + public String getTakerFee() { + return takerFee; + } + + + public void setTakerFee(String takerFee) { + this.takerFee = takerFee; + } + + public SpotFee makerFee(String makerFee) { + + this.makerFee = makerFee; + return this; + } + + /** + * maker fee rate + * @return makerFee + **/ + @javax.annotation.Nullable + public String getMakerFee() { + return makerFee; + } + + + public void setMakerFee(String makerFee) { + this.makerFee = makerFee; + } + + public SpotFee gtDiscount(Boolean gtDiscount) { + + this.gtDiscount = gtDiscount; + return this; + } + + /** + * Whether GT deduction discount is enabled + * @return gtDiscount + **/ + @javax.annotation.Nullable + public Boolean getGtDiscount() { + return gtDiscount; + } + + + public void setGtDiscount(Boolean gtDiscount) { + this.gtDiscount = gtDiscount; + } + + public SpotFee gtTakerFee(String gtTakerFee) { + + this.gtTakerFee = gtTakerFee; + return this; + } + + /** + * Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled + * @return gtTakerFee + **/ + @javax.annotation.Nullable + public String getGtTakerFee() { + return gtTakerFee; + } + + + public void setGtTakerFee(String gtTakerFee) { + this.gtTakerFee = gtTakerFee; + } + + public SpotFee gtMakerFee(String gtMakerFee) { + + this.gtMakerFee = gtMakerFee; + return this; + } + + /** + * Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled + * @return gtMakerFee + **/ + @javax.annotation.Nullable + public String getGtMakerFee() { + return gtMakerFee; + } + + + public void setGtMakerFee(String gtMakerFee) { + this.gtMakerFee = gtMakerFee; + } + + public SpotFee loanFee(String loanFee) { + + this.loanFee = loanFee; + return this; + } + + /** + * Loan fee rate of margin lending + * @return loanFee + **/ + @javax.annotation.Nullable + public String getLoanFee() { + return loanFee; + } + + + public void setLoanFee(String loanFee) { + this.loanFee = loanFee; + } + + public SpotFee pointType(String pointType) { + + this.pointType = pointType; + return this; + } + + /** + * Point card type: 0 - Original version, 1 - New version since 202009 + * @return pointType + **/ + @javax.annotation.Nullable + public String getPointType() { + return pointType; + } + + + public void setPointType(String pointType) { + this.pointType = pointType; + } + + public SpotFee currencyPair(String currencyPair) { + + this.currencyPair = currencyPair; + return this; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + public void setCurrencyPair(String currencyPair) { + this.currencyPair = currencyPair; + } + + public SpotFee debitFee(Integer debitFee) { + + this.debitFee = debitFee; + return this; + } + + /** + * Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates + * @return debitFee + **/ + @javax.annotation.Nullable + public Integer getDebitFee() { + return debitFee; + } + + + public void setDebitFee(Integer debitFee) { + this.debitFee = debitFee; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpotFee spotFee = (SpotFee) o; + return Objects.equals(this.userId, spotFee.userId) && + Objects.equals(this.takerFee, spotFee.takerFee) && + Objects.equals(this.makerFee, spotFee.makerFee) && + Objects.equals(this.gtDiscount, spotFee.gtDiscount) && + Objects.equals(this.gtTakerFee, spotFee.gtTakerFee) && + Objects.equals(this.gtMakerFee, spotFee.gtMakerFee) && + Objects.equals(this.loanFee, spotFee.loanFee) && + Objects.equals(this.pointType, spotFee.pointType) && + Objects.equals(this.currencyPair, spotFee.currencyPair) && + Objects.equals(this.debitFee, spotFee.debitFee); + } + + @Override + public int hashCode() { + return Objects.hash(userId, takerFee, makerFee, gtDiscount, gtTakerFee, gtMakerFee, loanFee, pointType, currencyPair, debitFee); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpotFee {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" takerFee: ").append(toIndentedString(takerFee)).append("\n"); + sb.append(" makerFee: ").append(toIndentedString(makerFee)).append("\n"); + sb.append(" gtDiscount: ").append(toIndentedString(gtDiscount)).append("\n"); + sb.append(" gtTakerFee: ").append(toIndentedString(gtTakerFee)).append("\n"); + sb.append(" gtMakerFee: ").append(toIndentedString(gtMakerFee)).append("\n"); + sb.append(" loanFee: ").append(toIndentedString(loanFee)).append("\n"); + sb.append(" pointType: ").append(toIndentedString(pointType)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" debitFee: ").append(toIndentedString(debitFee)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SpotInsuranceHistory.java b/src/main/java/io/gate/gateapi/models/SpotInsuranceHistory.java new file mode 100644 index 0000000..36464d2 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SpotInsuranceHistory.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SpotInsuranceHistory + */ +public class SpotInsuranceHistory { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_BALANCE = "balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private String balance; + + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Long time; + + + public SpotInsuranceHistory currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public SpotInsuranceHistory balance(String balance) { + + this.balance = balance; + return this; + } + + /** + * Balance + * @return balance + **/ + @javax.annotation.Nullable + public String getBalance() { + return balance; + } + + + public void setBalance(String balance) { + this.balance = balance; + } + + public SpotInsuranceHistory time(Long time) { + + this.time = time; + return this; + } + + /** + * Creation time, timestamp, milliseconds + * @return time + **/ + @javax.annotation.Nullable + public Long getTime() { + return time; + } + + + public void setTime(Long time) { + this.time = time; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpotInsuranceHistory spotInsuranceHistory = (SpotInsuranceHistory) o; + return Objects.equals(this.currency, spotInsuranceHistory.currency) && + Objects.equals(this.balance, spotInsuranceHistory.balance) && + Objects.equals(this.time, spotInsuranceHistory.time); + } + + @Override + public int hashCode() { + return Objects.hash(currency, balance, time); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpotInsuranceHistory {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SpotPricePutOrder.java b/src/main/java/io/gate/gateapi/models/SpotPricePutOrder.java index f60515c..ee0739b 100644 --- a/src/main/java/io/gate/gateapi/models/SpotPricePutOrder.java +++ b/src/main/java/io/gate/gateapi/models/SpotPricePutOrder.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 @@ -23,9 +23,56 @@ * SpotPricePutOrder */ public class SpotPricePutOrder { + /** + * Order type,default to `limit` - limit : Limit Order - market : Market Order + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + LIMIT("limit"), + + MARKET("market"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type = "limit"; + private TypeEnum type = TypeEnum.LIMIT; /** * Order side - buy: buy side - sell: sell side @@ -87,13 +134,15 @@ public SideEnum read(final JsonReader jsonReader) throws IOException { private String amount; /** - * Trading type - normal: spot trading - margin: margin trading + * Trading account type. Unified account must be set to `unified` - normal: spot trading - margin: margin trading - unified: unified account */ @JsonAdapter(AccountEnum.Adapter.class) public enum AccountEnum { NORMAL("normal"), - MARGIN("margin"); + MARGIN("margin"), + + UNIFIED("unified"); private String value; @@ -135,7 +184,7 @@ public AccountEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ACCOUNT = "account"; @SerializedName(SERIALIZED_NAME_ACCOUNT) - private AccountEnum account; + private AccountEnum account = AccountEnum.NORMAL; /** * time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only @@ -186,26 +235,38 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_TIME_IN_FORCE = "time_in_force"; @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) - private TimeInForceEnum timeInForce; + private TimeInForceEnum timeInForce = TimeInForceEnum.GTC; + + public static final String SERIALIZED_NAME_AUTO_BORROW = "auto_borrow"; + @SerializedName(SERIALIZED_NAME_AUTO_BORROW) + private Boolean autoBorrow = false; + + public static final String SERIALIZED_NAME_AUTO_REPAY = "auto_repay"; + @SerializedName(SERIALIZED_NAME_AUTO_REPAY) + private Boolean autoRepay = false; + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; - public SpotPricePutOrder type(String type) { + + public SpotPricePutOrder type(TypeEnum type) { this.type = type; return this; } /** - * Order type, default to `limit` + * Order type,default to `limit` - limit : Limit Order - market : Market Order * @return type **/ @javax.annotation.Nullable - public String getType() { + public TypeEnum getType() { return type; } - public void setType(String type) { + public void setType(TypeEnum type) { this.type = type; } @@ -254,7 +315,7 @@ public SpotPricePutOrder amount(String amount) { } /** - * Order amount + * 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` * @return amount **/ public String getAmount() { @@ -273,7 +334,7 @@ public SpotPricePutOrder account(AccountEnum account) { } /** - * Trading type - normal: spot trading - margin: margin trading + * Trading account type. Unified account must be set to `unified` - normal: spot trading - margin: margin trading - unified: unified account * @return account **/ public AccountEnum getAccount() { @@ -304,6 +365,66 @@ public TimeInForceEnum getTimeInForce() { public void setTimeInForce(TimeInForceEnum timeInForce) { this.timeInForce = timeInForce; } + + public SpotPricePutOrder autoBorrow(Boolean autoBorrow) { + + this.autoBorrow = autoBorrow; + return this; + } + + /** + * Whether to borrow coins automatically + * @return autoBorrow + **/ + @javax.annotation.Nullable + public Boolean getAutoBorrow() { + return autoBorrow; + } + + + public void setAutoBorrow(Boolean autoBorrow) { + this.autoBorrow = autoBorrow; + } + + public SpotPricePutOrder autoRepay(Boolean autoRepay) { + + this.autoRepay = autoRepay; + return this; + } + + /** + * Whether to repay the loan automatically + * @return autoRepay + **/ + @javax.annotation.Nullable + public Boolean getAutoRepay() { + return autoRepay; + } + + + public void setAutoRepay(Boolean autoRepay) { + this.autoRepay = autoRepay; + } + + public SpotPricePutOrder text(String text) { + + this.text = text; + return this; + } + + /** + * The source of the order, including: - web: Web - api: API call - app: Mobile app + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -318,12 +439,15 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.price, spotPricePutOrder.price) && Objects.equals(this.amount, spotPricePutOrder.amount) && Objects.equals(this.account, spotPricePutOrder.account) && - Objects.equals(this.timeInForce, spotPricePutOrder.timeInForce); + Objects.equals(this.timeInForce, spotPricePutOrder.timeInForce) && + Objects.equals(this.autoBorrow, spotPricePutOrder.autoBorrow) && + Objects.equals(this.autoRepay, spotPricePutOrder.autoRepay) && + Objects.equals(this.text, spotPricePutOrder.text); } @Override public int hashCode() { - return Objects.hash(type, side, price, amount, account, timeInForce); + return Objects.hash(type, side, price, amount, account, timeInForce, autoBorrow, autoRepay, text); } @@ -337,6 +461,9 @@ public String toString() { sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" account: ").append(toIndentedString(account)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" autoBorrow: ").append(toIndentedString(autoBorrow)).append("\n"); + sb.append(" autoRepay: ").append(toIndentedString(autoRepay)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/SpotPriceTrigger.java b/src/main/java/io/gate/gateapi/models/SpotPriceTrigger.java index 7be6a47..843ec5f 100644 --- a/src/main/java/io/gate/gateapi/models/SpotPriceTrigger.java +++ b/src/main/java/io/gate/gateapi/models/SpotPriceTrigger.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 @@ -28,7 +28,7 @@ public class SpotPriceTrigger { private String price; /** - * 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 + * 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` */ @JsonAdapter(RuleEnum.Adapter.class) public enum RuleEnum { @@ -109,7 +109,7 @@ public SpotPriceTrigger rule(RuleEnum rule) { } /** - * 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 + * 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` * @return rule **/ public RuleEnum getRule() { @@ -128,7 +128,7 @@ public SpotPriceTrigger expiration(Integer expiration) { } /** - * How long (in seconds) to wait for the condition to be triggered before cancelling the order. + * Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout * @return expiration **/ public Integer getExpiration() { diff --git a/src/main/java/io/gate/gateapi/models/SpotPriceTriggeredOrder.java b/src/main/java/io/gate/gateapi/models/SpotPriceTriggeredOrder.java index 8adb28d..c4dd8e0 100644 --- a/src/main/java/io/gate/gateapi/models/SpotPriceTriggeredOrder.java +++ b/src/main/java/io/gate/gateapi/models/SpotPriceTriggeredOrder.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 @@ -22,7 +22,7 @@ import java.io.IOException; /** - * Spot order detail + * Spot price order details */ public class SpotPriceTriggeredOrder { public static final String SERIALIZED_NAME_TRIGGER = "trigger"; @@ -47,11 +47,11 @@ public class SpotPriceTriggeredOrder { public static final String SERIALIZED_NAME_CTIME = "ctime"; @SerializedName(SERIALIZED_NAME_CTIME) - private Double ctime; + private Long ctime; public static final String SERIALIZED_NAME_FTIME = "ftime"; @SerializedName(SERIALIZED_NAME_FTIME) - private Double ftime; + private Long ftime; public static final String SERIALIZED_NAME_FIRED_ORDER_ID = "fired_order_id"; @SerializedName(SERIALIZED_NAME_FIRED_ORDER_ID) @@ -131,7 +131,7 @@ public SpotPriceTriggeredOrder market(String market) { } /** - * Currency pair + * Market * @return market **/ public String getMarket() { @@ -144,27 +144,27 @@ public void setMarket(String market) { } /** - * Creation time + * Created time * @return ctime **/ @javax.annotation.Nullable - public Double getCtime() { + public Long getCtime() { return ctime; } /** - * Finished time + * End time * @return ftime **/ @javax.annotation.Nullable - public Double getFtime() { + public Long getFtime() { return ftime; } /** - * ID of the newly created order on condition triggered + * ID of the order created after trigger * @return firedOrderId **/ @javax.annotation.Nullable @@ -174,7 +174,7 @@ public Long getFiredOrderId() { /** - * Status - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired + * Status - open: Running - cancelled: Manually cancelled - finish: Successfully completed - failed: Failed to execute - expired: Expired * @return status **/ @javax.annotation.Nullable @@ -184,7 +184,7 @@ public String getStatus() { /** - * Additional remarks on how the order was finished + * Additional description of how the order was completed * @return reason **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/Repayment.java b/src/main/java/io/gate/gateapi/models/StpGroup.java similarity index 51% rename from src/main/java/io/gate/gateapi/models/Repayment.java rename to src/main/java/io/gate/gateapi/models/StpGroup.java index 27920e9..bc53e57 100644 --- a/src/main/java/io/gate/gateapi/models/Repayment.java +++ b/src/main/java/io/gate/gateapi/models/StpGroup.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 @@ -20,104 +20,103 @@ import java.io.IOException; /** - * Repayment + * StpGroup */ -public class Repayment { +public class StpGroup { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) - private String id; + private Long id; - public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; - @SerializedName(SERIALIZED_NAME_CREATE_TIME) - private String createTime; + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public static final String SERIALIZED_NAME_PRINCIPAL = "principal"; - @SerializedName(SERIALIZED_NAME_PRINCIPAL) - private String principal; + public static final String SERIALIZED_NAME_CREATOR_ID = "creator_id"; + @SerializedName(SERIALIZED_NAME_CREATOR_ID) + private Long creatorId; - public static final String SERIALIZED_NAME_INTEREST = "interest"; - @SerializedName(SERIALIZED_NAME_INTEREST) - private String interest; + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; - public Repayment id(String id) { + public StpGroup id(Long id) { this.id = id; return this; } /** - * Loan record ID + * STP Group ID * @return id **/ @javax.annotation.Nullable - public String getId() { + public Long getId() { return id; } - public void setId(String id) { + public void setId(Long id) { this.id = id; } - public Repayment createTime(String createTime) { + public StpGroup name(String name) { - this.createTime = createTime; + this.name = name; return this; } /** - * Repayment time - * @return createTime + * STP Group name + * @return name **/ - @javax.annotation.Nullable - public String getCreateTime() { - return createTime; + public String getName() { + return name; } - public void setCreateTime(String createTime) { - this.createTime = createTime; + public void setName(String name) { + this.name = name; } - public Repayment principal(String principal) { + public StpGroup creatorId(Long creatorId) { - this.principal = principal; + this.creatorId = creatorId; return this; } /** - * Repaid principal - * @return principal + * Creator ID + * @return creatorId **/ @javax.annotation.Nullable - public String getPrincipal() { - return principal; + public Long getCreatorId() { + return creatorId; } - public void setPrincipal(String principal) { - this.principal = principal; + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; } - public Repayment interest(String interest) { + public StpGroup createTime(Long createTime) { - this.interest = interest; + this.createTime = createTime; return this; } /** - * Repaid interest - * @return interest + * Created time + * @return createTime **/ @javax.annotation.Nullable - public String getInterest() { - return interest; + public Long getCreateTime() { + return createTime; } - public void setInterest(String interest) { - this.interest = interest; + public void setCreateTime(Long createTime) { + this.createTime = createTime; } @Override public boolean equals(java.lang.Object o) { @@ -127,27 +126,27 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Repayment repayment = (Repayment) o; - return Objects.equals(this.id, repayment.id) && - Objects.equals(this.createTime, repayment.createTime) && - Objects.equals(this.principal, repayment.principal) && - Objects.equals(this.interest, repayment.interest); + StpGroup stpGroup = (StpGroup) o; + return Objects.equals(this.id, stpGroup.id) && + Objects.equals(this.name, stpGroup.name) && + Objects.equals(this.creatorId, stpGroup.creatorId) && + Objects.equals(this.createTime, stpGroup.createTime); } @Override public int hashCode() { - return Objects.hash(id, createTime, principal, interest); + return Objects.hash(id, name, creatorId, createTime); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Repayment {\n"); + sb.append("class StpGroup {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" creatorId: ").append(toIndentedString(creatorId)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); - sb.append(" principal: ").append(toIndentedString(principal)).append("\n"); - sb.append(" interest: ").append(toIndentedString(interest)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/StpGroupUser.java b/src/main/java/io/gate/gateapi/models/StpGroupUser.java new file mode 100644 index 0000000..f69d405 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/StpGroupUser.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * StpGroupUser + */ +public class StpGroupUser { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_STP_ID = "stp_id"; + @SerializedName(SERIALIZED_NAME_STP_ID) + private Long stpId; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + public StpGroupUser userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public StpGroupUser stpId(Long stpId) { + + this.stpId = stpId; + return this; + } + + /** + * STP Group ID + * @return stpId + **/ + @javax.annotation.Nullable + public Long getStpId() { + return stpId; + } + + + public void setStpId(Long stpId) { + this.stpId = stpId; + } + + public StpGroupUser createTime(Long createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StpGroupUser stpGroupUser = (StpGroupUser) o; + return Objects.equals(this.userId, stpGroupUser.userId) && + Objects.equals(this.stpId, stpGroupUser.stpId) && + Objects.equals(this.createTime, stpGroupUser.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(userId, stpId, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StpGroupUser {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" stpId: ").append(toIndentedString(stpId)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/StructuredBuy.java b/src/main/java/io/gate/gateapi/models/StructuredBuy.java new file mode 100644 index 0000000..999fc46 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/StructuredBuy.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Dual Investment Buy + */ +public class StructuredBuy { + public static final String SERIALIZED_NAME_PID = "pid"; + @SerializedName(SERIALIZED_NAME_PID) + private String pid; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + + public StructuredBuy pid(String pid) { + + this.pid = pid; + return this; + } + + /** + * Product ID + * @return pid + **/ + @javax.annotation.Nullable + public String getPid() { + return pid; + } + + + public void setPid(String pid) { + this.pid = pid; + } + + public StructuredBuy amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Buy Quantity + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StructuredBuy structuredBuy = (StructuredBuy) o; + return Objects.equals(this.pid, structuredBuy.pid) && + Objects.equals(this.amount, structuredBuy.amount); + } + + @Override + public int hashCode() { + return Objects.hash(pid, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StructuredBuy {\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/StructuredGetProjectList.java b/src/main/java/io/gate/gateapi/models/StructuredGetProjectList.java new file mode 100644 index 0000000..11bcdd9 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/StructuredGetProjectList.java @@ -0,0 +1,375 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Structured Investment + */ +public class StructuredGetProjectList { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Integer id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_NAME_EN = "name_en"; + @SerializedName(SERIALIZED_NAME_NAME_EN) + private String nameEn; + + public static final String SERIALIZED_NAME_INVESTMENT_COIN = "investment_coin"; + @SerializedName(SERIALIZED_NAME_INVESTMENT_COIN) + private String investmentCoin; + + public static final String SERIALIZED_NAME_INVESTMENT_PERIOD = "investment_period"; + @SerializedName(SERIALIZED_NAME_INVESTMENT_PERIOD) + private String investmentPeriod; + + public static final String SERIALIZED_NAME_MIN_ANNUAL_RATE = "min_annual_rate"; + @SerializedName(SERIALIZED_NAME_MIN_ANNUAL_RATE) + private String minAnnualRate; + + public static final String SERIALIZED_NAME_MID_ANNUAL_RATE = "mid_annual_rate"; + @SerializedName(SERIALIZED_NAME_MID_ANNUAL_RATE) + private String midAnnualRate; + + public static final String SERIALIZED_NAME_MAX_ANNUAL_RATE = "max_annual_rate"; + @SerializedName(SERIALIZED_NAME_MAX_ANNUAL_RATE) + private String maxAnnualRate; + + public static final String SERIALIZED_NAME_WATCH_MARKET = "watch_market"; + @SerializedName(SERIALIZED_NAME_WATCH_MARKET) + private String watchMarket; + + public static final String SERIALIZED_NAME_START_TIME = "start_time"; + @SerializedName(SERIALIZED_NAME_START_TIME) + private Integer startTime; + + public static final String SERIALIZED_NAME_END_TIME = "end_time"; + @SerializedName(SERIALIZED_NAME_END_TIME) + private Integer endTime; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + + public StructuredGetProjectList id(Integer id) { + + this.id = id; + return this; + } + + /** + * Product ID + * @return id + **/ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + + public void setId(Integer id) { + this.id = id; + } + + public StructuredGetProjectList type(String type) { + + this.type = type; + return this; + } + + /** + * 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 + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + public StructuredGetProjectList nameEn(String nameEn) { + + this.nameEn = nameEn; + return this; + } + + /** + * Product Name + * @return nameEn + **/ + @javax.annotation.Nullable + public String getNameEn() { + return nameEn; + } + + + public void setNameEn(String nameEn) { + this.nameEn = nameEn; + } + + public StructuredGetProjectList investmentCoin(String investmentCoin) { + + this.investmentCoin = investmentCoin; + return this; + } + + /** + * Investment Token + * @return investmentCoin + **/ + @javax.annotation.Nullable + public String getInvestmentCoin() { + return investmentCoin; + } + + + public void setInvestmentCoin(String investmentCoin) { + this.investmentCoin = investmentCoin; + } + + public StructuredGetProjectList investmentPeriod(String investmentPeriod) { + + this.investmentPeriod = investmentPeriod; + return this; + } + + /** + * Investment Period + * @return investmentPeriod + **/ + @javax.annotation.Nullable + public String getInvestmentPeriod() { + return investmentPeriod; + } + + + public void setInvestmentPeriod(String investmentPeriod) { + this.investmentPeriod = investmentPeriod; + } + + public StructuredGetProjectList minAnnualRate(String minAnnualRate) { + + this.minAnnualRate = minAnnualRate; + return this; + } + + /** + * Minimum Annual Rate + * @return minAnnualRate + **/ + @javax.annotation.Nullable + public String getMinAnnualRate() { + return minAnnualRate; + } + + + public void setMinAnnualRate(String minAnnualRate) { + this.minAnnualRate = minAnnualRate; + } + + public StructuredGetProjectList midAnnualRate(String midAnnualRate) { + + this.midAnnualRate = midAnnualRate; + return this; + } + + /** + * Intermediate Annual Rate + * @return midAnnualRate + **/ + @javax.annotation.Nullable + public String getMidAnnualRate() { + return midAnnualRate; + } + + + public void setMidAnnualRate(String midAnnualRate) { + this.midAnnualRate = midAnnualRate; + } + + public StructuredGetProjectList maxAnnualRate(String maxAnnualRate) { + + this.maxAnnualRate = maxAnnualRate; + return this; + } + + /** + * Maximum Annual Rate + * @return maxAnnualRate + **/ + @javax.annotation.Nullable + public String getMaxAnnualRate() { + return maxAnnualRate; + } + + + public void setMaxAnnualRate(String maxAnnualRate) { + this.maxAnnualRate = maxAnnualRate; + } + + public StructuredGetProjectList watchMarket(String watchMarket) { + + this.watchMarket = watchMarket; + return this; + } + + /** + * Underlying Market + * @return watchMarket + **/ + @javax.annotation.Nullable + public String getWatchMarket() { + return watchMarket; + } + + + public void setWatchMarket(String watchMarket) { + this.watchMarket = watchMarket; + } + + public StructuredGetProjectList startTime(Integer startTime) { + + this.startTime = startTime; + return this; + } + + /** + * Start Time + * @return startTime + **/ + @javax.annotation.Nullable + public Integer getStartTime() { + return startTime; + } + + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public StructuredGetProjectList endTime(Integer endTime) { + + this.endTime = endTime; + return this; + } + + /** + * End time + * @return endTime + **/ + @javax.annotation.Nullable + public Integer getEndTime() { + return endTime; + } + + + public void setEndTime(Integer endTime) { + this.endTime = endTime; + } + + public StructuredGetProjectList status(String status) { + + this.status = status; + return this; + } + + /** + * Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StructuredGetProjectList structuredGetProjectList = (StructuredGetProjectList) o; + return Objects.equals(this.id, structuredGetProjectList.id) && + Objects.equals(this.type, structuredGetProjectList.type) && + Objects.equals(this.nameEn, structuredGetProjectList.nameEn) && + Objects.equals(this.investmentCoin, structuredGetProjectList.investmentCoin) && + Objects.equals(this.investmentPeriod, structuredGetProjectList.investmentPeriod) && + Objects.equals(this.minAnnualRate, structuredGetProjectList.minAnnualRate) && + Objects.equals(this.midAnnualRate, structuredGetProjectList.midAnnualRate) && + Objects.equals(this.maxAnnualRate, structuredGetProjectList.maxAnnualRate) && + Objects.equals(this.watchMarket, structuredGetProjectList.watchMarket) && + Objects.equals(this.startTime, structuredGetProjectList.startTime) && + Objects.equals(this.endTime, structuredGetProjectList.endTime) && + Objects.equals(this.status, structuredGetProjectList.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, nameEn, investmentCoin, investmentPeriod, minAnnualRate, midAnnualRate, maxAnnualRate, watchMarket, startTime, endTime, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StructuredGetProjectList {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nameEn: ").append(toIndentedString(nameEn)).append("\n"); + sb.append(" investmentCoin: ").append(toIndentedString(investmentCoin)).append("\n"); + sb.append(" investmentPeriod: ").append(toIndentedString(investmentPeriod)).append("\n"); + sb.append(" minAnnualRate: ").append(toIndentedString(minAnnualRate)).append("\n"); + sb.append(" midAnnualRate: ").append(toIndentedString(midAnnualRate)).append("\n"); + sb.append(" maxAnnualRate: ").append(toIndentedString(maxAnnualRate)).append("\n"); + sb.append(" watchMarket: ").append(toIndentedString(watchMarket)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/StructuredOrderList.java b/src/main/java/io/gate/gateapi/models/StructuredOrderList.java new file mode 100644 index 0000000..dd1e269 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/StructuredOrderList.java @@ -0,0 +1,245 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Structured order + */ +public class StructuredOrderList { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Integer id; + + public static final String SERIALIZED_NAME_PID = "pid"; + @SerializedName(SERIALIZED_NAME_PID) + private String pid; + + public static final String SERIALIZED_NAME_LOCK_COIN = "lock_coin"; + @SerializedName(SERIALIZED_NAME_LOCK_COIN) + private String lockCoin; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_INCOME = "income"; + @SerializedName(SERIALIZED_NAME_INCOME) + private String income; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Integer createTime; + + + public StructuredOrderList id(Integer id) { + + this.id = id; + return this; + } + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + + public void setId(Integer id) { + this.id = id; + } + + public StructuredOrderList pid(String pid) { + + this.pid = pid; + return this; + } + + /** + * Product ID + * @return pid + **/ + @javax.annotation.Nullable + public String getPid() { + return pid; + } + + + public void setPid(String pid) { + this.pid = pid; + } + + public StructuredOrderList lockCoin(String lockCoin) { + + this.lockCoin = lockCoin; + return this; + } + + /** + * Locked coin + * @return lockCoin + **/ + @javax.annotation.Nullable + public String getLockCoin() { + return lockCoin; + } + + + public void setLockCoin(String lockCoin) { + this.lockCoin = lockCoin; + } + + public StructuredOrderList amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Locked amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public StructuredOrderList status(String status) { + + this.status = status; + return this; + } + + /** + * Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + public StructuredOrderList income(String income) { + + this.income = income; + return this; + } + + /** + * Income + * @return income + **/ + @javax.annotation.Nullable + public String getIncome() { + return income; + } + + + public void setIncome(String income) { + this.income = income; + } + + public StructuredOrderList createTime(Integer createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Integer getCreateTime() { + return createTime; + } + + + public void setCreateTime(Integer createTime) { + this.createTime = createTime; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StructuredOrderList structuredOrderList = (StructuredOrderList) o; + return Objects.equals(this.id, structuredOrderList.id) && + Objects.equals(this.pid, structuredOrderList.pid) && + Objects.equals(this.lockCoin, structuredOrderList.lockCoin) && + Objects.equals(this.amount, structuredOrderList.amount) && + Objects.equals(this.status, structuredOrderList.status) && + Objects.equals(this.income, structuredOrderList.income) && + Objects.equals(this.createTime, structuredOrderList.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(id, pid, lockCoin, amount, status, income, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StructuredOrderList {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append(" lockCoin: ").append(toIndentedString(lockCoin)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" income: ").append(toIndentedString(income)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccount.java b/src/main/java/io/gate/gateapi/models/SubAccount.java new file mode 100644 index 0000000..29635d8 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccount.java @@ -0,0 +1,230 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SubAccount + */ +public class SubAccount { + public static final String SERIALIZED_NAME_REMARK = "remark"; + @SerializedName(SERIALIZED_NAME_REMARK) + private String remark; + + public static final String SERIALIZED_NAME_LOGIN_NAME = "login_name"; + @SerializedName(SERIALIZED_NAME_LOGIN_NAME) + private String loginName; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private Integer state; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Integer type; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + public SubAccount remark(String remark) { + + this.remark = remark; + return this; + } + + /** + * Remark + * @return remark + **/ + @javax.annotation.Nullable + public String getRemark() { + return remark; + } + + + public void setRemark(String remark) { + this.remark = remark; + } + + public SubAccount loginName(String loginName) { + + this.loginName = loginName; + return this; + } + + /** + * Sub-account login name: Only letters, numbers and underscores are supported, cannot contain other invalid characters + * @return loginName + **/ + public String getLoginName() { + return loginName; + } + + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public SubAccount password(String password) { + + this.password = password; + return this; + } + + /** + * The sub-account's password. (Default: the same as main account's password) + * @return password + **/ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + public SubAccount email(String email) { + + this.email = email; + return this; + } + + /** + * The sub-account's email address. (Default: the same as main account's email address) + * @return email + **/ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + /** + * Sub-account status: 1-normal, 2-locked + * @return state + **/ + @javax.annotation.Nullable + public Integer getState() { + return state; + } + + + /** + * Sub-account type: 1-Regular sub-account, 3-Cross margin sub-account + * @return type + **/ + @javax.annotation.Nullable + public Integer getType() { + return type; + } + + + /** + * Sub-account user ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccount subAccount = (SubAccount) o; + return Objects.equals(this.remark, subAccount.remark) && + Objects.equals(this.loginName, subAccount.loginName) && + Objects.equals(this.password, subAccount.password) && + Objects.equals(this.email, subAccount.email) && + Objects.equals(this.state, subAccount.state) && + Objects.equals(this.type, subAccount.type) && + Objects.equals(this.userId, subAccount.userId) && + Objects.equals(this.createTime, subAccount.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(remark, loginName, password, email, state, type, userId, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccount {\n"); + sb.append(" remark: ").append(toIndentedString(remark)).append("\n"); + sb.append(" loginName: ").append(toIndentedString(loginName)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccountBalance.java b/src/main/java/io/gate/gateapi/models/SubAccountBalance.java index 8edd08a..802a901 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccountBalance.java +++ b/src/main/java/io/gate/gateapi/models/SubAccountBalance.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/models/SubAccountCrossMarginBalance.java b/src/main/java/io/gate/gateapi/models/SubAccountCrossMarginBalance.java new file mode 100644 index 0000000..b1b2c3f --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccountCrossMarginBalance.java @@ -0,0 +1,116 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.SubCrossMarginAccount; +import java.io.IOException; + +/** + * SubAccountCrossMarginBalance + */ +public class SubAccountCrossMarginBalance { + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private String uid; + + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private SubCrossMarginAccount available; + + + public SubAccountCrossMarginBalance uid(String uid) { + + this.uid = uid; + return this; + } + + /** + * User ID + * @return uid + **/ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + + public void setUid(String uid) { + this.uid = uid; + } + + public SubAccountCrossMarginBalance available(SubCrossMarginAccount available) { + + this.available = available; + return this; + } + + /** + * 账户余额信息 + * @return available + **/ + @javax.annotation.Nullable + public SubCrossMarginAccount getAvailable() { + return available; + } + + + public void setAvailable(SubCrossMarginAccount available) { + this.available = available; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountCrossMarginBalance subAccountCrossMarginBalance = (SubAccountCrossMarginBalance) o; + return Objects.equals(this.uid, subAccountCrossMarginBalance.uid) && + Objects.equals(this.available, subAccountCrossMarginBalance.available); + } + + @Override + public int hashCode() { + return Objects.hash(uid, available); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountCrossMarginBalance {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" available: ").append(toIndentedString(available)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccountFuturesBalance.java b/src/main/java/io/gate/gateapi/models/SubAccountFuturesBalance.java new file mode 100644 index 0000000..8b01461 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccountFuturesBalance.java @@ -0,0 +1,127 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.FuturesAccount; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * SubAccountFuturesBalance + */ +public class SubAccountFuturesBalance { + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private String uid; + + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private Map available = null; + + + public SubAccountFuturesBalance uid(String uid) { + + this.uid = uid; + return this; + } + + /** + * User ID + * @return uid + **/ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + + public void setUid(String uid) { + this.uid = uid; + } + + public SubAccountFuturesBalance available(Map available) { + + this.available = available; + return this; + } + + public SubAccountFuturesBalance putAvailableItem(String key, FuturesAccount availableItem) { + if (this.available == null) { + this.available = new HashMap<>(); + } + this.available.put(key, availableItem); + return this; + } + + /** + * Futures account balances + * @return available + **/ + @javax.annotation.Nullable + public Map getAvailable() { + return available; + } + + + public void setAvailable(Map available) { + this.available = available; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountFuturesBalance subAccountFuturesBalance = (SubAccountFuturesBalance) o; + return Objects.equals(this.uid, subAccountFuturesBalance.uid) && + Objects.equals(this.available, subAccountFuturesBalance.available); + } + + @Override + public int hashCode() { + return Objects.hash(uid, available); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountFuturesBalance {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" available: ").append(toIndentedString(available)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccountKey.java b/src/main/java/io/gate/gateapi/models/SubAccountKey.java new file mode 100644 index 0000000..3725e4b --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccountKey.java @@ -0,0 +1,282 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.SubAccountKeyPerms; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * SubAccountKey + */ +public class SubAccountKey { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private Integer mode; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PERMS = "perms"; + @SerializedName(SERIALIZED_NAME_PERMS) + private List perms = null; + + public static final String SERIALIZED_NAME_IP_WHITELIST = "ip_whitelist"; + @SerializedName(SERIALIZED_NAME_IP_WHITELIST) + private List ipWhitelist = null; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private Integer state; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private Long createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private Long updatedAt; + + public static final String SERIALIZED_NAME_LAST_ACCESS = "last_access"; + @SerializedName(SERIALIZED_NAME_LAST_ACCESS) + private Long lastAccess; + + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public SubAccountKey mode(Integer mode) { + + this.mode = mode; + return this; + } + + /** + * Mode: 1 - classic 2 - portfolio account + * @return mode + **/ + @javax.annotation.Nullable + public Integer getMode() { + return mode; + } + + + public void setMode(Integer mode) { + this.mode = mode; + } + + public SubAccountKey name(String name) { + + this.name = name; + return this; + } + + /** + * API Key Name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public SubAccountKey perms(List perms) { + + this.perms = perms; + return this; + } + + public SubAccountKey addPermsItem(SubAccountKeyPerms permsItem) { + if (this.perms == null) { + this.perms = new ArrayList<>(); + } + this.perms.add(permsItem); + return this; + } + + /** + * Get perms + * @return perms + **/ + @javax.annotation.Nullable + public List getPerms() { + return perms; + } + + + public void setPerms(List perms) { + this.perms = perms; + } + + public SubAccountKey ipWhitelist(List ipWhitelist) { + + this.ipWhitelist = ipWhitelist; + return this; + } + + public SubAccountKey addIpWhitelistItem(String ipWhitelistItem) { + if (this.ipWhitelist == null) { + this.ipWhitelist = new ArrayList<>(); + } + this.ipWhitelist.add(ipWhitelistItem); + return this; + } + + /** + * IP whitelist (list will be cleared if no value is passed) + * @return ipWhitelist + **/ + @javax.annotation.Nullable + public List getIpWhitelist() { + return ipWhitelist; + } + + + public void setIpWhitelist(List ipWhitelist) { + this.ipWhitelist = ipWhitelist; + } + + /** + * API Key + * @return key + **/ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + + /** + * Status: 1-Normal 2-Frozen 3-Locked + * @return state + **/ + @javax.annotation.Nullable + public Integer getState() { + return state; + } + + + /** + * Created time + * @return createdAt + **/ + @javax.annotation.Nullable + public Long getCreatedAt() { + return createdAt; + } + + + /** + * Last Update Time + * @return updatedAt + **/ + @javax.annotation.Nullable + public Long getUpdatedAt() { + return updatedAt; + } + + + /** + * Last Access Time + * @return lastAccess + **/ + @javax.annotation.Nullable + public Long getLastAccess() { + return lastAccess; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountKey subAccountKey = (SubAccountKey) o; + return Objects.equals(this.userId, subAccountKey.userId) && + Objects.equals(this.mode, subAccountKey.mode) && + Objects.equals(this.name, subAccountKey.name) && + Objects.equals(this.perms, subAccountKey.perms) && + Objects.equals(this.ipWhitelist, subAccountKey.ipWhitelist) && + Objects.equals(this.key, subAccountKey.key) && + Objects.equals(this.state, subAccountKey.state) && + Objects.equals(this.createdAt, subAccountKey.createdAt) && + Objects.equals(this.updatedAt, subAccountKey.updatedAt) && + Objects.equals(this.lastAccess, subAccountKey.lastAccess); + } + + @Override + public int hashCode() { + return Objects.hash(userId, mode, name, perms, ipWhitelist, key, state, createdAt, updatedAt, lastAccess); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountKey {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" perms: ").append(toIndentedString(perms)).append("\n"); + sb.append(" ipWhitelist: ").append(toIndentedString(ipWhitelist)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" lastAccess: ").append(toIndentedString(lastAccess)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccountKeyPerms.java b/src/main/java/io/gate/gateapi/models/SubAccountKeyPerms.java new file mode 100644 index 0000000..6133f8a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccountKeyPerms.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SubAccountKeyPerms + */ +public class SubAccountKeyPerms { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_READ_ONLY = "read_only"; + @SerializedName(SERIALIZED_NAME_READ_ONLY) + private Boolean readOnly; + + + public SubAccountKeyPerms name(String name) { + + this.name = name; + return this; + } + + /** + * 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 + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public SubAccountKeyPerms readOnly(Boolean readOnly) { + + this.readOnly = readOnly; + return this; + } + + /** + * Read Only + * @return readOnly + **/ + @javax.annotation.Nullable + public Boolean getReadOnly() { + return readOnly; + } + + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountKeyPerms subAccountKeyPerms = (SubAccountKeyPerms) o; + return Objects.equals(this.name, subAccountKeyPerms.name) && + Objects.equals(this.readOnly, subAccountKeyPerms.readOnly); + } + + @Override + public int hashCode() { + return Objects.hash(name, readOnly); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountKeyPerms {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccountMarginBalance.java b/src/main/java/io/gate/gateapi/models/SubAccountMarginBalance.java new file mode 100644 index 0000000..6f1dae5 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccountMarginBalance.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MarginAccount; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * SubAccountMarginBalance + */ +public class SubAccountMarginBalance { + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private String uid; + + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private List available = null; + + + public SubAccountMarginBalance uid(String uid) { + + this.uid = uid; + return this; + } + + /** + * User ID + * @return uid + **/ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + + public void setUid(String uid) { + this.uid = uid; + } + + public SubAccountMarginBalance available(List available) { + + this.available = available; + return this; + } + + public SubAccountMarginBalance addAvailableItem(MarginAccount availableItem) { + if (this.available == null) { + this.available = new ArrayList<>(); + } + this.available.add(availableItem); + return this; + } + + /** + * Margin account balances + * @return available + **/ + @javax.annotation.Nullable + public List getAvailable() { + return available; + } + + + public void setAvailable(List available) { + this.available = available; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountMarginBalance subAccountMarginBalance = (SubAccountMarginBalance) o; + return Objects.equals(this.uid, subAccountMarginBalance.uid) && + Objects.equals(this.available, subAccountMarginBalance.available); + } + + @Override + public int hashCode() { + return Objects.hash(uid, available); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountMarginBalance {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" available: ").append(toIndentedString(available)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccountToSubAccount.java b/src/main/java/io/gate/gateapi/models/SubAccountToSubAccount.java new file mode 100644 index 0000000..9d99d91 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccountToSubAccount.java @@ -0,0 +1,239 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SubAccountToSubAccount + */ +public class SubAccountToSubAccount { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_SUB_ACCOUNT_TYPE = "sub_account_type"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TYPE) + private String subAccountType; + + public static final String SERIALIZED_NAME_SUB_ACCOUNT_FROM = "sub_account_from"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_FROM) + private String subAccountFrom; + + public static final String SERIALIZED_NAME_SUB_ACCOUNT_FROM_TYPE = "sub_account_from_type"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_FROM_TYPE) + private String subAccountFromType; + + public static final String SERIALIZED_NAME_SUB_ACCOUNT_TO = "sub_account_to"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TO) + private String subAccountTo; + + public static final String SERIALIZED_NAME_SUB_ACCOUNT_TO_TYPE = "sub_account_to_type"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TO_TYPE) + private String subAccountToType; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + + public SubAccountToSubAccount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Transfer currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public SubAccountToSubAccount subAccountType(String subAccountType) { + + this.subAccountType = subAccountType; + return this; + } + + /** + * Transfer from account (deprecated, use `sub_account_from_type` and `sub_account_to_type` instead) + * @return subAccountType + **/ + @javax.annotation.Nullable + public String getSubAccountType() { + return subAccountType; + } + + + public void setSubAccountType(String subAccountType) { + this.subAccountType = subAccountType; + } + + public SubAccountToSubAccount subAccountFrom(String subAccountFrom) { + + this.subAccountFrom = subAccountFrom; + return this; + } + + /** + * Transfer from the user id of the sub-account + * @return subAccountFrom + **/ + public String getSubAccountFrom() { + return subAccountFrom; + } + + + public void setSubAccountFrom(String subAccountFrom) { + this.subAccountFrom = subAccountFrom; + } + + public SubAccountToSubAccount subAccountFromType(String subAccountFromType) { + + this.subAccountFromType = subAccountFromType; + return this; + } + + /** + * Source sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account + * @return subAccountFromType + **/ + public String getSubAccountFromType() { + return subAccountFromType; + } + + + public void setSubAccountFromType(String subAccountFromType) { + this.subAccountFromType = subAccountFromType; + } + + public SubAccountToSubAccount subAccountTo(String subAccountTo) { + + this.subAccountTo = subAccountTo; + return this; + } + + /** + * Transfer to the user id of the sub-account + * @return subAccountTo + **/ + public String getSubAccountTo() { + return subAccountTo; + } + + + public void setSubAccountTo(String subAccountTo) { + this.subAccountTo = subAccountTo; + } + + public SubAccountToSubAccount subAccountToType(String subAccountToType) { + + this.subAccountToType = subAccountToType; + return this; + } + + /** + * Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account + * @return subAccountToType + **/ + public String getSubAccountToType() { + return subAccountToType; + } + + + public void setSubAccountToType(String subAccountToType) { + this.subAccountToType = subAccountToType; + } + + public SubAccountToSubAccount amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Transfer amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountToSubAccount subAccountToSubAccount = (SubAccountToSubAccount) o; + return Objects.equals(this.currency, subAccountToSubAccount.currency) && + Objects.equals(this.subAccountType, subAccountToSubAccount.subAccountType) && + Objects.equals(this.subAccountFrom, subAccountToSubAccount.subAccountFrom) && + Objects.equals(this.subAccountFromType, subAccountToSubAccount.subAccountFromType) && + Objects.equals(this.subAccountTo, subAccountToSubAccount.subAccountTo) && + Objects.equals(this.subAccountToType, subAccountToSubAccount.subAccountToType) && + Objects.equals(this.amount, subAccountToSubAccount.amount); + } + + @Override + public int hashCode() { + return Objects.hash(currency, subAccountType, subAccountFrom, subAccountFromType, subAccountTo, subAccountToType, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountToSubAccount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" subAccountType: ").append(toIndentedString(subAccountType)).append("\n"); + sb.append(" subAccountFrom: ").append(toIndentedString(subAccountFrom)).append("\n"); + sb.append(" subAccountFromType: ").append(toIndentedString(subAccountFromType)).append("\n"); + sb.append(" subAccountTo: ").append(toIndentedString(subAccountTo)).append("\n"); + sb.append(" subAccountToType: ").append(toIndentedString(subAccountToType)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubAccountTransfer.java b/src/main/java/io/gate/gateapi/models/SubAccountTransfer.java index 3f734df..e8273e7 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccountTransfer.java +++ b/src/main/java/io/gate/gateapi/models/SubAccountTransfer.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 @@ -23,188 +23,87 @@ * SubAccountTransfer */ public class SubAccountTransfer { - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - public static final String SERIALIZED_NAME_SUB_ACCOUNT = "sub_account"; @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT) private String subAccount; - /** - * Transfer direction. to - transfer into sub account; from - transfer out from sub account - */ - @JsonAdapter(DirectionEnum.Adapter.class) - public enum DirectionEnum { - TO("to"), - - FROM("from"); - - private String value; - - DirectionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DirectionEnum fromValue(String value) { - for (DirectionEnum b : DirectionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final DirectionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DirectionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return DirectionEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_SUB_ACCOUNT_TYPE = "sub_account_type"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TYPE) + private String subAccountType = "spot"; - public static final String SERIALIZED_NAME_DIRECTION = "direction"; - @SerializedName(SERIALIZED_NAME_DIRECTION) - private DirectionEnum direction; + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; public static final String SERIALIZED_NAME_AMOUNT = "amount"; @SerializedName(SERIALIZED_NAME_AMOUNT) private String amount; - public static final String SERIALIZED_NAME_UID = "uid"; - @SerializedName(SERIALIZED_NAME_UID) - private String uid; - - public static final String SERIALIZED_NAME_TIMEST = "timest"; - @SerializedName(SERIALIZED_NAME_TIMEST) - private String timest; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - private String source; - - /** - * Target sub user's account. `spot` - spot account, `futures` - perpetual contract account - */ - @JsonAdapter(SubAccountTypeEnum.Adapter.class) - public enum SubAccountTypeEnum { - SPOT("spot"), - - FUTURES("futures"); - - private String value; - - SubAccountTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SubAccountTypeEnum fromValue(String value) { - for (SubAccountTypeEnum b : SubAccountTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SubAccountTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SubAccountTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SubAccountTypeEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + @SerializedName(SERIALIZED_NAME_DIRECTION) + private String direction; - public static final String SERIALIZED_NAME_SUB_ACCOUNT_TYPE = "sub_account_type"; - @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TYPE) - private SubAccountTypeEnum subAccountType = SubAccountTypeEnum.SPOT; + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "client_order_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + private String clientOrderId; - public SubAccountTransfer currency(String currency) { + public SubAccountTransfer subAccount(String subAccount) { - this.currency = currency; + this.subAccount = subAccount; return this; } /** - * Transfer currency name - * @return currency + * Sub account user ID + * @return subAccount **/ - public String getCurrency() { - return currency; + public String getSubAccount() { + return subAccount; } - public void setCurrency(String currency) { - this.currency = currency; + public void setSubAccount(String subAccount) { + this.subAccount = subAccount; } - public SubAccountTransfer subAccount(String subAccount) { + public SubAccountTransfer subAccountType(String subAccountType) { - this.subAccount = subAccount; + this.subAccountType = subAccountType; return this; } /** - * Sub account user ID - * @return subAccount + * Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account + * @return subAccountType **/ - public String getSubAccount() { - return subAccount; + @javax.annotation.Nullable + public String getSubAccountType() { + return subAccountType; } - public void setSubAccount(String subAccount) { - this.subAccount = subAccount; + public void setSubAccountType(String subAccountType) { + this.subAccountType = subAccountType; } - public SubAccountTransfer direction(DirectionEnum direction) { + public SubAccountTransfer currency(String currency) { - this.direction = direction; + this.currency = currency; return this; } /** - * Transfer direction. to - transfer into sub account; from - transfer out from sub account - * @return direction + * Transfer currency name + * @return currency **/ - public DirectionEnum getDirection() { - return direction; + public String getCurrency() { + return currency; } - public void setDirection(DirectionEnum direction) { - this.direction = direction; + public void setCurrency(String currency) { + this.currency = currency; } public SubAccountTransfer amount(String amount) { @@ -226,54 +125,43 @@ public void setAmount(String amount) { this.amount = amount; } - /** - * Main account user ID - * @return uid - **/ - @javax.annotation.Nullable - public String getUid() { - return uid; + public SubAccountTransfer direction(String direction) { + + this.direction = direction; + return this; } - /** - * Transfer timestamp - * @return timest + * Transfer direction: to - transfer into sub-account, from - transfer out from sub-account + * @return direction **/ - @javax.annotation.Nullable - public String getTimest() { - return timest; + public String getDirection() { + return direction; } - /** - * Where the operation is initiated from - * @return source - **/ - @javax.annotation.Nullable - public String getSource() { - return source; + public void setDirection(String direction) { + this.direction = direction; } - - public SubAccountTransfer subAccountType(SubAccountTypeEnum subAccountType) { + public SubAccountTransfer clientOrderId(String clientOrderId) { - this.subAccountType = subAccountType; + this.clientOrderId = clientOrderId; return this; } /** - * Target sub user's account. `spot` - spot account, `futures` - perpetual contract account - * @return subAccountType + * 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 + * @return clientOrderId **/ @javax.annotation.Nullable - public SubAccountTypeEnum getSubAccountType() { - return subAccountType; + public String getClientOrderId() { + return clientOrderId; } - public void setSubAccountType(SubAccountTypeEnum subAccountType) { - this.subAccountType = subAccountType; + public void setClientOrderId(String clientOrderId) { + this.clientOrderId = clientOrderId; } @Override public boolean equals(java.lang.Object o) { @@ -284,19 +172,17 @@ public boolean equals(java.lang.Object o) { return false; } SubAccountTransfer subAccountTransfer = (SubAccountTransfer) o; - return Objects.equals(this.currency, subAccountTransfer.currency) && - Objects.equals(this.subAccount, subAccountTransfer.subAccount) && - Objects.equals(this.direction, subAccountTransfer.direction) && + return Objects.equals(this.subAccount, subAccountTransfer.subAccount) && + Objects.equals(this.subAccountType, subAccountTransfer.subAccountType) && + Objects.equals(this.currency, subAccountTransfer.currency) && Objects.equals(this.amount, subAccountTransfer.amount) && - Objects.equals(this.uid, subAccountTransfer.uid) && - Objects.equals(this.timest, subAccountTransfer.timest) && - Objects.equals(this.source, subAccountTransfer.source) && - Objects.equals(this.subAccountType, subAccountTransfer.subAccountType); + Objects.equals(this.direction, subAccountTransfer.direction) && + Objects.equals(this.clientOrderId, subAccountTransfer.clientOrderId); } @Override public int hashCode() { - return Objects.hash(currency, subAccount, direction, amount, uid, timest, source, subAccountType); + return Objects.hash(subAccount, subAccountType, currency, amount, direction, clientOrderId); } @@ -304,14 +190,12 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SubAccountTransfer {\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" subAccount: ").append(toIndentedString(subAccount)).append("\n"); - sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); - sb.append(" timest: ").append(toIndentedString(timest)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" subAccountType: ").append(toIndentedString(subAccountType)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/SubAccountTransferRecordItem.java b/src/main/java/io/gate/gateapi/models/SubAccountTransferRecordItem.java new file mode 100644 index 0000000..4bdc741 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubAccountTransferRecordItem.java @@ -0,0 +1,289 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SubAccountTransferRecordItem + */ +public class SubAccountTransferRecordItem { + public static final String SERIALIZED_NAME_TIMEST = "timest"; + @SerializedName(SERIALIZED_NAME_TIMEST) + private String timest; + + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private String uid; + + public static final String SERIALIZED_NAME_SUB_ACCOUNT = "sub_account"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT) + private String subAccount; + + public static final String SERIALIZED_NAME_SUB_ACCOUNT_TYPE = "sub_account_type"; + @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TYPE) + private String subAccountType = "spot"; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + @SerializedName(SERIALIZED_NAME_DIRECTION) + private String direction; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "client_order_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + private String clientOrderId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + + /** + * Transfer timestamp + * @return timest + **/ + @javax.annotation.Nullable + public String getTimest() { + return timest; + } + + + /** + * Main account user ID + * @return uid + **/ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + + public SubAccountTransferRecordItem subAccount(String subAccount) { + + this.subAccount = subAccount; + return this; + } + + /** + * Sub account user ID + * @return subAccount + **/ + public String getSubAccount() { + return subAccount; + } + + + public void setSubAccount(String subAccount) { + this.subAccount = subAccount; + } + + public SubAccountTransferRecordItem subAccountType(String subAccountType) { + + this.subAccountType = subAccountType; + return this; + } + + /** + * Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account + * @return subAccountType + **/ + @javax.annotation.Nullable + public String getSubAccountType() { + return subAccountType; + } + + + public void setSubAccountType(String subAccountType) { + this.subAccountType = subAccountType; + } + + public SubAccountTransferRecordItem currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Transfer currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public SubAccountTransferRecordItem amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Transfer amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public SubAccountTransferRecordItem direction(String direction) { + + this.direction = direction; + return this; + } + + /** + * Transfer direction: to - transfer into sub-account, from - transfer out from sub-account + * @return direction + **/ + public String getDirection() { + return direction; + } + + + public void setDirection(String direction) { + this.direction = direction; + } + + /** + * Source of the transfer operation + * @return source + **/ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + + public SubAccountTransferRecordItem clientOrderId(String clientOrderId) { + + this.clientOrderId = clientOrderId; + return this; + } + + /** + * 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 + * @return clientOrderId + **/ + @javax.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + + public void setClientOrderId(String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public SubAccountTransferRecordItem status(String status) { + + this.status = status; + return this; + } + + /** + * Sub-account transfer record status, currently only 'success' + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountTransferRecordItem subAccountTransferRecordItem = (SubAccountTransferRecordItem) o; + return Objects.equals(this.timest, subAccountTransferRecordItem.timest) && + Objects.equals(this.uid, subAccountTransferRecordItem.uid) && + Objects.equals(this.subAccount, subAccountTransferRecordItem.subAccount) && + Objects.equals(this.subAccountType, subAccountTransferRecordItem.subAccountType) && + Objects.equals(this.currency, subAccountTransferRecordItem.currency) && + Objects.equals(this.amount, subAccountTransferRecordItem.amount) && + Objects.equals(this.direction, subAccountTransferRecordItem.direction) && + Objects.equals(this.source, subAccountTransferRecordItem.source) && + Objects.equals(this.clientOrderId, subAccountTransferRecordItem.clientOrderId) && + Objects.equals(this.status, subAccountTransferRecordItem.status); + } + + @Override + public int hashCode() { + return Objects.hash(timest, uid, subAccount, subAccountType, currency, amount, direction, source, clientOrderId, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountTransferRecordItem {\n"); + sb.append(" timest: ").append(toIndentedString(timest)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" subAccount: ").append(toIndentedString(subAccount)).append("\n"); + sb.append(" subAccountType: ").append(toIndentedString(subAccountType)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubCrossMarginAccount.java b/src/main/java/io/gate/gateapi/models/SubCrossMarginAccount.java new file mode 100644 index 0000000..7111ea2 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubCrossMarginAccount.java @@ -0,0 +1,491 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.CrossMarginBalance; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * SubCrossMarginAccount + */ +public class SubCrossMarginAccount { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_LOCKED = "locked"; + @SerializedName(SERIALIZED_NAME_LOCKED) + private Boolean locked; + + public static final String SERIALIZED_NAME_BALANCES = "balances"; + @SerializedName(SERIALIZED_NAME_BALANCES) + private Map balances = null; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private String total; + + public static final String SERIALIZED_NAME_BORROWED = "borrowed"; + @SerializedName(SERIALIZED_NAME_BORROWED) + private String borrowed; + + public static final String SERIALIZED_NAME_BORROWED_NET = "borrowed_net"; + @SerializedName(SERIALIZED_NAME_BORROWED_NET) + private String borrowedNet; + + public static final String SERIALIZED_NAME_NET = "net"; + @SerializedName(SERIALIZED_NAME_NET) + private String net; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + public static final String SERIALIZED_NAME_INTEREST = "interest"; + @SerializedName(SERIALIZED_NAME_INTEREST) + private String interest; + + public static final String SERIALIZED_NAME_RISK = "risk"; + @SerializedName(SERIALIZED_NAME_RISK) + private String risk; + + public static final String SERIALIZED_NAME_TOTAL_INITIAL_MARGIN = "total_initial_margin"; + @SerializedName(SERIALIZED_NAME_TOTAL_INITIAL_MARGIN) + private String totalInitialMargin; + + public static final String SERIALIZED_NAME_TOTAL_MARGIN_BALANCE = "total_margin_balance"; + @SerializedName(SERIALIZED_NAME_TOTAL_MARGIN_BALANCE) + private String totalMarginBalance; + + public static final String SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN = "total_maintenance_margin"; + @SerializedName(SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN) + private String totalMaintenanceMargin; + + public static final String SERIALIZED_NAME_TOTAL_INITIAL_MARGIN_RATE = "total_initial_margin_rate"; + @SerializedName(SERIALIZED_NAME_TOTAL_INITIAL_MARGIN_RATE) + private String totalInitialMarginRate; + + public static final String SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN_RATE = "total_maintenance_margin_rate"; + @SerializedName(SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN_RATE) + private String totalMaintenanceMarginRate; + + public static final String SERIALIZED_NAME_TOTAL_AVAILABLE_MARGIN = "total_available_margin"; + @SerializedName(SERIALIZED_NAME_TOTAL_AVAILABLE_MARGIN) + private String totalAvailableMargin; + + + public SubCrossMarginAccount userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * Cross margin account user ID. 0 means this sub-account has not yet opened a cross margin account + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public SubCrossMarginAccount locked(Boolean locked) { + + this.locked = locked; + return this; + } + + /** + * Whether the account is locked + * @return locked + **/ + @javax.annotation.Nullable + public Boolean getLocked() { + return locked; + } + + + public void setLocked(Boolean locked) { + this.locked = locked; + } + + public SubCrossMarginAccount balances(Map balances) { + + this.balances = balances; + return this; + } + + public SubCrossMarginAccount putBalancesItem(String key, CrossMarginBalance balancesItem) { + if (this.balances == null) { + this.balances = new HashMap<>(); + } + this.balances.put(key, balancesItem); + return this; + } + + /** + * Get balances + * @return balances + **/ + @javax.annotation.Nullable + public Map getBalances() { + return balances; + } + + + public void setBalances(Map balances) { + this.balances = balances; + } + + public SubCrossMarginAccount total(String total) { + + this.total = total; + return this; + } + + /** + * Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` + * @return total + **/ + @javax.annotation.Nullable + public String getTotal() { + return total; + } + + + public void setTotal(String total) { + this.total = total; + } + + public SubCrossMarginAccount borrowed(String borrowed) { + + this.borrowed = borrowed; + return this; + } + + /** + * Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` + * @return borrowed + **/ + @javax.annotation.Nullable + public String getBorrowed() { + return borrowed; + } + + + public void setBorrowed(String borrowed) { + this.borrowed = borrowed; + } + + public SubCrossMarginAccount borrowedNet(String borrowedNet) { + + this.borrowedNet = borrowedNet; + return this; + } + + /** + * Total borrowed value in USDT * leverage factor + * @return borrowedNet + **/ + @javax.annotation.Nullable + public String getBorrowedNet() { + return borrowedNet; + } + + + public void setBorrowedNet(String borrowedNet) { + this.borrowedNet = borrowedNet; + } + + public SubCrossMarginAccount net(String net) { + + this.net = net; + return this; + } + + /** + * Total net assets in USDT + * @return net + **/ + @javax.annotation.Nullable + public String getNet() { + return net; + } + + + public void setNet(String net) { + this.net = net; + } + + public SubCrossMarginAccount leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * Position leverage + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + + public SubCrossMarginAccount interest(String interest) { + + this.interest = interest; + return this; + } + + /** + * Total unpaid interest in USDT, i.e., the sum of all currencies' `interest*price*discount` + * @return interest + **/ + @javax.annotation.Nullable + public String getInterest() { + return interest; + } + + + public void setInterest(String interest) { + this.interest = interest; + } + + public SubCrossMarginAccount risk(String risk) { + + this.risk = risk; + return this; + } + + /** + * Risk rate. When it falls below 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` + * @return risk + **/ + @javax.annotation.Nullable + public String getRisk() { + return risk; + } + + + public void setRisk(String risk) { + this.risk = risk; + } + + public SubCrossMarginAccount totalInitialMargin(String totalInitialMargin) { + + this.totalInitialMargin = totalInitialMargin; + return this; + } + + /** + * Total initial margin + * @return totalInitialMargin + **/ + @javax.annotation.Nullable + public String getTotalInitialMargin() { + return totalInitialMargin; + } + + + public void setTotalInitialMargin(String totalInitialMargin) { + this.totalInitialMargin = totalInitialMargin; + } + + public SubCrossMarginAccount totalMarginBalance(String totalMarginBalance) { + + this.totalMarginBalance = totalMarginBalance; + return this; + } + + /** + * Total margin balance + * @return totalMarginBalance + **/ + @javax.annotation.Nullable + public String getTotalMarginBalance() { + return totalMarginBalance; + } + + + public void setTotalMarginBalance(String totalMarginBalance) { + this.totalMarginBalance = totalMarginBalance; + } + + public SubCrossMarginAccount totalMaintenanceMargin(String totalMaintenanceMargin) { + + this.totalMaintenanceMargin = totalMaintenanceMargin; + return this; + } + + /** + * Total maintenance margin + * @return totalMaintenanceMargin + **/ + @javax.annotation.Nullable + public String getTotalMaintenanceMargin() { + return totalMaintenanceMargin; + } + + + public void setTotalMaintenanceMargin(String totalMaintenanceMargin) { + this.totalMaintenanceMargin = totalMaintenanceMargin; + } + + public SubCrossMarginAccount totalInitialMarginRate(String totalInitialMarginRate) { + + this.totalInitialMarginRate = totalInitialMarginRate; + return this; + } + + /** + * Total initial margin rate + * @return totalInitialMarginRate + **/ + @javax.annotation.Nullable + public String getTotalInitialMarginRate() { + return totalInitialMarginRate; + } + + + public void setTotalInitialMarginRate(String totalInitialMarginRate) { + this.totalInitialMarginRate = totalInitialMarginRate; + } + + public SubCrossMarginAccount totalMaintenanceMarginRate(String totalMaintenanceMarginRate) { + + this.totalMaintenanceMarginRate = totalMaintenanceMarginRate; + return this; + } + + /** + * Total maintenance margin rate + * @return totalMaintenanceMarginRate + **/ + @javax.annotation.Nullable + public String getTotalMaintenanceMarginRate() { + return totalMaintenanceMarginRate; + } + + + public void setTotalMaintenanceMarginRate(String totalMaintenanceMarginRate) { + this.totalMaintenanceMarginRate = totalMaintenanceMarginRate; + } + + public SubCrossMarginAccount totalAvailableMargin(String totalAvailableMargin) { + + this.totalAvailableMargin = totalAvailableMargin; + return this; + } + + /** + * Total available margin + * @return totalAvailableMargin + **/ + @javax.annotation.Nullable + public String getTotalAvailableMargin() { + return totalAvailableMargin; + } + + + public void setTotalAvailableMargin(String totalAvailableMargin) { + this.totalAvailableMargin = totalAvailableMargin; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubCrossMarginAccount subCrossMarginAccount = (SubCrossMarginAccount) o; + return Objects.equals(this.userId, subCrossMarginAccount.userId) && + Objects.equals(this.locked, subCrossMarginAccount.locked) && + Objects.equals(this.balances, subCrossMarginAccount.balances) && + Objects.equals(this.total, subCrossMarginAccount.total) && + Objects.equals(this.borrowed, subCrossMarginAccount.borrowed) && + Objects.equals(this.borrowedNet, subCrossMarginAccount.borrowedNet) && + Objects.equals(this.net, subCrossMarginAccount.net) && + Objects.equals(this.leverage, subCrossMarginAccount.leverage) && + Objects.equals(this.interest, subCrossMarginAccount.interest) && + Objects.equals(this.risk, subCrossMarginAccount.risk) && + Objects.equals(this.totalInitialMargin, subCrossMarginAccount.totalInitialMargin) && + Objects.equals(this.totalMarginBalance, subCrossMarginAccount.totalMarginBalance) && + Objects.equals(this.totalMaintenanceMargin, subCrossMarginAccount.totalMaintenanceMargin) && + Objects.equals(this.totalInitialMarginRate, subCrossMarginAccount.totalInitialMarginRate) && + Objects.equals(this.totalMaintenanceMarginRate, subCrossMarginAccount.totalMaintenanceMarginRate) && + Objects.equals(this.totalAvailableMargin, subCrossMarginAccount.totalAvailableMargin); + } + + @Override + public int hashCode() { + return Objects.hash(userId, locked, balances, total, borrowed, borrowedNet, net, leverage, interest, risk, totalInitialMargin, totalMarginBalance, totalMaintenanceMargin, totalInitialMarginRate, totalMaintenanceMarginRate, totalAvailableMargin); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubCrossMarginAccount {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" borrowed: ").append(toIndentedString(borrowed)).append("\n"); + sb.append(" borrowedNet: ").append(toIndentedString(borrowedNet)).append("\n"); + sb.append(" net: ").append(toIndentedString(net)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append(" interest: ").append(toIndentedString(interest)).append("\n"); + sb.append(" risk: ").append(toIndentedString(risk)).append("\n"); + sb.append(" totalInitialMargin: ").append(toIndentedString(totalInitialMargin)).append("\n"); + sb.append(" totalMarginBalance: ").append(toIndentedString(totalMarginBalance)).append("\n"); + sb.append(" totalMaintenanceMargin: ").append(toIndentedString(totalMaintenanceMargin)).append("\n"); + sb.append(" totalInitialMarginRate: ").append(toIndentedString(totalInitialMarginRate)).append("\n"); + sb.append(" totalMaintenanceMarginRate: ").append(toIndentedString(totalMaintenanceMarginRate)).append("\n"); + sb.append(" totalAvailableMargin: ").append(toIndentedString(totalAvailableMargin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SubUserMode.java b/src/main/java/io/gate/gateapi/models/SubUserMode.java new file mode 100644 index 0000000..5ea3a83 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SubUserMode.java @@ -0,0 +1,141 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SubUserMode + */ +public class SubUserMode { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_IS_UNIFIED = "is_unified"; + @SerializedName(SERIALIZED_NAME_IS_UNIFIED) + private Boolean isUnified; + + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + + public SubUserMode userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public SubUserMode isUnified(Boolean isUnified) { + + this.isUnified = isUnified; + return this; + } + + /** + * Whether it is a unified account + * @return isUnified + **/ + @javax.annotation.Nullable + public Boolean getIsUnified() { + return isUnified; + } + + + public void setIsUnified(Boolean isUnified) { + this.isUnified = isUnified; + } + + public SubUserMode mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode + * @return mode + **/ + @javax.annotation.Nullable + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubUserMode subUserMode = (SubUserMode) o; + return Objects.equals(this.userId, subUserMode.userId) && + Objects.equals(this.isUnified, subUserMode.isUnified) && + Objects.equals(this.mode, subUserMode.mode); + } + + @Override + public int hashCode() { + return Objects.hash(userId, isUnified, mode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubUserMode {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" isUnified: ").append(toIndentedString(isUnified)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SwapCoin.java b/src/main/java/io/gate/gateapi/models/SwapCoin.java new file mode 100644 index 0000000..0f7fe0a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SwapCoin.java @@ -0,0 +1,164 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Blockchain Mining + */ +public class SwapCoin { + public static final String SERIALIZED_NAME_COIN = "coin"; + @SerializedName(SERIALIZED_NAME_COIN) + private String coin; + + public static final String SERIALIZED_NAME_SIDE = "side"; + @SerializedName(SERIALIZED_NAME_SIDE) + private String side; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_PID = "pid"; + @SerializedName(SERIALIZED_NAME_PID) + private Integer pid; + + + public SwapCoin coin(String coin) { + + this.coin = coin; + return this; + } + + /** + * Currency + * @return coin + **/ + public String getCoin() { + return coin; + } + + + public void setCoin(String coin) { + this.coin = coin; + } + + public SwapCoin side(String side) { + + this.side = side; + return this; + } + + /** + * 0 - Stake 1 - Redeem + * @return side + **/ + public String getSide() { + return side; + } + + + public void setSide(String side) { + this.side = side; + } + + public SwapCoin amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Size + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public SwapCoin pid(Integer pid) { + + this.pid = pid; + return this; + } + + /** + * DeFi-type Mining Protocol Identifier + * @return pid + **/ + @javax.annotation.Nullable + public Integer getPid() { + return pid; + } + + + public void setPid(Integer pid) { + this.pid = pid; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapCoin swapCoin = (SwapCoin) o; + return Objects.equals(this.coin, swapCoin.coin) && + Objects.equals(this.side, swapCoin.side) && + Objects.equals(this.amount, swapCoin.amount) && + Objects.equals(this.pid, swapCoin.pid); + } + + @Override + public int hashCode() { + return Objects.hash(coin, side, amount, pid); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapCoin {\n"); + sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SwapCoinStruct.java b/src/main/java/io/gate/gateapi/models/SwapCoinStruct.java new file mode 100644 index 0000000..f15a430 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SwapCoinStruct.java @@ -0,0 +1,453 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SwapCoinStruct + */ +public class SwapCoinStruct { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Integer id; + + public static final String SERIALIZED_NAME_PID = "pid"; + @SerializedName(SERIALIZED_NAME_PID) + private Integer pid; + + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private Integer uid; + + public static final String SERIALIZED_NAME_COIN = "coin"; + @SerializedName(SERIALIZED_NAME_COIN) + private String coin; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Integer type; + + public static final String SERIALIZED_NAME_SUBTYPE = "subtype"; + @SerializedName(SERIALIZED_NAME_SUBTYPE) + private String subtype; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_EXCHANGE_RATE = "exchange_rate"; + @SerializedName(SERIALIZED_NAME_EXCHANGE_RATE) + private String exchangeRate; + + public static final String SERIALIZED_NAME_EXCHANGE_AMOUNT = "exchange_amount"; + @SerializedName(SERIALIZED_NAME_EXCHANGE_AMOUNT) + private String exchangeAmount; + + public static final String SERIALIZED_NAME_UPDATE_STAMP = "updateStamp"; + @SerializedName(SERIALIZED_NAME_UPDATE_STAMP) + private Integer updateStamp; + + public static final String SERIALIZED_NAME_CREATE_STAMP = "createStamp"; + @SerializedName(SERIALIZED_NAME_CREATE_STAMP) + private Integer createStamp; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public static final String SERIALIZED_NAME_PROTOCOL_TYPE = "protocol_type"; + @SerializedName(SERIALIZED_NAME_PROTOCOL_TYPE) + private Integer protocolType; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "client_order_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + private String clientOrderId; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + + public SwapCoinStruct id(Integer id) { + + this.id = id; + return this; + } + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + + public void setId(Integer id) { + this.id = id; + } + + public SwapCoinStruct pid(Integer pid) { + + this.pid = pid; + return this; + } + + /** + * Product ID + * @return pid + **/ + @javax.annotation.Nullable + public Integer getPid() { + return pid; + } + + + public void setPid(Integer pid) { + this.pid = pid; + } + + public SwapCoinStruct uid(Integer uid) { + + this.uid = uid; + return this; + } + + /** + * User ID + * @return uid + **/ + @javax.annotation.Nullable + public Integer getUid() { + return uid; + } + + + public void setUid(Integer uid) { + this.uid = uid; + } + + public SwapCoinStruct coin(String coin) { + + this.coin = coin; + return this; + } + + /** + * Currency + * @return coin + **/ + @javax.annotation.Nullable + public String getCoin() { + return coin; + } + + + public void setCoin(String coin) { + this.coin = coin; + } + + public SwapCoinStruct type(Integer type) { + + this.type = type; + return this; + } + + /** + * Type 0-Staking 1-Redemption + * @return type + **/ + @javax.annotation.Nullable + public Integer getType() { + return type; + } + + + public void setType(Integer type) { + this.type = type; + } + + public SwapCoinStruct subtype(String subtype) { + + this.subtype = subtype; + return this; + } + + /** + * SubType + * @return subtype + **/ + @javax.annotation.Nullable + public String getSubtype() { + return subtype; + } + + + public void setSubtype(String subtype) { + this.subtype = subtype; + } + + public SwapCoinStruct amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public SwapCoinStruct exchangeRate(String exchangeRate) { + + this.exchangeRate = exchangeRate; + return this; + } + + /** + * Exchange ratio + * @return exchangeRate + **/ + @javax.annotation.Nullable + public String getExchangeRate() { + return exchangeRate; + } + + + public void setExchangeRate(String exchangeRate) { + this.exchangeRate = exchangeRate; + } + + public SwapCoinStruct exchangeAmount(String exchangeAmount) { + + this.exchangeAmount = exchangeAmount; + return this; + } + + /** + * Redemption Amount + * @return exchangeAmount + **/ + @javax.annotation.Nullable + public String getExchangeAmount() { + return exchangeAmount; + } + + + public void setExchangeAmount(String exchangeAmount) { + this.exchangeAmount = exchangeAmount; + } + + public SwapCoinStruct updateStamp(Integer updateStamp) { + + this.updateStamp = updateStamp; + return this; + } + + /** + * UpdateTimestamp + * @return updateStamp + **/ + @javax.annotation.Nullable + public Integer getUpdateStamp() { + return updateStamp; + } + + + public void setUpdateStamp(Integer updateStamp) { + this.updateStamp = updateStamp; + } + + public SwapCoinStruct createStamp(Integer createStamp) { + + this.createStamp = createStamp; + return this; + } + + /** + * Transaction timestamp + * @return createStamp + **/ + @javax.annotation.Nullable + public Integer getCreateStamp() { + return createStamp; + } + + + public void setCreateStamp(Integer createStamp) { + this.createStamp = createStamp; + } + + public SwapCoinStruct status(Integer status) { + + this.status = status; + return this; + } + + /** + * status 1-success + * @return status + **/ + @javax.annotation.Nullable + public Integer getStatus() { + return status; + } + + + public void setStatus(Integer status) { + this.status = status; + } + + public SwapCoinStruct protocolType(Integer protocolType) { + + this.protocolType = protocolType; + return this; + } + + /** + * DEFI Protocol Type + * @return protocolType + **/ + @javax.annotation.Nullable + public Integer getProtocolType() { + return protocolType; + } + + + public void setProtocolType(Integer protocolType) { + this.protocolType = protocolType; + } + + public SwapCoinStruct clientOrderId(String clientOrderId) { + + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Reference ID + * @return clientOrderId + **/ + @javax.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + + public void setClientOrderId(String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public SwapCoinStruct source(String source) { + + this.source = source; + return this; + } + + /** + * Order Origin + * @return source + **/ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + + public void setSource(String source) { + this.source = source; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapCoinStruct swapCoinStruct = (SwapCoinStruct) o; + return Objects.equals(this.id, swapCoinStruct.id) && + Objects.equals(this.pid, swapCoinStruct.pid) && + Objects.equals(this.uid, swapCoinStruct.uid) && + Objects.equals(this.coin, swapCoinStruct.coin) && + Objects.equals(this.type, swapCoinStruct.type) && + Objects.equals(this.subtype, swapCoinStruct.subtype) && + Objects.equals(this.amount, swapCoinStruct.amount) && + Objects.equals(this.exchangeRate, swapCoinStruct.exchangeRate) && + Objects.equals(this.exchangeAmount, swapCoinStruct.exchangeAmount) && + Objects.equals(this.updateStamp, swapCoinStruct.updateStamp) && + Objects.equals(this.createStamp, swapCoinStruct.createStamp) && + Objects.equals(this.status, swapCoinStruct.status) && + Objects.equals(this.protocolType, swapCoinStruct.protocolType) && + Objects.equals(this.clientOrderId, swapCoinStruct.clientOrderId) && + Objects.equals(this.source, swapCoinStruct.source); + } + + @Override + public int hashCode() { + return Objects.hash(id, pid, uid, coin, type, subtype, amount, exchangeRate, exchangeAmount, updateStamp, createStamp, status, protocolType, clientOrderId, source); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapCoinStruct {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" subtype: ").append(toIndentedString(subtype)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" exchangeRate: ").append(toIndentedString(exchangeRate)).append("\n"); + sb.append(" exchangeAmount: ").append(toIndentedString(exchangeAmount)).append("\n"); + sb.append(" updateStamp: ").append(toIndentedString(updateStamp)).append("\n"); + sb.append(" createStamp: ").append(toIndentedString(createStamp)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" protocolType: ").append(toIndentedString(protocolType)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/SystemTime.java b/src/main/java/io/gate/gateapi/models/SystemTime.java new file mode 100644 index 0000000..dae8438 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/SystemTime.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * SystemTime + */ +public class SystemTime { + public static final String SERIALIZED_NAME_SERVER_TIME = "server_time"; + @SerializedName(SERIALIZED_NAME_SERVER_TIME) + private Long serverTime; + + + public SystemTime serverTime(Long serverTime) { + + this.serverTime = serverTime; + return this; + } + + /** + * Server current time(ms) + * @return serverTime + **/ + @javax.annotation.Nullable + public Long getServerTime() { + return serverTime; + } + + + public void setServerTime(Long serverTime) { + this.serverTime = serverTime; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SystemTime systemTime = (SystemTime) o; + return Objects.equals(this.serverTime, systemTime.serverTime); + } + + @Override + public int hashCode() { + return Objects.hash(serverTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SystemTime {\n"); + sb.append(" serverTime: ").append(toIndentedString(serverTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/Ticker.java b/src/main/java/io/gate/gateapi/models/Ticker.java index 5a32b67..908546a 100644 --- a/src/main/java/io/gate/gateapi/models/Ticker.java +++ b/src/main/java/io/gate/gateapi/models/Ticker.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 @@ -35,14 +35,30 @@ public class Ticker { @SerializedName(SERIALIZED_NAME_LOWEST_ASK) private String lowestAsk; + public static final String SERIALIZED_NAME_LOWEST_SIZE = "lowest_size"; + @SerializedName(SERIALIZED_NAME_LOWEST_SIZE) + private String lowestSize; + public static final String SERIALIZED_NAME_HIGHEST_BID = "highest_bid"; @SerializedName(SERIALIZED_NAME_HIGHEST_BID) private String highestBid; + public static final String SERIALIZED_NAME_HIGHEST_SIZE = "highest_size"; + @SerializedName(SERIALIZED_NAME_HIGHEST_SIZE) + private String highestSize; + public static final String SERIALIZED_NAME_CHANGE_PERCENTAGE = "change_percentage"; @SerializedName(SERIALIZED_NAME_CHANGE_PERCENTAGE) private String changePercentage; + public static final String SERIALIZED_NAME_CHANGE_UTC0 = "change_utc0"; + @SerializedName(SERIALIZED_NAME_CHANGE_UTC0) + private String changeUtc0; + + public static final String SERIALIZED_NAME_CHANGE_UTC8 = "change_utc8"; + @SerializedName(SERIALIZED_NAME_CHANGE_UTC8) + private String changeUtc8; + public static final String SERIALIZED_NAME_BASE_VOLUME = "base_volume"; @SerializedName(SERIALIZED_NAME_BASE_VOLUME) private String baseVolume; @@ -123,7 +139,7 @@ public Ticker lowestAsk(String lowestAsk) { } /** - * Lowest ask + * Recent lowest ask * @return lowestAsk **/ @javax.annotation.Nullable @@ -136,6 +152,26 @@ public void setLowestAsk(String lowestAsk) { this.lowestAsk = lowestAsk; } + public Ticker lowestSize(String lowestSize) { + + this.lowestSize = lowestSize; + return this; + } + + /** + * Latest seller's lowest price quantity; not available for batch queries; available for single queries, empty if no data + * @return lowestSize + **/ + @javax.annotation.Nullable + public String getLowestSize() { + return lowestSize; + } + + + public void setLowestSize(String lowestSize) { + this.lowestSize = lowestSize; + } + public Ticker highestBid(String highestBid) { this.highestBid = highestBid; @@ -143,7 +179,7 @@ public Ticker highestBid(String highestBid) { } /** - * Highest bid + * Recent highest bid * @return highestBid **/ @javax.annotation.Nullable @@ -156,6 +192,26 @@ public void setHighestBid(String highestBid) { this.highestBid = highestBid; } + public Ticker highestSize(String highestSize) { + + this.highestSize = highestSize; + return this; + } + + /** + * Latest buyer's highest price quantity; not available for batch queries; available for single queries, empty if no data + * @return highestSize + **/ + @javax.annotation.Nullable + public String getHighestSize() { + return highestSize; + } + + + public void setHighestSize(String highestSize) { + this.highestSize = highestSize; + } + public Ticker changePercentage(String changePercentage) { this.changePercentage = changePercentage; @@ -163,7 +219,7 @@ public Ticker changePercentage(String changePercentage) { } /** - * Change percentage. + * 24h price change percentage (negative for decrease, e.g., -7.45) * @return changePercentage **/ @javax.annotation.Nullable @@ -176,6 +232,46 @@ public void setChangePercentage(String changePercentage) { this.changePercentage = changePercentage; } + public Ticker changeUtc0(String changeUtc0) { + + this.changeUtc0 = changeUtc0; + return this; + } + + /** + * UTC+0 timezone, 24h price change percentage, negative for decline (e.g., -7.45) + * @return changeUtc0 + **/ + @javax.annotation.Nullable + public String getChangeUtc0() { + return changeUtc0; + } + + + public void setChangeUtc0(String changeUtc0) { + this.changeUtc0 = changeUtc0; + } + + public Ticker changeUtc8(String changeUtc8) { + + this.changeUtc8 = changeUtc8; + return this; + } + + /** + * UTC+8 timezone, 24h price change percentage, negative for decline (e.g., -7.45) + * @return changeUtc8 + **/ + @javax.annotation.Nullable + public String getChangeUtc8() { + return changeUtc8; + } + + + public void setChangeUtc8(String changeUtc8) { + this.changeUtc8 = changeUtc8; + } + public Ticker baseVolume(String baseVolume) { this.baseVolume = baseVolume; @@ -183,7 +279,7 @@ public Ticker baseVolume(String baseVolume) { } /** - * Base currency trade volume + * Base currency trading volume in the last 24h * @return baseVolume **/ @javax.annotation.Nullable @@ -203,7 +299,7 @@ public Ticker quoteVolume(String quoteVolume) { } /** - * Quote currency trade volume + * Quote currency trading volume in the last 24h * @return quoteVolume **/ @javax.annotation.Nullable @@ -223,7 +319,7 @@ public Ticker high24h(String high24h) { } /** - * Highest price in 24h + * 24h High * @return high24h **/ @javax.annotation.Nullable @@ -243,7 +339,7 @@ public Ticker low24h(String low24h) { } /** - * Lowest price in 24h + * 24h Low * @return low24h **/ @javax.annotation.Nullable @@ -283,7 +379,7 @@ public Ticker etfPreNetValue(String etfPreNetValue) { } /** - * ETF previous net value at re-balancing time + * ETF net value at previous rebalancing point * @return etfPreNetValue **/ @javax.annotation.Nullable @@ -303,7 +399,7 @@ public Ticker etfPreTimestamp(Long etfPreTimestamp) { } /** - * ETF previous re-balancing time + * ETF previous rebalancing time * @return etfPreTimestamp **/ @javax.annotation.Nullable @@ -347,8 +443,12 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.currencyPair, ticker.currencyPair) && Objects.equals(this.last, ticker.last) && Objects.equals(this.lowestAsk, ticker.lowestAsk) && + Objects.equals(this.lowestSize, ticker.lowestSize) && Objects.equals(this.highestBid, ticker.highestBid) && + Objects.equals(this.highestSize, ticker.highestSize) && Objects.equals(this.changePercentage, ticker.changePercentage) && + Objects.equals(this.changeUtc0, ticker.changeUtc0) && + Objects.equals(this.changeUtc8, ticker.changeUtc8) && Objects.equals(this.baseVolume, ticker.baseVolume) && Objects.equals(this.quoteVolume, ticker.quoteVolume) && Objects.equals(this.high24h, ticker.high24h) && @@ -361,7 +461,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(currencyPair, last, lowestAsk, highestBid, changePercentage, baseVolume, quoteVolume, high24h, low24h, etfNetValue, etfPreNetValue, etfPreTimestamp, etfLeverage); + return Objects.hash(currencyPair, last, lowestAsk, lowestSize, highestBid, highestSize, changePercentage, changeUtc0, changeUtc8, baseVolume, quoteVolume, high24h, low24h, etfNetValue, etfPreNetValue, etfPreTimestamp, etfLeverage); } @@ -372,8 +472,12 @@ public String toString() { sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); sb.append(" last: ").append(toIndentedString(last)).append("\n"); sb.append(" lowestAsk: ").append(toIndentedString(lowestAsk)).append("\n"); + sb.append(" lowestSize: ").append(toIndentedString(lowestSize)).append("\n"); sb.append(" highestBid: ").append(toIndentedString(highestBid)).append("\n"); + sb.append(" highestSize: ").append(toIndentedString(highestSize)).append("\n"); sb.append(" changePercentage: ").append(toIndentedString(changePercentage)).append("\n"); + sb.append(" changeUtc0: ").append(toIndentedString(changeUtc0)).append("\n"); + sb.append(" changeUtc8: ").append(toIndentedString(changeUtc8)).append("\n"); sb.append(" baseVolume: ").append(toIndentedString(baseVolume)).append("\n"); sb.append(" quoteVolume: ").append(toIndentedString(quoteVolume)).append("\n"); sb.append(" high24h: ").append(toIndentedString(high24h)).append("\n"); diff --git a/src/main/java/io/gate/gateapi/models/TotalBalance.java b/src/main/java/io/gate/gateapi/models/TotalBalance.java index a2b3bb3..dbd650c 100644 --- a/src/main/java/io/gate/gateapi/models/TotalBalance.java +++ b/src/main/java/io/gate/gateapi/models/TotalBalance.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 @@ -24,7 +24,7 @@ import java.util.Map; /** - * User's balance in all accounts + * User's total balance information */ public class TotalBalance { public static final String SERIALIZED_NAME_TOTAL = "total"; @@ -71,7 +71,7 @@ public TotalBalance putDetailsItem(String key, AccountBalance detailsItem) { } /** - * 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 + * 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 * @return details **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/Trade.java b/src/main/java/io/gate/gateapi/models/Trade.java index 169838e..41d8c14 100644 --- a/src/main/java/io/gate/gateapi/models/Trade.java +++ b/src/main/java/io/gate/gateapi/models/Trade.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 @@ -40,7 +40,7 @@ public class Trade { private String currencyPair; /** - * Order side + * Buy or sell order */ @JsonAdapter(SideEnum.Adapter.class) public enum SideEnum { @@ -91,7 +91,7 @@ public SideEnum read(final JsonReader jsonReader) throws IOException { private SideEnum side; /** - * Trade role + * Trade role, not returned in public endpoints */ @JsonAdapter(RoleEnum.Adapter.class) public enum RoleEnum { @@ -169,6 +169,18 @@ public RoleEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_GT_FEE) private String gtFee; + public static final String SERIALIZED_NAME_AMEND_TEXT = "amend_text"; + @SerializedName(SERIALIZED_NAME_AMEND_TEXT) + private String amendText; + + public static final String SERIALIZED_NAME_SEQUENCE_ID = "sequence_id"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_ID) + private String sequenceId; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + public Trade id(String id) { @@ -177,7 +189,7 @@ public Trade id(String id) { } /** - * Trade ID + * Fill ID * @return id **/ @javax.annotation.Nullable @@ -197,7 +209,7 @@ public Trade createTime(String createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -257,7 +269,7 @@ public Trade side(SideEnum side) { } /** - * Order side + * Buy or sell order * @return side **/ @javax.annotation.Nullable @@ -277,7 +289,7 @@ public Trade role(RoleEnum role) { } /** - * Trade role + * Trade role, not returned in public endpoints * @return role **/ @javax.annotation.Nullable @@ -337,7 +349,7 @@ public Trade orderId(String orderId) { } /** - * Related order ID. No value in public endpoints + * Related order ID, not returned in public endpoints * @return orderId **/ @javax.annotation.Nullable @@ -357,7 +369,7 @@ public Trade fee(String fee) { } /** - * Fee deducted. No value in public endpoints + * Fee deducted, not returned in public endpoints * @return fee **/ @javax.annotation.Nullable @@ -377,7 +389,7 @@ public Trade feeCurrency(String feeCurrency) { } /** - * Fee currency unit. No value in public endpoints + * Fee currency unit, not returned in public endpoints * @return feeCurrency **/ @javax.annotation.Nullable @@ -397,7 +409,7 @@ public Trade pointFee(String pointFee) { } /** - * Points used to deduct fee + * Points used to deduct fee, not returned in public endpoints * @return pointFee **/ @javax.annotation.Nullable @@ -417,7 +429,7 @@ public Trade gtFee(String gtFee) { } /** - * GT used to deduct fee + * GT used to deduct fee, not returned in public endpoints * @return gtFee **/ @javax.annotation.Nullable @@ -429,6 +441,66 @@ public String getGtFee() { public void setGtFee(String gtFee) { this.gtFee = gtFee; } + + public Trade amendText(String amendText) { + + this.amendText = amendText; + return this; + } + + /** + * The custom data that the user remarked when amending the order + * @return amendText + **/ + @javax.annotation.Nullable + public String getAmendText() { + return amendText; + } + + + public void setAmendText(String amendText) { + this.amendText = amendText; + } + + public Trade sequenceId(String sequenceId) { + + this.sequenceId = sequenceId; + return this; + } + + /** + * Consecutive trade ID within a single market. Used to track and identify trades in the specific market + * @return sequenceId + **/ + @javax.annotation.Nullable + public String getSequenceId() { + return sequenceId; + } + + + public void setSequenceId(String sequenceId) { + this.sequenceId = sequenceId; + } + + public Trade text(String text) { + + this.text = text; + return this; + } + + /** + * User-defined information, not returned in public endpoints + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -450,12 +522,15 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.fee, trade.fee) && Objects.equals(this.feeCurrency, trade.feeCurrency) && Objects.equals(this.pointFee, trade.pointFee) && - Objects.equals(this.gtFee, trade.gtFee); + Objects.equals(this.gtFee, trade.gtFee) && + Objects.equals(this.amendText, trade.amendText) && + Objects.equals(this.sequenceId, trade.sequenceId) && + Objects.equals(this.text, trade.text); } @Override public int hashCode() { - return Objects.hash(id, createTime, createTimeMs, currencyPair, side, role, amount, price, orderId, fee, feeCurrency, pointFee, gtFee); + return Objects.hash(id, createTime, createTimeMs, currencyPair, side, role, amount, price, orderId, fee, feeCurrency, pointFee, gtFee, amendText, sequenceId, text); } @@ -476,6 +551,9 @@ public String toString() { sb.append(" feeCurrency: ").append(toIndentedString(feeCurrency)).append("\n"); sb.append(" pointFee: ").append(toIndentedString(pointFee)).append("\n"); sb.append(" gtFee: ").append(toIndentedString(gtFee)).append("\n"); + sb.append(" amendText: ").append(toIndentedString(amendText)).append("\n"); + sb.append(" sequenceId: ").append(toIndentedString(sequenceId)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/TradeFee.java b/src/main/java/io/gate/gateapi/models/TradeFee.java index 49aa64d..540c779 100644 --- a/src/main/java/io/gate/gateapi/models/TradeFee.java +++ b/src/main/java/io/gate/gateapi/models/TradeFee.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 @@ -63,6 +63,18 @@ public class TradeFee { @SerializedName(SERIALIZED_NAME_FUTURES_MAKER_FEE) private String futuresMakerFee; + public static final String SERIALIZED_NAME_DELIVERY_TAKER_FEE = "delivery_taker_fee"; + @SerializedName(SERIALIZED_NAME_DELIVERY_TAKER_FEE) + private String deliveryTakerFee; + + public static final String SERIALIZED_NAME_DELIVERY_MAKER_FEE = "delivery_maker_fee"; + @SerializedName(SERIALIZED_NAME_DELIVERY_MAKER_FEE) + private String deliveryMakerFee; + + public static final String SERIALIZED_NAME_DEBIT_FEE = "debit_fee"; + @SerializedName(SERIALIZED_NAME_DEBIT_FEE) + private Integer debitFee; + public TradeFee userId(Long userId) { @@ -131,7 +143,7 @@ public TradeFee gtDiscount(Boolean gtDiscount) { } /** - * If GT deduction is enabled + * Whether GT deduction discount is enabled * @return gtDiscount **/ @javax.annotation.Nullable @@ -171,7 +183,7 @@ public TradeFee gtMakerFee(String gtMakerFee) { } /** - * Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled + * Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled * @return gtMakerFee **/ @javax.annotation.Nullable @@ -211,7 +223,7 @@ public TradeFee pointType(String pointType) { } /** - * Point type. 0 - Initial version. 1 - new version since 202009 + * Point card type: 0 - Original version, 1 - New version since 202009 * @return pointType **/ @javax.annotation.Nullable @@ -231,7 +243,7 @@ public TradeFee futuresTakerFee(String futuresTakerFee) { } /** - * Futures trading taker fee + * Perpetual contract taker fee rate * @return futuresTakerFee **/ @javax.annotation.Nullable @@ -251,7 +263,7 @@ public TradeFee futuresMakerFee(String futuresMakerFee) { } /** - * Future trading maker fee + * Perpetual contract maker fee rate * @return futuresMakerFee **/ @javax.annotation.Nullable @@ -263,6 +275,66 @@ public String getFuturesMakerFee() { public void setFuturesMakerFee(String futuresMakerFee) { this.futuresMakerFee = futuresMakerFee; } + + public TradeFee deliveryTakerFee(String deliveryTakerFee) { + + this.deliveryTakerFee = deliveryTakerFee; + return this; + } + + /** + * Delivery contract taker fee rate + * @return deliveryTakerFee + **/ + @javax.annotation.Nullable + public String getDeliveryTakerFee() { + return deliveryTakerFee; + } + + + public void setDeliveryTakerFee(String deliveryTakerFee) { + this.deliveryTakerFee = deliveryTakerFee; + } + + public TradeFee deliveryMakerFee(String deliveryMakerFee) { + + this.deliveryMakerFee = deliveryMakerFee; + return this; + } + + /** + * Delivery contract maker fee rate + * @return deliveryMakerFee + **/ + @javax.annotation.Nullable + public String getDeliveryMakerFee() { + return deliveryMakerFee; + } + + + public void setDeliveryMakerFee(String deliveryMakerFee) { + this.deliveryMakerFee = deliveryMakerFee; + } + + public TradeFee debitFee(Integer debitFee) { + + this.debitFee = debitFee; + return this; + } + + /** + * Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates + * @return debitFee + **/ + @javax.annotation.Nullable + public Integer getDebitFee() { + return debitFee; + } + + + public void setDebitFee(Integer debitFee) { + this.debitFee = debitFee; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -281,12 +353,15 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.loanFee, tradeFee.loanFee) && Objects.equals(this.pointType, tradeFee.pointType) && Objects.equals(this.futuresTakerFee, tradeFee.futuresTakerFee) && - Objects.equals(this.futuresMakerFee, tradeFee.futuresMakerFee); + Objects.equals(this.futuresMakerFee, tradeFee.futuresMakerFee) && + Objects.equals(this.deliveryTakerFee, tradeFee.deliveryTakerFee) && + Objects.equals(this.deliveryMakerFee, tradeFee.deliveryMakerFee) && + Objects.equals(this.debitFee, tradeFee.debitFee); } @Override public int hashCode() { - return Objects.hash(userId, takerFee, makerFee, gtDiscount, gtTakerFee, gtMakerFee, loanFee, pointType, futuresTakerFee, futuresMakerFee); + return Objects.hash(userId, takerFee, makerFee, gtDiscount, gtTakerFee, gtMakerFee, loanFee, pointType, futuresTakerFee, futuresMakerFee, deliveryTakerFee, deliveryMakerFee, debitFee); } @@ -304,6 +379,9 @@ public String toString() { sb.append(" pointType: ").append(toIndentedString(pointType)).append("\n"); sb.append(" futuresTakerFee: ").append(toIndentedString(futuresTakerFee)).append("\n"); sb.append(" futuresMakerFee: ").append(toIndentedString(futuresMakerFee)).append("\n"); + sb.append(" deliveryTakerFee: ").append(toIndentedString(deliveryTakerFee)).append("\n"); + sb.append(" deliveryMakerFee: ").append(toIndentedString(deliveryMakerFee)).append("\n"); + sb.append(" debitFee: ").append(toIndentedString(debitFee)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/TransactionID.java b/src/main/java/io/gate/gateapi/models/TransactionID.java new file mode 100644 index 0000000..a0ae56a --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/TransactionID.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * TransactionID + */ +public class TransactionID { + public static final String SERIALIZED_NAME_TX_ID = "tx_id"; + @SerializedName(SERIALIZED_NAME_TX_ID) + private Long txId; + + + public TransactionID txId(Long txId) { + + this.txId = txId; + return this; + } + + /** + * Order ID + * @return txId + **/ + @javax.annotation.Nullable + public Long getTxId() { + return txId; + } + + + public void setTxId(Long txId) { + this.txId = txId; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionID transactionID = (TransactionID) o; + return Objects.equals(this.txId, transactionID.txId); + } + + @Override + public int hashCode() { + return Objects.hash(txId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionID {\n"); + sb.append(" txId: ").append(toIndentedString(txId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/Transfer.java b/src/main/java/io/gate/gateapi/models/Transfer.java index a92b502..73c4e4d 100644 --- a/src/main/java/io/gate/gateapi/models/Transfer.java +++ b/src/main/java/io/gate/gateapi/models/Transfer.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 @@ -20,7 +20,7 @@ import java.io.IOException; /** - * 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 */ public class Transfer { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @@ -40,7 +40,7 @@ public enum FromEnum { DELIVERY("delivery"), - CROSS_MARGIN("cross_margin"); + OPTIONS("options"); private String value; @@ -97,7 +97,7 @@ public enum ToEnum { DELIVERY("delivery"), - CROSS_MARGIN("cross_margin"); + OPTIONS("options"); private String value; @@ -161,7 +161,7 @@ public Transfer currency(String currency) { } /** - * Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency + * Transfer currency name. For contract accounts, `currency` can be set to `POINT` (points) or supported settlement currencies (e.g., `BTC`, `USDT`) * @return currency **/ public String getCurrency() { @@ -237,7 +237,7 @@ public Transfer currencyPair(String currencyPair) { } /** - * Margin currency pair. Required if transfer from or to margin account + * Margin trading pair. Required when transferring to or from margin account * @return currencyPair **/ @javax.annotation.Nullable @@ -257,7 +257,7 @@ public Transfer settle(String settle) { } /** - * Futures settle currency. Required if `currency` is `POINT` + * Contract settlement currency. Required when transferring to or from contract account * @return settle **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/TransferOrderStatus.java b/src/main/java/io/gate/gateapi/models/TransferOrderStatus.java new file mode 100644 index 0000000..a888ea0 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/TransferOrderStatus.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * TransferOrderStatus + */ +public class TransferOrderStatus { + public static final String SERIALIZED_NAME_TX_ID = "tx_id"; + @SerializedName(SERIALIZED_NAME_TX_ID) + private String txId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + + public TransferOrderStatus txId(String txId) { + + this.txId = txId; + return this; + } + + /** + * Order ID + * @return txId + **/ + @javax.annotation.Nullable + public String getTxId() { + return txId; + } + + + public void setTxId(String txId) { + this.txId = txId; + } + + public TransferOrderStatus status(String status) { + + this.status = status; + return this; + } + + /** + * Transfer status: PENDING - Processing, SUCCESS - Transfer successful, FAIL - Transfer failed, PARTIAL_SUCCESS - Partially successful (this status appears when transferring between sub-accounts) + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferOrderStatus transferOrderStatus = (TransferOrderStatus) o; + return Objects.equals(this.txId, transferOrderStatus.txId) && + Objects.equals(this.status, transferOrderStatus.status); + } + + @Override + public int hashCode() { + return Objects.hash(txId, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferOrderStatus {\n"); + sb.append(" txId: ").append(toIndentedString(txId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/TransferablesResult.java b/src/main/java/io/gate/gateapi/models/TransferablesResult.java new file mode 100644 index 0000000..f4147d9 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/TransferablesResult.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Batch query unified account maximum transferable results + */ +public class TransferablesResult { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + + public TransferablesResult currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency detail + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public TransferablesResult amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Maximum transferable amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferablesResult transferablesResult = (TransferablesResult) o; + return Objects.equals(this.currency, transferablesResult.currency) && + Objects.equals(this.amount, transferablesResult.amount); + } + + @Override + public int hashCode() { + return Objects.hash(currency, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferablesResult {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/TriggerOrderResponse.java b/src/main/java/io/gate/gateapi/models/TriggerOrderResponse.java index f437ae9..6b78f96 100644 --- a/src/main/java/io/gate/gateapi/models/TriggerOrderResponse.java +++ b/src/main/java/io/gate/gateapi/models/TriggerOrderResponse.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/models/TriggerTime.java b/src/main/java/io/gate/gateapi/models/TriggerTime.java new file mode 100644 index 0000000..37c370d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/TriggerTime.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * TriggerTime + */ +public class TriggerTime { + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + private Long triggerTime; + + + public TriggerTime triggerTime(Long triggerTime) { + + this.triggerTime = triggerTime; + return this; + } + + /** + * Timestamp when countdown ends, in milliseconds + * @return triggerTime + **/ + @javax.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + + public void setTriggerTime(Long triggerTime) { + this.triggerTime = triggerTime; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerTime triggerTime = (TriggerTime) o; + return Objects.equals(this.triggerTime, triggerTime.triggerTime); + } + + @Override + public int hashCode() { + return Objects.hash(triggerTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerTime {\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UidPushOrder.java b/src/main/java/io/gate/gateapi/models/UidPushOrder.java new file mode 100644 index 0000000..65c1687 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UidPushOrder.java @@ -0,0 +1,297 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UidPushOrder + */ +public class UidPushOrder { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_PUSH_UID = "push_uid"; + @SerializedName(SERIALIZED_NAME_PUSH_UID) + private Long pushUid; + + public static final String SERIALIZED_NAME_RECEIVE_UID = "receive_uid"; + @SerializedName(SERIALIZED_NAME_RECEIVE_UID) + private Long receiveUid; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_TRANSACTION_TYPE = "transaction_type"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_TYPE) + private String transactionType; + + + public UidPushOrder id(Long id) { + + this.id = id; + return this; + } + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + public UidPushOrder pushUid(Long pushUid) { + + this.pushUid = pushUid; + return this; + } + + /** + * Initiator User ID + * @return pushUid + **/ + @javax.annotation.Nullable + public Long getPushUid() { + return pushUid; + } + + + public void setPushUid(Long pushUid) { + this.pushUid = pushUid; + } + + public UidPushOrder receiveUid(Long receiveUid) { + + this.receiveUid = receiveUid; + return this; + } + + /** + * Recipient User ID + * @return receiveUid + **/ + @javax.annotation.Nullable + public Long getReceiveUid() { + return receiveUid; + } + + + public void setReceiveUid(Long receiveUid) { + this.receiveUid = receiveUid; + } + + public UidPushOrder currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UidPushOrder amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Transfer amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public UidPushOrder createTime(Long createTime) { + + this.createTime = createTime; + return this; + } + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public UidPushOrder status(String status) { + + this.status = status; + return this; + } + + /** + * 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 + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + public UidPushOrder message(String message) { + + this.message = message; + return this; + } + + /** + * PENDING reason tips + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + public UidPushOrder transactionType(String transactionType) { + + this.transactionType = transactionType; + return this; + } + + /** + * Order Type + * @return transactionType + **/ + @javax.annotation.Nullable + public String getTransactionType() { + return transactionType; + } + + + public void setTransactionType(String transactionType) { + this.transactionType = transactionType; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UidPushOrder uidPushOrder = (UidPushOrder) o; + return Objects.equals(this.id, uidPushOrder.id) && + Objects.equals(this.pushUid, uidPushOrder.pushUid) && + Objects.equals(this.receiveUid, uidPushOrder.receiveUid) && + Objects.equals(this.currency, uidPushOrder.currency) && + Objects.equals(this.amount, uidPushOrder.amount) && + Objects.equals(this.createTime, uidPushOrder.createTime) && + Objects.equals(this.status, uidPushOrder.status) && + Objects.equals(this.message, uidPushOrder.message) && + Objects.equals(this.transactionType, uidPushOrder.transactionType); + } + + @Override + public int hashCode() { + return Objects.hash(id, pushUid, receiveUid, currency, amount, createTime, status, message, transactionType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UidPushOrder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pushUid: ").append(toIndentedString(pushUid)).append("\n"); + sb.append(" receiveUid: ").append(toIndentedString(receiveUid)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" transactionType: ").append(toIndentedString(transactionType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UidPushWithdrawal.java b/src/main/java/io/gate/gateapi/models/UidPushWithdrawal.java new file mode 100644 index 0000000..32ee3a2 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UidPushWithdrawal.java @@ -0,0 +1,138 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UidPushWithdrawal + */ +public class UidPushWithdrawal { + public static final String SERIALIZED_NAME_RECEIVE_UID = "receive_uid"; + @SerializedName(SERIALIZED_NAME_RECEIVE_UID) + private Long receiveUid; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + + public UidPushWithdrawal receiveUid(Long receiveUid) { + + this.receiveUid = receiveUid; + return this; + } + + /** + * Recipient UID + * @return receiveUid + **/ + public Long getReceiveUid() { + return receiveUid; + } + + + public void setReceiveUid(Long receiveUid) { + this.receiveUid = receiveUid; + } + + public UidPushWithdrawal currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UidPushWithdrawal amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Transfer amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UidPushWithdrawal uidPushWithdrawal = (UidPushWithdrawal) o; + return Objects.equals(this.receiveUid, uidPushWithdrawal.receiveUid) && + Objects.equals(this.currency, uidPushWithdrawal.currency) && + Objects.equals(this.amount, uidPushWithdrawal.amount); + } + + @Override + public int hashCode() { + return Objects.hash(receiveUid, currency, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UidPushWithdrawal {\n"); + sb.append(" receiveUid: ").append(toIndentedString(receiveUid)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UidPushWithdrawalResp.java b/src/main/java/io/gate/gateapi/models/UidPushWithdrawalResp.java new file mode 100644 index 0000000..5d1d399 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UidPushWithdrawalResp.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UidPushWithdrawalResp + */ +public class UidPushWithdrawalResp { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + + public UidPushWithdrawalResp id(Long id) { + + this.id = id; + return this; + } + + /** + * Order ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UidPushWithdrawalResp uidPushWithdrawalResp = (UidPushWithdrawalResp) o; + return Objects.equals(this.id, uidPushWithdrawalResp.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UidPushWithdrawalResp {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniCurrency.java b/src/main/java/io/gate/gateapi/models/UniCurrency.java new file mode 100644 index 0000000..21eef24 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniCurrency.java @@ -0,0 +1,143 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Currency detail + */ +public class UniCurrency { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_MIN_LEND_AMOUNT = "min_lend_amount"; + @SerializedName(SERIALIZED_NAME_MIN_LEND_AMOUNT) + private String minLendAmount; + + public static final String SERIALIZED_NAME_MAX_LEND_AMOUNT = "max_lend_amount"; + @SerializedName(SERIALIZED_NAME_MAX_LEND_AMOUNT) + private String maxLendAmount; + + public static final String SERIALIZED_NAME_MAX_RATE = "max_rate"; + @SerializedName(SERIALIZED_NAME_MAX_RATE) + private String maxRate; + + public static final String SERIALIZED_NAME_MIN_RATE = "min_rate"; + @SerializedName(SERIALIZED_NAME_MIN_RATE) + private String minRate; + + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * The minimum lending amount, in the unit of the currency + * @return minLendAmount + **/ + @javax.annotation.Nullable + public String getMinLendAmount() { + return minLendAmount; + } + + + /** + * The total maximum lending amount, in USDT + * @return maxLendAmount + **/ + @javax.annotation.Nullable + public String getMaxLendAmount() { + return maxLendAmount; + } + + + /** + * Maximum rate (Hourly) + * @return maxRate + **/ + @javax.annotation.Nullable + public String getMaxRate() { + return maxRate; + } + + + /** + * Minimum rate (Hourly) + * @return minRate + **/ + @javax.annotation.Nullable + public String getMinRate() { + return minRate; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniCurrency uniCurrency = (UniCurrency) o; + return Objects.equals(this.currency, uniCurrency.currency) && + Objects.equals(this.minLendAmount, uniCurrency.minLendAmount) && + Objects.equals(this.maxLendAmount, uniCurrency.maxLendAmount) && + Objects.equals(this.maxRate, uniCurrency.maxRate) && + Objects.equals(this.minRate, uniCurrency.minRate); + } + + @Override + public int hashCode() { + return Objects.hash(currency, minLendAmount, maxLendAmount, maxRate, minRate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniCurrency {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" minLendAmount: ").append(toIndentedString(minLendAmount)).append("\n"); + sb.append(" maxLendAmount: ").append(toIndentedString(maxLendAmount)).append("\n"); + sb.append(" maxRate: ").append(toIndentedString(maxRate)).append("\n"); + sb.append(" minRate: ").append(toIndentedString(minRate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniCurrencyInterest.java b/src/main/java/io/gate/gateapi/models/UniCurrencyInterest.java new file mode 100644 index 0000000..609c2b1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniCurrencyInterest.java @@ -0,0 +1,95 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UniCurrencyInterest + */ +public class UniCurrencyInterest { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INTEREST_STATUS = "interest_status"; + @SerializedName(SERIALIZED_NAME_INTEREST_STATUS) + private String interestStatus; + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment + * @return interestStatus + **/ + @javax.annotation.Nullable + public String getInterestStatus() { + return interestStatus; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniCurrencyInterest uniCurrencyInterest = (UniCurrencyInterest) o; + return Objects.equals(this.currency, uniCurrencyInterest.currency) && + Objects.equals(this.interestStatus, uniCurrencyInterest.interestStatus); + } + + @Override + public int hashCode() { + return Objects.hash(currency, interestStatus); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniCurrencyInterest {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" interestStatus: ").append(toIndentedString(interestStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniCurrencyPair.java b/src/main/java/io/gate/gateapi/models/UniCurrencyPair.java new file mode 100644 index 0000000..16c27d7 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniCurrencyPair.java @@ -0,0 +1,127 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Currency pair of the loan + */ +public class UniCurrencyPair { + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_BASE_MIN_BORROW_AMOUNT = "base_min_borrow_amount"; + @SerializedName(SERIALIZED_NAME_BASE_MIN_BORROW_AMOUNT) + private String baseMinBorrowAmount; + + public static final String SERIALIZED_NAME_QUOTE_MIN_BORROW_AMOUNT = "quote_min_borrow_amount"; + @SerializedName(SERIALIZED_NAME_QUOTE_MIN_BORROW_AMOUNT) + private String quoteMinBorrowAmount; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + /** + * Minimum borrow amount of base currency + * @return baseMinBorrowAmount + **/ + @javax.annotation.Nullable + public String getBaseMinBorrowAmount() { + return baseMinBorrowAmount; + } + + + /** + * Minimum borrow amount of quote currency + * @return quoteMinBorrowAmount + **/ + @javax.annotation.Nullable + public String getQuoteMinBorrowAmount() { + return quoteMinBorrowAmount; + } + + + /** + * Position leverage + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniCurrencyPair uniCurrencyPair = (UniCurrencyPair) o; + return Objects.equals(this.currencyPair, uniCurrencyPair.currencyPair) && + Objects.equals(this.baseMinBorrowAmount, uniCurrencyPair.baseMinBorrowAmount) && + Objects.equals(this.quoteMinBorrowAmount, uniCurrencyPair.quoteMinBorrowAmount) && + Objects.equals(this.leverage, uniCurrencyPair.leverage); + } + + @Override + public int hashCode() { + return Objects.hash(currencyPair, baseMinBorrowAmount, quoteMinBorrowAmount, leverage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniCurrencyPair {\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" baseMinBorrowAmount: ").append(toIndentedString(baseMinBorrowAmount)).append("\n"); + sb.append(" quoteMinBorrowAmount: ").append(toIndentedString(quoteMinBorrowAmount)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniInterestRecord.java b/src/main/java/io/gate/gateapi/models/UniInterestRecord.java new file mode 100644 index 0000000..19c3fbb --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniInterestRecord.java @@ -0,0 +1,159 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Interest Record + */ +public class UniInterestRecord { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_ACTUAL_RATE = "actual_rate"; + @SerializedName(SERIALIZED_NAME_ACTUAL_RATE) + private String actualRate; + + public static final String SERIALIZED_NAME_INTEREST = "interest"; + @SerializedName(SERIALIZED_NAME_INTEREST) + private String interest; + + public static final String SERIALIZED_NAME_INTEREST_STATUS = "interest_status"; + @SerializedName(SERIALIZED_NAME_INTEREST_STATUS) + private String interestStatus; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + /** + * Status: 0 - fail, 1 - success + * @return status + **/ + @javax.annotation.Nullable + public Integer getStatus() { + return status; + } + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Actual Rate + * @return actualRate + **/ + @javax.annotation.Nullable + public String getActualRate() { + return actualRate; + } + + + /** + * Interest + * @return interest + **/ + @javax.annotation.Nullable + public String getInterest() { + return interest; + } + + + /** + * Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment + * @return interestStatus + **/ + @javax.annotation.Nullable + public String getInterestStatus() { + return interestStatus; + } + + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniInterestRecord uniInterestRecord = (UniInterestRecord) o; + return Objects.equals(this.status, uniInterestRecord.status) && + Objects.equals(this.currency, uniInterestRecord.currency) && + Objects.equals(this.actualRate, uniInterestRecord.actualRate) && + Objects.equals(this.interest, uniInterestRecord.interest) && + Objects.equals(this.interestStatus, uniInterestRecord.interestStatus) && + Objects.equals(this.createTime, uniInterestRecord.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(status, currency, actualRate, interest, interestStatus, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniInterestRecord {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" actualRate: ").append(toIndentedString(actualRate)).append("\n"); + sb.append(" interest: ").append(toIndentedString(interest)).append("\n"); + sb.append(" interestStatus: ").append(toIndentedString(interestStatus)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniLend.java b/src/main/java/io/gate/gateapi/models/UniLend.java new file mode 100644 index 0000000..6008e2c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniLend.java @@ -0,0 +1,223 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Loan record + */ +public class UniLend { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_CURRENT_AMOUNT = "current_amount"; + @SerializedName(SERIALIZED_NAME_CURRENT_AMOUNT) + private String currentAmount; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_LENT_AMOUNT = "lent_amount"; + @SerializedName(SERIALIZED_NAME_LENT_AMOUNT) + private String lentAmount; + + public static final String SERIALIZED_NAME_FROZEN_AMOUNT = "frozen_amount"; + @SerializedName(SERIALIZED_NAME_FROZEN_AMOUNT) + private String frozenAmount; + + public static final String SERIALIZED_NAME_MIN_RATE = "min_rate"; + @SerializedName(SERIALIZED_NAME_MIN_RATE) + private String minRate; + + public static final String SERIALIZED_NAME_INTEREST_STATUS = "interest_status"; + @SerializedName(SERIALIZED_NAME_INTEREST_STATUS) + private String interestStatus; + + public static final String SERIALIZED_NAME_REINVEST_LEFT_AMOUNT = "reinvest_left_amount"; + @SerializedName(SERIALIZED_NAME_REINVEST_LEFT_AMOUNT) + private String reinvestLeftAmount; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private Long updateTime; + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Current amount + * @return currentAmount + **/ + @javax.annotation.Nullable + public String getCurrentAmount() { + return currentAmount; + } + + + /** + * Total Lending Amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + /** + * Lent Amount + * @return lentAmount + **/ + @javax.annotation.Nullable + public String getLentAmount() { + return lentAmount; + } + + + /** + * Pending Redemption Amount + * @return frozenAmount + **/ + @javax.annotation.Nullable + public String getFrozenAmount() { + return frozenAmount; + } + + + /** + * Minimum interest rate + * @return minRate + **/ + @javax.annotation.Nullable + public String getMinRate() { + return minRate; + } + + + /** + * Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment + * @return interestStatus + **/ + @javax.annotation.Nullable + public String getInterestStatus() { + return interestStatus; + } + + + /** + * Non-reinvested Amount + * @return reinvestLeftAmount + **/ + @javax.annotation.Nullable + public String getReinvestLeftAmount() { + return reinvestLeftAmount; + } + + + /** + * Lending Order Creation Time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + + /** + * Lending Order Last Update Time + * @return updateTime + **/ + @javax.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniLend uniLend = (UniLend) o; + return Objects.equals(this.currency, uniLend.currency) && + Objects.equals(this.currentAmount, uniLend.currentAmount) && + Objects.equals(this.amount, uniLend.amount) && + Objects.equals(this.lentAmount, uniLend.lentAmount) && + Objects.equals(this.frozenAmount, uniLend.frozenAmount) && + Objects.equals(this.minRate, uniLend.minRate) && + Objects.equals(this.interestStatus, uniLend.interestStatus) && + Objects.equals(this.reinvestLeftAmount, uniLend.reinvestLeftAmount) && + Objects.equals(this.createTime, uniLend.createTime) && + Objects.equals(this.updateTime, uniLend.updateTime); + } + + @Override + public int hashCode() { + return Objects.hash(currency, currentAmount, amount, lentAmount, frozenAmount, minRate, interestStatus, reinvestLeftAmount, createTime, updateTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniLend {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" currentAmount: ").append(toIndentedString(currentAmount)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" lentAmount: ").append(toIndentedString(lentAmount)).append("\n"); + sb.append(" frozenAmount: ").append(toIndentedString(frozenAmount)).append("\n"); + sb.append(" minRate: ").append(toIndentedString(minRate)).append("\n"); + sb.append(" interestStatus: ").append(toIndentedString(interestStatus)).append("\n"); + sb.append(" reinvestLeftAmount: ").append(toIndentedString(reinvestLeftAmount)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniLendInterest.java b/src/main/java/io/gate/gateapi/models/UniLendInterest.java new file mode 100644 index 0000000..e7ec36c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniLendInterest.java @@ -0,0 +1,95 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UniLendInterest + */ +public class UniLendInterest { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_INTEREST = "interest"; + @SerializedName(SERIALIZED_NAME_INTEREST) + private String interest; + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Interest income + * @return interest + **/ + @javax.annotation.Nullable + public String getInterest() { + return interest; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniLendInterest uniLendInterest = (UniLendInterest) o; + return Objects.equals(this.currency, uniLendInterest.currency) && + Objects.equals(this.interest, uniLendInterest.interest); + } + + @Override + public int hashCode() { + return Objects.hash(currency, interest); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniLendInterest {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" interest: ").append(toIndentedString(interest)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniLendRecord.java b/src/main/java/io/gate/gateapi/models/UniLendRecord.java new file mode 100644 index 0000000..605c3fa --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniLendRecord.java @@ -0,0 +1,175 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Lending Record + */ +public class UniLendRecord { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_LAST_WALLET_AMOUNT = "last_wallet_amount"; + @SerializedName(SERIALIZED_NAME_LAST_WALLET_AMOUNT) + private String lastWalletAmount; + + public static final String SERIALIZED_NAME_LAST_LENT_AMOUNT = "last_lent_amount"; + @SerializedName(SERIALIZED_NAME_LAST_LENT_AMOUNT) + private String lastLentAmount; + + public static final String SERIALIZED_NAME_LAST_FROZEN_AMOUNT = "last_frozen_amount"; + @SerializedName(SERIALIZED_NAME_LAST_FROZEN_AMOUNT) + private String lastFrozenAmount; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Current Amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + /** + * Previous Available Amount + * @return lastWalletAmount + **/ + @javax.annotation.Nullable + public String getLastWalletAmount() { + return lastWalletAmount; + } + + + /** + * Previous Lent Amount + * @return lastLentAmount + **/ + @javax.annotation.Nullable + public String getLastLentAmount() { + return lastLentAmount; + } + + + /** + * Previous Frozen Amount + * @return lastFrozenAmount + **/ + @javax.annotation.Nullable + public String getLastFrozenAmount() { + return lastFrozenAmount; + } + + + /** + * Record Type: lend - Lend, redeem - Redeem + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniLendRecord uniLendRecord = (UniLendRecord) o; + return Objects.equals(this.currency, uniLendRecord.currency) && + Objects.equals(this.amount, uniLendRecord.amount) && + Objects.equals(this.lastWalletAmount, uniLendRecord.lastWalletAmount) && + Objects.equals(this.lastLentAmount, uniLendRecord.lastLentAmount) && + Objects.equals(this.lastFrozenAmount, uniLendRecord.lastFrozenAmount) && + Objects.equals(this.type, uniLendRecord.type) && + Objects.equals(this.createTime, uniLendRecord.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(currency, amount, lastWalletAmount, lastLentAmount, lastFrozenAmount, type, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniLendRecord {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" lastWalletAmount: ").append(toIndentedString(lastWalletAmount)).append("\n"); + sb.append(" lastLentAmount: ").append(toIndentedString(lastLentAmount)).append("\n"); + sb.append(" lastFrozenAmount: ").append(toIndentedString(lastFrozenAmount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniLoan.java b/src/main/java/io/gate/gateapi/models/UniLoan.java new file mode 100644 index 0000000..80a9411 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniLoan.java @@ -0,0 +1,159 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Borrowing + */ +public class UniLoan { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "update_time"; + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + private Long updateTime; + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + /** + * Amount to Repay + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + /** + * Loan type: platform borrowing - platform, margin borrowing - margin + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + + /** + * Last Update Time + * @return updateTime + **/ + @javax.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniLoan uniLoan = (UniLoan) o; + return Objects.equals(this.currency, uniLoan.currency) && + Objects.equals(this.currencyPair, uniLoan.currencyPair) && + Objects.equals(this.amount, uniLoan.amount) && + Objects.equals(this.type, uniLoan.type) && + Objects.equals(this.createTime, uniLoan.createTime) && + Objects.equals(this.updateTime, uniLoan.updateTime); + } + + @Override + public int hashCode() { + return Objects.hash(currency, currencyPair, amount, type, createTime, updateTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniLoan {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniLoanInterestRecord.java b/src/main/java/io/gate/gateapi/models/UniLoanInterestRecord.java new file mode 100644 index 0000000..1a9027c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniLoanInterestRecord.java @@ -0,0 +1,175 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Interest Deduction Record + */ +public class UniLoanInterestRecord { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_ACTUAL_RATE = "actual_rate"; + @SerializedName(SERIALIZED_NAME_ACTUAL_RATE) + private String actualRate; + + public static final String SERIALIZED_NAME_INTEREST = "interest"; + @SerializedName(SERIALIZED_NAME_INTEREST) + private String interest; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + /** + * Actual Rate + * @return actualRate + **/ + @javax.annotation.Nullable + public String getActualRate() { + return actualRate; + } + + + /** + * Interest + * @return interest + **/ + @javax.annotation.Nullable + public String getInterest() { + return interest; + } + + + /** + * Status: 0 - fail, 1 - success + * @return status + **/ + @javax.annotation.Nullable + public Integer getStatus() { + return status; + } + + + /** + * Type: platform - Platform borrowing, margin - Margin borrowing + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniLoanInterestRecord uniLoanInterestRecord = (UniLoanInterestRecord) o; + return Objects.equals(this.currency, uniLoanInterestRecord.currency) && + Objects.equals(this.currencyPair, uniLoanInterestRecord.currencyPair) && + Objects.equals(this.actualRate, uniLoanInterestRecord.actualRate) && + Objects.equals(this.interest, uniLoanInterestRecord.interest) && + Objects.equals(this.status, uniLoanInterestRecord.status) && + Objects.equals(this.type, uniLoanInterestRecord.type) && + Objects.equals(this.createTime, uniLoanInterestRecord.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(currency, currencyPair, actualRate, interest, status, type, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniLoanInterestRecord {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" actualRate: ").append(toIndentedString(actualRate)).append("\n"); + sb.append(" interest: ").append(toIndentedString(interest)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UniLoanRecord.java b/src/main/java/io/gate/gateapi/models/UniLoanRecord.java new file mode 100644 index 0000000..d2879be --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UniLoanRecord.java @@ -0,0 +1,143 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Borrowing Records + */ +public class UniLoanRecord { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + /** + * Type: `borrow` - borrow, `repay` - repay + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Borrow or repayment amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UniLoanRecord uniLoanRecord = (UniLoanRecord) o; + return Objects.equals(this.type, uniLoanRecord.type) && + Objects.equals(this.currencyPair, uniLoanRecord.currencyPair) && + Objects.equals(this.currency, uniLoanRecord.currency) && + Objects.equals(this.amount, uniLoanRecord.amount) && + Objects.equals(this.createTime, uniLoanRecord.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(type, currencyPair, currency, amount, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UniLoanRecord {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedAccount.java b/src/main/java/io/gate/gateapi/models/UnifiedAccount.java new file mode 100644 index 0000000..da41ee1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedAccount.java @@ -0,0 +1,585 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.UnifiedBalance; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * UnifiedAccount + */ +public class UnifiedAccount { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_REFRESH_TIME = "refresh_time"; + @SerializedName(SERIALIZED_NAME_REFRESH_TIME) + private Long refreshTime; + + public static final String SERIALIZED_NAME_LOCKED = "locked"; + @SerializedName(SERIALIZED_NAME_LOCKED) + private Boolean locked; + + public static final String SERIALIZED_NAME_BALANCES = "balances"; + @SerializedName(SERIALIZED_NAME_BALANCES) + private Map balances = null; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private String total; + + public static final String SERIALIZED_NAME_BORROWED = "borrowed"; + @SerializedName(SERIALIZED_NAME_BORROWED) + private String borrowed; + + public static final String SERIALIZED_NAME_TOTAL_INITIAL_MARGIN = "total_initial_margin"; + @SerializedName(SERIALIZED_NAME_TOTAL_INITIAL_MARGIN) + private String totalInitialMargin; + + public static final String SERIALIZED_NAME_TOTAL_MARGIN_BALANCE = "total_margin_balance"; + @SerializedName(SERIALIZED_NAME_TOTAL_MARGIN_BALANCE) + private String totalMarginBalance; + + public static final String SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN = "total_maintenance_margin"; + @SerializedName(SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN) + private String totalMaintenanceMargin; + + public static final String SERIALIZED_NAME_TOTAL_INITIAL_MARGIN_RATE = "total_initial_margin_rate"; + @SerializedName(SERIALIZED_NAME_TOTAL_INITIAL_MARGIN_RATE) + private String totalInitialMarginRate; + + public static final String SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN_RATE = "total_maintenance_margin_rate"; + @SerializedName(SERIALIZED_NAME_TOTAL_MAINTENANCE_MARGIN_RATE) + private String totalMaintenanceMarginRate; + + public static final String SERIALIZED_NAME_TOTAL_AVAILABLE_MARGIN = "total_available_margin"; + @SerializedName(SERIALIZED_NAME_TOTAL_AVAILABLE_MARGIN) + private String totalAvailableMargin; + + public static final String SERIALIZED_NAME_UNIFIED_ACCOUNT_TOTAL = "unified_account_total"; + @SerializedName(SERIALIZED_NAME_UNIFIED_ACCOUNT_TOTAL) + private String unifiedAccountTotal; + + public static final String SERIALIZED_NAME_UNIFIED_ACCOUNT_TOTAL_LIAB = "unified_account_total_liab"; + @SerializedName(SERIALIZED_NAME_UNIFIED_ACCOUNT_TOTAL_LIAB) + private String unifiedAccountTotalLiab; + + public static final String SERIALIZED_NAME_UNIFIED_ACCOUNT_TOTAL_EQUITY = "unified_account_total_equity"; + @SerializedName(SERIALIZED_NAME_UNIFIED_ACCOUNT_TOTAL_EQUITY) + private String unifiedAccountTotalEquity; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + public static final String SERIALIZED_NAME_SPOT_ORDER_LOSS = "spot_order_loss"; + @SerializedName(SERIALIZED_NAME_SPOT_ORDER_LOSS) + private String spotOrderLoss; + + public static final String SERIALIZED_NAME_SPOT_HEDGE = "spot_hedge"; + @SerializedName(SERIALIZED_NAME_SPOT_HEDGE) + private Boolean spotHedge; + + public static final String SERIALIZED_NAME_USE_FUNDING = "use_funding"; + @SerializedName(SERIALIZED_NAME_USE_FUNDING) + private Boolean useFunding; + + public static final String SERIALIZED_NAME_IS_ALL_COLLATERAL = "is_all_collateral"; + @SerializedName(SERIALIZED_NAME_IS_ALL_COLLATERAL) + private Boolean isAllCollateral; + + + public UnifiedAccount userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public UnifiedAccount refreshTime(Long refreshTime) { + + this.refreshTime = refreshTime; + return this; + } + + /** + * Last refresh time + * @return refreshTime + **/ + @javax.annotation.Nullable + public Long getRefreshTime() { + return refreshTime; + } + + + public void setRefreshTime(Long refreshTime) { + this.refreshTime = refreshTime; + } + + public UnifiedAccount locked(Boolean locked) { + + this.locked = locked; + return this; + } + + /** + * Whether the account is locked, valid in cross-currency margin/combined margin mode, false in other modes such as single-currency margin mode + * @return locked + **/ + @javax.annotation.Nullable + public Boolean getLocked() { + return locked; + } + + + public void setLocked(Boolean locked) { + this.locked = locked; + } + + public UnifiedAccount balances(Map balances) { + + this.balances = balances; + return this; + } + + public UnifiedAccount putBalancesItem(String key, UnifiedBalance balancesItem) { + if (this.balances == null) { + this.balances = new HashMap<>(); + } + this.balances.put(key, balancesItem); + return this; + } + + /** + * Get balances + * @return balances + **/ + @javax.annotation.Nullable + public Map getBalances() { + return balances; + } + + + public void setBalances(Map balances) { + this.balances = balances; + } + + public UnifiedAccount total(String total) { + + this.total = total; + return this; + } + + /** + * 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) + * @return total + **/ + @javax.annotation.Nullable + public String getTotal() { + return total; + } + + + public void setTotal(String total) { + this.total = total; + } + + public UnifiedAccount borrowed(String borrowed) { + + this.borrowed = borrowed; + return this; + } + + /** + * 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 + * @return borrowed + **/ + @javax.annotation.Nullable + public String getBorrowed() { + return borrowed; + } + + + public void setBorrowed(String borrowed) { + this.borrowed = borrowed; + } + + public UnifiedAccount totalInitialMargin(String totalInitialMargin) { + + this.totalInitialMargin = totalInitialMargin; + return this; + } + + /** + * Total initial margin, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return totalInitialMargin + **/ + @javax.annotation.Nullable + public String getTotalInitialMargin() { + return totalInitialMargin; + } + + + public void setTotalInitialMargin(String totalInitialMargin) { + this.totalInitialMargin = totalInitialMargin; + } + + public UnifiedAccount totalMarginBalance(String totalMarginBalance) { + + this.totalMarginBalance = totalMarginBalance; + return this; + } + + /** + * Total margin balance, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return totalMarginBalance + **/ + @javax.annotation.Nullable + public String getTotalMarginBalance() { + return totalMarginBalance; + } + + + public void setTotalMarginBalance(String totalMarginBalance) { + this.totalMarginBalance = totalMarginBalance; + } + + public UnifiedAccount totalMaintenanceMargin(String totalMaintenanceMargin) { + + this.totalMaintenanceMargin = totalMaintenanceMargin; + return this; + } + + /** + * Total maintenance margin is valid in cross-currency margin/combined margin mode, and is 0 in other modes such as single-currency margin mode + * @return totalMaintenanceMargin + **/ + @javax.annotation.Nullable + public String getTotalMaintenanceMargin() { + return totalMaintenanceMargin; + } + + + public void setTotalMaintenanceMargin(String totalMaintenanceMargin) { + this.totalMaintenanceMargin = totalMaintenanceMargin; + } + + public UnifiedAccount totalInitialMarginRate(String totalInitialMarginRate) { + + this.totalInitialMarginRate = totalInitialMarginRate; + return this; + } + + /** + * Total initial margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return totalInitialMarginRate + **/ + @javax.annotation.Nullable + public String getTotalInitialMarginRate() { + return totalInitialMarginRate; + } + + + public void setTotalInitialMarginRate(String totalInitialMarginRate) { + this.totalInitialMarginRate = totalInitialMarginRate; + } + + public UnifiedAccount totalMaintenanceMarginRate(String totalMaintenanceMarginRate) { + + this.totalMaintenanceMarginRate = totalMaintenanceMarginRate; + return this; + } + + /** + * Total maintenance margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return totalMaintenanceMarginRate + **/ + @javax.annotation.Nullable + public String getTotalMaintenanceMarginRate() { + return totalMaintenanceMarginRate; + } + + + public void setTotalMaintenanceMarginRate(String totalMaintenanceMarginRate) { + this.totalMaintenanceMarginRate = totalMaintenanceMarginRate; + } + + public UnifiedAccount totalAvailableMargin(String totalAvailableMargin) { + + this.totalAvailableMargin = totalAvailableMargin; + return this; + } + + /** + * Available margin amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return totalAvailableMargin + **/ + @javax.annotation.Nullable + public String getTotalAvailableMargin() { + return totalAvailableMargin; + } + + + public void setTotalAvailableMargin(String totalAvailableMargin) { + this.totalAvailableMargin = totalAvailableMargin; + } + + public UnifiedAccount unifiedAccountTotal(String unifiedAccountTotal) { + + this.unifiedAccountTotal = unifiedAccountTotal; + return this; + } + + /** + * Total unified account assets, valid in single currency margin/cross-currency margin/combined margin mode + * @return unifiedAccountTotal + **/ + @javax.annotation.Nullable + public String getUnifiedAccountTotal() { + return unifiedAccountTotal; + } + + + public void setUnifiedAccountTotal(String unifiedAccountTotal) { + this.unifiedAccountTotal = unifiedAccountTotal; + } + + public UnifiedAccount unifiedAccountTotalLiab(String unifiedAccountTotalLiab) { + + this.unifiedAccountTotalLiab = unifiedAccountTotalLiab; + return this; + } + + /** + * Total unified account borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return unifiedAccountTotalLiab + **/ + @javax.annotation.Nullable + public String getUnifiedAccountTotalLiab() { + return unifiedAccountTotalLiab; + } + + + public void setUnifiedAccountTotalLiab(String unifiedAccountTotalLiab) { + this.unifiedAccountTotalLiab = unifiedAccountTotalLiab; + } + + public UnifiedAccount unifiedAccountTotalEquity(String unifiedAccountTotalEquity) { + + this.unifiedAccountTotalEquity = unifiedAccountTotalEquity; + return this; + } + + /** + * Total unified account equity, valid in single currency margin/cross-currency margin/combined margin mode + * @return unifiedAccountTotalEquity + **/ + @javax.annotation.Nullable + public String getUnifiedAccountTotalEquity() { + return unifiedAccountTotalEquity; + } + + + public void setUnifiedAccountTotalEquity(String unifiedAccountTotalEquity) { + this.unifiedAccountTotalEquity = unifiedAccountTotalEquity; + } + + /** + * Actual leverage ratio, valid in cross-currency margin/combined margin mode + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + public UnifiedAccount spotOrderLoss(String spotOrderLoss) { + + this.spotOrderLoss = spotOrderLoss; + return this; + } + + /** + * Total pending order loss, in USDT, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return spotOrderLoss + **/ + @javax.annotation.Nullable + public String getSpotOrderLoss() { + return spotOrderLoss; + } + + + public void setSpotOrderLoss(String spotOrderLoss) { + this.spotOrderLoss = spotOrderLoss; + } + + public UnifiedAccount spotHedge(Boolean spotHedge) { + + this.spotHedge = spotHedge; + return this; + } + + /** + * Spot hedging status: true - enabled, false - disabled + * @return spotHedge + **/ + @javax.annotation.Nullable + public Boolean getSpotHedge() { + return spotHedge; + } + + + public void setSpotHedge(Boolean spotHedge) { + this.spotHedge = spotHedge; + } + + public UnifiedAccount useFunding(Boolean useFunding) { + + this.useFunding = useFunding; + return this; + } + + /** + * Whether to use Earn funds as margin + * @return useFunding + **/ + @javax.annotation.Nullable + public Boolean getUseFunding() { + return useFunding; + } + + + public void setUseFunding(Boolean useFunding) { + this.useFunding = useFunding; + } + + public UnifiedAccount isAllCollateral(Boolean isAllCollateral) { + + this.isAllCollateral = isAllCollateral; + return this; + } + + /** + * Whether all currencies are used as margin: true - all currencies as margin, false - no + * @return isAllCollateral + **/ + @javax.annotation.Nullable + public Boolean getIsAllCollateral() { + return isAllCollateral; + } + + + public void setIsAllCollateral(Boolean isAllCollateral) { + this.isAllCollateral = isAllCollateral; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedAccount unifiedAccount = (UnifiedAccount) o; + return Objects.equals(this.userId, unifiedAccount.userId) && + Objects.equals(this.refreshTime, unifiedAccount.refreshTime) && + Objects.equals(this.locked, unifiedAccount.locked) && + Objects.equals(this.balances, unifiedAccount.balances) && + Objects.equals(this.total, unifiedAccount.total) && + Objects.equals(this.borrowed, unifiedAccount.borrowed) && + Objects.equals(this.totalInitialMargin, unifiedAccount.totalInitialMargin) && + Objects.equals(this.totalMarginBalance, unifiedAccount.totalMarginBalance) && + Objects.equals(this.totalMaintenanceMargin, unifiedAccount.totalMaintenanceMargin) && + Objects.equals(this.totalInitialMarginRate, unifiedAccount.totalInitialMarginRate) && + Objects.equals(this.totalMaintenanceMarginRate, unifiedAccount.totalMaintenanceMarginRate) && + Objects.equals(this.totalAvailableMargin, unifiedAccount.totalAvailableMargin) && + Objects.equals(this.unifiedAccountTotal, unifiedAccount.unifiedAccountTotal) && + Objects.equals(this.unifiedAccountTotalLiab, unifiedAccount.unifiedAccountTotalLiab) && + Objects.equals(this.unifiedAccountTotalEquity, unifiedAccount.unifiedAccountTotalEquity) && + Objects.equals(this.leverage, unifiedAccount.leverage) && + Objects.equals(this.spotOrderLoss, unifiedAccount.spotOrderLoss) && + Objects.equals(this.spotHedge, unifiedAccount.spotHedge) && + Objects.equals(this.useFunding, unifiedAccount.useFunding) && + Objects.equals(this.isAllCollateral, unifiedAccount.isAllCollateral); + } + + @Override + public int hashCode() { + return Objects.hash(userId, refreshTime, locked, balances, total, borrowed, totalInitialMargin, totalMarginBalance, totalMaintenanceMargin, totalInitialMarginRate, totalMaintenanceMarginRate, totalAvailableMargin, unifiedAccountTotal, unifiedAccountTotalLiab, unifiedAccountTotalEquity, leverage, spotOrderLoss, spotHedge, useFunding, isAllCollateral); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedAccount {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" refreshTime: ").append(toIndentedString(refreshTime)).append("\n"); + sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" borrowed: ").append(toIndentedString(borrowed)).append("\n"); + sb.append(" totalInitialMargin: ").append(toIndentedString(totalInitialMargin)).append("\n"); + sb.append(" totalMarginBalance: ").append(toIndentedString(totalMarginBalance)).append("\n"); + sb.append(" totalMaintenanceMargin: ").append(toIndentedString(totalMaintenanceMargin)).append("\n"); + sb.append(" totalInitialMarginRate: ").append(toIndentedString(totalInitialMarginRate)).append("\n"); + sb.append(" totalMaintenanceMarginRate: ").append(toIndentedString(totalMaintenanceMarginRate)).append("\n"); + sb.append(" totalAvailableMargin: ").append(toIndentedString(totalAvailableMargin)).append("\n"); + sb.append(" unifiedAccountTotal: ").append(toIndentedString(unifiedAccountTotal)).append("\n"); + sb.append(" unifiedAccountTotalLiab: ").append(toIndentedString(unifiedAccountTotalLiab)).append("\n"); + sb.append(" unifiedAccountTotalEquity: ").append(toIndentedString(unifiedAccountTotalEquity)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append(" spotOrderLoss: ").append(toIndentedString(spotOrderLoss)).append("\n"); + sb.append(" spotHedge: ").append(toIndentedString(spotHedge)).append("\n"); + sb.append(" useFunding: ").append(toIndentedString(useFunding)).append("\n"); + sb.append(" isAllCollateral: ").append(toIndentedString(isAllCollateral)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedBalance.java b/src/main/java/io/gate/gateapi/models/UnifiedBalance.java new file mode 100644 index 0000000..6e76fe5 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedBalance.java @@ -0,0 +1,583 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UnifiedBalance + */ +public class UnifiedBalance { + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private String available; + + public static final String SERIALIZED_NAME_FREEZE = "freeze"; + @SerializedName(SERIALIZED_NAME_FREEZE) + private String freeze; + + public static final String SERIALIZED_NAME_BORROWED = "borrowed"; + @SerializedName(SERIALIZED_NAME_BORROWED) + private String borrowed; + + public static final String SERIALIZED_NAME_NEGATIVE_LIAB = "negative_liab"; + @SerializedName(SERIALIZED_NAME_NEGATIVE_LIAB) + private String negativeLiab; + + public static final String SERIALIZED_NAME_FUTURES_POS_LIAB = "futures_pos_liab"; + @SerializedName(SERIALIZED_NAME_FUTURES_POS_LIAB) + private String futuresPosLiab; + + public static final String SERIALIZED_NAME_EQUITY = "equity"; + @SerializedName(SERIALIZED_NAME_EQUITY) + private String equity; + + public static final String SERIALIZED_NAME_TOTAL_FREEZE = "total_freeze"; + @SerializedName(SERIALIZED_NAME_TOTAL_FREEZE) + private String totalFreeze; + + public static final String SERIALIZED_NAME_TOTAL_LIAB = "total_liab"; + @SerializedName(SERIALIZED_NAME_TOTAL_LIAB) + private String totalLiab; + + public static final String SERIALIZED_NAME_SPOT_IN_USE = "spot_in_use"; + @SerializedName(SERIALIZED_NAME_SPOT_IN_USE) + private String spotInUse; + + public static final String SERIALIZED_NAME_FUNDING = "funding"; + @SerializedName(SERIALIZED_NAME_FUNDING) + private String funding; + + public static final String SERIALIZED_NAME_FUNDING_VERSION = "funding_version"; + @SerializedName(SERIALIZED_NAME_FUNDING_VERSION) + private String fundingVersion; + + public static final String SERIALIZED_NAME_CROSS_BALANCE = "cross_balance"; + @SerializedName(SERIALIZED_NAME_CROSS_BALANCE) + private String crossBalance; + + public static final String SERIALIZED_NAME_ISO_BALANCE = "iso_balance"; + @SerializedName(SERIALIZED_NAME_ISO_BALANCE) + private String isoBalance; + + public static final String SERIALIZED_NAME_IM = "im"; + @SerializedName(SERIALIZED_NAME_IM) + private String im; + + public static final String SERIALIZED_NAME_MM = "mm"; + @SerializedName(SERIALIZED_NAME_MM) + private String mm; + + public static final String SERIALIZED_NAME_IMR = "imr"; + @SerializedName(SERIALIZED_NAME_IMR) + private String imr; + + public static final String SERIALIZED_NAME_MMR = "mmr"; + @SerializedName(SERIALIZED_NAME_MMR) + private String mmr; + + public static final String SERIALIZED_NAME_MARGIN_BALANCE = "margin_balance"; + @SerializedName(SERIALIZED_NAME_MARGIN_BALANCE) + private String marginBalance; + + public static final String SERIALIZED_NAME_AVAILABLE_MARGIN = "available_margin"; + @SerializedName(SERIALIZED_NAME_AVAILABLE_MARGIN) + private String availableMargin; + + public static final String SERIALIZED_NAME_ENABLED_COLLATERAL = "enabled_collateral"; + @SerializedName(SERIALIZED_NAME_ENABLED_COLLATERAL) + private Boolean enabledCollateral; + + + public UnifiedBalance available(String available) { + + this.available = available; + return this; + } + + /** + * Available balance, valid in single currency margin/cross-currency margin/combined margin mode, calculation varies by mode + * @return available + **/ + @javax.annotation.Nullable + public String getAvailable() { + return available; + } + + + public void setAvailable(String available) { + this.available = available; + } + + public UnifiedBalance freeze(String freeze) { + + this.freeze = freeze; + return this; + } + + /** + * Locked balance, valid in single currency margin/cross-currency margin/combined margin mode + * @return freeze + **/ + @javax.annotation.Nullable + public String getFreeze() { + return freeze; + } + + + public void setFreeze(String freeze) { + this.freeze = freeze; + } + + public UnifiedBalance borrowed(String borrowed) { + + this.borrowed = borrowed; + return this; + } + + /** + * Borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return borrowed + **/ + @javax.annotation.Nullable + public String getBorrowed() { + return borrowed; + } + + + public void setBorrowed(String borrowed) { + this.borrowed = borrowed; + } + + public UnifiedBalance negativeLiab(String negativeLiab) { + + this.negativeLiab = negativeLiab; + return this; + } + + /** + * Negative balance borrowing, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return negativeLiab + **/ + @javax.annotation.Nullable + public String getNegativeLiab() { + return negativeLiab; + } + + + public void setNegativeLiab(String negativeLiab) { + this.negativeLiab = negativeLiab; + } + + public UnifiedBalance futuresPosLiab(String futuresPosLiab) { + + this.futuresPosLiab = futuresPosLiab; + return this; + } + + /** + * Contract opening position borrowing currency (abandoned, to be offline field) + * @return futuresPosLiab + **/ + @javax.annotation.Nullable + public String getFuturesPosLiab() { + return futuresPosLiab; + } + + + public void setFuturesPosLiab(String futuresPosLiab) { + this.futuresPosLiab = futuresPosLiab; + } + + public UnifiedBalance equity(String equity) { + + this.equity = equity; + return this; + } + + /** + * Equity, valid in single currency margin/cross currency margin/combined margin mode + * @return equity + **/ + @javax.annotation.Nullable + public String getEquity() { + return equity; + } + + + public void setEquity(String equity) { + this.equity = equity; + } + + public UnifiedBalance totalFreeze(String totalFreeze) { + + this.totalFreeze = totalFreeze; + return this; + } + + /** + * Total frozen (deprecated, to be removed) + * @return totalFreeze + **/ + @javax.annotation.Nullable + public String getTotalFreeze() { + return totalFreeze; + } + + + public void setTotalFreeze(String totalFreeze) { + this.totalFreeze = totalFreeze; + } + + public UnifiedBalance totalLiab(String totalLiab) { + + this.totalLiab = totalLiab; + return this; + } + + /** + * Total borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode + * @return totalLiab + **/ + @javax.annotation.Nullable + public String getTotalLiab() { + return totalLiab; + } + + + public void setTotalLiab(String totalLiab) { + this.totalLiab = totalLiab; + } + + public UnifiedBalance spotInUse(String spotInUse) { + + this.spotInUse = spotInUse; + return this; + } + + /** + * 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 + * @return spotInUse + **/ + @javax.annotation.Nullable + public String getSpotInUse() { + return spotInUse; + } + + + public void setSpotInUse(String spotInUse) { + this.spotInUse = spotInUse; + } + + public UnifiedBalance funding(String funding) { + + this.funding = funding; + return this; + } + + /** + * Uniloan financial management amount, effective when turned on as a unified account margin switch + * @return funding + **/ + @javax.annotation.Nullable + public String getFunding() { + return funding; + } + + + public void setFunding(String funding) { + this.funding = funding; + } + + public UnifiedBalance fundingVersion(String fundingVersion) { + + this.fundingVersion = fundingVersion; + return this; + } + + /** + * Funding version + * @return fundingVersion + **/ + @javax.annotation.Nullable + public String getFundingVersion() { + return fundingVersion; + } + + + public void setFundingVersion(String fundingVersion) { + this.fundingVersion = fundingVersion; + } + + public UnifiedBalance crossBalance(String crossBalance) { + + this.crossBalance = crossBalance; + return this; + } + + /** + * Full margin balance is valid in single currency margin mode, and is 0 in other modes such as cross currency margin/combined margin mode + * @return crossBalance + **/ + @javax.annotation.Nullable + public String getCrossBalance() { + return crossBalance; + } + + + public void setCrossBalance(String crossBalance) { + this.crossBalance = crossBalance; + } + + public UnifiedBalance isoBalance(String isoBalance) { + + this.isoBalance = isoBalance; + return this; + } + + /** + * Isolated margin balance is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode + * @return isoBalance + **/ + @javax.annotation.Nullable + public String getIsoBalance() { + return isoBalance; + } + + + public void setIsoBalance(String isoBalance) { + this.isoBalance = isoBalance; + } + + public UnifiedBalance im(String im) { + + this.im = im; + return this; + } + + /** + * 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 + * @return im + **/ + @javax.annotation.Nullable + public String getIm() { + return im; + } + + + public void setIm(String im) { + this.im = im; + } + + public UnifiedBalance mm(String mm) { + + this.mm = mm; + return this; + } + + /** + * Cross margin maintenance margin, valid in single-currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode + * @return mm + **/ + @javax.annotation.Nullable + public String getMm() { + return mm; + } + + + public void setMm(String mm) { + this.mm = mm; + } + + public UnifiedBalance imr(String imr) { + + this.imr = imr; + return this; + } + + /** + * 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 + * @return imr + **/ + @javax.annotation.Nullable + public String getImr() { + return imr; + } + + + public void setImr(String imr) { + this.imr = imr; + } + + public UnifiedBalance mmr(String mmr) { + + this.mmr = mmr; + return this; + } + + /** + * 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 + * @return mmr + **/ + @javax.annotation.Nullable + public String getMmr() { + return mmr; + } + + + public void setMmr(String mmr) { + this.mmr = mmr; + } + + public UnifiedBalance marginBalance(String marginBalance) { + + this.marginBalance = marginBalance; + return this; + } + + /** + * Full margin balance is valid in single currency margin mode and is 0 in other modes such as cross currency margin/combined margin mode + * @return marginBalance + **/ + @javax.annotation.Nullable + public String getMarginBalance() { + return marginBalance; + } + + + public void setMarginBalance(String marginBalance) { + this.marginBalance = marginBalance; + } + + public UnifiedBalance availableMargin(String availableMargin) { + + this.availableMargin = availableMargin; + return this; + } + + /** + * Cross margin available balance, valid in single currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode + * @return availableMargin + **/ + @javax.annotation.Nullable + public String getAvailableMargin() { + return availableMargin; + } + + + public void setAvailableMargin(String availableMargin) { + this.availableMargin = availableMargin; + } + + public UnifiedBalance enabledCollateral(Boolean enabledCollateral) { + + this.enabledCollateral = enabledCollateral; + return this; + } + + /** + * Currency enabled as margin: true - Enabled, false - Disabled + * @return enabledCollateral + **/ + @javax.annotation.Nullable + public Boolean getEnabledCollateral() { + return enabledCollateral; + } + + + public void setEnabledCollateral(Boolean enabledCollateral) { + this.enabledCollateral = enabledCollateral; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedBalance unifiedBalance = (UnifiedBalance) o; + return Objects.equals(this.available, unifiedBalance.available) && + Objects.equals(this.freeze, unifiedBalance.freeze) && + Objects.equals(this.borrowed, unifiedBalance.borrowed) && + Objects.equals(this.negativeLiab, unifiedBalance.negativeLiab) && + Objects.equals(this.futuresPosLiab, unifiedBalance.futuresPosLiab) && + Objects.equals(this.equity, unifiedBalance.equity) && + Objects.equals(this.totalFreeze, unifiedBalance.totalFreeze) && + Objects.equals(this.totalLiab, unifiedBalance.totalLiab) && + Objects.equals(this.spotInUse, unifiedBalance.spotInUse) && + Objects.equals(this.funding, unifiedBalance.funding) && + Objects.equals(this.fundingVersion, unifiedBalance.fundingVersion) && + Objects.equals(this.crossBalance, unifiedBalance.crossBalance) && + Objects.equals(this.isoBalance, unifiedBalance.isoBalance) && + Objects.equals(this.im, unifiedBalance.im) && + Objects.equals(this.mm, unifiedBalance.mm) && + Objects.equals(this.imr, unifiedBalance.imr) && + Objects.equals(this.mmr, unifiedBalance.mmr) && + Objects.equals(this.marginBalance, unifiedBalance.marginBalance) && + Objects.equals(this.availableMargin, unifiedBalance.availableMargin) && + Objects.equals(this.enabledCollateral, unifiedBalance.enabledCollateral); + } + + @Override + public int hashCode() { + return Objects.hash(available, freeze, borrowed, negativeLiab, futuresPosLiab, equity, totalFreeze, totalLiab, spotInUse, funding, fundingVersion, crossBalance, isoBalance, im, mm, imr, mmr, marginBalance, availableMargin, enabledCollateral); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedBalance {\n"); + sb.append(" available: ").append(toIndentedString(available)).append("\n"); + sb.append(" freeze: ").append(toIndentedString(freeze)).append("\n"); + sb.append(" borrowed: ").append(toIndentedString(borrowed)).append("\n"); + sb.append(" negativeLiab: ").append(toIndentedString(negativeLiab)).append("\n"); + sb.append(" futuresPosLiab: ").append(toIndentedString(futuresPosLiab)).append("\n"); + sb.append(" equity: ").append(toIndentedString(equity)).append("\n"); + sb.append(" totalFreeze: ").append(toIndentedString(totalFreeze)).append("\n"); + sb.append(" totalLiab: ").append(toIndentedString(totalLiab)).append("\n"); + sb.append(" spotInUse: ").append(toIndentedString(spotInUse)).append("\n"); + sb.append(" funding: ").append(toIndentedString(funding)).append("\n"); + sb.append(" fundingVersion: ").append(toIndentedString(fundingVersion)).append("\n"); + sb.append(" crossBalance: ").append(toIndentedString(crossBalance)).append("\n"); + sb.append(" isoBalance: ").append(toIndentedString(isoBalance)).append("\n"); + sb.append(" im: ").append(toIndentedString(im)).append("\n"); + sb.append(" mm: ").append(toIndentedString(mm)).append("\n"); + sb.append(" imr: ").append(toIndentedString(imr)).append("\n"); + sb.append(" mmr: ").append(toIndentedString(mmr)).append("\n"); + sb.append(" marginBalance: ").append(toIndentedString(marginBalance)).append("\n"); + sb.append(" availableMargin: ").append(toIndentedString(availableMargin)).append("\n"); + sb.append(" enabledCollateral: ").append(toIndentedString(enabledCollateral)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginBorrowable.java b/src/main/java/io/gate/gateapi/models/UnifiedBorrowable.java similarity index 77% rename from src/main/java/io/gate/gateapi/models/CrossMarginBorrowable.java rename to src/main/java/io/gate/gateapi/models/UnifiedBorrowable.java index 3c63a77..e553e3f 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginBorrowable.java +++ b/src/main/java/io/gate/gateapi/models/UnifiedBorrowable.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 @@ -20,9 +20,9 @@ import java.io.IOException; /** - * CrossMarginBorrowable + * UnifiedBorrowable */ -public class CrossMarginBorrowable { +public class UnifiedBorrowable { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; @@ -32,7 +32,7 @@ public class CrossMarginBorrowable { private String amount; - public CrossMarginBorrowable currency(String currency) { + public UnifiedBorrowable currency(String currency) { this.currency = currency; return this; @@ -52,7 +52,7 @@ public void setCurrency(String currency) { this.currency = currency; } - public CrossMarginBorrowable amount(String amount) { + public UnifiedBorrowable amount(String amount) { this.amount = amount; return this; @@ -79,9 +79,9 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CrossMarginBorrowable crossMarginBorrowable = (CrossMarginBorrowable) o; - return Objects.equals(this.currency, crossMarginBorrowable.currency) && - Objects.equals(this.amount, crossMarginBorrowable.amount); + UnifiedBorrowable unifiedBorrowable = (UnifiedBorrowable) o; + return Objects.equals(this.currency, unifiedBorrowable.currency) && + Objects.equals(this.amount, unifiedBorrowable.amount); } @Override @@ -93,7 +93,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginBorrowable {\n"); + sb.append("class UnifiedBorrowable {\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append("}"); diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginTransferable.java b/src/main/java/io/gate/gateapi/models/UnifiedBorrowable1.java similarity index 75% rename from src/main/java/io/gate/gateapi/models/CrossMarginTransferable.java rename to src/main/java/io/gate/gateapi/models/UnifiedBorrowable1.java index 2c409db..165b1c1 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginTransferable.java +++ b/src/main/java/io/gate/gateapi/models/UnifiedBorrowable1.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 @@ -20,9 +20,9 @@ import java.io.IOException; /** - * CrossMarginTransferable + * Batch query unified account maximum borrowable results */ -public class CrossMarginTransferable { +public class UnifiedBorrowable1 { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; @@ -32,7 +32,7 @@ public class CrossMarginTransferable { private String amount; - public CrossMarginTransferable currency(String currency) { + public UnifiedBorrowable1 currency(String currency) { this.currency = currency; return this; @@ -52,14 +52,14 @@ public void setCurrency(String currency) { this.currency = currency; } - public CrossMarginTransferable amount(String amount) { + public UnifiedBorrowable1 amount(String amount) { this.amount = amount; return this; } /** - * Max transferable amount + * Maximum borrowable amount * @return amount **/ @javax.annotation.Nullable @@ -79,9 +79,9 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CrossMarginTransferable crossMarginTransferable = (CrossMarginTransferable) o; - return Objects.equals(this.currency, crossMarginTransferable.currency) && - Objects.equals(this.amount, crossMarginTransferable.amount); + UnifiedBorrowable1 unifiedBorrowable1 = (UnifiedBorrowable1) o; + return Objects.equals(this.currency, unifiedBorrowable1.currency) && + Objects.equals(this.amount, unifiedBorrowable1.amount); } @Override @@ -93,7 +93,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginTransferable {\n"); + sb.append("class UnifiedBorrowable1 {\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append("}"); diff --git a/src/main/java/io/gate/gateapi/models/UnifiedCollateralReq.java b/src/main/java/io/gate/gateapi/models/UnifiedCollateralReq.java new file mode 100644 index 0000000..7ed61e3 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedCollateralReq.java @@ -0,0 +1,206 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * UnifiedCollateralReq + */ +public class UnifiedCollateralReq { + /** + * 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 + */ + @JsonAdapter(CollateralTypeEnum.Adapter.class) + public enum CollateralTypeEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + CollateralTypeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CollateralTypeEnum fromValue(Integer value) { + for (CollateralTypeEnum b : CollateralTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CollateralTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CollateralTypeEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return CollateralTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_COLLATERAL_TYPE = "collateral_type"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_TYPE) + private CollateralTypeEnum collateralType; + + public static final String SERIALIZED_NAME_ENABLE_LIST = "enable_list"; + @SerializedName(SERIALIZED_NAME_ENABLE_LIST) + private List enableList = null; + + public static final String SERIALIZED_NAME_DISABLE_LIST = "disable_list"; + @SerializedName(SERIALIZED_NAME_DISABLE_LIST) + private List disableList = null; + + + public UnifiedCollateralReq collateralType(CollateralTypeEnum collateralType) { + + this.collateralType = collateralType; + return this; + } + + /** + * 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 + * @return collateralType + **/ + @javax.annotation.Nullable + public CollateralTypeEnum getCollateralType() { + return collateralType; + } + + + public void setCollateralType(CollateralTypeEnum collateralType) { + this.collateralType = collateralType; + } + + public UnifiedCollateralReq enableList(List enableList) { + + this.enableList = enableList; + return this; + } + + public UnifiedCollateralReq addEnableListItem(String enableListItem) { + if (this.enableList == null) { + this.enableList = new ArrayList<>(); + } + this.enableList.add(enableListItem); + return this; + } + + /** + * Currency list, where collateral_type=1(custom) indicates the addition logic + * @return enableList + **/ + @javax.annotation.Nullable + public List getEnableList() { + return enableList; + } + + + public void setEnableList(List enableList) { + this.enableList = enableList; + } + + public UnifiedCollateralReq disableList(List disableList) { + + this.disableList = disableList; + return this; + } + + public UnifiedCollateralReq addDisableListItem(String disableListItem) { + if (this.disableList == null) { + this.disableList = new ArrayList<>(); + } + this.disableList.add(disableListItem); + return this; + } + + /** + * Disable list, indicating the disable logic + * @return disableList + **/ + @javax.annotation.Nullable + public List getDisableList() { + return disableList; + } + + + public void setDisableList(List disableList) { + this.disableList = disableList; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedCollateralReq unifiedCollateralReq = (UnifiedCollateralReq) o; + return Objects.equals(this.collateralType, unifiedCollateralReq.collateralType) && + Objects.equals(this.enableList, unifiedCollateralReq.enableList) && + Objects.equals(this.disableList, unifiedCollateralReq.disableList); + } + + @Override + public int hashCode() { + return Objects.hash(collateralType, enableList, disableList); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedCollateralReq {\n"); + sb.append(" collateralType: ").append(toIndentedString(collateralType)).append("\n"); + sb.append(" enableList: ").append(toIndentedString(enableList)).append("\n"); + sb.append(" disableList: ").append(toIndentedString(disableList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedCollateralRes.java b/src/main/java/io/gate/gateapi/models/UnifiedCollateralRes.java new file mode 100644 index 0000000..a1aa90d --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedCollateralRes.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Unified account collateral mode settings response + */ +public class UnifiedCollateralRes { + public static final String SERIALIZED_NAME_IS_SUCCESS = "is_success"; + @SerializedName(SERIALIZED_NAME_IS_SUCCESS) + private Boolean isSuccess; + + + public UnifiedCollateralRes isSuccess(Boolean isSuccess) { + + this.isSuccess = isSuccess; + return this; + } + + /** + * Whether the setting was successful + * @return isSuccess + **/ + @javax.annotation.Nullable + public Boolean getIsSuccess() { + return isSuccess; + } + + + public void setIsSuccess(Boolean isSuccess) { + this.isSuccess = isSuccess; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedCollateralRes unifiedCollateralRes = (UnifiedCollateralRes) o; + return Objects.equals(this.isSuccess, unifiedCollateralRes.isSuccess); + } + + @Override + public int hashCode() { + return Objects.hash(isSuccess); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedCollateralRes {\n"); + sb.append(" isSuccess: ").append(toIndentedString(isSuccess)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginCurrency.java b/src/main/java/io/gate/gateapi/models/UnifiedCurrency.java similarity index 56% rename from src/main/java/io/gate/gateapi/models/CrossMarginCurrency.java rename to src/main/java/io/gate/gateapi/models/UnifiedCurrency.java index eadf52a..24624f9 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginCurrency.java +++ b/src/main/java/io/gate/gateapi/models/UnifiedCurrency.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 @@ -20,25 +20,17 @@ import java.io.IOException; /** - * CrossMarginCurrency + * UnifiedCurrency */ -public class CrossMarginCurrency { +public class UnifiedCurrency { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; - public static final String SERIALIZED_NAME_RATE = "rate"; - @SerializedName(SERIALIZED_NAME_RATE) - private String rate; - public static final String SERIALIZED_NAME_PREC = "prec"; @SerializedName(SERIALIZED_NAME_PREC) private String prec; - public static final String SERIALIZED_NAME_DISCOUNT = "discount"; - @SerializedName(SERIALIZED_NAME_DISCOUNT) - private String discount; - public static final String SERIALIZED_NAME_MIN_BORROW_AMOUNT = "min_borrow_amount"; @SerializedName(SERIALIZED_NAME_MIN_BORROW_AMOUNT) private String minBorrowAmount; @@ -51,12 +43,12 @@ public class CrossMarginCurrency { @SerializedName(SERIALIZED_NAME_TOTAL_MAX_BORROW_AMOUNT) private String totalMaxBorrowAmount; - public static final String SERIALIZED_NAME_PRICE = "price"; - @SerializedName(SERIALIZED_NAME_PRICE) - private String price; + public static final String SERIALIZED_NAME_LOAN_STATUS = "loan_status"; + @SerializedName(SERIALIZED_NAME_LOAN_STATUS) + private String loanStatus; - public CrossMarginCurrency name(String name) { + public UnifiedCurrency name(String name) { this.name = name; return this; @@ -76,27 +68,7 @@ public void setName(String name) { this.name = name; } - public CrossMarginCurrency rate(String rate) { - - this.rate = rate; - return this; - } - - /** - * Loan rate - * @return rate - **/ - @javax.annotation.Nullable - public String getRate() { - return rate; - } - - - public void setRate(String rate) { - this.rate = rate; - } - - public CrossMarginCurrency prec(String prec) { + public UnifiedCurrency prec(String prec) { this.prec = prec; return this; @@ -116,34 +88,14 @@ public void setPrec(String prec) { this.prec = prec; } - public CrossMarginCurrency discount(String discount) { - - this.discount = discount; - return this; - } - - /** - * Currency value discount, which is used in total value calculation - * @return discount - **/ - @javax.annotation.Nullable - public String getDiscount() { - return discount; - } - - - public void setDiscount(String discount) { - this.discount = discount; - } - - public CrossMarginCurrency minBorrowAmount(String minBorrowAmount) { + public UnifiedCurrency minBorrowAmount(String minBorrowAmount) { this.minBorrowAmount = minBorrowAmount; return this; } /** - * Minimum currency borrow amount. Unit is currency itself + * Minimum borrowable limit, in currency units * @return minBorrowAmount **/ @javax.annotation.Nullable @@ -156,14 +108,14 @@ public void setMinBorrowAmount(String minBorrowAmount) { this.minBorrowAmount = minBorrowAmount; } - public CrossMarginCurrency userMaxBorrowAmount(String userMaxBorrowAmount) { + public UnifiedCurrency userMaxBorrowAmount(String userMaxBorrowAmount) { this.userMaxBorrowAmount = userMaxBorrowAmount; return this; } /** - * Maximum borrow value allowed per user, in USDT + * User's maximum borrowable limit, in USDT * @return userMaxBorrowAmount **/ @javax.annotation.Nullable @@ -176,14 +128,14 @@ public void setUserMaxBorrowAmount(String userMaxBorrowAmount) { this.userMaxBorrowAmount = userMaxBorrowAmount; } - public CrossMarginCurrency totalMaxBorrowAmount(String totalMaxBorrowAmount) { + public UnifiedCurrency totalMaxBorrowAmount(String totalMaxBorrowAmount) { this.totalMaxBorrowAmount = totalMaxBorrowAmount; return this; } /** - * Maximum borrow value allowed for this currency, in USDT + * Platform's maximum borrowable limit, in USDT * @return totalMaxBorrowAmount **/ @javax.annotation.Nullable @@ -196,24 +148,24 @@ public void setTotalMaxBorrowAmount(String totalMaxBorrowAmount) { this.totalMaxBorrowAmount = totalMaxBorrowAmount; } - public CrossMarginCurrency price(String price) { + public UnifiedCurrency loanStatus(String loanStatus) { - this.price = price; + this.loanStatus = loanStatus; return this; } /** - * Price change between this currency and USDT - * @return price + * Lending status - `disable` : Lending prohibited - `enable` : Lending supported + * @return loanStatus **/ @javax.annotation.Nullable - public String getPrice() { - return price; + public String getLoanStatus() { + return loanStatus; } - public void setPrice(String price) { - this.price = price; + public void setLoanStatus(String loanStatus) { + this.loanStatus = loanStatus; } @Override public boolean equals(java.lang.Object o) { @@ -223,35 +175,31 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CrossMarginCurrency crossMarginCurrency = (CrossMarginCurrency) o; - return Objects.equals(this.name, crossMarginCurrency.name) && - Objects.equals(this.rate, crossMarginCurrency.rate) && - Objects.equals(this.prec, crossMarginCurrency.prec) && - Objects.equals(this.discount, crossMarginCurrency.discount) && - Objects.equals(this.minBorrowAmount, crossMarginCurrency.minBorrowAmount) && - Objects.equals(this.userMaxBorrowAmount, crossMarginCurrency.userMaxBorrowAmount) && - Objects.equals(this.totalMaxBorrowAmount, crossMarginCurrency.totalMaxBorrowAmount) && - Objects.equals(this.price, crossMarginCurrency.price); + UnifiedCurrency unifiedCurrency = (UnifiedCurrency) o; + return Objects.equals(this.name, unifiedCurrency.name) && + Objects.equals(this.prec, unifiedCurrency.prec) && + Objects.equals(this.minBorrowAmount, unifiedCurrency.minBorrowAmount) && + Objects.equals(this.userMaxBorrowAmount, unifiedCurrency.userMaxBorrowAmount) && + Objects.equals(this.totalMaxBorrowAmount, unifiedCurrency.totalMaxBorrowAmount) && + Objects.equals(this.loanStatus, unifiedCurrency.loanStatus); } @Override public int hashCode() { - return Objects.hash(name, rate, prec, discount, minBorrowAmount, userMaxBorrowAmount, totalMaxBorrowAmount, price); + return Objects.hash(name, prec, minBorrowAmount, userMaxBorrowAmount, totalMaxBorrowAmount, loanStatus); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginCurrency {\n"); + sb.append("class UnifiedCurrency {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); sb.append(" prec: ").append(toIndentedString(prec)).append("\n"); - sb.append(" discount: ").append(toIndentedString(discount)).append("\n"); sb.append(" minBorrowAmount: ").append(toIndentedString(minBorrowAmount)).append("\n"); sb.append(" userMaxBorrowAmount: ").append(toIndentedString(userMaxBorrowAmount)).append("\n"); sb.append(" totalMaxBorrowAmount: ").append(toIndentedString(totalMaxBorrowAmount)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" loanStatus: ").append(toIndentedString(loanStatus)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/UnifiedDiscount.java b/src/main/java/io/gate/gateapi/models/UnifiedDiscount.java new file mode 100644 index 0000000..ad5b0e0 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedDiscount.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.UnifiedDiscountTiers; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Unified account tiered discount + */ +public class UnifiedDiscount { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_DISCOUNT_TIERS = "discount_tiers"; + @SerializedName(SERIALIZED_NAME_DISCOUNT_TIERS) + private List discountTiers = null; + + + public UnifiedDiscount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UnifiedDiscount discountTiers(List discountTiers) { + + this.discountTiers = discountTiers; + return this; + } + + public UnifiedDiscount addDiscountTiersItem(UnifiedDiscountTiers discountTiersItem) { + if (this.discountTiers == null) { + this.discountTiers = new ArrayList<>(); + } + this.discountTiers.add(discountTiersItem); + return this; + } + + /** + * Tiered discount + * @return discountTiers + **/ + @javax.annotation.Nullable + public List getDiscountTiers() { + return discountTiers; + } + + + public void setDiscountTiers(List discountTiers) { + this.discountTiers = discountTiers; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedDiscount unifiedDiscount = (UnifiedDiscount) o; + return Objects.equals(this.currency, unifiedDiscount.currency) && + Objects.equals(this.discountTiers, unifiedDiscount.discountTiers); + } + + @Override + public int hashCode() { + return Objects.hash(currency, discountTiers); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedDiscount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" discountTiers: ").append(toIndentedString(discountTiers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedDiscountTiers.java b/src/main/java/io/gate/gateapi/models/UnifiedDiscountTiers.java new file mode 100644 index 0000000..e1605ce --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedDiscountTiers.java @@ -0,0 +1,193 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UnifiedDiscountTiers + */ +public class UnifiedDiscountTiers { + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + private String tier; + + public static final String SERIALIZED_NAME_DISCOUNT = "discount"; + @SerializedName(SERIALIZED_NAME_DISCOUNT) + private String discount; + + public static final String SERIALIZED_NAME_LOWER_LIMIT = "lower_limit"; + @SerializedName(SERIALIZED_NAME_LOWER_LIMIT) + private String lowerLimit; + + public static final String SERIALIZED_NAME_UPPER_LIMIT = "upper_limit"; + @SerializedName(SERIALIZED_NAME_UPPER_LIMIT) + private String upperLimit; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + + public UnifiedDiscountTiers tier(String tier) { + + this.tier = tier; + return this; + } + + /** + * Tier + * @return tier + **/ + @javax.annotation.Nullable + public String getTier() { + return tier; + } + + + public void setTier(String tier) { + this.tier = tier; + } + + public UnifiedDiscountTiers discount(String discount) { + + this.discount = discount; + return this; + } + + /** + * Discount + * @return discount + **/ + @javax.annotation.Nullable + public String getDiscount() { + return discount; + } + + + public void setDiscount(String discount) { + this.discount = discount; + } + + public UnifiedDiscountTiers lowerLimit(String lowerLimit) { + + this.lowerLimit = lowerLimit; + return this; + } + + /** + * Lower limit + * @return lowerLimit + **/ + @javax.annotation.Nullable + public String getLowerLimit() { + return lowerLimit; + } + + + public void setLowerLimit(String lowerLimit) { + this.lowerLimit = lowerLimit; + } + + public UnifiedDiscountTiers upperLimit(String upperLimit) { + + this.upperLimit = upperLimit; + return this; + } + + /** + * Upper limit, + indicates positive infinity + * @return upperLimit + **/ + @javax.annotation.Nullable + public String getUpperLimit() { + return upperLimit; + } + + + public void setUpperLimit(String upperLimit) { + this.upperLimit = upperLimit; + } + + public UnifiedDiscountTiers leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * Position leverage + * @return leverage + **/ + @javax.annotation.Nullable + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedDiscountTiers unifiedDiscountTiers = (UnifiedDiscountTiers) o; + return Objects.equals(this.tier, unifiedDiscountTiers.tier) && + Objects.equals(this.discount, unifiedDiscountTiers.discount) && + Objects.equals(this.lowerLimit, unifiedDiscountTiers.lowerLimit) && + Objects.equals(this.upperLimit, unifiedDiscountTiers.upperLimit) && + Objects.equals(this.leverage, unifiedDiscountTiers.leverage); + } + + @Override + public int hashCode() { + return Objects.hash(tier, discount, lowerLimit, upperLimit, leverage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedDiscountTiers {\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" discount: ").append(toIndentedString(discount)).append("\n"); + sb.append(" lowerLimit: ").append(toIndentedString(lowerLimit)).append("\n"); + sb.append(" upperLimit: ").append(toIndentedString(upperLimit)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedHistoryLoanRate.java b/src/main/java/io/gate/gateapi/models/UnifiedHistoryLoanRate.java new file mode 100644 index 0000000..dbcc1e9 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedHistoryLoanRate.java @@ -0,0 +1,178 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.UnifiedHistoryLoanRateRates; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * UnifiedHistoryLoanRate + */ +public class UnifiedHistoryLoanRate { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_TIER = "tier"; + @SerializedName(SERIALIZED_NAME_TIER) + private String tier; + + public static final String SERIALIZED_NAME_TIER_UP_RATE = "tier_up_rate"; + @SerializedName(SERIALIZED_NAME_TIER_UP_RATE) + private String tierUpRate; + + public static final String SERIALIZED_NAME_RATES = "rates"; + @SerializedName(SERIALIZED_NAME_RATES) + private List rates = null; + + + public UnifiedHistoryLoanRate currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UnifiedHistoryLoanRate tier(String tier) { + + this.tier = tier; + return this; + } + + /** + * VIP level for the floating rate to be retrieved + * @return tier + **/ + @javax.annotation.Nullable + public String getTier() { + return tier; + } + + + public void setTier(String tier) { + this.tier = tier; + } + + public UnifiedHistoryLoanRate tierUpRate(String tierUpRate) { + + this.tierUpRate = tierUpRate; + return this; + } + + /** + * Floating rate corresponding to VIP level + * @return tierUpRate + **/ + @javax.annotation.Nullable + public String getTierUpRate() { + return tierUpRate; + } + + + public void setTierUpRate(String tierUpRate) { + this.tierUpRate = tierUpRate; + } + + public UnifiedHistoryLoanRate rates(List rates) { + + this.rates = rates; + return this; + } + + public UnifiedHistoryLoanRate addRatesItem(UnifiedHistoryLoanRateRates ratesItem) { + if (this.rates == null) { + this.rates = new ArrayList<>(); + } + this.rates.add(ratesItem); + return this; + } + + /** + * 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 + * @return rates + **/ + @javax.annotation.Nullable + public List getRates() { + return rates; + } + + + public void setRates(List rates) { + this.rates = rates; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedHistoryLoanRate unifiedHistoryLoanRate = (UnifiedHistoryLoanRate) o; + return Objects.equals(this.currency, unifiedHistoryLoanRate.currency) && + Objects.equals(this.tier, unifiedHistoryLoanRate.tier) && + Objects.equals(this.tierUpRate, unifiedHistoryLoanRate.tierUpRate) && + Objects.equals(this.rates, unifiedHistoryLoanRate.rates); + } + + @Override + public int hashCode() { + return Objects.hash(currency, tier, tierUpRate, rates); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedHistoryLoanRate {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); + sb.append(" tierUpRate: ").append(toIndentedString(tierUpRate)).append("\n"); + sb.append(" rates: ").append(toIndentedString(rates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedHistoryLoanRateRates.java b/src/main/java/io/gate/gateapi/models/UnifiedHistoryLoanRateRates.java new file mode 100644 index 0000000..fcbc9c4 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedHistoryLoanRateRates.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UnifiedHistoryLoanRateRates + */ +public class UnifiedHistoryLoanRateRates { + public static final String SERIALIZED_NAME_TIME = "time"; + @SerializedName(SERIALIZED_NAME_TIME) + private Long time; + + public static final String SERIALIZED_NAME_RATE = "rate"; + @SerializedName(SERIALIZED_NAME_RATE) + private String rate; + + + public UnifiedHistoryLoanRateRates time(Long time) { + + this.time = time; + return this; + } + + /** + * Hourly timestamp corresponding to this interest rate, in milliseconds + * @return time + **/ + @javax.annotation.Nullable + public Long getTime() { + return time; + } + + + public void setTime(Long time) { + this.time = time; + } + + public UnifiedHistoryLoanRateRates rate(String rate) { + + this.rate = rate; + return this; + } + + /** + * Historical interest rate for this hour + * @return rate + **/ + @javax.annotation.Nullable + public String getRate() { + return rate; + } + + + public void setRate(String rate) { + this.rate = rate; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedHistoryLoanRateRates unifiedHistoryLoanRateRates = (UnifiedHistoryLoanRateRates) o; + return Objects.equals(this.time, unifiedHistoryLoanRateRates.time) && + Objects.equals(this.rate, unifiedHistoryLoanRateRates.rate); + } + + @Override + public int hashCode() { + return Objects.hash(time, rate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedHistoryLoanRateRates {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedLeverageConfig.java b/src/main/java/io/gate/gateapi/models/UnifiedLeverageConfig.java new file mode 100644 index 0000000..6073415 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedLeverageConfig.java @@ -0,0 +1,245 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UnifiedLeverageConfig + */ +public class UnifiedLeverageConfig { + public static final String SERIALIZED_NAME_CURRENT_LEVERAGE = "current_leverage"; + @SerializedName(SERIALIZED_NAME_CURRENT_LEVERAGE) + private String currentLeverage; + + public static final String SERIALIZED_NAME_MIN_LEVERAGE = "min_leverage"; + @SerializedName(SERIALIZED_NAME_MIN_LEVERAGE) + private String minLeverage; + + public static final String SERIALIZED_NAME_MAX_LEVERAGE = "max_leverage"; + @SerializedName(SERIALIZED_NAME_MAX_LEVERAGE) + private String maxLeverage; + + public static final String SERIALIZED_NAME_DEBIT = "debit"; + @SerializedName(SERIALIZED_NAME_DEBIT) + private String debit; + + public static final String SERIALIZED_NAME_AVAILABLE_MARGIN = "available_margin"; + @SerializedName(SERIALIZED_NAME_AVAILABLE_MARGIN) + private String availableMargin; + + public static final String SERIALIZED_NAME_BORROWABLE = "borrowable"; + @SerializedName(SERIALIZED_NAME_BORROWABLE) + private String borrowable; + + public static final String SERIALIZED_NAME_EXCEPT_LEVERAGE_BORROWABLE = "except_leverage_borrowable"; + @SerializedName(SERIALIZED_NAME_EXCEPT_LEVERAGE_BORROWABLE) + private String exceptLeverageBorrowable; + + + public UnifiedLeverageConfig currentLeverage(String currentLeverage) { + + this.currentLeverage = currentLeverage; + return this; + } + + /** + * Current leverage ratio + * @return currentLeverage + **/ + @javax.annotation.Nullable + public String getCurrentLeverage() { + return currentLeverage; + } + + + public void setCurrentLeverage(String currentLeverage) { + this.currentLeverage = currentLeverage; + } + + public UnifiedLeverageConfig minLeverage(String minLeverage) { + + this.minLeverage = minLeverage; + return this; + } + + /** + * Minimum adjustable leverage ratio + * @return minLeverage + **/ + @javax.annotation.Nullable + public String getMinLeverage() { + return minLeverage; + } + + + public void setMinLeverage(String minLeverage) { + this.minLeverage = minLeverage; + } + + public UnifiedLeverageConfig maxLeverage(String maxLeverage) { + + this.maxLeverage = maxLeverage; + return this; + } + + /** + * Maximum adjustable leverage ratio + * @return maxLeverage + **/ + @javax.annotation.Nullable + public String getMaxLeverage() { + return maxLeverage; + } + + + public void setMaxLeverage(String maxLeverage) { + this.maxLeverage = maxLeverage; + } + + public UnifiedLeverageConfig debit(String debit) { + + this.debit = debit; + return this; + } + + /** + * Current liabilities + * @return debit + **/ + @javax.annotation.Nullable + public String getDebit() { + return debit; + } + + + public void setDebit(String debit) { + this.debit = debit; + } + + public UnifiedLeverageConfig availableMargin(String availableMargin) { + + this.availableMargin = availableMargin; + return this; + } + + /** + * Available Margin + * @return availableMargin + **/ + @javax.annotation.Nullable + public String getAvailableMargin() { + return availableMargin; + } + + + public void setAvailableMargin(String availableMargin) { + this.availableMargin = availableMargin; + } + + public UnifiedLeverageConfig borrowable(String borrowable) { + + this.borrowable = borrowable; + return this; + } + + /** + * Maximum borrowable amount at current leverage + * @return borrowable + **/ + @javax.annotation.Nullable + public String getBorrowable() { + return borrowable; + } + + + public void setBorrowable(String borrowable) { + this.borrowable = borrowable; + } + + public UnifiedLeverageConfig exceptLeverageBorrowable(String exceptLeverageBorrowable) { + + this.exceptLeverageBorrowable = exceptLeverageBorrowable; + return this; + } + + /** + * Maximum borrowable from margin and maximum borrowable from Earn, whichever is smaller + * @return exceptLeverageBorrowable + **/ + @javax.annotation.Nullable + public String getExceptLeverageBorrowable() { + return exceptLeverageBorrowable; + } + + + public void setExceptLeverageBorrowable(String exceptLeverageBorrowable) { + this.exceptLeverageBorrowable = exceptLeverageBorrowable; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedLeverageConfig unifiedLeverageConfig = (UnifiedLeverageConfig) o; + return Objects.equals(this.currentLeverage, unifiedLeverageConfig.currentLeverage) && + Objects.equals(this.minLeverage, unifiedLeverageConfig.minLeverage) && + Objects.equals(this.maxLeverage, unifiedLeverageConfig.maxLeverage) && + Objects.equals(this.debit, unifiedLeverageConfig.debit) && + Objects.equals(this.availableMargin, unifiedLeverageConfig.availableMargin) && + Objects.equals(this.borrowable, unifiedLeverageConfig.borrowable) && + Objects.equals(this.exceptLeverageBorrowable, unifiedLeverageConfig.exceptLeverageBorrowable); + } + + @Override + public int hashCode() { + return Objects.hash(currentLeverage, minLeverage, maxLeverage, debit, availableMargin, borrowable, exceptLeverageBorrowable); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedLeverageConfig {\n"); + sb.append(" currentLeverage: ").append(toIndentedString(currentLeverage)).append("\n"); + sb.append(" minLeverage: ").append(toIndentedString(minLeverage)).append("\n"); + sb.append(" maxLeverage: ").append(toIndentedString(maxLeverage)).append("\n"); + sb.append(" debit: ").append(toIndentedString(debit)).append("\n"); + sb.append(" availableMargin: ").append(toIndentedString(availableMargin)).append("\n"); + sb.append(" borrowable: ").append(toIndentedString(borrowable)).append("\n"); + sb.append(" exceptLeverageBorrowable: ").append(toIndentedString(exceptLeverageBorrowable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedLeverageSetting.java b/src/main/java/io/gate/gateapi/models/UnifiedLeverageSetting.java new file mode 100644 index 0000000..5b869a9 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedLeverageSetting.java @@ -0,0 +1,113 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Leverage multiplier for borrowing currency + */ +public class UnifiedLeverageSetting { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; + @SerializedName(SERIALIZED_NAME_LEVERAGE) + private String leverage; + + + public UnifiedLeverageSetting currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UnifiedLeverageSetting leverage(String leverage) { + + this.leverage = leverage; + return this; + } + + /** + * Multiplier + * @return leverage + **/ + public String getLeverage() { + return leverage; + } + + + public void setLeverage(String leverage) { + this.leverage = leverage; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedLeverageSetting unifiedLeverageSetting = (UnifiedLeverageSetting) o; + return Objects.equals(this.currency, unifiedLeverageSetting.currency) && + Objects.equals(this.leverage, unifiedLeverageSetting.leverage); + } + + @Override + public int hashCode() { + return Objects.hash(currency, leverage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedLeverageSetting {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" leverage: ").append(toIndentedString(leverage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedLoan.java b/src/main/java/io/gate/gateapi/models/UnifiedLoan.java new file mode 100644 index 0000000..f69f3f0 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedLoan.java @@ -0,0 +1,237 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Borrow or repay + */ +public class UnifiedLoan { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + /** + * Type: `borrow` - borrow, `repay` - repay + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BORROW("borrow"), + + REPAY("repay"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_REPAID_ALL = "repaid_all"; + @SerializedName(SERIALIZED_NAME_REPAID_ALL) + private Boolean repaidAll; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + + public UnifiedLoan currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UnifiedLoan type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type: `borrow` - borrow, `repay` - repay + * @return type + **/ + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + public UnifiedLoan amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Borrow or repayment amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + public UnifiedLoan repaidAll(Boolean repaidAll) { + + this.repaidAll = repaidAll; + return this; + } + + /** + * Full repayment, only used for repayment operations. When set to `true`, overrides `amount` and directly repays the full amount + * @return repaidAll + **/ + @javax.annotation.Nullable + public Boolean getRepaidAll() { + return repaidAll; + } + + + public void setRepaidAll(Boolean repaidAll) { + this.repaidAll = repaidAll; + } + + public UnifiedLoan text(String text) { + + this.text = text; + return this; + } + + /** + * User defined custom ID + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedLoan unifiedLoan = (UnifiedLoan) o; + return Objects.equals(this.currency, unifiedLoan.currency) && + Objects.equals(this.type, unifiedLoan.type) && + Objects.equals(this.amount, unifiedLoan.amount) && + Objects.equals(this.repaidAll, unifiedLoan.repaidAll) && + Objects.equals(this.text, unifiedLoan.text); + } + + @Override + public int hashCode() { + return Objects.hash(currency, type, amount, repaidAll, text); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedLoan {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" repaidAll: ").append(toIndentedString(repaidAll)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedLoanRecord.java b/src/main/java/io/gate/gateapi/models/UnifiedLoanRecord.java new file mode 100644 index 0000000..b759379 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedLoanRecord.java @@ -0,0 +1,201 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Borrowing Records + */ +public class UnifiedLoanRecord { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_REPAYMENT_TYPE = "repayment_type"; + @SerializedName(SERIALIZED_NAME_REPAYMENT_TYPE) + private String repaymentType; + + public static final String SERIALIZED_NAME_BORROW_TYPE = "borrow_type"; + @SerializedName(SERIALIZED_NAME_BORROW_TYPE) + private String borrowType; + + public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; + @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) + private String currencyPair; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_CREATE_TIME = "create_time"; + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + private Long createTime; + + + /** + * ID + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + /** + * Type: `borrow` - borrow, `repay` - repay + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + + /** + * 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 + * @return repaymentType + **/ + @javax.annotation.Nullable + public String getRepaymentType() { + return repaymentType; + } + + + public UnifiedLoanRecord borrowType(String borrowType) { + + this.borrowType = borrowType; + return this; + } + + /** + * Borrowing type, returned when querying loan records: manual_borrow - Manual borrowing, auto_borrow - Automatic borrowing + * @return borrowType + **/ + @javax.annotation.Nullable + public String getBorrowType() { + return borrowType; + } + + + public void setBorrowType(String borrowType) { + this.borrowType = borrowType; + } + + /** + * Currency pair + * @return currencyPair + **/ + @javax.annotation.Nullable + public String getCurrencyPair() { + return currencyPair; + } + + + /** + * Currency + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + /** + * Borrow or repayment amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + /** + * Created time + * @return createTime + **/ + @javax.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedLoanRecord unifiedLoanRecord = (UnifiedLoanRecord) o; + return Objects.equals(this.id, unifiedLoanRecord.id) && + Objects.equals(this.type, unifiedLoanRecord.type) && + Objects.equals(this.repaymentType, unifiedLoanRecord.repaymentType) && + Objects.equals(this.borrowType, unifiedLoanRecord.borrowType) && + Objects.equals(this.currencyPair, unifiedLoanRecord.currencyPair) && + Objects.equals(this.currency, unifiedLoanRecord.currency) && + Objects.equals(this.amount, unifiedLoanRecord.amount) && + Objects.equals(this.createTime, unifiedLoanRecord.createTime); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, repaymentType, borrowType, currencyPair, currency, amount, createTime); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedLoanRecord {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" repaymentType: ").append(toIndentedString(repaymentType)).append("\n"); + sb.append(" borrowType: ").append(toIndentedString(borrowType)).append("\n"); + sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedLoanResult.java b/src/main/java/io/gate/gateapi/models/UnifiedLoanResult.java new file mode 100644 index 0000000..bd4269c --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedLoanResult.java @@ -0,0 +1,89 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * Unified account borrowing and repayment response result + */ +public class UnifiedLoanResult { + public static final String SERIALIZED_NAME_TRAN_ID = "tran_id"; + @SerializedName(SERIALIZED_NAME_TRAN_ID) + private Long tranId; + + + public UnifiedLoanResult tranId(Long tranId) { + + this.tranId = tranId; + return this; + } + + /** + * Transaction ID + * @return tranId + **/ + @javax.annotation.Nullable + public Long getTranId() { + return tranId; + } + + + public void setTranId(Long tranId) { + this.tranId = tranId; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedLoanResult unifiedLoanResult = (UnifiedLoanResult) o; + return Objects.equals(this.tranId, unifiedLoanResult.tranId); + } + + @Override + public int hashCode() { + return Objects.hash(tranId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedLoanResult {\n"); + sb.append(" tranId: ").append(toIndentedString(tranId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedMarginTiers.java b/src/main/java/io/gate/gateapi/models/UnifiedMarginTiers.java new file mode 100644 index 0000000..1eac0ac --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedMarginTiers.java @@ -0,0 +1,126 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MarginTiers; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Unified account borrowing margin tiers + */ +public class UnifiedMarginTiers { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_MARGIN_TIERS = "margin_tiers"; + @SerializedName(SERIALIZED_NAME_MARGIN_TIERS) + private List marginTiers = null; + + + public UnifiedMarginTiers currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UnifiedMarginTiers marginTiers(List marginTiers) { + + this.marginTiers = marginTiers; + return this; + } + + public UnifiedMarginTiers addMarginTiersItem(MarginTiers marginTiersItem) { + if (this.marginTiers == null) { + this.marginTiers = new ArrayList<>(); + } + this.marginTiers.add(marginTiersItem); + return this; + } + + /** + * Tiered margin + * @return marginTiers + **/ + @javax.annotation.Nullable + public List getMarginTiers() { + return marginTiers; + } + + + public void setMarginTiers(List marginTiers) { + this.marginTiers = marginTiers; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedMarginTiers unifiedMarginTiers = (UnifiedMarginTiers) o; + return Objects.equals(this.currency, unifiedMarginTiers.currency) && + Objects.equals(this.marginTiers, unifiedMarginTiers.marginTiers); + } + + @Override + public int hashCode() { + return Objects.hash(currency, marginTiers); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedMarginTiers {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" marginTiers: ").append(toIndentedString(marginTiers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedModeSet.java b/src/main/java/io/gate/gateapi/models/UnifiedModeSet.java new file mode 100644 index 0000000..855fc5f --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedModeSet.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.UnifiedSettings; +import java.io.IOException; + +/** + * UnifiedModeSet + */ +public class UnifiedModeSet { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private UnifiedSettings settings; + + + public UnifiedModeSet mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode + * @return mode + **/ + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + + public UnifiedModeSet settings(UnifiedSettings settings) { + + this.settings = settings; + return this; + } + + /** + * Get settings + * @return settings + **/ + @javax.annotation.Nullable + public UnifiedSettings getSettings() { + return settings; + } + + + public void setSettings(UnifiedSettings settings) { + this.settings = settings; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedModeSet unifiedModeSet = (UnifiedModeSet) o; + return Objects.equals(this.mode, unifiedModeSet.mode) && + Objects.equals(this.settings, unifiedModeSet.settings); + } + + @Override + public int hashCode() { + return Objects.hash(mode, settings); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedModeSet {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedPortfolioInput.java b/src/main/java/io/gate/gateapi/models/UnifiedPortfolioInput.java new file mode 100644 index 0000000..841e7bf --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedPortfolioInput.java @@ -0,0 +1,301 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MockFuturesOrder; +import io.gate.gateapi.models.MockFuturesPosition; +import io.gate.gateapi.models.MockOptionsOrder; +import io.gate.gateapi.models.MockOptionsPosition; +import io.gate.gateapi.models.MockSpotBalance; +import io.gate.gateapi.models.MockSpotOrder; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Portfolio margin calculator input + */ +public class UnifiedPortfolioInput { + public static final String SERIALIZED_NAME_SPOT_BALANCES = "spot_balances"; + @SerializedName(SERIALIZED_NAME_SPOT_BALANCES) + private List spotBalances = null; + + public static final String SERIALIZED_NAME_SPOT_ORDERS = "spot_orders"; + @SerializedName(SERIALIZED_NAME_SPOT_ORDERS) + private List spotOrders = null; + + public static final String SERIALIZED_NAME_FUTURES_POSITIONS = "futures_positions"; + @SerializedName(SERIALIZED_NAME_FUTURES_POSITIONS) + private List futuresPositions = null; + + public static final String SERIALIZED_NAME_FUTURES_ORDERS = "futures_orders"; + @SerializedName(SERIALIZED_NAME_FUTURES_ORDERS) + private List futuresOrders = null; + + public static final String SERIALIZED_NAME_OPTIONS_POSITIONS = "options_positions"; + @SerializedName(SERIALIZED_NAME_OPTIONS_POSITIONS) + private List optionsPositions = null; + + public static final String SERIALIZED_NAME_OPTIONS_ORDERS = "options_orders"; + @SerializedName(SERIALIZED_NAME_OPTIONS_ORDERS) + private List optionsOrders = null; + + public static final String SERIALIZED_NAME_SPOT_HEDGE = "spot_hedge"; + @SerializedName(SERIALIZED_NAME_SPOT_HEDGE) + private Boolean spotHedge; + + + public UnifiedPortfolioInput spotBalances(List spotBalances) { + + this.spotBalances = spotBalances; + return this; + } + + public UnifiedPortfolioInput addSpotBalancesItem(MockSpotBalance spotBalancesItem) { + if (this.spotBalances == null) { + this.spotBalances = new ArrayList<>(); + } + this.spotBalances.add(spotBalancesItem); + return this; + } + + /** + * Spot + * @return spotBalances + **/ + @javax.annotation.Nullable + public List getSpotBalances() { + return spotBalances; + } + + + public void setSpotBalances(List spotBalances) { + this.spotBalances = spotBalances; + } + + public UnifiedPortfolioInput spotOrders(List spotOrders) { + + this.spotOrders = spotOrders; + return this; + } + + public UnifiedPortfolioInput addSpotOrdersItem(MockSpotOrder spotOrdersItem) { + if (this.spotOrders == null) { + this.spotOrders = new ArrayList<>(); + } + this.spotOrders.add(spotOrdersItem); + return this; + } + + /** + * Spot orders + * @return spotOrders + **/ + @javax.annotation.Nullable + public List getSpotOrders() { + return spotOrders; + } + + + public void setSpotOrders(List spotOrders) { + this.spotOrders = spotOrders; + } + + public UnifiedPortfolioInput futuresPositions(List futuresPositions) { + + this.futuresPositions = futuresPositions; + return this; + } + + public UnifiedPortfolioInput addFuturesPositionsItem(MockFuturesPosition futuresPositionsItem) { + if (this.futuresPositions == null) { + this.futuresPositions = new ArrayList<>(); + } + this.futuresPositions.add(futuresPositionsItem); + return this; + } + + /** + * Futures positions + * @return futuresPositions + **/ + @javax.annotation.Nullable + public List getFuturesPositions() { + return futuresPositions; + } + + + public void setFuturesPositions(List futuresPositions) { + this.futuresPositions = futuresPositions; + } + + public UnifiedPortfolioInput futuresOrders(List futuresOrders) { + + this.futuresOrders = futuresOrders; + return this; + } + + public UnifiedPortfolioInput addFuturesOrdersItem(MockFuturesOrder futuresOrdersItem) { + if (this.futuresOrders == null) { + this.futuresOrders = new ArrayList<>(); + } + this.futuresOrders.add(futuresOrdersItem); + return this; + } + + /** + * Futures order + * @return futuresOrders + **/ + @javax.annotation.Nullable + public List getFuturesOrders() { + return futuresOrders; + } + + + public void setFuturesOrders(List futuresOrders) { + this.futuresOrders = futuresOrders; + } + + public UnifiedPortfolioInput optionsPositions(List optionsPositions) { + + this.optionsPositions = optionsPositions; + return this; + } + + public UnifiedPortfolioInput addOptionsPositionsItem(MockOptionsPosition optionsPositionsItem) { + if (this.optionsPositions == null) { + this.optionsPositions = new ArrayList<>(); + } + this.optionsPositions.add(optionsPositionsItem); + return this; + } + + /** + * Options positions + * @return optionsPositions + **/ + @javax.annotation.Nullable + public List getOptionsPositions() { + return optionsPositions; + } + + + public void setOptionsPositions(List optionsPositions) { + this.optionsPositions = optionsPositions; + } + + public UnifiedPortfolioInput optionsOrders(List optionsOrders) { + + this.optionsOrders = optionsOrders; + return this; + } + + public UnifiedPortfolioInput addOptionsOrdersItem(MockOptionsOrder optionsOrdersItem) { + if (this.optionsOrders == null) { + this.optionsOrders = new ArrayList<>(); + } + this.optionsOrders.add(optionsOrdersItem); + return this; + } + + /** + * Option orders + * @return optionsOrders + **/ + @javax.annotation.Nullable + public List getOptionsOrders() { + return optionsOrders; + } + + + public void setOptionsOrders(List optionsOrders) { + this.optionsOrders = optionsOrders; + } + + public UnifiedPortfolioInput spotHedge(Boolean spotHedge) { + + this.spotHedge = spotHedge; + return this; + } + + /** + * Whether to enable spot hedging + * @return spotHedge + **/ + @javax.annotation.Nullable + public Boolean getSpotHedge() { + return spotHedge; + } + + + public void setSpotHedge(Boolean spotHedge) { + this.spotHedge = spotHedge; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedPortfolioInput unifiedPortfolioInput = (UnifiedPortfolioInput) o; + return Objects.equals(this.spotBalances, unifiedPortfolioInput.spotBalances) && + Objects.equals(this.spotOrders, unifiedPortfolioInput.spotOrders) && + Objects.equals(this.futuresPositions, unifiedPortfolioInput.futuresPositions) && + Objects.equals(this.futuresOrders, unifiedPortfolioInput.futuresOrders) && + Objects.equals(this.optionsPositions, unifiedPortfolioInput.optionsPositions) && + Objects.equals(this.optionsOrders, unifiedPortfolioInput.optionsOrders) && + Objects.equals(this.spotHedge, unifiedPortfolioInput.spotHedge); + } + + @Override + public int hashCode() { + return Objects.hash(spotBalances, spotOrders, futuresPositions, futuresOrders, optionsPositions, optionsOrders, spotHedge); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedPortfolioInput {\n"); + sb.append(" spotBalances: ").append(toIndentedString(spotBalances)).append("\n"); + sb.append(" spotOrders: ").append(toIndentedString(spotOrders)).append("\n"); + sb.append(" futuresPositions: ").append(toIndentedString(futuresPositions)).append("\n"); + sb.append(" futuresOrders: ").append(toIndentedString(futuresOrders)).append("\n"); + sb.append(" optionsPositions: ").append(toIndentedString(optionsPositions)).append("\n"); + sb.append(" optionsOrders: ").append(toIndentedString(optionsOrders)).append("\n"); + sb.append(" spotHedge: ").append(toIndentedString(spotHedge)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedPortfolioOutput.java b/src/main/java/io/gate/gateapi/models/UnifiedPortfolioOutput.java new file mode 100644 index 0000000..7a9b9c1 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedPortfolioOutput.java @@ -0,0 +1,178 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.MockRiskUnit; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Portfolio margin calculator output + */ +public class UnifiedPortfolioOutput { + public static final String SERIALIZED_NAME_MAINTAIN_MARGIN_TOTAL = "maintain_margin_total"; + @SerializedName(SERIALIZED_NAME_MAINTAIN_MARGIN_TOTAL) + private String maintainMarginTotal; + + public static final String SERIALIZED_NAME_INITIAL_MARGIN_TOTAL = "initial_margin_total"; + @SerializedName(SERIALIZED_NAME_INITIAL_MARGIN_TOTAL) + private String initialMarginTotal; + + public static final String SERIALIZED_NAME_CALCULATE_TIME = "calculate_time"; + @SerializedName(SERIALIZED_NAME_CALCULATE_TIME) + private Long calculateTime; + + public static final String SERIALIZED_NAME_RISK_UNIT = "risk_unit"; + @SerializedName(SERIALIZED_NAME_RISK_UNIT) + private List riskUnit = null; + + + public UnifiedPortfolioOutput maintainMarginTotal(String maintainMarginTotal) { + + this.maintainMarginTotal = maintainMarginTotal; + return this; + } + + /** + * 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 + * @return maintainMarginTotal + **/ + @javax.annotation.Nullable + public String getMaintainMarginTotal() { + return maintainMarginTotal; + } + + + public void setMaintainMarginTotal(String maintainMarginTotal) { + this.maintainMarginTotal = maintainMarginTotal; + } + + public UnifiedPortfolioOutput initialMarginTotal(String initialMarginTotal) { + + this.initialMarginTotal = initialMarginTotal; + return this; + } + + /** + * Total initial margin, calculated as the maximum of the following three combinations: position, position + positive delta orders, position + negative delta orders + * @return initialMarginTotal + **/ + @javax.annotation.Nullable + public String getInitialMarginTotal() { + return initialMarginTotal; + } + + + public void setInitialMarginTotal(String initialMarginTotal) { + this.initialMarginTotal = initialMarginTotal; + } + + public UnifiedPortfolioOutput calculateTime(Long calculateTime) { + + this.calculateTime = calculateTime; + return this; + } + + /** + * Calculation time + * @return calculateTime + **/ + @javax.annotation.Nullable + public Long getCalculateTime() { + return calculateTime; + } + + + public void setCalculateTime(Long calculateTime) { + this.calculateTime = calculateTime; + } + + public UnifiedPortfolioOutput riskUnit(List riskUnit) { + + this.riskUnit = riskUnit; + return this; + } + + public UnifiedPortfolioOutput addRiskUnitItem(MockRiskUnit riskUnitItem) { + if (this.riskUnit == null) { + this.riskUnit = new ArrayList<>(); + } + this.riskUnit.add(riskUnitItem); + return this; + } + + /** + * Risk unit + * @return riskUnit + **/ + @javax.annotation.Nullable + public List getRiskUnit() { + return riskUnit; + } + + + public void setRiskUnit(List riskUnit) { + this.riskUnit = riskUnit; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedPortfolioOutput unifiedPortfolioOutput = (UnifiedPortfolioOutput) o; + return Objects.equals(this.maintainMarginTotal, unifiedPortfolioOutput.maintainMarginTotal) && + Objects.equals(this.initialMarginTotal, unifiedPortfolioOutput.initialMarginTotal) && + Objects.equals(this.calculateTime, unifiedPortfolioOutput.calculateTime) && + Objects.equals(this.riskUnit, unifiedPortfolioOutput.riskUnit); + } + + @Override + public int hashCode() { + return Objects.hash(maintainMarginTotal, initialMarginTotal, calculateTime, riskUnit); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedPortfolioOutput {\n"); + sb.append(" maintainMarginTotal: ").append(toIndentedString(maintainMarginTotal)).append("\n"); + sb.append(" initialMarginTotal: ").append(toIndentedString(initialMarginTotal)).append("\n"); + sb.append(" calculateTime: ").append(toIndentedString(calculateTime)).append("\n"); + sb.append(" riskUnit: ").append(toIndentedString(riskUnit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedRiskUnits.java b/src/main/java/io/gate/gateapi/models/UnifiedRiskUnits.java new file mode 100644 index 0000000..d47e0b4 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedRiskUnits.java @@ -0,0 +1,152 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.RiskUnits; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * UnifiedRiskUnits + */ +public class UnifiedRiskUnits { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private Long userId; + + public static final String SERIALIZED_NAME_SPOT_HEDGE = "spot_hedge"; + @SerializedName(SERIALIZED_NAME_SPOT_HEDGE) + private Boolean spotHedge; + + public static final String SERIALIZED_NAME_RISK_UNITS = "risk_units"; + @SerializedName(SERIALIZED_NAME_RISK_UNITS) + private List riskUnits = null; + + + public UnifiedRiskUnits userId(Long userId) { + + this.userId = userId; + return this; + } + + /** + * User ID + * @return userId + **/ + @javax.annotation.Nullable + public Long getUserId() { + return userId; + } + + + public void setUserId(Long userId) { + this.userId = userId; + } + + public UnifiedRiskUnits spotHedge(Boolean spotHedge) { + + this.spotHedge = spotHedge; + return this; + } + + /** + * Spot hedging status: true - enabled, false - disabled + * @return spotHedge + **/ + @javax.annotation.Nullable + public Boolean getSpotHedge() { + return spotHedge; + } + + + public void setSpotHedge(Boolean spotHedge) { + this.spotHedge = spotHedge; + } + + public UnifiedRiskUnits riskUnits(List riskUnits) { + + this.riskUnits = riskUnits; + return this; + } + + public UnifiedRiskUnits addRiskUnitsItem(RiskUnits riskUnitsItem) { + if (this.riskUnits == null) { + this.riskUnits = new ArrayList<>(); + } + this.riskUnits.add(riskUnitsItem); + return this; + } + + /** + * Risk unit + * @return riskUnits + **/ + @javax.annotation.Nullable + public List getRiskUnits() { + return riskUnits; + } + + + public void setRiskUnits(List riskUnits) { + this.riskUnits = riskUnits; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedRiskUnits unifiedRiskUnits = (UnifiedRiskUnits) o; + return Objects.equals(this.userId, unifiedRiskUnits.userId) && + Objects.equals(this.spotHedge, unifiedRiskUnits.spotHedge) && + Objects.equals(this.riskUnits, unifiedRiskUnits.riskUnits); + } + + @Override + public int hashCode() { + return Objects.hash(userId, spotHedge, riskUnits); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedRiskUnits {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" spotHedge: ").append(toIndentedString(spotHedge)).append("\n"); + sb.append(" riskUnits: ").append(toIndentedString(riskUnits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedSettings.java b/src/main/java/io/gate/gateapi/models/UnifiedSettings.java new file mode 100644 index 0000000..3ba73ea --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedSettings.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UnifiedSettings + */ +public class UnifiedSettings { + public static final String SERIALIZED_NAME_USDT_FUTURES = "usdt_futures"; + @SerializedName(SERIALIZED_NAME_USDT_FUTURES) + private Boolean usdtFutures; + + public static final String SERIALIZED_NAME_SPOT_HEDGE = "spot_hedge"; + @SerializedName(SERIALIZED_NAME_SPOT_HEDGE) + private Boolean spotHedge; + + public static final String SERIALIZED_NAME_USE_FUNDING = "use_funding"; + @SerializedName(SERIALIZED_NAME_USE_FUNDING) + private Boolean useFunding; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + @SerializedName(SERIALIZED_NAME_OPTIONS) + private Boolean options; + + + public UnifiedSettings usdtFutures(Boolean usdtFutures) { + + this.usdtFutures = usdtFutures; + return this; + } + + /** + * USDT futures switch. In cross-currency margin mode, can only be enabled and cannot be disabled + * @return usdtFutures + **/ + @javax.annotation.Nullable + public Boolean getUsdtFutures() { + return usdtFutures; + } + + + public void setUsdtFutures(Boolean usdtFutures) { + this.usdtFutures = usdtFutures; + } + + public UnifiedSettings spotHedge(Boolean spotHedge) { + + this.spotHedge = spotHedge; + return this; + } + + /** + * Spot hedging switch + * @return spotHedge + **/ + @javax.annotation.Nullable + public Boolean getSpotHedge() { + return spotHedge; + } + + + public void setSpotHedge(Boolean spotHedge) { + this.spotHedge = spotHedge; + } + + public UnifiedSettings useFunding(Boolean useFunding) { + + this.useFunding = useFunding; + return this; + } + + /** + * Earn switch, when mode is cross-currency margin mode, whether to use Earn funds as margin + * @return useFunding + **/ + @javax.annotation.Nullable + public Boolean getUseFunding() { + return useFunding; + } + + + public void setUseFunding(Boolean useFunding) { + this.useFunding = useFunding; + } + + public UnifiedSettings options(Boolean options) { + + this.options = options; + return this; + } + + /** + * Options switch. In cross-currency margin mode, can only be enabled and cannot be disabled + * @return options + **/ + @javax.annotation.Nullable + public Boolean getOptions() { + return options; + } + + + public void setOptions(Boolean options) { + this.options = options; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedSettings unifiedSettings = (UnifiedSettings) o; + return Objects.equals(this.usdtFutures, unifiedSettings.usdtFutures) && + Objects.equals(this.spotHedge, unifiedSettings.spotHedge) && + Objects.equals(this.useFunding, unifiedSettings.useFunding) && + Objects.equals(this.options, unifiedSettings.options); + } + + @Override + public int hashCode() { + return Objects.hash(usdtFutures, spotHedge, useFunding, options); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedSettings {\n"); + sb.append(" usdtFutures: ").append(toIndentedString(usdtFutures)).append("\n"); + sb.append(" spotHedge: ").append(toIndentedString(spotHedge)).append("\n"); + sb.append(" useFunding: ").append(toIndentedString(useFunding)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UnifiedTransferable.java b/src/main/java/io/gate/gateapi/models/UnifiedTransferable.java new file mode 100644 index 0000000..6fd5153 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UnifiedTransferable.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UnifiedTransferable + */ +public class UnifiedTransferable { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + + public UnifiedTransferable currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency detail + * @return currency + **/ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public UnifiedTransferable amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Maximum transferable amount + * @return amount + **/ + @javax.annotation.Nullable + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnifiedTransferable unifiedTransferable = (UnifiedTransferable) o; + return Objects.equals(this.currency, unifiedTransferable.currency) && + Objects.equals(this.amount, unifiedTransferable.amount); + } + + @Override + public int hashCode() { + return Objects.hash(currency, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnifiedTransferable {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UserLtvInfo.java b/src/main/java/io/gate/gateapi/models/UserLtvInfo.java new file mode 100644 index 0000000..496d13f --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UserLtvInfo.java @@ -0,0 +1,245 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * User's currency statistics data + */ +public class UserLtvInfo { + public static final String SERIALIZED_NAME_COLLATERAL_CURRENCY = "collateral_currency"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_CURRENCY) + private String collateralCurrency; + + public static final String SERIALIZED_NAME_BORROW_CURRENCY = "borrow_currency"; + @SerializedName(SERIALIZED_NAME_BORROW_CURRENCY) + private String borrowCurrency; + + public static final String SERIALIZED_NAME_INIT_LTV = "init_ltv"; + @SerializedName(SERIALIZED_NAME_INIT_LTV) + private String initLtv; + + public static final String SERIALIZED_NAME_ALERT_LTV = "alert_ltv"; + @SerializedName(SERIALIZED_NAME_ALERT_LTV) + private String alertLtv; + + public static final String SERIALIZED_NAME_LIQUIDATE_LTV = "liquidate_ltv"; + @SerializedName(SERIALIZED_NAME_LIQUIDATE_LTV) + private String liquidateLtv; + + public static final String SERIALIZED_NAME_MIN_BORROW_AMOUNT = "min_borrow_amount"; + @SerializedName(SERIALIZED_NAME_MIN_BORROW_AMOUNT) + private String minBorrowAmount; + + public static final String SERIALIZED_NAME_LEFT_BORROWABLE_AMOUNT = "left_borrowable_amount"; + @SerializedName(SERIALIZED_NAME_LEFT_BORROWABLE_AMOUNT) + private String leftBorrowableAmount; + + + public UserLtvInfo collateralCurrency(String collateralCurrency) { + + this.collateralCurrency = collateralCurrency; + return this; + } + + /** + * Collateral currency + * @return collateralCurrency + **/ + @javax.annotation.Nullable + public String getCollateralCurrency() { + return collateralCurrency; + } + + + public void setCollateralCurrency(String collateralCurrency) { + this.collateralCurrency = collateralCurrency; + } + + public UserLtvInfo borrowCurrency(String borrowCurrency) { + + this.borrowCurrency = borrowCurrency; + return this; + } + + /** + * Borrowed currency + * @return borrowCurrency + **/ + @javax.annotation.Nullable + public String getBorrowCurrency() { + return borrowCurrency; + } + + + public void setBorrowCurrency(String borrowCurrency) { + this.borrowCurrency = borrowCurrency; + } + + public UserLtvInfo initLtv(String initLtv) { + + this.initLtv = initLtv; + return this; + } + + /** + * Initial collateralization rate + * @return initLtv + **/ + @javax.annotation.Nullable + public String getInitLtv() { + return initLtv; + } + + + public void setInitLtv(String initLtv) { + this.initLtv = initLtv; + } + + public UserLtvInfo alertLtv(String alertLtv) { + + this.alertLtv = alertLtv; + return this; + } + + /** + * Warning collateralization rate + * @return alertLtv + **/ + @javax.annotation.Nullable + public String getAlertLtv() { + return alertLtv; + } + + + public void setAlertLtv(String alertLtv) { + this.alertLtv = alertLtv; + } + + public UserLtvInfo liquidateLtv(String liquidateLtv) { + + this.liquidateLtv = liquidateLtv; + return this; + } + + /** + * Liquidation collateralization rate + * @return liquidateLtv + **/ + @javax.annotation.Nullable + public String getLiquidateLtv() { + return liquidateLtv; + } + + + public void setLiquidateLtv(String liquidateLtv) { + this.liquidateLtv = liquidateLtv; + } + + public UserLtvInfo minBorrowAmount(String minBorrowAmount) { + + this.minBorrowAmount = minBorrowAmount; + return this; + } + + /** + * Minimum borrowable amount for the loan currency + * @return minBorrowAmount + **/ + @javax.annotation.Nullable + public String getMinBorrowAmount() { + return minBorrowAmount; + } + + + public void setMinBorrowAmount(String minBorrowAmount) { + this.minBorrowAmount = minBorrowAmount; + } + + public UserLtvInfo leftBorrowableAmount(String leftBorrowableAmount) { + + this.leftBorrowableAmount = leftBorrowableAmount; + return this; + } + + /** + * Remaining borrowable amount for the loan currency + * @return leftBorrowableAmount + **/ + @javax.annotation.Nullable + public String getLeftBorrowableAmount() { + return leftBorrowableAmount; + } + + + public void setLeftBorrowableAmount(String leftBorrowableAmount) { + this.leftBorrowableAmount = leftBorrowableAmount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserLtvInfo userLtvInfo = (UserLtvInfo) o; + return Objects.equals(this.collateralCurrency, userLtvInfo.collateralCurrency) && + Objects.equals(this.borrowCurrency, userLtvInfo.borrowCurrency) && + Objects.equals(this.initLtv, userLtvInfo.initLtv) && + Objects.equals(this.alertLtv, userLtvInfo.alertLtv) && + Objects.equals(this.liquidateLtv, userLtvInfo.liquidateLtv) && + Objects.equals(this.minBorrowAmount, userLtvInfo.minBorrowAmount) && + Objects.equals(this.leftBorrowableAmount, userLtvInfo.leftBorrowableAmount); + } + + @Override + public int hashCode() { + return Objects.hash(collateralCurrency, borrowCurrency, initLtv, alertLtv, liquidateLtv, minBorrowAmount, leftBorrowableAmount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserLtvInfo {\n"); + sb.append(" collateralCurrency: ").append(toIndentedString(collateralCurrency)).append("\n"); + sb.append(" borrowCurrency: ").append(toIndentedString(borrowCurrency)).append("\n"); + sb.append(" initLtv: ").append(toIndentedString(initLtv)).append("\n"); + sb.append(" alertLtv: ").append(toIndentedString(alertLtv)).append("\n"); + sb.append(" liquidateLtv: ").append(toIndentedString(liquidateLtv)).append("\n"); + sb.append(" minBorrowAmount: ").append(toIndentedString(minBorrowAmount)).append("\n"); + sb.append(" leftBorrowableAmount: ").append(toIndentedString(leftBorrowableAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UserSub.java b/src/main/java/io/gate/gateapi/models/UserSub.java new file mode 100644 index 0000000..a276564 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UserSub.java @@ -0,0 +1,167 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * UserSub + */ +public class UserSub { + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private Long uid; + + public static final String SERIALIZED_NAME_BELONG = "belong"; + @SerializedName(SERIALIZED_NAME_BELONG) + private String belong; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Long type; + + public static final String SERIALIZED_NAME_REF_UID = "ref_uid"; + @SerializedName(SERIALIZED_NAME_REF_UID) + private Long refUid; + + + public UserSub uid(Long uid) { + + this.uid = uid; + return this; + } + + /** + * User ID + * @return uid + **/ + @javax.annotation.Nullable + public Long getUid() { + return uid; + } + + + public void setUid(Long uid) { + this.uid = uid; + } + + public UserSub belong(String belong) { + + this.belong = belong; + return this; + } + + /** + * User's system affiliation (partner/referral). Empty means not belonging to any system + * @return belong + **/ + @javax.annotation.Nullable + public String getBelong() { + return belong; + } + + + public void setBelong(String belong) { + this.belong = belong; + } + + public UserSub type(Long type) { + + this.type = type; + return this; + } + + /** + * Type (0-Not in system 1-Direct subordinate agent 2-Indirect subordinate agent 3-Direct direct customer 4-Indirect direct customer 5-Regular user) + * @return type + **/ + @javax.annotation.Nullable + public Long getType() { + return type; + } + + + public void setType(Long type) { + this.type = type; + } + + public UserSub refUid(Long refUid) { + + this.refUid = refUid; + return this; + } + + /** + * Inviter user ID + * @return refUid + **/ + @javax.annotation.Nullable + public Long getRefUid() { + return refUid; + } + + + public void setRefUid(Long refUid) { + this.refUid = refUid; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSub userSub = (UserSub) o; + return Objects.equals(this.uid, userSub.uid) && + Objects.equals(this.belong, userSub.belong) && + Objects.equals(this.type, userSub.type) && + Objects.equals(this.refUid, userSub.refUid); + } + + @Override + public int hashCode() { + return Objects.hash(uid, belong, type, refUid); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserSub {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" belong: ").append(toIndentedString(belong)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" refUid: ").append(toIndentedString(refUid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UserSubRelation.java b/src/main/java/io/gate/gateapi/models/UserSubRelation.java new file mode 100644 index 0000000..c76a733 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UserSubRelation.java @@ -0,0 +1,100 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gate.gateapi.models.UserSub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * UserSubRelation + */ +public class UserSubRelation { + public static final String SERIALIZED_NAME_LIST = "list"; + @SerializedName(SERIALIZED_NAME_LIST) + private List list = null; + + + public UserSubRelation list(List list) { + + this.list = list; + return this; + } + + public UserSubRelation addListItem(UserSub listItem) { + if (this.list == null) { + this.list = new ArrayList<>(); + } + this.list.add(listItem); + return this; + } + + /** + * Subordinate relationship list + * @return list + **/ + @javax.annotation.Nullable + public List getList() { + return list; + } + + + public void setList(List list) { + this.list = list; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSubRelation userSubRelation = (UserSubRelation) o; + return Objects.equals(this.list, userSubRelation.list); + } + + @Override + public int hashCode() { + return Objects.hash(list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserSubRelation {\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/UserTotalAmount.java b/src/main/java/io/gate/gateapi/models/UserTotalAmount.java new file mode 100644 index 0000000..b416530 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/UserTotalAmount.java @@ -0,0 +1,115 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * User's total borrowing and collateral amount + */ +public class UserTotalAmount { + public static final String SERIALIZED_NAME_BORROW_AMOUNT = "borrow_amount"; + @SerializedName(SERIALIZED_NAME_BORROW_AMOUNT) + private String borrowAmount; + + public static final String SERIALIZED_NAME_COLLATERAL_AMOUNT = "collateral_amount"; + @SerializedName(SERIALIZED_NAME_COLLATERAL_AMOUNT) + private String collateralAmount; + + + public UserTotalAmount borrowAmount(String borrowAmount) { + + this.borrowAmount = borrowAmount; + return this; + } + + /** + * Total borrowing amount in USDT + * @return borrowAmount + **/ + @javax.annotation.Nullable + public String getBorrowAmount() { + return borrowAmount; + } + + + public void setBorrowAmount(String borrowAmount) { + this.borrowAmount = borrowAmount; + } + + public UserTotalAmount collateralAmount(String collateralAmount) { + + this.collateralAmount = collateralAmount; + return this; + } + + /** + * Total collateral amount in USDT + * @return collateralAmount + **/ + @javax.annotation.Nullable + public String getCollateralAmount() { + return collateralAmount; + } + + + public void setCollateralAmount(String collateralAmount) { + this.collateralAmount = collateralAmount; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTotalAmount userTotalAmount = (UserTotalAmount) o; + return Objects.equals(this.borrowAmount, userTotalAmount.borrowAmount) && + Objects.equals(this.collateralAmount, userTotalAmount.collateralAmount); + } + + @Override + public int hashCode() { + return Objects.hash(borrowAmount, collateralAmount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTotalAmount {\n"); + sb.append(" borrowAmount: ").append(toIndentedString(borrowAmount)).append("\n"); + sb.append(" collateralAmount: ").append(toIndentedString(collateralAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/io/gate/gateapi/models/WithdrawStatus.java b/src/main/java/io/gate/gateapi/models/WithdrawStatus.java index 023bccd..da92b8d 100644 --- a/src/main/java/io/gate/gateapi/models/WithdrawStatus.java +++ b/src/main/java/io/gate/gateapi/models/WithdrawStatus.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 @@ -70,6 +70,10 @@ public class WithdrawStatus { @SerializedName(SERIALIZED_NAME_WITHDRAW_FIX_ON_CHAINS) private Map withdrawFixOnChains = null; + public static final String SERIALIZED_NAME_WITHDRAW_PERCENT_ON_CHAINS = "withdraw_percent_on_chains"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_PERCENT_ON_CHAINS) + private Map withdrawPercentOnChains = null; + public WithdrawStatus currency(String currency) { @@ -138,7 +142,7 @@ public WithdrawStatus deposit(String deposit) { } /** - * Deposits fee + * Deposit fee * @return deposit **/ @javax.annotation.Nullable @@ -298,6 +302,34 @@ public Map getWithdrawFixOnChains() { public void setWithdrawFixOnChains(Map withdrawFixOnChains) { this.withdrawFixOnChains = withdrawFixOnChains; } + + public WithdrawStatus withdrawPercentOnChains(Map withdrawPercentOnChains) { + + this.withdrawPercentOnChains = withdrawPercentOnChains; + return this; + } + + public WithdrawStatus putWithdrawPercentOnChainsItem(String key, String withdrawPercentOnChainsItem) { + if (this.withdrawPercentOnChains == null) { + this.withdrawPercentOnChains = new HashMap<>(); + } + this.withdrawPercentOnChains.put(key, withdrawPercentOnChainsItem); + return this; + } + + /** + * Percentage withdrawal fee on multiple chains + * @return withdrawPercentOnChains + **/ + @javax.annotation.Nullable + public Map getWithdrawPercentOnChains() { + return withdrawPercentOnChains; + } + + + public void setWithdrawPercentOnChains(Map withdrawPercentOnChains) { + this.withdrawPercentOnChains = withdrawPercentOnChains; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -317,12 +349,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.withdrawAmountMini, withdrawStatus.withdrawAmountMini) && Objects.equals(this.withdrawDayLimitRemain, withdrawStatus.withdrawDayLimitRemain) && Objects.equals(this.withdrawEachtimeLimit, withdrawStatus.withdrawEachtimeLimit) && - Objects.equals(this.withdrawFixOnChains, withdrawStatus.withdrawFixOnChains); + Objects.equals(this.withdrawFixOnChains, withdrawStatus.withdrawFixOnChains) && + Objects.equals(this.withdrawPercentOnChains, withdrawStatus.withdrawPercentOnChains); } @Override public int hashCode() { - return Objects.hash(currency, name, nameCn, deposit, withdrawPercent, withdrawFix, withdrawDayLimit, withdrawAmountMini, withdrawDayLimitRemain, withdrawEachtimeLimit, withdrawFixOnChains); + return Objects.hash(currency, name, nameCn, deposit, withdrawPercent, withdrawFix, withdrawDayLimit, withdrawAmountMini, withdrawDayLimitRemain, withdrawEachtimeLimit, withdrawFixOnChains, withdrawPercentOnChains); } @@ -341,6 +374,7 @@ public String toString() { sb.append(" withdrawDayLimitRemain: ").append(toIndentedString(withdrawDayLimitRemain)).append("\n"); sb.append(" withdrawEachtimeLimit: ").append(toIndentedString(withdrawEachtimeLimit)).append("\n"); sb.append(" withdrawFixOnChains: ").append(toIndentedString(withdrawFixOnChains)).append("\n"); + sb.append(" withdrawPercentOnChains: ").append(toIndentedString(withdrawPercentOnChains)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/WithdrawalRecord.java b/src/main/java/io/gate/gateapi/models/WithdrawalRecord.java new file mode 100644 index 0000000..207ac42 --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/WithdrawalRecord.java @@ -0,0 +1,364 @@ +/* + * 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.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** + * WithdrawalRecord + */ +public class WithdrawalRecord { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TXID = "txid"; + @SerializedName(SERIALIZED_NAME_TXID) + private String txid; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "block_number"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_WITHDRAW_ORDER_ID = "withdraw_order_id"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_ORDER_ID) + private String withdrawOrderId; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private String amount; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private String fee; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_FAIL_REASON = "fail_reason"; + @SerializedName(SERIALIZED_NAME_FAIL_REASON) + private String failReason; + + public static final String SERIALIZED_NAME_TIMESTAMP2 = "timestamp2"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP2) + private String timestamp2; + + public static final String SERIALIZED_NAME_MEMO = "memo"; + @SerializedName(SERIALIZED_NAME_MEMO) + private String memo; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CHAIN = "chain"; + @SerializedName(SERIALIZED_NAME_CHAIN) + private String chain; + + + /** + * Record ID + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + /** + * Hash record of the withdrawal + * @return txid + **/ + @javax.annotation.Nullable + public String getTxid() { + return txid; + } + + + /** + * Block Number + * @return blockNumber + **/ + @javax.annotation.Nullable + public String getBlockNumber() { + return blockNumber; + } + + + public WithdrawalRecord withdrawOrderId(String withdrawOrderId) { + + this.withdrawOrderId = withdrawOrderId; + return this; + } + + /** + * Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * @return withdrawOrderId + **/ + @javax.annotation.Nullable + public String getWithdrawOrderId() { + return withdrawOrderId; + } + + + public void setWithdrawOrderId(String withdrawOrderId) { + this.withdrawOrderId = withdrawOrderId; + } + + /** + * Operation time + * @return timestamp + **/ + @javax.annotation.Nullable + public String getTimestamp() { + return timestamp; + } + + + public WithdrawalRecord amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Token amount + * @return amount + **/ + public String getAmount() { + return amount; + } + + + public void setAmount(String amount) { + this.amount = amount; + } + + /** + * fee + * @return fee + **/ + @javax.annotation.Nullable + public String getFee() { + return fee; + } + + + public WithdrawalRecord currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Currency name + * @return currency + **/ + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + public WithdrawalRecord address(String address) { + + this.address = address; + return this; + } + + /** + * Withdrawal address + * @return address + **/ + @javax.annotation.Nullable + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + public WithdrawalRecord failReason(String failReason) { + + this.failReason = failReason; + return this; + } + + /** + * Reason for withdrawal failure. Has a value when status = CANCEL, empty for all other statuses + * @return failReason + **/ + @javax.annotation.Nullable + public String getFailReason() { + return failReason; + } + + + public void setFailReason(String failReason) { + this.failReason = failReason; + } + + public WithdrawalRecord timestamp2(String timestamp2) { + + this.timestamp2 = timestamp2; + return this; + } + + /** + * 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 + * @return timestamp2 + **/ + @javax.annotation.Nullable + public String getTimestamp2() { + return timestamp2; + } + + + public void setTimestamp2(String timestamp2) { + this.timestamp2 = timestamp2; + } + + public WithdrawalRecord memo(String memo) { + + this.memo = memo; + return this; + } + + /** + * Additional remarks with regards to the withdrawal + * @return memo + **/ + @javax.annotation.Nullable + public String getMemo() { + return memo; + } + + + public void setMemo(String memo) { + this.memo = memo; + } + + /** + * 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 + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + + public WithdrawalRecord chain(String chain) { + + this.chain = chain; + return this; + } + + /** + * Name of the chain used in withdrawals + * @return chain + **/ + public String getChain() { + return chain; + } + + + public void setChain(String chain) { + this.chain = chain; + } + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithdrawalRecord withdrawalRecord = (WithdrawalRecord) o; + return Objects.equals(this.id, withdrawalRecord.id) && + Objects.equals(this.txid, withdrawalRecord.txid) && + Objects.equals(this.blockNumber, withdrawalRecord.blockNumber) && + Objects.equals(this.withdrawOrderId, withdrawalRecord.withdrawOrderId) && + Objects.equals(this.timestamp, withdrawalRecord.timestamp) && + Objects.equals(this.amount, withdrawalRecord.amount) && + Objects.equals(this.fee, withdrawalRecord.fee) && + Objects.equals(this.currency, withdrawalRecord.currency) && + Objects.equals(this.address, withdrawalRecord.address) && + Objects.equals(this.failReason, withdrawalRecord.failReason) && + Objects.equals(this.timestamp2, withdrawalRecord.timestamp2) && + Objects.equals(this.memo, withdrawalRecord.memo) && + Objects.equals(this.status, withdrawalRecord.status) && + Objects.equals(this.chain, withdrawalRecord.chain); + } + + @Override + public int hashCode() { + return Objects.hash(id, txid, blockNumber, withdrawOrderId, timestamp, amount, fee, currency, address, failReason, timestamp2, memo, status, chain); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WithdrawalRecord {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" txid: ").append(toIndentedString(txid)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" withdrawOrderId: ").append(toIndentedString(withdrawOrderId)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" failReason: ").append(toIndentedString(failReason)).append("\n"); + sb.append(" timestamp2: ").append(toIndentedString(timestamp2)).append("\n"); + sb.append(" memo: ").append(toIndentedString(memo)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" chain: ").append(toIndentedString(chain)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} +