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 720187e..6f1c3fc 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ # gate-api -Gate API v4 +Gate API -- API version: 4.57.0 -- SDK version: 6.57.0 +- 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)* @@ -53,7 +52,7 @@ Add this dependency to your project's POM: io.gate gate-api - 6.57.0 + 7.1.8 compile ``` @@ -63,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.57.0" +compile "io.gate:gate-api:7.1.8" ``` ### Others @@ -76,7 +75,7 @@ mvn clean package Then manually install the following JARs: -* `target/gate-api-6.57.0.jar` +* `target/gate-api-7.1.8.jar` * `target/lib/*.jar` To install the API client library to your local Maven repository, simply execute: @@ -141,245 +140,287 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AccountApi* | [**getAccountDetail**](docs/AccountApi.md#getAccountDetail) | **GET** /account/detail | Get account detail -*AccountApi* | [**listSTPGroups**](docs/AccountApi.md#listSTPGroups) | **GET** /account/stp_groups | List STP Groups -*AccountApi* | [**createSTPGroup**](docs/AccountApi.md#createSTPGroup) | **POST** /account/stp_groups | Create STP Group -*AccountApi* | [**listSTPGroupsUsers**](docs/AccountApi.md#listSTPGroupsUsers) | **GET** /account/stp_groups/{stp_id}/users | List users of the STP group -*AccountApi* | [**addSTPGroupUsers**](docs/AccountApi.md#addSTPGroupUsers) | **POST** /account/stp_groups/{stp_id}/users | Add users to the STP group -*AccountApi* | [**deleteSTPGroupUsers**](docs/AccountApi.md#deleteSTPGroupUsers) | **DELETE** /account/stp_groups/{stp_id}/users | Delete the user in the STP group -*CollateralLoanApi* | [**listCollateralLoanOrders**](docs/CollateralLoanApi.md#listCollateralLoanOrders) | **GET** /loan/collateral/orders | List Orders -*CollateralLoanApi* | [**createCollateralLoan**](docs/CollateralLoanApi.md#createCollateralLoan) | **POST** /loan/collateral/orders | Place order -*CollateralLoanApi* | [**getCollateralLoanOrderDetail**](docs/CollateralLoanApi.md#getCollateralLoanOrderDetail) | **GET** /loan/collateral/orders/{order_id} | Get a single order -*CollateralLoanApi* | [**repayCollateralLoan**](docs/CollateralLoanApi.md#repayCollateralLoan) | **POST** /loan/collateral/repay | Repayment -*CollateralLoanApi* | [**listRepayRecords**](docs/CollateralLoanApi.md#listRepayRecords) | **GET** /loan/collateral/repay_records | Repayment history +*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 the total borrowing and collateral amount for the user -*CollateralLoanApi* | [**getUserLtvInfo**](docs/CollateralLoanApi.md#getUserLtvInfo) | **GET** /loan/collateral/ltv | Query user's collateralization ratio +*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 | 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 +*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 price-triggered order -*DeliveryApi* | [**cancelPriceTriggeredDeliveryOrder**](docs/DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order -*EarnUniApi* | [**listUniCurrencies**](docs/EarnUniApi.md#listUniCurrencies) | **GET** /earn/uni/currencies | List currencies for lending -*EarnUniApi* | [**getUniCurrency**](docs/EarnUniApi.md#getUniCurrency) | **GET** /earn/uni/currencies/{currency} | Get currency detail for lending -*EarnUniApi* | [**listUserUniLends**](docs/EarnUniApi.md#listUserUniLends) | **GET** /earn/uni/lends | List user's lending orders -*EarnUniApi* | [**createUniLend**](docs/EarnUniApi.md#createUniLend) | **POST** /earn/uni/lends | Lend or redeem -*EarnUniApi* | [**changeUniLend**](docs/EarnUniApi.md#changeUniLend) | **PATCH** /earn/uni/lends | Amend lending order -*EarnUniApi* | [**listUniLendRecords**](docs/EarnUniApi.md#listUniLendRecords) | **GET** /earn/uni/lend_records | List records of lending -*EarnUniApi* | [**getUniInterest**](docs/EarnUniApi.md#getUniInterest) | **GET** /earn/uni/interests/{currency} | Get the user's total interest income of specified currency -*EarnUniApi* | [**listUniInterestRecords**](docs/EarnUniApi.md#listUniInterestRecords) | **GET** /earn/uni/interest_records | List interest records -*EarnUniApi* | [**switchInterestReinvest**](docs/EarnUniApi.md#switchInterestReinvest) | **PUT** /earn/uni/interest_reinvest | Set interest reinvestment toggle -*EarnUniApi* | [**getUniInterestStatus**](docs/EarnUniApi.md#getUniInterestStatus) | **GET** /earn/uni/interest_status/{currency} | query currency interest compounding status -*FlashSwapApi* | [**listFlashSwapCurrencies**](docs/FlashSwapApi.md#listFlashSwapCurrencies) | **GET** /flash_swap/currencies | List All Supported Currencies In Flash Swap (deprecated) +*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 | List all flash swap orders +*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} | Get a single flash swap order's detail -*FlashSwapApi* | [**previewFlashSwapOrder**](docs/FlashSwapApi.md#previewFlashSwapOrder) | **POST** /flash_swap/orders/preview | Initiate a flash swap order preview -*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* | [**listFuturesPremiumIndex**](docs/FuturesApi.md#listFuturesPremiumIndex) | **GET** /futures/{settle}/premium_index | Premium Index K-Line -*FuturesApi* | [**listFuturesTickers**](docs/FuturesApi.md#listFuturesTickers) | **GET** /futures/{settle}/tickers | List futures tickers -*FuturesApi* | [**listFuturesFundingRateHistory**](docs/FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Funding rate history -*FuturesApi* | [**listFuturesInsuranceLedger**](docs/FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures insurance balance history -*FuturesApi* | [**listContractStats**](docs/FuturesApi.md#listContractStats) | **GET** /futures/{settle}/contract_stats | Futures stats -*FuturesApi* | [**getIndexConstituents**](docs/FuturesApi.md#getIndexConstituents) | **GET** /futures/{settle}/index_constituents/{index} | Get index constituents -*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 +*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* | [**getOrdersWithTimeRange**](docs/FuturesApi.md#getOrdersWithTimeRange) | **GET** /futures/{settle}/orders_timerange | List Futures Orders By Time Range -*FuturesApi* | [**createBatchFuturesOrder**](docs/FuturesApi.md#createBatchFuturesOrder) | **POST** /futures/{settle}/batch_orders | Create a batch of futures orders -*FuturesApi* | [**getFuturesOrder**](docs/FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order -*FuturesApi* | [**amendFuturesOrder**](docs/FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order -*FuturesApi* | [**cancelFuturesOrder**](docs/FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order -*FuturesApi* | [**getMyTrades**](docs/FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | List personal trading history -*FuturesApi* | [**getMyTradesWithTimeRange**](docs/FuturesApi.md#getMyTradesWithTimeRange) | **GET** /futures/{settle}/my_trades_timerange | List personal trading history by time range -*FuturesApi* | [**listPositionClose**](docs/FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history -*FuturesApi* | [**listLiquidates**](docs/FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | List liquidation history -*FuturesApi* | [**listAutoDeleverages**](docs/FuturesApi.md#listAutoDeleverages) | **GET** /futures/{settle}/auto_deleverages | List Auto-Deleveraging History +*FuturesApi* | [**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 user trading fee rates -*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 price-triggered order -*FuturesApi* | [**cancelPriceTriggeredOrder**](docs/FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order +*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* | [**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* | [**listMarginCurrencyPairs**](docs/MarginApi.md#listMarginCurrencyPairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading(Deprecated) -*MarginApi* | [**getMarginCurrencyPair**](docs/MarginApi.md#getMarginCurrencyPair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair(Deprecated) -*MarginApi* | [**listFundingBook**](docs/MarginApi.md#listFundingBook) | **GET** /margin/funding_book | Order book of lending loans(Deprecated) -*MarginApi* | [**listLoans**](docs/MarginApi.md#listLoans) | **GET** /margin/loans | List all loans(Deprecated) -*MarginApi* | [**createLoan**](docs/MarginApi.md#createLoan) | **POST** /margin/loans | Lend or borrow(Deprecated) -*MarginApi* | [**mergeLoans**](docs/MarginApi.md#mergeLoans) | **POST** /margin/merged_loans | Merge multiple lending loans(Deprecated) -*MarginApi* | [**getLoan**](docs/MarginApi.md#getLoan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail(Deprecated) -*MarginApi* | [**cancelLoan**](docs/MarginApi.md#cancelLoan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan(Deprecated) -*MarginApi* | [**updateLoan**](docs/MarginApi.md#updateLoan) | **PATCH** /margin/loans/{loan_id} | Modify a loan(Deprecated) -*MarginApi* | [**listLoanRepayments**](docs/MarginApi.md#listLoanRepayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records(Deprecated) -*MarginApi* | [**repayLoan**](docs/MarginApi.md#repayLoan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan(Deprecated) -*MarginApi* | [**listLoanRecords**](docs/MarginApi.md#listLoanRecords) | **GET** /margin/loan_records | List repayment records of a specific loan(Deprecated) -*MarginApi* | [**getLoanRecord**](docs/MarginApi.md#getLoanRecord) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record(Deprecated) -*MarginApi* | [**updateLoanRecord**](docs/MarginApi.md#updateLoanRecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record(Deprecated) -*MarginApi* | [**getMarginBorrowable**](docs/MarginApi.md#getMarginBorrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency(Deprecated) -*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 | Cross margin repayments -*MarginApi* | [**getCrossMarginInterestRecords**](docs/MarginApi.md#getCrossMarginInterestRecords) | **GET** /margin/cross/interest_records | Interest records for the cross margin account -*MarginApi* | [**getCrossMarginTransferable**](docs/MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency -*MarginApi* | [**getCrossMarginEstimateRate**](docs/MarginApi.md#getCrossMarginEstimateRate) | **GET** /margin/cross/estimate_rate | Estimated interest rates -*MarginApi* | [**getCrossMarginBorrowable**](docs/MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency +*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 detail of lending market -*MarginUniApi* | [**getMarginUniEstimateRate**](docs/MarginUniApi.md#getMarginUniEstimateRate) | **GET** /margin/uni/estimate_rate | Estimate interest Rate -*MarginUniApi* | [**listUniLoans**](docs/MarginUniApi.md#listUniLoans) | **GET** /margin/uni/loans | List loans +*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 | Get load records -*MarginUniApi* | [**listUniLoanInterestRecords**](docs/MarginUniApi.md#listUniLoanInterestRecords) | **GET** /margin/uni/interest_records | List interest records -*MarginUniApi* | [**getUniBorrowable**](docs/MarginUniApi.md#getUniBorrowable) | **GET** /margin/uni/borrowable | Get maximum borrowable -*OptionsApi* | [**listOptionsUnderlyings**](docs/OptionsApi.md#listOptionsUnderlyings) | **GET** /options/underlyings | List all underlyings -*OptionsApi* | [**listOptionsExpirations**](docs/OptionsApi.md#listOptionsExpirations) | **GET** /options/expirations | List all expiration times -*OptionsApi* | [**listOptionsContracts**](docs/OptionsApi.md#listOptionsContracts) | **GET** /options/contracts | List all the contracts with specified underlying and expiration time -*OptionsApi* | [**getOptionsContract**](docs/OptionsApi.md#getOptionsContract) | **GET** /options/contracts/{contract} | Query specified contract detail +*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's settlement -*OptionsApi* | [**listMyOptionsSettlements**](docs/OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | List my options settlements -*OptionsApi* | [**listOptionsOrderBook**](docs/OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Options order book -*OptionsApi* | [**listOptionsTickers**](docs/OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | List tickers of options contracts -*OptionsApi* | [**listOptionsUnderlyingTickers**](docs/OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker -*OptionsApi* | [**listOptionsCandlesticks**](docs/OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get options candlesticks -*OptionsApi* | [**listOptionsUnderlyingCandlesticks**](docs/OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying -*OptionsApi* | [**listOptionsTrades**](docs/OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Options trade history -*OptionsApi* | [**listOptionsAccount**](docs/OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | List options account -*OptionsApi* | [**listOptionsAccountBook**](docs/OptionsApi.md#listOptionsAccountBook) | **GET** /options/account_book | List account changing 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 `open` orders matched -*OptionsApi* | [**getOptionsOrder**](docs/OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Get a single order -*OptionsApi* | [**cancelOptionsOrder**](docs/OptionsApi.md#cancelOptionsOrder) | **DELETE** /options/orders/{order_id} | Cancel a single order -*OptionsApi* | [**listMyOptionsTrades**](docs/OptionsApi.md#listMyOptionsTrades) | **GET** /options/my_trades | List personal trading history -*PortfolioApi* | [**listPortfolioAccounts**](docs/PortfolioApi.md#listPortfolioAccounts) | **GET** /portfolio/accounts | Get portfolio account information -*PortfolioApi* | [**listAccountPortfolioMode**](docs/PortfolioApi.md#listAccountPortfolioMode) | **GET** /portfolio/account_mode | Retrieve the account's portfolio mode -*PortfolioApi* | [**setAccountPortfolioMode**](docs/PortfolioApi.md#setAccountPortfolioMode) | **POST** /portfolio/account_mode | Configure the account's portfolio mode. -*PortfolioApi* | [**getPortfolioBorrowable**](docs/PortfolioApi.md#getPortfolioBorrowable) | **GET** /portfolio/borrowable | Retrieve the maximum borrowable amount for the account. -*PortfolioApi* | [**getPortfolioTransferable**](docs/PortfolioApi.md#getPortfolioTransferable) | **GET** /portfolio/transferable | Retrieve the maximum amount that can be transferred out from the account -*PortfolioApi* | [**listPortfolioUniLoanInterestRecords**](docs/PortfolioApi.md#listPortfolioUniLoanInterestRecords) | **GET** /portfolio/loans | List loans -*PortfolioApi* | [**createPortfolioLoan**](docs/PortfolioApi.md#createPortfolioLoan) | **POST** /portfolio/loans | Borrow or repay -*PortfolioApi* | [**listPortfolioLoanRecords**](docs/PortfolioApi.md#listPortfolioLoanRecords) | **GET** /portfolio/loan_records | Get load records -*PortfolioApi* | [**listPortfolioLoanInterestRecords**](docs/PortfolioApi.md#listPortfolioLoanInterestRecords) | **GET** /portfolio/interest_records | List interest records -*RebateApi* | [**agencyTransactionHistory**](docs/RebateApi.md#agencyTransactionHistory) | **GET** /rebate/agency/transaction_history | The broker obtains the transaction history of the recommended user -*RebateApi* | [**agencyCommissionsHistory**](docs/RebateApi.md#agencyCommissionsHistory) | **GET** /rebate/agency/commission_history | The broker obtains the commission history of the recommended user -*SpotApi* | [**listCurrencies**](docs/SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies' details -*SpotApi* | [**getCurrency**](docs/SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency -*SpotApi* | [**listCurrencyPairs**](docs/SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported -*SpotApi* | [**getCurrencyPair**](docs/SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair -*SpotApi* | [**listTickers**](docs/SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information -*SpotApi* | [**listOrderBook**](docs/SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book -*SpotApi* | [**listTrades**](docs/SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades -*SpotApi* | [**listCandlesticks**](docs/SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks -*SpotApi* | [**getFee**](docs/SpotApi.md#getFee) | **GET** /spot/fee | Query user trading fee rates -*SpotApi* | [**getBatchSpotFee**](docs/SpotApi.md#getBatchSpotFee) | **GET** /spot/batch_fee | Query a batch of user trading fee rates -*SpotApi* | [**listSpotAccounts**](docs/SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts -*SpotApi* | [**listSpotAccountBook**](docs/SpotApi.md#listSpotAccountBook) | **GET** /spot/account_book | Query account book -*SpotApi* | [**createBatchOrders**](docs/SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Create a batch of orders +*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* | [**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* | [**amendOrder**](docs/SpotApi.md#amendOrder) | **PATCH** /spot/orders/{order_id} | Amend an order -*SpotApi* | [**listMyTrades**](docs/SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history +*SpotApi* | [**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* | [**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 price-triggered order -*SpotApi* | [**cancelSpotPriceTriggeredOrder**](docs/SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order +*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 the sub-account -*SubAccountApi* | [**listSubAccountKeys**](docs/SubAccountApi.md#listSubAccountKeys) | **GET** /sub_accounts/{user_id}/keys | List all API Key of the sub-account -*SubAccountApi* | [**createSubAccountKeys**](docs/SubAccountApi.md#createSubAccountKeys) | **POST** /sub_accounts/{user_id}/keys | Create API Key of the sub-account -*SubAccountApi* | [**getSubAccountKey**](docs/SubAccountApi.md#getSubAccountKey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account -*SubAccountApi* | [**updateSubAccountKeys**](docs/SubAccountApi.md#updateSubAccountKeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account -*SubAccountApi* | [**deleteSubAccountKeys**](docs/SubAccountApi.md#deleteSubAccountKeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account -*SubAccountApi* | [**lockSubAccount**](docs/SubAccountApi.md#lockSubAccount) | **POST** /sub_accounts/{user_id}/lock | Lock the sub-account -*SubAccountApi* | [**unlockSubAccount**](docs/SubAccountApi.md#unlockSubAccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock the sub-account -*WalletApi* | [**listCurrencyChains**](docs/WalletApi.md#listCurrencyChains) | **GET** /wallet/currency_chains | List chains supported for specified currency +*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* | [**subAccountToSubAccount**](docs/WalletApi.md#subAccountToSubAccount) | **POST** /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account -*WalletApi* | [**listWithdrawStatus**](docs/WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status -*WalletApi* | [**listSubAccountBalances**](docs/WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances -*WalletApi* | [**listSubAccountMarginBalances**](docs/WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances -*WalletApi* | [**listSubAccountFuturesBalances**](docs/WalletApi.md#listSubAccountFuturesBalances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances -*WalletApi* | [**listSubAccountCrossMarginBalances**](docs/WalletApi.md#listSubAccountCrossMarginBalances) | **GET** /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info -*WalletApi* | [**listSavedAddress**](docs/WalletApi.md#listSavedAddress) | **GET** /wallet/saved_address | Query saved address -*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 @@ -388,88 +429,129 @@ Class | Method | HTTP request | Description - [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) - - [AmendOrderResult](docs/AmendOrderResult.md) - - [ApiV4KeyPerm](docs/ApiV4KeyPerm.md) - [AutoRepaySetting](docs/AutoRepaySetting.md) - [BatchAmendItem](docs/BatchAmendItem.md) + - [BatchAmendOrderReq](docs/BatchAmendOrderReq.md) - [BatchFuturesOrder](docs/BatchFuturesOrder.md) - [BatchOrder](docs/BatchOrder.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) + - [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) - - [CrossMarginAccount](docs/CrossMarginAccount.md) - - [CrossMarginAccountBook](docs/CrossMarginAccountBook.md) - [CrossMarginBalance](docs/CrossMarginBalance.md) - - [CrossMarginBalance1](docs/CrossMarginBalance1.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) - - [FlashSwapCurrency](docs/FlashSwapCurrency.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) - [LiquidateOrder](docs/LiquidateOrder.md) - - [Loan](docs/Loan.md) - - [LoanPatch](docs/LoanPatch.md) - - [LoanRecord](docs/LoanRecord.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) @@ -477,6 +559,8 @@ Class | Method | HTTP request | Description - [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) @@ -489,42 +573,60 @@ Class | Method | HTTP request | Description - [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) - - [PortfolioAccount](docs/PortfolioAccount.md) - - [PortfolioBorrowable](docs/PortfolioBorrowable.md) - - [PortfolioLoan](docs/PortfolioLoan.md) - - [PortfolioLoanRecord](docs/PortfolioLoanRecord.md) - - [PortfolioMarginBalance](docs/PortfolioMarginBalance.md) - - [PortfolioMode](docs/PortfolioMode.md) - - [PortfolioTransferable](docs/PortfolioTransferable.md) + - [PlaceDualInvestmentOrder](docs/PlaceDualInvestmentOrder.md) - [Position](docs/Position.md) - [PositionClose](docs/PositionClose.md) - [PositionCloseOrder](docs/PositionCloseOrder.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) - - [RepayRequest](docs/RepayRequest.md) + - [RepayRecordCurrency](docs/RepayRecordCurrency.md) + - [RepayRecordLeftInterest](docs/RepayRecordLeftInterest.md) + - [RepayRecordRepaidCurrency](docs/RepayRecordRepaidCurrency.md) + - [RepayRecordTotalInterest](docs/RepayRecordTotalInterest.md) - [RepayResp](docs/RepayResp.md) - - [Repayment](docs/Repayment.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) @@ -532,12 +634,16 @@ Class | Method | HTTP request | Description - [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) - - [UniInterestMode](docs/UniInterestMode.md) - [UniInterestRecord](docs/UniInterestRecord.md) - [UniLend](docs/UniLend.md) - [UniLendInterest](docs/UniLendInterest.md) @@ -545,9 +651,35 @@ Class | Method | HTTP request | Description - [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 @@ -564,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 5ec7bf7..06a0965 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'eclipse' apply plugin: 'java' group = 'io.gate' -version = '6.57.0' +version = '7.1.8' buildscript { repositories { diff --git a/build.sbt b/build.sbt index 235c95d..d90345d 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "io.gate", name := "gate-api", - version := "6.57.0", + version := "7.1.8", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/AccountApi.md b/docs/AccountApi.md index ec67fa4..348ae04 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -4,19 +4,22 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**getAccountDetail**](AccountApi.md#getAccountDetail) | **GET** /account/detail | Get account detail -[**listSTPGroups**](AccountApi.md#listSTPGroups) | **GET** /account/stp_groups | List STP Groups -[**createSTPGroup**](AccountApi.md#createSTPGroup) | **POST** /account/stp_groups | Create STP Group -[**listSTPGroupsUsers**](AccountApi.md#listSTPGroupsUsers) | **GET** /account/stp_groups/{stp_id}/users | List users of the STP group -[**addSTPGroupUsers**](AccountApi.md#addSTPGroupUsers) | **POST** /account/stp_groups/{stp_id}/users | Add users to the STP group -[**deleteSTPGroupUsers**](AccountApi.md#deleteSTPGroupUsers) | **DELETE** /account/stp_groups/{stp_id}/users | Delete the user in the STP group +[**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() -Get account detail +Retrieve user account information ### Example @@ -74,15 +77,79 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful | - | +**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(); -List STP Groups +Query STP user groups created by the user -Retrieve the list of STP groups created by the main account user only +Only query STP user groups created by the current main account ### Example @@ -105,7 +172,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); AccountApi apiInstance = new AccountApi(defaultClient); - String name = "group"; // String | Perform a fuzzy search based on the name + String name = "group"; // String | Fuzzy search by name try { List result = apiInstance.listSTPGroups() .name(name) @@ -128,7 +195,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **String**| Perform a fuzzy search based on the name | [optional] + **name** | **String**| Fuzzy search by name | [optional] ### Return type @@ -146,13 +213,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **createSTPGroup** > StpGroup createSTPGroup(stpGroup) -Create STP Group +Create STP user group Only the main account is allowed to create a new STP user group @@ -216,15 +283,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | User added successfully. Returning the current users within the STP group. | - | +**200** | User added successfully, returning current users in the STP group | - | # **listSTPGroupsUsers** > List<StpGroupUser> listSTPGroupsUsers(stpId) -List users of the STP group +Query users in the STP user group -Only the main account that created this STP group is allowed to list the user ID of the STP group +Only the main account that created this STP group can query the account ID list in the current STP group ### Example @@ -286,15 +353,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **addSTPGroupUsers** > List<StpGroupUser> addSTPGroupUsers(stpId, requestBody) -Add users to the STP group +Add users to the STP user group -- Only the master account that created the STP user group is allowed to add users to the STP user group.- Only accounts under the main account are allowed to be added. Cross-account is not permitted +- 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 @@ -358,13 +425,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | User added successfully. Returning the current users within the STP group. | - | +**200** | User added successfully, returning current users in the STP group | - | # **deleteSTPGroupUsers** -> List<StpGroupUser> deleteSTPGroupUsers(stpId, requestBody) +> List<StpGroupUser> deleteSTPGroupUsers(stpId, userId) -Delete the user in the STP group +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 @@ -390,9 +457,9 @@ public class Example { AccountApi apiInstance = new AccountApi(defaultClient); Long stpId = 1L; // Long | STP Group ID - List requestBody = Arrays.asList(); // List | User ID + Long userId = 1L; // Long | STP user IDs, multiple IDs can be separated by commas try { - List result = apiInstance.deleteSTPGroupUsers(stpId, requestBody); + 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())); @@ -412,7 +479,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **stpId** | **Long**| STP Group ID | - **requestBody** | [**List<Long>**](Long.md)| User ID | + **userId** | **Long**| STP user IDs, multiple IDs can be separated by commas | ### Return type @@ -424,9 +491,144 @@ 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** | 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 | |-------------|-------------|------------------| 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 index faef975..d8ab381 100644 --- a/docs/AccountDetail.md +++ b/docs/AccountDetail.md @@ -1,14 +1,16 @@ # AccountDetail -Account detail +Account details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ipWhitelist** | **List<String>** | IP whitelist | [optional] -**currencyPairs** | **List<String>** | CurrencyPair whitelisting | [optional] +**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 index 801792f..57978ca 100644 --- a/docs/AccountDetailKey.md +++ b/docs/AccountDetailKey.md @@ -1,11 +1,11 @@ # AccountDetailKey -API Key detail +API Key details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | **Integer** | mode: 1 - classic account 2 - portfolio margin account | [optional] +**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 index 1162280..beaf7e5 100644 --- a/docs/AgencyCommission.md +++ b/docs/AgencyCommission.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**commissionTime** | **Long** | Commission Time. (unix timestamp) | [optional] +**commissionTime** | **Long** | Commission time (Unix timestamp in seconds) | [optional] **userId** | **Long** | User ID | [optional] **groupName** | **String** | Group name | [optional] -**commissionAmount** | **String** | Commission Amount | [optional] +**commissionAmount** | **String** | Transaction amount | [optional] **commissionAsset** | **String** | Commission Asset | [optional] -**source** | **String** | Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate | [optional] +**source** | **String** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional] diff --git a/docs/AgencyCommissionHistory.md b/docs/AgencyCommissionHistory.md index 9a5b4c1..d74cc13 100644 --- a/docs/AgencyCommissionHistory.md +++ b/docs/AgencyCommissionHistory.md @@ -7,5 +7,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currencyPair** | **String** | Currency pair | [optional] **total** | **Long** | Total | [optional] -**list** | [**List<AgencyCommission>**](AgencyCommission.md) | List of comission history | [optional] +**list** | [**List<AgencyCommission>**](AgencyCommission.md) | List of commission history | [optional] diff --git a/docs/AgencyTransaction.md b/docs/AgencyTransaction.md index 81a851b..4483e3f 100644 --- a/docs/AgencyTransaction.md +++ b/docs/AgencyTransaction.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **fee** | **String** | Fee | [optional] **feeAsset** | **String** | Fee currency | [optional] **currencyPair** | **String** | Currency pair | [optional] -**amount** | **String** | Commission Amount | [optional] +**amount** | **String** | Transaction amount | [optional] **amountAsset** | **String** | Commission Asset | [optional] -**source** | **String** | Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate | [optional] +**source** | **String** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional] diff --git a/docs/AmendOrderResult.md b/docs/AmendOrderResult.md deleted file mode 100644 index 2c6d9cb..0000000 --- a/docs/AmendOrderResult.md +++ /dev/null @@ -1,18 +0,0 @@ - -# AmendOrderResult - -Batch order modification results - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**orderId** | **String** | Order ID | [optional] [readonly] -**amount** | **String** | Trade amount | [optional] [readonly] -**price** | **String** | Order price | [optional] [readonly] -**amendText** | **String** | The custom data that the user remarked when amending the order | [optional] [readonly] -**succeeded** | **Boolean** | Update success status | [optional] [readonly] -**label** | **String** | Error indicator for failed modifications; empty when successful | [optional] [readonly] -**message** | **String** | Error description for failed modifications; empty when successful | [optional] [readonly] -**account** | **String** | Account types, spot - spot account, margin - margin account, portfolio - portfolio margin account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` | [optional] [readonly] - diff --git a/docs/ApiV4KeyPerm.md b/docs/ApiV4KeyPerm.md deleted file mode 100644 index cb34a74..0000000 --- a/docs/ApiV4KeyPerm.md +++ /dev/null @@ -1,24 +0,0 @@ - -# ApiV4KeyPerm - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | [**NameEnum**](#NameEnum) | Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options- account: Account - portfolio: Portfolio - loan: Loan | [optional] -**readOnly** | **Boolean** | read only | [optional] - -## Enum: NameEnum - -Name | Value ----- | ----- -WALLET | "wallet" -SPOT | "spot" -FUTURES | "futures" -DELIVERY | "delivery" -EARN | "earn" -OPTIONS | "options" -ACCOUNT | "account" -PORTFOLIO | "portfolio" -LOAN | "loan" - 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 index d1e0cf3..e37ee0d 100644 --- a/docs/BatchAmendItem.md +++ b/docs/BatchAmendItem.md @@ -7,10 +7,11 @@ Order information that needs to be modified 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). | +**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 to spot, portfolio, and margin accounts if not specified. Use 'cross_margin' to query cross margin accounts. Only 'cross_margin' can be specified for portfolio margin accounts. | [optional] -**amount** | **String** | trade amount, only one of amount and price can be specified | [optional] -**price** | **String** | trade price, only one of amount and price can be specified | [optional] -**amendText** | **String** | Custom info during amending order | [optional] +**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 index 903c032..5ed54b4 100644 --- a/docs/BatchFuturesOrder.md +++ b/docs/BatchFuturesOrder.md @@ -7,33 +7,33 @@ Futures order details Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**succeeded** | **Boolean** | Whether the batch of orders succeeded | [optional] +**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 of position close - stp: cancelled because self trade prevention | [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 | [optional] -**size** | **Long** | Order size. Specify positive number to make a bid, and negative number to ask | [optional] -**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. | [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** | Size left to be traded | [optional] [readonly] -**fillPrice** | **String** | Fill price of the order | [optional] [readonly] +**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** | 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] -**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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled | [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 diff --git a/docs/BatchOrder.md b/docs/BatchOrder.md index 9d9b30f..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,27 +20,29 @@ 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 - market : Market Order | [optional] -**account** | [**AccountEnum**](#AccountEnum) | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, portfolio - portfolio 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 - 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` cannot be both set to true in one order. | [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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled | [optional] +**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 @@ -63,7 +67,7 @@ Name | Value SPOT | "spot" MARGIN | "margin" CROSS_MARGIN | "cross_margin" -PORTFOLIO | "portfolio" +UNIFIED | "unified" ## Enum: SideEnum 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 index 370fe3a..be6fb13 100644 --- a/docs/CancelBatchOrder.md +++ b/docs/CancelBatchOrder.md @@ -9,5 +9,6 @@ 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 or is portfolio margin account's API key, this field must be set and can only be `cross_margin`If cancelled order is cross margin order, this field must be set and can only be `cross_margin` | [optional] +**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 731e5c4..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 or is portfolio margin account's API key, this field must be set and can only be `cross_margin`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 index 7aae66a..022b44b 100644 --- a/docs/CollateralAlign.md +++ b/docs/CollateralAlign.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **orderId** | **Long** | Order ID | -**collateralCurrency** | **String** | Collateral | +**collateralCurrency** | **String** | Collateral currency | **collateralAmount** | **String** | Collateral amount | -**type** | **String** | Operation types: append - for adding collateral, redeem - for withdrawing collateral | +**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 index 8117fa0..881aa73 100644 --- a/docs/CollateralLoanApi.md +++ b/docs/CollateralLoanApi.md @@ -4,15 +4,15 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listCollateralLoanOrders**](CollateralLoanApi.md#listCollateralLoanOrders) | **GET** /loan/collateral/orders | List Orders -[**createCollateralLoan**](CollateralLoanApi.md#createCollateralLoan) | **POST** /loan/collateral/orders | Place order -[**getCollateralLoanOrderDetail**](CollateralLoanApi.md#getCollateralLoanOrderDetail) | **GET** /loan/collateral/orders/{order_id} | Get a single order -[**repayCollateralLoan**](CollateralLoanApi.md#repayCollateralLoan) | **POST** /loan/collateral/repay | Repayment -[**listRepayRecords**](CollateralLoanApi.md#listRepayRecords) | **GET** /loan/collateral/repay_records | Repayment history +[**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 the total borrowing and collateral amount for the user -[**getUserLtvInfo**](CollateralLoanApi.md#getUserLtvInfo) | **GET** /loan/collateral/ltv | Query user's collateralization ratio +[**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 @@ -20,7 +20,7 @@ Method | HTTP request | Description # **listCollateralLoanOrders** > List<CollateralOrder> listCollateralLoanOrders().page(page).limit(limit).collateralCurrency(collateralCurrency).borrowCurrency(borrowCurrency).execute(); -List Orders +Query collateral loan order list ### Example @@ -44,8 +44,8 @@ public class Example { CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient); Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum number of records to be returned in a single list - String collateralCurrency = "BTC"; // String | Collateral + 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() @@ -73,8 +73,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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] - **collateralCurrency** | **String**| Collateral | [optional] + **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 @@ -93,13 +93,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **createCollateralLoan** > OrderResp createCollateralLoan(createCollateralOrder) -Place order +Place collateral loan order ### Example @@ -161,13 +161,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Success | - | +**200** | Order placed successfully | - | # **getCollateralLoanOrderDetail** > CollateralOrder getCollateralLoanOrderDetail(orderId) -Get a single order +Query single order details ### Example @@ -190,7 +190,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient); - Long orderId = 100001L; // Long | Order ID returned on successful order creation + Long orderId = 100001L; // Long | Order ID returned when order is successfully created try { CollateralOrder result = apiInstance.getCollateralLoanOrderDetail(orderId); System.out.println(result); @@ -211,7 +211,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| Order ID returned on successful order creation | + **orderId** | **Long**| Order ID returned when order is successfully created | ### Return type @@ -229,13 +229,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Success | - | +**200** | Order details queried successfully | - | # **repayCollateralLoan** > RepayResp repayCollateralLoan(repayLoan) -Repayment +Collateral loan repayment ### Example @@ -297,13 +297,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Operated successfully | - | +**200** | Operation successful | - | # **listRepayRecords** > List<RepayRecord> listRepayRecords(source).borrowCurrency(borrowCurrency).collateralCurrency(collateralCurrency).page(page).limit(limit).from(from).to(to).execute(); -Repayment history +Query collateral loan repayment records ### Example @@ -328,11 +328,11 @@ public class Example { 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 + String collateralCurrency = "BTC"; // String | Collateral currency Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum number of records to be returned in a single list - Long from = 1609459200L; // Long | Start timestamp of the query - Long to = 1609459200L; // Long | Time range ending, default to current time + 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) @@ -362,11 +362,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **source** | **String**| Operation type: repay - Regular repayment, liquidate - Liquidation | **borrowCurrency** | **String**| Borrowed currency | [optional] - **collateralCurrency** | **String**| Collateral | [optional] + **collateralCurrency** | **String**| Collateral currency | [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] - **from** | **Long**| Start timestamp of the query | [optional] - **to** | **Long**| Time range ending, default to current time | [optional] + **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 @@ -384,7 +384,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listCollateralRecords** @@ -414,11 +414,11 @@ public class Example { CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient); Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum number of records to be returned in a single list - Long from = 1609459200L; // Long | Start timestamp of the query - Long to = 1609459200L; // Long | Time range ending, default to current time + 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 + String collateralCurrency = "BTC"; // String | Collateral currency try { List result = apiInstance.listCollateralRecords() .page(page) @@ -447,11 +447,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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] - **from** | **Long**| Start timestamp of the query | [optional] - **to** | **Long**| Time range ending, default to current time | [optional] + **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 | [optional] + **collateralCurrency** | **String**| Collateral currency | [optional] ### Return type @@ -469,7 +469,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **operateCollateral** @@ -536,13 +536,13 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Operated successfully | - | +**204** | Operation successful | - | # **getUserTotalAmount** > UserTotalAmount getUserTotalAmount() -Query the total borrowing and collateral amount for the user +Query user's total borrowing and collateral amount ### Example @@ -600,13 +600,13 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getUserLtvInfo** > UserLtvInfo getUserLtvInfo(collateralCurrency, borrowCurrency) -Query user's collateralization ratio +Query user's collateralization ratio and remaining borrowable currencies ### Example @@ -629,7 +629,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient); - String collateralCurrency = "BTC"; // String | Collateral + String collateralCurrency = "BTC"; // String | Collateral currency String borrowCurrency = "USDT"; // String | Borrowed currency try { UserLtvInfo result = apiInstance.getUserLtvInfo(collateralCurrency, borrowCurrency); @@ -651,7 +651,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collateralCurrency** | **String**| Collateral | + **collateralCurrency** | **String**| Collateral currency | **borrowCurrency** | **String**| Borrowed currency | ### Return type @@ -670,7 +670,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listCollateralCurrencies** @@ -695,7 +695,7 @@ public class Example { defaultClient.setBasePath("https://api.gateio.ws/api/v4"); CollateralLoanApi apiInstance = new CollateralLoanApi(defaultClient); - String loanCurrency = "BTC"; // String | The parameter loan_currency is used to specify the borrowing currency. If loan_currency is not provided, the API will return all supported borrowing currencies. If loan_currency is provided, the API will return an array of collateral currencies supported for the specified borrowing currency. + 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) @@ -718,7 +718,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loanCurrency** | **String**| The parameter loan_currency is used to specify the borrowing currency. If loan_currency is not provided, the API will return all supported borrowing currencies. If loan_currency is provided, the API will return an array of collateral currencies supported for the specified borrowing currency. | [optional] + **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 @@ -736,5 +736,5 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | 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 index bae42ce..19cb8bd 100644 --- a/docs/CollateralOrder.md +++ b/docs/CollateralOrder.md @@ -1,26 +1,26 @@ # CollateralOrder -Collateral Order +Collateral order ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **orderId** | **Long** | Order ID | [optional] -**collateralCurrency** | **String** | Collateral | [optional] +**collateralCurrency** | **String** | Collateral currency | [optional] **collateralAmount** | **String** | Collateral amount | [optional] **borrowCurrency** | **String** | Borrowed currency | [optional] -**borrowAmount** | **String** | Borrowing amount | [optional] +**borrowAmount** | **String** | Borrowed amount | [optional] **repaidAmount** | **String** | Repaid amount | [optional] **repaidPrincipal** | **String** | Repaid principal | [optional] **repaidInterest** | **String** | Repaid interest | [optional] -**initLtv** | **String** | The initial collateralization rate | [optional] -**currentLtv** | **String** | The current collateralization rate | [optional] -**liquidateLtv** | **String** | The liquidation collateralization rate | [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] +**leftRepayPrincipal** | **String** | Outstanding principal | [optional] +**leftRepayInterest** | **String** | Outstanding interest | [optional] diff --git a/docs/CollateralRecord.md b/docs/CollateralRecord.md index e50dc83..da9834c 100644 --- a/docs/CollateralRecord.md +++ b/docs/CollateralRecord.md @@ -10,11 +10,11 @@ Name | Type | Description | Notes **orderId** | **Long** | Order ID | [optional] **recordId** | **Long** | Collateral record ID | [optional] **borrowCurrency** | **String** | Borrowed currency | [optional] -**borrowAmount** | **String** | Borrowing amount | [optional] -**collateralCurrency** | **String** | Collateral | [optional] -**beforeCollateral** | **String** | The collateral amount before adjustment | [optional] -**afterCollateral** | **String** | The collateral amount after adjustment | [optional] -**beforeLtv** | **String** | The collateral ratio before adjustment | [optional] -**afterLtv** | **String** | The collateral ratio after adjustment | [optional] -**operateTime** | **Long** | Timestamp of the operation, in seconds | [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 efe2e20..2b2b400 100644 --- a/docs/Contract.md +++ b/docs/Contract.md @@ -8,40 +8,45 @@ Futures contract details 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] -**enableBonus** | **Boolean** | Whether bouns is enabled | [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 index e148bc8..cf945ef 100644 --- a/docs/CountdownCancelAllFuturesTask.md +++ b/docs/CountdownCancelAllFuturesTask.md @@ -1,12 +1,12 @@ # CountdownCancelAllFuturesTask -Countdown cancel task detail +Countdown cancel task details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timeout** | **Integer** | Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown | +**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 index 797d188..8b8ffc2 100644 --- a/docs/CountdownCancelAllSpotTask.md +++ b/docs/CountdownCancelAllSpotTask.md @@ -1,12 +1,12 @@ # CountdownCancelAllSpotTask -Countdown cancel task detail +Countdown cancel task details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timeout** | **Integer** | Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown | +**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 index f8aebc7..9d28efe 100644 --- a/docs/CreateCollateralOrder.md +++ b/docs/CreateCollateralOrder.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **collateralAmount** | **String** | Collateral amount | -**collateralCurrency** | **String** | Collateral | -**borrowAmount** | **String** | Borrowing 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 index f280986..af2ee4a 100644 --- a/docs/CreateUniLend.md +++ b/docs/CreateUniLend.md @@ -1,16 +1,16 @@ # CreateUniLend -Lend or redeem +Create lending or redemption ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency name | -**amount** | **String** | The amount of currency could be lent | -**type** | [**TypeEnum**](#TypeEnum) | type: lend - lend, redeem - redeem | -**minRate** | **String** | The minimum interest rate. If the value is too high, it might lead to the unsuccessful lending and no profit will be gained for that hour. | [optional] +**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 diff --git a/docs/CreateUniLoan.md b/docs/CreateUniLoan.md index 990887e..350308f 100644 --- a/docs/CreateUniLoan.md +++ b/docs/CreateUniLoan.md @@ -8,9 +8,9 @@ Borrow or repay Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency | -**type** | [**TypeEnum**](#TypeEnum) | type: borrow - borrow, repay - repay | -**amount** | **String** | The amount of lending or repaying | -**repaidAll** | **Boolean** | Full repayment. Repay operation only. If the value is `true`, the amount will be ignored and the loan will be repaid in full. | [optional] +**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 diff --git a/docs/CrossMarginAccount.md b/docs/CrossMarginAccount.md deleted file mode 100644 index 1ea0b0a..0000000 --- a/docs/CrossMarginAccount.md +++ /dev/null @@ -1,25 +0,0 @@ - -# CrossMarginAccount - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userId** | **Long** | User ID | [optional] -**refreshTime** | **Long** | Time of the most recent refresh | [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] -**totalInitialMargin** | **String** | Total initial margin | [optional] -**totalMarginBalance** | **String** | Total Margin Balance (∑(positive equity * index price * discount) + ∑(negative equity * index price)) | [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] -**portfolioMarginTotal** | **String** | Total amount of the portfolio margin account | [optional] -**portfolioMarginTotalLiab** | **String** | Total liabilities of the portfolio margin account | [optional] -**portfolioMarginTotalEquity** | **String** | Total equity of the portfolio margin account | [optional] - diff --git a/docs/CrossMarginAccountBook.md b/docs/CrossMarginAccountBook.md deleted file mode 100644 index de80b26..0000000 --- a/docs/CrossMarginAccountBook.md +++ /dev/null @@ -1,14 +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** | **String** | Account book type. Please refer to [account book type](#accountbook-type) for more detail | [optional] - diff --git a/docs/CrossMarginBalance.md b/docs/CrossMarginBalance.md index 84f02d6..347d99a 100644 --- a/docs/CrossMarginBalance.md +++ b/docs/CrossMarginBalance.md @@ -5,13 +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] -**negativeLiab** | **String** | Negative Liabilities. Formula:Min[available+total+unrealized_pnl,0] | [optional] -**futuresPosLiab** | **String** | Borrowing to Open Positions in Futures | [optional] -**equity** | **String** | Equity. Formula: available + freeze - borrowed + futures account's total + unrealized_pnl | [optional] -**totalFreeze** | **String** | Total freeze. Formula: freeze + position_initial_margin + order_margin | [optional] -**totalLiab** | **String** | Total liabilities. Formula: Max[Abs[Min[quity - total_freeze,0], borrowed]] - futures_pos_liab | [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/CrossMarginBalance1.md b/docs/CrossMarginBalance1.md deleted file mode 100644 index 0ba73d5..0000000 --- a/docs/CrossMarginBalance1.md +++ /dev/null @@ -1,12 +0,0 @@ - -# CrossMarginBalance1 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**available** | **String** | Available amount | [optional] -**freeze** | **String** | Locked amount | [optional] -**borrowed** | **String** | Borrowed amount | [optional] -**interest** | **String** | Unpaid interests | [optional] - diff --git a/docs/CrossMarginCurrency.md b/docs/CrossMarginCurrency.md deleted file mode 100644 index d740a29..0000000 --- a/docs/CrossMarginCurrency.md +++ /dev/null @@ -1,17 +0,0 @@ - -# CrossMarginCurrency - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Currency name | [optional] -**rate** | **String** | Minimum lending rate (hourly 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] -**status** | **Integer** | status - `0` : disable - `1` : enable | [optional] - diff --git a/docs/CrossMarginLoan.md b/docs/CrossMarginLoan.md index b9fe1d6..3572614 100644 --- a/docs/CrossMarginLoan.md +++ b/docs/CrossMarginLoan.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **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 5759bf6..04c92f9 100644 --- a/docs/CrossMarginRepayment.md +++ b/docs/CrossMarginRepayment.md @@ -11,5 +11,5 @@ Name | Type | Description | Notes **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, cancel_auto_repay - automatic repayment after cancellation | [optional] [readonly] +**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 041572a..0f1d258 100644 --- a/docs/Currency.md +++ b/docs/Currency.md @@ -5,12 +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** | Chain of currency | [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 index 8d55e4a..ff36e70 100644 --- a/docs/CurrencyChain.md +++ b/docs/CurrencyChain.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **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 | [optional] -**isWithdrawDisabled** | **Integer** | Is withdrawal disabled. 0 means not | [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 3b3873c..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 price-triggered order -[**cancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered 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 @@ -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 @@ -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) @@ -220,9 +221,9 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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) @@ -298,10 +299,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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<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,9 +350,9 @@ 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. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 + 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) .from(from) @@ -380,9 +381,9 @@ Name | Type | Description | Notes **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. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 | [optional] [default to 5m] [enum: 10s, 30s, 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 7d, 1w, 30d] + **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 @@ -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); @@ -454,7 +455,7 @@ Name | Type | Description | Notes ### 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) @@ -518,7 +519,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **String**| Settle currency | [enum: 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 @@ -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 @@ -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) @@ -664,10 +665,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **String**| Settle currency | [enum: 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] + **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 @@ -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 @@ -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); @@ -877,7 +878,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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 @@ -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-filled order cannot be retrieved 10 minutes after order 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) @@ -1104,12 +1105,12 @@ 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 | [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-filled order cannot be retrieved 10 minutes after order cancellation +Zero-fill orders cannot be retrieved 10 minutes after order cancellation ### Example @@ -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-filled order cannot be retrieved 10 minutes after order 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); @@ -1255,7 +1256,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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-filled order cannot be retrieved 10 minutes after order 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); @@ -1327,7 +1328,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 @@ -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); @@ -1397,7 +1398,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 @@ -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) @@ -1481,10 +1482,10 @@ Name | Type | Description | Notes **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) @@ -1559,7 +1560,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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) @@ -1636,8 +1637,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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) @@ -1714,8 +1715,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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 price-triggered 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 price-triggered 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/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/PortfolioApi.md b/docs/EarnApi.md similarity index 56% rename from docs/PortfolioApi.md rename to docs/EarnApi.md index 31e1a0a..78e2408 100644 --- a/docs/PortfolioApi.md +++ b/docs/EarnApi.md @@ -1,27 +1,26 @@ -# PortfolioApi +# EarnApi All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listPortfolioAccounts**](PortfolioApi.md#listPortfolioAccounts) | **GET** /portfolio/accounts | Get portfolio account information -[**listAccountPortfolioMode**](PortfolioApi.md#listAccountPortfolioMode) | **GET** /portfolio/account_mode | Retrieve the account's portfolio mode -[**setAccountPortfolioMode**](PortfolioApi.md#setAccountPortfolioMode) | **POST** /portfolio/account_mode | Configure the account's portfolio mode. -[**getPortfolioBorrowable**](PortfolioApi.md#getPortfolioBorrowable) | **GET** /portfolio/borrowable | Retrieve the maximum borrowable amount for the account. -[**getPortfolioTransferable**](PortfolioApi.md#getPortfolioTransferable) | **GET** /portfolio/transferable | Retrieve the maximum amount that can be transferred out from the account -[**listPortfolioUniLoanInterestRecords**](PortfolioApi.md#listPortfolioUniLoanInterestRecords) | **GET** /portfolio/loans | List loans -[**createPortfolioLoan**](PortfolioApi.md#createPortfolioLoan) | **POST** /portfolio/loans | Borrow or repay -[**listPortfolioLoanRecords**](PortfolioApi.md#listPortfolioLoanRecords) | **GET** /portfolio/loan_records | Get load records -[**listPortfolioLoanInterestRecords**](PortfolioApi.md#listPortfolioLoanInterestRecords) | **GET** /portfolio/interest_records | List interest records +[**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 - -# **listPortfolioAccounts** -> PortfolioAccount listPortfolioAccounts().currency(currency).execute(); + +# **swapETH2** +> swapETH2(eth2Swap) -Get portfolio 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. You can refer to the [Formula](#portfolio-account) in the documentation +ETH2 swap ### Example @@ -33,7 +32,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -43,18 +42,15 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + EarnApi apiInstance = new EarnApi(defaultClient); + Eth2Swap eth2Swap = new Eth2Swap(); // Eth2Swap | try { - PortfolioAccount result = apiInstance.listPortfolioAccounts() - .currency(currency) - .execute(); - System.out.println(result); + 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 PortfolioApi#listPortfolioAccounts"); + System.err.println("Exception when calling EarnApi#swapETH2"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -67,11 +63,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [optional] + **eth2Swap** | [**Eth2Swap**](Eth2Swap.md)| | ### Return type -[**PortfolioAccount**](PortfolioAccount.md) +null (empty response body) ### Authorization @@ -79,21 +75,21 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json + - **Content-Type**: application/json + - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | Swap successful | - | - -# **listAccountPortfolioMode** -> Map<String, Boolean> listAccountPortfolioMode() + +# **rateListETH2** +> List<Eth2RateList> rateListETH2() -Retrieve the account's portfolio mode +ETH2 historical return rate query -cross_margin - cross margin +Query ETH earnings rate records for the last 31 days ### Example @@ -105,7 +101,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -115,15 +111,15 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); + EarnApi apiInstance = new EarnApi(defaultClient); try { - Map result = apiInstance.listAccountPortfolioMode(); + 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 PortfolioApi#listAccountPortfolioMode"); + System.err.println("Exception when calling EarnApi#rateListETH2"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -137,7 +133,7 @@ This endpoint does not need any parameter. ### Return type -**Map<String, Boolean>** +[**List<Eth2RateList>**](Eth2RateList.md) ### Authorization @@ -153,11 +149,11 @@ This endpoint does not need any parameter. |-------------|-------------|------------------| **200** | Successfully retrieved | - | - -# **setAccountPortfolioMode** -> Map<String, Boolean> setAccountPortfolioMode(portfolioMode) + +# **listDualInvestmentPlans** +> List<DualGetPlans> listDualInvestmentPlans().planId(planId).execute(); -Configure the account's portfolio mode. +Dual Investment product list ### Example @@ -167,28 +163,26 @@ import io.gate.gateapi.ApiClient; import io.gate.gateapi.ApiException; import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; -import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +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"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - PortfolioMode portfolioMode = new PortfolioMode(); // PortfolioMode | + EarnApi apiInstance = new EarnApi(defaultClient); + Long planId = 1L; // Long | Financial project ID try { - Map result = apiInstance.setAccountPortfolioMode(portfolioMode); + 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 PortfolioApi#setAccountPortfolioMode"); + System.err.println("Exception when calling EarnApi#listDualInvestmentPlans"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -201,31 +195,31 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **portfolioMode** | [**PortfolioMode**](PortfolioMode.md)| | + **planId** | **Long**| Financial project ID | [optional] ### Return type -**Map<String, Boolean>** +[**List<DualGetPlans>**](DualGetPlans.md) ### Authorization -[apiv4](../README.md#apiv4) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Success | - | +**200** | Successfully retrieved | - | - -# **getPortfolioBorrowable** -> PortfolioBorrowable getPortfolioBorrowable(currency) + +# **listDualOrders** +> List<DualGetOrders> listDualOrders().from(from).to(to).page(page).limit(limit).execute(); -Retrieve the maximum borrowable amount for the account. +Dual Investment order list ### Example @@ -237,7 +231,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -247,16 +241,24 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + 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 { - PortfolioBorrowable result = apiInstance.getPortfolioBorrowable(currency); + 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 PortfolioApi#getPortfolioBorrowable"); + System.err.println("Exception when calling EarnApi#listDualOrders"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -269,11 +271,14 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | + **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 -[**PortfolioBorrowable**](PortfolioBorrowable.md) +[**List<DualGetOrders>**](DualGetOrders.md) ### Authorization @@ -289,11 +294,11 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | Successfully retrieved | - | - -# **getPortfolioTransferable** -> PortfolioTransferable getPortfolioTransferable(currency) + +# **placeDualOrder** +> placeDualOrder(placeDualInvestmentOrder) -Retrieve the maximum amount that can be transferred out from the account +Place Dual Investment order ### Example @@ -305,7 +310,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -315,16 +320,15 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + EarnApi apiInstance = new EarnApi(defaultClient); + PlaceDualInvestmentOrder placeDualInvestmentOrder = new PlaceDualInvestmentOrder(); // PlaceDualInvestmentOrder | try { - PortfolioTransferable result = apiInstance.getPortfolioTransferable(currency); - System.out.println(result); + 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 PortfolioApi#getPortfolioTransferable"); + System.err.println("Exception when calling EarnApi#placeDualOrder"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -337,16 +341,90 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | + **placeDualInvestmentOrder** | [**PlaceDualInvestmentOrder**](PlaceDualInvestmentOrder.md)| | ### Return type -[**PortfolioTransferable**](PortfolioTransferable.md) +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 @@ -357,11 +435,11 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | Successfully retrieved | - | - -# **listPortfolioUniLoanInterestRecords** -> List<UniLoan> listPortfolioUniLoanInterestRecords().currency(currency).page(page).limit(limit).execute(); + +# **listStructuredOrders** +> List<StructuredOrderList> listStructuredOrders().from(from).to(to).page(page).limit(limit).execute(); -List loans +Structured Product Order List ### Example @@ -373,7 +451,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -383,13 +461,15 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + 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 response items. Default: 100, minimum: 1, Maximum: 100 + Integer limit = 100; // Integer | Maximum number of records returned in a single list try { - List result = apiInstance.listPortfolioUniLoanInterestRecords() - .currency(currency) + List result = apiInstance.listStructuredOrders() + .from(from) + .to(to) .page(page) .limit(limit) .execute(); @@ -398,7 +478,7 @@ public class Example { System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage())); e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling PortfolioApi#listPortfolioUniLoanInterestRecords"); + System.err.println("Exception when calling EarnApi#listStructuredOrders"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -411,13 +491,14 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [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] **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100] ### Return type -[**List<UniLoan>**](UniLoan.md) +[**List<StructuredOrderList>**](StructuredOrderList.md) ### Authorization @@ -433,13 +514,11 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | Successfully retrieved | - | - -# **createPortfolioLoan** -> createPortfolioLoan(portfolioLoan) - -Borrow or repay + +# **placeStructuredOrder** +> placeStructuredOrder(structuredBuy) -When borrowing, it is essential to ensure that 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 the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` +Place Structured Product Order ### Example @@ -451,7 +530,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -461,15 +540,15 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - PortfolioLoan portfolioLoan = new PortfolioLoan(); // PortfolioLoan | + EarnApi apiInstance = new EarnApi(defaultClient); + StructuredBuy structuredBuy = new StructuredBuy(); // StructuredBuy | try { - apiInstance.createPortfolioLoan(portfolioLoan); + 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 PortfolioApi#createPortfolioLoan"); + System.err.println("Exception when calling EarnApi#placeStructuredOrder"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -482,7 +561,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **portfolioLoan** | [**PortfolioLoan**](PortfolioLoan.md)| | + **structuredBuy** | [**StructuredBuy**](StructuredBuy.md)| | ### Return type @@ -500,13 +579,13 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Operated successfully | - | +**200** | Order placed successfully | - | - -# **listPortfolioLoanRecords** -> List<PortfolioLoanRecord> listPortfolioLoanRecords().type(type).currency(currency).page(page).limit(limit).execute(); + +# **findCoin** +> Object findCoin(findCoin) -Get load records +Staking coins ### Example @@ -518,7 +597,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -528,24 +607,16 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - String type = "type_example"; // String | The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds - String currency = "BTC"; // String | Retrieve data of the specified currency - Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 + EarnApi apiInstance = new EarnApi(defaultClient); + FindCoin findCoin = new FindCoin(); // FindCoin | try { - List result = apiInstance.listPortfolioLoanRecords() - .type(type) - .currency(currency) - .page(page) - .limit(limit) - .execute(); + 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 PortfolioApi#listPortfolioLoanRecords"); + System.err.println("Exception when calling EarnApi#findCoin"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -558,14 +629,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type** | **String**| The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds | [optional] [enum: borrow, repay] - **currency** | **String**| Retrieve data of the specified currency | [optional] - **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + **findCoin** | [**FindCoin**](FindCoin.md)| | ### Return type -[**List<PortfolioLoanRecord>**](PortfolioLoanRecord.md) +**Object** ### Authorization @@ -573,7 +641,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -581,11 +649,11 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | Successfully retrieved | - | - -# **listPortfolioLoanInterestRecords** -> List<UniLoanInterestRecord> listPortfolioLoanInterestRecords().currency(currency).page(page).limit(limit).execute(); + +# **swapStakingCoin** +> SwapCoinStruct swapStakingCoin(swapCoin) -List interest records +On-chain token swap for earned coins ### Example @@ -597,7 +665,7 @@ import io.gate.gateapi.Configuration; import io.gate.gateapi.GateApiException; import io.gate.gateapi.auth.*; import io.gate.gateapi.models.*; -import io.gate.gateapi.api.PortfolioApi; +import io.gate.gateapi.api.EarnApi; public class Example { public static void main(String[] args) { @@ -607,22 +675,16 @@ public class Example { // Configure APIv4 authorization: apiv4 defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); - PortfolioApi apiInstance = new PortfolioApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency - Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 + EarnApi apiInstance = new EarnApi(defaultClient); + SwapCoin swapCoin = new SwapCoin(); // SwapCoin | try { - List result = apiInstance.listPortfolioLoanInterestRecords() - .currency(currency) - .page(page) - .limit(limit) - .execute(); + 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 PortfolioApi#listPortfolioLoanInterestRecords"); + System.err.println("Exception when calling EarnApi#swapStakingCoin"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -635,13 +697,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [optional] - **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + **swapCoin** | [**SwapCoin**](SwapCoin.md)| | ### Return type -[**List<UniLoanInterestRecord>**](UniLoanInterestRecord.md) +[**SwapCoinStruct**](SwapCoinStruct.md) ### Authorization @@ -649,11 +709,11 @@ 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** | Swap successful | - | diff --git a/docs/EarnUniApi.md b/docs/EarnUniApi.md index ebff715..769e34c 100644 --- a/docs/EarnUniApi.md +++ b/docs/EarnUniApi.md @@ -4,23 +4,24 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listUniCurrencies**](EarnUniApi.md#listUniCurrencies) | **GET** /earn/uni/currencies | List currencies for lending -[**getUniCurrency**](EarnUniApi.md#getUniCurrency) | **GET** /earn/uni/currencies/{currency} | Get currency detail for lending -[**listUserUniLends**](EarnUniApi.md#listUserUniLends) | **GET** /earn/uni/lends | List user's lending orders -[**createUniLend**](EarnUniApi.md#createUniLend) | **POST** /earn/uni/lends | Lend or redeem -[**changeUniLend**](EarnUniApi.md#changeUniLend) | **PATCH** /earn/uni/lends | Amend lending order -[**listUniLendRecords**](EarnUniApi.md#listUniLendRecords) | **GET** /earn/uni/lend_records | List records of lending -[**getUniInterest**](EarnUniApi.md#getUniInterest) | **GET** /earn/uni/interests/{currency} | Get the user's total interest income of specified currency -[**listUniInterestRecords**](EarnUniApi.md#listUniInterestRecords) | **GET** /earn/uni/interest_records | List interest records -[**switchInterestReinvest**](EarnUniApi.md#switchInterestReinvest) | **PUT** /earn/uni/interest_reinvest | Set interest reinvestment toggle -[**getUniInterestStatus**](EarnUniApi.md#getUniInterestStatus) | **GET** /earn/uni/interest_status/{currency} | query currency interest compounding status +[**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() -List currencies for lending +Query lending currency list ### Example @@ -74,13 +75,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getUniCurrency** > UniCurrency getUniCurrency(currency) -Get currency detail for lending +Query single lending currency details ### Example @@ -138,13 +139,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listUserUniLends** > List<UniLend> listUserUniLends().currency(currency).page(page).limit(limit).execute(); -List user's lending orders +Query user's lending order list ### Example @@ -167,9 +168,9 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); EarnUniApi apiInstance = new EarnUniApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + String currency = "BTC"; // String | Query by specified currency name Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 + Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 try { List result = apiInstance.listUserUniLends() .currency(currency) @@ -194,9 +195,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [optional] + **currency** | **String**| Query by specified currency name | [optional] **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] ### Return type @@ -214,15 +215,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **createUniLend** > createUniLend(createUniLend) -Lend or redeem +Create lending or redemption -`Lending`: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first `Redemption`: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour `Note`: Two minutes before and after the hour is the settlement time, lending and redemption are prohibited. +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 @@ -283,15 +284,15 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Operated successfully | - | +**204** | Operation successful | - | # **changeUniLend** > changeUniLend(patchUniLend) -Amend lending order +Amend user lending information -Currently only supports amending the minimum interest rate (hour) +Currently only supports amending minimum interest rate (hourly) ### Example @@ -352,13 +353,13 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Updated | - | +**204** | Updated successfully | - | # **listUniLendRecords** > List<UniLendRecord> listUniLendRecords().currency(currency).page(page).limit(limit).from(from).to(to).type(type).execute(); -List records of lending +Query lending transaction records ### Example @@ -381,12 +382,12 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); EarnUniApi apiInstance = new EarnUniApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + String currency = "BTC"; // String | Query by specified currency name Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 - Long from = 1547706332L; // Long | Start timestamp - Long to = 1547706332L; // Long | End timestamp - String type = "lend"; // String | type: lend - lend, redeem - redeem + 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) @@ -414,12 +415,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [optional] + **currency** | **String**| Query by specified currency name | [optional] **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] - **from** | **Long**| Start timestamp | [optional] - **to** | **Long**| End timestamp | [optional] - **type** | **String**| type: lend - lend, redeem - redeem | [optional] [enum: lend, redeem] + **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 @@ -437,13 +438,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getUniInterest** > UniLendInterest getUniInterest(currency) -Get the user's total interest income of specified currency +Query user's total interest income for specified currency ### Example @@ -505,13 +506,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listUniInterestRecords** -> List<UniInterestRecord> listUniInterestRecords().currency(currency).page(page).limit(limit).execute(); +> List<UniInterestRecord> listUniInterestRecords().currency(currency).page(page).limit(limit).from(from).to(to).execute(); -List interest records +Query user dividend records ### Example @@ -534,14 +535,18 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); EarnUniApi apiInstance = new EarnUniApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + String currency = "BTC"; // String | Query by specified currency name Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 + 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) { @@ -561,9 +566,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [optional] + **currency** | **String**| Query by specified currency name | [optional] **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + **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 @@ -581,13 +588,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | - -# **switchInterestReinvest** -> switchInterestReinvest(uniInterestMode) + +# **getUniInterestStatus** +> UniCurrencyInterest getUniInterestStatus(currency) -Set interest reinvestment toggle +Query currency interest compounding status ### Example @@ -610,14 +617,15 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); EarnUniApi apiInstance = new EarnUniApi(defaultClient); - UniInterestMode uniInterestMode = new UniInterestMode(); // UniInterestMode | + String currency = "btc"; // String | Currency try { - apiInstance.switchInterestReinvest(uniInterestMode); + 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#switchInterestReinvest"); + System.err.println("Exception when calling EarnUniApi#getUniInterestStatus"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -630,11 +638,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **uniInterestMode** | [**UniInterestMode**](UniInterestMode.md)| | + **currency** | **String**| Currency | ### Return type -null (empty response body) +[**UniCurrencyInterest**](UniCurrencyInterest.md) ### Authorization @@ -642,19 +650,21 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Success | - | +**200** | Query successful | - | - -# **getUniInterestStatus** -> UniCurrencyInterest getUniInterestStatus(currency) + +# **listUniChart** +> List<InlineResponse200> listUniChart(from, to, asset) -query currency interest compounding status +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 @@ -677,15 +687,17 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); EarnUniApi apiInstance = new EarnUniApi(defaultClient); - String currency = "btc"; // String | Currency + 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 { - UniCurrencyInterest result = apiInstance.getUniInterestStatus(currency); + 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#getUniInterestStatus"); + System.err.println("Exception when calling EarnUniApi#listUniChart"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -698,11 +710,79 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Currency | + **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 -[**UniCurrencyInterest**](UniCurrencyInterest.md) +[**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 @@ -716,5 +796,5 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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 index 4fc52cc..5cd0034 100644 --- a/docs/FlashSwapApi.md +++ b/docs/FlashSwapApi.md @@ -4,77 +4,16 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listFlashSwapCurrencies**](FlashSwapApi.md#listFlashSwapCurrencies) | **GET** /flash_swap/currencies | List All Supported Currencies In Flash Swap (deprecated) [**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 | List all flash swap orders +[**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} | Get a single flash swap order's detail -[**previewFlashSwapOrder**](FlashSwapApi.md#previewFlashSwapOrder) | **POST** /flash_swap/orders/preview | Initiate a flash swap order preview +[**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 - -# **listFlashSwapCurrencies** -> List<FlashSwapCurrency> listFlashSwapCurrencies() - -List All Supported Currencies In Flash Swap (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.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); - try { - List result = apiInstance.listFlashSwapCurrencies(); - System.out.println(result); - } catch (GateApiException e) { - System.err.println(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#listFlashSwapCurrencies"); - 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<FlashSwapCurrency>**](FlashSwapCurrency.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 | - | - # **listFlashSwapCurrencyPair** -> List<FlashSwapCurrencyPair> listFlashSwapCurrencyPair().currency(currency).execute(); +> List<FlashSwapCurrencyPair> listFlashSwapCurrencyPair().currency(currency).page(page).limit(limit).execute(); List All Supported Currency Pairs In Flash Swap @@ -97,10 +36,14 @@ public class Example { defaultClient.setBasePath("https://api.gateio.ws/api/v4"); FlashSwapApi apiInstance = new FlashSwapApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + 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) { @@ -120,7 +63,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [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: 1000, minimum: 1, maximum: 1000 | [optional] [default to 1000] ### Return type @@ -138,13 +83,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listFlashSwapOrders** > List<FlashSwapOrder> listFlashSwapOrders().status(status).sellCurrency(sellCurrency).buyCurrency(buyCurrency).reverse(reverse).limit(limit).page(page).execute(); -List all flash swap orders +Query flash swap order list ### Example @@ -167,11 +112,11 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); FlashSwapApi apiInstance = new FlashSwapApi(defaultClient); - Integer status = 1; // Integer | Flash swap order status `1` - success `2` - failure - String sellCurrency = "BTC"; // String | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` - String buyCurrency = "BTC"; // String | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` - Boolean reverse = true; // Boolean | If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) - Integer limit = 100; // Integer | Maximum number of records to be returned in a single list + 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() @@ -200,11 +145,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | **Integer**| Flash swap order status `1` - success `2` - failure | [optional] - **sellCurrency** | **String**| Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] - **buyCurrency** | **String**| Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] - **reverse** | **Boolean**| If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) | [optional] - **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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 @@ -223,7 +168,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **createFlashSwapOrder** @@ -293,13 +238,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | The flash swap order is created successfully | - | +**201** | Flash swap order created successfully | - | # **getFlashSwapOrder** > FlashSwapOrder getFlashSwapOrder(orderId) -Get a single flash swap order's detail +Query single flash swap order ### Example @@ -361,13 +306,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **previewFlashSwapOrder** > FlashSwapOrderPreview previewFlashSwapOrder(flashSwapPreviewRequest) -Initiate a flash swap order preview +Flash swap order preview ### Example @@ -429,5 +374,5 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The flash swap order successfully previewed | - | +**200** | Flash swap order preview successful | - | diff --git a/docs/FlashSwapCurrency.md b/docs/FlashSwapCurrency.md deleted file mode 100644 index 4543d04..0000000 --- a/docs/FlashSwapCurrency.md +++ /dev/null @@ -1,14 +0,0 @@ - -# FlashSwapCurrency - -Currencies supported in flash swap - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency** | **String** | Currency name | [optional] [readonly] -**minAmount** | **String** | Minimum amount required in flash swap | [optional] [readonly] -**maxAmount** | **String** | Maximum amount allowed in flash swap | [optional] [readonly] -**swappable** | **List<String>** | Currencies which can be swapped to from this currency | [optional] [readonly] - diff --git a/docs/FlashSwapCurrencyPair.md b/docs/FlashSwapCurrencyPair.md index 79406b1..2ad2f0a 100644 --- a/docs/FlashSwapCurrencyPair.md +++ b/docs/FlashSwapCurrencyPair.md @@ -7,11 +7,11 @@ List all supported currencies in flash swap Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**currencyPair** | **String** | The currency pair, BTC_USDT represents selling Bitcoin (BTC) and buying Tether (USDT). | [optional] [readonly] -**sellCurrency** | **String** | The currency to be sold | [optional] [readonly] -**buyCurrency** | **String** | The currency to be bought | [optional] [readonly] -**sellMinAmount** | **String** | The minimum quantity required for selling | [optional] [readonly] -**sellMaxAmount** | **String** | The maximum quantity allowed for selling | [optional] [readonly] -**buyMinAmount** | **String** | The minimum quantity required for buying | [optional] [readonly] -**buyMaxAmount** | **String** | The maximum quantity allowed for buying | [optional] [readonly] +**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/FlashSwapOrderPreview.md b/docs/FlashSwapOrderPreview.md index bba0595..b25622d 100644 --- a/docs/FlashSwapOrderPreview.md +++ b/docs/FlashSwapOrderPreview.md @@ -1,16 +1,16 @@ # FlashSwapOrderPreview -Initiate a flash swap order preview +Flash swap order preview ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **previewId** | **String** | Preview result ID | [optional] -**sellCurrency** | **String** | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [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** | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [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 index 43ddd0f..100b504 100644 --- a/docs/FlashSwapOrderRequest.md +++ b/docs/FlashSwapOrderRequest.md @@ -8,8 +8,8 @@ Parameters of flash swap order creation Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **previewId** | **String** | Preview result ID | -**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. | +**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** | 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. | +**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 index 1fec8a3..0819b9c 100644 --- a/docs/FlashSwapPreviewRequest.md +++ b/docs/FlashSwapPreviewRequest.md @@ -7,8 +7,8 @@ Parameters of flash swap order creation 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. | +**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. | +**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 7a9e27d..0000000 --- a/docs/FundingBookItem.md +++ /dev/null @@ -1,11 +0,0 @@ - -# FundingBookItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**rate** | **String** | Loan rate (daily 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 3c413b1..0ff4e6d 100644 --- a/docs/FuturesAccount.md +++ b/docs/FuturesAccount.md @@ -9,13 +9,27 @@ Name | Type | Description | Notes **unrealisedPnl** | **String** | Unrealized PNL | [optional] **positionMargin** | **String** | Position margin | [optional] **orderMargin** | **String** | Order margin of unfinished orders | [optional] -**available** | **String** | The available balance for transferring or trading(including bonus. Bonus can't be be withdrawn. The transfer amount needs to deduct the bonus) | [optional] -**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 position, applicable to the portfolio margin account model | [optional] -**maintenanceMargin** | **String** | Maintenance margin position, applicable to the portfolio margin account model | [optional] -**bonus** | **String** | Perpetual Contract Bonus | [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/FuturesApi.md b/docs/FuturesApi.md index 866d63f..3495c30 100644 --- a/docs/FuturesApi.md +++ b/docs/FuturesApi.md @@ -4,57 +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 -[**listFuturesPremiumIndex**](FuturesApi.md#listFuturesPremiumIndex) | **GET** /futures/{settle}/premium_index | Premium Index K-Line -[**listFuturesTickers**](FuturesApi.md#listFuturesTickers) | **GET** /futures/{settle}/tickers | List futures tickers -[**listFuturesFundingRateHistory**](FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Funding rate history -[**listFuturesInsuranceLedger**](FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures insurance balance history -[**listContractStats**](FuturesApi.md#listContractStats) | **GET** /futures/{settle}/contract_stats | Futures stats -[**getIndexConstituents**](FuturesApi.md#getIndexConstituents) | **GET** /futures/{settle}/index_constituents/{index} | Get index constituents -[**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 -[**getOrdersWithTimeRange**](FuturesApi.md#getOrdersWithTimeRange) | **GET** /futures/{settle}/orders_timerange | List Futures Orders By Time Range -[**createBatchFuturesOrder**](FuturesApi.md#createBatchFuturesOrder) | **POST** /futures/{settle}/batch_orders | Create a batch of futures orders -[**getFuturesOrder**](FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order -[**amendFuturesOrder**](FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order -[**cancelFuturesOrder**](FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order -[**getMyTrades**](FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | List personal trading history -[**getMyTradesWithTimeRange**](FuturesApi.md#getMyTradesWithTimeRange) | **GET** /futures/{settle}/my_trades_timerange | List personal trading history by time range -[**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history -[**listLiquidates**](FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | List liquidation history -[**listAutoDeleverages**](FuturesApi.md#listAutoDeleverages) | **GET** /futures/{settle}/auto_deleverages | List Auto-Deleveraging History +[**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 user trading fee rates -[**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 price-triggered order -[**cancelPriceTriggeredOrder**](FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order +[**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 @@ -74,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())); @@ -94,7 +105,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 @@ -112,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 @@ -159,7 +172,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **contract** | **String**| Futures contract | ### Return type @@ -184,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 @@ -207,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) @@ -234,11 +247,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 @@ -256,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).offset(offset).lastId(lastId).from(from).to(to).execute(); -Futures trading history +Futures market transaction records ### Example @@ -283,11 +296,11 @@ 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) @@ -314,13 +327,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 @@ -338,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` @@ -368,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. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0. Note that 30d means 1 natual month, not 30 days + 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) { @@ -396,12 +411,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0. Note that 30d means 1 natual month, not 30 days | [optional] [default to 5m] [enum: 10s, 30s, 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 7d, 1w, 30d] + **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 @@ -419,13 +435,13 @@ 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 +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 @@ -449,9 +465,9 @@ 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 | Time interval between data points try { List result = apiInstance.listFuturesPremiumIndex(settle, contract) .from(from) @@ -477,12 +493,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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: 1m, 5m, 15m, 30m, 1h, 4h, 6h, 8h, 1d, 7d, 30d] + **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 @@ -500,13 +516,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listFuturesTickers** > List<FuturesTicker> listFuturesTickers(settle).contract(contract).execute(); -List futures tickers +Get all futures trading statistics ### Example @@ -549,7 +565,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **contract** | **String**| Futures contract, return related data only if specified | [optional] ### Return type @@ -568,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 @@ -595,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) { @@ -618,9 +638,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 @@ -638,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 @@ -664,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) @@ -687,8 +709,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **settle** | **String**| Settle currency | [enum: btc, usdt] + **limit** | **Integer**| Maximum number of records returned in a single list | [optional] [default to 100] ### Return type @@ -706,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 @@ -734,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) @@ -760,10 +782,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 @@ -782,13 +804,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **getIndexConstituents** > FuturesIndexConstituents getIndexConstituents(settle, index) -Get index constituents +Query index constituents ### Example @@ -829,7 +851,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **index** | **String**| Index name | ### Return type @@ -848,15 +870,15 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listLiquidatedOrders** > List<FuturesLiqOrder> listLiquidatedOrders(settle).contract(contract).from(from).to(to).limit(limit).execute(); -Retrieve liquidation history +Query liquidation order 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. +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 @@ -877,9 +899,9 @@ 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 + 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 { List result = apiInstance.listLiquidatedOrders(settle) .contract(contract) @@ -905,11 +927,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **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 @@ -927,13 +949,89 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | + + +# **listFuturesRiskLimitTiers** +> List<FuturesLimitRiskTiers> listFuturesRiskLimitTiers(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.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, 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.listFuturesRiskLimitTiers(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 FuturesApi#listFuturesRiskLimitTiers"); + 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] + **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 | - | # **listFuturesAccounts** > FuturesAccount listFuturesAccounts(settle) -Query futures account +Get futures account ### Example @@ -977,7 +1075,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] ### Return type @@ -995,13 +1093,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | Query successful | - | # **listFuturesAccountBook** -> List<FuturesAccountBook> listFuturesAccountBook(settle).limit(limit).from(from).to(to).type(type).execute(); +> List<FuturesAccountBook> listFuturesAccountBook(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).type(type).execute(); + +Query futures account change history -Query account book +If the contract field is passed, only records containing this field after 2023-10-30 can be filtered. ### Example @@ -1025,13 +1125,17 @@ 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 - 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 + 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 { List result = apiInstance.listFuturesAccountBook(settle) + .contract(contract) .limit(limit) + .offset(offset) .from(from) .to(to) .type(type) @@ -1054,11 +1158,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **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: btc, usdt] + **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 @@ -1076,13 +1182,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listPositions** -> List<Position> listPositions(settle).holding(holding).execute(); +> List<Position> listPositions(settle).holding(holding).limit(limit).offset(offset).execute(); -List all positions of a user +Get user position list ### Example @@ -1106,10 +1212,14 @@ public class Example { FuturesApi apiInstance = new FuturesApi(defaultClient); String settle = "usdt"; // String | Settle currency - Boolean holding = true; // Boolean | Return only real positions - true, return all - false. + 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 { List result = apiInstance.listPositions(settle) .holding(holding) + .limit(limit) + .offset(offset) .execute(); System.out.println(result); } catch (GateApiException e) { @@ -1129,8 +1239,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **holding** | **Boolean**| Return only real positions - true, return all - false. | [optional] + **settle** | **String**| Settle currency | [enum: btc, usdt] + **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 @@ -1148,13 +1260,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **getPosition** -> Position getPosition(settle, contract) +> Position getPosition(settle, contract).execute(); -Get single position +Get single position information ### Example @@ -1180,7 +1292,8 @@ public class Example { String settle = "usdt"; // String | Settle currency String contract = "BTC_USDT"; // String | Futures contract try { - Position result = apiInstance.getPosition(settle, contract); + 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())); @@ -1199,7 +1312,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **contract** | **String**| Futures contract | ### Return type @@ -1249,7 +1362,7 @@ 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 change = "0.01"; // String | Margin change amount, positive number increases, negative number decreases try { Position result = apiInstance.updatePositionMargin(settle, contract, change); System.out.println(result); @@ -1270,9 +1383,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, 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 @@ -1294,7 +1407,7 @@ Name | Type | Description | Notes # **updatePositionLeverage** -> Position updatePositionLeverage(settle, contract, leverage, crossLeverageLimit) +> Position updatePositionLeverage(settle, contract, leverage, crossLeverageLimit, pid) Update position leverage @@ -1322,9 +1435,10 @@ 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) + String crossLeverageLimit = "10"; // String | Cross margin leverage (valid only when `leverage` is 0) + Integer pid = 1; // Integer | Product ID try { - Position result = apiInstance.updatePositionLeverage(settle, contract, leverage, crossLeverageLimit); + 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())); @@ -1343,10 +1457,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **crossLeverageLimit** | **String**| Cross margin leverage (valid only when `leverage` is 0) | [optional] + **pid** | **Integer**| Product ID | [optional] ### Return type @@ -1366,6 +1481,146 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | Position information | - | + +# **updatePositionCrossMode** +> Position updatePositionCrossMode(settle, futuresPositionCrossMode) + +Switch Position 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.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 + FuturesPositionCrossMode futuresPositionCrossMode = new FuturesPositionCrossMode(); // FuturesPositionCrossMode | + try { + 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#updatePositionCrossMode"); + 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] + **futuresPositionCrossMode** | [**FuturesPositionCrossMode**](FuturesPositionCrossMode.md)| | + +### Return type + +[**Position**](Position.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** | Position information | - | + + +# **updateDualCompPositionCrossMode** +> List<Position> updateDualCompPositionCrossMode(settle, inlineObject) + +Switch Between Cross and Isolated Margin Modes Under Hedge 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 + InlineObject inlineObject = new InlineObject(); // InlineObject | + try { + 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#updateDualCompPositionCrossMode"); + 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] + **inlineObject** | [**InlineObject**](InlineObject.md)| | + +### Return type + +[**List<Position>**](Position.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** | Query successful | - | + # **updatePositionRiskLimit** > Position updatePositionRiskLimit(settle, contract, riskLimit) @@ -1395,7 +1650,7 @@ 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 riskLimit = "1000000"; // String | New risk limit value try { Position result = apiInstance.updatePositionRiskLimit(settle, contract, riskLimit); System.out.println(result); @@ -1416,9 +1671,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **contract** | **String**| Futures contract | - **riskLimit** | **String**| New position risk limit | + **riskLimit** | **String**| New risk limit value | ### Return type @@ -1442,9 +1697,9 @@ Name | Type | Description | Notes # **setDualMode** > FuturesAccount setDualMode(settle, dualMode) -Enable or disable dual mode +Set position mode -Before setting dual mode, make sure all positions are closed and no orders are open +The prerequisite for changing mode is that all positions have no holdings and no pending orders ### Example @@ -1489,7 +1744,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **dualMode** | **Boolean**| Whether to enable dual mode | ### Return type @@ -1508,13 +1763,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Updated | - | +**200** | Updated successfully | - | # **getDualModePosition** -> List<Position> getDualModePosition(settle, contract) +> List<Position> getDualModePosition(settle, contract).execute(); -Retrieve position detail in dual mode +Get position information in dual mode ### Example @@ -1540,7 +1795,8 @@ public class Example { String settle = "usdt"; // String | Settle currency String contract = "BTC_USDT"; // String | Futures contract try { - List result = apiInstance.getDualModePosition(settle, contract); + 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())); @@ -1559,7 +1815,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **contract** | **String**| Futures contract | ### Return type @@ -1578,7 +1834,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **updateDualModePositionMargin** @@ -1609,7 +1865,7 @@ 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 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); @@ -1631,10 +1887,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **change** | **String**| Margin change amount, positive number increases, negative number decreases | + **dualSide** | **String**| Long or short position | ### Return type @@ -1652,7 +1908,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **updateDualModePositionLeverage** @@ -1684,7 +1940,7 @@ 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) + 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); @@ -1705,10 +1961,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **crossLeverageLimit** | **String**| Cross margin leverage (valid only when `leverage` is 0) | [optional] ### Return type @@ -1726,7 +1982,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **updateDualModePositionRiskLimit** @@ -1757,7 +2013,7 @@ 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 riskLimit = "1000000"; // String | New risk limit value try { List result = apiInstance.updateDualModePositionRiskLimit(settle, contract, riskLimit); System.out.println(result); @@ -1778,9 +2034,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **contract** | **String**| Futures contract | - **riskLimit** | **String**| New position risk limit | + **riskLimit** | **String**| New risk limit value | ### Return type @@ -1798,15 +2054,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listFuturesOrders** > List<FuturesOrder> listFuturesOrders(settle, status).contract(contract).limit(limit).offset(offset).lastId(lastId).execute(); -List futures orders +Query futures order list -Zero-filled order cannot be retrieved 10 minutes after order cancellation +- 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 @@ -1830,11 +2086,11 @@ public class Example { FuturesApi apiInstance = new FuturesApi(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"; // 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 - String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results + 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) @@ -1860,12 +2116,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **status** | **String**| Only list the orders with this status | [enum: open, finished] + **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 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] + **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 @@ -1883,15 +2139,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
| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| # **createFuturesOrder** -> FuturesOrder createFuturesOrder(settle, futuresOrder) +> FuturesOrder createFuturesOrder(settle, futuresOrder, xGateExptime) -Create a futures order +Place futures order -- Creating futures orders requires `size`, which is number of contracts instead of currency amount. You can use `quanto_multiplier` in contract detail response to know how much currency 1 size contract represents - Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders - Set `reduce_only` to `true` can keep the position from changing side when reducing position size - In single position mode, to close a position, you need to set `size` to 0 and `close` to `true` - In dual position mode, to close one side position, you need to set `auto_size` side, `reduce_only` to true and `size` to 0 - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body +- 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 @@ -1916,8 +2172,9 @@ public class Example { 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); + 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())); @@ -1936,8 +2193,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 @@ -1959,11 +2217,11 @@ Name | Type | Description | Notes # **cancelFuturesOrders** -> List<FuturesOrder> cancelFuturesOrders(settle, contract, side) +> List<FuturesOrder> cancelFuturesOrders(settle, contract, xGateExptime, side, excludeReduceOnly, text) -Cancel all `open` orders matched +Cancel all orders with 'open' status -Zero-filled order cannot be retrieved 10 minutes after order cancellation +Zero-fill orders cannot be retrieved 10 minutes after order cancellation ### Example @@ -1988,9 +2246,12 @@ 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 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, side); + 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())); @@ -2009,9 +2270,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **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 @@ -2029,13 +2293,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | All orders matched cancelled | - | +**200** | Batch cancellation successful | - | # **getOrdersWithTimeRange** > List<FuturesOrder> getOrdersWithTimeRange(settle).contract(contract).from(from).to(to).limit(limit).offset(offset).execute(); -List Futures Orders By Time Range +Query futures order list by time range ### Example @@ -2060,9 +2324,9 @@ 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 + 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) @@ -2090,11 +2354,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **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 @@ -2113,13 +2377,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
| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| # **createBatchFuturesOrder** -> List<BatchFuturesOrder> createBatchFuturesOrder(settle, futuresOrder) +> List<BatchFuturesOrder> createBatchFuturesOrder(settle, futuresOrder, xGateExptime) -Create a batch of futures orders +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 @@ -2146,8 +2410,9 @@ public class Example { 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); + 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())); @@ -2166,8 +2431,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 @@ -2185,15 +2451,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Request is completed | - | +**200** | Request execution completed | - | # **getFuturesOrder** > FuturesOrder getFuturesOrder(settle, orderId) -Get a single order +Query single order details -Zero-filled order cannot be retrieved 10 minutes after order cancellation +- 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 @@ -2217,7 +2483,7 @@ 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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. + 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); @@ -2238,8 +2504,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **orderId** | **String**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | + **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 @@ -2261,9 +2527,9 @@ Name | Type | Description | Notes # **amendFuturesOrder** -> FuturesOrder amendFuturesOrder(settle, orderId, futuresOrderAmendment) +> FuturesOrder amendFuturesOrder(settle, orderId, futuresOrderAmendment, xGateExptime) -Amend an order +Amend single order ### Example @@ -2287,10 +2553,11 @@ 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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. + 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); + 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())); @@ -2309,9 +2576,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **orderId** | **String**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | + **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 @@ -2333,9 +2601,9 @@ Name | Type | Description | Notes # **cancelFuturesOrder** -> FuturesOrder cancelFuturesOrder(settle, orderId) +> FuturesOrder cancelFuturesOrder(settle, orderId, xGateExptime) -Cancel a single order +Cancel single order ### Example @@ -2359,9 +2627,10 @@ 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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. + 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 { - FuturesOrder result = apiInstance.cancelFuturesOrder(settle, orderId); + 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())); @@ -2380,8 +2649,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **orderId** | **String**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | + **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. | + **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 @@ -2405,7 +2675,9 @@ Name | Type | Description | Notes # **getMyTrades** > List<MyFuturesTrade> getMyTrades(settle).contract(contract).order(order).limit(limit).offset(offset).lastId(lastId).execute(); -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`. ### Example @@ -2431,7 +2703,7 @@ public class Example { 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 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 { @@ -2460,10 +2732,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **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] @@ -2483,13 +2755,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
| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| # **getMyTradesWithTimeRange** > List<MyFuturesTradeTimeRange> getMyTradesWithTimeRange(settle).contract(contract).from(from).to(to).limit(limit).offset(offset).role(role).execute(); -List personal trading history by time range +Query personal trading records by time range ### Example @@ -2514,11 +2786,11 @@ 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 + 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 role = "maker"; // String | Query role, maker or taker. + String role = "maker"; // String | Query role, maker or taker try { List result = apiInstance.getMyTradesWithTimeRange(settle) .contract(contract) @@ -2546,13 +2818,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **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] - **role** | **String**| Query role, maker or taker. | [optional] + **role** | **String**| Query role, maker or taker | [optional] ### Return type @@ -2570,13 +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
| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| # **listPositionClose** > List<PositionClose> listPositionClose(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).side(side).pnl(pnl).execute(); -List position close history +Query position close history ### Example @@ -2601,11 +2873,11 @@ 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 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 - Long to = 1547706332L; // Long | End timestamp - String side = "short"; // String | Query side. long or shot + 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 { List result = apiInstance.listPositionClose(settle) @@ -2635,13 +2907,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **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 | [optional] - **to** | **Long**| End timestamp | [optional] - **side** | **String**| Query side. long or shot | [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] + **side** | **String**| Query side. long or shot | [optional] **pnl** | **String**| Query profit or loss | [optional] ### Return type @@ -2660,13 +2932,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listLiquidates** -> List<FuturesLiquidate> listLiquidates(settle).contract(contract).limit(limit).at(at).execute(); +> List<FuturesLiquidate> listLiquidates(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).at(at).execute(); -List liquidation history +Query liquidation history ### Example @@ -2691,12 +2963,18 @@ 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 + 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.listLiquidates(settle) .contract(contract) .limit(limit) + .offset(offset) + .from(from) + .to(to) .at(at) .execute(); System.out.println(result); @@ -2717,10 +2995,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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] + **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 @@ -2738,13 +3019,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listAutoDeleverages** -> List<FuturesAutoDeleverage> listAutoDeleverages(settle).contract(contract).limit(limit).at(at).execute(); +> List<FuturesAutoDeleverage> listAutoDeleverages(settle).contract(contract).limit(limit).offset(offset).from(from).to(to).at(at).execute(); -List Auto-Deleveraging History +Query ADL auto-deleveraging order information ### Example @@ -2769,12 +3050,18 @@ 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 an auto-deleveraging timestamp + 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 { List result = apiInstance.listAutoDeleverages(settle) .contract(contract) .limit(limit) + .offset(offset) + .from(from) + .to(to) .at(at) .execute(); System.out.println(result); @@ -2795,10 +3082,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **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 an auto-deleveraging timestamp | [optional] [default to 0] + **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 @@ -2816,7 +3106,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **countdownCancelAllFutures** @@ -2824,7 +3114,7 @@ Name | Type | Description | Notes Countdown cancel orders -When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. +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 @@ -2869,7 +3159,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **countdownCancelAllFuturesTask** | [**CountdownCancelAllFuturesTask**](CountdownCancelAllFuturesTask.md)| | ### Return type @@ -2888,13 +3178,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Set countdown successfully | - | +**200** | Countdown set successfully | - | # **getFuturesFee** > Map<String, FuturesFee> getFuturesFee(settle).contract(contract).execute(); -Query user trading fee rates +Query futures market trading fee rates ### Example @@ -2941,7 +3231,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **contract** | **String**| Futures contract, return related data only if specified | [optional] ### Return type @@ -2960,13 +3250,229 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | + + +# **cancelBatchFutureOrders** +> List<FutureCancelOrderResult> cancelBatchFutureOrders(settle, requestBody, xGateExptime) + +Cancel batch orders by specified ID list + +Multiple different order IDs can be specified, maximum 20 records per request + +### Example + +```java +// Import classes: +import io.gate.gateapi.ApiClient; +import io.gate.gateapi.ApiException; +import 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 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.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#cancelBatchFutureOrders"); + 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] + **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<FutureCancelOrderResult>**](FutureCancelOrderResult.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 cancellation operation completed | - | + + +# **amendBatchFutureOrders** +> List<BatchFuturesOrder> amendBatchFutureOrders(settle, batchAmendOrderReq, xGateExptime) + +Batch modify orders by specified IDs + +Multiple different order IDs can be specified, maximum 10 orders per request + +### Example + +```java +// Import classes: +import io.gate.gateapi.ApiClient; +import io.gate.gateapi.ApiException; +import 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 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.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#amendBatchFutureOrders"); + 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] + **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<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 + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**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 @@ -2990,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) @@ -3018,10 +3524,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **status** | **String**| Only list the orders with this status | [enum: open, finished] + **settle** | **String**| Settle currency | [enum: btc, usdt] + **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 @@ -3040,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 @@ -3091,7 +3597,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] + **settle** | **String**| Settle currency | [enum: btc, usdt] **futuresPriceTriggeredOrder** | [**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md)| | ### Return type @@ -3110,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 @@ -3140,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); @@ -3161,8 +3667,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **contract** | **String**| Futures contract | + **settle** | **String**| Settle currency | [enum: btc, usdt] + **contract** | **String**| Futures contract, return related data only if specified | [optional] ### Return type @@ -3180,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 price-triggered order +Query single auto order details ### Example @@ -3210,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); @@ -3231,8 +3737,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **orderId** | **String**| Retrieve the data of the order with the specified ID | + **settle** | **String**| Settle currency | [enum: btc, usdt] + **orderId** | **String**| ID returned when order is successfully created | ### Return type @@ -3250,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 price-triggered order +Cancel single auto order ### Example @@ -3280,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); @@ -3301,8 +3807,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **settle** | **String**| Settle currency | [enum: btc, usdt, usd] - **orderId** | **String**| Retrieve the data of the order with the specified ID | + **settle** | **String**| Settle currency | [enum: btc, usdt] + **orderId** | **String**| ID returned when order is successfully created | ### Return type @@ -3320,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 index a094eef..30e8f27 100644 --- a/docs/FuturesAutoDeleverage.md +++ b/docs/FuturesAutoDeleverage.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **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] +**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] 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/FuturesFee.md b/docs/FuturesFee.md index a6756bf..c3b9cbd 100644 --- a/docs/FuturesFee.md +++ b/docs/FuturesFee.md @@ -1,7 +1,7 @@ # FuturesFee -The returned result is a map type, where the key represents the market and the value represents the taker and maker fee rates. +The returned result is a map type, where the key represents the market and taker and maker fee rates ## Properties diff --git a/docs/FuturesInitialOrder.md b/docs/FuturesInitialOrder.md index 669a2be..3c1f79d 100644 --- a/docs/FuturesInitialOrder.md +++ b/docs/FuturesInitialOrder.md @@ -6,13 +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] -**autoSize** | **String** | Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 | [optional] +**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 index 4b64cb3..5b681bd 100644 --- a/docs/FuturesLiqOrder.md +++ b/docs/FuturesLiqOrder.md @@ -8,6 +8,7 @@ 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 d215c48..7c451b2 100644 --- a/docs/FuturesOrder.md +++ b/docs/FuturesOrder.md @@ -10,29 +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 - stp: cancelled because self trade prevention | [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, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [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] +**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 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled | [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] **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 diff --git a/docs/FuturesOrderAmendment.md b/docs/FuturesOrderAmendment.md index 6d70ff5..8fb2998 100644 --- a/docs/FuturesOrderAmendment.md +++ b/docs/FuturesOrderAmendment.md @@ -6,6 +6,7 @@ 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 amending order | [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/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 index 759ceb9..3ba1a47 100644 --- a/docs/FuturesPremiumIndex.md +++ b/docs/FuturesPremiumIndex.md @@ -10,6 +10,6 @@ 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] +**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 0fcf4ff..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,14 +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) | Auto order status - `open`: order is active - `finished`: order is finished - `inactive`: order is not active, only for close-long-order or close-short-order - `invalid`: order is invalid, only for close-long-order or close-short-order | [optional] [readonly] -**finishAs** | [**FinishAsEnum**](#FinishAsEnum) | How order is finished | [optional] [readonly] -**reason** | **String** | Additional remarks on how the order was finished | [optional] [readonly] -**orderType** | **String** | Take-profit/stop-loss types, which include: - `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, close long position - `close-short-position`: position take-profit/stop-loss, close short position - `plan-close-long-position`: position planned take-profit/stop-loss, close long position - `plan-close-short-position`: position planned take-profit/stop-loss, close short position The order take-profit/stop-loss can not be passed by request. These two types are read only. | [optional] -**meOrderId** | **String** | Corresponding order ID of order take-profit/stop-loss. | [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 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 09e7f56..0a0bab6 100644 --- a/docs/FuturesTicker.md +++ b/docs/FuturesTicker.md @@ -7,23 +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] -**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] +**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 94b908d..01c91f6 100644 --- a/docs/FuturesTrade.md +++ b/docs/FuturesTrade.md @@ -5,11 +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 (quote currency) | [optional] -**isInternal** | **Boolean** | Whether 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 transaction price may deviate, and it will not be recorded in the K-line. If it is not an internal trade, this field will not be returned. | [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/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 5643a06..9625498 100644 --- a/docs/LedgerRecord.md +++ b/docs/LedgerRecord.md @@ -7,30 +7,14 @@ 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] +**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 - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount | [optional] [readonly] +**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 | -## Enum: StatusEnum - -Name | Value ----- | ----- -DONE | "DONE" -CANCEL | "CANCEL" -REQUEST | "REQUEST" -MANUAL | "MANUAL" -BCODE | "BCODE" -EXTPEND | "EXTPEND" -FAIL | "FAIL" -INVALID | "INVALID" -VERIFY | "VERIFY" -PROCES | "PROCES" -PEND | "PEND" -DMOVE | "DMOVE" -SPLITPEND | "SPLITPEND" - diff --git a/docs/LiquidateOrder.md b/docs/LiquidateOrder.md index 3e9e9a3..cd32ef4 100644 --- a/docs/LiquidateOrder.md +++ b/docs/LiquidateOrder.md @@ -1,14 +1,15 @@ # LiquidateOrder -Liquidate Order detail +Spot liquidation order details ## Properties 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] +**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 de5d402..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.0001, 0.01] 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 57291ac..094301c 100644 --- a/docs/MarginAccountBook.md +++ b/docs/MarginAccountBook.md @@ -6,11 +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] +**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 f1de43b..2dc7496 100644 --- a/docs/MarginApi.md +++ b/docs/MarginApi.md @@ -5,39 +5,17 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**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 -[**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 -[**listMarginCurrencyPairs**](MarginApi.md#listMarginCurrencyPairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading(Deprecated) -[**getMarginCurrencyPair**](MarginApi.md#getMarginCurrencyPair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair(Deprecated) -[**listFundingBook**](MarginApi.md#listFundingBook) | **GET** /margin/funding_book | Order book of lending loans(Deprecated) -[**listLoans**](MarginApi.md#listLoans) | **GET** /margin/loans | List all loans(Deprecated) -[**createLoan**](MarginApi.md#createLoan) | **POST** /margin/loans | Lend or borrow(Deprecated) -[**mergeLoans**](MarginApi.md#mergeLoans) | **POST** /margin/merged_loans | Merge multiple lending loans(Deprecated) -[**getLoan**](MarginApi.md#getLoan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail(Deprecated) -[**cancelLoan**](MarginApi.md#cancelLoan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan(Deprecated) -[**updateLoan**](MarginApi.md#updateLoan) | **PATCH** /margin/loans/{loan_id} | Modify a loan(Deprecated) -[**listLoanRepayments**](MarginApi.md#listLoanRepayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records(Deprecated) -[**repayLoan**](MarginApi.md#repayLoan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan(Deprecated) -[**listLoanRecords**](MarginApi.md#listLoanRecords) | **GET** /margin/loan_records | List repayment records of a specific loan(Deprecated) -[**getLoanRecord**](MarginApi.md#getLoanRecord) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record(Deprecated) -[**updateLoanRecord**](MarginApi.md#updateLoanRecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record(Deprecated) -[**getMarginBorrowable**](MarginApi.md#getMarginBorrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency(Deprecated) -[**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 | Cross margin repayments -[**getCrossMarginInterestRecords**](MarginApi.md#getCrossMarginInterestRecords) | **GET** /margin/cross/interest_records | Interest records for the cross margin account -[**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency -[**getCrossMarginEstimateRate**](MarginApi.md#getCrossMarginEstimateRate) | **GET** /margin/cross/estimate_rate | Estimated interest rates -[**getCrossMarginBorrowable**](MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency +[**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) @@ -108,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).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 @@ -139,13 +117,13 @@ 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 - String type = "lend"; // String | Only retrieve changes of the specified type. All types will be returned if not specified. - Long from = 1627706330L; // Long | Start timestamp of the query - Long to = 1635329650L; // 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) @@ -174,13 +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] - **type** | **String**| Only retrieve changes of the specified type. All types will be returned if not specified. | [optional] - **from** | **Long**| Start timestamp of the query | [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 @@ -198,7 +176,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listFundingAccounts** @@ -227,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) @@ -250,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 @@ -268,13 +246,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **getAutoRepayStatus** > AutoRepaySetting getAutoRepayStatus() -Retrieve user auto repayment setting +Query user auto repayment settings ### Example @@ -332,13 +310,13 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Current auto repayment setting | - | +**200** | User's current auto repayment settings | - | # **setAutoRepay** > AutoRepaySetting setAutoRepay(status) -Update user's auto repayment setting +Update user auto repayment settings ### Example @@ -361,7 +339,7 @@ public class Example { 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 + String status = "on"; // String | Whether to enable auto repayment: `on` - enabled, `off` - disabled try { AutoRepaySetting result = apiInstance.setAutoRepay(status); System.out.println(result); @@ -382,7 +360,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | **String**| New auto repayment status. `on` - enabled, `off` - disabled | + **status** | **String**| Whether to enable auto repayment: `on` - enabled, `off` - disabled | ### Return type @@ -400,13 +378,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Current auto repayment setting | - | +**200** | User's current auto repayment settings | - | # **getMarginTransferable** > MarginTransferable getMarginTransferable(currency).currencyPair(currencyPair).execute(); -Get the max transferable amount for a specific margin currency +Get maximum transferable amount for isolated margin ### Example @@ -429,7 +407,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 String currencyPair = "BTC_USDT"; // String | Currency pair try { MarginTransferable result = apiInstance.getMarginTransferable(currency) @@ -453,7 +431,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | + **currency** | **String**| Query by specified currency name | **currencyPair** | **String**| Currency pair | [optional] ### Return type @@ -472,1500 +450,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | - -# **listMarginCurrencyPairs** -> List<MarginCurrencyPair> listMarginCurrencyPairs() + +# **getUserMarginTier** +> List<MarginLeverageTier> getUserMarginTier(currencyPair) -List all supported currency pairs supported in margin trading(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(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); - 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(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); - 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 | - | - - -# **listLoans** -> List<Loan> listLoans(status, side).currency(currency).currencyPair(currencyPair).sortBy(sortBy).reverseSort(reverseSort).page(page).limit(limit).execute(); - -List all loans(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.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 = "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(); - System.out.println(result); - } catch (GateApiException e) { - System.err.println(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("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### 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] - -### Return type - -[**List<Loan>**](Loan.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 | - | - - -# **createLoan** -> Loan createLoan(loan) - -Lend or borrow(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.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); - Loan loan = new Loan(); // Loan | - try { - Loan result = apiInstance.createLoan(loan); - System.out.println(result); - } catch (GateApiException e) { - System.err.println(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("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loan** | [**Loan**](Loan.md)| | - -### Return type - -[**Loan**](Loan.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** | Loan created | - | - - -# **mergeLoans** -> Loan mergeLoans(currency, ids) - -Merge multiple lending loans(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.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 ids = "123,234,345"; // String | A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request - try { - Loan result = apiInstance.mergeLoans(currency, ids); - System.out.println(result); - } catch (GateApiException e) { - System.err.println(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("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 | - **ids** | **String**| A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request | - -### Return type - -[**Loan**](Loan.md) - -### Authorization - -[apiv4](../README.md#apiv4) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Loans merged | - | - - -# **getLoan** -> Loan getLoan(loanId, side) - -Retrieve one single loan detail(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.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 | Loan ID - String side = "lend"; // String | Lend or borrow - try { - Loan result = apiInstance.getLoan(loanId, 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 MarginApi#getLoan"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loanId** | **String**| Loan ID | - **side** | **String**| Lend or borrow | [enum: lend, borrow] - -### Return type - -[**Loan**](Loan.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 | - | - - -# **cancelLoan** -> Loan cancelLoan(loanId, currency) - -Cancel lending loan(Deprecated) - -Only lent loans can 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.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 | Loan ID - String currency = "BTC"; // String | Retrieve data of the specified currency - try { - Loan result = apiInstance.cancelLoan(loanId, 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#cancelLoan"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loanId** | **String**| Loan ID | - **currency** | **String**| Retrieve data of the specified currency | - -### Return type - -[**Loan**](Loan.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 cancelled | - | - - -# **updateLoan** -> Loan updateLoan(loanId, loanPatch) - -Modify a loan(Deprecated) - -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 loanId = "12345"; // String | Loan ID - LoanPatch loanPatch = new LoanPatch(); // LoanPatch | - try { - Loan result = apiInstance.updateLoan(loanId, 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#updateLoan"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loanId** | **String**| Loan ID | - **loanPatch** | [**LoanPatch**](LoanPatch.md)| | - -### Return type - -[**Loan**](Loan.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 | - | - - -# **listLoanRepayments** -> List<Repayment> listLoanRepayments(loanId) - -List loan repayment records(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.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 | Loan ID - try { - List result = apiInstance.listLoanRepayments(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#listLoanRepayments"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loanId** | **String**| Loan ID | - -### Return type - -[**List<Repayment>**](Repayment.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 | - | - - -# **repayLoan** -> Loan repayLoan(loanId, repayRequest) - -Repay a loan(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.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 | Loan ID - RepayRequest repayRequest = new RepayRequest(); // RepayRequest | - try { - Loan result = apiInstance.repayLoan(loanId, repayRequest); - System.out.println(result); - } catch (GateApiException e) { - System.err.println(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("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loanId** | **String**| Loan ID | - **repayRequest** | [**RepayRequest**](RepayRequest.md)| | - -### Return type - -[**Loan**](Loan.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 | - | - - -# **listLoanRecords** -> List<LoanRecord> listLoanRecords(loanId).status(status).page(page).limit(limit).execute(); - -List repayment records of a specific loan(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.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 | 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 - try { - List result = apiInstance.listLoanRecords(loanId) - .status(status) - .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 MarginApi#listLoanRecords"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -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(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.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(Deprecated) - -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 | - | - - -# **getMarginBorrowable** -> MarginBorrowable getMarginBorrowable(currency).currencyPair(currencyPair).execute(); - -Get the max borrowable amount for a specific margin currency(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.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 = 1627706330L; // Long | Start timestamp of the query - Long to = 1635329650L; // 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**| Start timestamp of the query | [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. (deprecated.) - 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. (deprecated.) | - **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 +Query user's own leverage lending tiers in current market ### Example @@ -1988,15 +479,15 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); MarginApi apiInstance = new MarginApi(defaultClient); - String loanId = "12345"; // String | Borrow loan ID + String currencyPair = "BTC_USDT"; // String | Currency pair try { - CrossMarginLoan result = apiInstance.getCrossMarginLoan(loanId); + 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#getCrossMarginLoan"); + System.err.println("Exception when calling MarginApi#getUserMarginTier"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -2009,11 +500,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loanId** | **String**| Borrow loan ID | + **currencyPair** | **String**| Currency pair | ### Return type -[**CrossMarginLoan**](CrossMarginLoan.md) +[**List<MarginLeverageTier>**](MarginLeverageTier.md) ### Authorization @@ -2027,15 +518,13 @@ Name | Type | Description | Notes ### 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(); +**200** | Query successful | - | -Retrieve cross margin repayments + +# **getMarketMarginTier** +> List<MarginLeverageTier> getMarketMarginTier(currencyPair) -Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. +Query current market leverage lending tiers ### Example @@ -2045,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; @@ -2053,30 +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 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 + String currencyPair = "BTC_USDT"; // String | Currency pair try { - List result = apiInstance.listCrossMarginRepayments() - .currency(currency) - .loanId(loanId) - .limit(limit) - .offset(offset) - .reverse(reverse) - .execute(); + 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#listCrossMarginRepayments"); + System.err.println("Exception when calling MarginApi#getMarketMarginTier"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -2089,19 +564,15 @@ public class Example { 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] + **currencyPair** | **String**| Currency pair | ### Return type -[**List<CrossMarginRepayment>**](CrossMarginRepayment.md) +[**List<MarginLeverageTier>**](MarginLeverageTier.md) ### Authorization -[apiv4](../README.md#apiv4) +No authorization required ### HTTP request headers @@ -2111,15 +582,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | Query successful | - | - -# **repayCrossMarginLoan** -> List<CrossMarginLoan> repayCrossMarginLoan(crossMarginRepayRequest) + +# **setUserMarketLeverage** +> setUserMarketLeverage(marginMarketLeverage) -Cross margin repayments - -When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first +Set user market leverage multiplier ### Example @@ -2142,15 +611,14 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); MarginApi apiInstance = new MarginApi(defaultClient); - CrossMarginRepayRequest crossMarginRepayRequest = new CrossMarginRepayRequest(); // CrossMarginRepayRequest | + MarginMarketLeverage marginMarketLeverage = new MarginMarketLeverage(); // MarginMarketLeverage | try { - List result = apiInstance.repayCrossMarginLoan(crossMarginRepayRequest); - 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#repayCrossMarginLoan"); + System.err.println("Exception when calling MarginApi#setUserMarketLeverage"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -2163,11 +631,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **crossMarginRepayRequest** | [**CrossMarginRepayRequest**](CrossMarginRepayRequest.md)| | + **marginMarketLeverage** | [**MarginMarketLeverage**](MarginMarketLeverage.md)| | ### Return type -[**List<CrossMarginLoan>**](CrossMarginLoan.md) +null (empty response body) ### Authorization @@ -2176,94 +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** | Loan repaid | - | - - -# **getCrossMarginInterestRecords** -> List<UniLoanInterestRecord> getCrossMarginInterestRecords().currency(currency).page(page).limit(limit).execute(); - -Interest records for the 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); - String currency = "BTC"; // String | Retrieve data of the specified currency - Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 - try { - List result = apiInstance.getCrossMarginInterestRecords() - .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 MarginApi#getCrossMarginInterestRecords"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` +**204** | Set successfully | - | -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [optional] - **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] - -### 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** | Successfully retrieved | - | + +# **listMarginUserAccount** +> List<MarginAccount> listMarginUserAccount().currencyPair(currencyPair).execute(); - -# **getCrossMarginTransferable** -> CrossMarginTransferable getCrossMarginTransferable(currency) +Query user's isolated margin account list -Get the max transferable amount for a specific cross margin currency +Supports querying risk ratio isolated accounts and margin ratio isolated accounts ### Example @@ -2286,15 +680,17 @@ 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 currencyPair = "BTC_USDT"; // String | Currency pair try { - CrossMarginTransferable result = apiInstance.getCrossMarginTransferable(currency); + 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#getCrossMarginTransferable"); + System.err.println("Exception when calling MarginApi#listMarginUserAccount"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -2307,11 +703,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | + **currencyPair** | **String**| Currency pair | [optional] ### Return type -[**CrossMarginTransferable**](CrossMarginTransferable.md) +[**List<MarginAccount>**](MarginAccount.md) ### Authorization @@ -2325,15 +721,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | List retrieved successfully | - | - -# **getCrossMarginEstimateRate** -> Map<String, String> getCrossMarginEstimateRate(currencies) + +# **listCrossMarginLoans** +> List<CrossMarginLoan> listCrossMarginLoans(status).currency(currency).limit(limit).offset(offset).reverse(reverse).execute(); -Estimated interest rates +Query cross margin borrow history (deprecated) -Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. +Sorted by creation time in descending order by default. Set `reverse=false` for ascending order ### Example @@ -2356,15 +752,24 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); MarginApi apiInstance = new MarginApi(defaultClient); - List currencies = Arrays.asList(); // List | An array of up to 10 specifying the currency name + 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 { - Map result = apiInstance.getCrossMarginEstimateRate(currencies); + 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#getCrossMarginEstimateRate"); + System.err.println("Exception when calling MarginApi#listCrossMarginLoans"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -2377,11 +782,15 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currencies** | [**List<String>**](String.md)| An array of up to 10 specifying the currency name | + **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 -**Map<String, String>** +[**List<CrossMarginLoan>**](CrossMarginLoan.md) ### Authorization @@ -2395,13 +804,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | + + +# **listCrossMarginRepayments** +> List<CrossMarginRepayment> listCrossMarginRepayments().currency(currency).loanId(loanId).limit(limit).offset(offset).reverse(reverse).execute(); - -# **getCrossMarginBorrowable** -> PortfolioBorrowable getCrossMarginBorrowable(currency) +Retrieve cross margin repayments. (deprecated) -Get the max borrowable amount for a specific cross margin currency +Sorted by creation time in descending order by default. Set `reverse=false` for ascending order ### Example @@ -2424,15 +835,25 @@ 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 | + 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 { - PortfolioBorrowable result = apiInstance.getCrossMarginBorrowable(currency); + 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#getCrossMarginBorrowable"); + System.err.println("Exception when calling MarginApi#listCrossMarginRepayments"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); @@ -2445,11 +866,15 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | + **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 -[**PortfolioBorrowable**](PortfolioBorrowable.md) +[**List<CrossMarginRepayment>**](CrossMarginRepayment.md) ### Authorization @@ -2463,5 +888,5 @@ Name | Type | Description | Notes ### 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 4f9127a..0000000 --- a/docs/MarginCurrencyPair.md +++ /dev/null @@ -1,16 +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] -**status** | **Integer** | Currency pair status - `0`: disabled - `1`: enabled | [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 index c7fd26b..54e1d25 100644 --- a/docs/MarginUniApi.md +++ b/docs/MarginUniApi.md @@ -5,13 +5,13 @@ 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 detail of lending market -[**getMarginUniEstimateRate**](MarginUniApi.md#getMarginUniEstimateRate) | **GET** /margin/uni/estimate_rate | Estimate interest Rate -[**listUniLoans**](MarginUniApi.md#listUniLoans) | **GET** /margin/uni/loans | List loans +[**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 | Get load records -[**listUniLoanInterestRecords**](MarginUniApi.md#listUniLoanInterestRecords) | **GET** /margin/uni/interest_records | List interest records -[**getUniBorrowable**](MarginUniApi.md#getUniBorrowable) | **GET** /margin/uni/borrowable | Get maximum borrowable +[**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 @@ -72,13 +72,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getUniCurrencyPair** > UniCurrencyPair getUniCurrencyPair(currencyPair) -Get detail of lending market +Get lending market details ### Example @@ -136,15 +136,15 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getMarginUniEstimateRate** > Map<String, String> getMarginUniEstimateRate(currencies) -Estimate interest Rate +Estimate interest rate for isolated margin currencies -Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. +Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided. ### Example @@ -167,7 +167,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); MarginUniApi apiInstance = new MarginUniApi(defaultClient); - List currencies = Arrays.asList(); // List | An array of up to 10 specifying the currency name + List currencies = Arrays.asList(); // List | Array of currency names to query, maximum 10 try { Map result = apiInstance.getMarginUniEstimateRate(currencies); System.out.println(result); @@ -188,7 +188,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currencies** | [**List<String>**](String.md)| An array of up to 10 specifying the currency name | + **currencies** | [**List<String>**](String.md)| Array of currency names to query, maximum 10 | ### Return type @@ -206,13 +206,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listUniLoans** > List<UniLoan> listUniLoans().currencyPair(currencyPair).currency(currency).page(page).limit(limit).execute(); -List loans +Query loans ### Example @@ -236,9 +236,9 @@ public class Example { MarginUniApi apiInstance = new MarginUniApi(defaultClient); String currencyPair = "BTC_USDT"; // String | Currency pair - String currency = "BTC"; // String | Retrieve data of the specified currency + String currency = "BTC"; // String | Query by specified currency name Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 + Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 try { List result = apiInstance.listUniLoans() .currencyPair(currencyPair) @@ -265,9 +265,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currencyPair** | **String**| Currency pair | [optional] - **currency** | **String**| Retrieve data of the specified currency | [optional] + **currency** | **String**| Query by specified currency name | [optional] **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] ### Return type @@ -285,7 +285,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **createUniLoan** @@ -352,13 +352,13 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Operated successfully | - | +**204** | Operation successful | - | # **listUniLoanRecords** > List<UniLoanRecord> listUniLoanRecords().type(type).currency(currency).currencyPair(currencyPair).page(page).limit(limit).execute(); -Get load records +Query loan records ### Example @@ -381,11 +381,11 @@ public class Example { 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 | Retrieve data of the specified currency + 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 response items. Default: 100, minimum: 1, Maximum: 100 + Integer limit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 try { List result = apiInstance.listUniLoanRecords() .type(type) @@ -412,11 +412,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type** | **String**| type: borrow - borrow, repay - repay | [optional] [enum: borrow, repay] - **currency** | **String**| Retrieve data of the specified currency | [optional] + **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 response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + **limit** | **Integer**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] ### Return type @@ -434,13 +434,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listUniLoanInterestRecords** -> List<UniLoanInterestRecord> listUniLoanInterestRecords().currencyPair(currencyPair).currency(currency).page(page).limit(limit).execute(); +> List<UniLoanInterestRecord> listUniLoanInterestRecords().currencyPair(currencyPair).currency(currency).page(page).limit(limit).from(from).to(to).execute(); -List interest records +Query interest deduction records ### Example @@ -464,15 +464,19 @@ public class Example { MarginUniApi apiInstance = new MarginUniApi(defaultClient); String currencyPair = "BTC_USDT"; // String | Currency pair - String currency = "BTC"; // String | Retrieve data of the specified currency + String currency = "BTC"; // String | Query by specified currency name Integer page = 1; // Integer | Page number - Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 + 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) { @@ -493,9 +497,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currencyPair** | **String**| Currency pair | [optional] - **currency** | **String**| Retrieve data of the specified currency | [optional] + **currency** | **String**| Query by specified currency name | [optional] **page** | **Integer**| Page number | [optional] [default to 1] - **limit** | **Integer**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [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 @@ -513,13 +519,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getUniBorrowable** > MaxUniBorrowable getUniBorrowable(currency, currencyPair) -Get maximum borrowable +Query maximum borrowable amount by currency ### Example @@ -542,7 +548,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); MarginUniApi apiInstance = new MarginUniApi(defaultClient); - String currency = "BTC"; // String | Retrieve data of the specified currency + String currency = "BTC"; // String | Query by specified currency name String currencyPair = "BTC_USDT"; // String | Currency pair try { MaxUniBorrowable result = apiInstance.getUniBorrowable(currency, currencyPair); @@ -564,7 +570,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | + **currency** | **String**| Query by specified currency name | **currencyPair** | **String**| Currency pair | ### Return type @@ -583,5 +589,5 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | 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 fee98ab..6ba2205 100644 --- a/docs/MyFuturesTrade.md +++ b/docs/MyFuturesTrade.md @@ -5,16 +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] -**text** | **String** | User defined information | [optional] -**fee** | **String** | Fee deducted | [optional] -**pointFee** | **String** | Points used to deduct fee | [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 index c4a47d1..c9a11be 100644 --- a/docs/MyFuturesTradeTimeRange.md +++ b/docs/MyFuturesTradeTimeRange.md @@ -5,16 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**tradeId** | **String** | Trade ID | [optional] -**createTime** | **Double** | Trading time | [optional] +**tradeId** | **String** | 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] -**text** | **String** | User defined information | [optional] -**fee** | **String** | Fee deducted | [optional] -**pointFee** | **String** | Points used to deduct fee | [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/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 index fd512a9..df62861 100644 --- a/docs/OptionsAccount.md +++ b/docs/OptionsAccount.md @@ -5,14 +5,31 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**user** | **Integer** | User ID | [optional] -**total** | **String** | Total account balance | [optional] +**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 amount | [optional] -**currency** | **String** | Settle currency | [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 index 4525438..7c12eb6 100644 --- a/docs/OptionsAccountBook.md +++ b/docs/OptionsAccountBook.md @@ -8,6 +8,6 @@ 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 Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] -**text** | **String** | custom text | [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 index 1400615..a55b055 100644 --- a/docs/OptionsApi.md +++ b/docs/OptionsApi.md @@ -4,37 +4,41 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listOptionsUnderlyings**](OptionsApi.md#listOptionsUnderlyings) | **GET** /options/underlyings | List all underlyings -[**listOptionsExpirations**](OptionsApi.md#listOptionsExpirations) | **GET** /options/expirations | List all expiration times -[**listOptionsContracts**](OptionsApi.md#listOptionsContracts) | **GET** /options/contracts | List all the contracts with specified underlying and expiration time -[**getOptionsContract**](OptionsApi.md#getOptionsContract) | **GET** /options/contracts/{contract} | Query specified contract detail +[**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's settlement -[**listMyOptionsSettlements**](OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | List my options settlements -[**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Options order book -[**listOptionsTickers**](OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | List tickers of options contracts -[**listOptionsUnderlyingTickers**](OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker -[**listOptionsCandlesticks**](OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get options candlesticks -[**listOptionsUnderlyingCandlesticks**](OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying -[**listOptionsTrades**](OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Options trade history -[**listOptionsAccount**](OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | List options account -[**listOptionsAccountBook**](OptionsApi.md#listOptionsAccountBook) | **GET** /options/account_book | List account changing 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 `open` orders matched -[**getOptionsOrder**](OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Get a single order -[**cancelOptionsOrder**](OptionsApi.md#cancelOptionsOrder) | **DELETE** /options/orders/{order_id} | Cancel a single order -[**listMyOptionsTrades**](OptionsApi.md#listMyOptionsTrades) | **GET** /options/my_trades | List personal trading history +[**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 underlyings +List all underlying assets ### Example @@ -88,13 +92,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listOptionsExpirations** > List<Long> listOptionsExpirations(underlying) -List all expiration times +List all expiration dates ### Example @@ -152,13 +156,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List expiration times of specified underlying | - | +**200** | List expiration dates for specified underlying | - | # **listOptionsContracts** > List<OptionsContract> listOptionsContracts(underlying).expiration(expiration).execute(); -List all the contracts with specified underlying and expiration time +List all contracts for specified underlying and expiration date ### Example @@ -178,7 +182,7 @@ public class Example { OptionsApi apiInstance = new OptionsApi(defaultClient); String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint) - Long expiration = 1636588800L; // Long | Unix timestamp of the expiration time + Long expiration = 1636588800L; // Long | Unix timestamp of expiration date try { List result = apiInstance.listOptionsContracts(underlying) .expiration(expiration) @@ -202,7 +206,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) | - **expiration** | **Long**| Unix timestamp of the expiration time | [optional] + **expiration** | **Long**| Unix timestamp of expiration date | [optional] ### Return type @@ -220,13 +224,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **getOptionsContract** > OptionsContract getOptionsContract(contract) -Query specified contract detail +Query specified contract details ### Example @@ -284,7 +288,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listOptionsSettlements** @@ -310,10 +314,10 @@ public class Example { OptionsApi apiInstance = new OptionsApi(defaultClient); String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint) - 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 - Long from = 1547706332L; // Long | Start timestamp - Long to = 1547706332L; // Long | End timestamp + 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) @@ -340,10 +344,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) | - **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] - **from** | **Long**| Start timestamp | [optional] - **to** | **Long**| End timestamp | [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] ### Return type @@ -361,13 +365,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **getOptionsSettlement** > OptionsSettlement getOptionsSettlement(contract, underlying, at) -Get specified contract's settlement +Get specified contract settlement information ### Example @@ -429,13 +433,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listMyOptionsSettlements** > List<OptionsMySettlements> listMyOptionsSettlements(underlying).contract(contract).limit(limit).offset(offset).from(from).to(to).execute(); -List my options settlements +Query personal settlement records ### Example @@ -460,10 +464,10 @@ public class Example { 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 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 - Long from = 1547706332L; // Long | Start timestamp - Long to = 1547706332L; // Long | End timestamp + 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) @@ -492,10 +496,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) | **contract** | **String**| Options contract name | [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] - **from** | **Long**| Start timestamp | [optional] - **to** | **Long**| End timestamp | [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] ### Return type @@ -513,13 +517,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listOptionsOrderBook** > FuturesOrderBook listOptionsOrderBook(contract).interval(interval).limit(limit).withId(withId).execute(); -Options order book +Query options contract order book Bids will be sorted by price from high to low, while asks sorted reversely @@ -541,9 +545,9 @@ public class Example { OptionsApi apiInstance = new OptionsApi(defaultClient); String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name - 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.listOptionsOrderBook(contract) .interval(interval) @@ -569,9 +573,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **String**| Options contract name | - **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 @@ -589,13 +593,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order book retrieved | - | +**200** | Depth query successful | - | # **listOptionsTickers** > List<OptionsTicker> listOptionsTickers(underlying) -List tickers of options contracts +Query options market ticker information ### Example @@ -653,13 +657,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listOptionsUnderlyingTickers** > OptionsUnderlyingTicker listOptionsUnderlyingTickers(underlying) -Get underlying ticker +Query underlying ticker information ### Example @@ -717,13 +721,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listOptionsCandlesticks** > List<OptionsCandlestick> listOptionsCandlesticks(contract).limit(limit).from(from).to(to).interval(interval).execute(); -Get options candlesticks +Options contract market candlestick chart ### Example @@ -743,10 +747,10 @@ public class Example { OptionsApi apiInstance = new OptionsApi(defaultClient); String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name - 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 interval = "5m"; // String | Interval time between data points + 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) @@ -773,10 +777,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **String**| Options contract name | - **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] - **interval** | **String**| Interval time between data points | [optional] [default to 5m] [enum: 1m, 5m, 15m, 30m, 1h] + **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 @@ -794,13 +798,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listOptionsUnderlyingCandlesticks** > List<FuturesCandlestick> listOptionsUnderlyingCandlesticks(underlying).limit(limit).from(from).to(to).interval(interval).execute(); -Mark price candlesticks of an underlying +Underlying index price candlestick chart ### Example @@ -820,10 +824,10 @@ public class Example { OptionsApi apiInstance = new OptionsApi(defaultClient); String underlying = "BTC_USDT"; // String | Underlying (Obtained by listing underlying endpoint) - 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 interval = "5m"; // String | Interval time between data points + 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) @@ -850,10 +854,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) | - **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] - **interval** | **String**| Interval time between data points | [optional] [default to 5m] [enum: 1m, 5m, 15m, 30m, 1h] + **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 @@ -871,13 +875,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listOptionsTrades** > List<FuturesTrade> listOptionsTrades().contract(contract).type(type).limit(limit).offset(offset).from(from).to(to).execute(); -Options trade history +Market trade records ### Example @@ -897,11 +901,11 @@ public class Example { OptionsApi apiInstance = new OptionsApi(defaultClient); String contract = "BTC_USDT-20210916-5000-C"; // String | Options contract name - String type = "1546935600"; // String | `C` is call, while `P` is put - Integer limit = 100; // Integer | Maximum number of records to be returned in a single list + 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 - Long to = 1547706332L; // Long | End timestamp + 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) @@ -930,11 +934,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **String**| Options contract name | [optional] - **type** | **String**| `C` is call, while `P` is put | [optional] - **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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 | [optional] - **to** | **Long**| End timestamp | [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] ### Return type @@ -952,13 +956,13 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listOptionsAccount** > OptionsAccount listOptionsAccount() -List options account +Query account information ### Example @@ -1016,13 +1020,13 @@ This endpoint does not need any parameter. ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listOptionsAccountBook** > List<OptionsAccountBook> listOptionsAccountBook().limit(limit).offset(offset).from(from).to(to).type(type).execute(); -List account changing history +Query account change history ### Example @@ -1045,11 +1049,11 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); OptionsApi apiInstance = new OptionsApi(defaultClient); - 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 - Long from = 1547706332L; // Long | Start timestamp - Long to = 1547706332L; // Long | End timestamp - String type = "dnw"; // String | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL + 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) @@ -1076,11 +1080,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **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] - **from** | **Long**| Start timestamp | [optional] - **to** | **Long**| End timestamp | [optional] - **type** | **String**| Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL | [optional] [enum: dnw, prem, fee, refr, set] + **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 @@ -1098,7 +1102,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listOptionsPositions** @@ -1168,7 +1172,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **getOptionsPosition** @@ -1236,7 +1240,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listOptionsPositionClose** @@ -1308,7 +1312,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listOptionsOrders** @@ -1337,13 +1341,13 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); OptionsApi apiInstance = new OptionsApi(defaultClient); - 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-20210916-5000-C"; // String | Options contract name String underlying = "BTC_USDT"; // String | Underlying - 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 - Long from = 1547706332L; // Long | Start timestamp - Long to = 1547706332L; // Long | End timestamp + 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) @@ -1371,13 +1375,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **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**| Options contract name | [optional] **underlying** | **String**| Underlying | [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] - **from** | **Long**| Start timestamp | [optional] - **to** | **Long**| End timestamp | [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] ### Return type @@ -1395,7 +1399,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **createOptionsOrder** @@ -1469,7 +1473,7 @@ Name | Type | Description | Notes # **cancelOptionsOrders** > List<OptionsOrder> cancelOptionsOrders(contract, underlying, side) -Cancel all `open` orders matched +Cancel all orders with 'open' status ### Example @@ -1494,7 +1498,7 @@ public class Example { 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 | 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.cancelOptionsOrders(contract, underlying, side); System.out.println(result); @@ -1517,7 +1521,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **String**| Options contract name | [optional] **underlying** | **String**| Underlying | [optional] - **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 @@ -1535,13 +1539,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | All orders matched cancelled | - | +**200** | Batch cancellation successful | - | # **getOptionsOrder** > OptionsOrder getOptionsOrder(orderId) -Get a single order +Query single order details ### Example @@ -1564,7 +1568,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); OptionsApi apiInstance = new OptionsApi(defaultClient); - Long orderId = 12345L; // Long | Order ID returned on successful order creation + Long orderId = 12345L; // Long | Order ID returned when order is successfully created try { OptionsOrder result = apiInstance.getOptionsOrder(orderId); System.out.println(result); @@ -1585,7 +1589,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| Order ID returned on successful order creation | + **orderId** | **Long**| Order ID returned when order is successfully created | ### Return type @@ -1609,7 +1613,7 @@ Name | Type | Description | Notes # **cancelOptionsOrder** > OptionsOrder cancelOptionsOrder(orderId) -Cancel a single order +Cancel single order ### Example @@ -1632,7 +1636,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); OptionsApi apiInstance = new OptionsApi(defaultClient); - Long orderId = 12345L; // Long | Order ID returned on successful order creation + Long orderId = 12345L; // Long | Order ID returned when order is successfully created try { OptionsOrder result = apiInstance.cancelOptionsOrder(orderId); System.out.println(result); @@ -1653,7 +1657,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| Order ID returned on successful order creation | + **orderId** | **Long**| Order ID returned when order is successfully created | ### Return type @@ -1673,11 +1677,81 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **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(); -List personal trading history +Query personal trading records ### Example @@ -1702,10 +1776,10 @@ public class Example { 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 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 - Long from = 1547706332L; // Long | Start timestamp - Long to = 1547706332L; // Long | End timestamp + 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) @@ -1734,10 +1808,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **underlying** | **String**| Underlying (Obtained by listing underlying endpoint) | **contract** | **String**| Options contract name | [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] - **from** | **Long**| Start timestamp | [optional] - **to** | **Long**| End timestamp | [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] ### Return type @@ -1755,5 +1829,211 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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/OptionsContract.md b/docs/OptionsContract.md index 3d799aa..c0943d3 100644 --- a/docs/OptionsContract.md +++ b/docs/OptionsContract.md @@ -1,35 +1,35 @@ # OptionsContract -Options contract detail +Options contract details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Options contract name | [optional] -**tag** | **String** | tag | [optional] -**createTime** | **Double** | Creation time | [optional] +**tag** | **String** | Tag | [optional] +**createTime** | **Double** | Created time | [optional] **expirationTime** | **Double** | Expiration time | [optional] -**isCall** | **Boolean** | `true` means call options, while `false` is put options | [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, 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] -**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** | 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 accumulated trade size | [optional] +**tradeSize** | **Long** | Historical cumulative trading volume | [optional] **positionSize** | **Long** | Current total long position size | [optional] -**ordersLimit** | **Integer** | Maximum number of open orders | [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 index 67cce53..1bf8c76 100644 --- a/docs/OptionsMySettlements.md +++ b/docs/OptionsMySettlements.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **contract** | **String** | Options contract name | [optional] **strikePrice** | **String** | Strike price (quote currency) | [optional] **settlePrice** | **String** | Settlement price (quote currency) | [optional] -**size** | **Long** | Size | [optional] +**size** | **Long** | Settlement size | [optional] **settleProfit** | **String** | Settlement profit (quote currency) | [optional] -**fee** | **String** | Fee (quote currency) | [optional] -**realisedPnl** | **String** | The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (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 index f4a6aa5..a8228ae 100644 --- a/docs/OptionsMyTrade.md +++ b/docs/OptionsMyTrade.md @@ -5,14 +5,14 @@ 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** | Options contract name | [optional] -**orderId** | **Integer** | Order ID related | [optional] +**orderId** | **Integer** | Related order ID | [optional] **size** | **Long** | Trading size | [optional] -**price** | **String** | Trading price (quote currency) | [optional] +**price** | **String** | Trade price (quote currency) | [optional] **underlyingPrice** | **String** | Underlying price (quote currency) | [optional] -**role** | [**RoleEnum**](#RoleEnum) | Trade role. Available values are `taker` and `maker` | [optional] +**role** | [**RoleEnum**](#RoleEnum) | Trade role. taker - taker, maker - maker | [optional] ## Enum: RoleEnum diff --git a/docs/OptionsOrder.md b/docs/OptionsOrder.md index 68c6f5d..e35daf6 100644 --- a/docs/OptionsOrder.md +++ b/docs/OptionsOrder.md @@ -1,7 +1,7 @@ # OptionsOrder -Options order detail +Options order details ## Properties @@ -11,24 +11,26 @@ Name | Type | Description | Notes **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 of position close | [optional] [readonly] -**status** | [**StatusEnum**](#StatusEnum) | Order status - `open`: waiting to be traded - `finished`: finished | [optional] [readonly] -**contract** | **String** | Contract name | -**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` (USDT) | [optional] +**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] -**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 | [optional] -**left** | **Long** | Size left to be traded | [optional] [readonly] -**fillPrice** | **String** | Fill price of the order | [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** | Reference user ID | [optional] [readonly] +**refu** | **Integer** | Referrer user ID | [optional] [readonly] **refr** | **String** | Referrer rebate | [optional] [readonly] ## Enum: FinishAsEnum @@ -43,6 +45,7 @@ AUTO_DELEVERAGED | "auto_deleveraged" REDUCE_ONLY | "reduce_only" POSITION_CLOSED | "position_closed" REDUCE_OUT | "reduce_out" +MMP_CANCELLED | "mmp_cancelled" ## Enum: StatusEnum diff --git a/docs/OptionsPosition.md b/docs/OptionsPosition.md index 5488cc8..958bf5c 100644 --- a/docs/OptionsPosition.md +++ b/docs/OptionsPosition.md @@ -1,7 +1,7 @@ # OptionsPosition -Options position information +Options contract position details ## Properties @@ -11,16 +11,16 @@ Name | Type | Description | Notes **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 size) | [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] +**realisedPnl** | **String** | Realized PnL | [optional] [readonly] **unrealisedPnl** | **String** | Unrealized PNL | [optional] [readonly] -**pendingOrders** | **Integer** | Current open orders | [optional] [readonly] +**pendingOrders** | **Integer** | Current pending order quantity | [optional] [readonly] **closeOrder** | [**OptionsPositionCloseOrder**](OptionsPositionCloseOrder.md) | | [optional] -**delta** | **String** | Delta | [optional] [readonly] -**gamma** | **String** | Gamma | [optional] [readonly] -**vega** | **String** | Vega | [optional] [readonly] -**theta** | **String** | Theta | [optional] [readonly] +**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 index 5cd293b..7f241db 100644 --- a/docs/OptionsPositionClose.md +++ b/docs/OptionsPositionClose.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **Double** | Position close time | [optional] [readonly] **contract** | **String** | Options contract name | [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] -**settleSize** | **String** | settlement size | [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 diff --git a/docs/OptionsPositionCloseOrder.md b/docs/OptionsPositionCloseOrder.md index 720920b..8cc7bdc 100644 --- a/docs/OptionsPositionCloseOrder.md +++ b/docs/OptionsPositionCloseOrder.md @@ -1,13 +1,13 @@ # OptionsPositionCloseOrder -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 (quote currency) | [optional] -**isLiq** | **Boolean** | Is the close order from liquidation | [optional] +**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 index 7504cdc..b13aa6a 100644 --- a/docs/OptionsSettlement.md +++ b/docs/OptionsSettlement.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**time** | **Double** | Last changed time of configuration | [optional] +**time** | **Double** | Last configuration update time | [optional] **contract** | **String** | Options contract name | [optional] -**profit** | **String** | Settlement profit per size (quote currency) | [optional] -**fee** | **String** | Settlement fee per size (quote currency) | [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 index 3688459..4f01c27 100644 --- a/docs/OptionsTicker.md +++ b/docs/OptionsTicker.md @@ -1,14 +1,14 @@ # OptionsTicker -Options contract detail +Options contract details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Options contract name | [optional] -**lastPrice** | **String** | Last trading price (quote currency) | [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] @@ -20,9 +20,9 @@ Name | Type | Description | Notes **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** | Delta | [optional] -**gamma** | **String** | Gamma | [optional] -**vega** | **String** | Vega | [optional] -**theta** | **String** | Theta | [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/Order.md b/docs/Order.md index 533615e..d1ae44c 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -16,16 +16,17 @@ 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 | -**type** | [**TypeEnum**](#TypeEnum) | Order Type - limit : Limit Order - market : Market Order | [optional] -**account** | [**AccountEnum**](#AccountEnum) | Account type, spot - spot account, margin - margin account, cross_margin - cross margin account, portfolio - portfolio account Portfolio margin account must set to `cross_margin` | [optional] -**side** | [**SideEnum**](#SideEnum) | Order side | -**amount** | **String** | When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` | -**price** | **String** | Price can't be empty when `type`= `limit` | [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` cannot be both set to true in one order. | [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] @@ -33,14 +34,15 @@ Name | Type | Description | Notes **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 used to deduct maker fee | [optional] [readonly] -**gtTakerFee** | **String** | GT used to deduct taker 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 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, 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] +**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 @@ -57,15 +59,6 @@ Name | Value LIMIT | "limit" MARKET | "market" -## Enum: AccountEnum - -Name | Value ----- | ----- -SPOT | "spot" -MARGIN | "margin" -CROSS_MARGIN | "cross_margin" -PORTFOLIO | "portfolio" - ## Enum: SideEnum Name | Value @@ -98,6 +91,13 @@ 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 index 928e70b..88d1655 100644 --- a/docs/OrderPatch.md +++ b/docs/OrderPatch.md @@ -7,7 +7,10 @@ Spot order details Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**amount** | **String** | New order amount. `amount` and `price` must specify one of them | [optional] -**price** | **String** | New order price. `amount` and `Price` must specify one of them\" | [optional] -**amendText** | **String** | Custom info during amending order | [optional] +**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/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/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/PortfolioAccount.md b/docs/PortfolioAccount.md deleted file mode 100644 index a28e774..0000000 --- a/docs/PortfolioAccount.md +++ /dev/null @@ -1,24 +0,0 @@ - -# PortfolioAccount - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userId** | **Long** | User ID | [optional] -**refreshTime** | **Long** | Time of the most recent refresh | [optional] -**locked** | **Boolean** | Whether account is locked | [optional] -**balances** | [**Map<String, PortfolioMarginBalance>**](PortfolioMarginBalance.md) | | [optional] -**total** | **String** | Total account value in USDT, i.e., the sum of all currencies' | [optional] -**borrowed** | **String** | Total borrowed value in USDT, i.e., the sum of all currencies | [optional] -**interest** | **String** | Total unpaid interests in USDT, i.e., the sum of all currencies | [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] -**portfolioMarginTotal** | **String** | Total margin balance of the account | [optional] -**portfolioMarginTotalLiab** | **String** | Total liabilities of the account | [optional] -**portfolioMarginTotalEquity** | **String** | Total equity of the account | [optional] - diff --git a/docs/PortfolioLoan.md b/docs/PortfolioLoan.md deleted file mode 100644 index bd63f72..0000000 --- a/docs/PortfolioLoan.md +++ /dev/null @@ -1,22 +0,0 @@ - -# PortfolioLoan - -Borrow or repay - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency** | **String** | Currency | -**type** | [**TypeEnum**](#TypeEnum) | type: borrow - borrow, repay - repay | -**amount** | **String** | The amount of lending or repaying | -**repaidAll** | **Boolean** | Full repayment. Repay operation only. If the value is `true`, the amount will be ignored and the loan will be repaid in full. | [optional] -**text** | **String** | User defined custom ID | [optional] - -## Enum: TypeEnum - -Name | Value ----- | ----- -BORROW | "borrow" -REPAY | "repay" - diff --git a/docs/PortfolioLoanRecord.md b/docs/PortfolioLoanRecord.md deleted file mode 100644 index d56ee8f..0000000 --- a/docs/PortfolioLoanRecord.md +++ /dev/null @@ -1,17 +0,0 @@ - -# PortfolioLoanRecord - -Loan 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 cancellation | [optional] [readonly] -**currencyPair** | **String** | Currency pair | [optional] [readonly] -**currency** | **String** | Currency | [optional] [readonly] -**amount** | **String** | The amount of lending or repaying | [optional] [readonly] -**createTime** | **Long** | Created time | [optional] [readonly] - diff --git a/docs/PortfolioMarginBalance.md b/docs/PortfolioMarginBalance.md deleted file mode 100644 index fdc1ab4..0000000 --- a/docs/PortfolioMarginBalance.md +++ /dev/null @@ -1,17 +0,0 @@ - -# PortfolioMarginBalance - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**available** | **String** | Available amount | [optional] -**freeze** | **String** | Locked amount | [optional] -**borrowed** | **String** | Borrowed amount | [optional] -**interest** | **String** | Unpaid interests | [optional] -**negativeLiab** | **String** | Negative Liabilities | [optional] -**futuresPosLiab** | **String** | Borrowing to Open Positions in Futures | [optional] -**equity** | **String** | Equity | [optional] -**totalFreeze** | **String** | Total freeze | [optional] -**totalLiab** | **String** | Total liabilities | [optional] - diff --git a/docs/PortfolioMode.md b/docs/PortfolioMode.md deleted file mode 100644 index e9fe03d..0000000 --- a/docs/PortfolioMode.md +++ /dev/null @@ -1,10 +0,0 @@ - -# PortfolioMode - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mode** | **String** | Portfolio mode - cross_margin : cross margin | -**enabled** | **Boolean** | Is it enabled? | - diff --git a/docs/PortfolioTransferable.md b/docs/PortfolioTransferable.md deleted file mode 100644 index f219cd2..0000000 --- a/docs/PortfolioTransferable.md +++ /dev/null @@ -1,10 +0,0 @@ - -# PortfolioTransferable - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency** | **String** | Currency detail | [optional] -**amount** | **String** | The maximum amount that can be transferred out | [optional] - diff --git a/docs/Position.md b/docs/Position.md index 5516cc9..eb133ef 100644 --- a/docs/Position.md +++ b/docs/Position.md @@ -22,17 +22,25 @@ Name | Type | Description | Notes **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** | 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 open orders | [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 index 7f3a260..333e137 100644 --- a/docs/RebateApi.md +++ b/docs/RebateApi.md @@ -4,17 +4,24 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**agencyTransactionHistory**](RebateApi.md#agencyTransactionHistory) | **GET** /rebate/agency/transaction_history | The broker obtains the transaction history of the recommended user -[**agencyCommissionsHistory**](RebateApi.md#agencyCommissionsHistory) | **GET** /rebate/agency/commission_history | The broker obtains the commission history of the recommended user +[**agencyTransactionHistory**](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(); -The broker obtains the transaction history of the recommended user +Broker obtains transaction history of recommended users -Record time range cannot exceed 30 days +Record query time range cannot exceed 30 days ### Example @@ -37,11 +44,11 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); RebateApi apiInstance = new RebateApi(defaultClient); - String currencyPair = "BTC_USDT"; // String | Specify the currency pair, if not specified, return all currency pairs - String userId = "10003"; // String | User ID. If not specified, all user records will be returned - 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 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() @@ -70,11 +77,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currencyPair** | **String**| Specify the currency pair, if not specified, return all currency pairs | [optional] - **userId** | **String**| User ID. If not specified, all user records will be returned | [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] + **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 @@ -93,15 +100,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **agencyCommissionsHistory** -> List<AgencyCommissionHistory> agencyCommissionsHistory().currency(currency).userId(userId).from(from).to(to).limit(limit).offset(offset).execute(); +> List<AgencyCommissionHistory> agencyCommissionsHistory().currency(currency).commissionType(commissionType).userId(userId).from(from).to(to).limit(limit).offset(offset).execute(); -The broker obtains the commission history of the recommended user +Broker obtains rebate history of recommended users -Record time range cannot exceed 30 days +Record query time range cannot exceed 30 days ### Example @@ -124,15 +131,17 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); RebateApi apiInstance = new RebateApi(defaultClient); - String currency = "BTC"; // String | Filter by currency. Return all currency records if not specified - String userId = "10003"; // String | User ID. If not specified, all user records will be returned - 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 + 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) @@ -157,11 +166,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Filter by currency. Return all currency records if not specified | [optional] - **userId** | **String**| User ID. If not specified, all user records will be returned | [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] + **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 @@ -180,5 +190,559 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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 index 3d34e78..8ecfaaf 100644 --- a/docs/RepayLoan.md +++ b/docs/RepayLoan.md @@ -9,5 +9,5 @@ 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 set to false for partial repayment, the repay_amount parameter cannot be greater than the remaining amount to be repaid by the user. | +**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 index e291510..8082201 100644 --- a/docs/RepayRecord.md +++ b/docs/RepayRecord.md @@ -11,13 +11,13 @@ Name | Type | Description | Notes **recordId** | **Long** | Repayment record ID | [optional] **repaidAmount** | **String** | Repayment amount | [optional] **borrowCurrency** | **String** | Borrowed currency | [optional] -**collateralCurrency** | **String** | Collateral | [optional] -**initLtv** | **String** | The initial collateralization rate | [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 quantity before repayment | [optional] -**afterLeftCollateral** | **String** | Collateral quantity 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/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/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 index dc94e6a..9e7096f 100644 --- a/docs/SpotAccountBook.md +++ b/docs/SpotAccountBook.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **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] +**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 ea93ccd..a77f802 100644 --- a/docs/SpotApi.md +++ b/docs/SpotApi.md @@ -4,46 +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 currency pair -[**listTickers**](SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information -[**listOrderBook**](SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book -[**listTrades**](SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades -[**listCandlesticks**](SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks -[**getFee**](SpotApi.md#getFee) | **GET** /spot/fee | Query user trading fee rates -[**getBatchSpotFee**](SpotApi.md#getBatchSpotFee) | **GET** /spot/batch_fee | Query a batch of user trading fee rates -[**listSpotAccounts**](SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts -[**listSpotAccountBook**](SpotApi.md#listSpotAccountBook) | **GET** /spot/account_book | Query account book -[**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 +[**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 -[**amendOrder**](SpotApi.md#amendOrder) | **PATCH** /spot/orders/{order_id} | Amend an order -[**listMyTrades**](SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history +[**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 -[**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 price-triggered order -[**cancelSpotPriceTriggeredOrder**](SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order +[**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 -Currency has two forms: 1. Only currency name, e.g., BTC, USDT 2. `<currency>_<chain>`, e.g., `HT_ETH` The latter one occurs when one currency has multiple chains. Currency detail contains a `chain` field whatever the form is. To retrieve all chains of one currency, you can use use all the details which has the name of the currency or name starting with `<currency>_`. +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 @@ -97,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 @@ -161,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 @@ -227,7 +228,7 @@ No authorization required # **getCurrencyPair** > CurrencyPair getCurrencyPair(currencyPair) -Get details of a specifc currency pair +Query single currency pair details ### Example @@ -285,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).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 @@ -356,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 @@ -384,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) @@ -412,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 @@ -432,15 +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).from(from).to(to).page(page).execute(); -Retrieve market trades +Query market transaction records -You can use `from` and `to` to query by time range, or use `last_id` by scrolling page. The default behavior is by time range. Scrolling query using `last_id` is not recommended any more. If `last_id` is specified, time range query parameters will be ignored. +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 @@ -460,11 +461,11 @@ 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. Default: 100, Minimum: 1, Maximum: 1000 - 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 less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. - Long from = 1627706330L; // Long | Start timestamp of the query - Long to = 1635329650L; // Long | Time range ending, default to current time + 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) @@ -494,11 +495,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currencyPair** | **String**| Currency pair | - **limit** | **Integer**| Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 | [optional] [default to 100] - **lastId** | **String**| Specify list staring point using the `id` of last record in previous list-query results | [optional] - **reverse** | **Boolean**| Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to false] - **from** | **Long**| Start timestamp of the query | [optional] - **to** | **Long**| Time range ending, default to current time | [optional] + **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 @@ -517,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 @@ -545,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. Note that `30d` means 1 natual month, not 30 days + 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) @@ -575,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. Note that `30d` means 1 natual month, not 30 days | [optional] [default to 30m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d, 30d] + **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 @@ -596,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 @@ -627,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); @@ -650,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 @@ -668,13 +669,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getBatchSpotFee** > Map<String, SpotFee> getBatchSpotFee(currencyPairs) -Query a batch of user trading fee rates +Batch query account fee rates ### Example @@ -697,7 +698,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); SpotApi apiInstance = new SpotApi(defaultClient); - String currencyPairs = "BTC_USDT,ETH_USDT"; // String | A request can only query up to 50 currency pairs + String currencyPairs = "BTC_USDT,ETH_USDT"; // String | Maximum 50 currency pairs per request try { Map result = apiInstance.getBatchSpotFee(currencyPairs); System.out.println(result); @@ -718,7 +719,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currencyPairs** | **String**| A request can only query up to 50 currency pairs | + **currencyPairs** | **String**| Maximum 50 currency pairs per request | ### Return type @@ -736,13 +737,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **listSpotAccounts** > List<SpotAccount> listSpotAccounts().currency(currency).execute(); -List spot accounts +List spot trading accounts ### Example @@ -765,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) @@ -788,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 @@ -806,15 +807,15 @@ 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).execute(); +> List<SpotAccountBook> listSpotAccountBook().currency(currency).from(from).to(to).page(page).limit(limit).type(type).code(code).execute(); -Query account book +Query spot account transaction history -Record time range cannot exceed 30 days +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 @@ -837,12 +838,13 @@ 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 - Long from = 1627706330L; // Long | Start timestamp of the query - Long to = 1635329650L; // Long | Time range ending, default to current time + 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 to be returned in a single list - String type = "lend"; // String | Only retrieve changes of the specified type. All types will be returned if not specified. + 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) @@ -851,6 +853,7 @@ public class Example { .page(page) .limit(limit) .type(type) + .code(code) .execute(); System.out.println(result); } catch (GateApiException e) { @@ -870,12 +873,13 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **String**| Retrieve data of the specified currency | [optional] - **from** | **Long**| Start timestamp of the query | [optional] - **to** | **Long**| Time range ending, default to current time | [optional] + **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 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] + **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 @@ -893,15 +897,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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 @@ -925,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())); @@ -946,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 @@ -963,7 +969,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Request is completed | - | +**200** | Request execution completed | - | # **listAllOpenOrders** @@ -971,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,portfolio 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 @@ -996,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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only + String account = "spot"; // String | Specify query account try { List result = apiInstance.listAllOpenOrders() .page(page) @@ -1023,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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] + **account** | **String**| Specify query account | [optional] ### Return type @@ -1041,15 +1047,15 @@ 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 +Close position when cross-currency is disabled -Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998 +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 @@ -1111,7 +1117,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | order created | - | +**201** | Order created successfully | - | # **listOrders** @@ -1119,7 +1125,7 @@ Name | Type | Description | Notes List orders -Spot, portfolio 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 @@ -1142,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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only - Long from = 1627706330L; // Long | Start timestamp of the query - Long to = 1635329650L; // 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) @@ -1177,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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] - **from** | **Long**| Start timestamp of the query | [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 @@ -1202,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, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders.if the user is in portfolio mode, it defaults to the portfolio account. 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. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body +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 @@ -1234,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())); @@ -1255,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 @@ -1272,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, portfolio, 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 @@ -1304,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 - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only + 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())); @@ -1326,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 - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only | [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 @@ -1346,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(cancelBatchOrder) +> 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 @@ -1378,8 +1390,9 @@ public class Example { SpotApi apiInstance = new SpotApi(defaultClient); 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(cancelBatchOrder); + 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())); @@ -1399,6 +1412,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **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 @@ -1422,9 +1436,9 @@ Name | Type | Description | Notes # **getOrder** > Order getOrder(orderId, currencyPair, account) -Get a single order +Query single order details -Spot, portfolio and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin. +By default, queries orders for spot, unified account, and isolated margin accounts. ### Example @@ -1447,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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. - String currencyPair = "BTC_USDT"; // String | Currency pair - String account = "cross_margin"; // String | Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only + 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); @@ -1470,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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. | - **currencyPair** | **String**| Currency pair | - **account** | **String**| Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] + **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 @@ -1494,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,portfolio and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin +By default, orders for spot, unified accounts and leveraged accounts are revoked. ### Example @@ -1521,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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. + 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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only + 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())); @@ -1544,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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. | + **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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] + **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 @@ -1568,11 +1586,11 @@ Name | Type | Description | Notes # **amendOrder** -> Order amendOrder(orderId, currencyPair, orderPatch, account) +> Order amendOrder(orderId, orderPatch, currencyPair, account, xGateExptime) -Amend an order +Amend single order -By default, the orders of spot, portfolio and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: Only reducing the quantity without modifying the priority of matching, altering the price or increasing the quantity will adjust the priority to the new price at the end Note: If the modified amount is less than the fill amount, the order will be cancelled. +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 @@ -1595,12 +1613,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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. - String currencyPair = "BTC_USDT"; // String | Currency pair + 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 account = "cross_margin"; // String | Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only + 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, currencyPair, orderPatch, account); + 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())); @@ -1619,10 +1638,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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. | - **currencyPair** | **String**| Currency pair | + **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)| | - **account** | **String**| Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] + **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 @@ -1640,15 +1660,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Updated | - | +**200** | Updated successfully | - | # **listMyTrades** > 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,portfolio and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range. If you don't specify `from` and/or `to` parameters, only the last 7 days of data will be retured. The range of `from` and `to` is not alloed to exceed 30 days. Time range parameters are handled as order finish time. +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 @@ -1672,12 +1692,12 @@ public class Example { SpotApi apiInstance = new SpotApi(defaultClient); String currencyPair = "BTC_USDT"; // String | Retrieve results with specified currency pair - Integer limit = 100; // Integer | Maximum number of records to be returned in a single list + 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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only - Long from = 1627706330L; // Long | Start timestamp of the query - Long to = 1635329650L; // 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(currencyPair) @@ -1707,12 +1727,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currencyPair** | **String**| Retrieve results with specified currency pair | [optional] - **limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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 ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] - **from** | **Long**| Start timestamp of the query | [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 @@ -1730,7 +1750,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **getSystemTime** @@ -1790,7 +1810,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **countdownCancelAllSpot** @@ -1798,7 +1818,7 @@ No authorization required Countdown cancel orders -When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. +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 @@ -1860,15 +1880,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Set countdown successfully | - | +**200** | Countdown set successfully | - | # **amendBatchOrders** -> List<AmendOrderResult> amendBatchOrders(batchAmendItem) +> List<BatchOrder> amendBatchOrders(batchAmendItem, xGateExptime) Batch modification of orders -Default modification of orders for spot, portfolio, and margin accounts. To modify orders for a cross margin account, the `account` parameter must be specified as `cross_margin`. For portfolio margin accounts, the `account` parameter can only be specified as `cross_margin`. Currently, only modifications to price or quantity (choose one) are supported. When modifying unfinished orders, a maximum of 5 orders can be batch-modified in one request. The request parameters should be passed in an array format. During batch modification, if one order modification fails, the modification process will continue with the next order. After execution, the response will include corresponding failure information for the failed orders. The sequence of calling for batch order modification should be consistent with the order in the order list. The response content order for batch order modification will also be consistent with the order in the order list. +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 @@ -1892,8 +1912,9 @@ public class Example { 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); + 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())); @@ -1913,10 +1934,11 @@ public class Example { 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<AmendOrderResult>**](AmendOrderResult.md) +[**List<BatchOrder>**](BatchOrder.md) ### Authorization @@ -1932,11 +1954,88 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **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 @@ -1959,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 type. Portfolio margin account must set to `cross_margin` - 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) @@ -1989,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 type. Portfolio margin account must set to `cross_margin` | [optional] [enum: normal, margin, cross_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 @@ -2011,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 @@ -2079,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 @@ -2108,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 type. Portfolio margin account must set to `cross_margin` + 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); @@ -2130,8 +2229,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **market** | **String**| Currency pair | [optional] - **account** | **String**| Trading account type. Portfolio margin account must set to `cross_margin` | [optional] [enum: normal, margin, cross_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 @@ -2149,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 price-triggered order +Query single auto order details ### Example @@ -2178,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); @@ -2199,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 @@ -2217,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 price-triggered order +Cancel single auto order ### Example @@ -2246,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); @@ -2267,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 @@ -2285,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 index 1e454b5..4af52ff 100644 --- a/docs/SpotFee.md +++ b/docs/SpotFee.md @@ -8,10 +8,11 @@ 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] +**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 7cd61be..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 account type. Portfolio margin account must set to `cross_margin` - normal: spot trading - margin: margin trading - cross_margin: cross_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,7 +35,7 @@ Name | Value ---- | ----- NORMAL | "normal" MARGIN | "margin" -CROSS_MARGIN | "cross_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 818c34d..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** | **Long** | Creation time | [optional] [readonly] -**ftime** | **Long** | 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 index 42eaa7b..732f17c 100644 --- a/docs/StpGroup.md +++ b/docs/StpGroup.md @@ -8,5 +8,5 @@ Name | Type | Description | Notes **id** | **Long** | STP Group ID | [optional] **name** | **String** | STP Group name | **creatorId** | **Long** | Creator ID | [optional] -**createTime** | **Long** | Creation time | [optional] +**createTime** | **Long** | Created time | [optional] diff --git a/docs/StpGroupUser.md b/docs/StpGroupUser.md index fc9787d..b873a7c 100644 --- a/docs/StpGroupUser.md +++ b/docs/StpGroupUser.md @@ -7,5 +7,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **userId** | **Long** | User ID | [optional] **stpId** | **Long** | STP Group ID | [optional] -**createTime** | **Long** | Creation time | [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 index b0ab679..277844e 100644 --- a/docs/SubAccount.md +++ b/docs/SubAccount.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**remark** | **String** | custom text | [optional] -**loginName** | **String** | Sub-account login name: Only letters, numbers and underscores are supported, and cannot contain other illegal characters | +**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** | State: 1-normal, 2-locked\" | [optional] [readonly] -**type** | **Integer** | \"Sub-account type: 1 - sub-account, 3 - cross margin account | [optional] [readonly] -**userId** | **Long** | The user id of the sub-account | [optional] [readonly] +**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 index f2a1246..439800d 100644 --- a/docs/SubAccountApi.md +++ b/docs/SubAccountApi.md @@ -6,14 +6,15 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**listSubAccounts**](SubAccountApi.md#listSubAccounts) | **GET** /sub_accounts | List sub-accounts [**createSubAccounts**](SubAccountApi.md#createSubAccounts) | **POST** /sub_accounts | Create a new sub-account -[**getSubAccount**](SubAccountApi.md#getSubAccount) | **GET** /sub_accounts/{user_id} | Get the sub-account -[**listSubAccountKeys**](SubAccountApi.md#listSubAccountKeys) | **GET** /sub_accounts/{user_id}/keys | List all API Key of the sub-account -[**createSubAccountKeys**](SubAccountApi.md#createSubAccountKeys) | **POST** /sub_accounts/{user_id}/keys | Create API Key of the sub-account -[**getSubAccountKey**](SubAccountApi.md#getSubAccountKey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account -[**updateSubAccountKeys**](SubAccountApi.md#updateSubAccountKeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account -[**deleteSubAccountKeys**](SubAccountApi.md#deleteSubAccountKeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account -[**lockSubAccount**](SubAccountApi.md#lockSubAccount) | **POST** /sub_accounts/{user_id}/lock | Lock the sub-account -[**unlockSubAccount**](SubAccountApi.md#unlockSubAccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock the sub-account +[**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 @@ -43,7 +44,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); SubAccountApi apiInstance = new SubAccountApi(defaultClient); - String type = "0"; // String | `0` to list all types of sub-accounts (currently supporting cross margin accounts and sub-accounts). `1` to list sub-accounts only. If no parameter is passed, only sub-accounts will be listed by default. + 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) @@ -66,7 +67,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type** | **String**| `0` to list all types of sub-accounts (currently supporting cross margin accounts and sub-accounts). `1` to list sub-accounts only. If no parameter is passed, only sub-accounts will be listed by default. | [optional] + **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 @@ -84,7 +85,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **createSubAccounts** @@ -152,13 +153,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Created Successfully | - | +**201** | Created successfully | - | # **getSubAccount** > SubAccount getSubAccount(userId) -Get the sub-account +Get sub-account ### Example @@ -181,7 +182,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); SubAccountApi apiInstance = new SubAccountApi(defaultClient); - Long userId = 56L; // Long | Sub-account user id + Long userId = 56L; // Long | Sub-account user ID try { SubAccount result = apiInstance.getSubAccount(userId); System.out.println(result); @@ -202,7 +203,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Long**| Sub-account user id | + **userId** | **Long**| Sub-account user ID | ### Return type @@ -220,13 +221,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful | - | +**200** | Successfully retrieved | - | # **listSubAccountKeys** > List<SubAccountKey> listSubAccountKeys(userId) -List all API Key of the sub-account +List all API key pairs of the sub-account ### Example @@ -249,7 +250,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); SubAccountApi apiInstance = new SubAccountApi(defaultClient); - Integer userId = 56; // Integer | Sub-account user id + Integer userId = 56; // Integer | Sub-account user ID try { List result = apiInstance.listSubAccountKeys(userId); System.out.println(result); @@ -270,7 +271,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Integer**| Sub-account user id | + **userId** | **Integer**| Sub-account user ID | ### Return type @@ -288,13 +289,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **createSubAccountKeys** -> List<SubAccountKey> createSubAccountKeys(userId, subAccountKey) +> SubAccountKey createSubAccountKeys(userId, subAccountKey) -Create API Key of the sub-account +Create new sub-account API key pair ### Example @@ -317,10 +318,10 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); SubAccountApi apiInstance = new SubAccountApi(defaultClient); - Long userId = 56L; // Long | Sub-account user id + Long userId = 56L; // Long | Sub-account user ID SubAccountKey subAccountKey = new SubAccountKey(); // SubAccountKey | try { - List result = apiInstance.createSubAccountKeys(userId, subAccountKey); + 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())); @@ -339,12 +340,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Long**| Sub-account user id | + **userId** | **Long**| Sub-account user ID | **subAccountKey** | [**SubAccountKey**](SubAccountKey.md)| | ### Return type -[**List<SubAccountKey>**](SubAccountKey.md) +[**SubAccountKey**](SubAccountKey.md) ### Authorization @@ -358,13 +359,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Created Successfully | - | +**200** | Created successfully | - | # **getSubAccountKey** > SubAccountKey getSubAccountKey(userId, key) -Get the API Key of the sub-account +Get specific API key pair of the sub-account ### Example @@ -387,8 +388,8 @@ public class Example { 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 | The API Key of the sub-account + 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); @@ -409,8 +410,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Integer**| Sub-account user id | - **key** | **String**| The API Key of the sub-account | + **userId** | **Integer**| Sub-account user ID | + **key** | **String**| Sub-account API key | ### Return type @@ -428,13 +429,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful | - | +**200** | Successfully retrieved | - | # **updateSubAccountKeys** > updateSubAccountKeys(userId, key, subAccountKey) -Update API key of the sub-account +Update sub-account API key pair ### Example @@ -457,8 +458,8 @@ public class Example { 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 | The API Key of the sub-account + 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); @@ -479,8 +480,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Integer**| Sub-account user id | - **key** | **String**| The API Key of the sub-account | + **userId** | **Integer**| Sub-account user ID | + **key** | **String**| Sub-account API key | **subAccountKey** | [**SubAccountKey**](SubAccountKey.md)| | ### Return type @@ -499,13 +500,13 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Updated | - | +**204** | Updated successfully | - | # **deleteSubAccountKeys** > deleteSubAccountKeys(userId, key) -Delete API key of the sub-account +Delete sub-account API key pair ### Example @@ -528,8 +529,8 @@ public class Example { 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 | The API Key of the sub-account + 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) { @@ -549,8 +550,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Integer**| Sub-account user id | - **key** | **String**| The API Key of the sub-account | + **userId** | **Integer**| Sub-account user ID | + **key** | **String**| Sub-account API key | ### Return type @@ -568,13 +569,13 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Delete successfully | - | +**204** | Deleted successfully | - | # **lockSubAccount** > lockSubAccount(userId) -Lock the sub-account +Lock sub-account ### Example @@ -597,7 +598,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); SubAccountApi apiInstance = new SubAccountApi(defaultClient); - Long userId = 56L; // Long | The user id of the sub-account + Long userId = 56L; // Long | Sub-account user ID try { apiInstance.lockSubAccount(userId); } catch (GateApiException e) { @@ -617,7 +618,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Long**| The user id of the sub-account | + **userId** | **Long**| Sub-account user ID | ### Return type @@ -635,13 +636,13 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Lock successfully | - | +**204** | Locked successfully | - | # **unlockSubAccount** > unlockSubAccount(userId) -Unlock the sub-account +Unlock sub-account ### Example @@ -664,7 +665,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); SubAccountApi apiInstance = new SubAccountApi(defaultClient); - Long userId = 56L; // Long | The user id of the sub-account + Long userId = 56L; // Long | Sub-account user ID try { apiInstance.unlockSubAccount(userId); } catch (GateApiException e) { @@ -684,7 +685,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **userId** | **Long**| The user id of the sub-account | + **userId** | **Long**| Sub-account user ID | ### Return type @@ -702,5 +703,71 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Unlock successfully | - | +**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/SubAccountKey.md b/docs/SubAccountKey.md index 4a07dcc..a9700da 100644 --- a/docs/SubAccountKey.md +++ b/docs/SubAccountKey.md @@ -5,13 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**userId** | **String** | User ID | [optional] [readonly] +**userId** | **Long** | User ID | [optional] [readonly] **mode** | **Integer** | Mode: 1 - classic 2 - portfolio account | [optional] -**name** | **String** | API key name | [optional] -**perms** | [**List<ApiV4KeyPerm>**](ApiV4KeyPerm.md) | | [optional] -**ipWhitelist** | **List<String>** | ip white list (list will be removed if no value is passed) | [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** | State 1 - normal 2 - locked 3 - frozen | [optional] [readonly] -**createdAt** | **String** | Creation time | [optional] [readonly] -**updatedAt** | **String** | Last update time | [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/SubAccountToSubAccount.md b/docs/SubAccountToSubAccount.md index 1f24f95..c15d433 100644 --- a/docs/SubAccountToSubAccount.md +++ b/docs/SubAccountToSubAccount.md @@ -6,26 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Transfer currency name | -**subAccountType** | **String** | Transfer from the account. (deprecate, use `sub_account_from_type` and `sub_account_to_type` instead) | [optional] +**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** | [**SubAccountFromTypeEnum**](#SubAccountFromTypeEnum) | Transfer from the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin 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** | [**SubAccountToTypeEnum**](#SubAccountToTypeEnum) | Transfer to the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account | +**subAccountToType** | **String** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account | **amount** | **String** | Transfer amount | -## Enum: SubAccountFromTypeEnum - -Name | Value ----- | ----- -SPOT | "spot" -FUTURES | "futures" -CROSS_MARGIN | "cross_margin" - -## Enum: SubAccountToTypeEnum - -Name | Value ----- | ----- -SPOT | "spot" -FUTURES | "futures" -CROSS_MARGIN | "cross_margin" - diff --git a/docs/SubAccountTransfer.md b/docs/SubAccountTransfer.md index 030a646..dca8285 100644 --- a/docs/SubAccountTransfer.md +++ b/docs/SubAccountTransfer.md @@ -5,29 +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] -**clientOrderId** | **String** | The custom ID provided by the customer serves as a safeguard against duplicate transfers. It can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_', with a length ranging from 1 to 64 characters. | [optional] -**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, `cross_margin` - cross margin account, `delivery` - delivery account | [optional] - -## Enum: DirectionEnum - -Name | Value ----- | ----- -TO | "to" -FROM | "from" - -## Enum: SubAccountTypeEnum - -Name | Value ----- | ----- -SPOT | "spot" -FUTURES | "futures" -CROSS_MARGIN | "cross_margin" -DELIVERY | "delivery" +**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 index 5c63978..d8c4f02 100644 --- a/docs/SubCrossMarginAccount.md +++ b/docs/SubCrossMarginAccount.md @@ -5,16 +5,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**userId** | **Long** | User ID of the cross margin account. 0 means that the subaccount has not yet opened a cross margin account | [optional] -**locked** | **Boolean** | Whether account is locked | [optional] -**balances** | [**Map<String, CrossMarginBalance1>**](CrossMarginBalance1.md) | | [optional] +**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 * borrowed factor | [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 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] +**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] 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/Ticker.md b/docs/Ticker.md index eb0db42..77c5da5 100644 --- a/docs/Ticker.md +++ b/docs/Ticker.md @@ -8,16 +8,18 @@ Name | Type | Description | Notes **currencyPair** | **String** | Currency pair | [optional] **last** | **String** | Last trading price | [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] -**changePercentage** | **String** | Change percentage in the last 24h | [optional] -**changeUtc0** | **String** | utc0 timezone, the percentage change in the last 24 hours | [optional] -**changeUtc8** | **String** | utc8 timezone, the percentage change in the last 24 hours | [optional] -**baseVolume** | **String** | Base currency trade volume in the last 24h | [optional] -**quoteVolume** | **String** | Quote currency trade volume in the last 24h | [optional] -**high24h** | **String** | Highest price in 24h | [optional] -**low24h** | **String** | Lowest price in 24h | [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 b421b47..fb513ba 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -5,22 +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. No value in public endpoints | [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. No value in public endpoints | [optional] -**gtFee** | **String** | GT used to deduct fee. No value in public endpoints | [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** | Represents a unique and consecutive trade ID within a single market. It is used to track and identify trades in the specific market | [optional] -**text** | **String** | User defined information. No value in public endpoints | [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 054ded9..cb01b2d 100644 --- a/docs/TradeFee.md +++ b/docs/TradeFee.md @@ -8,13 +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] -**deliveryTakerFee** | **String** | Delivery trading taker fee | [optional] -**deliveryMakerFee** | **String** | Delivery 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 index 204d2e6..9431f79 100644 --- a/docs/TransactionID.md +++ b/docs/TransactionID.md @@ -5,5 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**txId** | **Long** | Order id | [optional] +**txId** | **Long** | Order ID | [optional] diff --git a/docs/Transfer.md b/docs/Transfer.md index 9f6955c..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 - `options`: options 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 transferring from or to futures account | [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,6 @@ SPOT | "spot" MARGIN | "margin" FUTURES | "futures" DELIVERY | "delivery" -CROSS_MARGIN | "cross_margin" OPTIONS | "options" ## Enum: ToEnum @@ -33,6 +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/CrossMarginTransferable.md b/docs/TransferablesResult.md similarity index 53% rename from docs/CrossMarginTransferable.md rename to docs/TransferablesResult.md index ba551b9..53216b6 100644 --- a/docs/CrossMarginTransferable.md +++ b/docs/TransferablesResult.md @@ -1,10 +1,12 @@ -# CrossMarginTransferable +# TransferablesResult + +Batch query unified account maximum transferable results ## 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/TriggerTime.md b/docs/TriggerTime.md index 1e8e196..1eb4c55 100644 --- a/docs/TriggerTime.md +++ b/docs/TriggerTime.md @@ -5,5 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**triggerTime** | **Long** | Timestamp of the end of the countdown, in milliseconds | [optional] +**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 index 09aac84..0cc1548 100644 --- a/docs/UniCurrency.md +++ b/docs/UniCurrency.md @@ -8,7 +8,7 @@ Currency detail Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency name | [optional] [readonly] -**minLendAmount** | **String** | The minimum lending amount, in the unit of the currency. | [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 index 5693395..212afc2 100644 --- a/docs/UniCurrencyInterest.md +++ b/docs/UniCurrencyInterest.md @@ -6,5 +6,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency | [optional] [readonly] -**interestStatus** | **String** | Interest status: interest_dividend - regular dividend, interest_reinvest - interest reinvestment | [optional] [readonly] +**interestStatus** | **String** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly] diff --git a/docs/UniInterestMode.md b/docs/UniInterestMode.md deleted file mode 100644 index 2680536..0000000 --- a/docs/UniInterestMode.md +++ /dev/null @@ -1,12 +0,0 @@ - -# UniInterestMode - -余币宝利息复投开关 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency** | **String** | Currency | -**status** | **Boolean** | Interest toggle settings, true - interest reinvestment, false - regular dividend | - diff --git a/docs/UniInterestRecord.md b/docs/UniInterestRecord.md index 77d22bf..bd2d474 100644 --- a/docs/UniInterestRecord.md +++ b/docs/UniInterestRecord.md @@ -11,6 +11,6 @@ Name | Type | Description | Notes **currency** | **String** | Currency | [optional] [readonly] **actualRate** | **String** | Actual Rate | [optional] [readonly] **interest** | **String** | Interest | [optional] [readonly] -**interestStatus** | **String** | Interest status: interest_dividend - regular dividend, interest_reinvest - interest reinvestment | [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 index 51970dd..961d0ab 100644 --- a/docs/UniLend.md +++ b/docs/UniLend.md @@ -9,12 +9,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency | [optional] [readonly] **currentAmount** | **String** | Current amount | [optional] [readonly] -**amount** | **String** | Total amount | [optional] [readonly] -**lentAmount** | **String** | Lent amount | [optional] [readonly] -**frozenAmount** | **String** | Frozen 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 - regular dividend, interest_reinvest - interest reinvestment | [optional] [readonly] -**reinvestLeftAmount** | **String** | Amount not reinvested | [optional] [readonly] -**createTime** | **Long** | Created time of the lending order | [optional] [readonly] -**updateTime** | **Long** | Upated time of the lending order | [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 index 005a1d9..feaaf25 100644 --- a/docs/UniLendInterest.md +++ b/docs/UniLendInterest.md @@ -6,5 +6,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency | [optional] [readonly] -**interest** | **String** | Interest | [optional] [readonly] +**interest** | **String** | Interest income | [optional] [readonly] diff --git a/docs/UniLendRecord.md b/docs/UniLendRecord.md index 3f056c5..fef9b1b 100644 --- a/docs/UniLendRecord.md +++ b/docs/UniLendRecord.md @@ -1,17 +1,17 @@ # UniLendRecord -Interest Record +Lending Record ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency name | [optional] [readonly] -**amount** | **String** | current amount | [optional] [readonly] -**lastWalletAmount** | **String** | Last wallet amount | [optional] [readonly] -**lastLentAmount** | **String** | Last lent amount | [optional] [readonly] -**lastFrozenAmount** | **String** | Last frozen amount | [optional] [readonly] -**type** | **String** | Record type: lend - lend, redeem - redeem | [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 index 005a035..758c1ed 100644 --- a/docs/UniLoan.md +++ b/docs/UniLoan.md @@ -1,7 +1,7 @@ # UniLoan -Loan +Borrowing ## Properties @@ -9,7 +9,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency | [optional] [readonly] **currencyPair** | **String** | Currency pair | [optional] [readonly] -**amount** | **String** | amount | [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** | Updated time | [optional] [readonly] +**updateTime** | **Long** | Last Update Time | [optional] [readonly] diff --git a/docs/UniLoanInterestRecord.md b/docs/UniLoanInterestRecord.md index 209d6de..31bfe46 100644 --- a/docs/UniLoanInterestRecord.md +++ b/docs/UniLoanInterestRecord.md @@ -1,7 +1,7 @@ # UniLoanInterestRecord -Interest record +Interest Deduction Record ## Properties @@ -9,8 +9,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency name | [optional] [readonly] **currencyPair** | **String** | Currency pair | [optional] [readonly] -**actualRate** | **String** | Actual rate | [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 index 2324db8..9adc6ee 100644 --- a/docs/UniLoanRecord.md +++ b/docs/UniLoanRecord.md @@ -1,15 +1,15 @@ # UniLoanRecord -Loan records +Borrowing Records ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **String** | type: borrow - borrow, repay - repay | [optional] [readonly] +**type** | **String** | Type: `borrow` - borrow, `repay` - repay | [optional] [readonly] **currencyPair** | **String** | Currency pair | [optional] [readonly] **currency** | **String** | Currency | [optional] [readonly] -**amount** | **String** | The amount of lending or repaying | [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/PortfolioBorrowable.md b/docs/UnifiedBorrowable.md similarity index 91% rename from docs/PortfolioBorrowable.md rename to docs/UnifiedBorrowable.md index c90adbd..f23cf0a 100644 --- a/docs/PortfolioBorrowable.md +++ b/docs/UnifiedBorrowable.md @@ -1,5 +1,5 @@ -# PortfolioBorrowable +# 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/CrossMarginBorrowable.md b/docs/UnifiedTransferable.md similarity index 65% rename from docs/CrossMarginBorrowable.md rename to docs/UnifiedTransferable.md index faec447..23e6b01 100644 --- a/docs/CrossMarginBorrowable.md +++ b/docs/UnifiedTransferable.md @@ -1,10 +1,10 @@ -# CrossMarginBorrowable +# UnifiedTransferable ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **String** | Currency detail | [optional] -**amount** | **String** | Max borrowable amount | [optional] +**amount** | **String** | Maximum transferable amount | [optional] diff --git a/docs/UserLtvInfo.md b/docs/UserLtvInfo.md index 9577c0c..0298471 100644 --- a/docs/UserLtvInfo.md +++ b/docs/UserLtvInfo.md @@ -7,11 +7,11 @@ User's currency statistics data Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**collateralCurrency** | **String** | Collateral | [optional] +**collateralCurrency** | **String** | Collateral currency | [optional] **borrowCurrency** | **String** | Borrowed currency | [optional] -**initLtv** | **String** | The initial collateralization rate | [optional] -**alertLtv** | **String** | Warning collateralization ratio | [optional] -**liquidateLtv** | **String** | The liquidation collateralization rate | [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 index e95cc61..0dfe968 100644 --- a/docs/UserTotalAmount.md +++ b/docs/UserTotalAmount.md @@ -1,12 +1,12 @@ # UserTotalAmount -Total borrowed amount and pledged collateral amount by the user +User's total borrowing and collateral amount ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**borrowAmount** | **String** | Total borrowing amount, calculated in USDT | [optional] -**collateralAmount** | **String** | Total collateral amount, calculated in USDT | [optional] +**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 c7448e9..1fedfb4 100644 --- a/docs/WalletApi.md +++ b/docs/WalletApi.md @@ -4,29 +4,34 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listCurrencyChains**](WalletApi.md#listCurrencyChains) | **GET** /wallet/currency_chains | List chains supported for specified currency +[**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 -[**subAccountToSubAccount**](WalletApi.md#subAccountToSubAccount) | **POST** /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account -[**listWithdrawStatus**](WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status -[**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances -[**listSubAccountMarginBalances**](WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances -[**listSubAccountFuturesBalances**](WalletApi.md#listSubAccountFuturesBalances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances -[**listSubAccountCrossMarginBalances**](WalletApi.md#listSubAccountCrossMarginBalances) | **GET** /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info -[**listSavedAddress**](WalletApi.md#listSavedAddress) | **GET** /wallet/saved_address | Query saved address -[**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) -List chains supported for specified currency +Query chains supported for specified currency ### Example @@ -84,7 +89,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getDepositAddress** @@ -156,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 @@ -183,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) @@ -214,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 @@ -236,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 @@ -267,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) @@ -298,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 @@ -320,7 +334,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **transfer** @@ -328,7 +342,7 @@ Name | Type | Description | Notes 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 5. spot - options +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 @@ -390,15 +404,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | 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 @@ -421,13 +435,13 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); WalletApi apiInstance = new WalletApi(defaultClient); - String subUid = "10003"; // String | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts - 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) @@ -452,15 +466,15 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] - **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 @@ -474,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 @@ -507,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(); @@ -529,7 +544,7 @@ Name | Type | Description | Notes ### Return type -null (empty response body) +[**TransactionID**](TransactionID.md) ### Authorization @@ -538,20 +553,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 | - | # **subAccountToSubAccount** -> subAccountToSubAccount(subAccountToSubAccount) +> TransactionID subAccountToSubAccount(subAccountToSubAccount) -Sub-account transfers to sub-account +Transfer between sub-accounts -It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer. +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 @@ -576,7 +591,8 @@ public class Example { WalletApi apiInstance = new WalletApi(defaultClient); SubAccountToSubAccount subAccountToSubAccount = new SubAccountToSubAccount(); // SubAccountToSubAccount | try { - apiInstance.subAccountToSubAccount(subAccountToSubAccount); + 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(); @@ -598,7 +614,7 @@ Name | Type | Description | Notes ### Return type -null (empty response body) +[**TransactionID**](TransactionID.md) ### Authorization @@ -607,18 +623,93 @@ 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 | - | + + +# **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 @@ -641,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) @@ -664,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 @@ -682,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 @@ -711,7 +802,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); WalletApi apiInstance = new WalletApi(defaultClient); - String subUid = "10003"; // String | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts + 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) @@ -734,7 +825,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] + **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 @@ -752,13 +843,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listSubAccountMarginBalances** > List<SubAccountMarginBalance> listSubAccountMarginBalances().subUid(subUid).execute(); -Query sub accounts' margin balances +Query sub-account isolated margin account balance information ### Example @@ -781,7 +872,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); WalletApi apiInstance = new WalletApi(defaultClient); - String subUid = "10003"; // String | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts + 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.listSubAccountMarginBalances() .subUid(subUid) @@ -804,7 +895,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] + **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 @@ -822,13 +913,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listSubAccountFuturesBalances** > List<SubAccountFuturesBalance> listSubAccountFuturesBalances().subUid(subUid).settle(settle).execute(); -Query sub accounts' futures account balances +Query sub-account perpetual futures account balance information ### Example @@ -851,8 +942,8 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); WalletApi apiInstance = new WalletApi(defaultClient); - String subUid = "10003"; // String | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts - String settle = "usdt"; // String | Query only balances of specified settle currency + 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 { List result = apiInstance.listSubAccountFuturesBalances() .subUid(subUid) @@ -876,8 +967,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] - **settle** | **String**| Query only balances of specified settle currency | [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] + **settle** | **String**| Query balance of specified settlement currency | [optional] ### Return type @@ -895,13 +986,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listSubAccountCrossMarginBalances** > List<SubAccountCrossMarginBalance> listSubAccountCrossMarginBalances().subUid(subUid).execute(); -Query subaccount's cross_margin account info +Query sub-account cross margin account balance information ### Example @@ -924,7 +1015,7 @@ public class Example { defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET"); WalletApi apiInstance = new WalletApi(defaultClient); - String subUid = "10003"; // String | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts + 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) @@ -947,7 +1038,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subUid** | **String**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] + **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 @@ -965,13 +1056,13 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | List retrieved successfully | - | # **listSavedAddress** -> List<SavedAddress> listSavedAddress(currency).chain(chain).limit(limit).execute(); +> List<SavedAddress> listSavedAddress(currency).chain(chain).limit(limit).page(page).execute(); -Query saved address +Query withdrawal address whitelist ### Example @@ -996,11 +1087,13 @@ public class Example { WalletApi apiInstance = new WalletApi(defaultClient); String currency = "USDT"; // String | Currency String chain = "\"\""; // String | Chain name - String limit = "\"50\""; // String | Maximum number returned, 100 at most + 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) { @@ -1022,7 +1115,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **String**| Currency | **chain** | **String**| Chain name | [optional] [default to ""] - **limit** | **String**| Maximum number returned, 100 at most | [optional] [default to "50"] + **limit** | **String**| Maximum number returned, up to 100 | [optional] [default to "50"] + **page** | **Integer**| Page number | [optional] [default to 1] ### Return type @@ -1040,13 +1134,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).settle(settle).execute(); -Retrieve personal trading fee +Query personal trading fees ### Example @@ -1069,8 +1163,8 @@ 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 settle = "BTC"; // String | Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. + 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) @@ -1094,8 +1188,8 @@ 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] - **settle** | **String**| Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. | [optional] [enum: BTC, USDT, USD] + **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 @@ -1113,15 +1207,15 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Query successful | - | # **getTotalBalance** > TotalBalance getTotalBalance().currency(currency).execute(); -Retrieve user's total balances +Query personal account totals -This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation. For trading calculation, use the corresponding account query endpoint for each account type. For example: - `GET /spot/accounts` to query spot account balance - `GET /margin/accounts` to query margin account balance - `GET /futures/{settle}/accounts` to query futures account balance +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 @@ -1144,7 +1238,7 @@ 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 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) @@ -1167,7 +1261,7 @@ 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"] + **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 @@ -1185,5 +1279,297 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Request is valid and is successfully responded | - | +**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 + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**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/gradlew b/gradlew old mode 100755 new mode 100644 diff --git a/pom.xml b/pom.xml index b3d7201..66fdb7c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,8 +5,8 @@ gate-api jar gate-api - 6.57.0 - 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/ 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 3e93422..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.57.0/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 index afef326..3e3d775 100644 --- a/src/main/java/io/gate/gateapi/api/AccountApi.java +++ b/src/main/java/io/gate/gateapi/api/AccountApi.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.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; @@ -57,7 +59,7 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
Status Code Description Response Headers
200 Successful -
200 Successfully retrieved -
*/ public okhttp3.Call getAccountDetailCall(final ApiCallback _callback) throws ApiException { @@ -96,14 +98,14 @@ private okhttp3.Call getAccountDetailValidateBeforeCall(final ApiCallback _callb } /** - * Get account detail + * 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 Successful -
200 Successfully retrieved -
*/ public AccountDetail getAccountDetail() throws ApiException { @@ -112,14 +114,14 @@ public AccountDetail getAccountDetail() throws ApiException { } /** - * Get account detail + * 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 Successful -
200 Successfully retrieved -
*/ public ApiResponse getAccountDetailWithHttpInfo() throws ApiException { @@ -129,7 +131,7 @@ public ApiResponse getAccountDetailWithHttpInfo() throws ApiExcep } /** - * Get account detail (asynchronously) + * Retrieve user account information (asynchronously) * * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -137,7 +139,7 @@ public ApiResponse getAccountDetailWithHttpInfo() throws ApiExcep * @http.response.details - +
Status Code Description Response Headers
200 Successful -
200 Successfully retrieved -
*/ public okhttp3.Call getAccountDetailAsync(final ApiCallback _callback) throws ApiException { @@ -147,6 +149,104 @@ public okhttp3.Call getAccountDetailAsync(final ApiCallback _call 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; @@ -208,7 +308,7 @@ private APIlistSTPGroupsRequest() { /** * Set name - * @param name Perform a fuzzy search based on the name (optional) + * @param name Fuzzy search by name (optional) * @return APIlistSTPGroupsRequest */ public APIlistSTPGroupsRequest name(String name) { @@ -224,7 +324,7 @@ public APIlistSTPGroupsRequest name(String name) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -238,7 +338,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 { @@ -253,7 +353,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 { @@ -268,7 +368,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 { @@ -277,13 +377,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) th } /** - * List STP Groups - * Retrieve the list of STP groups created by the main account user only + * 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 -
200 List retrieved successfully -
*/ public APIlistSTPGroupsRequest listSTPGroups() { @@ -299,7 +399,7 @@ public APIlistSTPGroupsRequest listSTPGroups() { * @http.response.details - +
Status Code Description Response Headers
200 User added successfully. Returning the current users within the STP group. -
200 User added successfully, returning current users in the STP group -
*/ public okhttp3.Call createSTPGroupCall(StpGroup stpGroup, final ApiCallback _callback) throws ApiException { @@ -343,7 +443,7 @@ private okhttp3.Call createSTPGroupValidateBeforeCall(StpGroup stpGroup, final A } /** - * Create STP Group + * Create STP user group * Only the main account is allowed to create a new STP user group * @param stpGroup (required) * @return StpGroup @@ -351,7 +451,7 @@ private okhttp3.Call createSTPGroupValidateBeforeCall(StpGroup stpGroup, final A * @http.response.details - +
Status Code Description Response Headers
200 User added successfully. Returning the current users within the STP group. -
200 User added successfully, returning current users in the STP group -
*/ public StpGroup createSTPGroup(StpGroup stpGroup) throws ApiException { @@ -360,7 +460,7 @@ public StpGroup createSTPGroup(StpGroup stpGroup) throws ApiException { } /** - * Create STP Group + * Create STP user group * Only the main account is allowed to create a new STP user group * @param stpGroup (required) * @return ApiResponse<StpGroup> @@ -368,7 +468,7 @@ public StpGroup createSTPGroup(StpGroup stpGroup) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 User added successfully. Returning the current users within the STP group. -
200 User added successfully, returning current users in the STP group -
*/ public ApiResponse createSTPGroupWithHttpInfo(StpGroup stpGroup) throws ApiException { @@ -378,7 +478,7 @@ public ApiResponse createSTPGroupWithHttpInfo(StpGroup stpGroup) throw } /** - * Create STP Group (asynchronously) + * 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 @@ -387,7 +487,7 @@ public ApiResponse createSTPGroupWithHttpInfo(StpGroup stpGroup) throw * @http.response.details - +
Status Code Description Response Headers
200 User added successfully. Returning the current users within the STP group. -
200 User added successfully, returning current users in the STP group -
*/ public okhttp3.Call createSTPGroupAsync(StpGroup stpGroup, final ApiCallback _callback) throws ApiException { @@ -406,7 +506,7 @@ public okhttp3.Call createSTPGroupAsync(StpGroup stpGroup, final ApiCallback Status Code Description Response Headers - 200 List retrieved - + 200 List retrieved successfully - */ public okhttp3.Call listSTPGroupsUsersCall(Long stpId, final ApiCallback _callback) throws ApiException { @@ -451,15 +551,15 @@ private okhttp3.Call listSTPGroupsUsersValidateBeforeCall(Long stpId, final ApiC } /** - * List users of the STP group - * Only the main account that created this STP group is allowed to list the user ID of the STP group + * 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 -
200 List retrieved successfully -
*/ public List listSTPGroupsUsers(Long stpId) throws ApiException { @@ -468,15 +568,15 @@ public List listSTPGroupsUsers(Long stpId) throws ApiException { } /** - * List users of the STP group - * Only the main account that created this STP group is allowed to list the user ID of the STP group + * 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 -
200 List retrieved successfully -
*/ public ApiResponse> listSTPGroupsUsersWithHttpInfo(Long stpId) throws ApiException { @@ -486,8 +586,8 @@ public ApiResponse> listSTPGroupsUsersWithHttpInfo(Long stpId } /** - * List users of the STP group (asynchronously) - * Only the main account that created this STP group is allowed to list the user ID of the STP group + * 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 @@ -495,7 +595,7 @@ public ApiResponse> listSTPGroupsUsersWithHttpInfo(Long stpId * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listSTPGroupsUsersAsync(Long stpId, final ApiCallback> _callback) throws ApiException { @@ -515,7 +615,7 @@ public okhttp3.Call listSTPGroupsUsersAsync(Long stpId, final ApiCallback Status Code Description Response Headers - 200 User added successfully. Returning the current users within the STP group. - + 200 User added successfully, returning current users in the STP group - */ public okhttp3.Call addSTPGroupUsersCall(Long stpId, List requestBody, final ApiCallback _callback) throws ApiException { @@ -565,8 +665,8 @@ private okhttp3.Call addSTPGroupUsersValidateBeforeCall(Long stpId, List r } /** - * Add users to the STP group - * - Only the master account that created the STP user group is allowed to add users to the STP user group.- Only accounts under the main account are allowed to be added. Cross-account is not permitted + * 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> @@ -574,7 +674,7 @@ private okhttp3.Call addSTPGroupUsersValidateBeforeCall(Long stpId, List r * @http.response.details - +
Status Code Description Response Headers
200 User added successfully. Returning the current users within the STP group. -
200 User added successfully, returning current users in the STP group -
*/ public List addSTPGroupUsers(Long stpId, List requestBody) throws ApiException { @@ -583,8 +683,8 @@ public List addSTPGroupUsers(Long stpId, List requestBody) t } /** - * Add users to the STP group - * - Only the master account that created the STP user group is allowed to add users to the STP user group.- Only accounts under the main account are allowed to be added. Cross-account is not permitted + * 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>> @@ -592,7 +692,7 @@ public List addSTPGroupUsers(Long stpId, List requestBody) t * @http.response.details - +
Status Code Description Response Headers
200 User added successfully. Returning the current users within the STP group. -
200 User added successfully, returning current users in the STP group -
*/ public ApiResponse> addSTPGroupUsersWithHttpInfo(Long stpId, List requestBody) throws ApiException { @@ -602,8 +702,8 @@ public ApiResponse> addSTPGroupUsersWithHttpInfo(Long stpId, } /** - * Add users to the STP group (asynchronously) - * - Only the master account that created the STP user group is allowed to add users to the STP user group.- Only accounts under the main account are allowed to be added. Cross-account is not permitted + * 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 @@ -612,7 +712,7 @@ public ApiResponse> addSTPGroupUsersWithHttpInfo(Long stpId, * @http.response.details - +
Status Code Description Response Headers
200 User added successfully. Returning the current users within the STP group. -
200 User added successfully, returning current users in the STP group -
*/ public okhttp3.Call addSTPGroupUsersAsync(Long stpId, List requestBody, final ApiCallback> _callback) throws ApiException { @@ -625,18 +725,18 @@ public okhttp3.Call addSTPGroupUsersAsync(Long stpId, List requestBody, fi /** * Build call for deleteSTPGroupUsers * @param stpId STP Group ID (required) - * @param requestBody User 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 Success -
200 Users deleted successfully, returns current users in the STP group -
*/ - public okhttp3.Call deleteSTPGroupUsersCall(Long stpId, List requestBody, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = requestBody; + 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" @@ -644,6 +744,10 @@ public okhttp3.Call deleteSTPGroupUsersCall(Long stpId, List requestBody, 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(); @@ -656,7 +760,7 @@ public okhttp3.Call deleteSTPGroupUsersCall(Long stpId, List requestBody, } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -666,77 +770,278 @@ public okhttp3.Call deleteSTPGroupUsersCall(Long stpId, List requestBody, } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSTPGroupUsersValidateBeforeCall(Long stpId, List requestBody, final ApiCallback _callback) throws ApiException { + 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 'requestBody' is set - if (requestBody == null) { - throw new ApiException("Missing the required parameter 'requestBody' 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, requestBody, _callback); + okhttp3.Call localVarCall = deleteSTPGroupUsersCall(stpId, userId, _callback); return localVarCall; } /** - * Delete the user in the STP group + * 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 requestBody User 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 Success -
200 Users deleted successfully, returns current users in the STP group -
*/ - public List deleteSTPGroupUsers(Long stpId, List requestBody) throws ApiException { - ApiResponse> localVarResp = deleteSTPGroupUsersWithHttpInfo(stpId, requestBody); + public List deleteSTPGroupUsers(Long stpId, Long userId) throws ApiException { + ApiResponse> localVarResp = deleteSTPGroupUsersWithHttpInfo(stpId, userId); return localVarResp.getData(); } /** - * Delete the user in the STP group + * 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 requestBody User 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 Success -
200 Users deleted successfully, returns current users in the STP group -
*/ - public ApiResponse> deleteSTPGroupUsersWithHttpInfo(Long stpId, List requestBody) throws ApiException { - okhttp3.Call localVarCall = deleteSTPGroupUsersValidateBeforeCall(stpId, requestBody, null); + 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 the user in the STP group (asynchronously) + * 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 requestBody User 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 Success -
200 Users deleted successfully, returns current users in the STP group -
*/ - public okhttp3.Call deleteSTPGroupUsersAsync(Long stpId, List requestBody, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = deleteSTPGroupUsersValidateBeforeCall(stpId, requestBody, _callback); + 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 index b96ddd5..135456c 100644 --- a/src/main/java/io/gate/gateapi/api/CollateralLoanApi.java +++ b/src/main/java/io/gate/gateapi/api/CollateralLoanApi.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 @@ -143,7 +143,7 @@ public APIlistCollateralLoanOrdersRequest 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 APIlistCollateralLoanOrdersRequest */ public APIlistCollateralLoanOrdersRequest limit(Integer limit) { @@ -153,7 +153,7 @@ public APIlistCollateralLoanOrdersRequest limit(Integer limit) { /** * Set collateralCurrency - * @param collateralCurrency Collateral (optional) + * @param collateralCurrency Collateral currency (optional) * @return APIlistCollateralLoanOrdersRequest */ public APIlistCollateralLoanOrdersRequest collateralCurrency(String collateralCurrency) { @@ -179,7 +179,7 @@ public APIlistCollateralLoanOrdersRequest borrowCurrency(String borrowCurrency) * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -193,7 +193,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 { @@ -208,7 +208,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 { @@ -223,7 +223,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -232,13 +232,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callb } /** - * List Orders + * Query collateral loan order list * * @return APIlistCollateralLoanOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistCollateralLoanOrdersRequest listCollateralLoanOrders() { @@ -254,7 +254,7 @@ public APIlistCollateralLoanOrdersRequest listCollateralLoanOrders() { * @http.response.details - +
Status Code Description Response Headers
200 Success -
200 Order placed successfully -
*/ public okhttp3.Call createCollateralLoanCall(CreateCollateralOrder createCollateralOrder, final ApiCallback _callback) throws ApiException { @@ -298,7 +298,7 @@ private okhttp3.Call createCollateralLoanValidateBeforeCall(CreateCollateralOrde } /** - * Place order + * Place collateral loan order * * @param createCollateralOrder (required) * @return OrderResp @@ -306,7 +306,7 @@ private okhttp3.Call createCollateralLoanValidateBeforeCall(CreateCollateralOrde * @http.response.details - +
Status Code Description Response Headers
200 Success -
200 Order placed successfully -
*/ public OrderResp createCollateralLoan(CreateCollateralOrder createCollateralOrder) throws ApiException { @@ -315,7 +315,7 @@ public OrderResp createCollateralLoan(CreateCollateralOrder createCollateralOrde } /** - * Place order + * Place collateral loan order * * @param createCollateralOrder (required) * @return ApiResponse<OrderResp> @@ -323,7 +323,7 @@ public OrderResp createCollateralLoan(CreateCollateralOrder createCollateralOrde * @http.response.details - +
Status Code Description Response Headers
200 Success -
200 Order placed successfully -
*/ public ApiResponse createCollateralLoanWithHttpInfo(CreateCollateralOrder createCollateralOrder) throws ApiException { @@ -333,7 +333,7 @@ public ApiResponse createCollateralLoanWithHttpInfo(CreateCollateralO } /** - * Place order (asynchronously) + * Place collateral loan order (asynchronously) * * @param createCollateralOrder (required) * @param _callback The callback to be executed when the API call finishes @@ -342,7 +342,7 @@ public ApiResponse createCollateralLoanWithHttpInfo(CreateCollateralO * @http.response.details - +
Status Code Description Response Headers
200 Success -
200 Order placed successfully -
*/ public okhttp3.Call createCollateralLoanAsync(CreateCollateralOrder createCollateralOrder, final ApiCallback _callback) throws ApiException { @@ -354,14 +354,14 @@ public okhttp3.Call createCollateralLoanAsync(CreateCollateralOrder createCollat /** * Build call for getCollateralLoanOrderDetail - * @param orderId Order ID returned on successful order creation (required) + * @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 Success -
200 Order details queried successfully -
*/ public okhttp3.Call getCollateralLoanOrderDetailCall(Long orderId, final ApiCallback _callback) throws ApiException { @@ -406,15 +406,15 @@ private okhttp3.Call getCollateralLoanOrderDetailValidateBeforeCall(Long orderId } /** - * Get a single order + * Query single order details * - * @param orderId Order ID returned on successful order creation (required) + * @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 Success -
200 Order details queried successfully -
*/ public CollateralOrder getCollateralLoanOrderDetail(Long orderId) throws ApiException { @@ -423,15 +423,15 @@ public CollateralOrder getCollateralLoanOrderDetail(Long orderId) throws ApiExce } /** - * Get a single order + * Query single order details * - * @param orderId Order ID returned on successful order creation (required) + * @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 Success -
200 Order details queried successfully -
*/ public ApiResponse getCollateralLoanOrderDetailWithHttpInfo(Long orderId) throws ApiException { @@ -441,16 +441,16 @@ public ApiResponse getCollateralLoanOrderDetailWithHttpInfo(Lon } /** - * Get a single order (asynchronously) + * Query single order details (asynchronously) * - * @param orderId Order ID returned on successful order creation (required) + * @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 Success -
200 Order details queried successfully -
*/ public okhttp3.Call getCollateralLoanOrderDetailAsync(Long orderId, final ApiCallback _callback) throws ApiException { @@ -469,7 +469,7 @@ public okhttp3.Call getCollateralLoanOrderDetailAsync(Long orderId, final ApiCal * @http.response.details - +
Status Code Description Response Headers
200 Operated successfully -
200 Operation successful -
*/ public okhttp3.Call repayCollateralLoanCall(RepayLoan repayLoan, final ApiCallback _callback) throws ApiException { @@ -513,7 +513,7 @@ private okhttp3.Call repayCollateralLoanValidateBeforeCall(RepayLoan repayLoan, } /** - * Repayment + * Collateral loan repayment * * @param repayLoan (required) * @return RepayResp @@ -521,7 +521,7 @@ private okhttp3.Call repayCollateralLoanValidateBeforeCall(RepayLoan repayLoan, * @http.response.details - +
Status Code Description Response Headers
200 Operated successfully -
200 Operation successful -
*/ public RepayResp repayCollateralLoan(RepayLoan repayLoan) throws ApiException { @@ -530,7 +530,7 @@ public RepayResp repayCollateralLoan(RepayLoan repayLoan) throws ApiException { } /** - * Repayment + * Collateral loan repayment * * @param repayLoan (required) * @return ApiResponse<RepayResp> @@ -538,7 +538,7 @@ public RepayResp repayCollateralLoan(RepayLoan repayLoan) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Operated successfully -
200 Operation successful -
*/ public ApiResponse repayCollateralLoanWithHttpInfo(RepayLoan repayLoan) throws ApiException { @@ -548,7 +548,7 @@ public ApiResponse repayCollateralLoanWithHttpInfo(RepayLoan repayLoa } /** - * Repayment (asynchronously) + * Collateral loan repayment (asynchronously) * * @param repayLoan (required) * @param _callback The callback to be executed when the API call finishes @@ -557,7 +557,7 @@ public ApiResponse repayCollateralLoanWithHttpInfo(RepayLoan repayLoa * @http.response.details - +
Status Code Description Response Headers
200 Operated successfully -
200 Operation successful -
*/ public okhttp3.Call repayCollateralLoanAsync(RepayLoan repayLoan, final ApiCallback _callback) throws ApiException { @@ -674,7 +674,7 @@ public APIlistRepayRecordsRequest borrowCurrency(String borrowCurrency) { /** * Set collateralCurrency - * @param collateralCurrency Collateral (optional) + * @param collateralCurrency Collateral currency (optional) * @return APIlistRepayRecordsRequest */ public APIlistRepayRecordsRequest collateralCurrency(String collateralCurrency) { @@ -694,7 +694,7 @@ public APIlistRepayRecordsRequest 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 APIlistRepayRecordsRequest */ public APIlistRepayRecordsRequest limit(Integer limit) { @@ -704,7 +704,7 @@ public APIlistRepayRecordsRequest limit(Integer limit) { /** * Set from - * @param from Start timestamp of the query (optional) + * @param from Start timestamp for the query (optional) * @return APIlistRepayRecordsRequest */ public APIlistRepayRecordsRequest from(Long from) { @@ -714,7 +714,7 @@ public APIlistRepayRecordsRequest 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 APIlistRepayRecordsRequest */ public APIlistRepayRecordsRequest to(Long to) { @@ -730,7 +730,7 @@ public APIlistRepayRecordsRequest to(Long to) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -744,7 +744,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 { @@ -759,7 +759,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 { @@ -774,7 +774,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 { @@ -783,14 +783,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) } /** - * Repayment history + * 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 Successfully retrieved -
200 Query successful -
*/ public APIlistRepayRecordsRequest listRepayRecords(String source) { @@ -893,7 +893,7 @@ public APIlistCollateralRecordsRequest 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 APIlistCollateralRecordsRequest */ public APIlistCollateralRecordsRequest limit(Integer limit) { @@ -903,7 +903,7 @@ public APIlistCollateralRecordsRequest limit(Integer limit) { /** * Set from - * @param from Start timestamp of the query (optional) + * @param from Start timestamp for the query (optional) * @return APIlistCollateralRecordsRequest */ public APIlistCollateralRecordsRequest from(Long from) { @@ -913,7 +913,7 @@ public APIlistCollateralRecordsRequest 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 APIlistCollateralRecordsRequest */ public APIlistCollateralRecordsRequest to(Long to) { @@ -933,7 +933,7 @@ public APIlistCollateralRecordsRequest borrowCurrency(String borrowCurrency) { /** * Set collateralCurrency - * @param collateralCurrency Collateral (optional) + * @param collateralCurrency Collateral currency (optional) * @return APIlistCollateralRecordsRequest */ public APIlistCollateralRecordsRequest collateralCurrency(String collateralCurrency) { @@ -949,7 +949,7 @@ public APIlistCollateralRecordsRequest collateralCurrency(String collateralCurre * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -963,7 +963,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 { @@ -978,7 +978,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 { @@ -993,7 +993,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcep * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1008,7 +1008,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _call * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistCollateralRecordsRequest listCollateralRecords() { @@ -1024,7 +1024,7 @@ public APIlistCollateralRecordsRequest listCollateralRecords() { * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public okhttp3.Call operateCollateralCall(CollateralAlign collateralAlign, final ApiCallback _callback) throws ApiException { @@ -1075,7 +1075,7 @@ private okhttp3.Call operateCollateralValidateBeforeCall(CollateralAlign collate * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public void operateCollateral(CollateralAlign collateralAlign) throws ApiException { @@ -1091,7 +1091,7 @@ public void operateCollateral(CollateralAlign collateralAlign) throws ApiExcepti * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public ApiResponse operateCollateralWithHttpInfo(CollateralAlign collateralAlign) throws ApiException { @@ -1109,7 +1109,7 @@ public ApiResponse operateCollateralWithHttpInfo(CollateralAlign collatera * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public okhttp3.Call operateCollateralAsync(CollateralAlign collateralAlign, final ApiCallback _callback) throws ApiException { @@ -1126,7 +1126,7 @@ public okhttp3.Call operateCollateralAsync(CollateralAlign collateralAlign, fina * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUserTotalAmountCall(final ApiCallback _callback) throws ApiException { @@ -1165,14 +1165,14 @@ private okhttp3.Call getUserTotalAmountValidateBeforeCall(final ApiCallback _cal } /** - * Query the total borrowing and collateral amount for the user + * 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 Successfully retrieved -
200 Query successful -
*/ public UserTotalAmount getUserTotalAmount() throws ApiException { @@ -1181,14 +1181,14 @@ public UserTotalAmount getUserTotalAmount() throws ApiException { } /** - * Query the total borrowing and collateral amount for the user + * 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 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getUserTotalAmountWithHttpInfo() throws ApiException { @@ -1198,7 +1198,7 @@ public ApiResponse getUserTotalAmountWithHttpInfo() throws ApiE } /** - * Query the total borrowing and collateral amount for the user (asynchronously) + * 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 @@ -1206,7 +1206,7 @@ public ApiResponse getUserTotalAmountWithHttpInfo() throws ApiE * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUserTotalAmountAsync(final ApiCallback _callback) throws ApiException { @@ -1218,7 +1218,7 @@ public okhttp3.Call getUserTotalAmountAsync(final ApiCallback _ /** * Build call for getUserLtvInfo - * @param collateralCurrency Collateral (required) + * @param collateralCurrency Collateral currency (required) * @param borrowCurrency Borrowed currency (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1226,7 +1226,7 @@ public okhttp3.Call getUserTotalAmountAsync(final ApiCallback _ * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUserLtvInfoCall(String collateralCurrency, String borrowCurrency, final ApiCallback _callback) throws ApiException { @@ -1283,16 +1283,16 @@ private okhttp3.Call getUserLtvInfoValidateBeforeCall(String collateralCurrency, } /** - * Query user's collateralization ratio + * Query user's collateralization ratio and remaining borrowable currencies * - * @param collateralCurrency Collateral (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public UserLtvInfo getUserLtvInfo(String collateralCurrency, String borrowCurrency) throws ApiException { @@ -1301,16 +1301,16 @@ public UserLtvInfo getUserLtvInfo(String collateralCurrency, String borrowCurren } /** - * Query user's collateralization ratio + * Query user's collateralization ratio and remaining borrowable currencies * - * @param collateralCurrency Collateral (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getUserLtvInfoWithHttpInfo(String collateralCurrency, String borrowCurrency) throws ApiException { @@ -1320,9 +1320,9 @@ public ApiResponse getUserLtvInfoWithHttpInfo(String collateralCurr } /** - * Query user's collateralization ratio (asynchronously) + * Query user's collateralization ratio and remaining borrowable currencies (asynchronously) * - * @param collateralCurrency Collateral (required) + * @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 @@ -1330,7 +1330,7 @@ public ApiResponse getUserLtvInfoWithHttpInfo(String collateralCurr * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUserLtvInfoAsync(String collateralCurrency, String borrowCurrency, final ApiCallback _callback) throws ApiException { @@ -1401,7 +1401,7 @@ private APIlistCollateralCurrenciesRequest() { /** * Set loanCurrency - * @param loanCurrency The parameter loan_currency is used to specify the borrowing currency. If loan_currency is not provided, the API will return all supported borrowing currencies. If loan_currency is provided, the API will return an array of collateral currencies supported for the specified borrowing currency. (optional) + * @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) { @@ -1417,7 +1417,7 @@ public APIlistCollateralCurrenciesRequest loanCurrency(String loanCurrency) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1431,7 +1431,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 { @@ -1446,7 +1446,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 { @@ -1461,7 +1461,7 @@ public ApiResponse> executeWithHttpInfo() throws Ap * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1476,7 +1476,7 @@ public okhttp3.Call executeAsync(final ApiCallback> * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistCollateralCurrenciesRequest listCollateralCurrencies() { diff --git a/src/main/java/io/gate/gateapi/api/DeliveryApi.java b/src/main/java/io/gate/gateapi/api/DeliveryApi.java index 8eed293..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 @@ -23,13 +23,14 @@ 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.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) { @@ -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. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (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 { @@ -846,7 +847,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 { @@ -861,7 +862,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 { @@ -876,7 +877,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiEx * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -885,7 +886,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _c } /** - * 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> _c * @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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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 price-triggered 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 price-triggered 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 price-triggered 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 price-triggered 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 price-triggered 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 price-triggered 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/PortfolioApi.java b/src/main/java/io/gate/gateapi/api/EarnApi.java similarity index 55% rename from src/main/java/io/gate/gateapi/api/PortfolioApi.java rename to src/main/java/io/gate/gateapi/api/EarnApi.java index 4f8ddfb..78ffd05 100644 --- a/src/main/java/io/gate/gateapi/api/PortfolioApi.java +++ b/src/main/java/io/gate/gateapi/api/EarnApi.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,17 @@ import com.google.gson.reflect.TypeToken; -import io.gate.gateapi.models.PortfolioAccount; -import io.gate.gateapi.models.PortfolioBorrowable; -import io.gate.gateapi.models.PortfolioLoan; -import io.gate.gateapi.models.PortfolioLoanRecord; -import io.gate.gateapi.models.PortfolioMode; -import io.gate.gateapi.models.PortfolioTransferable; -import io.gate.gateapi.models.UniLoan; -import io.gate.gateapi.models.UniLoanInterestRecord; +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; @@ -35,14 +38,14 @@ import java.util.List; import java.util.Map; -public class PortfolioApi { +public class EarnApi { private ApiClient localVarApiClient; - public PortfolioApi() { + public EarnApi() { this(Configuration.getDefaultApiClient()); } - public PortfolioApi(ApiClient apiClient) { + public EarnApi(ApiClient apiClient) { this.localVarApiClient = apiClient; } @@ -54,165 +57,23 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } - private okhttp3.Call listPortfolioAccountsCall(String currency, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/portfolio/accounts"; - - 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 listPortfolioAccountsValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioAccountsCall(currency, _callback); - return localVarCall; - } - - - private ApiResponse listPortfolioAccountsWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = listPortfolioAccountsValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - private okhttp3.Call listPortfolioAccountsAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioAccountsValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - public class APIlistPortfolioAccountsRequest { - private String currency; - - private APIlistPortfolioAccountsRequest() { - } - - /** - * Set currency - * @param currency Retrieve data of the specified currency (optional) - * @return APIlistPortfolioAccountsRequest - */ - public APIlistPortfolioAccountsRequest currency(String currency) { - this.currency = currency; - return this; - } - - /** - * Build call for listPortfolioAccounts - * @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 listPortfolioAccountsCall(currency, _callback); - } - - /** - * Execute listPortfolioAccounts request - * @return PortfolioAccount - * @throws ApiException If 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 PortfolioAccount execute() throws ApiException { - ApiResponse localVarResp = listPortfolioAccountsWithHttpInfo(currency); - return localVarResp.getData(); - } - - /** - * Execute listPortfolioAccounts request with HTTP info returned - * @return ApiResponse<PortfolioAccount> - * @throws ApiException If 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 listPortfolioAccountsWithHttpInfo(currency); - } - - /** - * Execute listPortfolioAccounts 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 listPortfolioAccountsAsync(currency, _callback); - } - } - /** - * Get portfolio 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. You can refer to the [Formula](#portfolio-account) in the documentation - * @return APIlistPortfolioAccountsRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - public APIlistPortfolioAccountsRequest listPortfolioAccounts() { - return new APIlistPortfolioAccountsRequest(); - } - - /** - * Build call for listAccountPortfolioMode + * 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 Successfully retrieved -
200 Swap successful -
*/ - public okhttp3.Call listAccountPortfolioModeCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public okhttp3.Call swapETH2Call(Eth2Swap eth2Swap, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = eth2Swap; // create path and map variables - String localVarPath = "/portfolio/account_mode"; + String localVarPath = "/earn/staking/eth2/swap"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -220,106 +81,7 @@ public okhttp3.Call listAccountPortfolioModeCall(final ApiCallback _callback) th 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 listAccountPortfolioModeValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listAccountPortfolioModeCall(_callback); - return localVarCall; - } - - /** - * Retrieve the account's portfolio mode - * cross_margin - cross margin - * @return Map<String, Boolean> - * @throws ApiException If 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 Map listAccountPortfolioMode() throws ApiException { - ApiResponse> localVarResp = listAccountPortfolioModeWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Retrieve the account's portfolio mode - * cross_margin - cross margin - * @return ApiResponse<Map<String, Boolean>> - * @throws ApiException If 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> listAccountPortfolioModeWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listAccountPortfolioModeValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Retrieve the account's portfolio mode (asynchronously) - * cross_margin - cross margin - * @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 listAccountPortfolioModeAsync(final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listAccountPortfolioModeValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for setAccountPortfolioMode - * @param portfolioMode (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 setAccountPortfolioModeCall(PortfolioMode portfolioMode, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = portfolioMode; - - // create path and map variables - String localVarPath = "/portfolio/account_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) { @@ -337,74 +99,69 @@ public okhttp3.Call setAccountPortfolioModeCall(PortfolioMode portfolioMode, fin } @SuppressWarnings("rawtypes") - private okhttp3.Call setAccountPortfolioModeValidateBeforeCall(PortfolioMode portfolioMode, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'portfolioMode' is set - if (portfolioMode == null) { - throw new ApiException("Missing the required parameter 'portfolioMode' when calling setAccountPortfolioMode(Async)"); + 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 = setAccountPortfolioModeCall(portfolioMode, _callback); + okhttp3.Call localVarCall = swapETH2Call(eth2Swap, _callback); return localVarCall; } /** - * Configure the account's portfolio mode. + * ETH2 swap * - * @param portfolioMode (required) - * @return Map<String, Boolean> + * @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 Success -
200 Swap successful -
*/ - public Map setAccountPortfolioMode(PortfolioMode portfolioMode) throws ApiException { - ApiResponse> localVarResp = setAccountPortfolioModeWithHttpInfo(portfolioMode); - return localVarResp.getData(); + public void swapETH2(Eth2Swap eth2Swap) throws ApiException { + swapETH2WithHttpInfo(eth2Swap); } /** - * Configure the account's portfolio mode. + * ETH2 swap * - * @param portfolioMode (required) - * @return ApiResponse<Map<String, Boolean>> + * @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 Success -
200 Swap successful -
*/ - public ApiResponse> setAccountPortfolioModeWithHttpInfo(PortfolioMode portfolioMode) throws ApiException { - okhttp3.Call localVarCall = setAccountPortfolioModeValidateBeforeCall(portfolioMode, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse swapETH2WithHttpInfo(Eth2Swap eth2Swap) throws ApiException { + okhttp3.Call localVarCall = swapETH2ValidateBeforeCall(eth2Swap, null); + return localVarApiClient.execute(localVarCall); } /** - * Configure the account's portfolio mode. (asynchronously) + * ETH2 swap (asynchronously) * - * @param portfolioMode (required) + * @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 Success -
200 Swap successful -
*/ - public okhttp3.Call setAccountPortfolioModeAsync(PortfolioMode portfolioMode, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = setAccountPortfolioModeValidateBeforeCall(portfolioMode, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + 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 getPortfolioBorrowable - * @param currency Retrieve data of the specified currency (required) + * 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 @@ -414,18 +171,14 @@ public okhttp3.Call setAccountPortfolioModeAsync(PortfolioMode portfolioMode, fi 200 Successfully retrieved - */ - public okhttp3.Call getPortfolioBorrowableCall(String currency, final ApiCallback _callback) throws ApiException { + public okhttp3.Call rateListETH2Call(final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/portfolio/borrowable"; + String localVarPath = "/earn/staking/eth2/rate_records"; 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(); @@ -448,21 +201,15 @@ public okhttp3.Call getPortfolioBorrowableCall(String currency, final ApiCallbac } @SuppressWarnings("rawtypes") - private okhttp3.Call getPortfolioBorrowableValidateBeforeCall(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 getPortfolioBorrowable(Async)"); - } - - okhttp3.Call localVarCall = getPortfolioBorrowableCall(currency, _callback); + private okhttp3.Call rateListETH2ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = rateListETH2Call(_callback); return localVarCall; } /** - * Retrieve the maximum borrowable amount for the account. - * - * @param currency Retrieve data of the specified currency (required) - * @return PortfolioBorrowable + * 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 @@ -470,16 +217,15 @@ private okhttp3.Call getPortfolioBorrowableValidateBeforeCall(String currency, f
200 Successfully retrieved -
*/ - public PortfolioBorrowable getPortfolioBorrowable(String currency) throws ApiException { - ApiResponse localVarResp = getPortfolioBorrowableWithHttpInfo(currency); + public List rateListETH2() throws ApiException { + ApiResponse> localVarResp = rateListETH2WithHttpInfo(); return localVarResp.getData(); } /** - * Retrieve the maximum borrowable amount for the account. - * - * @param currency Retrieve data of the specified currency (required) - * @return ApiResponse<PortfolioBorrowable> + * 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 @@ -487,16 +233,15 @@ public PortfolioBorrowable getPortfolioBorrowable(String currency) throws ApiExc
200 Successfully retrieved -
*/ - public ApiResponse getPortfolioBorrowableWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getPortfolioBorrowableValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse> rateListETH2WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = rateListETH2ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Retrieve the maximum borrowable amount for the account. (asynchronously) - * - * @param currency Retrieve data of the specified currency (required) + * 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 @@ -506,35 +251,23 @@ public ApiResponse getPortfolioBorrowableWithHttpInfo(Strin 200 Successfully retrieved - */ - public okhttp3.Call getPortfolioBorrowableAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPortfolioBorrowableValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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; } - /** - * Build call for getPortfolioTransferable - * @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 getPortfolioTransferableCall(String currency, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listDualInvestmentPlansCall(Long planId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/portfolio/transferable"; + String localVarPath = "/earn/dual/investment_plan"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + if (planId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("plan_id", planId)); } Map localVarHeaderParams = new HashMap(); @@ -554,86 +287,134 @@ public okhttp3.Call getPortfolioTransferableCall(String currency, final ApiCallb 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 getPortfolioTransferableValidateBeforeCall(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 getPortfolioTransferable(Async)"); - } - - okhttp3.Call localVarCall = getPortfolioTransferableCall(currency, _callback); + private okhttp3.Call listDualInvestmentPlansValidateBeforeCall(Long planId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listDualInvestmentPlansCall(planId, _callback); return localVarCall; } - /** - * Retrieve the maximum amount that can be transferred out from the account - * - * @param currency Retrieve data of the specified currency (required) - * @return PortfolioTransferable - * @throws ApiException If 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 PortfolioTransferable getPortfolioTransferable(String currency) throws ApiException { - ApiResponse localVarResp = getPortfolioTransferableWithHttpInfo(currency); - return localVarResp.getData(); - } - /** - * Retrieve the maximum amount that can be transferred out from the account - * - * @param currency Retrieve data of the specified currency (required) - * @return ApiResponse<PortfolioTransferable> - * @throws ApiException If 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 getPortfolioTransferableWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getPortfolioTransferableValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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); + } + } + /** - * Retrieve the maximum amount that can be transferred out from the account (asynchronously) + * Dual Investment product list * - * @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 + * @return APIlistDualInvestmentPlansRequest * @http.response.details
Status Code Description Response Headers
200 Successfully retrieved -
*/ - public okhttp3.Call getPortfolioTransferableAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPortfolioTransferableValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; + public APIlistDualInvestmentPlansRequest listDualInvestmentPlans() { + return new APIlistDualInvestmentPlansRequest(); } - private okhttp3.Call listPortfolioUniLoanInterestRecordsCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + 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 = "/portfolio/loans"; + String localVarPath = "/earn/dual/orders"; 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) { @@ -666,65 +447,76 @@ private okhttp3.Call listPortfolioUniLoanInterestRecordsCall(String currency, In } @SuppressWarnings("rawtypes") - private okhttp3.Call listPortfolioUniLoanInterestRecordsValidateBeforeCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioUniLoanInterestRecordsCall(currency, page, limit, _callback); + 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> listPortfolioUniLoanInterestRecordsWithHttpInfo(String currency, Integer page, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listPortfolioUniLoanInterestRecordsValidateBeforeCall(currency, page, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 listPortfolioUniLoanInterestRecordsAsync(String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioUniLoanInterestRecordsValidateBeforeCall(currency, page, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 APIlistPortfolioUniLoanInterestRecordsRequest { - private String currency; + public class APIlistDualOrdersRequest { + private Long from; + private Long to; private Integer page; private Integer limit; - private APIlistPortfolioUniLoanInterestRecordsRequest() { + private APIlistDualOrdersRequest() { + } + + /** + * Set from + * @param from Start settlement time (optional) + * @return APIlistDualOrdersRequest + */ + public APIlistDualOrdersRequest from(Long from) { + this.from = from; + return this; } /** - * Set currency - * @param currency Retrieve data of the specified currency (optional) - * @return APIlistPortfolioUniLoanInterestRecordsRequest + * Set to + * @param to End settlement time (optional) + * @return APIlistDualOrdersRequest */ - public APIlistPortfolioUniLoanInterestRecordsRequest currency(String currency) { - this.currency = currency; + public APIlistDualOrdersRequest to(Long to) { + this.to = to; return this; } /** * Set page * @param page Page number (optional, default to 1) - * @return APIlistPortfolioUniLoanInterestRecordsRequest + * @return APIlistDualOrdersRequest */ - public APIlistPortfolioUniLoanInterestRecordsRequest page(Integer page) { + public APIlistDualOrdersRequest page(Integer page) { this.page = page; return this; } /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) - * @return APIlistPortfolioUniLoanInterestRecordsRequest + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistDualOrdersRequest */ - public APIlistPortfolioUniLoanInterestRecordsRequest limit(Integer limit) { + public APIlistDualOrdersRequest limit(Integer limit) { this.limit = limit; return this; } /** - * Build call for listPortfolioUniLoanInterestRecords + * Build call for listDualOrders * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -735,12 +527,12 @@ public APIlistPortfolioUniLoanInterestRecordsRequest limit(Integer limit) { */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listPortfolioUniLoanInterestRecordsCall(currency, page, limit, _callback); + return listDualOrdersCall(from, to, page, limit, _callback); } /** - * Execute listPortfolioUniLoanInterestRecords request - * @return List<UniLoan> + * 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 @@ -748,14 +540,14 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
200 Successfully retrieved -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listPortfolioUniLoanInterestRecordsWithHttpInfo(currency, page, limit); + public List execute() throws ApiException { + ApiResponse> localVarResp = listDualOrdersWithHttpInfo(from, to, page, limit); return localVarResp.getData(); } /** - * Execute listPortfolioUniLoanInterestRecords request with HTTP info returned - * @return ApiResponse<List<UniLoan>> + * 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 @@ -763,12 +555,12 @@ public List execute() throws ApiException {
200 Successfully retrieved -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listPortfolioUniLoanInterestRecordsWithHttpInfo(currency, page, limit); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listDualOrdersWithHttpInfo(from, to, page, limit); } /** - * Execute listPortfolioUniLoanInterestRecords request (asynchronously) + * 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 @@ -778,42 +570,42 @@ public ApiResponse> executeWithHttpInfo() throws ApiException { 200 Successfully retrieved - */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listPortfolioUniLoanInterestRecordsAsync(currency, page, limit, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listDualOrdersAsync(from, to, page, limit, _callback); } } /** - * List loans + * Dual Investment order list * - * @return APIlistPortfolioUniLoanInterestRecordsRequest + * @return APIlistDualOrdersRequest * @http.response.details
Status Code Description Response Headers
200 Successfully retrieved -
*/ - public APIlistPortfolioUniLoanInterestRecordsRequest listPortfolioUniLoanInterestRecords() { - return new APIlistPortfolioUniLoanInterestRecordsRequest(); + public APIlistDualOrdersRequest listDualOrders() { + return new APIlistDualOrdersRequest(); } /** - * Build call for createPortfolioLoan - * @param portfolioLoan (required) + * 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
204 Operated successfully -
200 Order placed successfully -
*/ - public okhttp3.Call createPortfolioLoanCall(PortfolioLoan portfolioLoan, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = portfolioLoan; + public okhttp3.Call placeDualOrderCall(PlaceDualInvestmentOrder placeDualInvestmentOrder, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = placeDualInvestmentOrder; // create path and map variables - String localVarPath = "/portfolio/loans"; + String localVarPath = "/earn/dual/orders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -839,72 +631,72 @@ public okhttp3.Call createPortfolioLoanCall(PortfolioLoan portfolioLoan, final A } @SuppressWarnings("rawtypes") - private okhttp3.Call createPortfolioLoanValidateBeforeCall(PortfolioLoan portfolioLoan, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'portfolioLoan' is set - if (portfolioLoan == null) { - throw new ApiException("Missing the required parameter 'portfolioLoan' when calling createPortfolioLoan(Async)"); + 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 = createPortfolioLoanCall(portfolioLoan, _callback); + okhttp3.Call localVarCall = placeDualOrderCall(placeDualInvestmentOrder, _callback); return localVarCall; } /** - * Borrow or repay - * When borrowing, it is essential to ensure that 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 the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` - * @param portfolioLoan (required) + * 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
204 Operated successfully -
200 Order placed successfully -
*/ - public void createPortfolioLoan(PortfolioLoan portfolioLoan) throws ApiException { - createPortfolioLoanWithHttpInfo(portfolioLoan); + public void placeDualOrder(PlaceDualInvestmentOrder placeDualInvestmentOrder) throws ApiException { + placeDualOrderWithHttpInfo(placeDualInvestmentOrder); } /** - * Borrow or repay - * When borrowing, it is essential to ensure that 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 the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` - * @param portfolioLoan (required) + * 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
204 Operated successfully -
200 Order placed successfully -
*/ - public ApiResponse createPortfolioLoanWithHttpInfo(PortfolioLoan portfolioLoan) throws ApiException { - okhttp3.Call localVarCall = createPortfolioLoanValidateBeforeCall(portfolioLoan, null); + public ApiResponse placeDualOrderWithHttpInfo(PlaceDualInvestmentOrder placeDualInvestmentOrder) throws ApiException { + okhttp3.Call localVarCall = placeDualOrderValidateBeforeCall(placeDualInvestmentOrder, null); return localVarApiClient.execute(localVarCall); } /** - * Borrow or repay (asynchronously) - * When borrowing, it is essential to ensure that 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 the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` - * @param portfolioLoan (required) + * 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
204 Operated successfully -
200 Order placed successfully -
*/ - public okhttp3.Call createPortfolioLoanAsync(PortfolioLoan portfolioLoan, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createPortfolioLoanValidateBeforeCall(portfolioLoan, _callback); + 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 listPortfolioLoanRecordsCall(String type, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + 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 = "/portfolio/loan_records"; + String localVarPath = "/earn/structured/products"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -912,8 +704,8 @@ private okhttp3.Call listPortfolioLoanRecordsCall(String type, String currency, localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); } - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); } if (page != null) { @@ -941,81 +733,77 @@ private okhttp3.Call listPortfolioLoanRecordsCall(String type, String currency, 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 listPortfolioLoanRecordsValidateBeforeCall(String type, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioLoanRecordsCall(type, currency, page, limit, _callback); + 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> listPortfolioLoanRecordsWithHttpInfo(String type, String currency, Integer page, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listPortfolioLoanRecordsValidateBeforeCall(type, currency, page, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 listPortfolioLoanRecordsAsync(String type, String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioLoanRecordsValidateBeforeCall(type, currency, page, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 APIlistPortfolioLoanRecordsRequest { + public class APIlistStructuredProductsRequest { + private final String status; private String type; - private String currency; private Integer page; private Integer limit; - private APIlistPortfolioLoanRecordsRequest() { + private APIlistStructuredProductsRequest(String status) { + this.status = status; } /** * Set type - * @param type The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds (optional) - * @return APIlistPortfolioLoanRecordsRequest + * @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 APIlistPortfolioLoanRecordsRequest type(String type) { + public APIlistStructuredProductsRequest type(String type) { this.type = type; return this; } - /** - * Set currency - * @param currency Retrieve data of the specified currency (optional) - * @return APIlistPortfolioLoanRecordsRequest - */ - public APIlistPortfolioLoanRecordsRequest currency(String currency) { - this.currency = currency; - return this; - } - /** * Set page * @param page Page number (optional, default to 1) - * @return APIlistPortfolioLoanRecordsRequest + * @return APIlistStructuredProductsRequest */ - public APIlistPortfolioLoanRecordsRequest page(Integer page) { + public APIlistStructuredProductsRequest page(Integer page) { this.page = page; return this; } /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) - * @return APIlistPortfolioLoanRecordsRequest + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistStructuredProductsRequest */ - public APIlistPortfolioLoanRecordsRequest limit(Integer limit) { + public APIlistStructuredProductsRequest limit(Integer limit) { this.limit = limit; return this; } /** - * Build call for listPortfolioLoanRecords + * Build call for listStructuredProducts * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1026,12 +814,12 @@ public APIlistPortfolioLoanRecordsRequest limit(Integer limit) { */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listPortfolioLoanRecordsCall(type, currency, page, limit, _callback); + return listStructuredProductsCall(status, type, page, limit, _callback); } /** - * Execute listPortfolioLoanRecords request - * @return List<PortfolioLoanRecord> + * 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 @@ -1039,14 +827,14 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
200 Successfully retrieved -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listPortfolioLoanRecordsWithHttpInfo(type, currency, page, limit); + public List execute() throws ApiException { + ApiResponse> localVarResp = listStructuredProductsWithHttpInfo(status, type, page, limit); return localVarResp.getData(); } /** - * Execute listPortfolioLoanRecords request with HTTP info returned - * @return ApiResponse<List<PortfolioLoanRecord>> + * 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 @@ -1054,12 +842,12 @@ public List execute() throws ApiException {
200 Successfully retrieved -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listPortfolioLoanRecordsWithHttpInfo(type, currency, page, limit); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listStructuredProductsWithHttpInfo(status, type, page, limit); } /** - * Execute listPortfolioLoanRecords request (asynchronously) + * 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 @@ -1069,35 +857,40 @@ public ApiResponse> executeWithHttpInfo() throws ApiEx 200 Successfully retrieved - */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listPortfolioLoanRecordsAsync(type, currency, page, limit, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listStructuredProductsAsync(status, type, page, limit, _callback); } } /** - * Get load records + * Structured Product List * - * @return APIlistPortfolioLoanRecordsRequest + * @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 APIlistPortfolioLoanRecordsRequest listPortfolioLoanRecords() { - return new APIlistPortfolioLoanRecordsRequest(); + public APIlistStructuredProductsRequest listStructuredProducts(String status) { + return new APIlistStructuredProductsRequest(status); } - private okhttp3.Call listPortfolioLoanInterestRecordsCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + 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 = "/portfolio/interest_records"; + String localVarPath = "/earn/structured/orders"; 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) { @@ -1130,65 +923,76 @@ private okhttp3.Call listPortfolioLoanInterestRecordsCall(String currency, Integ } @SuppressWarnings("rawtypes") - private okhttp3.Call listPortfolioLoanInterestRecordsValidateBeforeCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioLoanInterestRecordsCall(currency, page, limit, _callback); + 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> listPortfolioLoanInterestRecordsWithHttpInfo(String currency, Integer page, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listPortfolioLoanInterestRecordsValidateBeforeCall(currency, page, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 listPortfolioLoanInterestRecordsAsync(String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listPortfolioLoanInterestRecordsValidateBeforeCall(currency, page, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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 APIlistPortfolioLoanInterestRecordsRequest { - private String currency; + public class APIlistStructuredOrdersRequest { + private Long from; + private Long to; private Integer page; private Integer limit; - private APIlistPortfolioLoanInterestRecordsRequest() { + private APIlistStructuredOrdersRequest() { } /** - * Set currency - * @param currency Retrieve data of the specified currency (optional) - * @return APIlistPortfolioLoanInterestRecordsRequest + * 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 APIlistPortfolioLoanInterestRecordsRequest currency(String currency) { - this.currency = currency; + 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 APIlistPortfolioLoanInterestRecordsRequest + * @return APIlistStructuredOrdersRequest */ - public APIlistPortfolioLoanInterestRecordsRequest page(Integer page) { + public APIlistStructuredOrdersRequest page(Integer page) { this.page = page; return this; } /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) - * @return APIlistPortfolioLoanInterestRecordsRequest + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistStructuredOrdersRequest */ - public APIlistPortfolioLoanInterestRecordsRequest limit(Integer limit) { + public APIlistStructuredOrdersRequest limit(Integer limit) { this.limit = limit; return this; } /** - * Build call for listPortfolioLoanInterestRecords + * Build call for listStructuredOrders * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1199,12 +1003,12 @@ public APIlistPortfolioLoanInterestRecordsRequest limit(Integer limit) { */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listPortfolioLoanInterestRecordsCall(currency, page, limit, _callback); + return listStructuredOrdersCall(from, to, page, limit, _callback); } /** - * Execute listPortfolioLoanInterestRecords request - * @return List<UniLoanInterestRecord> + * 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 @@ -1212,14 +1016,14 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
200 Successfully retrieved -
*/ - public List execute() throws ApiException { - ApiResponse> localVarResp = listPortfolioLoanInterestRecordsWithHttpInfo(currency, page, limit); + public List execute() throws ApiException { + ApiResponse> localVarResp = listStructuredOrdersWithHttpInfo(from, to, page, limit); return localVarResp.getData(); } /** - * Execute listPortfolioLoanInterestRecords request with HTTP info returned - * @return ApiResponse<List<UniLoanInterestRecord>> + * 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 @@ -1227,12 +1031,12 @@ public List execute() throws ApiException {
200 Successfully retrieved -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listPortfolioLoanInterestRecordsWithHttpInfo(currency, page, limit); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listStructuredOrdersWithHttpInfo(from, to, page, limit); } /** - * Execute listPortfolioLoanInterestRecords request (asynchronously) + * 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 @@ -1242,23 +1046,340 @@ public ApiResponse> executeWithHttpInfo() throws Api 200 Successfully retrieved - */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listPortfolioLoanInterestRecordsAsync(currency, page, limit, _callback); + 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); } /** - * List interest records + * Staking coins (asynchronously) * - * @return APIlistPortfolioLoanInterestRecordsRequest + * @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 APIlistPortfolioLoanInterestRecordsRequest listPortfolioLoanInterestRecords() { - return new APIlistPortfolioLoanInterestRecordsRequest(); + 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 index 09a0a99..c6a53ed 100644 --- a/src/main/java/io/gate/gateapi/api/EarnUniApi.java +++ b/src/main/java/io/gate/gateapi/api/EarnUniApi.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,10 +21,11 @@ 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.UniInterestMode; import io.gate.gateapi.models.UniInterestRecord; import io.gate.gateapi.models.UniLend; import io.gate.gateapi.models.UniLendInterest; @@ -63,7 +64,7 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listUniCurrenciesCall(final ApiCallback _callback) throws ApiException { @@ -102,14 +103,14 @@ private okhttp3.Call listUniCurrenciesValidateBeforeCall(final ApiCallback _call } /** - * List currencies for lending + * 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 Successfully retrieved -
200 Query successful -
*/ public List listUniCurrencies() throws ApiException { @@ -118,14 +119,14 @@ public List listUniCurrencies() throws ApiException { } /** - * List currencies for lending + * 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 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> listUniCurrenciesWithHttpInfo() throws ApiException { @@ -135,7 +136,7 @@ public ApiResponse> listUniCurrenciesWithHttpInfo() throws Api } /** - * List currencies for lending (asynchronously) + * Query lending currency list (asynchronously) * * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -143,7 +144,7 @@ public ApiResponse> listUniCurrenciesWithHttpInfo() throws Api * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listUniCurrenciesAsync(final ApiCallback> _callback) throws ApiException { @@ -162,7 +163,7 @@ public okhttp3.Call listUniCurrenciesAsync(final ApiCallback> * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUniCurrencyCall(String currency, final ApiCallback _callback) throws ApiException { @@ -207,7 +208,7 @@ private okhttp3.Call getUniCurrencyValidateBeforeCall(String currency, final Api } /** - * Get currency detail for lending + * Query single lending currency details * * @param currency Currency (required) * @return UniCurrency @@ -215,7 +216,7 @@ private okhttp3.Call getUniCurrencyValidateBeforeCall(String currency, final Api * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public UniCurrency getUniCurrency(String currency) throws ApiException { @@ -224,7 +225,7 @@ public UniCurrency getUniCurrency(String currency) throws ApiException { } /** - * Get currency detail for lending + * Query single lending currency details * * @param currency Currency (required) * @return ApiResponse<UniCurrency> @@ -232,7 +233,7 @@ public UniCurrency getUniCurrency(String currency) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getUniCurrencyWithHttpInfo(String currency) throws ApiException { @@ -242,7 +243,7 @@ public ApiResponse getUniCurrencyWithHttpInfo(String currency) thro } /** - * Get currency detail for lending (asynchronously) + * Query single lending currency details (asynchronously) * * @param currency Currency (required) * @param _callback The callback to be executed when the API call finishes @@ -251,7 +252,7 @@ public ApiResponse getUniCurrencyWithHttpInfo(String currency) thro * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUniCurrencyAsync(String currency, final ApiCallback _callback) throws ApiException { @@ -332,7 +333,7 @@ private APIlistUserUniLendsRequest() { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistUserUniLendsRequest */ public APIlistUserUniLendsRequest currency(String currency) { @@ -352,7 +353,7 @@ public APIlistUserUniLendsRequest page(Integer page) { /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) * @return APIlistUserUniLendsRequest */ public APIlistUserUniLendsRequest limit(Integer limit) { @@ -368,7 +369,7 @@ public APIlistUserUniLendsRequest 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 { @@ -382,7 +383,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 { @@ -397,7 +398,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 { @@ -412,7 +413,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 { @@ -421,13 +422,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) thr } /** - * List user's lending orders + * Query user's lending order list * * @return APIlistUserUniLendsRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistUserUniLendsRequest listUserUniLends() { @@ -443,7 +444,7 @@ public APIlistUserUniLendsRequest listUserUniLends() { * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public okhttp3.Call createUniLendCall(CreateUniLend createUniLend, final ApiCallback _callback) throws ApiException { @@ -487,14 +488,14 @@ private okhttp3.Call createUniLendValidateBeforeCall(CreateUniLend createUniLend } /** - * Lend or redeem - * `Lending`: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first `Redemption`: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour `Note`: Two minutes before and after the hour is the settlement time, lending and redemption are prohibited. + * 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 Operated successfully -
204 Operation successful -
*/ public void createUniLend(CreateUniLend createUniLend) throws ApiException { @@ -502,15 +503,15 @@ public void createUniLend(CreateUniLend createUniLend) throws ApiException { } /** - * Lend or redeem - * `Lending`: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first `Redemption`: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour `Note`: Two minutes before and after the hour is the settlement time, lending and redemption are prohibited. + * 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 Operated successfully -
204 Operation successful -
*/ public ApiResponse createUniLendWithHttpInfo(CreateUniLend createUniLend) throws ApiException { @@ -519,8 +520,8 @@ public ApiResponse createUniLendWithHttpInfo(CreateUniLend createUniLend) } /** - * Lend or redeem (asynchronously) - * `Lending`: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first `Redemption`: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour `Note`: Two minutes before and after the hour is the settlement time, lending and redemption are prohibited. + * 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 @@ -528,7 +529,7 @@ public ApiResponse createUniLendWithHttpInfo(CreateUniLend createUniLend) * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public okhttp3.Call createUniLendAsync(CreateUniLend createUniLend, final ApiCallback _callback) throws ApiException { @@ -546,7 +547,7 @@ public okhttp3.Call createUniLendAsync(CreateUniLend createUniLend, final ApiCal * @http.response.details - +
Status Code Description Response Headers
204 Updated -
204 Updated successfully -
*/ public okhttp3.Call changeUniLendCall(PatchUniLend patchUniLend, final ApiCallback _callback) throws ApiException { @@ -590,14 +591,14 @@ private okhttp3.Call changeUniLendValidateBeforeCall(PatchUniLend patchUniLend, } /** - * Amend lending order - * Currently only supports amending the minimum interest rate (hour) + * 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 -
204 Updated successfully -
*/ public void changeUniLend(PatchUniLend patchUniLend) throws ApiException { @@ -605,15 +606,15 @@ public void changeUniLend(PatchUniLend patchUniLend) throws ApiException { } /** - * Amend lending order - * Currently only supports amending the minimum interest rate (hour) + * 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 -
204 Updated successfully -
*/ public ApiResponse changeUniLendWithHttpInfo(PatchUniLend patchUniLend) throws ApiException { @@ -622,8 +623,8 @@ public ApiResponse changeUniLendWithHttpInfo(PatchUniLend patchUniLend) th } /** - * Amend lending order (asynchronously) - * Currently only supports amending the minimum interest rate (hour) + * 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 @@ -631,7 +632,7 @@ public ApiResponse changeUniLendWithHttpInfo(PatchUniLend patchUniLend) th * @http.response.details - +
Status Code Description Response Headers
204 Updated -
204 Updated successfully -
*/ public okhttp3.Call changeUniLendAsync(PatchUniLend patchUniLend, final ApiCallback _callback) throws ApiException { @@ -726,7 +727,7 @@ private APIlistUniLendRecordsRequest() { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistUniLendRecordsRequest */ public APIlistUniLendRecordsRequest currency(String currency) { @@ -746,7 +747,7 @@ public APIlistUniLendRecordsRequest page(Integer page) { /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) * @return APIlistUniLendRecordsRequest */ public APIlistUniLendRecordsRequest limit(Integer limit) { @@ -756,7 +757,7 @@ public APIlistUniLendRecordsRequest 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 APIlistUniLendRecordsRequest */ public APIlistUniLendRecordsRequest from(Long from) { @@ -766,7 +767,7 @@ public APIlistUniLendRecordsRequest 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 APIlistUniLendRecordsRequest */ public APIlistUniLendRecordsRequest to(Long to) { @@ -776,7 +777,7 @@ public APIlistUniLendRecordsRequest to(Long to) { /** * Set type - * @param type type: lend - lend, redeem - redeem (optional) + * @param type Operation type: lend - Lend, redeem - Redeem (optional) * @return APIlistUniLendRecordsRequest */ public APIlistUniLendRecordsRequest type(String type) { @@ -792,7 +793,7 @@ public APIlistUniLendRecordsRequest type(String type) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -806,7 +807,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 { @@ -821,7 +822,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 { @@ -836,7 +837,7 @@ 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 { @@ -845,13 +846,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callbac } /** - * List records of lending + * Query lending transaction records * * @return APIlistUniLendRecordsRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistUniLendRecordsRequest listUniLendRecords() { @@ -867,7 +868,7 @@ public APIlistUniLendRecordsRequest listUniLendRecords() { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUniInterestCall(String currency, final ApiCallback _callback) throws ApiException { @@ -912,7 +913,7 @@ private okhttp3.Call getUniInterestValidateBeforeCall(String currency, final Api } /** - * Get the user's total interest income of specified currency + * Query user's total interest income for specified currency * * @param currency Currency (required) * @return UniLendInterest @@ -920,7 +921,7 @@ private okhttp3.Call getUniInterestValidateBeforeCall(String currency, final Api * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public UniLendInterest getUniInterest(String currency) throws ApiException { @@ -929,7 +930,7 @@ public UniLendInterest getUniInterest(String currency) throws ApiException { } /** - * Get the user's total interest income of specified currency + * Query user's total interest income for specified currency * * @param currency Currency (required) * @return ApiResponse<UniLendInterest> @@ -937,7 +938,7 @@ public UniLendInterest getUniInterest(String currency) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getUniInterestWithHttpInfo(String currency) throws ApiException { @@ -947,7 +948,7 @@ public ApiResponse getUniInterestWithHttpInfo(String currency) } /** - * Get the user's total interest income of specified currency (asynchronously) + * 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 @@ -956,7 +957,7 @@ public ApiResponse getUniInterestWithHttpInfo(String currency) * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUniInterestAsync(String currency, final ApiCallback _callback) throws ApiException { @@ -966,7 +967,7 @@ public okhttp3.Call getUniInterestAsync(String currency, final ApiCallback localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -1008,20 +1017,20 @@ private okhttp3.Call listUniInterestRecordsCall(String currency, Integer page, I } @SuppressWarnings("rawtypes") - private okhttp3.Call listUniInterestRecordsValidateBeforeCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listUniInterestRecordsCall(currency, page, limit, _callback); + 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) throws ApiException { - okhttp3.Call localVarCall = listUniInterestRecordsValidateBeforeCall(currency, page, limit, null); + 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, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listUniInterestRecordsValidateBeforeCall(currency, page, limit, _callback); + 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; @@ -1031,13 +1040,15 @@ public class APIlistUniInterestRecordsRequest { private String currency; private Integer page; private Integer limit; + private Long from; + private Long to; private APIlistUniInterestRecordsRequest() { } /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistUniInterestRecordsRequest */ public APIlistUniInterestRecordsRequest currency(String currency) { @@ -1057,7 +1068,7 @@ public APIlistUniInterestRecordsRequest page(Integer page) { /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) * @return APIlistUniInterestRecordsRequest */ public APIlistUniInterestRecordsRequest limit(Integer limit) { @@ -1065,6 +1076,26 @@ public APIlistUniInterestRecordsRequest 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 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 @@ -1073,11 +1104,11 @@ public APIlistUniInterestRecordsRequest 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 { - return listUniInterestRecordsCall(currency, page, limit, _callback); + return listUniInterestRecordsCall(currency, page, limit, from, to, _callback); } /** @@ -1087,11 +1118,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 = listUniInterestRecordsWithHttpInfo(currency, page, limit); + ApiResponse> localVarResp = listUniInterestRecordsWithHttpInfo(currency, page, limit, from, to); return localVarResp.getData(); } @@ -1102,11 +1133,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 listUniInterestRecordsWithHttpInfo(currency, page, limit); + return listUniInterestRecordsWithHttpInfo(currency, page, limit, from, to); } /** @@ -1117,22 +1148,22 @@ public ApiResponse> executeWithHttpInfo() throws ApiExce * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listUniInterestRecordsAsync(currency, page, limit, _callback); + return listUniInterestRecordsAsync(currency, page, limit, from, to, _callback); } } /** - * List interest records + * Query user dividend records * * @return APIlistUniInterestRecordsRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistUniInterestRecordsRequest listUniInterestRecords() { @@ -1140,22 +1171,23 @@ public APIlistUniInterestRecordsRequest listUniInterestRecords() { } /** - * Build call for switchInterestReinvest - * @param uniInterestMode (required) + * 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
204 Success -
200 Query successful -
*/ - public okhttp3.Call switchInterestReinvestCall(UniInterestMode uniInterestMode, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = uniInterestMode; + public okhttp3.Call getUniInterestStatusCall(String currency, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/earn/uni/interest_reinvest"; + String localVarPath = "/earn/uni/interest_status/{currency}" + .replaceAll("\\{" + "currency" + "\\}", localVarApiClient.escapeString(currency)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1163,7 +1195,7 @@ public okhttp3.Call switchInterestReinvestCall(UniInterestMode uniInterestMode, Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1171,98 +1203,115 @@ public okhttp3.Call switchInterestReinvestCall(UniInterestMode uniInterestMode, } 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); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call switchInterestReinvestValidateBeforeCall(UniInterestMode uniInterestMode, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'uniInterestMode' is set - if (uniInterestMode == null) { - throw new ApiException("Missing the required parameter 'uniInterestMode' when calling switchInterestReinvest(Async)"); + 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 = switchInterestReinvestCall(uniInterestMode, _callback); + okhttp3.Call localVarCall = getUniInterestStatusCall(currency, _callback); return localVarCall; } /** - * Set interest reinvestment toggle + * Query currency interest compounding status * - * @param uniInterestMode (required) + * @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
204 Success -
200 Query successful -
*/ - public void switchInterestReinvest(UniInterestMode uniInterestMode) throws ApiException { - switchInterestReinvestWithHttpInfo(uniInterestMode); + public UniCurrencyInterest getUniInterestStatus(String currency) throws ApiException { + ApiResponse localVarResp = getUniInterestStatusWithHttpInfo(currency); + return localVarResp.getData(); } /** - * Set interest reinvestment toggle + * Query currency interest compounding status * - * @param uniInterestMode (required) - * @return ApiResponse<Void> + * @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
204 Success -
200 Query successful -
*/ - public ApiResponse switchInterestReinvestWithHttpInfo(UniInterestMode uniInterestMode) throws ApiException { - okhttp3.Call localVarCall = switchInterestReinvestValidateBeforeCall(uniInterestMode, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse getUniInterestStatusWithHttpInfo(String currency) throws ApiException { + okhttp3.Call localVarCall = getUniInterestStatusValidateBeforeCall(currency, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Set interest reinvestment toggle (asynchronously) + * Query currency interest compounding status (asynchronously) * - * @param uniInterestMode (required) + * @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
204 Success -
200 Query successful -
*/ - public okhttp3.Call switchInterestReinvestAsync(UniInterestMode uniInterestMode, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = switchInterestReinvestValidateBeforeCall(uniInterestMode, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + 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 getUniInterestStatus - * @param currency Currency (required) + * 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 Successfully retrieved -
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 getUniInterestStatusCall(String currency, final ApiCallback _callback) throws ApiException { + 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/interest_status/{currency}" - .replaceAll("\\{" + "currency" + "\\}", localVarApiClient.escapeString(currency)); + 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(); @@ -1285,67 +1334,181 @@ public okhttp3.Call getUniInterestStatusCall(String currency, final ApiCallback } @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)"); + 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)"); } - okhttp3.Call localVarCall = getUniInterestStatusCall(currency, _callback); + // 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; } /** - * query currency interest compounding status - * - * @param currency Currency (required) - * @return UniCurrencyInterest + * 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 Successfully retrieved -
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 UniCurrencyInterest getUniInterestStatus(String currency) throws ApiException { - ApiResponse localVarResp = getUniInterestStatusWithHttpInfo(currency); + public List listUniChart(Long from, Long to, String asset) throws ApiException { + ApiResponse> localVarResp = listUniChartWithHttpInfo(from, to, asset); return localVarResp.getData(); } /** - * query currency interest compounding status - * - * @param currency Currency (required) - * @return ApiResponse<UniCurrencyInterest> + * 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 Successfully retrieved -
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 getUniInterestStatusWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getUniInterestStatusValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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); } /** - * query currency interest compounding status (asynchronously) - * - * @param currency Currency (required) + * 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 Successfully retrieved -
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 getUniInterestStatusAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getUniInterestStatusValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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 index 7a625a8..b168961 100644 --- a/src/main/java/io/gate/gateapi/api/FlashSwapApi.java +++ b/src/main/java/io/gate/gateapi/api/FlashSwapApi.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,6 @@ import com.google.gson.reflect.TypeToken; -import io.gate.gateapi.models.FlashSwapCurrency; import io.gate.gateapi.models.FlashSwapCurrencyPair; import io.gate.gateapi.models.FlashSwapOrder; import io.gate.gateapi.models.FlashSwapOrderPreview; @@ -52,114 +51,7 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } - /** - * Build call for listFlashSwapCurrencies - * @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 -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listFlashSwapCurrenciesCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/flash_swap/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); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call listFlashSwapCurrenciesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listFlashSwapCurrenciesCall(_callback); - return localVarCall; - } - - /** - * List All Supported Currencies In Flash Swap (deprecated) - * - * @return List<FlashSwapCurrency> - * @throws ApiException If 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 -
- * @deprecated - */ - @Deprecated - public List listFlashSwapCurrencies() throws ApiException { - ApiResponse> localVarResp = listFlashSwapCurrenciesWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * List All Supported Currencies In Flash Swap (deprecated) - * - * @return ApiResponse<List<FlashSwapCurrency>> - * @throws ApiException If 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 -
- * @deprecated - */ - @Deprecated - public ApiResponse> listFlashSwapCurrenciesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listFlashSwapCurrenciesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List All Supported Currencies In Flash Swap (deprecated) (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 -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listFlashSwapCurrenciesAsync(final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFlashSwapCurrenciesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - private okhttp3.Call listFlashSwapCurrencyPairCall(String currency, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listFlashSwapCurrencyPairCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -171,6 +63,14 @@ private okhttp3.Call listFlashSwapCurrencyPairCall(String currency, final ApiCal 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(); @@ -193,20 +93,20 @@ private okhttp3.Call listFlashSwapCurrencyPairCall(String currency, final ApiCal } @SuppressWarnings("rawtypes") - private okhttp3.Call listFlashSwapCurrencyPairValidateBeforeCall(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listFlashSwapCurrencyPairCall(currency, _callback); + 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) throws ApiException { - okhttp3.Call localVarCall = listFlashSwapCurrencyPairValidateBeforeCall(currency, null); + 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, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFlashSwapCurrencyPairValidateBeforeCall(currency, _callback); + 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; @@ -214,13 +114,15 @@ private okhttp3.Call listFlashSwapCurrencyPairAsync(String currency, final ApiCa public class APIlistFlashSwapCurrencyPairRequest { private String currency; + private Integer page; + private Integer limit; private APIlistFlashSwapCurrencyPairRequest() { } /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistFlashSwapCurrencyPairRequest */ public APIlistFlashSwapCurrencyPairRequest currency(String currency) { @@ -228,6 +130,26 @@ public APIlistFlashSwapCurrencyPairRequest currency(String 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 @@ -236,11 +158,11 @@ public APIlistFlashSwapCurrencyPairRequest currency(String currency) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listFlashSwapCurrencyPairCall(currency, _callback); + return listFlashSwapCurrencyPairCall(currency, page, limit, _callback); } /** @@ -250,11 +172,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 = listFlashSwapCurrencyPairWithHttpInfo(currency); + ApiResponse> localVarResp = listFlashSwapCurrencyPairWithHttpInfo(currency, page, limit); return localVarResp.getData(); } @@ -265,11 +187,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 listFlashSwapCurrencyPairWithHttpInfo(currency); + return listFlashSwapCurrencyPairWithHttpInfo(currency, page, limit); } /** @@ -280,11 +202,11 @@ public ApiResponse> executeWithHttpInfo() throws Api * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listFlashSwapCurrencyPairAsync(currency, _callback); + return listFlashSwapCurrencyPairAsync(currency, page, limit, _callback); } } @@ -295,7 +217,7 @@ public okhttp3.Call executeAsync(final ApiCallback> * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistFlashSwapCurrencyPairRequest listFlashSwapCurrencyPair() { @@ -388,7 +310,7 @@ private APIlistFlashSwapOrdersRequest() { /** * Set status - * @param status Flash swap order status `1` - success `2` - failure (optional) + * @param status Flash swap order status `1` - success `2` - failed (optional) * @return APIlistFlashSwapOrdersRequest */ public APIlistFlashSwapOrdersRequest status(Integer status) { @@ -398,7 +320,7 @@ public APIlistFlashSwapOrdersRequest status(Integer status) { /** * Set sellCurrency - * @param sellCurrency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @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) { @@ -408,7 +330,7 @@ public APIlistFlashSwapOrdersRequest sellCurrency(String sellCurrency) { /** * Set buyCurrency - * @param buyCurrency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @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) { @@ -418,7 +340,7 @@ public APIlistFlashSwapOrdersRequest buyCurrency(String buyCurrency) { /** * Set reverse - * @param reverse If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) (optional) + * @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) { @@ -428,7 +350,7 @@ public APIlistFlashSwapOrdersRequest reverse(Boolean reverse) { /** * 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 APIlistFlashSwapOrdersRequest */ public APIlistFlashSwapOrdersRequest limit(Integer limit) { @@ -454,7 +376,7 @@ public APIlistFlashSwapOrdersRequest page(Integer page) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -468,7 +390,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 { @@ -483,7 +405,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 { @@ -498,7 +420,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 { @@ -507,13 +429,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callba } /** - * List all flash swap orders + * Query flash swap order list * * @return APIlistFlashSwapOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistFlashSwapOrdersRequest listFlashSwapOrders() { @@ -529,7 +451,7 @@ public APIlistFlashSwapOrdersRequest listFlashSwapOrders() { * @http.response.details - +
Status Code Description Response Headers
201 The flash swap order is created successfully -
201 Flash swap order created successfully -
*/ public okhttp3.Call createFlashSwapOrderCall(FlashSwapOrderRequest flashSwapOrderRequest, final ApiCallback _callback) throws ApiException { @@ -581,7 +503,7 @@ private okhttp3.Call createFlashSwapOrderValidateBeforeCall(FlashSwapOrderReques * @http.response.details - +
Status Code Description Response Headers
201 The flash swap order is created successfully -
201 Flash swap order created successfully -
*/ public FlashSwapOrder createFlashSwapOrder(FlashSwapOrderRequest flashSwapOrderRequest) throws ApiException { @@ -598,7 +520,7 @@ public FlashSwapOrder createFlashSwapOrder(FlashSwapOrderRequest flashSwapOrderR * @http.response.details - +
Status Code Description Response Headers
201 The flash swap order is created successfully -
201 Flash swap order created successfully -
*/ public ApiResponse createFlashSwapOrderWithHttpInfo(FlashSwapOrderRequest flashSwapOrderRequest) throws ApiException { @@ -617,7 +539,7 @@ public ApiResponse createFlashSwapOrderWithHttpInfo(FlashSwapOrd * @http.response.details - +
Status Code Description Response Headers
201 The flash swap order is created successfully -
201 Flash swap order created successfully -
*/ public okhttp3.Call createFlashSwapOrderAsync(FlashSwapOrderRequest flashSwapOrderRequest, final ApiCallback _callback) throws ApiException { @@ -636,7 +558,7 @@ public okhttp3.Call createFlashSwapOrderAsync(FlashSwapOrderRequest flashSwapOrd * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getFlashSwapOrderCall(Integer orderId, final ApiCallback _callback) throws ApiException { @@ -681,7 +603,7 @@ private okhttp3.Call getFlashSwapOrderValidateBeforeCall(Integer orderId, final } /** - * Get a single flash swap order's detail + * Query single flash swap order * * @param orderId Flash swap order ID (required) * @return FlashSwapOrder @@ -689,7 +611,7 @@ private okhttp3.Call getFlashSwapOrderValidateBeforeCall(Integer orderId, final * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public FlashSwapOrder getFlashSwapOrder(Integer orderId) throws ApiException { @@ -698,7 +620,7 @@ public FlashSwapOrder getFlashSwapOrder(Integer orderId) throws ApiException { } /** - * Get a single flash swap order's detail + * Query single flash swap order * * @param orderId Flash swap order ID (required) * @return ApiResponse<FlashSwapOrder> @@ -706,7 +628,7 @@ public FlashSwapOrder getFlashSwapOrder(Integer orderId) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getFlashSwapOrderWithHttpInfo(Integer orderId) throws ApiException { @@ -716,7 +638,7 @@ public ApiResponse getFlashSwapOrderWithHttpInfo(Integer orderId } /** - * Get a single flash swap order's detail (asynchronously) + * 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 @@ -725,7 +647,7 @@ public ApiResponse getFlashSwapOrderWithHttpInfo(Integer orderId * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getFlashSwapOrderAsync(Integer orderId, final ApiCallback _callback) throws ApiException { @@ -744,7 +666,7 @@ public okhttp3.Call getFlashSwapOrderAsync(Integer orderId, final ApiCallback Status Code Description Response Headers - 200 The flash swap order successfully previewed - + 200 Flash swap order preview successful - */ public okhttp3.Call previewFlashSwapOrderCall(FlashSwapPreviewRequest flashSwapPreviewRequest, final ApiCallback _callback) throws ApiException { @@ -788,7 +710,7 @@ private okhttp3.Call previewFlashSwapOrderValidateBeforeCall(FlashSwapPreviewReq } /** - * Initiate a flash swap order preview + * Flash swap order preview * * @param flashSwapPreviewRequest (required) * @return FlashSwapOrderPreview @@ -796,7 +718,7 @@ private okhttp3.Call previewFlashSwapOrderValidateBeforeCall(FlashSwapPreviewReq * @http.response.details - +
Status Code Description Response Headers
200 The flash swap order successfully previewed -
200 Flash swap order preview successful -
*/ public FlashSwapOrderPreview previewFlashSwapOrder(FlashSwapPreviewRequest flashSwapPreviewRequest) throws ApiException { @@ -805,7 +727,7 @@ public FlashSwapOrderPreview previewFlashSwapOrder(FlashSwapPreviewRequest flash } /** - * Initiate a flash swap order preview + * Flash swap order preview * * @param flashSwapPreviewRequest (required) * @return ApiResponse<FlashSwapOrderPreview> @@ -813,7 +735,7 @@ public FlashSwapOrderPreview previewFlashSwapOrder(FlashSwapPreviewRequest flash * @http.response.details - +
Status Code Description Response Headers
200 The flash swap order successfully previewed -
200 Flash swap order preview successful -
*/ public ApiResponse previewFlashSwapOrderWithHttpInfo(FlashSwapPreviewRequest flashSwapPreviewRequest) throws ApiException { @@ -823,7 +745,7 @@ public ApiResponse previewFlashSwapOrderWithHttpInfo(Flas } /** - * Initiate a flash swap order preview (asynchronously) + * Flash swap order preview (asynchronously) * * @param flashSwapPreviewRequest (required) * @param _callback The callback to be executed when the API call finishes @@ -832,7 +754,7 @@ public ApiResponse previewFlashSwapOrderWithHttpInfo(Flas * @http.response.details - +
Status Code Description Response Headers
200 The flash swap order successfully previewed -
200 Flash swap order preview successful -
*/ public okhttp3.Call previewFlashSwapOrderAsync(FlashSwapPreviewRequest flashSwapPreviewRequest, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/io/gate/gateapi/api/FuturesApi.java b/src/main/java/io/gate/gateapi/api/FuturesApi.java index dd15dc3..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,26 +20,32 @@ 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; @@ -73,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 @@ -94,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(); @@ -116,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); } /** @@ -242,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) @@ -260,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) @@ -279,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) @@ -389,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) { @@ -399,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) { @@ -409,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) { @@ -425,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 { @@ -439,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 { @@ -454,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 { @@ -469,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 { @@ -478,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) @@ -486,7 +551,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 APIlistFuturesOrderBookRequest listFuturesOrderBook(String settle, String contract) { @@ -593,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) { @@ -633,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) { @@ -649,7 +714,7 @@ 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 { @@ -663,7 +728,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 { @@ -678,7 +743,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 { @@ -693,7 +758,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 { @@ -702,7 +767,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) @@ -710,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 @@ -746,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(); @@ -768,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)"); @@ -779,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; @@ -804,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; @@ -822,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) { @@ -832,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) { @@ -842,7 +912,7 @@ public APIlistFuturesCandlesticksRequest limit(Integer limit) { /** * Set interval - * @param interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0. Note that 30d means 1 natual month, not 30 days (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) { @@ -850,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 @@ -858,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); } /** @@ -872,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(); } @@ -887,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); } /** @@ -902,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) @@ -919,7 +999,7 @@ 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) { @@ -1031,7 +1111,7 @@ public APIlistFuturesPremiumIndexRequest 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 APIlistFuturesPremiumIndexRequest */ public APIlistFuturesPremiumIndexRequest to(Long to) { @@ -1041,7 +1121,7 @@ public APIlistFuturesPremiumIndexRequest 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 APIlistFuturesPremiumIndexRequest */ public APIlistFuturesPremiumIndexRequest limit(Integer limit) { @@ -1051,7 +1131,7 @@ public APIlistFuturesPremiumIndexRequest limit(Integer limit) { /** * Set interval - * @param interval Interval time between data points (optional, default to 5m) + * @param interval Time interval between data points (optional, default to 5m) * @return APIlistFuturesPremiumIndexRequest */ public APIlistFuturesPremiumIndexRequest interval(String interval) { @@ -1067,7 +1147,7 @@ public APIlistFuturesPremiumIndexRequest 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 { @@ -1081,7 +1161,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 { @@ -1096,7 +1176,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 { @@ -1111,7 +1191,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiEx * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1120,7 +1200,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _c } /** - * Premium Index K-Line + * 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) * @param contract Futures contract (required) @@ -1128,7 +1208,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _c * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistFuturesPremiumIndexRequest listFuturesPremiumIndex(String settle, String contract) { @@ -1220,7 +1300,7 @@ public APIlistFuturesTickersRequest 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 { @@ -1234,7 +1314,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 { @@ -1249,7 +1329,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 { @@ -1264,7 +1344,7 @@ 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 { @@ -1273,21 +1353,21 @@ public okhttp3.Call executeAsync(final ApiCallback> _callbac } /** - * List futures tickers + * Get all futures trading statistics * * @param settle Settle currency (required) * @return APIlistFuturesTickersRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistFuturesTickersRequest listFuturesTickers(String settle) { return new APIlistFuturesTickersRequest(settle); } - private okhttp3.Call listFuturesFundingRateHistoryCall(String settle, String contract, Integer limit, final ApiCallback _callback) throws ApiException { + 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 @@ -1304,6 +1384,14 @@ private okhttp3.Call listFuturesFundingRateHistoryCall(String settle, String con 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(); @@ -1326,7 +1414,7 @@ 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 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)"); @@ -1337,19 +1425,19 @@ private okhttp3.Call listFuturesFundingRateHistoryValidateBeforeCall(String sett throw new ApiException("Missing the required parameter 'contract' when calling listFuturesFundingRateHistory(Async)"); } - okhttp3.Call localVarCall = listFuturesFundingRateHistoryCall(settle, contract, limit, _callback); + okhttp3.Call localVarCall = listFuturesFundingRateHistoryCall(settle, contract, limit, from, to, _callback); return localVarCall; } - private ApiResponse> listFuturesFundingRateHistoryWithHttpInfo(String settle, String contract, Integer limit) throws ApiException { - okhttp3.Call localVarCall = listFuturesFundingRateHistoryValidateBeforeCall(settle, contract, limit, null); + 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, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesFundingRateHistoryValidateBeforeCall(settle, contract, limit, _callback); + 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; @@ -1359,6 +1447,8 @@ 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; @@ -1367,7 +1457,7 @@ private APIlistFuturesFundingRateHistoryRequest(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 APIlistFuturesFundingRateHistoryRequest */ public APIlistFuturesFundingRateHistoryRequest limit(Integer limit) { @@ -1375,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 @@ -1383,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); } /** @@ -1397,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(); } @@ -1412,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); } /** @@ -1427,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) @@ -1444,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) { @@ -1520,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) { @@ -1536,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 { @@ -1550,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 { @@ -1565,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 { @@ -1580,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 { @@ -1589,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) { @@ -1703,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) { @@ -1729,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 { @@ -1743,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 { @@ -1758,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 { @@ -1773,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 { @@ -1782,7 +1892,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback } /** - * Futures stats + * Futures statistics * * @param settle Settle currency (required) * @param contract Futures contract (required) @@ -1790,7 +1900,7 @@ 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) { @@ -1807,7 +1917,7 @@ public APIlistContractStatsRequest listContractStats(String settle, String contr * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getIndexConstituentsCall(String settle, String index, final ApiCallback _callback) throws ApiException { @@ -1858,7 +1968,7 @@ private okhttp3.Call getIndexConstituentsValidateBeforeCall(String settle, Strin } /** - * Get index constituents + * Query index constituents * * @param settle Settle currency (required) * @param index Index name (required) @@ -1867,7 +1977,7 @@ private okhttp3.Call getIndexConstituentsValidateBeforeCall(String settle, Strin * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public FuturesIndexConstituents getIndexConstituents(String settle, String index) throws ApiException { @@ -1876,7 +1986,7 @@ public FuturesIndexConstituents getIndexConstituents(String settle, String index } /** - * Get index constituents + * Query index constituents * * @param settle Settle currency (required) * @param index Index name (required) @@ -1885,7 +1995,7 @@ public FuturesIndexConstituents getIndexConstituents(String settle, String index * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getIndexConstituentsWithHttpInfo(String settle, String index) throws ApiException { @@ -1895,7 +2005,7 @@ public ApiResponse getIndexConstituentsWithHttpInfo(St } /** - * Get index constituents (asynchronously) + * Query index constituents (asynchronously) * * @param settle Settle currency (required) * @param index Index name (required) @@ -1905,7 +2015,7 @@ public ApiResponse getIndexConstituentsWithHttpInfo(St * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getIndexConstituentsAsync(String settle, String index, final ApiCallback _callback) throws ApiException { @@ -2009,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) { @@ -2019,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) { @@ -2029,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) { @@ -2045,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 { @@ -2059,7 +2169,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 { @@ -2074,7 +2184,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 { @@ -2089,7 +2199,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -2098,41 +2208,41 @@ public okhttp3.Call executeAsync(final ApiCallback> _callb } /** - * 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); } - /** - * Build call for listFuturesAccounts - * @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 listFuturesAccountsCall(String settle, final ApiCallback _callback) throws ApiException { + 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}/accounts" + 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(); @@ -2150,98 +2260,288 @@ public okhttp3.Call listFuturesAccountsCall(String settle, final ApiCallback _ca 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 listFuturesAccountsValidateBeforeCall(String settle, final ApiCallback _callback) throws ApiException { + 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 listFuturesAccounts(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling listFuturesRiskLimitTiers(Async)"); } - okhttp3.Call localVarCall = listFuturesAccountsCall(settle, _callback); + okhttp3.Call localVarCall = listFuturesRiskLimitTiersCall(settle, contract, limit, offset, _callback); return localVarCall; } - /** - * Query futures account - * - * @param settle Settle currency (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 List retrieved -
- */ - public FuturesAccount listFuturesAccounts(String settle) throws ApiException { - ApiResponse localVarResp = listFuturesAccountsWithHttpInfo(settle); - return localVarResp.getData(); - } - /** - * Query futures account - * - * @param settle Settle currency (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 List retrieved -
- */ - public ApiResponse listFuturesAccountsWithHttpInfo(String settle) throws ApiException { - okhttp3.Call localVarCall = listFuturesAccountsValidateBeforeCall(settle, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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); } - /** - * Query futures account (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 listFuturesAccountsAsync(String settle, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listFuturesAccountsValidateBeforeCall(settle, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + 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; } - private okhttp3.Call listFuturesAccountBookCall(String settle, Integer limit, Long from, Long to, String type, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + public class APIlistFuturesRiskLimitTiersRequest { + private final String settle; + private String contract; + private Integer limit; + private Integer offset; - // create path and map variables - String localVarPath = "/futures/{settle}/account_book" - .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + private APIlistFuturesRiskLimitTiersRequest(String settle) { + this.settle = settle; + } - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + /** + * 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; } - if (from != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from)); + /** + * 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; } - if (to != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); + /** + * 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; } - if (type != null) { + /** + * 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) + * @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 listFuturesAccountsCall(String settle, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/futures/{settle}/accounts" + .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 = { + + }; + 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 listFuturesAccountsValidateBeforeCall(String settle, 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 listFuturesAccounts(Async)"); + } + + okhttp3.Call localVarCall = listFuturesAccountsCall(settle, _callback); + return localVarCall; + } + + /** + * Get futures account + * + * @param settle Settle currency (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 Query successful -
+ */ + public FuturesAccount listFuturesAccounts(String settle) throws ApiException { + ApiResponse localVarResp = listFuturesAccountsWithHttpInfo(settle); + return localVarResp.getData(); + } + + /** + * Get futures account + * + * @param settle Settle currency (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 Query successful -
+ */ + public ApiResponse listFuturesAccountsWithHttpInfo(String settle) throws ApiException { + okhttp3.Call localVarCall = listFuturesAccountsValidateBeforeCall(settle, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get futures account (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 Query successful -
+ */ + public okhttp3.Call listFuturesAccountsAsync(String settle, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listFuturesAccountsValidateBeforeCall(settle, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listFuturesAccountBookCall(String settle, String contract, 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 = "/futures/{settle}/account_book" + .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 (type != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); } @@ -2267,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; @@ -2293,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; @@ -2302,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) { @@ -2312,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) { @@ -2324,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) { @@ -2334,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) { @@ -2350,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); } /** @@ -2364,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(); } @@ -2379,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); } /** @@ -2394,30 +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); } - private okhttp3.Call listPositionsCall(String settle, Boolean holding, 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 @@ -2430,6 +2752,14 @@ private okhttp3.Call listPositionsCall(String settle, Boolean holding, final Api 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(); @@ -2452,25 +2782,25 @@ private okhttp3.Call listPositionsCall(String settle, Boolean holding, final Api } @SuppressWarnings("rawtypes") - private okhttp3.Call listPositionsValidateBeforeCall(String settle, Boolean holding, 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, holding, _callback); + okhttp3.Call localVarCall = listPositionsCall(settle, holding, limit, offset, _callback); return localVarCall; } - private ApiResponse> listPositionsWithHttpInfo(String settle, Boolean holding) throws ApiException { - okhttp3.Call localVarCall = listPositionsValidateBeforeCall(settle, holding, 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); } - private okhttp3.Call listPositionsAsync(String settle, Boolean holding, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listPositionsValidateBeforeCall(settle, holding, _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; @@ -2479,6 +2809,8 @@ private okhttp3.Call listPositionsAsync(String settle, Boolean holding, final Ap public class APIlistPositionsRequest { private final String settle; private Boolean holding; + private Integer limit; + private Integer offset; private APIlistPositionsRequest(String settle) { this.settle = settle; @@ -2486,7 +2818,7 @@ private APIlistPositionsRequest(String settle) { /** * Set holding - * @param holding Return only real positions - true, return all - false. (optional) + * @param holding Return only real positions - true, return all - false (optional) * @return APIlistPositionsRequest */ public APIlistPositionsRequest holding(Boolean holding) { @@ -2494,6 +2826,26 @@ public APIlistPositionsRequest holding(Boolean 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 @@ -2502,11 +2854,11 @@ public APIlistPositionsRequest holding(Boolean holding) { * @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 listPositionsCall(settle, holding, _callback); + return listPositionsCall(settle, holding, limit, offset, _callback); } /** @@ -2516,11 +2868,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 = listPositionsWithHttpInfo(settle, holding); + ApiResponse> localVarResp = listPositionsWithHttpInfo(settle, holding, limit, offset); return localVarResp.getData(); } @@ -2531,11 +2883,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 listPositionsWithHttpInfo(settle, holding); + return listPositionsWithHttpInfo(settle, holding, limit, offset); } /** @@ -2546,43 +2898,30 @@ 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 listPositionsAsync(settle, holding, _callback); + return listPositionsAsync(settle, holding, limit, offset, _callback); } } /** - * List all positions of a user + * Get user position list * * @param settle Settle currency (required) * @return APIlistPositionsRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistPositionsRequest listPositions(String settle) { return new APIlistPositionsRequest(settle); } - /** - * Build call for getPosition - * @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 - * @http.response.details - - - -
Status Code Description Response Headers
200 Position information -
- */ - public okhttp3.Call getPositionCall(String settle, String contract, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getPositionCall(String settle, String contract, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -2629,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 @@ -2762,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 @@ -2781,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 @@ -2801,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 @@ -2823,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 @@ -2833,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 @@ -2851,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(); @@ -2873,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)"); @@ -2889,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; } @@ -2899,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 @@ -2908,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(); } @@ -2919,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 @@ -2928,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); } @@ -2940,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 @@ -2950,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 @@ -2971,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(); @@ -2997,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); @@ -3007,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 @@ -3041,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 @@ -3060,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 @@ -3081,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(); @@ -3126,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); @@ -3136,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(); @@ -3250,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(); @@ -3382,126 +3758,256 @@ 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); + 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; + } + + 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}" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)) + .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 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 getDualModePosition(Async)"); + } + + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling getDualModePosition(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); + } + + 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); + } + } + /** - * Build call for updateDualModePositionLeverage + * Get position information 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 APIgetDualModePositionRequest + * @http.response.details + + + +
Status Code Description Response Headers
200 Query successful -
+ */ + public APIgetDualModePositionRequest getDualModePosition(String settle, String contract) { + return new APIgetDualModePositionRequest(settle, contract); + } + + /** + * Build call for updateDualModePositionMargin + * @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 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 updateDualModePositionLeverageCall(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback _callback) throws ApiException { + 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}/leverage" + 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 (leverage != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("leverage", leverage)); + if (change != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("change", change)); } - if (crossLeverageLimit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("cross_leverage_limit", crossLeverageLimit)); + if (dualSide != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dual_side", dualSide)); } Map localVarHeaderParams = new HashMap(); @@ -3526,116 +4032,126 @@ public okhttp3.Call updateDualModePositionLeverageCall(String settle, String con } @SuppressWarnings("rawtypes") - private okhttp3.Call updateDualModePositionLeverageValidateBeforeCall(String settle, String contract, String leverage, String crossLeverageLimit, final ApiCallback _callback) throws ApiException { + 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 updateDualModePositionLeverage(Async)"); + 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 updateDualModePositionLeverage(Async)"); + throw new ApiException("Missing the required parameter 'contract' when calling updateDualModePositionMargin(Async)"); } - // verify the required parameter 'leverage' is set - if (leverage == null) { - throw new ApiException("Missing the required parameter 'leverage' when calling updateDualModePositionLeverage(Async)"); + // verify the required parameter 'change' is set + if (change == null) { + throw new ApiException("Missing the required parameter 'change' when calling updateDualModePositionMargin(Async)"); } - okhttp3.Call localVarCall = updateDualModePositionLeverageCall(settle, contract, leverage, crossLeverageLimit, _callback); + // 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 leverage in dual mode + * Update position margin 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) + * @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 Successfully retrieved -
200 Query successful -
*/ - public List updateDualModePositionLeverage(String settle, String contract, String leverage, String crossLeverageLimit) throws ApiException { - ApiResponse> localVarResp = updateDualModePositionLeverageWithHttpInfo(settle, contract, leverage, crossLeverageLimit); + 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 leverage in dual mode + * Update position margin 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) + * @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 Successfully retrieved -
200 Query successful -
*/ - public ApiResponse> updateDualModePositionLeverageWithHttpInfo(String settle, String contract, String leverage, String crossLeverageLimit) throws ApiException { - okhttp3.Call localVarCall = updateDualModePositionLeverageValidateBeforeCall(settle, contract, leverage, crossLeverageLimit, null); + 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 leverage in dual mode (asynchronously) + * Update position margin in dual mode (asynchronously) * * @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 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 Successfully retrieved -
200 Query successful -
*/ - 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); + 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 updateDualModePositionRiskLimit + * Build call for updateDualModePositionLeverage * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (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 Successfully retrieved -
200 Query successful -
*/ - public okhttp3.Call updateDualModePositionRiskLimitCall(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { + 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}/risk_limit" + 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 (riskLimit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("risk_limit", riskLimit)); + if (leverage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("leverage", leverage)); + } + + if (crossLeverageLimit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cross_leverage_limit", crossLeverageLimit)); } Map localVarHeaderParams = new HashMap(); @@ -3660,93 +4176,227 @@ public okhttp3.Call updateDualModePositionRiskLimitCall(String settle, String co } @SuppressWarnings("rawtypes") - private okhttp3.Call updateDualModePositionRiskLimitValidateBeforeCall(String settle, String contract, String riskLimit, final ApiCallback _callback) throws ApiException { + 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 updateDualModePositionRiskLimit(Async)"); + 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 updateDualModePositionRiskLimit(Async)"); + throw new ApiException("Missing the required parameter 'contract' when calling updateDualModePositionLeverage(Async)"); } - // verify the required parameter 'riskLimit' is set - if (riskLimit == null) { - throw new ApiException("Missing the required parameter 'riskLimit' when calling updateDualModePositionRiskLimit(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 = updateDualModePositionRiskLimitCall(settle, contract, riskLimit, _callback); + okhttp3.Call localVarCall = updateDualModePositionLeverageCall(settle, contract, leverage, crossLeverageLimit, _callback); return localVarCall; } /** - * Update position risk limit in dual mode + * Update position leverage in dual mode * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (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 Successfully retrieved -
200 Query successful -
*/ - public List updateDualModePositionRiskLimit(String settle, String contract, String riskLimit) throws ApiException { - ApiResponse> localVarResp = updateDualModePositionRiskLimitWithHttpInfo(settle, contract, riskLimit); + 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 risk limit in dual mode + * Update position leverage in dual mode * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (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> updateDualModePositionRiskLimitWithHttpInfo(String settle, String contract, String riskLimit) throws ApiException { - okhttp3.Call localVarCall = updateDualModePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, 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); } /** - * Update position risk limit in dual mode (asynchronously) + * Update position leverage in dual mode (asynchronously) * * @param settle Settle currency (required) * @param contract Futures contract (required) - * @param riskLimit New position risk limit (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 updateDualModePositionRiskLimitAsync(String settle, String contract, String riskLimit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = updateDualModePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, _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; } - 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 - String localVarPath = "/futures/{settle}/orders" - .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); + /** + * Build call for updateDualModePositionRiskLimit + * @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 Query successful -
+ */ + public okhttp3.Call updateDualModePositionRiskLimitCall(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}/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(); + 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 updateDualModePositionRiskLimitValidateBeforeCall(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 updateDualModePositionRiskLimit(Async)"); + } + + // verify the required parameter 'contract' is set + if (contract == null) { + throw new ApiException("Missing the required parameter 'contract' when calling updateDualModePositionRiskLimit(Async)"); + } + + // verify the required parameter 'riskLimit' is set + if (riskLimit == null) { + throw new ApiException("Missing the required parameter 'riskLimit' when calling updateDualModePositionRiskLimit(Async)"); + } + + okhttp3.Call localVarCall = updateDualModePositionRiskLimitCall(settle, contract, riskLimit, _callback); + return localVarCall; + } + + /** + * Update position risk limit in dual mode + * + * @param settle Settle currency (required) + * @param contract Futures contract (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 Query successful -
+ */ + public List updateDualModePositionRiskLimit(String settle, String contract, String riskLimit) throws ApiException { + ApiResponse> localVarResp = updateDualModePositionRiskLimitWithHttpInfo(settle, contract, riskLimit); + return localVarResp.getData(); + } + + /** + * Update position risk limit in dual mode + * + * @param settle Settle currency (required) + * @param contract Futures contract (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 Query successful -
+ */ + public ApiResponse> updateDualModePositionRiskLimitWithHttpInfo(String settle, String contract, String riskLimit) throws ApiException { + okhttp3.Call localVarCall = updateDualModePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update position risk limit in dual mode (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 Query successful -
+ */ + public okhttp3.Call updateDualModePositionRiskLimitAsync(String settle, String contract, String riskLimit, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = updateDualModePositionRiskLimitValidateBeforeCall(settle, contract, riskLimit, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + 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 + String localVarPath = "/futures/{settle}/orders" + .replaceAll("\\{" + "settle" + "\\}", localVarApiClient.escapeString(settle)); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3846,7 +4496,7 @@ public APIlistFuturesOrdersRequest 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 APIlistFuturesOrdersRequest */ public APIlistFuturesOrdersRequest limit(Integer limit) { @@ -3866,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) { @@ -3882,7 +4532,7 @@ public APIlistFuturesOrdersRequest lastId(String lastId) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
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 { @@ -3896,7 +4546,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public List execute() throws ApiException { @@ -3911,7 +4561,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -3926,7 +4576,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
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 { @@ -3935,15 +4585,15 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback } /** - * List futures orders - * Zero-filled order cannot be retrieved 10 minutes after order 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 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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public APIlistFuturesOrdersRequest listFuturesOrders(String settle, String status) { @@ -3954,6 +4604,7 @@ public APIlistFuturesOrdersRequest listFuturesOrders(String settle, String statu * 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 @@ -3963,7 +4614,7 @@ public APIlistFuturesOrdersRequest listFuturesOrders(String settle, String statu 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 @@ -3973,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 = { @@ -3994,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)"); @@ -4005,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 - * - Creating futures orders requires `size`, which is number of contracts instead of currency amount. You can use `quanto_multiplier` in contract detail response to know how much currency 1 size contract represents - Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders - Set `reduce_only` to `true` can keep the position from changing side when reducing position size - In single position mode, to close a position, you need to set `size` to 0 and `close` to `true` - In dual position mode, to close one side position, you need to set `auto_size` side, `reduce_only` to true and `size` to 0 - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body + * 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 @@ -4022,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 - * - Creating futures orders requires `size`, which is number of contracts instead of currency amount. You can use `quanto_multiplier` in contract detail response to know how much currency 1 size contract represents - Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders - Set `reduce_only` to `true` can keep the position from changing side when reducing position size - In single position mode, to close a position, you need to set `size` to 0 and `close` to `true` - In dual position mode, to close one side position, you need to set `auto_size` side, `reduce_only` to true and `size` to 0 - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body + * 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 @@ -4040,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) - * - Creating futures orders requires `size`, which is number of contracts instead of currency amount. You can use `quanto_multiplier` in contract detail response to know how much currency 1 size contract represents - Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders - Set `reduce_only` to `true` can keep the position from changing side when reducing position size - In single position mode, to close a position, you need to set `size` to 0 and `close` to `true` - In dual position mode, to close one side position, you need to set `auto_size` side, `reduce_only` to true and `size` to 0 - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body + * 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 @@ -4060,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; @@ -4071,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 @@ -4098,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 = { @@ -4120,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)"); @@ -4131,66 +4804,75 @@ 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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-filled order cannot be retrieved 10 minutes after order 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; @@ -4295,7 +4977,7 @@ public APIgetOrdersWithTimeRangeRequest 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 APIgetOrdersWithTimeRangeRequest */ public APIgetOrdersWithTimeRangeRequest from(Long from) { @@ -4305,7 +4987,7 @@ public APIgetOrdersWithTimeRangeRequest 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 APIgetOrdersWithTimeRangeRequest */ public APIgetOrdersWithTimeRangeRequest to(Long to) { @@ -4315,7 +4997,7 @@ public APIgetOrdersWithTimeRangeRequest 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 APIgetOrdersWithTimeRangeRequest */ public APIgetOrdersWithTimeRangeRequest limit(Integer limit) { @@ -4341,7 +5023,7 @@ public APIgetOrdersWithTimeRangeRequest offset(Integer offset) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
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 { @@ -4355,7 +5037,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public List execute() throws ApiException { @@ -4370,7 +5052,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -4385,7 +5067,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
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 { @@ -4394,14 +5076,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback } /** - * List Futures Orders By Time Range + * 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 * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public APIgetOrdersWithTimeRangeRequest getOrdersWithTimeRange(String settle) { @@ -4412,16 +5094,17 @@ public APIgetOrdersWithTimeRangeRequest getOrdersWithTimeRange(String settle) { * Build call for createBatchFuturesOrder * @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 * @http.response.details - +
Status Code Description Response Headers
200 Request is completed -
200 Request execution completed -
*/ - public okhttp3.Call createBatchFuturesOrderCall(String settle, List futuresOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createBatchFuturesOrderCall(String settle, List futuresOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { Object localVarPostBody = futuresOrder; // create path and map variables @@ -4431,6 +5114,10 @@ public okhttp3.Call createBatchFuturesOrderCall(String 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 = { @@ -4452,7 +5139,7 @@ public okhttp3.Call createBatchFuturesOrderCall(String settle, List futuresOrder, 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 createBatchFuturesOrder(Async)"); @@ -4463,63 +5150,66 @@ private okhttp3.Call createBatchFuturesOrderValidateBeforeCall(String settle, Li throw new ApiException("Missing the required parameter 'futuresOrder' when calling createBatchFuturesOrder(Async)"); } - okhttp3.Call localVarCall = createBatchFuturesOrderCall(settle, futuresOrder, _callback); + okhttp3.Call localVarCall = createBatchFuturesOrderCall(settle, futuresOrder, xGateExptime, _callback); return localVarCall; } /** - * Create a batch of futures orders + * 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 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 Request is completed -
200 Request execution completed -
*/ - public List createBatchFuturesOrder(String settle, List futuresOrder) throws ApiException { - ApiResponse> localVarResp = createBatchFuturesOrderWithHttpInfo(settle, futuresOrder); + public List createBatchFuturesOrder(String settle, List futuresOrder, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = createBatchFuturesOrderWithHttpInfo(settle, futuresOrder, xGateExptime); return localVarResp.getData(); } /** - * Create a batch of futures orders + * 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 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 Request is completed -
200 Request execution completed -
*/ - public ApiResponse> createBatchFuturesOrderWithHttpInfo(String settle, List futuresOrder) throws ApiException { - okhttp3.Call localVarCall = createBatchFuturesOrderValidateBeforeCall(settle, futuresOrder, null); + 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); } /** - * Create a batch of futures orders (asynchronously) + * 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 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 Request is completed -
200 Request execution completed -
*/ - public okhttp3.Call createBatchFuturesOrderAsync(String settle, List futuresOrder, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = createBatchFuturesOrderValidateBeforeCall(settle, futuresOrder, _callback); + 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; @@ -4528,7 +5218,7 @@ public okhttp3.Call createBatchFuturesOrderAsync(String settle, List getFuturesOrderWithHttpInfo(String settle, Stri } /** - * Get a single order (asynchronously) - * Zero-filled order cannot be retrieved 10 minutes after order cancellation + * 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 can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4646,8 +5336,9 @@ public okhttp3.Call getFuturesOrderAsync(String settle, String orderId, final Ap /** * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4657,7 +5348,7 @@ public okhttp3.Call getFuturesOrderAsync(String settle, String orderId, final Ap 200 Order details - */ - public okhttp3.Call amendFuturesOrderCall(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, final ApiCallback _callback) throws ApiException { + 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 @@ -4668,6 +5359,10 @@ public okhttp3.Call amendFuturesOrderCall(String settle, String orderId, Futures 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 = { @@ -4689,7 +5384,7 @@ public okhttp3.Call amendFuturesOrderCall(String settle, String orderId, Futures } @SuppressWarnings("rawtypes") - private okhttp3.Call amendFuturesOrderValidateBeforeCall(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, final ApiCallback _callback) throws ApiException { + 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)"); @@ -4705,16 +5400,17 @@ private okhttp3.Call amendFuturesOrderValidateBeforeCall(String settle, String o throw new ApiException("Missing the required parameter 'futuresOrderAmendment' when calling amendFuturesOrder(Async)"); } - okhttp3.Call localVarCall = amendFuturesOrderCall(settle, orderId, futuresOrderAmendment, _callback); + okhttp3.Call localVarCall = amendFuturesOrderCall(settle, orderId, futuresOrderAmendment, xGateExptime, _callback); return localVarCall; } /** - * Amend an order + * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4723,17 +5419,18 @@ private okhttp3.Call amendFuturesOrderValidateBeforeCall(String settle, String o 200 Order details - */ - public FuturesOrder amendFuturesOrder(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment) throws ApiException { - ApiResponse localVarResp = amendFuturesOrderWithHttpInfo(settle, orderId, futuresOrderAmendment); + public FuturesOrder amendFuturesOrder(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, String xGateExptime) throws ApiException { + ApiResponse localVarResp = amendFuturesOrderWithHttpInfo(settle, orderId, futuresOrderAmendment, xGateExptime); return localVarResp.getData(); } /** - * Amend an order + * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4742,18 +5439,19 @@ public FuturesOrder amendFuturesOrder(String settle, String orderId, FuturesOrde 200 Order details - */ - public ApiResponse amendFuturesOrderWithHttpInfo(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment) throws ApiException { - okhttp3.Call localVarCall = amendFuturesOrderValidateBeforeCall(settle, orderId, futuresOrderAmendment, null); + 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 an order (asynchronously) + * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4763,8 +5461,8 @@ public ApiResponse amendFuturesOrderWithHttpInfo(String settle, St 200 Order details - */ - public okhttp3.Call amendFuturesOrderAsync(String settle, String orderId, FuturesOrderAmendment futuresOrderAmendment, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = amendFuturesOrderValidateBeforeCall(settle, orderId, futuresOrderAmendment, _callback); + 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; @@ -4773,7 +5471,8 @@ public okhttp3.Call amendFuturesOrderAsync(String settle, String orderId, Future /** * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4783,7 +5482,7 @@ public okhttp3.Call amendFuturesOrderAsync(String settle, String orderId, Future 200 Order details - */ - public okhttp3.Call cancelFuturesOrderCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call cancelFuturesOrderCall(String settle, String orderId, String xGateExptime, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -4794,6 +5493,10 @@ public okhttp3.Call cancelFuturesOrderCall(String settle, String orderId, final 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 = { @@ -4815,7 +5518,7 @@ public okhttp3.Call cancelFuturesOrderCall(String settle, String orderId, final } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelFuturesOrderValidateBeforeCall(String settle, String orderId, final ApiCallback _callback) throws ApiException { + 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)"); @@ -4826,15 +5529,16 @@ private okhttp3.Call cancelFuturesOrderValidateBeforeCall(String settle, String throw new ApiException("Missing the required parameter 'orderId' when calling cancelFuturesOrder(Async)"); } - okhttp3.Call localVarCall = cancelFuturesOrderCall(settle, orderId, _callback); + okhttp3.Call localVarCall = cancelFuturesOrderCall(settle, orderId, xGateExptime, _callback); return localVarCall; } /** - * Cancel a single order + * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4843,16 +5547,17 @@ 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 cancelFuturesOrder(String settle, String orderId, String xGateExptime) throws ApiException { + ApiResponse localVarResp = cancelFuturesOrderWithHttpInfo(settle, orderId, xGateExptime); return localVarResp.getData(); } /** - * Cancel a single order + * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4861,17 +5566,18 @@ 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 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 a single order (asynchronously) + * 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. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (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 @@ -4881,8 +5587,8 @@ 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 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; @@ -4997,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) { @@ -5033,7 +5739,7 @@ public APIgetMyTradesRequest lastId(String lastId) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
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 { @@ -5047,7 +5753,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public List execute() throws ApiException { @@ -5062,7 +5768,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -5077,7 +5783,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
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 { @@ -5086,14 +5792,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callba } /** - * 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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public APIgetMyTradesRequest getMyTrades(String settle) { @@ -5204,7 +5910,7 @@ public APIgetMyTradesWithTimeRangeRequest 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 APIgetMyTradesWithTimeRangeRequest */ public APIgetMyTradesWithTimeRangeRequest from(Long from) { @@ -5214,7 +5920,7 @@ public APIgetMyTradesWithTimeRangeRequest 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 APIgetMyTradesWithTimeRangeRequest */ public APIgetMyTradesWithTimeRangeRequest to(Long to) { @@ -5224,7 +5930,7 @@ public APIgetMyTradesWithTimeRangeRequest 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 APIgetMyTradesWithTimeRangeRequest */ public APIgetMyTradesWithTimeRangeRequest limit(Integer limit) { @@ -5244,7 +5950,7 @@ public APIgetMyTradesWithTimeRangeRequest offset(Integer offset) { /** * Set role - * @param role Query role, maker or taker. (optional) + * @param role Query role, maker or taker (optional) * @return APIgetMyTradesWithTimeRangeRequest */ public APIgetMyTradesWithTimeRangeRequest role(String role) { @@ -5260,7 +5966,7 @@ public APIgetMyTradesWithTimeRangeRequest role(String role) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
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 { @@ -5274,7 +5980,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public List execute() throws ApiException { @@ -5289,7 +5995,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
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { @@ -5304,7 +6010,7 @@ public ApiResponse> executeWithHttpInfo() throws A * @http.response.details - +
Status Code Description Response Headers
200 List retrieved * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
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 { @@ -5313,14 +6019,14 @@ public okhttp3.Call executeAsync(final ApiCallback } /** - * List personal trading history by time range + * 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 * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
200 List retrieved successfully * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
*/ public APIgetMyTradesWithTimeRangeRequest getMyTradesWithTimeRange(String settle) { @@ -5436,7 +6142,7 @@ public APIlistPositionCloseRequest 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 APIlistPositionCloseRequest */ public APIlistPositionCloseRequest limit(Integer limit) { @@ -5456,7 +6162,7 @@ public APIlistPositionCloseRequest offset(Integer offset) { /** * 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 APIlistPositionCloseRequest */ public APIlistPositionCloseRequest from(Long from) { @@ -5466,7 +6172,7 @@ public APIlistPositionCloseRequest 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 APIlistPositionCloseRequest */ public APIlistPositionCloseRequest to(Long to) { @@ -5476,7 +6182,7 @@ public APIlistPositionCloseRequest to(Long to) { /** * Set side - * @param side Query side. long or shot (optional) + * @param side Query side. long or shot (optional) * @return APIlistPositionCloseRequest */ public APIlistPositionCloseRequest side(String side) { @@ -5502,7 +6208,7 @@ public APIlistPositionCloseRequest pnl(String pnl) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -5516,7 +6222,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 { @@ -5531,7 +6237,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 { @@ -5546,7 +6252,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 { @@ -5555,21 +6261,21 @@ public okhttp3.Call executeAsync(final ApiCallback> _callbac } /** - * List position close history + * Query position close history * * @param settle Settle currency (required) * @return APIlistPositionCloseRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistPositionCloseRequest listPositionClose(String settle) { return new APIlistPositionCloseRequest(settle); } - private okhttp3.Call listLiquidatesCall(String settle, String contract, Integer limit, Integer at, final ApiCallback _callback) throws ApiException { + 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 @@ -5586,6 +6292,18 @@ private okhttp3.Call listLiquidatesCall(String settle, String contract, Integer 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)); } @@ -5612,25 +6330,25 @@ private okhttp3.Call listLiquidatesCall(String settle, String contract, Integer } @SuppressWarnings("rawtypes") - private okhttp3.Call listLiquidatesValidateBeforeCall(String settle, String contract, Integer limit, Integer at, final ApiCallback _callback) throws ApiException { + 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, at, _callback); + okhttp3.Call localVarCall = listLiquidatesCall(settle, contract, limit, offset, from, to, at, _callback); return localVarCall; } - private ApiResponse> listLiquidatesWithHttpInfo(String settle, String contract, Integer limit, Integer at) throws ApiException { - okhttp3.Call localVarCall = listLiquidatesValidateBeforeCall(settle, contract, limit, at, null); + 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 at, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listLiquidatesValidateBeforeCall(settle, contract, limit, at, _callback); + 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; @@ -5640,6 +6358,9 @@ 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) { @@ -5658,7 +6379,7 @@ public APIlistLiquidatesRequest 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 APIlistLiquidatesRequest */ public APIlistLiquidatesRequest limit(Integer limit) { @@ -5666,9 +6387,39 @@ public APIlistLiquidatesRequest limit(Integer 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 a liquidation timestamp (optional, default to 0) + * @param at Specify liquidation timestamp (optional, default to 0) * @return APIlistLiquidatesRequest */ public APIlistLiquidatesRequest at(Integer at) { @@ -5684,11 +6435,11 @@ public APIlistLiquidatesRequest 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 { - return listLiquidatesCall(settle, contract, limit, at, _callback); + return listLiquidatesCall(settle, contract, limit, offset, from, to, at, _callback); } /** @@ -5698,11 +6449,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 = listLiquidatesWithHttpInfo(settle, contract, limit, at); + ApiResponse> localVarResp = listLiquidatesWithHttpInfo(settle, contract, limit, offset, from, to, at); return localVarResp.getData(); } @@ -5713,11 +6464,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 listLiquidatesWithHttpInfo(settle, contract, limit, at); + return listLiquidatesWithHttpInfo(settle, contract, limit, offset, from, to, at); } /** @@ -5728,30 +6479,30 @@ 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 { - return listLiquidatesAsync(settle, contract, limit, at, _callback); + return listLiquidatesAsync(settle, contract, limit, offset, from, to, at, _callback); } } /** - * List liquidation history + * Query liquidation history * * @param settle Settle currency (required) * @return APIlistLiquidatesRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistLiquidatesRequest listLiquidates(String settle) { return new APIlistLiquidatesRequest(settle); } - private okhttp3.Call listAutoDeleveragesCall(String settle, String contract, Integer limit, Integer at, final ApiCallback _callback) throws ApiException { + 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 @@ -5768,6 +6519,18 @@ private okhttp3.Call listAutoDeleveragesCall(String settle, String contract, Int 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)); } @@ -5794,25 +6557,25 @@ private okhttp3.Call listAutoDeleveragesCall(String settle, String contract, Int } @SuppressWarnings("rawtypes") - private okhttp3.Call listAutoDeleveragesValidateBeforeCall(String settle, String contract, Integer limit, Integer at, final ApiCallback _callback) throws ApiException { + 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, at, _callback); + okhttp3.Call localVarCall = listAutoDeleveragesCall(settle, contract, limit, offset, from, to, at, _callback); return localVarCall; } - private ApiResponse> listAutoDeleveragesWithHttpInfo(String settle, String contract, Integer limit, Integer at) throws ApiException { - okhttp3.Call localVarCall = listAutoDeleveragesValidateBeforeCall(settle, contract, limit, at, null); + 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 at, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listAutoDeleveragesValidateBeforeCall(settle, contract, limit, at, _callback); + 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; @@ -5822,6 +6585,9 @@ 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) { @@ -5840,7 +6606,7 @@ public APIlistAutoDeleveragesRequest 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 APIlistAutoDeleveragesRequest */ public APIlistAutoDeleveragesRequest limit(Integer limit) { @@ -5848,9 +6614,39 @@ public APIlistAutoDeleveragesRequest limit(Integer 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 an auto-deleveraging timestamp (optional, default to 0) + * @param at Specify auto-deleveraging timestamp (optional, default to 0) * @return APIlistAutoDeleveragesRequest */ public APIlistAutoDeleveragesRequest at(Integer at) { @@ -5866,11 +6662,11 @@ public APIlistAutoDeleveragesRequest 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 { - return listAutoDeleveragesCall(settle, contract, limit, at, _callback); + return listAutoDeleveragesCall(settle, contract, limit, offset, from, to, at, _callback); } /** @@ -5880,82 +6676,356 @@ 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 = 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 List execute() throws ApiException { - ApiResponse> localVarResp = listAutoDeleveragesWithHttpInfo(settle, contract, limit, at); + public Map execute() throws ApiException { + ApiResponse> localVarResp = getFuturesFeeWithHttpInfo(settle, contract); return localVarResp.getData(); } /** - * Execute listAutoDeleverages request with HTTP info returned - * @return ApiResponse<List<FuturesAutoDeleverage>> + * 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 List retrieved -
200 Query successful -
*/ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listAutoDeleveragesWithHttpInfo(settle, contract, limit, at); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getFuturesFeeWithHttpInfo(settle, contract); } /** - * Execute listAutoDeleverages request (asynchronously) + * 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 List retrieved -
200 Query successful -
*/ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listAutoDeleveragesAsync(settle, contract, limit, at, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getFuturesFeeAsync(settle, contract, _callback); } } /** - * List Auto-Deleveraging History + * Query futures market trading fee rates * * @param settle Settle currency (required) - * @return APIlistAutoDeleveragesRequest + * @return APIgetFuturesFeeRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 Query successful -
*/ - public APIlistAutoDeleveragesRequest listAutoDeleverages(String settle) { - return new APIlistAutoDeleveragesRequest(settle); + public APIgetFuturesFeeRequest getFuturesFee(String settle) { + return new APIgetFuturesFeeRequest(settle); } /** - * Build call for countdownCancelAllFutures + * Build call for cancelBatchFutureOrders * @param settle Settle currency (required) - * @param countdownCancelAllFuturesTask (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 Set countdown successfully -
200 Order cancellation operation completed -
*/ - public okhttp3.Call countdownCancelAllFuturesCall(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = countdownCancelAllFuturesTask; + 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}/countdown_cancel_all" + 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 = { @@ -5977,93 +7047,110 @@ public okhttp3.Call countdownCancelAllFuturesCall(String settle, CountdownCancel } @SuppressWarnings("rawtypes") - private okhttp3.Call countdownCancelAllFuturesValidateBeforeCall(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask, final ApiCallback _callback) throws ApiException { + 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 countdownCancelAllFutures(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling cancelBatchFutureOrders(Async)"); } - // verify the required parameter 'countdownCancelAllFuturesTask' is set - if (countdownCancelAllFuturesTask == null) { - throw new ApiException("Missing the required parameter 'countdownCancelAllFuturesTask' when calling countdownCancelAllFutures(Async)"); + // 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 = countdownCancelAllFuturesCall(settle, countdownCancelAllFuturesTask, _callback); + okhttp3.Call localVarCall = cancelBatchFutureOrdersCall(settle, requestBody, xGateExptime, _callback); return localVarCall; } /** - * Countdown cancel orders - * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + * 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 countdownCancelAllFuturesTask (required) - * @return TriggerTime + * @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 Set countdown successfully -
200 Order cancellation operation completed -
*/ - public TriggerTime countdownCancelAllFutures(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask) throws ApiException { - ApiResponse localVarResp = countdownCancelAllFuturesWithHttpInfo(settle, countdownCancelAllFuturesTask); + public List cancelBatchFutureOrders(String settle, List requestBody, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = cancelBatchFutureOrdersWithHttpInfo(settle, requestBody, xGateExptime); return localVarResp.getData(); } /** - * Countdown cancel orders - * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + * 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 countdownCancelAllFuturesTask (required) - * @return ApiResponse<TriggerTime> + * @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 Set countdown successfully -
200 Order cancellation operation completed -
*/ - public ApiResponse countdownCancelAllFuturesWithHttpInfo(String settle, CountdownCancelAllFuturesTask countdownCancelAllFuturesTask) throws ApiException { - okhttp3.Call localVarCall = countdownCancelAllFuturesValidateBeforeCall(settle, countdownCancelAllFuturesTask, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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); } /** - * Countdown cancel orders (asynchronously) - * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + * 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 countdownCancelAllFuturesTask (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 Set countdown successfully -
200 Order cancellation operation completed -
*/ - 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(); + 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; } - private okhttp3.Call getFuturesFeeCall(String settle, String contract, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; + /** + * 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}/fee" + 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)); + 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 = { @@ -6075,131 +7162,211 @@ private okhttp3.Call getFuturesFeeCall(String settle, String contract, 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 getFuturesFeeValidateBeforeCall(String settle, String contract, 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 getFuturesFee(Async)"); + throw new ApiException("Missing the required parameter 'settle' when calling amendBatchFutureOrders(Async)"); } - okhttp3.Call localVarCall = getFuturesFeeCall(settle, contract, _callback); + // 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 = 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> getFuturesFeeWithHttpInfo(String settle, String contract) throws ApiException { - okhttp3.Call localVarCall = getFuturesFeeValidateBeforeCall(settle, contract, 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 getFuturesFeeAsync(String settle, String contract, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = getFuturesFeeValidateBeforeCall(settle, contract, _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 APIgetFuturesFeeRequest { - private final String settle; - private String contract; + /** + * 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 APIgetFuturesFeeRequest(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 APIgetFuturesFeeRequest - */ - public APIgetFuturesFeeRequest 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)); } - /** - * 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 Successfully retrieved -
- */ - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getFuturesFeeCall(settle, contract, _callback); + 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); } - /** - * 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 Successfully retrieved -
- */ - public Map execute() throws ApiException { - ApiResponse> localVarResp = getFuturesFeeWithHttpInfo(settle, contract); - return localVarResp.getData(); - } + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); - /** - * 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 Successfully retrieved -
- */ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return getFuturesFeeWithHttpInfo(settle, contract); + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @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 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 Successfully retrieved -
- */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return getFuturesFeeAsync(settle, contract, _callback); + // verify the required parameter 'tableId' is set + if (tableId == null) { + throw new ApiException("Missing the required parameter 'tableId' when calling getFuturesRiskLimitTable(Async)"); } + + okhttp3.Call localVarCall = getFuturesRiskLimitTableCall(settle, tableId, _callback); + return localVarCall; } /** - * Query user trading fee rates - * + * Query risk limit table by table_id + * Just pass table_id * @param settle Settle currency (required) - * @return APIgetFuturesFeeRequest + * @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 Successfully retrieved -
200 Query successful -
*/ - public APIgetFuturesFeeRequest getFuturesFee(String settle) { - return new APIgetFuturesFeeRequest(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 { @@ -6302,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) { @@ -6328,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 { @@ -6342,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 { @@ -6357,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 { @@ -6372,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 { @@ -6381,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) { @@ -6406,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 { @@ -6456,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) @@ -6465,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 { @@ -6474,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) @@ -6483,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 { @@ -6493,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) @@ -6503,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 { @@ -6516,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 { @@ -6567,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 { @@ -6595,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 { @@ -6614,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 { @@ -6637,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 { @@ -6695,16 +7857,16 @@ private okhttp3.Call getPriceTriggeredOrderValidateBeforeCall(String settle, Str } /** - * Get a price-triggered 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 { @@ -6713,16 +7875,16 @@ public FuturesPriceTriggeredOrder getPriceTriggeredOrder(String settle, String o } /** - * Get a price-triggered 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 { @@ -6732,17 +7894,17 @@ public ApiResponse getPriceTriggeredOrderWithHttpInf } /** - * Get a price-triggered 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 { @@ -6755,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 { @@ -6813,16 +7975,16 @@ private okhttp3.Call cancelPriceTriggeredOrderValidateBeforeCall(String settle, } /** - * cancel a price-triggered 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 { @@ -6831,16 +7993,16 @@ public FuturesPriceTriggeredOrder cancelPriceTriggeredOrder(String settle, Strin } /** - * cancel a price-triggered 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 { @@ -6850,17 +8012,17 @@ public ApiResponse cancelPriceTriggeredOrderWithHttp } /** - * cancel a price-triggered 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 76b2a9e..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,27 +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.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.PortfolioBorrowable; -import io.gate.gateapi.models.RepayRequest; -import io.gate.gateapi.models.Repayment; -import io.gate.gateapi.models.UniLoanInterestRecord; import java.lang.reflect.Type; import java.util.ArrayList; @@ -145,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 { @@ -159,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 { @@ -174,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 { @@ -189,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 { @@ -204,7 +191,7 @@ 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() { @@ -302,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) { @@ -312,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) { @@ -322,7 +309,7 @@ public APIlistMarginAccountBookRequest currencyPair(String currencyPair) { /** * Set type - * @param type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) + * @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) { @@ -332,7 +319,7 @@ public APIlistMarginAccountBookRequest type(String type) { /** * Set from - * @param from Start timestamp of the query (optional) + * @param from Start timestamp for the query (optional) * @return APIlistMarginAccountBookRequest */ public APIlistMarginAccountBookRequest from(Long from) { @@ -342,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) { @@ -362,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) { @@ -378,7 +365,7 @@ 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 { @@ -392,7 +379,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 { @@ -407,7 +394,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 { @@ -422,7 +409,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 { @@ -431,13 +418,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _cal } /** - * 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() { @@ -505,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) { @@ -521,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 { @@ -535,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 { @@ -550,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 { @@ -565,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 { @@ -580,7 +567,7 @@ 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() { @@ -595,7 +582,7 @@ public APIlistFundingAccountsRequest listFundingAccounts() { * @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 { @@ -634,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 { @@ -650,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 { @@ -667,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 @@ -675,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 { @@ -687,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 { @@ -742,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 { @@ -759,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 { @@ -777,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 { @@ -884,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 { @@ -898,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 { @@ -913,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 { @@ -928,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 { @@ -937,14 +924,14 @@ 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) { @@ -952,24 +939,29 @@ public APIgetMarginTransferableRequest getMarginTransferable(String currency) { } /** - * Build call for listMarginCurrencyPairs + * 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 listMarginCurrencyPairsCall(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/currency_pairs"; + 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(); @@ -987,89 +979,100 @@ public okhttp3.Call listMarginCurrencyPairsCall(final ApiCallback _callback) thr 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 listMarginCurrencyPairsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listMarginCurrencyPairsCall(_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; } /** - * List all supported currency pairs supported in margin trading(Deprecated) + * Query user's own leverage lending tiers in current market * - * @return List<MarginCurrencyPair> + * @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 listMarginCurrencyPairs() throws ApiException { - ApiResponse> localVarResp = listMarginCurrencyPairsWithHttpInfo(); + public List getUserMarginTier(String currencyPair) throws ApiException { + ApiResponse> localVarResp = getUserMarginTierWithHttpInfo(currencyPair); return localVarResp.getData(); } /** - * List all supported currency pairs supported in margin trading(Deprecated) + * Query user's own leverage lending tiers in current market * - * @return ApiResponse<List<MarginCurrencyPair>> + * @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> listMarginCurrencyPairsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listMarginCurrencyPairsValidateBeforeCall(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); } /** - * List all supported currency pairs supported in margin trading(Deprecated) (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 listMarginCurrencyPairsAsync(final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listMarginCurrencyPairsValidateBeforeCall(_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 getMarginCurrencyPair - * @param currencyPair Margin currency pair (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 getMarginCurrencyPairCall(String currencyPair, 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/currency_pairs/{currency_pair}" - .replaceAll("\\{" + "currency_pair" + "\\}", localVarApiClient.escapeString(currencyPair)); + 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(); @@ -1092,100 +1095,96 @@ public okhttp3.Call getMarginCurrencyPairCall(String currencyPair, final ApiCall } @SuppressWarnings("rawtypes") - private okhttp3.Call getMarginCurrencyPairValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { + 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 getMarginCurrencyPair(Async)"); + throw new ApiException("Missing the required parameter 'currencyPair' when calling getMarketMarginTier(Async)"); } - okhttp3.Call localVarCall = getMarginCurrencyPairCall(currencyPair, _callback); + okhttp3.Call localVarCall = getMarketMarginTierCall(currencyPair, _callback); return localVarCall; } /** - * Query one single margin currency pair(Deprecated) + * Query current market leverage lending tiers * - * @param currencyPair Margin currency pair (required) - * @return MarginCurrencyPair + * @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 MarginCurrencyPair getMarginCurrencyPair(String currencyPair) throws ApiException { - ApiResponse localVarResp = getMarginCurrencyPairWithHttpInfo(currencyPair); + public List getMarketMarginTier(String currencyPair) throws ApiException { + ApiResponse> localVarResp = getMarketMarginTierWithHttpInfo(currencyPair); return localVarResp.getData(); } /** - * Query one single margin currency pair(Deprecated) + * Query current market leverage lending tiers * - * @param currencyPair Margin currency pair (required) - * @return ApiResponse<MarginCurrencyPair> + * @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 getMarginCurrencyPairWithHttpInfo(String currencyPair) throws ApiException { - okhttp3.Call localVarCall = getMarginCurrencyPairValidateBeforeCall(currencyPair, 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); } /** - * Query one single margin currency pair(Deprecated) (asynchronously) + * Query current market leverage lending tiers (asynchronously) * - * @param currencyPair Margin currency pair (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 getMarginCurrencyPairAsync(String currencyPair, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getMarginCurrencyPairValidateBeforeCall(currencyPair, _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 listFundingBook - * @param currency Retrieve data of the specified currency (required) + * 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 Order book retrieved -
204 Set successfully -
*/ - public okhttp3.Call listFundingBookCall(String currency, 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/funding_book"; + String localVarPath = "/margin/leverage/user_market_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) { @@ -1193,121 +1192,89 @@ public okhttp3.Call listFundingBookCall(String currency, final ApiCallback _call } final String[] localVarContentTypes = { - + "application/json" }; 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); + String[] localVarAuthNames = new String[] { "apiv4" }; + return localVarApiClient.buildCall(localVarPath, "POST", 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)"); + 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 = listFundingBookCall(currency, _callback); + okhttp3.Call localVarCall = setUserMarketLeverageCall(marginMarketLeverage, _callback); return localVarCall; } /** - * Order book of lending loans(Deprecated) + * Set user market leverage multiplier * - * @param currency Retrieve data of the specified currency (required) - * @return List<FundingBookItem> + * @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 Order book retrieved -
204 Set successfully -
*/ - public List listFundingBook(String currency) throws ApiException { - ApiResponse> localVarResp = listFundingBookWithHttpInfo(currency); - return localVarResp.getData(); + public void setUserMarketLeverage(MarginMarketLeverage marginMarketLeverage) throws ApiException { + setUserMarketLeverageWithHttpInfo(marginMarketLeverage); } /** - * Order book of lending loans(Deprecated) + * Set user market leverage multiplier * - * @param currency Retrieve data of the specified currency (required) - * @return ApiResponse<List<FundingBookItem>> + * @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 Order book retrieved -
204 Set successfully -
*/ - public ApiResponse> listFundingBookWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = listFundingBookValidateBeforeCall(currency, 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); } /** - * Order book of lending loans(Deprecated) (asynchronously) + * Set user market leverage multiplier (asynchronously) * - * @param currency Retrieve data of the specified currency (required) + * @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 Order book retrieved -
204 Set successfully -
*/ - 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); + 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 listLoansCall(String status, String side, String currency, String currencyPair, String sortBy, Boolean reverseSort, Integer page, Integer limit, 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/loans"; + String localVarPath = "/margin/user/account"; 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(); @@ -1330,206 +1297,143 @@ private okhttp3.Call listLoansCall(String status, String side, String currency, } @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); + private okhttp3.Call listMarginUserAccountValidateBeforeCall(String currencyPair, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = listMarginUserAccountCall(currencyPair, _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(); + 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 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(); + 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 APIlistLoansRequest { - private final String status; - private final String side; - private String currency; + public class APIlistMarginUserAccountRequest { 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; + private APIlistMarginUserAccountRequest() { } /** * Set currencyPair * @param currencyPair Currency pair (optional) - * @return APIlistLoansRequest + * @return APIlistMarginUserAccountRequest */ - public APIlistLoansRequest currencyPair(String currencyPair) { + public APIlistMarginUserAccountRequest 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 + * 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 listLoansCall(status, side, currency, currencyPair, sortBy, reverseSort, page, limit, _callback); + return listMarginUserAccountCall(currencyPair, _callback); } /** - * Execute listLoans request - * @return List<Loan> + * 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 = listLoansWithHttpInfo(status, side, currency, currencyPair, sortBy, reverseSort, page, limit); + public List execute() throws ApiException { + ApiResponse> localVarResp = listMarginUserAccountWithHttpInfo(currencyPair); return localVarResp.getData(); } /** - * Execute listLoans request with HTTP info returned - * @return ApiResponse<List<Loan>> + * 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 listLoansWithHttpInfo(status, side, currency, currencyPair, sortBy, reverseSort, page, limit); + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listMarginUserAccountWithHttpInfo(currencyPair); } /** - * Execute listLoans 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 listLoansAsync(status, side, currency, currencyPair, sortBy, reverseSort, page, limit, _callback); + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listMarginUserAccountAsync(currencyPair, _callback); } } /** - * List all loans(Deprecated) - * - * @param status Loan status (required) - * @param side Lend or borrow (required) - * @return APIlistLoansRequest + * 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 APIlistLoansRequest listLoans(String status, String side) { - return new APIlistLoansRequest(status, side); + public APIlistMarginUserAccountRequest listMarginUserAccount() { + return new APIlistMarginUserAccountRequest(); } - /** - * 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; + private okhttp3.Call listCrossMarginLoansCall(Integer status, String currency, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/margin/loans"; + String localVarPath = "/margin/cross/loans"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + } + + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (reverse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reverse", reverse)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -1542,2920 +1446,203 @@ public okhttp3.Call createLoanCall(Loan loan, 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @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)"); + 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 + if (status == null) { + throw new ApiException("Missing the required parameter 'status' when calling listCrossMarginLoans(Async)"); } - okhttp3.Call localVarCall = createLoanCall(loan, _callback); + okhttp3.Call localVarCall = listCrossMarginLoansCall(status, currency, limit, offset, reverse, _callback); return localVarCall; } - /** - * Lend or borrow(Deprecated) - * - * @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(Deprecated) - * - * @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(); + private ApiResponse> listCrossMarginLoansWithHttpInfo(Integer status, String currency, Integer limit, Integer offset, Boolean reverse) throws ApiException { + okhttp3.Call localVarCall = listCrossMarginLoansValidateBeforeCall(status, currency, limit, offset, reverse, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Lend or borrow(Deprecated) (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(); + private okhttp3.Call listCrossMarginLoansAsync(Integer status, String currency, Integer limit, Integer offset, Boolean reverse, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listCrossMarginLoansValidateBeforeCall(status, currency, limit, offset, reverse, _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"; + public class APIlistCrossMarginLoansRequest { + private final Integer status; + private String currency; + private Integer limit; + private Integer offset; + private Boolean reverse; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + private APIlistCrossMarginLoansRequest(Integer status) { + this.status = status; } - if (ids != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ids", ids)); + /** + * Set currency + * @param currency Query by specified currency, includes all currencies if not specified (optional) + * @return APIlistCrossMarginLoansRequest + */ + public APIlistCrossMarginLoansRequest currency(String currency) { + this.currency = currency; + 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 limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistCrossMarginLoansRequest + */ + public APIlistCrossMarginLoansRequest limit(Integer limit) { + this.limit = limit; + return this; } - 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)"); + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistCrossMarginLoansRequest + */ + public APIlistCrossMarginLoansRequest offset(Integer offset) { + this.offset = offset; + return this; } - // 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(Deprecated) - * - * @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(Deprecated) - * - * @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(Deprecated) (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(Deprecated) - * - * @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(Deprecated) - * - * @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(Deprecated) (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(Deprecated) - * 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(Deprecated) - * 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(Deprecated) (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(Deprecated) - * 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(Deprecated) - * 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(Deprecated) (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(Deprecated) - * - * @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(Deprecated) - * - * @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(Deprecated) (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(Deprecated) - * - * @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(Deprecated) - * - * @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(Deprecated) (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(Deprecated) - * - * @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(Deprecated) - * - * @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(Deprecated) - * - * @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(Deprecated) (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(Deprecated) - * 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(Deprecated) - * 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(Deprecated) (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; - } - - 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(Deprecated) - * - * @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 - * @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 listCrossMarginCurrenciesCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/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 listCrossMarginCurrenciesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginCurrenciesCall(_callback); - return localVarCall; - } - - /** - * Currencies supported by cross margin. - * - * @return List<CrossMarginCurrency> - * @throws ApiException If 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 listCrossMarginCurrencies() throws ApiException { - ApiResponse> localVarResp = listCrossMarginCurrenciesWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Currencies supported by cross margin. - * - * @return ApiResponse<List<CrossMarginCurrency>> - * @throws ApiException If 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> listCrossMarginCurrenciesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listCrossMarginCurrenciesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Currencies supported by cross 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 List retrieved -
- */ - public okhttp3.Call listCrossMarginCurrenciesAsync(final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginCurrenciesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getCrossMarginCurrency - * @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 Successfully retrieved -
- */ - public okhttp3.Call getCrossMarginCurrencyCall(String currency, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/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 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)"); - } - - okhttp3.Call localVarCall = getCrossMarginCurrencyCall(currency, _callback); - return localVarCall; - } - - /** - * Retrieve detail of one single currency supported by cross margin - * - * @param currency Currency name (required) - * @return CrossMarginCurrency - * @throws ApiException If 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 CrossMarginCurrency getCrossMarginCurrency(String currency) throws ApiException { - ApiResponse localVarResp = getCrossMarginCurrencyWithHttpInfo(currency); - return localVarResp.getData(); - } - - /** - * Retrieve detail of one single currency supported by cross margin - * - * @param currency Currency name (required) - * @return ApiResponse<CrossMarginCurrency> - * @throws ApiException If 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 getCrossMarginCurrencyWithHttpInfo(String currency) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginCurrencyValidateBeforeCall(currency, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Retrieve detail of one single currency supported by cross margin (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 Successfully retrieved -
- */ - public okhttp3.Call getCrossMarginCurrencyAsync(String currency, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginCurrencyValidateBeforeCall(currency, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getCrossMarginAccount - * @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 getCrossMarginAccountCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/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 getCrossMarginAccountValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginAccountCall(_callback); - return localVarCall; - } - - /** - * Retrieve cross margin account - * - * @return CrossMarginAccount - * @throws ApiException If 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 CrossMarginAccount getCrossMarginAccount() throws ApiException { - ApiResponse localVarResp = getCrossMarginAccountWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Retrieve cross margin account - * - * @return ApiResponse<CrossMarginAccount> - * @throws ApiException If 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 getCrossMarginAccountWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getCrossMarginAccountValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Retrieve cross margin account (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 getCrossMarginAccountAsync(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginAccountValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - private okhttp3.Call listCrossMarginAccountBookCall(String currency, Long from, Long to, Integer page, Integer limit, String type, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/account_book"; - - 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)); - } - - 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 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); - 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(); - 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(); - 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 Start timestamp of the query (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; - } - - /** - * 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; - } - - /** - * Set type - * @param type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) - * @return APIlistCrossMarginAccountBookRequest - */ - public APIlistCrossMarginAccountBookRequest type(String type) { - this.type = type; - return this; - } - - /** - * Build call for listCrossMarginAccountBook - * @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 listCrossMarginAccountBookCall(currency, from, to, page, limit, type, _callback); - } - - /** - * Execute listCrossMarginAccountBook request - * @return List<CrossMarginAccountBook> - * @throws ApiException If 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 = listCrossMarginAccountBookWithHttpInfo(currency, from, to, page, limit, type); - return localVarResp.getData(); - } - - /** - * Execute listCrossMarginAccountBook request with HTTP info returned - * @return ApiResponse<List<CrossMarginAccountBook>> - * @throws ApiException If 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 listCrossMarginAccountBookWithHttpInfo(currency, from, to, page, limit, type); - } - - /** - * Execute listCrossMarginAccountBook 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 listCrossMarginAccountBookAsync(currency, from, to, page, limit, type, _callback); - } - } - - /** - * Retrieve cross margin account change history - * Record time range cannot exceed 30 days - * @return APIlistCrossMarginAccountBookRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - public APIlistCrossMarginAccountBookRequest listCrossMarginAccountBook() { - return new APIlistCrossMarginAccountBookRequest(); - } - - private okhttp3.Call listCrossMarginLoansCall(Integer status, String currency, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/loans"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (status != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); - } - - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (reverse != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reverse", reverse)); - } - - 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 listCrossMarginLoansValidateBeforeCall(Integer status, String currency, Integer limit, Integer offset, Boolean reverse, 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 listCrossMarginLoans(Async)"); - } - - okhttp3.Call localVarCall = listCrossMarginLoansCall(status, currency, limit, offset, reverse, _callback); - return localVarCall; - } - - - private ApiResponse> listCrossMarginLoansWithHttpInfo(Integer status, String currency, Integer limit, Integer offset, Boolean reverse) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginLoansValidateBeforeCall(status, currency, limit, offset, reverse, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - private okhttp3.Call listCrossMarginLoansAsync(Integer status, String currency, Integer limit, Integer offset, Boolean reverse, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginLoansValidateBeforeCall(status, currency, limit, offset, reverse, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - public class APIlistCrossMarginLoansRequest { - private final Integer status; - private String currency; - private Integer limit; - private Integer offset; - private Boolean reverse; - - private APIlistCrossMarginLoansRequest(Integer status) { - this.status = status; - } - - /** - * Set currency - * @param currency Filter by currency (optional) - * @return APIlistCrossMarginLoansRequest - */ - public APIlistCrossMarginLoansRequest currency(String currency) { - this.currency = currency; - return this; - } - - /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistCrossMarginLoansRequest - */ - public APIlistCrossMarginLoansRequest limit(Integer limit) { - this.limit = limit; - return this; - } - - /** - * Set offset - * @param offset List offset, starting from 0 (optional, default to 0) - * @return APIlistCrossMarginLoansRequest - */ - public APIlistCrossMarginLoansRequest offset(Integer offset) { - this.offset = offset; - return this; - } - - /** - * Set reverse - * @param reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) - * @return APIlistCrossMarginLoansRequest - */ - public APIlistCrossMarginLoansRequest reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - /** - * Build call for listCrossMarginLoans - * @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 listCrossMarginLoansCall(status, currency, limit, offset, reverse, _callback); - } - - /** - * Execute listCrossMarginLoans request - * @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 Successfully retrieved -
- */ - public List execute() throws ApiException { - ApiResponse> localVarResp = listCrossMarginLoansWithHttpInfo(status, currency, limit, offset, reverse); - return localVarResp.getData(); - } - - /** - * Execute listCrossMarginLoans request with HTTP info returned - * @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 Successfully retrieved -
- */ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return listCrossMarginLoansWithHttpInfo(status, currency, limit, offset, reverse); - } - - /** - * Execute listCrossMarginLoans 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 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. (deprecated.) (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 - * @http.response.details - - - -
Status Code Description Response Headers
200 Successfully retrieved -
- */ - 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; - } - - private okhttp3.Call listCrossMarginRepaymentsCall(String currency, String loanId, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/repayments"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); - } - - if (loanId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("loan_id", loanId)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (reverse != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("reverse", reverse)); - } - - 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 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); - return localVarCall; - } - - - private ApiResponse> listCrossMarginRepaymentsWithHttpInfo(String currency, String loanId, Integer limit, Integer offset, Boolean reverse) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginRepaymentsValidateBeforeCall(currency, loanId, limit, offset, reverse, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - private okhttp3.Call listCrossMarginRepaymentsAsync(String currency, String loanId, Integer limit, Integer offset, Boolean reverse, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listCrossMarginRepaymentsValidateBeforeCall(currency, loanId, limit, offset, reverse, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - public class APIlistCrossMarginRepaymentsRequest { - private String currency; - private String loanId; - private Integer limit; - private Integer offset; - private Boolean reverse; - - private APIlistCrossMarginRepaymentsRequest() { - } - - /** - * Set currency - * @param currency (optional) - * @return APIlistCrossMarginRepaymentsRequest - */ - public APIlistCrossMarginRepaymentsRequest currency(String currency) { - this.currency = currency; - return this; - } - - /** - * Set loanId - * @param loanId (optional) - * @return APIlistCrossMarginRepaymentsRequest - */ - public APIlistCrossMarginRepaymentsRequest loanId(String loanId) { - this.loanId = loanId; - return this; - } - - /** - * Set limit - * @param limit Maximum number of records to be returned in a single list (optional, default to 100) - * @return APIlistCrossMarginRepaymentsRequest - */ - public APIlistCrossMarginRepaymentsRequest limit(Integer limit) { - this.limit = limit; - return this; - } - - /** - * Set offset - * @param offset List offset, starting from 0 (optional, default to 0) - * @return APIlistCrossMarginRepaymentsRequest - */ - public APIlistCrossMarginRepaymentsRequest offset(Integer offset) { - this.offset = offset; - return this; - } - - /** - * Set reverse - * @param reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) - * @return APIlistCrossMarginRepaymentsRequest - */ - public APIlistCrossMarginRepaymentsRequest reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - /** - * Build call for listCrossMarginRepayments - * @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 listCrossMarginRepaymentsCall(currency, loanId, limit, offset, reverse, _callback); - } - - /** - * Execute listCrossMarginRepayments request - * @return List<CrossMarginRepayment> - * @throws ApiException If 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 = listCrossMarginRepaymentsWithHttpInfo(currency, loanId, limit, offset, reverse); - return localVarResp.getData(); - } - - /** - * Execute listCrossMarginRepayments request with HTTP info returned - * @return ApiResponse<List<CrossMarginRepayment>> - * @throws ApiException If 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 listCrossMarginRepaymentsWithHttpInfo(currency, loanId, limit, offset, reverse); - } - - /** - * Execute listCrossMarginRepayments 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 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. - * @return APIlistCrossMarginRepaymentsRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 List retrieved -
- */ - 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; - } - - /** - * Cross margin repayments - * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first - * @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(); - } - - /** - * Cross margin repayments - * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first - * @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); - } - - /** - * Cross margin repayments (asynchronously) - * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first - * @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; - } - - private okhttp3.Call getCrossMarginInterestRecordsCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/margin/cross/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)); - } - - 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 getCrossMarginInterestRecordsValidateBeforeCall(String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginInterestRecordsCall(currency, page, limit, _callback); - return localVarCall; - } - - - private ApiResponse> getCrossMarginInterestRecordsWithHttpInfo(String currency, Integer page, Integer limit) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginInterestRecordsValidateBeforeCall(currency, page, limit, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - private okhttp3.Call getCrossMarginInterestRecordsAsync(String currency, Integer page, Integer limit, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginInterestRecordsValidateBeforeCall(currency, page, limit, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - public class APIgetCrossMarginInterestRecordsRequest { - private String currency; - private Integer page; - private Integer limit; - - private APIgetCrossMarginInterestRecordsRequest() { - } - - /** - * Set currency - * @param currency Retrieve data of the specified currency (optional) - * @return APIgetCrossMarginInterestRecordsRequest - */ - public APIgetCrossMarginInterestRecordsRequest currency(String currency) { - this.currency = currency; - return this; - } - - /** - * Set page - * @param page Page number (optional, default to 1) - * @return APIgetCrossMarginInterestRecordsRequest - */ - public APIgetCrossMarginInterestRecordsRequest page(Integer page) { - this.page = page; - return this; - } - - /** - * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) - * @return APIgetCrossMarginInterestRecordsRequest - */ - public APIgetCrossMarginInterestRecordsRequest limit(Integer limit) { - this.limit = limit; - return this; + /** + * Set reverse + * @param reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) + * @return APIlistCrossMarginLoansRequest + */ + public APIlistCrossMarginLoansRequest reverse(Boolean reverse) { + this.reverse = reverse; + return this; } /** - * Build call for getCrossMarginInterestRecords + * Build call for listCrossMarginLoans * @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 -
+ * @deprecated */ + @Deprecated public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getCrossMarginInterestRecordsCall(currency, page, limit, _callback); + return listCrossMarginLoansCall(status, currency, limit, offset, reverse, _callback); } /** - * Execute getCrossMarginInterestRecords request - * @return List<UniLoanInterestRecord> + * Execute listCrossMarginLoans request + * @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 Successfully retrieved -
200 Query successful -
+ * @deprecated */ - public List execute() throws ApiException { - ApiResponse> localVarResp = getCrossMarginInterestRecordsWithHttpInfo(currency, page, limit); + @Deprecated + public List execute() throws ApiException { + ApiResponse> localVarResp = listCrossMarginLoansWithHttpInfo(status, currency, limit, offset, reverse); return localVarResp.getData(); } /** - * Execute getCrossMarginInterestRecords request with HTTP info returned - * @return ApiResponse<List<UniLoanInterestRecord>> + * Execute listCrossMarginLoans request with HTTP info returned + * @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 Successfully retrieved -
- */ - public ApiResponse> executeWithHttpInfo() throws ApiException { - return getCrossMarginInterestRecordsWithHttpInfo(currency, page, limit); - } - - /** - * Execute getCrossMarginInterestRecords 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 -
+ * @deprecated */ - public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return getCrossMarginInterestRecordsAsync(currency, page, limit, _callback); - } - } - - /** - * Interest records for the cross margin account - * - * @return APIgetCrossMarginInterestRecordsRequest - * @http.response.details - - - -
Status Code Description Response Headers
200 Successfully retrieved -
- */ - public APIgetCrossMarginInterestRecordsRequest getCrossMarginInterestRecords() { - return new APIgetCrossMarginInterestRecordsRequest(); - } - - /** - * 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); + @Deprecated + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listCrossMarginLoansWithHttpInfo(status, currency, limit, offset, reverse); + } + + /** + * Execute listCrossMarginLoans 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 -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listCrossMarginLoansAsync(status, currency, limit, offset, reverse, _callback); + } } /** - * 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 + * 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 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; + @Deprecated + public APIlistCrossMarginLoansRequest listCrossMarginLoans(Integer status) { + return new APIlistCrossMarginLoansRequest(status); } - /** - * Build call for getCrossMarginEstimateRate - * @param currencies An array of up to 10 specifying the 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 Successfully retrieved -
- */ - public okhttp3.Call getCrossMarginEstimateRateCall(List currencies, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listCrossMarginRepaymentsCall(String currency, String loanId, Integer limit, Integer offset, Boolean reverse, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/margin/cross/estimate_rate"; + String localVarPath = "/margin/cross/repayments"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (currencies != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "currencies", currencies)); + if (currency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + } + + if (loanId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("loan_id", loanId)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (reverse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reverse", reverse)); } Map localVarHeaderParams = new HashMap(); @@ -4479,181 +1666,169 @@ public okhttp3.Call getCrossMarginEstimateRateCall(List currencies, fina return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call getCrossMarginEstimateRateValidateBeforeCall(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 getCrossMarginEstimateRate(Async)"); - } - - okhttp3.Call localVarCall = getCrossMarginEstimateRateCall(currencies, _callback); + 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); return localVarCall; } - /** - * Estimated interest rates - * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. - * @param currencies An array of up to 10 specifying the currency name (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 Successfully retrieved -
- */ - public Map getCrossMarginEstimateRate(List currencies) throws ApiException { - ApiResponse> localVarResp = getCrossMarginEstimateRateWithHttpInfo(currencies); - return localVarResp.getData(); - } - /** - * Estimated interest rates - * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. - * @param currencies An array of up to 10 specifying the currency name (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 Successfully retrieved -
- */ - public ApiResponse> getCrossMarginEstimateRateWithHttpInfo(List currencies) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginEstimateRateValidateBeforeCall(currencies, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + private ApiResponse> listCrossMarginRepaymentsWithHttpInfo(String currency, String loanId, Integer limit, Integer offset, Boolean reverse) throws ApiException { + okhttp3.Call localVarCall = listCrossMarginRepaymentsValidateBeforeCall(currency, loanId, limit, offset, reverse, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Estimated interest rates (asynchronously) - * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. - * @param currencies An array of up to 10 specifying the 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 Successfully retrieved -
- */ - public okhttp3.Call getCrossMarginEstimateRateAsync(List currencies, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = getCrossMarginEstimateRateValidateBeforeCall(currencies, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + private okhttp3.Call listCrossMarginRepaymentsAsync(String currency, String loanId, Integer limit, Integer offset, Boolean reverse, final ApiCallback> _callback) throws ApiException { + okhttp3.Call localVarCall = listCrossMarginRepaymentsValidateBeforeCall(currency, loanId, limit, offset, reverse, _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; + public class APIlistCrossMarginRepaymentsRequest { + private String currency; + private String loanId; + private Integer limit; + private Integer offset; + private Boolean reverse; - // create path and map variables - String localVarPath = "/margin/cross/borrowable"; + private APIlistCrossMarginRepaymentsRequest() { + } - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (currency != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("currency", currency)); + /** + * Set currency + * @param currency (optional) + * @return APIlistCrossMarginRepaymentsRequest + */ + public APIlistCrossMarginRepaymentsRequest currency(String currency) { + this.currency = currency; + 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 loanId + * @param loanId (optional) + * @return APIlistCrossMarginRepaymentsRequest + */ + public APIlistCrossMarginRepaymentsRequest loanId(String loanId) { + this.loanId = loanId; + return this; } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + /** + * Set limit + * @param limit Maximum number of records returned in a single list (optional, default to 100) + * @return APIlistCrossMarginRepaymentsRequest + */ + public APIlistCrossMarginRepaymentsRequest limit(Integer limit) { + this.limit = limit; + return this; + } - String[] localVarAuthNames = new String[] { "apiv4" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } + /** + * Set offset + * @param offset List offset, starting from 0 (optional, default to 0) + * @return APIlistCrossMarginRepaymentsRequest + */ + public APIlistCrossMarginRepaymentsRequest offset(Integer offset) { + this.offset = offset; + return this; + } - @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)"); + /** + * Set reverse + * @param reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) + * @return APIlistCrossMarginRepaymentsRequest + */ + public APIlistCrossMarginRepaymentsRequest reverse(Boolean reverse) { + this.reverse = reverse; + return this; } - okhttp3.Call localVarCall = getCrossMarginBorrowableCall(currency, _callback); - return localVarCall; - } + /** + * Build call for listCrossMarginRepayments + * @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 -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listCrossMarginRepaymentsCall(currency, loanId, limit, offset, reverse, _callback); + } - /** - * Get the max borrowable amount for a specific cross margin currency - * - * @param currency Retrieve data of the specified currency (required) - * @return PortfolioBorrowable - * @throws ApiException If 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 PortfolioBorrowable getCrossMarginBorrowable(String currency) throws ApiException { - ApiResponse localVarResp = getCrossMarginBorrowableWithHttpInfo(currency); - return localVarResp.getData(); - } + /** + * Execute listCrossMarginRepayments request + * @return List<CrossMarginRepayment> + * @throws ApiException If 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 -
+ * @deprecated + */ + @Deprecated + public List execute() throws ApiException { + ApiResponse> localVarResp = listCrossMarginRepaymentsWithHttpInfo(currency, loanId, limit, offset, reverse); + 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<PortfolioBorrowable> - * @throws ApiException If 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); + /** + * Execute listCrossMarginRepayments request with HTTP info returned + * @return ApiResponse<List<CrossMarginRepayment>> + * @throws ApiException If 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 -
+ * @deprecated + */ + @Deprecated + public ApiResponse> executeWithHttpInfo() throws ApiException { + return listCrossMarginRepaymentsWithHttpInfo(currency, loanId, limit, offset, reverse); + } + + /** + * Execute listCrossMarginRepayments 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 -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return listCrossMarginRepaymentsAsync(currency, loanId, limit, offset, reverse, _callback); + } } /** - * 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 + * 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 Successfully retrieved -
200 List retrieved successfully -
+ * @deprecated */ - 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; + @Deprecated + public APIlistCrossMarginRepaymentsRequest listCrossMarginRepayments() { + return new APIlistCrossMarginRepaymentsRequest(); } } diff --git a/src/main/java/io/gate/gateapi/api/MarginUniApi.java b/src/main/java/io/gate/gateapi/api/MarginUniApi.java index 7bdac44..67b72ae 100644 --- a/src/main/java/io/gate/gateapi/api/MarginUniApi.java +++ b/src/main/java/io/gate/gateapi/api/MarginUniApi.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 @@ -60,7 +60,7 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listUniCurrencyPairsCall(final ApiCallback _callback) throws ApiException { @@ -106,7 +106,7 @@ private okhttp3.Call listUniCurrencyPairsValidateBeforeCall(final ApiCallback _c * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public List listUniCurrencyPairs() throws ApiException { @@ -122,7 +122,7 @@ public List listUniCurrencyPairs() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> listUniCurrencyPairsWithHttpInfo() throws ApiException { @@ -140,7 +140,7 @@ public ApiResponse> listUniCurrencyPairsWithHttpInfo() thr * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listUniCurrencyPairsAsync(final ApiCallback> _callback) throws ApiException { @@ -159,7 +159,7 @@ public okhttp3.Call listUniCurrencyPairsAsync(final ApiCallback Status Code Description Response Headers - 200 Successfully retrieved - + 200 Query successful - */ public okhttp3.Call getUniCurrencyPairCall(String currencyPair, final ApiCallback _callback) throws ApiException { @@ -204,7 +204,7 @@ private okhttp3.Call getUniCurrencyPairValidateBeforeCall(String currencyPair, f } /** - * Get detail of lending market + * Get lending market details * * @param currencyPair Currency pair (required) * @return UniCurrencyPair @@ -212,7 +212,7 @@ private okhttp3.Call getUniCurrencyPairValidateBeforeCall(String currencyPair, f * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public UniCurrencyPair getUniCurrencyPair(String currencyPair) throws ApiException { @@ -221,7 +221,7 @@ public UniCurrencyPair getUniCurrencyPair(String currencyPair) throws ApiExcepti } /** - * Get detail of lending market + * Get lending market details * * @param currencyPair Currency pair (required) * @return ApiResponse<UniCurrencyPair> @@ -229,7 +229,7 @@ public UniCurrencyPair getUniCurrencyPair(String currencyPair) throws ApiExcepti * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getUniCurrencyPairWithHttpInfo(String currencyPair) throws ApiException { @@ -239,7 +239,7 @@ public ApiResponse getUniCurrencyPairWithHttpInfo(String curren } /** - * Get detail of lending market (asynchronously) + * Get lending market details (asynchronously) * * @param currencyPair Currency pair (required) * @param _callback The callback to be executed when the API call finishes @@ -248,7 +248,7 @@ public ApiResponse getUniCurrencyPairWithHttpInfo(String curren * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUniCurrencyPairAsync(String currencyPair, final ApiCallback _callback) throws ApiException { @@ -260,14 +260,14 @@ public okhttp3.Call getUniCurrencyPairAsync(String currencyPair, final ApiCallba /** * Build call for getMarginUniEstimateRate - * @param currencies An array of up to 10 specifying the currency name (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getMarginUniEstimateRateCall(List currencies, final ApiCallback _callback) throws ApiException { @@ -315,15 +315,15 @@ private okhttp3.Call getMarginUniEstimateRateValidateBeforeCall(List cur } /** - * Estimate interest Rate - * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. - * @param currencies An array of up to 10 specifying the currency name (required) + * 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 Successfully retrieved -
200 Query successful -
*/ public Map getMarginUniEstimateRate(List currencies) throws ApiException { @@ -332,15 +332,15 @@ public Map getMarginUniEstimateRate(List currencies) thr } /** - * Estimate interest Rate - * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. - * @param currencies An array of up to 10 specifying the currency name (required) + * 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 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> getMarginUniEstimateRateWithHttpInfo(List currencies) throws ApiException { @@ -350,16 +350,16 @@ public ApiResponse> getMarginUniEstimateRateWithHttpInfo(Lis } /** - * Estimate interest Rate (asynchronously) - * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate. - * @param currencies An array of up to 10 specifying the currency name (required) + * 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 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getMarginUniEstimateRateAsync(List currencies, final ApiCallback> _callback) throws ApiException { @@ -455,7 +455,7 @@ public APIlistUniLoansRequest currencyPair(String currencyPair) { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistUniLoansRequest */ public APIlistUniLoansRequest currency(String currency) { @@ -475,7 +475,7 @@ public APIlistUniLoansRequest page(Integer page) { /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) * @return APIlistUniLoansRequest */ public APIlistUniLoansRequest limit(Integer limit) { @@ -491,7 +491,7 @@ public APIlistUniLoansRequest 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 { @@ -505,7 +505,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 { @@ -520,7 +520,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 { @@ -535,7 +535,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 { @@ -544,13 +544,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) thr } /** - * List loans + * Query loans * * @return APIlistUniLoansRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistUniLoansRequest listUniLoans() { @@ -566,7 +566,7 @@ public APIlistUniLoansRequest listUniLoans() { * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public okhttp3.Call createUniLoanCall(CreateUniLoan createUniLoan, final ApiCallback _callback) throws ApiException { @@ -617,7 +617,7 @@ private okhttp3.Call createUniLoanValidateBeforeCall(CreateUniLoan createUniLoan * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public void createUniLoan(CreateUniLoan createUniLoan) throws ApiException { @@ -633,7 +633,7 @@ public void createUniLoan(CreateUniLoan createUniLoan) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public ApiResponse createUniLoanWithHttpInfo(CreateUniLoan createUniLoan) throws ApiException { @@ -651,7 +651,7 @@ public ApiResponse createUniLoanWithHttpInfo(CreateUniLoan createUniLoan) * @http.response.details - +
Status Code Description Response Headers
204 Operated successfully -
204 Operation successful -
*/ public okhttp3.Call createUniLoanAsync(CreateUniLoan createUniLoan, final ApiCallback _callback) throws ApiException { @@ -741,7 +741,7 @@ private APIlistUniLoanRecordsRequest() { /** * Set type - * @param type type: borrow - borrow, repay - repay (optional) + * @param type Type: `borrow` - borrow, `repay` - repay (optional) * @return APIlistUniLoanRecordsRequest */ public APIlistUniLoanRecordsRequest type(String type) { @@ -751,7 +751,7 @@ public APIlistUniLoanRecordsRequest type(String type) { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistUniLoanRecordsRequest */ public APIlistUniLoanRecordsRequest currency(String currency) { @@ -781,7 +781,7 @@ public APIlistUniLoanRecordsRequest page(Integer page) { /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) + * @param limit Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional, default to 100) * @return APIlistUniLoanRecordsRequest */ public APIlistUniLoanRecordsRequest limit(Integer limit) { @@ -797,7 +797,7 @@ public APIlistUniLoanRecordsRequest 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 { @@ -811,7 +811,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 { @@ -826,7 +826,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 { @@ -841,7 +841,7 @@ 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 { @@ -850,20 +850,20 @@ public okhttp3.Call executeAsync(final ApiCallback> _callbac } /** - * Get load records + * Query loan records * * @return APIlistUniLoanRecordsRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistUniLoanRecordsRequest listUniLoanRecords() { return new APIlistUniLoanRecordsRequest(); } - private okhttp3.Call listUniLoanInterestRecordsCall(String currencyPair, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { + 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 @@ -887,6 +887,14 @@ private okhttp3.Call listUniLoanInterestRecordsCall(String currencyPair, String 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(); @@ -909,20 +917,20 @@ private okhttp3.Call listUniLoanInterestRecordsCall(String currencyPair, String } @SuppressWarnings("rawtypes") - private okhttp3.Call listUniLoanInterestRecordsValidateBeforeCall(String currencyPair, String currency, Integer page, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listUniLoanInterestRecordsCall(currencyPair, currency, page, limit, _callback); + 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) throws ApiException { - okhttp3.Call localVarCall = listUniLoanInterestRecordsValidateBeforeCall(currencyPair, currency, page, limit, null); + 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, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listUniLoanInterestRecordsValidateBeforeCall(currencyPair, currency, page, limit, _callback); + 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; @@ -933,6 +941,8 @@ public class APIlistUniLoanInterestRecordsRequest { private String currency; private Integer page; private Integer limit; + private Long from; + private Long to; private APIlistUniLoanInterestRecordsRequest() { } @@ -949,7 +959,7 @@ public APIlistUniLoanInterestRecordsRequest currencyPair(String currencyPair) { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistUniLoanInterestRecordsRequest */ public APIlistUniLoanInterestRecordsRequest currency(String currency) { @@ -969,7 +979,7 @@ public APIlistUniLoanInterestRecordsRequest page(Integer page) { /** * Set limit - * @param limit Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional, default to 100) + * @param limit Maximum number of records returned in a single list (optional, default to 100) * @return APIlistUniLoanInterestRecordsRequest */ public APIlistUniLoanInterestRecordsRequest limit(Integer limit) { @@ -977,6 +987,26 @@ public APIlistUniLoanInterestRecordsRequest 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 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 @@ -985,11 +1015,11 @@ public APIlistUniLoanInterestRecordsRequest 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 { - return listUniLoanInterestRecordsCall(currencyPair, currency, page, limit, _callback); + return listUniLoanInterestRecordsCall(currencyPair, currency, page, limit, from, to, _callback); } /** @@ -999,11 +1029,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 = listUniLoanInterestRecordsWithHttpInfo(currencyPair, currency, page, limit); + ApiResponse> localVarResp = listUniLoanInterestRecordsWithHttpInfo(currencyPair, currency, page, limit, from, to); return localVarResp.getData(); } @@ -1014,11 +1044,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 listUniLoanInterestRecordsWithHttpInfo(currencyPair, currency, page, limit); + return listUniLoanInterestRecordsWithHttpInfo(currencyPair, currency, page, limit, from, to); } /** @@ -1029,22 +1059,22 @@ public ApiResponse> executeWithHttpInfo() throws Api * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { - return listUniLoanInterestRecordsAsync(currencyPair, currency, page, limit, _callback); + return listUniLoanInterestRecordsAsync(currencyPair, currency, page, limit, from, to, _callback); } } /** - * List interest records + * Query interest deduction records * * @return APIlistUniLoanInterestRecordsRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistUniLoanInterestRecordsRequest listUniLoanInterestRecords() { @@ -1053,7 +1083,7 @@ public APIlistUniLoanInterestRecordsRequest listUniLoanInterestRecords() { /** * Build call for getUniBorrowable - * @param currency Retrieve data of the specified currency (required) + * @param currency Query by specified currency name (required) * @param currencyPair Currency pair (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1061,7 +1091,7 @@ public APIlistUniLoanInterestRecordsRequest listUniLoanInterestRecords() { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUniBorrowableCall(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { @@ -1118,16 +1148,16 @@ private okhttp3.Call getUniBorrowableValidateBeforeCall(String currency, String } /** - * Get maximum borrowable + * Query maximum borrowable amount by currency * - * @param currency Retrieve data of the specified currency (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public MaxUniBorrowable getUniBorrowable(String currency, String currencyPair) throws ApiException { @@ -1136,16 +1166,16 @@ public MaxUniBorrowable getUniBorrowable(String currency, String currencyPair) t } /** - * Get maximum borrowable + * Query maximum borrowable amount by currency * - * @param currency Retrieve data of the specified currency (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getUniBorrowableWithHttpInfo(String currency, String currencyPair) throws ApiException { @@ -1155,9 +1185,9 @@ public ApiResponse getUniBorrowableWithHttpInfo(String currenc } /** - * Get maximum borrowable (asynchronously) + * Query maximum borrowable amount by currency (asynchronously) * - * @param currency Retrieve data of the specified currency (required) + * @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 @@ -1165,7 +1195,7 @@ public ApiResponse getUniBorrowableWithHttpInfo(String currenc * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getUniBorrowableAsync(String currency, String currencyPair, final ApiCallback _callback) throws ApiException { 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 index 9d56deb..538f7f5 100644 --- a/src/main/java/io/gate/gateapi/api/OptionsApi.java +++ b/src/main/java/io/gate/gateapi/api/OptionsApi.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,6 +20,7 @@ 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; @@ -27,6 +28,8 @@ 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; @@ -36,6 +39,7 @@ 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; @@ -70,7 +74,7 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listOptionsUnderlyingsCall(final ApiCallback _callback) throws ApiException { @@ -109,14 +113,14 @@ private okhttp3.Call listOptionsUnderlyingsValidateBeforeCall(final ApiCallback } /** - * List all underlyings + * 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 -
200 List retrieved successfully -
*/ public List listOptionsUnderlyings() throws ApiException { @@ -125,14 +129,14 @@ public List listOptionsUnderlyings() throws ApiException { } /** - * List all underlyings + * 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 -
200 List retrieved successfully -
*/ public ApiResponse> listOptionsUnderlyingsWithHttpInfo() throws ApiException { @@ -142,7 +146,7 @@ public ApiResponse> listOptionsUnderlyingsWithHttpInfo() } /** - * List all underlyings (asynchronously) + * List all underlying assets (asynchronously) * * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -150,7 +154,7 @@ public ApiResponse> listOptionsUnderlyingsWithHttpInfo() * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call listOptionsUnderlyingsAsync(final ApiCallback> _callback) throws ApiException { @@ -169,7 +173,7 @@ public okhttp3.Call listOptionsUnderlyingsAsync(final ApiCallback Status Code Description Response Headers - 200 List expiration times of specified underlying - + 200 List expiration dates for specified underlying - */ public okhttp3.Call listOptionsExpirationsCall(String underlying, final ApiCallback _callback) throws ApiException { @@ -217,7 +221,7 @@ private okhttp3.Call listOptionsExpirationsValidateBeforeCall(String underlying, } /** - * List all expiration times + * List all expiration dates * * @param underlying Underlying (Obtained by listing underlying endpoint) (required) * @return List<Long> @@ -225,7 +229,7 @@ private okhttp3.Call listOptionsExpirationsValidateBeforeCall(String underlying, * @http.response.details - +
Status Code Description Response Headers
200 List expiration times of specified underlying -
200 List expiration dates for specified underlying -
*/ public List listOptionsExpirations(String underlying) throws ApiException { @@ -234,7 +238,7 @@ public List listOptionsExpirations(String underlying) throws ApiException } /** - * List all expiration times + * List all expiration dates * * @param underlying Underlying (Obtained by listing underlying endpoint) (required) * @return ApiResponse<List<Long>> @@ -242,7 +246,7 @@ public List listOptionsExpirations(String underlying) throws ApiException * @http.response.details - +
Status Code Description Response Headers
200 List expiration times of specified underlying -
200 List expiration dates for specified underlying -
*/ public ApiResponse> listOptionsExpirationsWithHttpInfo(String underlying) throws ApiException { @@ -252,7 +256,7 @@ public ApiResponse> listOptionsExpirationsWithHttpInfo(String underly } /** - * List all expiration times (asynchronously) + * 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 @@ -261,7 +265,7 @@ public ApiResponse> listOptionsExpirationsWithHttpInfo(String underly * @http.response.details - +
Status Code Description Response Headers
200 List expiration times of specified underlying -
200 List expiration dates for specified underlying -
*/ public okhttp3.Call listOptionsExpirationsAsync(String underlying, final ApiCallback> _callback) throws ApiException { @@ -343,7 +347,7 @@ private APIlistOptionsContractsRequest(String underlying) { /** * Set expiration - * @param expiration Unix timestamp of the expiration time (optional) + * @param expiration Unix timestamp of expiration date (optional) * @return APIlistOptionsContractsRequest */ public APIlistOptionsContractsRequest expiration(Long expiration) { @@ -359,7 +363,7 @@ public APIlistOptionsContractsRequest expiration(Long expiration) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -373,7 +377,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 { @@ -388,7 +392,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 { @@ -403,7 +407,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -412,14 +416,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callb } /** - * List all the contracts with specified underlying and expiration time + * 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 -
200 List retrieved successfully -
*/ public APIlistOptionsContractsRequest listOptionsContracts(String underlying) { @@ -435,7 +439,7 @@ public APIlistOptionsContractsRequest listOptionsContracts(String underlying) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getOptionsContractCall(String contract, final ApiCallback _callback) throws ApiException { @@ -480,7 +484,7 @@ private okhttp3.Call getOptionsContractValidateBeforeCall(String contract, final } /** - * Query specified contract detail + * Query specified contract details * * @param contract (required) * @return OptionsContract @@ -488,7 +492,7 @@ private okhttp3.Call getOptionsContractValidateBeforeCall(String contract, final * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public OptionsContract getOptionsContract(String contract) throws ApiException { @@ -497,7 +501,7 @@ public OptionsContract getOptionsContract(String contract) throws ApiException { } /** - * Query specified contract detail + * Query specified contract details * * @param contract (required) * @return ApiResponse<OptionsContract> @@ -505,7 +509,7 @@ public OptionsContract getOptionsContract(String contract) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getOptionsContractWithHttpInfo(String contract) throws ApiException { @@ -515,7 +519,7 @@ public ApiResponse getOptionsContractWithHttpInfo(String contra } /** - * Query specified contract detail (asynchronously) + * Query specified contract details (asynchronously) * * @param contract (required) * @param _callback The callback to be executed when the API call finishes @@ -524,7 +528,7 @@ public ApiResponse getOptionsContractWithHttpInfo(String contra * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getOptionsContractAsync(String contract, final ApiCallback _callback) throws ApiException { @@ -621,7 +625,7 @@ private APIlistOptionsSettlementsRequest(String underlying) { /** * 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 APIlistOptionsSettlementsRequest */ public APIlistOptionsSettlementsRequest limit(Integer limit) { @@ -641,7 +645,7 @@ public APIlistOptionsSettlementsRequest offset(Integer offset) { /** * 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 APIlistOptionsSettlementsRequest */ public APIlistOptionsSettlementsRequest from(Long from) { @@ -651,7 +655,7 @@ public APIlistOptionsSettlementsRequest 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 APIlistOptionsSettlementsRequest */ public APIlistOptionsSettlementsRequest to(Long to) { @@ -667,7 +671,7 @@ public APIlistOptionsSettlementsRequest 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 { @@ -681,7 +685,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 { @@ -696,7 +700,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 { @@ -711,7 +715,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 { @@ -727,7 +731,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _cal * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistOptionsSettlementsRequest listOptionsSettlements(String underlying) { @@ -745,7 +749,7 @@ public APIlistOptionsSettlementsRequest listOptionsSettlements(String underlying * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getOptionsSettlementCall(String contract, String underlying, Long at, final ApiCallback _callback) throws ApiException { @@ -808,7 +812,7 @@ private okhttp3.Call getOptionsSettlementValidateBeforeCall(String contract, Str } /** - * Get specified contract's settlement + * Get specified contract settlement information * * @param contract (required) * @param underlying Underlying (Obtained by listing underlying endpoint) (required) @@ -818,7 +822,7 @@ private okhttp3.Call getOptionsSettlementValidateBeforeCall(String contract, Str * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public OptionsSettlement getOptionsSettlement(String contract, String underlying, Long at) throws ApiException { @@ -827,7 +831,7 @@ public OptionsSettlement getOptionsSettlement(String contract, String underlying } /** - * Get specified contract's settlement + * Get specified contract settlement information * * @param contract (required) * @param underlying Underlying (Obtained by listing underlying endpoint) (required) @@ -837,7 +841,7 @@ public OptionsSettlement getOptionsSettlement(String contract, String underlying * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getOptionsSettlementWithHttpInfo(String contract, String underlying, Long at) throws ApiException { @@ -847,7 +851,7 @@ public ApiResponse getOptionsSettlementWithHttpInfo(String co } /** - * Get specified contract's settlement (asynchronously) + * Get specified contract settlement information (asynchronously) * * @param contract (required) * @param underlying Underlying (Obtained by listing underlying endpoint) (required) @@ -858,7 +862,7 @@ public ApiResponse getOptionsSettlementWithHttpInfo(String co * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getOptionsSettlementAsync(String contract, String underlying, Long at, final ApiCallback _callback) throws ApiException { @@ -970,7 +974,7 @@ public APIlistMyOptionsSettlementsRequest 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 APIlistMyOptionsSettlementsRequest */ public APIlistMyOptionsSettlementsRequest limit(Integer limit) { @@ -990,7 +994,7 @@ public APIlistMyOptionsSettlementsRequest offset(Integer offset) { /** * 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 APIlistMyOptionsSettlementsRequest */ public APIlistMyOptionsSettlementsRequest from(Long from) { @@ -1000,7 +1004,7 @@ public APIlistMyOptionsSettlementsRequest 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 APIlistMyOptionsSettlementsRequest */ public APIlistMyOptionsSettlementsRequest to(Long to) { @@ -1016,7 +1020,7 @@ public APIlistMyOptionsSettlementsRequest 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 { @@ -1030,7 +1034,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 { @@ -1045,7 +1049,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 { @@ -1060,7 +1064,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiE * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1069,14 +1073,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _ } /** - * List my options settlements + * 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 -
200 List retrieved successfully -
*/ public APIlistMyOptionsSettlementsRequest listMyOptionsSettlements(String underlying) { @@ -1165,7 +1169,7 @@ private APIlistOptionsOrderBookRequest(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 APIlistOptionsOrderBookRequest */ public APIlistOptionsOrderBookRequest interval(String interval) { @@ -1175,7 +1179,7 @@ public APIlistOptionsOrderBookRequest 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 APIlistOptionsOrderBookRequest */ public APIlistOptionsOrderBookRequest limit(Integer limit) { @@ -1185,7 +1189,7 @@ public APIlistOptionsOrderBookRequest 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 APIlistOptionsOrderBookRequest */ public APIlistOptionsOrderBookRequest withId(Boolean withId) { @@ -1201,7 +1205,7 @@ public APIlistOptionsOrderBookRequest 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 { @@ -1215,7 +1219,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 { @@ -1230,7 +1234,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 { @@ -1245,7 +1249,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 { @@ -1254,14 +1258,14 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) } /** - * Options order book + * 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 Order book retrieved -
200 Depth query successful -
*/ public APIlistOptionsOrderBookRequest listOptionsOrderBook(String contract) { @@ -1277,7 +1281,7 @@ public APIlistOptionsOrderBookRequest listOptionsOrderBook(String contract) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listOptionsTickersCall(String underlying, final ApiCallback _callback) throws ApiException { @@ -1325,7 +1329,7 @@ private okhttp3.Call listOptionsTickersValidateBeforeCall(String underlying, fin } /** - * List tickers of options contracts + * Query options market ticker information * * @param underlying Underlying (Obtained by listing underlying endpoint) (required) * @return List<OptionsTicker> @@ -1333,7 +1337,7 @@ private okhttp3.Call listOptionsTickersValidateBeforeCall(String underlying, fin * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public List listOptionsTickers(String underlying) throws ApiException { @@ -1342,7 +1346,7 @@ public List listOptionsTickers(String underlying) throws ApiExcep } /** - * List tickers of options contracts + * Query options market ticker information * * @param underlying Underlying (Obtained by listing underlying endpoint) (required) * @return ApiResponse<List<OptionsTicker>> @@ -1350,7 +1354,7 @@ public List listOptionsTickers(String underlying) throws ApiExcep * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> listOptionsTickersWithHttpInfo(String underlying) throws ApiException { @@ -1360,7 +1364,7 @@ public ApiResponse> listOptionsTickersWithHttpInfo(String un } /** - * List tickers of options contracts (asynchronously) + * 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 @@ -1369,7 +1373,7 @@ public ApiResponse> listOptionsTickersWithHttpInfo(String un * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listOptionsTickersAsync(String underlying, final ApiCallback> _callback) throws ApiException { @@ -1388,7 +1392,7 @@ public okhttp3.Call listOptionsTickersAsync(String underlying, final ApiCallback * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listOptionsUnderlyingTickersCall(String underlying, final ApiCallback _callback) throws ApiException { @@ -1433,7 +1437,7 @@ private okhttp3.Call listOptionsUnderlyingTickersValidateBeforeCall(String under } /** - * Get underlying ticker + * Query underlying ticker information * * @param underlying Underlying (required) * @return OptionsUnderlyingTicker @@ -1441,7 +1445,7 @@ private okhttp3.Call listOptionsUnderlyingTickersValidateBeforeCall(String under * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public OptionsUnderlyingTicker listOptionsUnderlyingTickers(String underlying) throws ApiException { @@ -1450,7 +1454,7 @@ public OptionsUnderlyingTicker listOptionsUnderlyingTickers(String underlying) t } /** - * Get underlying ticker + * Query underlying ticker information * * @param underlying Underlying (required) * @return ApiResponse<OptionsUnderlyingTicker> @@ -1458,7 +1462,7 @@ public OptionsUnderlyingTicker listOptionsUnderlyingTickers(String underlying) t * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse listOptionsUnderlyingTickersWithHttpInfo(String underlying) throws ApiException { @@ -1468,7 +1472,7 @@ public ApiResponse listOptionsUnderlyingTickersWithHttp } /** - * Get underlying ticker (asynchronously) + * Query underlying ticker information (asynchronously) * * @param underlying Underlying (required) * @param _callback The callback to be executed when the API call finishes @@ -1477,7 +1481,7 @@ public ApiResponse listOptionsUnderlyingTickersWithHttp * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listOptionsUnderlyingTickersAsync(String underlying, final ApiCallback _callback) throws ApiException { @@ -1574,7 +1578,7 @@ private APIlistOptionsCandlesticksRequest(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 APIlistOptionsCandlesticksRequest */ public APIlistOptionsCandlesticksRequest limit(Integer limit) { @@ -1584,7 +1588,7 @@ public APIlistOptionsCandlesticksRequest 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 APIlistOptionsCandlesticksRequest */ public APIlistOptionsCandlesticksRequest from(Long from) { @@ -1594,7 +1598,7 @@ public APIlistOptionsCandlesticksRequest 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 APIlistOptionsCandlesticksRequest */ public APIlistOptionsCandlesticksRequest to(Long to) { @@ -1604,7 +1608,7 @@ public APIlistOptionsCandlesticksRequest to(Long to) { /** * Set interval - * @param interval Interval time between data points (optional, default to 5m) + * @param interval Time interval between data points (optional, default to 5m) * @return APIlistOptionsCandlesticksRequest */ public APIlistOptionsCandlesticksRequest interval(String interval) { @@ -1620,7 +1624,7 @@ public APIlistOptionsCandlesticksRequest 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 { @@ -1634,7 +1638,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 { @@ -1649,7 +1653,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 { @@ -1664,7 +1668,7 @@ 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 { @@ -1673,14 +1677,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _ca } /** - * Get options candlesticks + * Options contract market candlestick chart * * @param contract Options contract name (required) * @return APIlistOptionsCandlesticksRequest * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public APIlistOptionsCandlesticksRequest listOptionsCandlesticks(String contract) { @@ -1774,7 +1778,7 @@ private APIlistOptionsUnderlyingCandlesticksRequest(String underlying) { /** * 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 APIlistOptionsUnderlyingCandlesticksRequest */ public APIlistOptionsUnderlyingCandlesticksRequest limit(Integer limit) { @@ -1784,7 +1788,7 @@ public APIlistOptionsUnderlyingCandlesticksRequest 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 APIlistOptionsUnderlyingCandlesticksRequest */ public APIlistOptionsUnderlyingCandlesticksRequest from(Long from) { @@ -1794,7 +1798,7 @@ public APIlistOptionsUnderlyingCandlesticksRequest 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 APIlistOptionsUnderlyingCandlesticksRequest */ public APIlistOptionsUnderlyingCandlesticksRequest to(Long to) { @@ -1804,7 +1808,7 @@ public APIlistOptionsUnderlyingCandlesticksRequest to(Long to) { /** * Set interval - * @param interval Interval time between data points (optional, default to 5m) + * @param interval Time interval between data points (optional, default to 5m) * @return APIlistOptionsUnderlyingCandlesticksRequest */ public APIlistOptionsUnderlyingCandlesticksRequest interval(String interval) { @@ -1820,7 +1824,7 @@ public APIlistOptionsUnderlyingCandlesticksRequest 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 { @@ -1834,7 +1838,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 { @@ -1849,7 +1853,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 { @@ -1864,7 +1868,7 @@ 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 { @@ -1873,14 +1877,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _ca } /** - * Mark price candlesticks of an underlying + * 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 Successfully retrieved -
200 Query successful -
*/ public APIlistOptionsUnderlyingCandlesticksRequest listOptionsUnderlyingCandlesticks(String underlying) { @@ -1983,7 +1987,7 @@ public APIlistOptionsTradesRequest contract(String contract) { /** * Set type - * @param type `C` is call, while `P` is put (optional) + * @param type `C` for call, `P` for put (optional) * @return APIlistOptionsTradesRequest */ public APIlistOptionsTradesRequest type(String type) { @@ -1993,7 +1997,7 @@ public APIlistOptionsTradesRequest type(String type) { /** * 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 APIlistOptionsTradesRequest */ public APIlistOptionsTradesRequest limit(Integer limit) { @@ -2013,7 +2017,7 @@ public APIlistOptionsTradesRequest offset(Integer offset) { /** * 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 APIlistOptionsTradesRequest */ public APIlistOptionsTradesRequest from(Long from) { @@ -2023,7 +2027,7 @@ public APIlistOptionsTradesRequest 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 APIlistOptionsTradesRequest */ public APIlistOptionsTradesRequest to(Long to) { @@ -2039,7 +2043,7 @@ public APIlistOptionsTradesRequest 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 { @@ -2053,7 +2057,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 { @@ -2068,7 +2072,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 { @@ -2083,7 +2087,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 { @@ -2092,13 +2096,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback } /** - * Options trade history + * Market trade records * * @return APIlistOptionsTradesRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistOptionsTradesRequest listOptionsTrades() { @@ -2113,7 +2117,7 @@ public APIlistOptionsTradesRequest listOptionsTrades() { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listOptionsAccountCall(final ApiCallback _callback) throws ApiException { @@ -2152,14 +2156,14 @@ private okhttp3.Call listOptionsAccountValidateBeforeCall(final ApiCallback _cal } /** - * List options account + * 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 Successfully retrieved -
200 Query successful -
*/ public OptionsAccount listOptionsAccount() throws ApiException { @@ -2168,14 +2172,14 @@ public OptionsAccount listOptionsAccount() throws ApiException { } /** - * List options account + * 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 Successfully retrieved -
200 Query successful -
*/ public ApiResponse listOptionsAccountWithHttpInfo() throws ApiException { @@ -2185,7 +2189,7 @@ public ApiResponse listOptionsAccountWithHttpInfo() throws ApiEx } /** - * List options account (asynchronously) + * Query account information (asynchronously) * * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -2193,7 +2197,7 @@ public ApiResponse listOptionsAccountWithHttpInfo() throws ApiEx * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call listOptionsAccountAsync(final ApiCallback _callback) throws ApiException { @@ -2284,7 +2288,7 @@ private APIlistOptionsAccountBookRequest() { /** * 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 APIlistOptionsAccountBookRequest */ public APIlistOptionsAccountBookRequest limit(Integer limit) { @@ -2304,7 +2308,7 @@ public APIlistOptionsAccountBookRequest offset(Integer offset) { /** * 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 APIlistOptionsAccountBookRequest */ public APIlistOptionsAccountBookRequest from(Long from) { @@ -2314,7 +2318,7 @@ public APIlistOptionsAccountBookRequest 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 APIlistOptionsAccountBookRequest */ public APIlistOptionsAccountBookRequest to(Long to) { @@ -2324,7 +2328,7 @@ public APIlistOptionsAccountBookRequest to(Long to) { /** * Set type - * @param type Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL (optional) + * @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) { @@ -2340,7 +2344,7 @@ public APIlistOptionsAccountBookRequest 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 { @@ -2354,7 +2358,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 { @@ -2369,7 +2373,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 { @@ -2384,7 +2388,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 { @@ -2393,13 +2397,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _ca } /** - * List account changing history + * Query account change history * * @return APIlistOptionsAccountBookRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistOptionsAccountBookRequest listOptionsAccountBook() { @@ -2483,7 +2487,7 @@ public APIlistOptionsPositionsRequest underlying(String underlying) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2497,7 +2501,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 { @@ -2512,7 +2516,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 { @@ -2527,7 +2531,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -2542,7 +2546,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _callb * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistOptionsPositionsRequest listOptionsPositions() { @@ -2558,7 +2562,7 @@ public APIlistOptionsPositionsRequest listOptionsPositions() { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getOptionsPositionCall(String contract, final ApiCallback _callback) throws ApiException { @@ -2611,7 +2615,7 @@ private okhttp3.Call getOptionsPositionValidateBeforeCall(String contract, final * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public OptionsPosition getOptionsPosition(String contract) throws ApiException { @@ -2628,7 +2632,7 @@ public OptionsPosition getOptionsPosition(String contract) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getOptionsPositionWithHttpInfo(String contract) throws ApiException { @@ -2647,7 +2651,7 @@ public ApiResponse getOptionsPositionWithHttpInfo(String contra * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getOptionsPositionAsync(String contract, final ApiCallback _callback) throws ApiException { @@ -2745,7 +2749,7 @@ public APIlistOptionsPositionCloseRequest contract(String contract) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2759,7 +2763,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 { @@ -2774,7 +2778,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 { @@ -2789,7 +2793,7 @@ public ApiResponse> executeWithHttpInfo() throws ApiE * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -2805,7 +2809,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _ * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistOptionsPositionCloseRequest listOptionsPositionClose(String underlying) { @@ -2929,7 +2933,7 @@ public APIlistOptionsOrdersRequest underlying(String underlying) { /** * 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 APIlistOptionsOrdersRequest */ public APIlistOptionsOrdersRequest limit(Integer limit) { @@ -2949,7 +2953,7 @@ public APIlistOptionsOrdersRequest offset(Integer offset) { /** * 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 APIlistOptionsOrdersRequest */ public APIlistOptionsOrdersRequest from(Long from) { @@ -2959,7 +2963,7 @@ public APIlistOptionsOrdersRequest 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 APIlistOptionsOrdersRequest */ public APIlistOptionsOrdersRequest to(Long to) { @@ -2975,7 +2979,7 @@ public APIlistOptionsOrdersRequest 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 { @@ -2989,7 +2993,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 { @@ -3004,7 +3008,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 { @@ -3019,7 +3023,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 { @@ -3030,12 +3034,12 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback /** * List options orders * - * @param status Only list the orders with this status (required) + * @param status Query order list based on status (required) * @return APIlistOptionsOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistOptionsOrdersRequest listOptionsOrders(String status) { @@ -3153,14 +3157,14 @@ public okhttp3.Call createOptionsOrderAsync(OptionsOrder optionsOrder, final Api * Build call for cancelOptionsOrders * @param contract Options contract name (optional) * @param underlying Underlying (optional) - * @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 cancelOptionsOrdersCall(String contract, String underlying, String side, final ApiCallback _callback) throws ApiException { @@ -3211,17 +3215,17 @@ private okhttp3.Call cancelOptionsOrdersValidateBeforeCall(String contract, Stri } /** - * Cancel all `open` orders matched + * Cancel all orders with 'open' status * * @param contract Options contract name (optional) * @param underlying Underlying (optional) - * @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<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 All orders matched cancelled -
200 Batch cancellation successful -
*/ public List cancelOptionsOrders(String contract, String underlying, String side) throws ApiException { @@ -3230,17 +3234,17 @@ public List cancelOptionsOrders(String contract, String underlying } /** - * Cancel all `open` orders matched + * Cancel all orders with 'open' status * * @param contract Options contract name (optional) * @param underlying Underlying (optional) - * @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<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 All orders matched cancelled -
200 Batch cancellation successful -
*/ public ApiResponse> cancelOptionsOrdersWithHttpInfo(String contract, String underlying, String side) throws ApiException { @@ -3250,18 +3254,18 @@ public ApiResponse> cancelOptionsOrdersWithHttpInfo(String co } /** - * Cancel all `open` orders matched (asynchronously) + * Cancel all orders with 'open' status (asynchronously) * * @param contract Options contract name (optional) * @param underlying Underlying (optional) - * @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 cancelOptionsOrdersAsync(String contract, String underlying, String side, final ApiCallback> _callback) throws ApiException { @@ -3273,7 +3277,7 @@ public okhttp3.Call cancelOptionsOrdersAsync(String contract, String underlying, /** * Build call for getOptionsOrder - * @param orderId Order ID returned on successful order creation (required) + * @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 @@ -3325,9 +3329,9 @@ private okhttp3.Call getOptionsOrderValidateBeforeCall(Long orderId, final ApiCa } /** - * Get a single order + * Query single order details * - * @param orderId Order ID returned on successful order creation (required) + * @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 @@ -3342,9 +3346,9 @@ public OptionsOrder getOptionsOrder(Long orderId) throws ApiException { } /** - * Get a single order + * Query single order details * - * @param orderId Order ID returned on successful order creation (required) + * @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 @@ -3360,9 +3364,9 @@ public ApiResponse getOptionsOrderWithHttpInfo(Long orderId) throw } /** - * Get a single order (asynchronously) + * Query single order details (asynchronously) * - * @param orderId Order ID returned on successful order creation (required) + * @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 @@ -3381,7 +3385,7 @@ public okhttp3.Call getOptionsOrderAsync(Long orderId, final ApiCallback cancelOptionsOrderWithHttpInfo(Long orderId) th } /** - * Cancel a single order (asynchronously) + * Cancel single order (asynchronously) * - * @param orderId Order ID returned on successful order creation (required) + * @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 @@ -3487,6 +3491,113 @@ public okhttp3.Call cancelOptionsOrderAsync(Long orderId, final ApiCallback + 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; @@ -3589,7 +3700,7 @@ public APIlistMyOptionsTradesRequest 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 APIlistMyOptionsTradesRequest */ public APIlistMyOptionsTradesRequest limit(Integer limit) { @@ -3609,7 +3720,7 @@ public APIlistMyOptionsTradesRequest offset(Integer offset) { /** * 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 APIlistMyOptionsTradesRequest */ public APIlistMyOptionsTradesRequest from(Long from) { @@ -3619,7 +3730,7 @@ public APIlistMyOptionsTradesRequest 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 APIlistMyOptionsTradesRequest */ public APIlistMyOptionsTradesRequest to(Long to) { @@ -3635,7 +3746,7 @@ public APIlistMyOptionsTradesRequest 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 { @@ -3649,7 +3760,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 { @@ -3664,7 +3775,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 { @@ -3679,7 +3790,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 { @@ -3688,18 +3799,375 @@ public okhttp3.Call executeAsync(final ApiCallback> _callba } /** - * List personal trading history + * 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 -
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 index 505aa93..a0a0246 100644 --- a/src/main/java/io/gate/gateapi/api/RebateApi.java +++ b/src/main/java/io/gate/gateapi/api/RebateApi.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,6 +22,13 @@ 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; @@ -48,7 +55,7 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } - private okhttp3.Call agencyTransactionHistoryCall(String currencyPair, String userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + 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 @@ -102,19 +109,19 @@ private okhttp3.Call agencyTransactionHistoryCall(String currencyPair, String us } @SuppressWarnings("rawtypes") - private okhttp3.Call agencyTransactionHistoryValidateBeforeCall(String currencyPair, String userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + 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, String userId, Long from, Long to, Integer limit, Integer offset) throws ApiException { + 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, String userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { + 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); @@ -123,7 +130,7 @@ private okhttp3.Call agencyTransactionHistoryAsync(String currencyPair, String u public class APIagencyTransactionHistoryRequest { private String currencyPair; - private String userId; + private Long userId; private Long from; private Long to; private Integer limit; @@ -134,7 +141,7 @@ private APIagencyTransactionHistoryRequest() { /** * Set currencyPair - * @param currencyPair Specify the currency pair, if not specified, return all currency pairs (optional) + * @param currencyPair Specify the trading pair. If not specified, returns all trading pairs (optional) * @return APIagencyTransactionHistoryRequest */ public APIagencyTransactionHistoryRequest currencyPair(String currencyPair) { @@ -147,14 +154,14 @@ public APIagencyTransactionHistoryRequest currencyPair(String currencyPair) { * @param userId User ID. If not specified, all user records will be returned (optional) * @return APIagencyTransactionHistoryRequest */ - public APIagencyTransactionHistoryRequest userId(String userId) { + public APIagencyTransactionHistoryRequest userId(Long userId) { this.userId = userId; 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 APIagencyTransactionHistoryRequest */ public APIagencyTransactionHistoryRequest from(Long from) { @@ -164,7 +171,7 @@ public APIagencyTransactionHistoryRequest 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 APIagencyTransactionHistoryRequest */ public APIagencyTransactionHistoryRequest to(Long to) { @@ -174,7 +181,7 @@ public APIagencyTransactionHistoryRequest 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 APIagencyTransactionHistoryRequest */ public APIagencyTransactionHistoryRequest limit(Integer limit) { @@ -200,7 +207,7 @@ public APIagencyTransactionHistoryRequest 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 { @@ -214,7 +221,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 { @@ -229,7 +236,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 { @@ -244,7 +251,7 @@ public ApiResponse> executeWithHttpInfo() throws * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -253,20 +260,20 @@ public okhttp3.Call executeAsync(final ApiCallback Status Code Description Response Headers - 200 List retrieved - + 200 List retrieved successfully - */ public APIagencyTransactionHistoryRequest agencyTransactionHistory() { return new APIagencyTransactionHistoryRequest(); } - private okhttp3.Call agencyCommissionsHistoryCall(String currency, String userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + 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 @@ -278,6 +285,10 @@ private okhttp3.Call agencyCommissionsHistoryCall(String currency, String userId 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)); } @@ -320,20 +331,20 @@ private okhttp3.Call agencyCommissionsHistoryCall(String currency, String userId } @SuppressWarnings("rawtypes") - private okhttp3.Call agencyCommissionsHistoryValidateBeforeCall(String currency, String userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = agencyCommissionsHistoryCall(currency, userId, from, to, limit, offset, _callback); + 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, String userId, Long from, Long to, Integer limit, Integer offset) throws ApiException { - okhttp3.Call localVarCall = agencyCommissionsHistoryValidateBeforeCall(currency, userId, from, to, limit, offset, null); + 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, String userId, Long from, Long to, Integer limit, Integer offset, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = agencyCommissionsHistoryValidateBeforeCall(currency, userId, from, to, limit, offset, _callback); + 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; @@ -341,7 +352,8 @@ private okhttp3.Call agencyCommissionsHistoryAsync(String currency, String userI public class APIagencyCommissionsHistoryRequest { private String currency; - private String userId; + private Integer commissionType; + private Long userId; private Long from; private Long to; private Integer limit; @@ -352,7 +364,7 @@ private APIagencyCommissionsHistoryRequest() { /** * 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 APIagencyCommissionsHistoryRequest */ public APIagencyCommissionsHistoryRequest currency(String currency) { @@ -360,19 +372,29 @@ public APIagencyCommissionsHistoryRequest currency(String 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(String userId) { + public APIagencyCommissionsHistoryRequest userId(Long userId) { this.userId = userId; 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 APIagencyCommissionsHistoryRequest */ public APIagencyCommissionsHistoryRequest from(Long from) { @@ -382,7 +404,7 @@ public APIagencyCommissionsHistoryRequest 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 APIagencyCommissionsHistoryRequest */ public APIagencyCommissionsHistoryRequest to(Long to) { @@ -392,7 +414,7 @@ public APIagencyCommissionsHistoryRequest 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 APIagencyCommissionsHistoryRequest */ public APIagencyCommissionsHistoryRequest limit(Integer limit) { @@ -418,11 +440,11 @@ public APIagencyCommissionsHistoryRequest 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 agencyCommissionsHistoryCall(currency, userId, from, to, limit, offset, _callback); + return agencyCommissionsHistoryCall(currency, commissionType, userId, from, to, limit, offset, _callback); } /** @@ -432,11 +454,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 = agencyCommissionsHistoryWithHttpInfo(currency, userId, from, to, limit, offset); + ApiResponse> localVarResp = agencyCommissionsHistoryWithHttpInfo(currency, commissionType, userId, from, to, limit, offset); return localVarResp.getData(); } @@ -447,11 +469,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 agencyCommissionsHistoryWithHttpInfo(currency, userId, from, to, limit, offset); + return agencyCommissionsHistoryWithHttpInfo(currency, commissionType, userId, from, to, limit, offset); } /** @@ -462,26 +484,1250 @@ 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 { - return agencyCommissionsHistoryAsync(currency, userId, from, to, limit, offset, _callback); + return agencyCommissionsHistoryAsync(currency, commissionType, userId, from, to, limit, offset, _callback); } } /** - * The broker obtains the commission history of the recommended user - * Record time range cannot exceed 30 days + * 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 -
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 66d0637..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,7 +20,6 @@ import com.google.gson.reflect.TypeToken; -import io.gate.gateapi.models.AmendOrderResult; import io.gate.gateapi.models.BatchAmendItem; import io.gate.gateapi.models.BatchOrder; import io.gate.gateapi.models.CancelBatchOrder; @@ -32,15 +31,16 @@ 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; @@ -77,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 { @@ -116,14 +116,14 @@ private okhttp3.Call listCurrenciesValidateBeforeCall(final ApiCallback _callbac } /** - * List all currencies' details - * Currency has two forms: 1. Only currency name, e.g., BTC, USDT 2. `<currency>_<chain>`, e.g., `HT_ETH` The latter one occurs when one currency has multiple chains. Currency detail contains a `chain` field whatever the form is. To retrieve all chains of one currency, you can use use all the details which has the name of the currency or name starting with `<currency>_`. + * 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 { @@ -132,14 +132,14 @@ public List listCurrencies() throws ApiException { } /** - * List all currencies' details - * Currency has two forms: 1. Only currency name, e.g., BTC, USDT 2. `<currency>_<chain>`, e.g., `HT_ETH` The latter one occurs when one currency has multiple chains. Currency detail contains a `chain` field whatever the form is. To retrieve all chains of one currency, you can use use all the details which has the name of the currency or name starting with `<currency>_`. + * 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 { @@ -149,15 +149,15 @@ public ApiResponse> listCurrenciesWithHttpInfo() throws ApiExcept } /** - * List all currencies' details (asynchronously) - * Currency has two forms: 1. Only currency name, e.g., BTC, USDT 2. `<currency>_<chain>`, e.g., `HT_ETH` The latter one occurs when one currency has multiple chains. Currency detail contains a `chain` field whatever the form is. To retrieve all chains of one currency, you can use use all the details which has the name of the currency or name starting with `<currency>_`. + * 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 { @@ -176,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 { @@ -221,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 @@ -229,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 { @@ -238,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> @@ -246,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 { @@ -256,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 @@ -265,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 { @@ -322,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 @@ -338,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 @@ -355,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 @@ -382,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 { @@ -427,7 +427,7 @@ private okhttp3.Call getCurrencyPairValidateBeforeCall(String currencyPair, fina } /** - * Get details of a specifc currency pair + * Query single currency pair details * * @param currencyPair Currency pair (required) * @return CurrencyPair @@ -435,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 { @@ -444,7 +444,7 @@ public CurrencyPair getCurrencyPair(String currencyPair) throws ApiException { } /** - * Get details of a specifc currency pair + * Query single currency pair details * * @param currencyPair Currency pair (required) * @return ApiResponse<CurrencyPair> @@ -452,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 { @@ -462,7 +462,7 @@ public ApiResponse getCurrencyPairWithHttpInfo(String currencyPair } /** - * Get details of a specifc currency pair (asynchronously) + * Query single currency pair details (asynchronously) * * @param currencyPair Currency pair (required) * @param _callback The callback to be executed when the API call finishes @@ -471,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 { @@ -573,7 +573,7 @@ public APIlistTickersRequest timezone(String timezone) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -587,7 +587,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 { @@ -602,7 +602,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 { @@ -617,7 +617,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 { @@ -626,13 +626,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) thro } /** - * 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() { @@ -721,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) { @@ -731,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) { @@ -741,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) { @@ -757,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 { @@ -771,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 { @@ -786,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 { @@ -801,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 { @@ -810,14 +810,14 @@ 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) { @@ -921,7 +921,7 @@ private APIlistTradesRequest(String currencyPair) { /** * Set limit - * @param limit Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 (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) { @@ -931,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) { @@ -941,7 +941,7 @@ public APIlistTradesRequest lastId(String lastId) { /** * Set reverse - * @param reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (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) { @@ -951,7 +951,7 @@ public APIlistTradesRequest reverse(Boolean reverse) { /** * Set from - * @param from Start timestamp of the query (optional) + * @param from Start timestamp for the query (optional) * @return APIlistTradesRequest */ public APIlistTradesRequest from(Long from) { @@ -961,7 +961,7 @@ public APIlistTradesRequest 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 APIlistTradesRequest */ public APIlistTradesRequest to(Long to) { @@ -987,7 +987,7 @@ public APIlistTradesRequest page(Integer page) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1001,7 +1001,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 { @@ -1016,7 +1016,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 { @@ -1031,7 +1031,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 { @@ -1040,14 +1040,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) throw } /** - * Retrieve market trades - * You can use `from` and `to` to query by time range, or use `last_id` by scrolling page. The default behavior is by time range. Scrolling query using `last_id` is not recommended any more. If `last_id` is specified, time range query parameters will be ignored. + * 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) { @@ -1141,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) { @@ -1161,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) { @@ -1171,7 +1171,7 @@ public APIlistCandlesticksRequest to(Long to) { /** * Set interval - * @param interval Interval time between data points. Note that `30d` means 1 natual month, not 30 days (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) { @@ -1187,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 { @@ -1201,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 { @@ -1216,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 { @@ -1231,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 { @@ -1240,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) { @@ -1295,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; } @@ -1316,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) { @@ -1332,7 +1332,7 @@ public APIgetFeeRequest currencyPair(String currencyPair) { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
* @deprecated */ @@ -1343,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); } @@ -1382,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 */ @@ -1410,14 +1410,14 @@ public APIgetFeeRequest getFee() { /** * Build call for getBatchSpotFee - * @param currencyPairs A request can only query up to 50 currency pairs (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getBatchSpotFeeCall(String currencyPairs, final ApiCallback _callback) throws ApiException { @@ -1465,15 +1465,15 @@ private okhttp3.Call getBatchSpotFeeValidateBeforeCall(String currencyPairs, fin } /** - * Query a batch of user trading fee rates + * Batch query account fee rates * - * @param currencyPairs A request can only query up to 50 currency pairs (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public Map getBatchSpotFee(String currencyPairs) throws ApiException { @@ -1482,15 +1482,15 @@ public Map getBatchSpotFee(String currencyPairs) throws ApiExce } /** - * Query a batch of user trading fee rates + * Batch query account fee rates * - * @param currencyPairs A request can only query up to 50 currency pairs (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public ApiResponse> getBatchSpotFeeWithHttpInfo(String currencyPairs) throws ApiException { @@ -1500,16 +1500,16 @@ public ApiResponse> getBatchSpotFeeWithHttpInfo(String curr } /** - * Query a batch of user trading fee rates (asynchronously) + * Batch query account fee rates (asynchronously) * - * @param currencyPairs A request can only query up to 50 currency pairs (required) + * @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 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getBatchSpotFeeAsync(String currencyPairs, final ApiCallback> _callback) throws ApiException { @@ -1580,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) { @@ -1596,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 { @@ -1610,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 { @@ -1625,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 { @@ -1640,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 { @@ -1649,20 +1649,20 @@ 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(); } - private okhttp3.Call listSpotAccountBookCall(String currency, Long from, Long to, Integer page, Integer limit, String type, final ApiCallback _callback) throws ApiException { + 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 @@ -1694,6 +1694,10 @@ private okhttp3.Call listSpotAccountBookCall(String currency, Long from, Long to localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); } + if (code != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("code", code)); + } + Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -1716,20 +1720,20 @@ private okhttp3.Call listSpotAccountBookCall(String currency, Long from, Long to } @SuppressWarnings("rawtypes") - private okhttp3.Call listSpotAccountBookValidateBeforeCall(String currency, Long from, Long to, Integer page, Integer limit, String type, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listSpotAccountBookCall(currency, from, to, page, limit, type, _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> listSpotAccountBookWithHttpInfo(String currency, Long from, Long to, Integer page, Integer limit, String type) throws ApiException { - okhttp3.Call localVarCall = listSpotAccountBookValidateBeforeCall(currency, from, to, page, limit, type, null); + 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 listSpotAccountBookAsync(String currency, Long from, Long to, Integer page, Integer limit, String type, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listSpotAccountBookValidateBeforeCall(currency, from, to, page, limit, type, _callback); + 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; @@ -1742,13 +1746,14 @@ public class APIlistSpotAccountBookRequest { private Integer page; private Integer limit; private String type; + private String code; private APIlistSpotAccountBookRequest() { } /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistSpotAccountBookRequest */ public APIlistSpotAccountBookRequest currency(String currency) { @@ -1758,7 +1763,7 @@ public APIlistSpotAccountBookRequest currency(String currency) { /** * Set from - * @param from Start timestamp of the query (optional) + * @param from Start timestamp for the query (optional) * @return APIlistSpotAccountBookRequest */ public APIlistSpotAccountBookRequest from(Long from) { @@ -1768,7 +1773,7 @@ public APIlistSpotAccountBookRequest 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 APIlistSpotAccountBookRequest */ public APIlistSpotAccountBookRequest to(Long to) { @@ -1788,7 +1793,7 @@ public APIlistSpotAccountBookRequest 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 APIlistSpotAccountBookRequest */ public APIlistSpotAccountBookRequest limit(Integer limit) { @@ -1798,7 +1803,7 @@ public APIlistSpotAccountBookRequest limit(Integer limit) { /** * Set type - * @param type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) + * @param type Query by specified account change type. If not specified, all change types will be included. (optional) * @return APIlistSpotAccountBookRequest */ public APIlistSpotAccountBookRequest type(String type) { @@ -1806,6 +1811,16 @@ public APIlistSpotAccountBookRequest type(String type) { return this; } + /** + * 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 @@ -1814,11 +1829,11 @@ public APIlistSpotAccountBookRequest 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 listSpotAccountBookCall(currency, from, to, page, limit, type, _callback); + return listSpotAccountBookCall(currency, from, to, page, limit, type, code, _callback); } /** @@ -1828,11 +1843,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 = listSpotAccountBookWithHttpInfo(currency, from, to, page, limit, type); + ApiResponse> localVarResp = listSpotAccountBookWithHttpInfo(currency, from, to, page, limit, type, code); return localVarResp.getData(); } @@ -1843,11 +1858,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 listSpotAccountBookWithHttpInfo(currency, from, to, page, limit, type); + return listSpotAccountBookWithHttpInfo(currency, from, to, page, limit, type, code); } /** @@ -1858,22 +1873,22 @@ public ApiResponse> executeWithHttpInfo() throws ApiExcept * @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 listSpotAccountBookAsync(currency, from, to, page, limit, type, _callback); + return listSpotAccountBookAsync(currency, from, to, page, limit, type, code, _callback); } } /** - * Query account book - * Record time range cannot exceed 30 days + * 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 APIlistSpotAccountBookRequest listSpotAccountBook() { @@ -1883,16 +1898,17 @@ public APIlistSpotAccountBookRequest listSpotAccountBook() { /** * 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 is completed -
200 Request execution completed -
*/ - public okhttp3.Call createBatchOrdersCall(List order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createBatchOrdersCall(List order, String xGateExptime, final ApiCallback _callback) throws ApiException { Object localVarPostBody = order; // create path and map variables @@ -1901,6 +1917,10 @@ public okhttp3.Call createBatchOrdersCall(List order, final ApiCallback _ 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 = { @@ -1922,66 +1942,69 @@ public okhttp3.Call createBatchOrdersCall(List order, final ApiCallback _ } @SuppressWarnings("rawtypes") - private okhttp3.Call createBatchOrdersValidateBeforeCall(List order, final ApiCallback _callback) throws ApiException { + 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, _callback); + okhttp3.Call localVarCall = createBatchOrdersCall(order, xGateExptime, _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 + * 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 is completed -
200 Request execution completed -
*/ - public List createBatchOrders(List order) throws ApiException { - ApiResponse> localVarResp = createBatchOrdersWithHttpInfo(order); + public List createBatchOrders(List order, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = createBatchOrdersWithHttpInfo(order, xGateExptime); 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 + * 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 is completed -
200 Request execution completed -
*/ - public ApiResponse> createBatchOrdersWithHttpInfo(List order) throws ApiException { - okhttp3.Call localVarCall = createBatchOrdersValidateBeforeCall(order, null); + 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); } /** - * 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 + * 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 is completed -
200 Request execution completed -
*/ - public okhttp3.Call createBatchOrdersAsync(List order, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = createBatchOrdersValidateBeforeCall(order, _callback); + 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; @@ -2078,7 +2101,7 @@ public APIlistAllOpenOrdersRequest limit(Integer limit) { /** * Set account - * @param account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @param account Specify query account (optional) * @return APIlistAllOpenOrdersRequest */ public APIlistAllOpenOrdersRequest account(String account) { @@ -2094,7 +2117,7 @@ public APIlistAllOpenOrdersRequest account(String account) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2108,7 +2131,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 { @@ -2123,7 +2146,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 { @@ -2138,7 +2161,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 { @@ -2148,12 +2171,12 @@ public okhttp3.Call executeAsync(final ApiCallback> _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,portfolio 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. * @return APIlistAllOpenOrdersRequest * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistAllOpenOrdersRequest listAllOpenOrders() { @@ -2169,7 +2192,7 @@ public APIlistAllOpenOrdersRequest listAllOpenOrders() { * @http.response.details - +
Status Code Description Response Headers
201 order created -
201 Order created successfully -
*/ public okhttp3.Call createCrossLiquidateOrderCall(LiquidateOrder liquidateOrder, final ApiCallback _callback) throws ApiException { @@ -2213,15 +2236,15 @@ private okhttp3.Call createCrossLiquidateOrderValidateBeforeCall(LiquidateOrder } /** - * close position when cross-currency is disabled - * Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998 + * 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 createCrossLiquidateOrder(LiquidateOrder liquidateOrder) throws ApiException { @@ -2230,15 +2253,15 @@ public Order createCrossLiquidateOrder(LiquidateOrder liquidateOrder) throws Api } /** - * close position when cross-currency is disabled - * Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998 + * 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 createCrossLiquidateOrderWithHttpInfo(LiquidateOrder liquidateOrder) throws ApiException { @@ -2248,8 +2271,8 @@ public ApiResponse createCrossLiquidateOrderWithHttpInfo(LiquidateOrder l } /** - * close position when cross-currency is disabled (asynchronously) - * Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998 + * 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 @@ -2257,7 +2280,7 @@ public ApiResponse createCrossLiquidateOrderWithHttpInfo(LiquidateOrder l * @http.response.details - +
Status Code Description Response Headers
201 order created -
201 Order created successfully -
*/ public okhttp3.Call createCrossLiquidateOrderAsync(LiquidateOrder liquidateOrder, final ApiCallback _callback) throws ApiException { @@ -2395,7 +2418,7 @@ public APIlistOrdersRequest limit(Integer limit) { /** * Set account - * @param account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @param account Specify query account (optional) * @return APIlistOrdersRequest */ public APIlistOrdersRequest account(String account) { @@ -2405,7 +2428,7 @@ public APIlistOrdersRequest account(String account) { /** * Set from - * @param from Start timestamp of the query (optional) + * @param from Start timestamp for the query (optional) * @return APIlistOrdersRequest */ public APIlistOrdersRequest from(Long from) { @@ -2415,7 +2438,7 @@ public APIlistOrdersRequest 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 APIlistOrdersRequest */ public APIlistOrdersRequest to(Long to) { @@ -2425,7 +2448,7 @@ public APIlistOrdersRequest to(Long to) { /** * Set side - * @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 APIlistOrdersRequest */ public APIlistOrdersRequest side(String side) { @@ -2441,7 +2464,7 @@ public APIlistOrdersRequest side(String side) { * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2455,7 +2478,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 { @@ -2470,7 +2493,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 { @@ -2485,7 +2508,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 { @@ -2495,14 +2518,14 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) throw /** * List orders - * Spot, portfolio 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) + * 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 List retrieved -
200 List retrieved successfully -
*/ public APIlistOrdersRequest listOrders(String currencyPair, String status) { @@ -2512,16 +2535,17 @@ public APIlistOrdersRequest listOrders(String currencyPair, String status) { /** * 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. -
201 Order created -
*/ - public okhttp3.Call createOrderCall(Order order, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createOrderCall(Order order, String xGateExptime, final ApiCallback _callback) throws ApiException { Object localVarPostBody = order; // create path and map variables @@ -2530,6 +2554,10 @@ public okhttp3.Call createOrderCall(Order order, final ApiCallback _callback) th 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 = { @@ -2551,66 +2579,69 @@ public okhttp3.Call createOrderCall(Order order, final ApiCallback _callback) th } @SuppressWarnings("rawtypes") - private okhttp3.Call createOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException { + 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, _callback); + okhttp3.Call localVarCall = createOrderCall(order, xGateExptime, _callback); return localVarCall; } /** * Create an order - * You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders.if the user is in portfolio mode, it defaults to the portfolio account. 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. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body + * 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. -
201 Order created -
*/ - public Order createOrder(Order order) throws ApiException { - ApiResponse localVarResp = createOrderWithHttpInfo(order); + public Order createOrder(Order order, String xGateExptime) throws ApiException { + ApiResponse localVarResp = createOrderWithHttpInfo(order, xGateExptime); return localVarResp.getData(); } /** * Create an order - * You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders.if the user is in portfolio mode, it defaults to the portfolio account. 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. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body + * 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. -
201 Order created -
*/ - public ApiResponse createOrderWithHttpInfo(Order order) throws ApiException { - okhttp3.Call localVarCall = createOrderValidateBeforeCall(order, null); + 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) - * You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders.if the user is in portfolio mode, it defaults to the portfolio account. 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. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body + * 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. -
201 Order created -
*/ - public okhttp3.Call createOrderAsync(Order order, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createOrderValidateBeforeCall(order, _callback); + 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; @@ -2618,19 +2649,21 @@ public okhttp3.Call createOrderAsync(Order order, final ApiCallback _call /** * 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 - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only (optional) + * @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. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ - public okhttp3.Call cancelOrdersCall(String currencyPair, String side, String account, final ApiCallback _callback) throws ApiException { + 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 @@ -2650,7 +2683,15 @@ public okhttp3.Call cancelOrdersCall(String currencyPair, String side, String ac 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 = { @@ -2672,73 +2713,74 @@ public okhttp3.Call cancelOrdersCall(String currencyPair, String side, String ac } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelOrdersValidateBeforeCall(String currencyPair, String side, String account, 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)"); - } - - okhttp3.Call localVarCall = cancelOrdersCall(currencyPair, side, account, _callback); + 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 - * If `account` is not set, all open orders, including spot, portfolio, 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 - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only (optional) - * @return List<Order> + * 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. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ - public List cancelOrders(String currencyPair, String side, String account) throws ApiException { - ApiResponse> localVarResp = cancelOrdersWithHttpInfo(currencyPair, side, account); + 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 - * If `account` is not set, all open orders, including spot, portfolio, 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 - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only (optional) - * @return ApiResponse<List<Order>> + * 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. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ - public ApiResponse> cancelOrdersWithHttpInfo(String currencyPair, String side, String account) throws ApiException { - okhttp3.Call localVarCall = cancelOrdersValidateBeforeCall(currencyPair, side, account, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + 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) - * If `account` is not set, all open orders, including spot, portfolio, 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 - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only (optional) + * 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. Query order status by listing orders -
200 Batch cancellation request accepted and processed, success determined by order list -
*/ - 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(); + 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; } @@ -2746,6 +2788,7 @@ public okhttp3.Call cancelOrdersAsync(String currencyPair, String side, String a /** * 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 @@ -2755,7 +2798,7 @@ public okhttp3.Call cancelOrdersAsync(String currencyPair, String side, String a 200 Batch cancellation completed - */ - public okhttp3.Call cancelBatchOrdersCall(List cancelBatchOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call cancelBatchOrdersCall(List cancelBatchOrder, String xGateExptime, final ApiCallback _callback) throws ApiException { Object localVarPostBody = cancelBatchOrder; // create path and map variables @@ -2764,6 +2807,10 @@ public okhttp3.Call cancelBatchOrdersCall(List cancelBatchOrde 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 = { @@ -2785,20 +2832,21 @@ public okhttp3.Call cancelBatchOrdersCall(List cancelBatchOrde } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelBatchOrdersValidateBeforeCall(List cancelBatchOrder, final ApiCallback _callback) throws ApiException { + 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, _callback); + okhttp3.Call localVarCall = cancelBatchOrdersCall(cancelBatchOrder, xGateExptime, _callback); return localVarCall; } /** - * 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 * @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 @@ -2807,15 +2855,16 @@ private okhttp3.Call cancelBatchOrdersValidateBeforeCall(List 200 Batch cancellation completed - */ - public List cancelBatchOrders(List cancelBatchOrder) throws ApiException { - ApiResponse> localVarResp = cancelBatchOrdersWithHttpInfo(cancelBatchOrder); + public List cancelBatchOrders(List cancelBatchOrder, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = cancelBatchOrdersWithHttpInfo(cancelBatchOrder, xGateExptime); return localVarResp.getData(); } /** - * 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 * @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 @@ -2824,16 +2873,17 @@ public List cancelBatchOrders(List cancelBa 200 Batch cancellation completed - */ - public ApiResponse> cancelBatchOrdersWithHttpInfo(List cancelBatchOrder) throws ApiException { - okhttp3.Call localVarCall = cancelBatchOrdersValidateBeforeCall(cancelBatchOrder, null); + 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 a batch of orders with an ID list (asynchronously) + * 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 @@ -2843,8 +2893,8 @@ public ApiResponse> cancelBatchOrdersWithHttpInfo(List 200 Batch cancellation completed - */ - public okhttp3.Call cancelBatchOrdersAsync(List cancelBatchOrder, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = cancelBatchOrdersValidateBeforeCall(cancelBatchOrder, _callback); + 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; @@ -2852,9 +2902,9 @@ public okhttp3.Call cancelBatchOrdersAsync(List cancelBatchOrd /** * Build call for getOrder - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 @@ -2919,11 +2969,11 @@ private okhttp3.Call getOrderValidateBeforeCall(String orderId, String currencyP } /** - * Get a single order - * Spot, portfolio and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin. - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * 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 @@ -2938,11 +2988,11 @@ public Order getOrder(String orderId, String currencyPair, String account) throw } /** - * Get a single order - * Spot, portfolio and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin. - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * 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 @@ -2958,11 +3008,11 @@ public ApiResponse getOrderWithHttpInfo(String orderId, String currencyPa } /** - * Get a single order (asynchronously) - * Spot, portfolio and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin. - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) - * @param account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * 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 @@ -2981,9 +3031,11 @@ public okhttp3.Call getOrderAsync(String orderId, String currencyPair, String ac /** * Build call for cancelOrder - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * @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 operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 @@ -2993,7 +3045,7 @@ public okhttp3.Call getOrderAsync(String orderId, String currencyPair, String ac 200 Order cancelled - */ - public okhttp3.Call cancelOrderCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { + 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 @@ -3010,7 +3062,15 @@ public okhttp3.Call cancelOrderCall(String orderId, String currencyPair, String 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 = { @@ -3032,7 +3092,7 @@ public okhttp3.Call cancelOrderCall(String orderId, String currencyPair, String } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelOrderValidateBeforeCall(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { + 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)"); @@ -3043,16 +3103,18 @@ private okhttp3.Call cancelOrderValidateBeforeCall(String orderId, String curren throw new ApiException("Missing the required parameter 'currencyPair' when calling cancelOrder(Async)"); } - okhttp3.Call localVarCall = cancelOrderCall(orderId, currencyPair, account, _callback); + okhttp3.Call localVarCall = cancelOrderCall(orderId, currencyPair, account, actionMode, xGateExptime, _callback); return localVarCall; } /** - * Cancel a single order - * Spot,portfolio and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * 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 operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 @@ -3061,17 +3123,19 @@ private okhttp3.Call cancelOrderValidateBeforeCall(String orderId, String curren 200 Order cancelled - */ - public Order cancelOrder(String orderId, String currencyPair, String account) throws ApiException { - ApiResponse localVarResp = cancelOrderWithHttpInfo(orderId, currencyPair, account); + 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 a single order - * Spot,portfolio and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * 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 operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 @@ -3080,18 +3144,20 @@ public Order cancelOrder(String orderId, String currencyPair, String account) th 200 Order cancelled - */ - public ApiResponse cancelOrderWithHttpInfo(String orderId, String currencyPair, String account) throws ApiException { - okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderId, currencyPair, account, null); + 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 a single order (asynchronously) - * Spot,portfolio and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * 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 operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 @@ -3101,8 +3167,8 @@ public ApiResponse cancelOrderWithHttpInfo(String orderId, String currenc 200 Order cancelled - */ - public okhttp3.Call cancelOrderAsync(String orderId, String currencyPair, String account, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderId, currencyPair, account, _callback); + 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; @@ -3110,20 +3176,21 @@ public okhttp3.Call cancelOrderAsync(String orderId, String currencyPair, String /** * Build call for amendOrder - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) + * @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 account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 -
200 Updated successfully -
*/ - public okhttp3.Call amendOrderCall(String orderId, String currencyPair, OrderPatch orderPatch, String account, final ApiCallback _callback) throws ApiException { + 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 @@ -3141,6 +3208,10 @@ public okhttp3.Call amendOrderCall(String orderId, String currencyPair, OrderPat } 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 = { @@ -3162,85 +3233,83 @@ public okhttp3.Call amendOrderCall(String orderId, String currencyPair, OrderPat } @SuppressWarnings("rawtypes") - private okhttp3.Call amendOrderValidateBeforeCall(String orderId, String currencyPair, OrderPatch orderPatch, String account, final ApiCallback _callback) throws ApiException { + 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 'currencyPair' is set - if (currencyPair == null) { - throw new ApiException("Missing the required parameter 'currencyPair' 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, currencyPair, orderPatch, account, _callback); + okhttp3.Call localVarCall = amendOrderCall(orderId, orderPatch, currencyPair, account, xGateExptime, _callback); return localVarCall; } /** - * Amend an order - * By default, the orders of spot, portfolio and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: Only reducing the quantity without modifying the priority of matching, altering the price or increasing the quantity will adjust the priority to the new price at the end Note: If the modified amount is less than the fill amount, the order will be cancelled. - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) + * 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 account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 -
200 Updated successfully -
*/ - public Order amendOrder(String orderId, String currencyPair, OrderPatch orderPatch, String account) throws ApiException { - ApiResponse localVarResp = amendOrderWithHttpInfo(orderId, currencyPair, orderPatch, account); + 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 an order - * By default, the orders of spot, portfolio and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: Only reducing the quantity without modifying the priority of matching, altering the price or increasing the quantity will adjust the priority to the new price at the end Note: If the modified amount is less than the fill amount, the order will be cancelled. - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) + * 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 account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 -
200 Updated successfully -
*/ - public ApiResponse amendOrderWithHttpInfo(String orderId, String currencyPair, OrderPatch orderPatch, String account) throws ApiException { - okhttp3.Call localVarCall = amendOrderValidateBeforeCall(orderId, currencyPair, orderPatch, account, null); + 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 an order (asynchronously) - * By default, the orders of spot, portfolio and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: Only reducing the quantity without modifying the priority of matching, altering the price or increasing the quantity will adjust the priority to the new price at the end Note: If the modified amount is less than the fill amount, the order will be cancelled. - * @param orderId Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) - * @param currencyPair Currency pair (required) + * 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 account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @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 -
200 Updated successfully -
*/ - public okhttp3.Call amendOrderAsync(String orderId, String currencyPair, OrderPatch orderPatch, String account, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = amendOrderValidateBeforeCall(orderId, currencyPair, orderPatch, account, _callback); + 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; @@ -3347,7 +3416,7 @@ public APIlistMyTradesRequest currencyPair(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 APIlistMyTradesRequest */ public APIlistMyTradesRequest limit(Integer limit) { @@ -3377,7 +3446,7 @@ public APIlistMyTradesRequest orderId(String orderId) { /** * Set account - * @param account Specify operation account. Default to spot ,portfolio and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * @param account Specify query account (optional) * @return APIlistMyTradesRequest */ public APIlistMyTradesRequest account(String account) { @@ -3387,7 +3456,7 @@ public APIlistMyTradesRequest account(String account) { /** * Set from - * @param from Start timestamp of the query (optional) + * @param from Start timestamp for the query (optional) * @return APIlistMyTradesRequest */ public APIlistMyTradesRequest from(Long from) { @@ -3397,7 +3466,7 @@ public APIlistMyTradesRequest 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 APIlistMyTradesRequest */ public APIlistMyTradesRequest to(Long to) { @@ -3413,7 +3482,7 @@ public APIlistMyTradesRequest 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 { @@ -3427,7 +3496,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 { @@ -3442,7 +3511,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 { @@ -3457,7 +3526,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 { @@ -3466,13 +3535,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) throw } /** - * List personal trading history - * Spot,portfolio and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range. If you don't specify `from` and/or `to` parameters, only the last 7 days of data will be retured. The range of `from` and `to` is not alloed to exceed 30 days. Time range parameters are handled as order finish time. + * 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 List retrieved -
200 List retrieved successfully -
*/ public APIlistMyTradesRequest listMyTrades() { @@ -3487,7 +3556,7 @@ public APIlistMyTradesRequest listMyTrades() { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getSystemTimeCall(final ApiCallback _callback) throws ApiException { @@ -3533,7 +3602,7 @@ private okhttp3.Call getSystemTimeValidateBeforeCall(final ApiCallback _callback * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public SystemTime getSystemTime() throws ApiException { @@ -3549,7 +3618,7 @@ public SystemTime getSystemTime() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public ApiResponse getSystemTimeWithHttpInfo() throws ApiException { @@ -3567,7 +3636,7 @@ public ApiResponse getSystemTimeWithHttpInfo() throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 Successfully retrieved -
200 Query successful -
*/ public okhttp3.Call getSystemTimeAsync(final ApiCallback _callback) throws ApiException { @@ -3586,7 +3655,7 @@ public okhttp3.Call getSystemTimeAsync(final ApiCallback _callback) * @http.response.details - +
Status Code Description Response Headers
200 Set countdown successfully -
200 Countdown set successfully -
*/ public okhttp3.Call countdownCancelAllSpotCall(CountdownCancelAllSpotTask countdownCancelAllSpotTask, final ApiCallback _callback) throws ApiException { @@ -3631,14 +3700,14 @@ private okhttp3.Call countdownCancelAllSpotValidateBeforeCall(CountdownCancelAll /** * Countdown cancel orders - * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + * 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 Set countdown successfully -
200 Countdown set successfully -
*/ public TriggerTime countdownCancelAllSpot(CountdownCancelAllSpotTask countdownCancelAllSpotTask) throws ApiException { @@ -3648,14 +3717,14 @@ public TriggerTime countdownCancelAllSpot(CountdownCancelAllSpotTask countdownCa /** * Countdown cancel orders - * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + * 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 Set countdown successfully -
200 Countdown set successfully -
*/ public ApiResponse countdownCancelAllSpotWithHttpInfo(CountdownCancelAllSpotTask countdownCancelAllSpotTask) throws ApiException { @@ -3666,7 +3735,7 @@ public ApiResponse countdownCancelAllSpotWithHttpInfo(CountdownCanc /** * Countdown cancel orders (asynchronously) - * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + * 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 @@ -3674,7 +3743,7 @@ public ApiResponse countdownCancelAllSpotWithHttpInfo(CountdownCanc * @http.response.details - +
Status Code Description Response Headers
200 Set countdown successfully -
200 Countdown set successfully -
*/ public okhttp3.Call countdownCancelAllSpotAsync(CountdownCancelAllSpotTask countdownCancelAllSpotTask, final ApiCallback _callback) throws ApiException { @@ -3687,6 +3756,7 @@ public okhttp3.Call countdownCancelAllSpotAsync(CountdownCancelAllSpotTask count /** * 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 @@ -3696,7 +3766,7 @@ public okhttp3.Call countdownCancelAllSpotAsync(CountdownCancelAllSpotTask count 200 Order modification executed successfully - */ - public okhttp3.Call amendBatchOrdersCall(List batchAmendItem, final ApiCallback _callback) throws ApiException { + public okhttp3.Call amendBatchOrdersCall(List batchAmendItem, String xGateExptime, final ApiCallback _callback) throws ApiException { Object localVarPostBody = batchAmendItem; // create path and map variables @@ -3705,6 +3775,10 @@ public okhttp3.Call amendBatchOrdersCall(List batchAmendItem, fi 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 = { @@ -3726,21 +3800,22 @@ public okhttp3.Call amendBatchOrdersCall(List batchAmendItem, fi } @SuppressWarnings("rawtypes") - private okhttp3.Call amendBatchOrdersValidateBeforeCall(List batchAmendItem, final ApiCallback _callback) throws ApiException { + 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 = amendBatchOrdersCall(batchAmendItem, _callback); + okhttp3.Call localVarCall = amendBatchOrdersCall(batchAmendItem, xGateExptime, _callback); return localVarCall; } /** * Batch modification of orders - * Default modification of orders for spot, portfolio, and margin accounts. To modify orders for a cross margin account, the `account` parameter must be specified as `cross_margin`. For portfolio margin accounts, the `account` parameter can only be specified as `cross_margin`. Currently, only modifications to price or quantity (choose one) are supported. When modifying unfinished orders, a maximum of 5 orders can be batch-modified in one request. The request parameters should be passed in an array format. During batch modification, if one order modification fails, the modification process will continue with the next order. After execution, the response will include corresponding failure information for the failed orders. The sequence of calling for batch order modification should be consistent with the order in the order list. The response content order for batch order modification will also be consistent with the order in the order list. + * 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) - * @return List<AmendOrderResult> + * @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 @@ -3748,16 +3823,17 @@ private okhttp3.Call amendBatchOrdersValidateBeforeCall(List bat
200 Order modification executed successfully -
*/ - public List amendBatchOrders(List batchAmendItem) throws ApiException { - ApiResponse> localVarResp = amendBatchOrdersWithHttpInfo(batchAmendItem); + public List amendBatchOrders(List batchAmendItem, String xGateExptime) throws ApiException { + ApiResponse> localVarResp = amendBatchOrdersWithHttpInfo(batchAmendItem, xGateExptime); return localVarResp.getData(); } /** * Batch modification of orders - * Default modification of orders for spot, portfolio, and margin accounts. To modify orders for a cross margin account, the `account` parameter must be specified as `cross_margin`. For portfolio margin accounts, the `account` parameter can only be specified as `cross_margin`. Currently, only modifications to price or quantity (choose one) are supported. When modifying unfinished orders, a maximum of 5 orders can be batch-modified in one request. The request parameters should be passed in an array format. During batch modification, if one order modification fails, the modification process will continue with the next order. After execution, the response will include corresponding failure information for the failed orders. The sequence of calling for batch order modification should be consistent with the order in the order list. The response content order for batch order modification will also be consistent with the order in the order list. + * 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) - * @return ApiResponse<List<AmendOrderResult>> + * @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 @@ -3765,16 +3841,17 @@ public List amendBatchOrders(List batchAmendIt
200 Order modification executed successfully -
*/ - public ApiResponse> amendBatchOrdersWithHttpInfo(List batchAmendItem) throws ApiException { - okhttp3.Call localVarCall = amendBatchOrdersValidateBeforeCall(batchAmendItem, 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); } /** * Batch modification of orders (asynchronously) - * Default modification of orders for spot, portfolio, and margin accounts. To modify orders for a cross margin account, the `account` parameter must be specified as `cross_margin`. For portfolio margin accounts, the `account` parameter can only be specified as `cross_margin`. Currently, only modifications to price or quantity (choose one) are supported. When modifying unfinished orders, a maximum of 5 orders can be batch-modified in one request. The request parameters should be passed in an array format. During batch modification, if one order modification fails, the modification process will continue with the next order. After execution, the response will include corresponding failure information for the failed orders. The sequence of calling for batch order modification should be consistent with the order in the order list. The response content order for batch order modification will also be consistent with the order in the order list. + * 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 @@ -3784,13 +3861,219 @@ public ApiResponse> amendBatchOrdersWithHttpInfo(List 200 Order modification executed successfully - */ - public okhttp3.Call amendBatchOrdersAsync(List batchAmendItem, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = amendBatchOrdersValidateBeforeCall(batchAmendItem, _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 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/insurance_history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (business != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("business", business)); + } + + 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[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + 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)"); + } + + // 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> 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 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 APIgetSpotInsuranceHistoryRequest { + private final String business; + private final String currency; + private final Long from; + private final Long to; + private Integer page; + private Integer limit; + + 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 APIgetSpotInsuranceHistoryRequest + */ + public APIgetSpotInsuranceHistoryRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * 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 APIgetSpotInsuranceHistoryRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * 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 Query successful -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getSpotInsuranceHistoryCall(business, currency, from, to, page, limit, _callback); + } + + /** + * 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 Query successful -
+ */ + public List execute() throws ApiException { + ApiResponse> localVarResp = getSpotInsuranceHistoryWithHttpInfo(business, currency, from, to, page, limit); + return localVarResp.getData(); + } + + /** + * 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 Query successful -
+ */ + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getSpotInsuranceHistoryWithHttpInfo(business, currency, from, to, page, limit); + } + + /** + * 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 Query successful -
+ */ + public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { + return getSpotInsuranceHistoryAsync(business, currency, from, to, page, limit, _callback); + } + } + + /** + * 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 Query successful -
+ */ + 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 { Object localVarPostBody = null; @@ -3878,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) { @@ -3888,7 +4171,7 @@ public APIlistSpotPriceTriggeredOrdersRequest market(String market) { /** * Set account - * @param account Trading account type. Portfolio margin account must set to `cross_margin` (optional) + * @param account Trading account type. Unified account must be set to `unified` (optional) * @return APIlistSpotPriceTriggeredOrdersRequest */ public APIlistSpotPriceTriggeredOrdersRequest account(String account) { @@ -3898,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) { @@ -3924,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 { @@ -3938,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 { @@ -3953,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 { @@ -3968,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 { @@ -3977,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) { @@ -4000,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 { @@ -4044,7 +4327,7 @@ private okhttp3.Call createSpotPriceTriggeredOrderValidateBeforeCall(SpotPriceTr } /** - * Create a price-triggered order + * Create price-triggered order * * @param spotPriceTriggeredOrder (required) * @return TriggerOrderResponse @@ -4052,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 { @@ -4061,7 +4344,7 @@ public TriggerOrderResponse createSpotPriceTriggeredOrder(SpotPriceTriggeredOrde } /** - * Create a price-triggered order + * Create price-triggered order * * @param spotPriceTriggeredOrder (required) * @return ApiResponse<TriggerOrderResponse> @@ -4069,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 { @@ -4079,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 @@ -4088,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 { @@ -4100,15 +4383,15 @@ public okhttp3.Call createSpotPriceTriggeredOrderAsync(SpotPriceTriggeredOrder s /** * Build call for cancelSpotPriceTriggeredOrderList - * @param market Currency pair (optional) - * @param account Trading account type. Portfolio margin account must set to `cross_margin` (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 { @@ -4155,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 type. Portfolio margin account must set to `cross_margin` (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 { @@ -4173,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 type. Portfolio margin account must set to `cross_margin` (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 { @@ -4192,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 type. Portfolio margin account must set to `cross_margin` (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 { @@ -4214,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 { @@ -4266,15 +4549,15 @@ private okhttp3.Call getSpotPriceTriggeredOrderValidateBeforeCall(String orderId } /** - * Get a price-triggered 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 { @@ -4283,15 +4566,15 @@ public SpotPriceTriggeredOrder getSpotPriceTriggeredOrder(String orderId) throws } /** - * Get a price-triggered 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 { @@ -4301,16 +4584,16 @@ public ApiResponse getSpotPriceTriggeredOrderWithHttpIn } /** - * Get a price-triggered 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 { @@ -4322,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 { @@ -4374,15 +4657,15 @@ private okhttp3.Call cancelSpotPriceTriggeredOrderValidateBeforeCall(String orde } /** - * cancel a price-triggered 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 { @@ -4391,15 +4674,15 @@ public SpotPriceTriggeredOrder cancelSpotPriceTriggeredOrder(String orderId) thr } /** - * cancel a price-triggered 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 { @@ -4409,16 +4692,16 @@ public ApiResponse cancelSpotPriceTriggeredOrderWithHtt } /** - * cancel a price-triggered 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 index a61b17d..275e990 100644 --- a/src/main/java/io/gate/gateapi/api/SubAccountApi.java +++ b/src/main/java/io/gate/gateapi/api/SubAccountApi.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,6 +22,7 @@ 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; @@ -109,7 +110,7 @@ private APIlistSubAccountsRequest() { /** * Set type - * @param type `0` to list all types of sub-accounts (currently supporting cross margin accounts and sub-accounts). `1` to list sub-accounts only. If no parameter is passed, only sub-accounts will be listed by default. (optional) + * @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) { @@ -125,7 +126,7 @@ public APIlistSubAccountsRequest 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 { @@ -139,7 +140,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 { @@ -154,7 +155,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 { @@ -169,7 +170,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 { @@ -184,7 +185,7 @@ public okhttp3.Call executeAsync(final ApiCallback> _callback) * @http.response.details - +
Status Code Description Response Headers
200 List retrieved -
200 List retrieved successfully -
*/ public APIlistSubAccountsRequest listSubAccounts() { @@ -200,7 +201,7 @@ public APIlistSubAccountsRequest listSubAccounts() { * @http.response.details - +
Status Code Description Response Headers
201 Created Successfully -
201 Created successfully -
*/ public okhttp3.Call createSubAccountsCall(SubAccount subAccount, final ApiCallback _callback) throws ApiException { @@ -252,7 +253,7 @@ private okhttp3.Call createSubAccountsValidateBeforeCall(SubAccount subAccount, * @http.response.details - +
Status Code Description Response Headers
201 Created Successfully -
201 Created successfully -
*/ public SubAccount createSubAccounts(SubAccount subAccount) throws ApiException { @@ -269,7 +270,7 @@ public SubAccount createSubAccounts(SubAccount subAccount) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
201 Created Successfully -
201 Created successfully -
*/ public ApiResponse createSubAccountsWithHttpInfo(SubAccount subAccount) throws ApiException { @@ -288,7 +289,7 @@ public ApiResponse createSubAccountsWithHttpInfo(SubAccount subAccou * @http.response.details - +
Status Code Description Response Headers
201 Created Successfully -
201 Created successfully -
*/ public okhttp3.Call createSubAccountsAsync(SubAccount subAccount, final ApiCallback _callback) throws ApiException { @@ -300,14 +301,14 @@ public okhttp3.Call createSubAccountsAsync(SubAccount subAccount, final ApiCallb /** * Build call for getSubAccount - * @param userId Sub-account user id (required) + * @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 Successful -
200 Successfully retrieved -
*/ public okhttp3.Call getSubAccountCall(Long userId, final ApiCallback _callback) throws ApiException { @@ -352,15 +353,15 @@ private okhttp3.Call getSubAccountValidateBeforeCall(Long userId, final ApiCallb } /** - * Get the sub-account + * Get sub-account * - * @param userId Sub-account user id (required) + * @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 Successful -
200 Successfully retrieved -
*/ public SubAccount getSubAccount(Long userId) throws ApiException { @@ -369,15 +370,15 @@ public SubAccount getSubAccount(Long userId) throws ApiException { } /** - * Get the sub-account + * Get sub-account * - * @param userId Sub-account user id (required) + * @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 Successful -
200 Successfully retrieved -
*/ public ApiResponse getSubAccountWithHttpInfo(Long userId) throws ApiException { @@ -387,16 +388,16 @@ public ApiResponse getSubAccountWithHttpInfo(Long userId) throws Api } /** - * Get the sub-account (asynchronously) + * Get sub-account (asynchronously) * - * @param userId Sub-account user id (required) + * @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 Successful -
200 Successfully retrieved -
*/ public okhttp3.Call getSubAccountAsync(Long userId, final ApiCallback _callback) throws ApiException { @@ -408,14 +409,14 @@ public okhttp3.Call getSubAccountAsync(Long userId, final ApiCallback Status Code Description Response Headers - 200 List retrieved - + 200 List retrieved successfully - */ public okhttp3.Call listSubAccountKeysCall(Integer userId, final ApiCallback _callback) throws ApiException { @@ -460,15 +461,15 @@ private okhttp3.Call listSubAccountKeysValidateBeforeCall(Integer userId, final } /** - * List all API Key of the sub-account + * List all API key pairs of the sub-account * - * @param userId Sub-account user id (required) + * @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 -
200 List retrieved successfully -
*/ public List listSubAccountKeys(Integer userId) throws ApiException { @@ -477,15 +478,15 @@ public List listSubAccountKeys(Integer userId) throws ApiExceptio } /** - * List all API Key of the sub-account + * List all API key pairs of the sub-account * - * @param userId Sub-account user id (required) + * @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 -
200 List retrieved successfully -
*/ public ApiResponse> listSubAccountKeysWithHttpInfo(Integer userId) throws ApiException { @@ -495,16 +496,16 @@ public ApiResponse> listSubAccountKeysWithHttpInfo(Integer u } /** - * List all API Key of the sub-account (asynchronously) + * List all API key pairs of the sub-account (asynchronously) * - * @param userId Sub-account user id (required) + * @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 -
200 List retrieved successfully -
*/ public okhttp3.Call listSubAccountKeysAsync(Integer userId, final ApiCallback> _callback) throws ApiException { @@ -516,7 +517,7 @@ public okhttp3.Call listSubAccountKeysAsync(Integer userId, final ApiCallback
  • Status Code Description Response Headers - 200 Created Successfully - + 200 Created successfully - */ public okhttp3.Call createSubAccountKeysCall(Long userId, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { @@ -574,46 +575,46 @@ private okhttp3.Call createSubAccountKeysValidateBeforeCall(Long userId, SubAcco } /** - * Create API Key of the sub-account + * Create new sub-account API key pair * - * @param userId Sub-account user id (required) + * @param userId Sub-account user ID (required) * @param subAccountKey (required) - * @return List<SubAccountKey> + * @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 -
    200 Created successfully -
    */ - public List createSubAccountKeys(Long userId, SubAccountKey subAccountKey) throws ApiException { - ApiResponse> localVarResp = createSubAccountKeysWithHttpInfo(userId, subAccountKey); + public SubAccountKey createSubAccountKeys(Long userId, SubAccountKey subAccountKey) throws ApiException { + ApiResponse localVarResp = createSubAccountKeysWithHttpInfo(userId, subAccountKey); return localVarResp.getData(); } /** - * Create API Key of the sub-account + * Create new sub-account API key pair * - * @param userId Sub-account user id (required) + * @param userId Sub-account user ID (required) * @param subAccountKey (required) - * @return ApiResponse<List<SubAccountKey>> + * @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 -
    200 Created successfully -
    */ - public ApiResponse> createSubAccountKeysWithHttpInfo(Long userId, SubAccountKey subAccountKey) throws ApiException { + public ApiResponse createSubAccountKeysWithHttpInfo(Long userId, SubAccountKey subAccountKey) throws ApiException { okhttp3.Call localVarCall = createSubAccountKeysValidateBeforeCall(userId, subAccountKey, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create API Key of the sub-account (asynchronously) + * Create new sub-account API key pair (asynchronously) * - * @param userId Sub-account user id (required) + * @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 @@ -621,27 +622,27 @@ public ApiResponse> createSubAccountKeysWithHttpInfo(Long us * @http.response.details - +
    Status Code Description Response Headers
    200 Created Successfully -
    200 Created successfully -
    */ - public okhttp3.Call createSubAccountKeysAsync(Long userId, SubAccountKey subAccountKey, final ApiCallback> _callback) throws ApiException { + 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(); + 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 The API Key of the sub-account (required) + * @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 Successful -
    200 Successfully retrieved -
    */ public okhttp3.Call getSubAccountKeyCall(Integer userId, String key, final ApiCallback _callback) throws ApiException { @@ -692,16 +693,16 @@ private okhttp3.Call getSubAccountKeyValidateBeforeCall(Integer userId, String k } /** - * Get the API Key of the sub-account + * Get specific API key pair of the sub-account * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 Successful -
    200 Successfully retrieved -
    */ public SubAccountKey getSubAccountKey(Integer userId, String key) throws ApiException { @@ -710,16 +711,16 @@ public SubAccountKey getSubAccountKey(Integer userId, String key) throws ApiExce } /** - * Get the API Key of the sub-account + * Get specific API key pair of the sub-account * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 Successful -
    200 Successfully retrieved -
    */ public ApiResponse getSubAccountKeyWithHttpInfo(Integer userId, String key) throws ApiException { @@ -729,17 +730,17 @@ public ApiResponse getSubAccountKeyWithHttpInfo(Integer userId, S } /** - * Get the API Key of the sub-account (asynchronously) + * Get specific API key pair of the sub-account (asynchronously) * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 Successful -
    200 Successfully retrieved -
    */ public okhttp3.Call getSubAccountKeyAsync(Integer userId, String key, final ApiCallback _callback) throws ApiException { @@ -751,8 +752,8 @@ public okhttp3.Call getSubAccountKeyAsync(Integer userId, String key, final ApiC /** * Build call for updateSubAccountKeys - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 @@ -760,7 +761,7 @@ public okhttp3.Call getSubAccountKeyAsync(Integer userId, String key, final ApiC * @http.response.details - +
    Status Code Description Response Headers
    204 Updated -
    204 Updated successfully -
    */ public okhttp3.Call updateSubAccountKeysCall(Integer userId, String key, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { @@ -816,16 +817,16 @@ private okhttp3.Call updateSubAccountKeysValidateBeforeCall(Integer userId, Stri } /** - * Update API key of the sub-account + * Update sub-account API key pair * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 -
    204 Updated successfully -
    */ public void updateSubAccountKeys(Integer userId, String key, SubAccountKey subAccountKey) throws ApiException { @@ -833,17 +834,17 @@ public void updateSubAccountKeys(Integer userId, String key, SubAccountKey subAc } /** - * Update API key of the sub-account + * Update sub-account API key pair * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 -
    204 Updated successfully -
    */ public ApiResponse updateSubAccountKeysWithHttpInfo(Integer userId, String key, SubAccountKey subAccountKey) throws ApiException { @@ -852,10 +853,10 @@ public ApiResponse updateSubAccountKeysWithHttpInfo(Integer userId, String } /** - * Update API key of the sub-account (asynchronously) + * Update sub-account API key pair (asynchronously) * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 @@ -863,7 +864,7 @@ public ApiResponse updateSubAccountKeysWithHttpInfo(Integer userId, String * @http.response.details - +
    Status Code Description Response Headers
    204 Updated -
    204 Updated successfully -
    */ public okhttp3.Call updateSubAccountKeysAsync(Integer userId, String key, SubAccountKey subAccountKey, final ApiCallback _callback) throws ApiException { @@ -874,15 +875,15 @@ public okhttp3.Call updateSubAccountKeysAsync(Integer userId, String key, SubAcc /** * Build call for deleteSubAccountKeys - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 Delete successfully -
    204 Deleted successfully -
    */ public okhttp3.Call deleteSubAccountKeysCall(Integer userId, String key, final ApiCallback _callback) throws ApiException { @@ -933,15 +934,15 @@ private okhttp3.Call deleteSubAccountKeysValidateBeforeCall(Integer userId, Stri } /** - * Delete API key of the sub-account + * Delete sub-account API key pair * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 Delete successfully -
    204 Deleted successfully -
    */ public void deleteSubAccountKeys(Integer userId, String key) throws ApiException { @@ -949,16 +950,16 @@ public void deleteSubAccountKeys(Integer userId, String key) throws ApiException } /** - * Delete API key of the sub-account + * Delete sub-account API key pair * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 Delete successfully -
    204 Deleted successfully -
    */ public ApiResponse deleteSubAccountKeysWithHttpInfo(Integer userId, String key) throws ApiException { @@ -967,17 +968,17 @@ public ApiResponse deleteSubAccountKeysWithHttpInfo(Integer userId, String } /** - * Delete API key of the sub-account (asynchronously) + * Delete sub-account API key pair (asynchronously) * - * @param userId Sub-account user id (required) - * @param key The API Key of the sub-account (required) + * @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 Delete successfully -
    204 Deleted successfully -
    */ public okhttp3.Call deleteSubAccountKeysAsync(Integer userId, String key, final ApiCallback _callback) throws ApiException { @@ -988,14 +989,14 @@ public okhttp3.Call deleteSubAccountKeysAsync(Integer userId, String key, final /** * Build call for lockSubAccount - * @param userId The user id of the sub-account (required) + * @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 Lock successfully -
    204 Locked successfully -
    */ public okhttp3.Call lockSubAccountCall(Long userId, final ApiCallback _callback) throws ApiException { @@ -1040,14 +1041,14 @@ private okhttp3.Call lockSubAccountValidateBeforeCall(Long userId, final ApiCall } /** - * Lock the sub-account + * Lock sub-account * - * @param userId The user id of the sub-account (required) + * @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 Lock successfully -
    204 Locked successfully -
    */ public void lockSubAccount(Long userId) throws ApiException { @@ -1055,15 +1056,15 @@ public void lockSubAccount(Long userId) throws ApiException { } /** - * Lock the sub-account + * Lock sub-account * - * @param userId The user id of the sub-account (required) + * @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 Lock successfully -
    204 Locked successfully -
    */ public ApiResponse lockSubAccountWithHttpInfo(Long userId) throws ApiException { @@ -1072,16 +1073,16 @@ public ApiResponse lockSubAccountWithHttpInfo(Long userId) throws ApiExcep } /** - * Lock the sub-account (asynchronously) + * Lock sub-account (asynchronously) * - * @param userId The user id of the sub-account (required) + * @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 Lock successfully -
    204 Locked successfully -
    */ public okhttp3.Call lockSubAccountAsync(Long userId, final ApiCallback _callback) throws ApiException { @@ -1092,14 +1093,14 @@ public okhttp3.Call lockSubAccountAsync(Long userId, final ApiCallback _ca /** * Build call for unlockSubAccount - * @param userId The user id of the sub-account (required) + * @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 Unlock successfully -
    204 Unlocked successfully -
    */ public okhttp3.Call unlockSubAccountCall(Long userId, final ApiCallback _callback) throws ApiException { @@ -1144,14 +1145,14 @@ private okhttp3.Call unlockSubAccountValidateBeforeCall(Long userId, final ApiCa } /** - * Unlock the sub-account + * Unlock sub-account * - * @param userId The user id of the sub-account (required) + * @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 Unlock successfully -
    204 Unlocked successfully -
    */ public void unlockSubAccount(Long userId) throws ApiException { @@ -1159,15 +1160,15 @@ public void unlockSubAccount(Long userId) throws ApiException { } /** - * Unlock the sub-account + * Unlock sub-account * - * @param userId The user id of the sub-account (required) + * @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 Unlock successfully -
    204 Unlocked successfully -
    */ public ApiResponse unlockSubAccountWithHttpInfo(Long userId) throws ApiException { @@ -1176,16 +1177,16 @@ public ApiResponse unlockSubAccountWithHttpInfo(Long userId) throws ApiExc } /** - * Unlock the sub-account (asynchronously) + * Unlock sub-account (asynchronously) * - * @param userId The user id of the sub-account (required) + * @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 Unlock successfully -
    204 Unlocked successfully -
    */ public okhttp3.Call unlockSubAccountAsync(Long userId, final ApiCallback _callback) throws ApiException { @@ -1194,4 +1195,102 @@ public okhttp3.Call unlockSubAccountAsync(Long userId, final ApiCallback _ 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 f7f44e7..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,21 +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; @@ -70,7 +77,7 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
    Status Code Description Response Headers
    200 Successfully retrieved -
    200 Query successful -
    */ public okhttp3.Call listCurrencyChainsCall(String currency, final ApiCallback _callback) throws ApiException { @@ -118,7 +125,7 @@ private okhttp3.Call listCurrencyChainsValidateBeforeCall(String currency, final } /** - * List chains supported for specified currency + * Query chains supported for specified currency * * @param currency Currency name (required) * @return List<CurrencyChain> @@ -126,7 +133,7 @@ private okhttp3.Call listCurrencyChainsValidateBeforeCall(String currency, final * @http.response.details - +
    Status Code Description Response Headers
    200 Successfully retrieved -
    200 Query successful -
    */ public List listCurrencyChains(String currency) throws ApiException { @@ -135,7 +142,7 @@ public List listCurrencyChains(String currency) throws ApiExcepti } /** - * List chains supported for specified currency + * Query chains supported for specified currency * * @param currency Currency name (required) * @return ApiResponse<List<CurrencyChain>> @@ -143,7 +150,7 @@ public List listCurrencyChains(String currency) throws ApiExcepti * @http.response.details - +
    Status Code Description Response Headers
    200 Successfully retrieved -
    200 Query successful -
    */ public ApiResponse> listCurrencyChainsWithHttpInfo(String currency) throws ApiException { @@ -153,7 +160,7 @@ public ApiResponse> listCurrencyChainsWithHttpInfo(String cu } /** - * List chains supported for specified currency (asynchronously) + * Query chains supported for specified currency (asynchronously) * * @param currency Currency name (required) * @param _callback The callback to be executed when the API call finishes @@ -162,7 +169,7 @@ public ApiResponse> listCurrencyChainsWithHttpInfo(String cu * @http.response.details - +
    Status Code Description Response Headers
    200 Successfully retrieved -
    200 Query successful -
    */ public okhttp3.Call listCurrencyChainsAsync(String currency, final ApiCallback> _callback) throws ApiException { @@ -283,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; @@ -364,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) { @@ -372,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) { @@ -384,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) { @@ -394,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) { @@ -420,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); } /** @@ -464,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() { @@ -542,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; } @@ -567,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) { @@ -577,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) { @@ -587,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) { @@ -597,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) { @@ -623,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 { @@ -632,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); } @@ -667,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() { @@ -698,7 +750,7 @@ public APIlistDepositsRequest listDeposits() { * @http.response.details - +
    Status Code Description Response Headers
    200 Balance transferred -
    200 Transfer operation successful -
    */ public okhttp3.Call transferCall(Transfer transfer, final ApiCallback _callback) throws ApiException { @@ -743,14 +795,14 @@ 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 5. spot - options + * 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
    200 Balance transferred -
    200 Transfer operation successful -
    */ public TransactionID transfer(Transfer transfer) throws ApiException { @@ -760,14 +812,14 @@ public TransactionID transfer(Transfer transfer) throws ApiException { /** * 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 5. spot - options + * 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<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 Balance transferred -
    200 Transfer operation successful -
    */ public ApiResponse transferWithHttpInfo(Transfer transfer) throws ApiException { @@ -778,7 +830,7 @@ public ApiResponse transferWithHttpInfo(Transfer transfer) throws /** * 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 5. spot - options + * 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 @@ -786,7 +838,7 @@ public ApiResponse transferWithHttpInfo(Transfer transfer) throws * @http.response.details - +
    Status Code Description Response Headers
    200 Balance transferred -
    200 Transfer operation successful -
    */ public okhttp3.Call transferAsync(Transfer transfer, final ApiCallback _callback) throws ApiException { @@ -852,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; } @@ -877,7 +929,7 @@ private APIlistSubAccountTransfersRequest() { /** * Set subUid - * @param subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (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) { @@ -887,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) { @@ -897,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) { @@ -907,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) { @@ -933,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 { @@ -942,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); } @@ -977,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() { @@ -1008,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 { @@ -1023,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) { @@ -1053,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 @@ -1093,12 +1148,13 @@ 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; } @@ -1111,7 +1167,7 @@ public okhttp3.Call transferWithSubAccountAsync(SubAccountTransfer subAccountTra * @http.response.details - +
    Status Code Description Response Headers
    204 Balance transferred -
    200 Transfer operation successful -
    */ public okhttp3.Call subAccountToSubAccountCall(SubAccountToSubAccount subAccountToSubAccount, final ApiCallback _callback) throws ApiException { @@ -1126,7 +1182,7 @@ public okhttp3.Call subAccountToSubAccountCall(SubAccountToSubAccount subAccount Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1155,40 +1211,43 @@ private okhttp3.Call subAccountToSubAccountValidateBeforeCall(SubAccountToSubAcc } /** - * Sub-account transfers to sub-account - * It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer. + * 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
    204 Balance transferred -
    200 Transfer operation successful -
    */ - public void subAccountToSubAccount(SubAccountToSubAccount subAccountToSubAccount) throws ApiException { - subAccountToSubAccountWithHttpInfo(subAccountToSubAccount); + public TransactionID subAccountToSubAccount(SubAccountToSubAccount subAccountToSubAccount) throws ApiException { + ApiResponse localVarResp = subAccountToSubAccountWithHttpInfo(subAccountToSubAccount); + return localVarResp.getData(); } /** - * Sub-account transfers to sub-account - * It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer. + * 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<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 subAccountToSubAccountWithHttpInfo(SubAccountToSubAccount subAccountToSubAccount) throws ApiException { + public ApiResponse subAccountToSubAccountWithHttpInfo(SubAccountToSubAccount subAccountToSubAccount) throws ApiException { okhttp3.Call localVarCall = subAccountToSubAccountValidateBeforeCall(subAccountToSubAccount, null); - return localVarApiClient.execute(localVarCall); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Sub-account transfers to sub-account (asynchronously) - * It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer. + * 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 @@ -1196,15 +1255,174 @@ public ApiResponse subAccountToSubAccountWithHttpInfo(SubAccountToSubAccou * @http.response.details - +
    Status Code Description Response Headers
    204 Balance transferred -
    200 Transfer operation successful -
    */ - public okhttp3.Call subAccountToSubAccountAsync(SubAccountToSubAccount subAccountToSubAccount, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subAccountToSubAccountAsync(SubAccountToSubAccount subAccountToSubAccount, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = subAccountToSubAccountValidateBeforeCall(subAccountToSubAccount, _callback); - localVarApiClient.executeAsync(localVarCall, _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/order_status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + 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(); + 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 getTransferOrderStatusValidateBeforeCall(String clientOrderId, String txId, final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getTransferOrderStatusCall(clientOrderId, txId, _callback); + return localVarCall; + } + + + 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 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 APIgetTransferOrderStatusRequest { + private String clientOrderId; + private String txId; + + private APIgetTransferOrderStatusRequest() { + } + + /** + * 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 APIgetTransferOrderStatusRequest clientOrderId(String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * 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 Transfer status retrieved successfully -
    + */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTransferOrderStatusCall(clientOrderId, txId, _callback); + } + + /** + * 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 Transfer status retrieved successfully -
    + */ + public TransferOrderStatus execute() throws ApiException { + ApiResponse localVarResp = getTransferOrderStatusWithHttpInfo(clientOrderId, txId); + return localVarResp.getData(); + } + + /** + * 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 Transfer status retrieved successfully -
    + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTransferOrderStatusWithHttpInfo(clientOrderId, txId); + } + + /** + * 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 Transfer status retrieved successfully -
    + */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTransferOrderStatusAsync(clientOrderId, txId, _callback); + } + } + + /** + * 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 Transfer status retrieved successfully -
    + */ + public APIgetTransferOrderStatusRequest getTransferOrderStatus() { + return new APIgetTransferOrderStatusRequest(); + } + private okhttp3.Call listWithdrawStatusCall(String currency, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; @@ -1266,7 +1484,7 @@ private APIlistWithdrawStatusRequest() { /** * Set currency - * @param currency Retrieve data of the specified currency (optional) + * @param currency Query by specified currency name (optional) * @return APIlistWithdrawStatusRequest */ public APIlistWithdrawStatusRequest currency(String currency) { @@ -1282,7 +1500,7 @@ public APIlistWithdrawStatusRequest 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 { @@ -1296,7 +1514,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 { @@ -1311,7 +1529,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 { @@ -1326,7 +1544,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 { @@ -1335,13 +1553,13 @@ public okhttp3.Call executeAsync(final ApiCallback> _callba } /** - * Retrieve withdrawal status + * Query withdrawal status * * @return APIlistWithdrawStatusRequest * @http.response.details - +
    Status Code Description Response Headers
    200 List retrieved -
    200 List retrieved successfully -
    */ public APIlistWithdrawStatusRequest listWithdrawStatus() { @@ -1409,7 +1627,7 @@ private APIlistSubAccountBalancesRequest() { /** * Set subUid - * @param subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (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) { @@ -1425,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 { @@ -1439,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 { @@ -1454,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 { @@ -1469,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 { @@ -1478,13 +1696,13 @@ 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() { @@ -1552,7 +1770,7 @@ private APIlistSubAccountMarginBalancesRequest() { /** * Set subUid - * @param subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (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 APIlistSubAccountMarginBalancesRequest */ public APIlistSubAccountMarginBalancesRequest subUid(String subUid) { @@ -1568,7 +1786,7 @@ public APIlistSubAccountMarginBalancesRequest 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 { @@ -1582,7 +1800,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 { @@ -1597,7 +1815,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 { @@ -1612,7 +1830,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 { @@ -1621,13 +1839,13 @@ public okhttp3.Call executeAsync(final ApiCallback } /** - * Query sub accounts' margin balances + * Query sub-account isolated margin account balance information * * @return APIlistSubAccountMarginBalancesRequest * @http.response.details - +
    Status Code Description Response Headers
    200 List retrieved -
    200 List retrieved successfully -
    */ public APIlistSubAccountMarginBalancesRequest listSubAccountMarginBalances() { @@ -1700,7 +1918,7 @@ private APIlistSubAccountFuturesBalancesRequest() { /** * Set subUid - * @param subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (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 APIlistSubAccountFuturesBalancesRequest */ public APIlistSubAccountFuturesBalancesRequest subUid(String subUid) { @@ -1710,7 +1928,7 @@ public APIlistSubAccountFuturesBalancesRequest subUid(String subUid) { /** * Set settle - * @param settle Query only balances of specified settle currency (optional) + * @param settle Query balance of specified settlement currency (optional) * @return APIlistSubAccountFuturesBalancesRequest */ public APIlistSubAccountFuturesBalancesRequest settle(String settle) { @@ -1726,7 +1944,7 @@ public APIlistSubAccountFuturesBalancesRequest settle(String settle) { * @http.response.details - +
    Status Code Description Response Headers
    200 List retrieved -
    200 List retrieved successfully -
    */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -1740,7 +1958,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 { @@ -1755,7 +1973,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 { @@ -1770,7 +1988,7 @@ public ApiResponse> executeWithHttpInfo() throws * @http.response.details - +
    Status Code Description Response Headers
    200 List retrieved -
    200 List retrieved successfully -
    */ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1779,13 +1997,13 @@ public okhttp3.Call executeAsync(final ApiCallback Status Code Description Response Headers - 200 List retrieved - + 200 List retrieved successfully - */ public APIlistSubAccountFuturesBalancesRequest listSubAccountFuturesBalances() { @@ -1853,7 +2071,7 @@ private APIlistSubAccountCrossMarginBalancesRequest() { /** * Set subUid - * @param subUid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (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 APIlistSubAccountCrossMarginBalancesRequest */ public APIlistSubAccountCrossMarginBalancesRequest subUid(String subUid) { @@ -1869,7 +2087,7 @@ public APIlistSubAccountCrossMarginBalancesRequest 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 { @@ -1883,7 +2101,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 { @@ -1898,7 +2116,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 { @@ -1913,7 +2131,7 @@ public ApiResponse> executeWithHttpInfo() thr * @http.response.details - +
    Status Code Description Response Headers
    200 List retrieved -
    200 List retrieved successfully -
    */ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { @@ -1922,20 +2140,20 @@ public okhttp3.Call executeAsync(final ApiCallback Status Code Description Response Headers - 200 List retrieved - + 200 List retrieved successfully - */ public APIlistSubAccountCrossMarginBalancesRequest listSubAccountCrossMarginBalances() { return new APIlistSubAccountCrossMarginBalancesRequest(); } - private okhttp3.Call listSavedAddressCall(String currency, String chain, String limit, final ApiCallback _callback) throws ApiException { + 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 @@ -1955,6 +2173,10 @@ private okhttp3.Call listSavedAddressCall(String currency, String chain, String 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(); @@ -1977,25 +2199,25 @@ private okhttp3.Call listSavedAddressCall(String currency, String chain, String } @SuppressWarnings("rawtypes") - private okhttp3.Call listSavedAddressValidateBeforeCall(String currency, String chain, String limit, final ApiCallback _callback) throws ApiException { + 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, _callback); + okhttp3.Call localVarCall = listSavedAddressCall(currency, chain, limit, page, _callback); return localVarCall; } - private ApiResponse> listSavedAddressWithHttpInfo(String currency, String chain, String limit) throws ApiException { - okhttp3.Call localVarCall = listSavedAddressValidateBeforeCall(currency, chain, limit, null); + 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, final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = listSavedAddressValidateBeforeCall(currency, chain, limit, _callback); + 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; @@ -2005,6 +2227,7 @@ public class APIlistSavedAddressRequest { private final String currency; private String chain; private String limit; + private Integer page; private APIlistSavedAddressRequest(String currency) { this.currency = currency; @@ -2022,7 +2245,7 @@ public APIlistSavedAddressRequest chain(String chain) { /** * Set limit - * @param limit Maximum number returned, 100 at most (optional, default to "50") + * @param limit Maximum number returned, up to 100 (optional, default to "50") * @return APIlistSavedAddressRequest */ public APIlistSavedAddressRequest limit(String limit) { @@ -2030,6 +2253,16 @@ public APIlistSavedAddressRequest limit(String 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 @@ -2038,11 +2271,11 @@ public APIlistSavedAddressRequest limit(String 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 listSavedAddressCall(currency, chain, limit, _callback); + return listSavedAddressCall(currency, chain, limit, page, _callback); } /** @@ -2052,11 +2285,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 = listSavedAddressWithHttpInfo(currency, chain, limit); + ApiResponse> localVarResp = listSavedAddressWithHttpInfo(currency, chain, limit, page); return localVarResp.getData(); } @@ -2067,11 +2300,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 listSavedAddressWithHttpInfo(currency, chain, limit); + return listSavedAddressWithHttpInfo(currency, chain, limit, page); } /** @@ -2082,23 +2315,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 listSavedAddressAsync(currency, chain, limit, _callback); + return listSavedAddressAsync(currency, chain, limit, page, _callback); } } /** - * Query saved address + * Query withdrawal address whitelist * * @param currency Currency (required) * @return APIlistSavedAddressRequest * @http.response.details - +
    Status Code Description Response Headers
    200 List retrieved -
    200 List retrieved successfully -
    */ public APIlistSavedAddressRequest listSavedAddress(String currency) { @@ -2171,7 +2404,7 @@ private APIgetTradeFeeRequest() { /** * 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 APIgetTradeFeeRequest */ public APIgetTradeFeeRequest currencyPair(String currencyPair) { @@ -2181,7 +2414,7 @@ public APIgetTradeFeeRequest currencyPair(String currencyPair) { /** * Set settle - * @param settle Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. (optional) + * @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) { @@ -2197,7 +2430,7 @@ public APIgetTradeFeeRequest settle(String settle) { * @http.response.details - +
    Status Code Description Response Headers
    200 Successfully retrieved -
    200 Query successful -
    */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2211,7 +2444,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 TradeFee execute() throws ApiException { @@ -2226,7 +2459,7 @@ public TradeFee execute() throws ApiException { * @http.response.details - +
    Status Code Description Response Headers
    200 Successfully retrieved -
    200 Query successful -
    */ public ApiResponse executeWithHttpInfo() throws ApiException { @@ -2241,7 +2474,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 { @@ -2250,13 +2483,13 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throws A } /** - * Retrieve personal trading fee + * Query personal trading fees * * @return APIgetTradeFeeRequest * @http.response.details - +
    Status Code Description Response Headers
    200 Successfully retrieved -
    200 Query successful -
    */ public APIgetTradeFeeRequest getTradeFee() { @@ -2324,7 +2557,7 @@ private APIgetTotalBalanceRequest() { /** * 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") + * @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) { @@ -2340,7 +2573,7 @@ public APIgetTotalBalanceRequest currency(String currency) { * @http.response.details - +
    Status Code Description Response Headers
    200 Request is valid and is successfully responded -
    200 Request is valid and successfully returned -
    */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { @@ -2354,7 +2587,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { * @http.response.details - +
    Status Code Description Response Headers
    200 Request is valid and is successfully responded -
    200 Request is valid and successfully returned -
    */ public TotalBalance execute() throws ApiException { @@ -2369,7 +2602,7 @@ public TotalBalance execute() throws ApiException { * @http.response.details - +
    Status Code Description Response Headers
    200 Request is valid and is successfully responded -
    200 Request is valid and successfully returned -
    */ public ApiResponse executeWithHttpInfo() throws ApiException { @@ -2384,7 +2617,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { * @http.response.details - +
    Status Code Description Response Headers
    200 Request is valid and is successfully responded -
    200 Request is valid and successfully returned -
    */ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { @@ -2393,17 +2626,609 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) thro } /** - * Retrieve user's total balances - * This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation. For trading calculation, use the corresponding account query endpoint for each account type. For example: - `GET /spot/accounts` to query spot account balance - `GET /margin/accounts` to query margin account balance - `GET /futures/{settle}/accounts` to query futures account balance + * 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 is successfully responded -
    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 index 2462551..a54edce 100644 --- a/src/main/java/io/gate/gateapi/models/AccountDetail.java +++ b/src/main/java/io/gate/gateapi/models/AccountDetail.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,7 +23,7 @@ import java.util.List; /** - * Account detail + * Account details */ public class AccountDetail { public static final String SERIALIZED_NAME_IP_WHITELIST = "ip_whitelist"; @@ -38,10 +38,18 @@ public class AccountDetail { @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) { @@ -58,7 +66,7 @@ public AccountDetail addIpWhitelistItem(String ipWhitelistItem) { } /** - * IP whitelist + * IP Whitelist * @return ipWhitelist **/ @javax.annotation.Nullable @@ -86,7 +94,7 @@ public AccountDetail addCurrencyPairsItem(String currencyPairsItem) { } /** - * CurrencyPair whitelisting + * Trading pair whitelist * @return currencyPairs **/ @javax.annotation.Nullable @@ -119,6 +127,26 @@ 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; @@ -138,6 +166,26 @@ public AccountDetailKey getKey() { 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) { @@ -150,12 +198,14 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.ipWhitelist, accountDetail.ipWhitelist) && Objects.equals(this.currencyPairs, accountDetail.currencyPairs) && Objects.equals(this.userId, accountDetail.userId) && - Objects.equals(this.key, accountDetail.key); + 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, key); + return Objects.hash(ipWhitelist, currencyPairs, userId, tier, key, copyTradingRole); } @@ -166,7 +216,9 @@ public String toString() { 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(); } diff --git a/src/main/java/io/gate/gateapi/models/AccountDetailKey.java b/src/main/java/io/gate/gateapi/models/AccountDetailKey.java index f4c0041..6a329b8 100644 --- a/src/main/java/io/gate/gateapi/models/AccountDetailKey.java +++ b/src/main/java/io/gate/gateapi/models/AccountDetailKey.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; /** - * API Key detail + * API Key details */ public class AccountDetailKey { public static final String SERIALIZED_NAME_MODE = "mode"; @@ -35,7 +35,7 @@ public AccountDetailKey mode(Integer mode) { } /** - * mode: 1 - classic account 2 - portfolio margin account + * Mode: 1 - Classic mode, 2 - Legacy unified mode * @return mode **/ @javax.annotation.Nullable 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 index cd6afab..787fe67 100644 --- a/src/main/java/io/gate/gateapi/models/AgencyCommission.java +++ b/src/main/java/io/gate/gateapi/models/AgencyCommission.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 @@ -55,7 +55,7 @@ public AgencyCommission commissionTime(Long commissionTime) { } /** - * Commission Time. (unix timestamp) + * Commission time (Unix timestamp in seconds) * @return commissionTime **/ @javax.annotation.Nullable @@ -115,7 +115,7 @@ public AgencyCommission commissionAmount(String commissionAmount) { } /** - * Commission Amount + * Transaction amount * @return commissionAmount **/ @javax.annotation.Nullable @@ -155,7 +155,7 @@ public AgencyCommission source(String source) { } /** - * Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate + * Commission source: SPOT - Spot commission, FUTURES - Futures commission * @return source **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/AgencyCommissionHistory.java b/src/main/java/io/gate/gateapi/models/AgencyCommissionHistory.java index 81fe624..957a770 100644 --- a/src/main/java/io/gate/gateapi/models/AgencyCommissionHistory.java +++ b/src/main/java/io/gate/gateapi/models/AgencyCommissionHistory.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 @@ -94,7 +94,7 @@ public AgencyCommissionHistory addListItem(AgencyCommission listItem) { } /** - * List of comission history + * List of commission history * @return list **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/AgencyTransaction.java b/src/main/java/io/gate/gateapi/models/AgencyTransaction.java index 0938911..56eb68c 100644 --- a/src/main/java/io/gate/gateapi/models/AgencyTransaction.java +++ b/src/main/java/io/gate/gateapi/models/AgencyTransaction.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 @@ -187,7 +187,7 @@ public AgencyTransaction amount(String amount) { } /** - * Commission Amount + * Transaction amount * @return amount **/ @javax.annotation.Nullable @@ -227,7 +227,7 @@ public AgencyTransaction source(String source) { } /** - * Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate + * Commission source: SPOT - Spot commission, FUTURES - Futures commission * @return source **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/AgencyTransactionHistory.java b/src/main/java/io/gate/gateapi/models/AgencyTransactionHistory.java index 36e84ae..6dce95a 100644 --- a/src/main/java/io/gate/gateapi/models/AgencyTransactionHistory.java +++ b/src/main/java/io/gate/gateapi/models/AgencyTransactionHistory.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/AmendOrderResult.java b/src/main/java/io/gate/gateapi/models/AmendOrderResult.java deleted file mode 100644 index 8e5a063..0000000 --- a/src/main/java/io/gate/gateapi/models/AmendOrderResult.java +++ /dev/null @@ -1,191 +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; - -/** - * Batch order modification results - */ -public class AmendOrderResult { - public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; - @SerializedName(SERIALIZED_NAME_ORDER_ID) - private String orderId; - - 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_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_ACCOUNT = "account"; - @SerializedName(SERIALIZED_NAME_ACCOUNT) - private String account; - - - /** - * Order ID - * @return orderId - **/ - @javax.annotation.Nullable - public String getOrderId() { - return orderId; - } - - - /** - * Trade amount - * @return amount - **/ - @javax.annotation.Nullable - public String getAmount() { - return amount; - } - - - /** - * Order price - * @return price - **/ - @javax.annotation.Nullable - public String getPrice() { - return price; - } - - - /** - * The custom data that the user remarked when amending the order - * @return amendText - **/ - @javax.annotation.Nullable - public String getAmendText() { - return amendText; - } - - - /** - * Update success status - * @return succeeded - **/ - @javax.annotation.Nullable - public Boolean getSucceeded() { - return succeeded; - } - - - /** - * Error indicator for failed modifications; empty when successful - * @return label - **/ - @javax.annotation.Nullable - public String getLabel() { - return label; - } - - - /** - * Error description for failed modifications; empty when successful - * @return message - **/ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - - /** - * Account types, spot - spot account, margin - margin account, portfolio - portfolio margin account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` - * @return account - **/ - @javax.annotation.Nullable - public String getAccount() { - return account; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AmendOrderResult amendOrderResult = (AmendOrderResult) o; - return Objects.equals(this.orderId, amendOrderResult.orderId) && - Objects.equals(this.amount, amendOrderResult.amount) && - Objects.equals(this.price, amendOrderResult.price) && - Objects.equals(this.amendText, amendOrderResult.amendText) && - Objects.equals(this.succeeded, amendOrderResult.succeeded) && - Objects.equals(this.label, amendOrderResult.label) && - Objects.equals(this.message, amendOrderResult.message) && - Objects.equals(this.account, amendOrderResult.account); - } - - @Override - public int hashCode() { - return Objects.hash(orderId, amount, price, amendText, succeeded, label, message, account); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AmendOrderResult {\n"); - sb.append(" orderId: ").append(toIndentedString(orderId)).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(" succeeded: ").append(toIndentedString(succeeded)).append("\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" account: ").append(toIndentedString(account)).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/ApiV4KeyPerm.java b/src/main/java/io/gate/gateapi/models/ApiV4KeyPerm.java deleted file mode 100644 index 39d96ce..0000000 --- a/src/main/java/io/gate/gateapi/models/ApiV4KeyPerm.java +++ /dev/null @@ -1,176 +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; - -/** - * ApiV4KeyPerm - */ -public class ApiV4KeyPerm { - /** - * Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options- account: Account - portfolio: Portfolio - loan: Loan - */ - @JsonAdapter(NameEnum.Adapter.class) - public enum NameEnum { - WALLET("wallet"), - - SPOT("spot"), - - FUTURES("futures"), - - DELIVERY("delivery"), - - EARN("earn"), - - OPTIONS("options"), - - ACCOUNT("account"), - - PORTFOLIO("portfolio"), - - LOAN("loan"); - - private String value; - - NameEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static NameEnum fromValue(String value) { - for (NameEnum b : NameEnum.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 NameEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public NameEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return NameEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private NameEnum name; - - public static final String SERIALIZED_NAME_READ_ONLY = "read_only"; - @SerializedName(SERIALIZED_NAME_READ_ONLY) - private Boolean readOnly; - - - public ApiV4KeyPerm name(NameEnum name) { - - this.name = name; - return this; - } - - /** - * Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options- account: Account - portfolio: Portfolio - loan: Loan - * @return name - **/ - @javax.annotation.Nullable - public NameEnum getName() { - return name; - } - - - public void setName(NameEnum name) { - this.name = name; - } - - public ApiV4KeyPerm 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; - } - ApiV4KeyPerm apiV4KeyPerm = (ApiV4KeyPerm) o; - return Objects.equals(this.name, apiV4KeyPerm.name) && - Objects.equals(this.readOnly, apiV4KeyPerm.readOnly); - } - - @Override - public int hashCode() { - return Objects.hash(name, readOnly); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiV4KeyPerm {\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/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 index dc4ec24..258e946 100644 --- a/src/main/java/io/gate/gateapi/models/BatchAmendItem.java +++ b/src/main/java/io/gate/gateapi/models/BatchAmendItem.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 BatchAmendItem { @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) { @@ -55,7 +59,7 @@ public BatchAmendItem orderId(String orderId) { } /** - * The order ID returned upon successful creation or the custom ID specified by the user during creation (i.e., the 'text' field). + * 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() { @@ -93,7 +97,7 @@ public BatchAmendItem account(String account) { } /** - * Default to spot, portfolio, and margin accounts if not specified. Use 'cross_margin' to query cross margin accounts. Only 'cross_margin' can be specified for portfolio margin accounts. + * Default spot, unified account and warehouse-by-store leverage account * @return account **/ @javax.annotation.Nullable @@ -113,7 +117,7 @@ public BatchAmendItem amount(String amount) { } /** - * trade amount, only one of amount and price can be specified + * Trading Quantity. Only one of `amount` or `price` can be specified * @return amount **/ @javax.annotation.Nullable @@ -133,7 +137,7 @@ public BatchAmendItem price(String price) { } /** - * trade price, only one of amount and price can be specified + * Trading Price. Only one of `amount` or `price` can be specified * @return price **/ @javax.annotation.Nullable @@ -153,7 +157,7 @@ public BatchAmendItem amendText(String amendText) { } /** - * Custom info during amending order + * Custom info during order amendment * @return amendText **/ @javax.annotation.Nullable @@ -165,6 +169,26 @@ public String getAmendText() { 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) { @@ -179,12 +203,13 @@ public boolean equals(java.lang.Object o) { 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.amendText, batchAmendItem.amendText) && + Objects.equals(this.actionMode, batchAmendItem.actionMode); } @Override public int hashCode() { - return Objects.hash(orderId, currencyPair, account, amount, price, amendText); + return Objects.hash(orderId, currencyPair, account, amount, price, amendText, actionMode); } @@ -198,6 +223,7 @@ public String toString() { 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(); } 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 index 03c58b9..15649ba 100644 --- a/src/main/java/io/gate/gateapi/models/BatchFuturesOrder.java +++ b/src/main/java/io/gate/gateapi/models/BatchFuturesOrder.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 @@ -52,7 +52,7 @@ public class BatchFuturesOrder { 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 - stp: cancelled because self trade prevention + * 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 { @@ -117,7 +117,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 { @@ -334,7 +334,7 @@ public AutoSizeEnum read(final JsonReader jsonReader) throws IOException { private AutoSizeEnum autoSize; /** - * 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 { @@ -400,7 +400,7 @@ public BatchFuturesOrder succeeded(Boolean succeeded) { } /** - * Whether the batch of orders succeeded + * Request execution result * @return succeeded **/ @javax.annotation.Nullable @@ -494,7 +494,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 - stp: cancelled because self trade prevention + * 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 @@ -504,7 +504,7 @@ public FinishAsEnum getFinishAs() { /** - * Order status - `open`: waiting to be traded - `finished`: finished + * Order status - `open`: Pending - `finished`: Completed * @return status **/ @javax.annotation.Nullable @@ -540,7 +540,7 @@ public BatchFuturesOrder 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 **/ @javax.annotation.Nullable @@ -560,7 +560,7 @@ public BatchFuturesOrder 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 @@ -580,7 +580,7 @@ public BatchFuturesOrder 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 @@ -684,7 +684,7 @@ public void setTif(TifEnum tif) { } /** - * Size left to be traded + * Unfilled quantity * @return left **/ @javax.annotation.Nullable @@ -694,7 +694,7 @@ public Long getLeft() { /** - * Fill price of the order + * Fill price * @return fillPrice **/ @javax.annotation.Nullable @@ -744,7 +744,7 @@ public String getMkfr() { /** - * Reference user ID + * Referrer user ID * @return refu **/ @javax.annotation.Nullable @@ -780,7 +780,7 @@ public BatchFuturesOrder stpAct(StpActEnum stpAct) { } /** - * 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 diff --git a/src/main/java/io/gate/gateapi/models/BatchOrder.java b/src/main/java/io/gate/gateapi/models/BatchOrder.java index 82e43ea..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,7 +125,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private String currencyPair; /** - * Order Type - limit : Limit Order - market : Market Order + * Order Type - limit : Limit Order - market : Market Order */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -168,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, portfolio - portfolio account + * Account type, spot - spot account, margin - leveraged account, unified - unified account */ @JsonAdapter(AccountEnum.Adapter.class) public enum AccountEnum { @@ -178,7 +186,7 @@ public enum AccountEnum { CROSS_MARGIN("cross_margin"), - PORTFOLIO("portfolio"); + UNIFIED("unified"); private String value; @@ -223,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 { @@ -352,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; @@ -360,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; @@ -393,7 +409,7 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 { @@ -505,6 +521,46 @@ public FinishAsEnum read(final JsonReader jsonReader) throws IOException { 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) { this.text = text; @@ -512,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 @@ -532,7 +588,7 @@ public BatchOrder succeeded(Boolean succeeded) { } /** - * Whether the batch of orders succeeded + * Request execution result * @return succeeded **/ @javax.annotation.Nullable @@ -672,7 +728,7 @@ public BatchOrder type(TypeEnum type) { } /** - * Order Type - limit : Limit Order - market : Market Order + * Order Type - limit : Limit Order - market : Market Order * @return type **/ @javax.annotation.Nullable @@ -692,7 +748,7 @@ public BatchOrder account(AccountEnum account) { } /** - * Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, portfolio - portfolio account + * Account type, spot - spot account, margin - leveraged account, unified - unified account * @return account **/ @javax.annotation.Nullable @@ -712,7 +768,7 @@ public BatchOrder side(SideEnum side) { } /** - * Order side + * Buy or sell order * @return side **/ @javax.annotation.Nullable @@ -792,7 +848,7 @@ public BatchOrder iceberg(String iceberg) { } /** - * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. + * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported * @return iceberg **/ @javax.annotation.Nullable @@ -812,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 @@ -832,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 @@ -855,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 @@ -875,6 +941,16 @@ public String getFilledTotal() { } + /** + * Average fill price + * @return avgDealPrice + **/ + @javax.annotation.Nullable + public String getAvgDealPrice() { + return avgDealPrice; + } + + /** * Fee deducted * @return fee @@ -916,7 +992,7 @@ public String getGtFee() { /** - * Whether GT fee discount is used + * Whether GT fee deduction is enabled * @return gtDiscount **/ @javax.annotation.Nullable @@ -962,7 +1038,7 @@ public BatchOrder stpAct(StpActEnum stpAct) { } /** - * 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 @@ -993,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) && @@ -1014,8 +1092,10 @@ 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) && @@ -1030,7 +1110,7 @@ public boolean equals(java.lang.Object o) { @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, stpId, stpAct, finishAs); + 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); } @@ -1038,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"); @@ -1059,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"); 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/CancelBatchOrder.java b/src/main/java/io/gate/gateapi/models/CancelBatchOrder.java index b0ab61c..fd2ba0c 100644 --- a/src/main/java/io/gate/gateapi/models/CancelBatchOrder.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 @@ -35,6 +35,10 @@ public class CancelBatchOrder { @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 CancelBatchOrder currencyPair(String currencyPair) { @@ -81,7 +85,7 @@ public CancelBatchOrder account(String account) { } /** - * If cancelled order is cross margin order or is portfolio margin account's API key, this field must be set and can only be `cross_margin`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) { @@ -104,12 +128,13 @@ public boolean equals(java.lang.Object o) { 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.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); } @@ -120,6 +145,7 @@ public String toString() { 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/CancelOrder.java b/src/main/java/io/gate/gateapi/models/CancelOrder.java deleted file mode 100644 index c4efbd6..0000000 --- a/src/main/java/io/gate/gateapi/models/CancelOrder.java +++ /dev/null @@ -1,139 +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; - -/** - * Info of order to be cancelled - */ -public class CancelOrder { - public static final String SERIALIZED_NAME_CURRENCY_PAIR = "currency_pair"; - @SerializedName(SERIALIZED_NAME_CURRENCY_PAIR) - private String currencyPair; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_ACCOUNT = "account"; - @SerializedName(SERIALIZED_NAME_ACCOUNT) - private String account; - - - public CancelOrder currencyPair(String currencyPair) { - - this.currencyPair = currencyPair; - return this; - } - - /** - * Order currency pair - * @return currencyPair - **/ - public String getCurrencyPair() { - return currencyPair; - } - - - public void setCurrencyPair(String currencyPair) { - this.currencyPair = currencyPair; - } - - public CancelOrder id(String id) { - - this.id = id; - return this; - } - - /** - * Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation - * @return id - **/ - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - public CancelOrder account(String account) { - - this.account = account; - return this; - } - - /** - * If cancelled order is cross margin order or is portfolio margin account's API key, this field must be set and can only be `cross_margin`If cancelled order is cross margin order, this field must be set and can only be `cross_margin` - * @return account - **/ - @javax.annotation.Nullable - public String getAccount() { - return account; - } - - - public void setAccount(String account) { - this.account = account; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(currencyPair, id, account); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CancelOrder {\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("}"); - 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/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 index 3750cc3..19c02b9 100644 --- a/src/main/java/io/gate/gateapi/models/CollateralAlign.java +++ b/src/main/java/io/gate/gateapi/models/CollateralAlign.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 CollateralAlign collateralCurrency(String collateralCurrency) { } /** - * Collateral + * Collateral currency * @return collateralCurrency **/ public String getCollateralCurrency() { @@ -104,7 +104,7 @@ public CollateralAlign type(String type) { } /** - * Operation types: append - for adding collateral, redeem - for withdrawing collateral + * Operation type: append - add collateral, redeem - withdraw collateral * @return type **/ public String getType() { diff --git a/src/main/java/io/gate/gateapi/models/CollateralCurrency.java b/src/main/java/io/gate/gateapi/models/CollateralCurrency.java new file mode 100644 index 0000000..734c4bc --- /dev/null +++ b/src/main/java/io/gate/gateapi/models/CollateralCurrency.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; + +/** + * CollateralCurrency + */ +public class CollateralCurrency { + 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 CollateralCurrency 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 CollateralCurrency amount(String amount) { + + this.amount = amount; + return this; + } + + /** + * Size + * @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; + } + CollateralCurrency collateralCurrency = (CollateralCurrency) o; + return Objects.equals(this.currency, collateralCurrency.currency) && + Objects.equals(this.amount, collateralCurrency.amount); + } + + @Override + public int hashCode() { + return Objects.hash(currency, amount); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollateralCurrency {\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/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 index 7c479c5..19b216d 100644 --- a/src/main/java/io/gate/gateapi/models/CollateralLoanCurrency.java +++ b/src/main/java/io/gate/gateapi/models/CollateralLoanCurrency.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/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 index 95d6510..f707431 100644 --- a/src/main/java/io/gate/gateapi/models/CollateralOrder.java +++ b/src/main/java/io/gate/gateapi/models/CollateralOrder.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; /** - * Collateral Order + * Collateral order */ public class CollateralOrder { public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; @@ -115,7 +115,7 @@ public CollateralOrder collateralCurrency(String collateralCurrency) { } /** - * Collateral + * Collateral currency * @return collateralCurrency **/ @javax.annotation.Nullable @@ -175,7 +175,7 @@ public CollateralOrder borrowAmount(String borrowAmount) { } /** - * Borrowing amount + * Borrowed amount * @return borrowAmount **/ @javax.annotation.Nullable @@ -255,7 +255,7 @@ public CollateralOrder initLtv(String initLtv) { } /** - * The initial collateralization rate + * Initial collateralization rate * @return initLtv **/ @javax.annotation.Nullable @@ -275,7 +275,7 @@ public CollateralOrder currentLtv(String currentLtv) { } /** - * The current collateralization rate + * Current collateralization rate * @return currentLtv **/ @javax.annotation.Nullable @@ -295,7 +295,7 @@ public CollateralOrder liquidateLtv(String liquidateLtv) { } /** - * The liquidation collateralization rate + * Liquidation collateralization rate * @return liquidateLtv **/ @javax.annotation.Nullable @@ -375,7 +375,7 @@ public CollateralOrder leftRepayPrincipal(String leftRepayPrincipal) { } /** - * outstanding principal + * Outstanding principal * @return leftRepayPrincipal **/ @javax.annotation.Nullable @@ -395,7 +395,7 @@ public CollateralOrder leftRepayInterest(String leftRepayInterest) { } /** - * outstanding interest + * Outstanding interest * @return leftRepayInterest **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/CollateralRecord.java b/src/main/java/io/gate/gateapi/models/CollateralRecord.java index 9054a49..58d2288 100644 --- a/src/main/java/io/gate/gateapi/models/CollateralRecord.java +++ b/src/main/java/io/gate/gateapi/models/CollateralRecord.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 @@ -131,7 +131,7 @@ public CollateralRecord borrowAmount(String borrowAmount) { } /** - * Borrowing amount + * Borrowed amount * @return borrowAmount **/ @javax.annotation.Nullable @@ -151,7 +151,7 @@ public CollateralRecord collateralCurrency(String collateralCurrency) { } /** - * Collateral + * Collateral currency * @return collateralCurrency **/ @javax.annotation.Nullable @@ -171,7 +171,7 @@ public CollateralRecord beforeCollateral(String beforeCollateral) { } /** - * The collateral amount before adjustment + * Collateral amount before adjustment * @return beforeCollateral **/ @javax.annotation.Nullable @@ -191,7 +191,7 @@ public CollateralRecord afterCollateral(String afterCollateral) { } /** - * The collateral amount after adjustment + * Collateral amount after adjustment * @return afterCollateral **/ @javax.annotation.Nullable @@ -211,7 +211,7 @@ public CollateralRecord beforeLtv(String beforeLtv) { } /** - * The collateral ratio before adjustment + * Collateral ratio before adjustment * @return beforeLtv **/ @javax.annotation.Nullable @@ -231,7 +231,7 @@ public CollateralRecord afterLtv(String afterLtv) { } /** - * The collateral ratio after adjustment + * Collateral ratio after adjustment * @return afterLtv **/ @javax.annotation.Nullable @@ -251,7 +251,7 @@ public CollateralRecord operateTime(Long operateTime) { } /** - * Timestamp of the operation, in seconds + * Operation time, timestamp in seconds * @return operateTime **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/Contract.java b/src/main/java/io/gate/gateapi/models/Contract.java index 9e555c4..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 @@ -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 { @@ -257,6 +257,26 @@ public MarkTypeEnum read(final JsonReader jsonReader) throws IOException { @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) { @@ -285,7 +305,7 @@ public Contract type(TypeEnum type) { } /** - * Futures contract type + * Contract type: inverse - inverse contract, direct - direct contract * @return type **/ @javax.annotation.Nullable @@ -385,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 @@ -465,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 @@ -605,7 +625,7 @@ public Contract riskLimitBase(String riskLimitBase) { } /** - * Risk limit base + * Base risk limit (deprecated) * @return riskLimitBase **/ @javax.annotation.Nullable @@ -625,7 +645,7 @@ public Contract riskLimitStep(String riskLimitStep) { } /** - * Step of adjusting risk limit + * Risk limit adjustment step (deprecated) * @return riskLimitStep **/ @javax.annotation.Nullable @@ -645,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 @@ -665,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 @@ -685,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 @@ -705,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 @@ -725,7 +745,7 @@ public Contract refDiscountRate(String refDiscountRate) { } /** - * Referral fee rate discount + * Trading fee discount for referred users * @return refDiscountRate **/ @javax.annotation.Nullable @@ -745,7 +765,7 @@ public Contract refRebateRate(String refRebateRate) { } /** - * Referrer commission rate + * Commission rate for referrers * @return refRebateRate **/ @javax.annotation.Nullable @@ -765,7 +785,7 @@ public Contract orderbookId(Long orderbookId) { } /** - * Current orderbook ID + * Orderbook update ID * @return orderbookId **/ @javax.annotation.Nullable @@ -805,7 +825,7 @@ public Contract tradeSize(Long tradeSize) { } /** - * Historical accumulated trade size + * Historical cumulative trading volume * @return tradeSize **/ @javax.annotation.Nullable @@ -845,7 +865,7 @@ public Contract configChangeTime(Double configChangeTime) { } /** - * Last changed time of configuration + * Last configuration update time * @return configChangeTime **/ @javax.annotation.Nullable @@ -865,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 @@ -885,7 +905,7 @@ public Contract ordersLimit(Integer ordersLimit) { } /** - * Maximum number of open orders + * Maximum number of pending orders * @return ordersLimit **/ @javax.annotation.Nullable @@ -905,7 +925,7 @@ public Contract enableBonus(Boolean enableBonus) { } /** - * Whether bouns is enabled + * Whether bonus is enabled * @return enableBonus **/ @javax.annotation.Nullable @@ -957,6 +977,106 @@ public Double getCreateTime() { 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) { @@ -1000,12 +1120,17 @@ public boolean equals(java.lang.Object o) { 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.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, enableBonus, enableCredit, createTime); + 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); } @@ -1048,6 +1173,11 @@ public String toString() { 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 index 41bee15..235f681 100644 --- a/src/main/java/io/gate/gateapi/models/CountdownCancelAllFuturesTask.java +++ b/src/main/java/io/gate/gateapi/models/CountdownCancelAllFuturesTask.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; /** - * Countdown cancel task detail + * Countdown cancel task details */ public class CountdownCancelAllFuturesTask { public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; @@ -39,7 +39,7 @@ public CountdownCancelAllFuturesTask timeout(Integer timeout) { } /** - * Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown + * Countdown time in seconds At least 5 seconds, 0 means cancel countdown * @return timeout **/ public Integer getTimeout() { 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 index a21f8bb..feb268e 100644 --- a/src/main/java/io/gate/gateapi/models/CountdownCancelAllSpotTask.java +++ b/src/main/java/io/gate/gateapi/models/CountdownCancelAllSpotTask.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; /** - * Countdown cancel task detail + * Countdown cancel task details */ public class CountdownCancelAllSpotTask { public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; @@ -39,7 +39,7 @@ public CountdownCancelAllSpotTask timeout(Integer timeout) { } /** - * Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown + * Countdown time in seconds At least 5 seconds, 0 means cancel countdown * @return timeout **/ public Integer getTimeout() { diff --git a/src/main/java/io/gate/gateapi/models/CreateCollateralOrder.java b/src/main/java/io/gate/gateapi/models/CreateCollateralOrder.java index 555310f..1535e79 100644 --- a/src/main/java/io/gate/gateapi/models/CreateCollateralOrder.java +++ b/src/main/java/io/gate/gateapi/models/CreateCollateralOrder.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 CreateCollateralOrder collateralCurrency(String collateralCurrency) { } /** - * Collateral + * Collateral currency * @return collateralCurrency **/ public String getCollateralCurrency() { @@ -85,7 +85,7 @@ public CreateCollateralOrder borrowAmount(String borrowAmount) { } /** - * Borrowing amount + * Borrowed amount * @return borrowAmount **/ public String getBorrowAmount() { 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 index 8ded410..73974c1 100644 --- a/src/main/java/io/gate/gateapi/models/CreateUniLend.java +++ b/src/main/java/io/gate/gateapi/models/CreateUniLend.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; /** - * Lend or redeem + * Create lending or redemption */ public class CreateUniLend { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @@ -32,7 +32,7 @@ public class CreateUniLend { private String amount; /** - * type: lend - lend, redeem - redeem + * Operation type: lend - Lend, redeem - Redeem */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -113,7 +113,7 @@ public CreateUniLend amount(String amount) { } /** - * The amount of currency could be lent + * Amount to deposit into lending pool * @return amount **/ public String getAmount() { @@ -132,7 +132,7 @@ public CreateUniLend type(TypeEnum type) { } /** - * type: lend - lend, redeem - redeem + * Operation type: lend - Lend, redeem - Redeem * @return type **/ public TypeEnum getType() { @@ -151,7 +151,7 @@ public CreateUniLend minRate(String minRate) { } /** - * The minimum interest rate. If the value is too high, it might lead to the unsuccessful lending and no profit will be gained for that hour. + * 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 diff --git a/src/main/java/io/gate/gateapi/models/CreateUniLoan.java b/src/main/java/io/gate/gateapi/models/CreateUniLoan.java index 73b55cf..f11bf67 100644 --- a/src/main/java/io/gate/gateapi/models/CreateUniLoan.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 @@ -28,7 +28,7 @@ public class CreateUniLoan { private String currency; /** - * type: borrow - borrow, repay - repay + * Type: `borrow` - borrow, `repay` - repay */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -117,7 +117,7 @@ public CreateUniLoan type(TypeEnum type) { } /** - * type: borrow - borrow, repay - repay + * Type: `borrow` - borrow, `repay` - repay * @return type **/ public TypeEnum getType() { @@ -136,7 +136,7 @@ public CreateUniLoan amount(String amount) { } /** - * The amount of lending or repaying + * Borrow or repayment amount * @return amount **/ public String getAmount() { @@ -155,7 +155,7 @@ public CreateUniLoan repaidAll(Boolean repaidAll) { } /** - * Full repayment. Repay operation only. If the value is `true`, the amount will be ignored and the loan will be repaid in full. + * Full repayment. For repayment operations only. When `true`, overrides `amount` and repays the full amount * @return repaidAll **/ @javax.annotation.Nullable 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 e3f72ac..0000000 --- a/src/main/java/io/gate/gateapi/models/CrossMarginAccount.java +++ /dev/null @@ -1,517 +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_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_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 static final String SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL = "portfolio_margin_total"; - @SerializedName(SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL) - private String portfolioMarginTotal; - - public static final String SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_LIAB = "portfolio_margin_total_liab"; - @SerializedName(SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_LIAB) - private String portfolioMarginTotalLiab; - - public static final String SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_EQUITY = "portfolio_margin_total_equity"; - @SerializedName(SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_EQUITY) - private String portfolioMarginTotalEquity; - - - 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 refreshTime(Long refreshTime) { - - this.refreshTime = refreshTime; - return this; - } - - /** - * Time of the most recent refresh - * @return refreshTime - **/ - @javax.annotation.Nullable - public Long getRefreshTime() { - return refreshTime; - } - - - public void setRefreshTime(Long refreshTime) { - this.refreshTime = refreshTime; - } - - 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; - } - - public CrossMarginAccount 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 CrossMarginAccount totalMarginBalance(String totalMarginBalance) { - - this.totalMarginBalance = totalMarginBalance; - return this; - } - - /** - * Total Margin Balance (∑(positive equity * index price * discount) + ∑(negative equity * index price)) - * @return totalMarginBalance - **/ - @javax.annotation.Nullable - public String getTotalMarginBalance() { - return totalMarginBalance; - } - - - public void setTotalMarginBalance(String totalMarginBalance) { - this.totalMarginBalance = totalMarginBalance; - } - - public CrossMarginAccount 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 CrossMarginAccount 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 CrossMarginAccount 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 CrossMarginAccount 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; - } - - public CrossMarginAccount portfolioMarginTotal(String portfolioMarginTotal) { - - this.portfolioMarginTotal = portfolioMarginTotal; - return this; - } - - /** - * Total amount of the portfolio margin account - * @return portfolioMarginTotal - **/ - @javax.annotation.Nullable - public String getPortfolioMarginTotal() { - return portfolioMarginTotal; - } - - - public void setPortfolioMarginTotal(String portfolioMarginTotal) { - this.portfolioMarginTotal = portfolioMarginTotal; - } - - public CrossMarginAccount portfolioMarginTotalLiab(String portfolioMarginTotalLiab) { - - this.portfolioMarginTotalLiab = portfolioMarginTotalLiab; - return this; - } - - /** - * Total liabilities of the portfolio margin account - * @return portfolioMarginTotalLiab - **/ - @javax.annotation.Nullable - public String getPortfolioMarginTotalLiab() { - return portfolioMarginTotalLiab; - } - - - public void setPortfolioMarginTotalLiab(String portfolioMarginTotalLiab) { - this.portfolioMarginTotalLiab = portfolioMarginTotalLiab; - } - - public CrossMarginAccount portfolioMarginTotalEquity(String portfolioMarginTotalEquity) { - - this.portfolioMarginTotalEquity = portfolioMarginTotalEquity; - return this; - } - - /** - * Total equity of the portfolio margin account - * @return portfolioMarginTotalEquity - **/ - @javax.annotation.Nullable - public String getPortfolioMarginTotalEquity() { - return portfolioMarginTotalEquity; - } - - - public void setPortfolioMarginTotalEquity(String portfolioMarginTotalEquity) { - this.portfolioMarginTotalEquity = portfolioMarginTotalEquity; - } - @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.refreshTime, crossMarginAccount.refreshTime) && - 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) && - Objects.equals(this.totalInitialMargin, crossMarginAccount.totalInitialMargin) && - Objects.equals(this.totalMarginBalance, crossMarginAccount.totalMarginBalance) && - Objects.equals(this.totalMaintenanceMargin, crossMarginAccount.totalMaintenanceMargin) && - Objects.equals(this.totalInitialMarginRate, crossMarginAccount.totalInitialMarginRate) && - Objects.equals(this.totalMaintenanceMarginRate, crossMarginAccount.totalMaintenanceMarginRate) && - Objects.equals(this.totalAvailableMargin, crossMarginAccount.totalAvailableMargin) && - Objects.equals(this.portfolioMarginTotal, crossMarginAccount.portfolioMarginTotal) && - Objects.equals(this.portfolioMarginTotalLiab, crossMarginAccount.portfolioMarginTotalLiab) && - Objects.equals(this.portfolioMarginTotalEquity, crossMarginAccount.portfolioMarginTotalEquity); - } - - @Override - public int hashCode() { - return Objects.hash(userId, refreshTime, locked, balances, total, borrowed, interest, risk, totalInitialMargin, totalMarginBalance, totalMaintenanceMargin, totalInitialMarginRate, totalMaintenanceMarginRate, totalAvailableMargin, portfolioMarginTotal, portfolioMarginTotalLiab, portfolioMarginTotalEquity); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginAccount {\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(" 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(" portfolioMarginTotal: ").append(toIndentedString(portfolioMarginTotal)).append("\n"); - sb.append(" portfolioMarginTotalLiab: ").append(toIndentedString(portfolioMarginTotalLiab)).append("\n"); - sb.append(" portfolioMarginTotalEquity: ").append(toIndentedString(portfolioMarginTotalEquity)).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/CrossMarginAccountBook.java b/src/main/java/io/gate/gateapi/models/CrossMarginAccountBook.java deleted file mode 100644 index 9d9a06d..0000000 --- a/src/main/java/io/gate/gateapi/models/CrossMarginAccountBook.java +++ /dev/null @@ -1,219 +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; - -/** - * CrossMarginAccountBook - */ -public class CrossMarginAccountBook { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_TIME = "time"; - @SerializedName(SERIALIZED_NAME_TIME) - private Long time; - - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - 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 CrossMarginAccountBook id(String id) { - - this.id = id; - return this; - } - - /** - * Balance change record ID - * @return id - **/ - @javax.annotation.Nullable - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - public CrossMarginAccountBook time(Long time) { - - this.time = time; - return this; - } - - /** - * The timestamp of the change (in milliseconds) - * @return time - **/ - @javax.annotation.Nullable - public Long getTime() { - return time; - } - - - public void setTime(Long time) { - this.time = time; - } - - public CrossMarginAccountBook currency(String currency) { - - this.currency = currency; - return this; - } - - /** - * Currency changed - * @return currency - **/ - @javax.annotation.Nullable - public String getCurrency() { - return currency; - } - - - public void setCurrency(String currency) { - this.currency = currency; - } - - public CrossMarginAccountBook change(String change) { - - this.change = change; - return this; - } - - /** - * Amount changed. Positive value means transferring in, while negative out - * @return change - **/ - @javax.annotation.Nullable - public String getChange() { - return change; - } - - - public void setChange(String change) { - this.change = change; - } - - public CrossMarginAccountBook balance(String balance) { - - this.balance = balance; - return this; - } - - /** - * Balance after change - * @return balance - **/ - @javax.annotation.Nullable - public String getBalance() { - return balance; - } - - - public void setBalance(String balance) { - this.balance = balance; - } - - public CrossMarginAccountBook 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) { - return true; - } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(id, time, currency, change, balance, type); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginAccountBook {\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("}"); - 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 22f6a5c..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 @@ -39,26 +39,6 @@ public class CrossMarginBalance { @SerializedName(SERIALIZED_NAME_INTEREST) private String interest; - 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 CrossMarginBalance available(String available) { @@ -67,7 +47,7 @@ public CrossMarginBalance available(String available) { } /** - * Available amount + * Available balance * @return available **/ @javax.annotation.Nullable @@ -87,7 +67,7 @@ public CrossMarginBalance freeze(String freeze) { } /** - * Locked amount + * Locked balance * @return freeze **/ @javax.annotation.Nullable @@ -107,7 +87,7 @@ public CrossMarginBalance borrowed(String borrowed) { } /** - * Borrowed amount + * Borrowed balance * @return borrowed **/ @javax.annotation.Nullable @@ -127,7 +107,7 @@ public CrossMarginBalance interest(String interest) { } /** - * Unpaid interests + * Unpaid interest * @return interest **/ @javax.annotation.Nullable @@ -139,106 +119,6 @@ public String getInterest() { public void setInterest(String interest) { this.interest = interest; } - - public CrossMarginBalance negativeLiab(String negativeLiab) { - - this.negativeLiab = negativeLiab; - return this; - } - - /** - * Negative Liabilities. Formula:Min[available+total+unrealized_pnl,0] - * @return negativeLiab - **/ - @javax.annotation.Nullable - public String getNegativeLiab() { - return negativeLiab; - } - - - public void setNegativeLiab(String negativeLiab) { - this.negativeLiab = negativeLiab; - } - - public CrossMarginBalance futuresPosLiab(String futuresPosLiab) { - - this.futuresPosLiab = futuresPosLiab; - return this; - } - - /** - * Borrowing to Open Positions in Futures - * @return futuresPosLiab - **/ - @javax.annotation.Nullable - public String getFuturesPosLiab() { - return futuresPosLiab; - } - - - public void setFuturesPosLiab(String futuresPosLiab) { - this.futuresPosLiab = futuresPosLiab; - } - - public CrossMarginBalance equity(String equity) { - - this.equity = equity; - return this; - } - - /** - * Equity. Formula: available + freeze - borrowed + futures account's total + unrealized_pnl - * @return equity - **/ - @javax.annotation.Nullable - public String getEquity() { - return equity; - } - - - public void setEquity(String equity) { - this.equity = equity; - } - - public CrossMarginBalance totalFreeze(String totalFreeze) { - - this.totalFreeze = totalFreeze; - return this; - } - - /** - * Total freeze. Formula: freeze + position_initial_margin + order_margin - * @return totalFreeze - **/ - @javax.annotation.Nullable - public String getTotalFreeze() { - return totalFreeze; - } - - - public void setTotalFreeze(String totalFreeze) { - this.totalFreeze = totalFreeze; - } - - public CrossMarginBalance totalLiab(String totalLiab) { - - this.totalLiab = totalLiab; - return this; - } - - /** - * Total liabilities. Formula: Max[Abs[Min[quity - total_freeze,0], borrowed]] - futures_pos_liab - * @return totalLiab - **/ - @javax.annotation.Nullable - public String getTotalLiab() { - return totalLiab; - } - - - public void setTotalLiab(String totalLiab) { - this.totalLiab = totalLiab; - } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -251,17 +131,12 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.available, crossMarginBalance.available) && Objects.equals(this.freeze, crossMarginBalance.freeze) && Objects.equals(this.borrowed, crossMarginBalance.borrowed) && - Objects.equals(this.interest, crossMarginBalance.interest) && - Objects.equals(this.negativeLiab, crossMarginBalance.negativeLiab) && - Objects.equals(this.futuresPosLiab, crossMarginBalance.futuresPosLiab) && - Objects.equals(this.equity, crossMarginBalance.equity) && - Objects.equals(this.totalFreeze, crossMarginBalance.totalFreeze) && - Objects.equals(this.totalLiab, crossMarginBalance.totalLiab); + Objects.equals(this.interest, crossMarginBalance.interest); } @Override public int hashCode() { - return Objects.hash(available, freeze, borrowed, interest, negativeLiab, futuresPosLiab, equity, totalFreeze, totalLiab); + return Objects.hash(available, freeze, borrowed, interest); } @@ -273,11 +148,6 @@ public String toString() { sb.append(" freeze: ").append(toIndentedString(freeze)).append("\n"); sb.append(" borrowed: ").append(toIndentedString(borrowed)).append("\n"); sb.append(" interest: ").append(toIndentedString(interest)).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("}"); return sb.toString(); } diff --git a/src/main/java/io/gate/gateapi/models/CrossMarginBalance1.java b/src/main/java/io/gate/gateapi/models/CrossMarginBalance1.java deleted file mode 100644 index ed9ba3a..0000000 --- a/src/main/java/io/gate/gateapi/models/CrossMarginBalance1.java +++ /dev/null @@ -1,167 +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; - -/** - * CrossMarginBalance1 - */ -public class CrossMarginBalance1 { - 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_INTEREST = "interest"; - @SerializedName(SERIALIZED_NAME_INTEREST) - private String interest; - - - public CrossMarginBalance1 available(String available) { - - this.available = available; - return this; - } - - /** - * Available amount - * @return available - **/ - @javax.annotation.Nullable - public String getAvailable() { - return available; - } - - - public void setAvailable(String available) { - this.available = available; - } - - public CrossMarginBalance1 freeze(String freeze) { - - this.freeze = freeze; - return this; - } - - /** - * Locked amount - * @return freeze - **/ - @javax.annotation.Nullable - public String getFreeze() { - return freeze; - } - - - public void setFreeze(String freeze) { - this.freeze = freeze; - } - - public CrossMarginBalance1 borrowed(String borrowed) { - - this.borrowed = borrowed; - return this; - } - - /** - * Borrowed amount - * @return borrowed - **/ - @javax.annotation.Nullable - public String getBorrowed() { - return borrowed; - } - - - public void setBorrowed(String borrowed) { - this.borrowed = borrowed; - } - - public CrossMarginBalance1 interest(String interest) { - - this.interest = interest; - return this; - } - - /** - * Unpaid interests - * @return interest - **/ - @javax.annotation.Nullable - public String getInterest() { - return interest; - } - - - public void setInterest(String interest) { - this.interest = interest; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CrossMarginBalance1 crossMarginBalance1 = (CrossMarginBalance1) o; - return Objects.equals(this.available, crossMarginBalance1.available) && - Objects.equals(this.freeze, crossMarginBalance1.freeze) && - Objects.equals(this.borrowed, crossMarginBalance1.borrowed) && - Objects.equals(this.interest, crossMarginBalance1.interest); - } - - @Override - public int hashCode() { - return Objects.hash(available, freeze, borrowed, interest); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginBalance1 {\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(" 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/CrossMarginLoan.java b/src/main/java/io/gate/gateapi/models/CrossMarginLoan.java index f242b33..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 @@ -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 1303449..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 @@ -173,7 +173,7 @@ public void setInterest(String interest) { } /** - * Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment, cancel_auto_repay - automatic repayment after cancellation + * Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment after cancellation * @return repaymentType **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/Currency.java b/src/main/java/io/gate/gateapi/models/Currency.java index a79a2c5..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; @@ -55,6 +62,10 @@ public class Currency { @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) { @@ -63,7 +74,7 @@ public Currency currency(String currency) { } /** - * Currency name + * Currency symbol * @return currency **/ @javax.annotation.Nullable @@ -76,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; @@ -103,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 @@ -123,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 @@ -143,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 @@ -203,7 +234,7 @@ public Currency chain(String chain) { } /** - * Chain of currency + * The main chain corresponding to the coin * @return chain **/ @javax.annotation.Nullable @@ -215,6 +246,34 @@ public String getChain() { 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) { @@ -225,18 +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.fixedRate, currency.fixedRate) && - Objects.equals(this.chain, currency.chain); + 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, fixedRate, chain); + return Objects.hash(currency, name, delisted, withdrawDisabled, withdrawDelayed, depositDisabled, tradeDisabled, fixedRate, chain, chains); } @@ -245,6 +306,7 @@ 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"); @@ -252,6 +314,7 @@ public String toString() { 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 index 5523bfe..6abbb94 100644 --- a/src/main/java/io/gate/gateapi/models/CurrencyChain.java +++ b/src/main/java/io/gate/gateapi/models/CurrencyChain.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 CurrencyChain { @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) { @@ -159,7 +163,7 @@ public CurrencyChain isDepositDisabled(Integer isDepositDisabled) { } /** - * Is deposit disabled. 0 means not + * Is deposit disabled. 0 means not disabled * @return isDepositDisabled **/ @javax.annotation.Nullable @@ -179,7 +183,7 @@ public CurrencyChain isWithdrawDisabled(Integer isWithdrawDisabled) { } /** - * Is withdrawal disabled. 0 means not + * Is withdrawal disabled. 0 means not disabled * @return isWithdrawDisabled **/ @javax.annotation.Nullable @@ -191,6 +195,26 @@ public Integer getIsWithdrawDisabled() { 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) { @@ -206,12 +230,13 @@ public boolean equals(java.lang.Object o) { 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.isWithdrawDisabled, currencyChain.isWithdrawDisabled) && + Objects.equals(this.decimal, currencyChain.decimal); } @Override public int hashCode() { - return Objects.hash(chain, nameCn, nameEn, contractAddress, isDisabled, isDepositDisabled, isWithdrawDisabled); + return Objects.hash(chain, nameCn, nameEn, contractAddress, isDisabled, isDepositDisabled, isWithdrawDisabled, decimal); } @@ -226,6 +251,7 @@ public String toString() { 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(); } 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/PortfolioMode.java b/src/main/java/io/gate/gateapi/models/DebitFee.java similarity index 59% rename from src/main/java/io/gate/gateapi/models/PortfolioMode.java rename to src/main/java/io/gate/gateapi/models/DebitFee.java index 4173c62..ce575cb 100644 --- a/src/main/java/io/gate/gateapi/models/PortfolioMode.java +++ b/src/main/java/io/gate/gateapi/models/DebitFee.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,45 +20,22 @@ import java.io.IOException; /** - * PortfolioMode + * DebitFee */ -public class PortfolioMode { - public static final String SERIALIZED_NAME_MODE = "mode"; - @SerializedName(SERIALIZED_NAME_MODE) - private String mode; - +public class DebitFee { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - public PortfolioMode mode(String mode) { - - this.mode = mode; - return this; - } - - /** - * Portfolio mode - cross_margin : cross margin - * @return mode - **/ - public String getMode() { - return mode; - } - - - public void setMode(String mode) { - this.mode = mode; - } - - public PortfolioMode enabled(Boolean enabled) { + public DebitFee enabled(Boolean enabled) { this.enabled = enabled; return this; } /** - * Is it enabled? + * Whether GT fee deduction is enabled * @return enabled **/ public Boolean getEnabled() { @@ -77,22 +54,20 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PortfolioMode portfolioMode = (PortfolioMode) o; - return Objects.equals(this.mode, portfolioMode.mode) && - Objects.equals(this.enabled, portfolioMode.enabled); + DebitFee debitFee = (DebitFee) o; + return Objects.equals(this.enabled, debitFee.enabled); } @Override public int hashCode() { - return Objects.hash(mode, enabled); + return Objects.hash(enabled); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PortfolioMode {\n"); - sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("class DebitFee {\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/io/gate/gateapi/models/DeliveryCandlestick.java b/src/main/java/io/gate/gateapi/models/DeliveryCandlestick.java index a02fc82..bd66a5c 100644 --- a/src/main/java/io/gate/gateapi/models/DeliveryCandlestick.java +++ b/src/main/java/io/gate/gateapi/models/DeliveryCandlestick.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/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 6d2a578..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 (daily 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/FlashSwapCurrency.java b/src/main/java/io/gate/gateapi/models/FlashSwapCurrency.java deleted file mode 100644 index d0e3b7b..0000000 --- a/src/main/java/io/gate/gateapi/models/FlashSwapCurrency.java +++ /dev/null @@ -1,129 +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; -import java.util.ArrayList; -import java.util.List; - -/** - * Currencies supported in flash swap - */ -public class FlashSwapCurrency { - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_MIN_AMOUNT = "min_amount"; - @SerializedName(SERIALIZED_NAME_MIN_AMOUNT) - private String minAmount; - - public static final String SERIALIZED_NAME_MAX_AMOUNT = "max_amount"; - @SerializedName(SERIALIZED_NAME_MAX_AMOUNT) - private String maxAmount; - - public static final String SERIALIZED_NAME_SWAPPABLE = "swappable"; - @SerializedName(SERIALIZED_NAME_SWAPPABLE) - private List swappable = null; - - - /** - * Currency name - * @return currency - **/ - @javax.annotation.Nullable - public String getCurrency() { - return currency; - } - - - /** - * Minimum amount required in flash swap - * @return minAmount - **/ - @javax.annotation.Nullable - public String getMinAmount() { - return minAmount; - } - - - /** - * Maximum amount allowed in flash swap - * @return maxAmount - **/ - @javax.annotation.Nullable - public String getMaxAmount() { - return maxAmount; - } - - - /** - * Currencies which can be swapped to from this currency - * @return swappable - **/ - @javax.annotation.Nullable - public List getSwappable() { - return swappable; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FlashSwapCurrency flashSwapCurrency = (FlashSwapCurrency) o; - return Objects.equals(this.currency, flashSwapCurrency.currency) && - Objects.equals(this.minAmount, flashSwapCurrency.minAmount) && - Objects.equals(this.maxAmount, flashSwapCurrency.maxAmount) && - Objects.equals(this.swappable, flashSwapCurrency.swappable); - } - - @Override - public int hashCode() { - return Objects.hash(currency, minAmount, maxAmount, swappable); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FlashSwapCurrency {\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" minAmount: ").append(toIndentedString(minAmount)).append("\n"); - sb.append(" maxAmount: ").append(toIndentedString(maxAmount)).append("\n"); - sb.append(" swappable: ").append(toIndentedString(swappable)).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 index d6cac8f..a54725a 100644 --- a/src/main/java/io/gate/gateapi/models/FlashSwapCurrencyPair.java +++ b/src/main/java/io/gate/gateapi/models/FlashSwapCurrencyPair.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 @@ -53,7 +53,7 @@ public class FlashSwapCurrencyPair { /** - * The currency pair, BTC_USDT represents selling Bitcoin (BTC) and buying Tether (USDT). + * Currency pair, `BTC_USDT` represents selling `BTC` and buying `USDT` * @return currencyPair **/ @javax.annotation.Nullable @@ -63,7 +63,7 @@ public String getCurrencyPair() { /** - * The currency to be sold + * Currency to sell * @return sellCurrency **/ @javax.annotation.Nullable @@ -73,7 +73,7 @@ public String getSellCurrency() { /** - * The currency to be bought + * Currency to buy * @return buyCurrency **/ @javax.annotation.Nullable @@ -83,7 +83,7 @@ public String getBuyCurrency() { /** - * The minimum quantity required for selling + * Minimum sell quantity * @return sellMinAmount **/ @javax.annotation.Nullable @@ -93,7 +93,7 @@ public String getSellMinAmount() { /** - * The maximum quantity allowed for selling + * Maximum sell quantity * @return sellMaxAmount **/ @javax.annotation.Nullable @@ -103,7 +103,7 @@ public String getSellMaxAmount() { /** - * The minimum quantity required for buying + * Minimum buy quantity * @return buyMinAmount **/ @javax.annotation.Nullable @@ -113,7 +113,7 @@ public String getBuyMinAmount() { /** - * The maximum quantity allowed for buying + * Maximum buy quantity * @return buyMaxAmount **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapOrder.java b/src/main/java/io/gate/gateapi/models/FlashSwapOrder.java index 2671da9..3985804 100644 --- a/src/main/java/io/gate/gateapi/models/FlashSwapOrder.java +++ b/src/main/java/io/gate/gateapi/models/FlashSwapOrder.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/FlashSwapOrderPreview.java b/src/main/java/io/gate/gateapi/models/FlashSwapOrderPreview.java index 6a0e7c3..00f49a4 100644 --- a/src/main/java/io/gate/gateapi/models/FlashSwapOrderPreview.java +++ b/src/main/java/io/gate/gateapi/models/FlashSwapOrderPreview.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; /** - * Initiate a flash swap order preview + * Flash swap order preview */ public class FlashSwapOrderPreview { public static final String SERIALIZED_NAME_PREVIEW_ID = "preview_id"; @@ -75,7 +75,7 @@ public FlashSwapOrderPreview sellCurrency(String sellCurrency) { } /** - * Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` + * 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 @@ -115,7 +115,7 @@ public FlashSwapOrderPreview buyCurrency(String buyCurrency) { } /** - * Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` + * 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 diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapOrderRequest.java b/src/main/java/io/gate/gateapi/models/FlashSwapOrderRequest.java index 008df15..da58ff1 100644 --- a/src/main/java/io/gate/gateapi/models/FlashSwapOrderRequest.java +++ b/src/main/java/io/gate/gateapi/models/FlashSwapOrderRequest.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,7 +70,7 @@ public FlashSwapOrderRequest sellCurrency(String sellCurrency) { } /** - * 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. + * 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() { @@ -108,7 +108,7 @@ public FlashSwapOrderRequest buyCurrency(String buyCurrency) { } /** - * 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. + * 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() { diff --git a/src/main/java/io/gate/gateapi/models/FlashSwapPreviewRequest.java b/src/main/java/io/gate/gateapi/models/FlashSwapPreviewRequest.java index 33ad21a..3f3de68 100644 --- a/src/main/java/io/gate/gateapi/models/FlashSwapPreviewRequest.java +++ b/src/main/java/io/gate/gateapi/models/FlashSwapPreviewRequest.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 FlashSwapPreviewRequest sellCurrency(String sellCurrency) { } /** - * 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. + * 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() { @@ -86,7 +86,7 @@ public FlashSwapPreviewRequest buyCurrency(String buyCurrency) { } /** - * 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. + * 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() { 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 251c2a9..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 @@ -56,6 +56,10 @@ 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; @@ -72,6 +76,58 @@ public class FuturesAccount { @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; @@ -164,7 +220,7 @@ public FuturesAccount available(String available) { } /** - * The available balance for transferring or trading(including bonus. Bonus can't be be withdrawn. The transfer amount needs to deduct the bonus) + * Available balance for transferring or trading (including bonus. Bonus cannot be withdrawn, so transfer amount needs to deduct bonus) * @return available **/ @javax.annotation.Nullable @@ -184,7 +240,7 @@ public FuturesAccount point(String point) { } /** - * POINT amount + * Point card amount * @return point **/ @javax.annotation.Nullable @@ -204,7 +260,7 @@ public FuturesAccount currency(String currency) { } /** - * Settle currency + * Settlement currency * @return currency **/ @javax.annotation.Nullable @@ -237,6 +293,26 @@ 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; @@ -264,7 +340,7 @@ public FuturesAccount positionInitialMargin(String positionInitialMargin) { } /** - * Initial margin position, applicable to the portfolio margin account model + * Initial margin occupied by positions, applicable to unified account mode * @return positionInitialMargin **/ @javax.annotation.Nullable @@ -284,7 +360,7 @@ public FuturesAccount maintenanceMargin(String maintenanceMargin) { } /** - * Maintenance margin position, applicable to the portfolio margin account model + * Maintenance margin occupied by positions, applicable to new classic account margin mode and unified account mode * @return maintenanceMargin **/ @javax.annotation.Nullable @@ -304,7 +380,7 @@ public FuturesAccount bonus(String bonus) { } /** - * Perpetual Contract Bonus + * Bonus * @return bonus **/ @javax.annotation.Nullable @@ -317,6 +393,266 @@ 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; @@ -353,16 +689,30 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.point, futuresAccount.point) && Objects.equals(this.currency, futuresAccount.currency) && 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, enableCredit, positionInitialMargin, maintenanceMargin, bonus, history); + 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); } @@ -378,10 +728,24 @@ 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 index 2881052..0b76d2d 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesAccountHistory.java +++ b/src/main/java/io/gate/gateapi/models/FuturesAccountHistory.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/FuturesAutoDeleverage.java b/src/main/java/io/gate/gateapi/models/FuturesAutoDeleverage.java index 3ceef84..9ac4f6b 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesAutoDeleverage.java +++ b/src/main/java/io/gate/gateapi/models/FuturesAutoDeleverage.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 @@ -115,7 +115,7 @@ public String getLeverage() { /** - * Cross margin leverage(valid only when `leverage` is 0) + * Cross margin leverage (valid only when `leverage` is 0) * @return crossLeverageLimit **/ @javax.annotation.Nullable 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 9a3650f..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 diff --git a/src/main/java/io/gate/gateapi/models/FuturesFee.java b/src/main/java/io/gate/gateapi/models/FuturesFee.java index 18bde43..37690a3 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesFee.java +++ b/src/main/java/io/gate/gateapi/models/FuturesFee.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; /** - * The returned result is a map type, where the key represents the market and the value represents the taker and maker fee rates. + * 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"; diff --git a/src/main/java/io/gate/gateapi/models/FuturesIndexConstituents.java b/src/main/java/io/gate/gateapi/models/FuturesIndexConstituents.java index b99b30a..1453045 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesIndexConstituents.java +++ b/src/main/java/io/gate/gateapi/models/FuturesIndexConstituents.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/FuturesInitialOrder.java b/src/main/java/io/gate/gateapi/models/FuturesInitialOrder.java index 30e1a2a..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 { @@ -137,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 @@ -176,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 @@ -196,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 @@ -216,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 @@ -236,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 @@ -256,7 +256,7 @@ public FuturesInitialOrder autoSize(String autoSize) { } /** - * 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 + * 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 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 index f5d12a3..fc632db 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesLiqOrder.java +++ b/src/main/java/io/gate/gateapi/models/FuturesLiqOrder.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 FuturesLiqOrder { @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; @@ -78,6 +82,16 @@ public Long getSize() { } + /** + * Number of forced liquidation orders + * @return orderSize + **/ + @javax.annotation.Nullable + public Long getOrderSize() { + return orderSize; + } + + /** * Liquidation order price * @return orderPrice @@ -119,6 +133,7 @@ public boolean equals(java.lang.Object 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); @@ -126,7 +141,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(time, contract, size, orderPrice, fillPrice, left); + return Objects.hash(time, contract, size, orderSize, orderPrice, fillPrice, left); } @@ -137,6 +152,7 @@ public String toString() { 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"); 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 5fb0456..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 - stp: cancelled because self trade prevention + * 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 { @@ -105,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 { @@ -326,7 +330,7 @@ public AutoSizeEnum read(final JsonReader jsonReader) throws IOException { 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 { @@ -384,6 +388,14 @@ public StpActEnum read(final JsonReader jsonReader) throws IOException { @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 @@ -415,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 @@ -426,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 - stp: cancelled because self trade prevention + * 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 @@ -436,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 @@ -471,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() { @@ -490,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 @@ -510,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 @@ -614,7 +636,7 @@ public void setTif(TifEnum tif) { } /** - * Size left to be traded + * Unfilled quantity * @return left **/ @javax.annotation.Nullable @@ -624,7 +646,7 @@ public Long getLeft() { /** - * Fill price of the order + * Fill price * @return fillPrice **/ @javax.annotation.Nullable @@ -640,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 @@ -674,7 +696,7 @@ public String getMkfr() { /** - * Reference user ID + * Referrer user ID * @return refu **/ @javax.annotation.Nullable @@ -720,7 +742,7 @@ public FuturesOrder stpAct(StpActEnum stpAct) { } /** - * 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 @@ -742,6 +764,46 @@ 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) { @@ -754,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) && @@ -776,12 +839,14 @@ public boolean equals(java.lang.Object o) { 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.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, stpId, stpAct, amendText); + 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); } @@ -792,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"); @@ -815,6 +881,8 @@ public String toString() { 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 index a8202d2..32f273c 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesOrderAmendment.java +++ b/src/main/java/io/gate/gateapi/models/FuturesOrderAmendment.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 FuturesOrderAmendment { @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) { @@ -63,7 +67,7 @@ public FuturesOrderAmendment price(String price) { } /** - * New order price. + * New order price * @return price **/ @javax.annotation.Nullable @@ -83,7 +87,7 @@ public FuturesOrderAmendment amendText(String amendText) { } /** - * Custom info during amending order + * Custom info during order amendment * @return amendText **/ @javax.annotation.Nullable @@ -95,6 +99,26 @@ public String getAmendText() { 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) { @@ -106,12 +130,13 @@ public boolean equals(java.lang.Object o) { 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.amendText, futuresOrderAmendment.amendText) && + Objects.equals(this.text, futuresOrderAmendment.text); } @Override public int hashCode() { - return Objects.hash(size, price, amendText); + return Objects.hash(size, price, amendText, text); } @@ -122,6 +147,7 @@ public String toString() { 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(); } 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 f1c7349..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 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 index 5599af7..cd1b743 100644 --- a/src/main/java/io/gate/gateapi/models/FuturesPremiumIndex.java +++ b/src/main/java/io/gate/gateapi/models/FuturesPremiumIndex.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 @@ -111,7 +111,7 @@ public FuturesPremiumIndex l(String l) { } /** - * Lowest price` + * Lowest price * @return l **/ @javax.annotation.Nullable 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 3a28418..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,7 +54,7 @@ public class FuturesPriceTriggeredOrder { private Long tradeId; /** - * Auto order status - `open`: order is active - `finished`: order is finished - `inactive`: order is not active, only for close-long-order or close-short-order - `invalid`: order is invalid, only for close-long-order or close-short-order + * 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 { @@ -109,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 { @@ -173,7 +173,7 @@ public FinishAsEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ME_ORDER_ID = "me_order_id"; @SerializedName(SERIALIZED_NAME_ME_ORDER_ID) - private String meOrderId; + private Long meOrderId; public FuturesPriceTriggeredOrder initial(FuturesInitialOrder initial) { @@ -235,7 +235,7 @@ public Integer getUser() { /** - * Creation time + * Created time * @return createTime **/ @javax.annotation.Nullable @@ -245,7 +245,7 @@ public Double getCreateTime() { /** - * Finished time + * End time * @return finishTime **/ @javax.annotation.Nullable @@ -255,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 @@ -265,7 +265,7 @@ public Long getTradeId() { /** - * Auto order status - `open`: order is active - `finished`: order is finished - `inactive`: order is not active, only for close-long-order or close-short-order - `invalid`: order is invalid, only for close-long-order or close-short-order + * 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 @@ -275,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 @@ -285,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 @@ -301,7 +301,7 @@ public FuturesPriceTriggeredOrder orderType(String orderType) { } /** - * Take-profit/stop-loss types, which include: - `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, close long position - `close-short-position`: position take-profit/stop-loss, close short position - `plan-close-long-position`: position planned take-profit/stop-loss, close long position - `plan-close-short-position`: position planned take-profit/stop-loss, close short position The order take-profit/stop-loss can not be passed by request. These two types are read only. + * 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 @@ -315,11 +315,11 @@ public void setOrderType(String orderType) { } /** - * Corresponding order ID of order take-profit/stop-loss. + * Corresponding order ID for order take-profit/stop-loss orders * @return meOrderId **/ @javax.annotation.Nullable - public String getMeOrderId() { + public Long getMeOrderId() { return meOrderId; } 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 a3bb3bf..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,22 +91,42 @@ public class FuturesTicker { @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 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) { @@ -155,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 @@ -195,7 +215,7 @@ public FuturesTicker low24h(String low24h) { } /** - * Lowest trading price in recent 24h + * 24-hour lowest price * @return low24h **/ @javax.annotation.Nullable @@ -215,7 +235,7 @@ public FuturesTicker high24h(String high24h) { } /** - * Highest trading price in recent 24h + * 24-hour highest price * @return high24h **/ @javax.annotation.Nullable @@ -235,7 +255,7 @@ public FuturesTicker volume24h(String volume24h) { } /** - * Trade size in recent 24h + * 24-hour trading volume * @return volume24h **/ @javax.annotation.Nullable @@ -255,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 @@ -275,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 @@ -295,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 @@ -315,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 @@ -335,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 @@ -395,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 @@ -448,84 +468,184 @@ public void setQuantoBaseRate(String quantoBaseRate) { this.quantoBaseRate = quantoBaseRate; } - public FuturesTicker basisRate(String basisRate) { + public FuturesTicker lowestAsk(String lowestAsk) { - this.basisRate = basisRate; + this.lowestAsk = lowestAsk; return this; } /** - * Basis rate - * @return basisRate + * Recent lowest ask + * @return lowestAsk **/ @javax.annotation.Nullable - public String getBasisRate() { - return basisRate; + public String getLowestAsk() { + return lowestAsk; } - public void setBasisRate(String basisRate) { - this.basisRate = basisRate; + public void setLowestAsk(String lowestAsk) { + this.lowestAsk = lowestAsk; } - public FuturesTicker basisValue(String basisValue) { + public FuturesTicker lowestSize(String lowestSize) { - this.basisValue = basisValue; + this.lowestSize = lowestSize; return this; } /** - * Basis value - * @return basisValue + * The latest seller's lowest price order quantity + * @return lowestSize **/ @javax.annotation.Nullable - public String getBasisValue() { - return basisValue; + public String getLowestSize() { + return lowestSize; } - public void setBasisValue(String basisValue) { - this.basisValue = basisValue; + public void setLowestSize(String lowestSize) { + this.lowestSize = lowestSize; } - public FuturesTicker lowestAsk(String lowestAsk) { + public FuturesTicker highestBid(String highestBid) { - this.lowestAsk = lowestAsk; + this.highestBid = highestBid; return this; } /** - * Recent lowest ask - * @return lowestAsk + * Recent highest bid + * @return highestBid **/ @javax.annotation.Nullable - public String getLowestAsk() { - return lowestAsk; + public String getHighestBid() { + return highestBid; } - public void setLowestAsk(String lowestAsk) { - this.lowestAsk = lowestAsk; + public void setHighestBid(String highestBid) { + this.highestBid = highestBid; } - public FuturesTicker highestBid(String highestBid) { + public FuturesTicker highestSize(String highestSize) { - this.highestBid = highestBid; + this.highestSize = highestSize; return this; } /** - * Recent highest bid - * @return highestBid + * The latest buyer's highest price order volume + * @return highestSize **/ @javax.annotation.Nullable - public String getHighestBid() { - return highestBid; + public String getHighestSize() { + return highestSize; } - public void setHighestBid(String highestBid) { - this.highestBid = highestBid; + 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) { @@ -553,15 +673,20 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.fundingRateIndicative, futuresTicker.fundingRateIndicative) && Objects.equals(this.indexPrice, futuresTicker.indexPrice) && Objects.equals(this.quantoBaseRate, futuresTicker.quantoBaseRate) && - Objects.equals(this.basisRate, futuresTicker.basisRate) && - Objects.equals(this.basisValue, futuresTicker.basisValue) && Objects.equals(this.lowestAsk, futuresTicker.lowestAsk) && - Objects.equals(this.highestBid, futuresTicker.highestBid); + 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, basisRate, basisValue, lowestAsk, highestBid); + 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); } @@ -586,10 +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(" 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(" 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 e1309fb..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 @@ -59,7 +59,7 @@ public FuturesTrade id(Long id) { } /** - * Trade ID + * Fill ID * @return id **/ @javax.annotation.Nullable @@ -79,7 +79,7 @@ public FuturesTrade createTime(Double createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -99,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 @@ -159,7 +159,7 @@ public FuturesTrade price(String price) { } /** - * Trading price (quote currency) + * Trade price (quote currency) * @return price **/ @javax.annotation.Nullable @@ -179,7 +179,7 @@ public FuturesTrade isInternal(Boolean isInternal) { } /** - * Whether 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 transaction price may deviate, and it will not be recorded in the K-line. If it is not an internal trade, this field will not be returned. + * 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 diff --git a/src/main/java/io/gate/gateapi/models/IndexConstituent.java b/src/main/java/io/gate/gateapi/models/IndexConstituent.java index e2bceb0..02170af 100644 --- a/src/main/java/io/gate/gateapi/models/IndexConstituent.java +++ b/src/main/java/io/gate/gateapi/models/IndexConstituent.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/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 ff04298..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 @@ -55,78 +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 - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - DONE("DONE"), - - CANCEL("CANCEL"), - - REQUEST("REQUEST"), - - MANUAL("MANUAL"), - - BCODE("BCODE"), - - EXTPEND("EXTPEND"), - - FAIL("FAIL"), - - INVALID("INVALID"), - - VERIFY("VERIFY"), - - PROCES("PROCES"), - - PEND("PEND"), - - DMOVE("DMOVE"), - - SPLITPEND("SPLITPEND"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } + public static final String SERIALIZED_NAME_WITHDRAW_ID = "withdraw_id"; + @SerializedName(SERIALIZED_NAME_WITHDRAW_ID) + private String withdrawId; - @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) @@ -160,7 +99,7 @@ public LedgerRecord withdrawOrderId(String withdrawOrderId) { } /** - * Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * 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 @@ -190,7 +129,7 @@ public LedgerRecord amount(String amount) { } /** - * Currency amount + * Token amount * @return amount **/ public String getAmount() { @@ -261,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 - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount + * 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; } @@ -306,13 +285,15 @@ public boolean equals(java.lang.Object o) { 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, withdrawOrderId, timestamp, amount, currency, address, memo, status, chain); + return Objects.hash(id, txid, withdrawOrderId, timestamp, amount, currency, address, memo, withdrawId, assetClass, status, chain); } @@ -328,6 +309,8 @@ public String toString() { 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 index 5c54370..de18094 100644 --- a/src/main/java/io/gate/gateapi/models/LiquidateOrder.java +++ b/src/main/java/io/gate/gateapi/models/LiquidateOrder.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; /** - * Liquidate Order detail + * Spot liquidation order details */ public class LiquidateOrder { public static final String SERIALIZED_NAME_TEXT = "text"; @@ -39,6 +39,10 @@ public class LiquidateOrder { @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) { @@ -47,7 +51,7 @@ public LiquidateOrder 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 @@ -116,6 +120,26 @@ public String getPrice() { 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) { @@ -128,12 +152,13 @@ public boolean equals(java.lang.Object 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.price, liquidateOrder.price) && + Objects.equals(this.actionMode, liquidateOrder.actionMode); } @Override public int hashCode() { - return Objects.hash(text, currencyPair, amount, price); + return Objects.hash(text, currencyPair, amount, price, actionMode); } @@ -145,6 +170,7 @@ public String toString() { 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(); } 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 ca02d4d..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.0001, 0.01] 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 e6cd2b8..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 @@ -83,7 +83,7 @@ public MarginAccountBook time(String time) { } /** - * Balance changed timestamp + * Account change timestamp * @return time **/ @javax.annotation.Nullable @@ -143,7 +143,7 @@ public MarginAccountBook currencyPair(String currencyPair) { } /** - * Account currency pair + * Account trading pair * @return currencyPair **/ @javax.annotation.Nullable @@ -203,7 +203,7 @@ public MarginAccountBook type(String type) { } /** - * Account book type. Please refer to [account book type](#accountbook-type) for more detail + * Account book type. Please refer to [account book type](#accountbook-type) for more detail * @return type **/ @javax.annotation.Nullable 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 e92dfde..0000000 --- a/src/main/java/io/gate/gateapi/models/MarginCurrencyPair.java +++ /dev/null @@ -1,271 +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 static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Integer status; - - - 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; - } - - public MarginCurrencyPair status(Integer status) { - - this.status = status; - return this; - } - - /** - * Currency pair status - `0`: disabled - `1`: enabled - * @return status - **/ - @javax.annotation.Nullable - public Integer getStatus() { - return status; - } - - - public void setStatus(Integer 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; - } - 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) && - Objects.equals(this.status, marginCurrencyPair.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, base, quote, leverage, minBaseAmount, minQuoteAmount, maxQuoteAmount, status); - } - - - @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(" 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/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 index 8c8aef4..7c03c11 100644 --- a/src/main/java/io/gate/gateapi/models/MaxUniBorrowable.java +++ b/src/main/java/io/gate/gateapi/models/MaxUniBorrowable.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/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/UniInterestMode.java b/src/main/java/io/gate/gateapi/models/MultiLoanItem.java similarity index 60% rename from src/main/java/io/gate/gateapi/models/UniInterestMode.java rename to src/main/java/io/gate/gateapi/models/MultiLoanItem.java index e868b5a..0231292 100644 --- a/src/main/java/io/gate/gateapi/models/UniInterestMode.java +++ b/src/main/java/io/gate/gateapi/models/MultiLoanItem.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,19 +20,19 @@ import java.io.IOException; /** - * 余币宝利息复投开关 + * MultiLoanItem */ -public class UniInterestMode { +public class MultiLoanItem { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Boolean status; + public static final String SERIALIZED_NAME_PRICE = "price"; + @SerializedName(SERIALIZED_NAME_PRICE) + private String price; - public UniInterestMode currency(String currency) { + public MultiLoanItem currency(String currency) { this.currency = currency; return this; @@ -42,6 +42,7 @@ public UniInterestMode currency(String currency) { * Currency * @return currency **/ + @javax.annotation.Nullable public String getCurrency() { return currency; } @@ -51,23 +52,24 @@ public void setCurrency(String currency) { this.currency = currency; } - public UniInterestMode status(Boolean status) { + public MultiLoanItem price(String price) { - this.status = status; + this.price = price; return this; } /** - * Interest toggle settings, true - interest reinvestment, false - regular dividend - * @return status + * Latest price of the currency + * @return price **/ - public Boolean getStatus() { - return status; + @javax.annotation.Nullable + public String getPrice() { + return price; } - public void setStatus(Boolean status) { - this.status = status; + public void setPrice(String price) { + this.price = price; } @Override public boolean equals(java.lang.Object o) { @@ -77,23 +79,23 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UniInterestMode uniInterestMode = (UniInterestMode) o; - return Objects.equals(this.currency, uniInterestMode.currency) && - Objects.equals(this.status, uniInterestMode.status); + 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, status); + return Objects.hash(currency, price); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UniInterestMode {\n"); + sb.append("class MultiLoanItem {\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append("}"); return sb.toString(); } 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 7d4c743..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 { @@ -118,7 +122,7 @@ public MyFuturesTrade id(Long id) { } /** - * Trade ID + * Fill ID * @return id **/ @javax.annotation.Nullable @@ -138,7 +142,7 @@ public MyFuturesTrade createTime(Double createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -178,7 +182,7 @@ public MyFuturesTrade orderId(String orderId) { } /** - * Order ID related + * Related order ID * @return orderId **/ @javax.annotation.Nullable @@ -211,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; @@ -218,7 +242,7 @@ public MyFuturesTrade price(String price) { } /** - * Trading price + * Fill Price * @return price **/ @javax.annotation.Nullable @@ -238,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 @@ -258,7 +282,7 @@ public MyFuturesTrade text(String text) { } /** - * User defined information + * Order custom information * @return text **/ @javax.annotation.Nullable @@ -278,7 +302,7 @@ public MyFuturesTrade fee(String fee) { } /** - * Fee deducted + * Trade fee * @return fee **/ @javax.annotation.Nullable @@ -298,7 +322,7 @@ public MyFuturesTrade pointFee(String pointFee) { } /** - * Points used to deduct fee + * Points used to deduct trade fee * @return pointFee **/ @javax.annotation.Nullable @@ -324,6 +348,7 @@ 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.text, myFuturesTrade.text) && @@ -333,7 +358,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, createTime, contract, orderId, size, price, role, text, fee, pointFee); + return Objects.hash(id, createTime, contract, orderId, size, closeSize, price, role, text, fee, pointFee); } @@ -346,6 +371,7 @@ 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"); diff --git a/src/main/java/io/gate/gateapi/models/MyFuturesTradeTimeRange.java b/src/main/java/io/gate/gateapi/models/MyFuturesTradeTimeRange.java index 6ad76a7..9364731 100644 --- a/src/main/java/io/gate/gateapi/models/MyFuturesTradeTimeRange.java +++ b/src/main/java/io/gate/gateapi/models/MyFuturesTradeTimeRange.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 MyFuturesTradeTimeRange { @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 { @@ -118,7 +122,7 @@ public MyFuturesTradeTimeRange tradeId(String tradeId) { } /** - * Trade ID + * Fill ID * @return tradeId **/ @javax.annotation.Nullable @@ -138,7 +142,7 @@ public MyFuturesTradeTimeRange createTime(Double createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -178,7 +182,7 @@ public MyFuturesTradeTimeRange orderId(String orderId) { } /** - * Order ID related + * Related order ID * @return orderId **/ @javax.annotation.Nullable @@ -211,6 +215,26 @@ 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; @@ -218,7 +242,7 @@ public MyFuturesTradeTimeRange price(String price) { } /** - * Trading price + * Fill Price * @return price **/ @javax.annotation.Nullable @@ -238,7 +262,7 @@ public MyFuturesTradeTimeRange role(RoleEnum role) { } /** - * Trade role. Available values are `taker` and `maker` + * Trade role. taker - taker, maker - maker * @return role **/ @javax.annotation.Nullable @@ -258,7 +282,7 @@ public MyFuturesTradeTimeRange text(String text) { } /** - * User defined information + * Order custom information * @return text **/ @javax.annotation.Nullable @@ -278,7 +302,7 @@ public MyFuturesTradeTimeRange fee(String fee) { } /** - * Fee deducted + * Trade fee * @return fee **/ @javax.annotation.Nullable @@ -298,7 +322,7 @@ public MyFuturesTradeTimeRange pointFee(String pointFee) { } /** - * Points used to deduct fee + * Points used to deduct trade fee * @return pointFee **/ @javax.annotation.Nullable @@ -324,6 +348,7 @@ public boolean equals(java.lang.Object o) { 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) && @@ -333,7 +358,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(tradeId, createTime, contract, orderId, size, price, role, text, fee, pointFee); + return Objects.hash(tradeId, createTime, contract, orderId, size, closeSize, price, role, text, fee, pointFee); } @@ -346,6 +371,7 @@ 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"); 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 index 8e70d8a..535c794 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsAccount.java +++ b/src/main/java/io/gate/gateapi/models/OptionsAccount.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 @@ -25,16 +25,85 @@ public class OptionsAccount { public static final String SERIALIZED_NAME_USER = "user"; @SerializedName(SERIALIZED_NAME_USER) - private Integer 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; @@ -51,6 +120,14 @@ public class OptionsAccount { @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; @@ -63,8 +140,16 @@ public class OptionsAccount { @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(Integer user) { + public OptionsAccount user(Long user) { this.user = user; return this; @@ -75,12 +160,12 @@ public OptionsAccount user(Integer user) { * @return user **/ @javax.annotation.Nullable - public Integer getUser() { + public Long getUser() { return user; } - public void setUser(Integer user) { + public void setUser(Long user) { this.user = user; } @@ -91,7 +176,7 @@ public OptionsAccount total(String total) { } /** - * Total account balance + * Account Balance * @return total **/ @javax.annotation.Nullable @@ -104,6 +189,46 @@ 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; @@ -124,6 +249,66 @@ 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; @@ -204,6 +389,46 @@ 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; @@ -231,7 +456,7 @@ public OptionsAccount point(String point) { } /** - * POINT amount + * Point card amount * @return point **/ @javax.annotation.Nullable @@ -251,7 +476,7 @@ public OptionsAccount currency(String currency) { } /** - * Settle currency + * Settlement currency * @return currency **/ @javax.annotation.Nullable @@ -263,6 +488,46 @@ public String getCurrency() { 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) { @@ -274,19 +539,28 @@ public boolean equals(java.lang.Object o) { 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.currency, optionsAccount.currency) && + Objects.equals(this.ordersLimit, optionsAccount.ordersLimit) && + Objects.equals(this.positionNotionalLimit, optionsAccount.positionNotionalLimit); } @Override public int hashCode() { - return Objects.hash(user, total, shortEnabled, unrealisedPnl, initMargin, maintMargin, orderMargin, available, point, currency); + return Objects.hash(user, total, positionValue, equity, shortEnabled, mmpEnabled, liqTriggered, marginMode, unrealisedPnl, initMargin, maintMargin, orderMargin, askOrderMargin, bidOrderMargin, available, point, currency, ordersLimit, positionNotionalLimit); } @@ -296,14 +570,23 @@ public String toString() { 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(); } diff --git a/src/main/java/io/gate/gateapi/models/OptionsAccountBook.java b/src/main/java/io/gate/gateapi/models/OptionsAccountBook.java index e9c6ff1..0e71a07 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsAccountBook.java +++ b/src/main/java/io/gate/gateapi/models/OptionsAccountBook.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 @@ -111,7 +111,7 @@ public OptionsAccountBook type(String type) { } /** - * Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate + * 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 @@ -131,7 +131,7 @@ public OptionsAccountBook text(String text) { } /** - * custom text + * Remark * @return text **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsCandlestick.java b/src/main/java/io/gate/gateapi/models/OptionsCandlestick.java index 6776188..247eee0 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsCandlestick.java +++ b/src/main/java/io/gate/gateapi/models/OptionsCandlestick.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/OptionsContract.java b/src/main/java/io/gate/gateapi/models/OptionsContract.java index 49527e2..827a036 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsContract.java +++ b/src/main/java/io/gate/gateapi/models/OptionsContract.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; /** - * Options contract detail + * Options contract details */ public class OptionsContract { public static final String SERIALIZED_NAME_NAME = "name"; @@ -151,7 +151,7 @@ public OptionsContract tag(String tag) { } /** - * tag + * Tag * @return tag **/ @javax.annotation.Nullable @@ -171,7 +171,7 @@ public OptionsContract createTime(Double createTime) { } /** - * Creation time + * Created time * @return createTime **/ @javax.annotation.Nullable @@ -211,7 +211,7 @@ public OptionsContract isCall(Boolean isCall) { } /** - * `true` means call options, while `false` is put options + * `true` means call options, `false` means put options * @return isCall **/ @javax.annotation.Nullable @@ -351,7 +351,7 @@ public OptionsContract makerFeeRate(String makerFeeRate) { } /** - * Maker fee rate, where negative means rebate + * Maker fee rate, negative values indicate rebates * @return makerFeeRate **/ @javax.annotation.Nullable @@ -431,7 +431,7 @@ public OptionsContract orderSizeMin(Long orderSizeMin) { } /** - * Minimum order size the contract allowed + * Minimum order size allowed by the contract * @return orderSizeMin **/ @javax.annotation.Nullable @@ -451,7 +451,7 @@ public OptionsContract orderSizeMax(Long orderSizeMax) { } /** - * Maximum order size the contract allowed + * Maximum order size allowed by the contract * @return orderSizeMax **/ @javax.annotation.Nullable @@ -471,7 +471,7 @@ public OptionsContract 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 + * 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 @@ -491,7 +491,7 @@ public OptionsContract refDiscountRate(String refDiscountRate) { } /** - * Referral fee rate discount + * Trading fee discount for referred users * @return refDiscountRate **/ @javax.annotation.Nullable @@ -511,7 +511,7 @@ public OptionsContract refRebateRate(String refRebateRate) { } /** - * Referrer commission rate + * Commission rate for referrers * @return refRebateRate **/ @javax.annotation.Nullable @@ -531,7 +531,7 @@ public OptionsContract orderbookId(Long orderbookId) { } /** - * Current orderbook ID + * Orderbook update ID * @return orderbookId **/ @javax.annotation.Nullable @@ -571,7 +571,7 @@ public OptionsContract tradeSize(Long tradeSize) { } /** - * Historical accumulated trade size + * Historical cumulative trading volume * @return tradeSize **/ @javax.annotation.Nullable @@ -611,7 +611,7 @@ public OptionsContract 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/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 index 467bc43..4f46613 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsMySettlements.java +++ b/src/main/java/io/gate/gateapi/models/OptionsMySettlements.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 @@ -167,7 +167,7 @@ public OptionsMySettlements size(Long size) { } /** - * Size + * Settlement size * @return size **/ @javax.annotation.Nullable @@ -207,7 +207,7 @@ public OptionsMySettlements fee(String fee) { } /** - * Fee (quote currency) + * Settlement fee (quote currency) * @return fee **/ @javax.annotation.Nullable @@ -227,7 +227,7 @@ public OptionsMySettlements realisedPnl(String realisedPnl) { } /** - * The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (quote currency) + * Accumulated profit and loss from opening positions, including premium, fees, settlement profit, etc. (quote currency) * @return realisedPnl **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsMyTrade.java b/src/main/java/io/gate/gateapi/models/OptionsMyTrade.java index 2123e33..dd22f1f 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsMyTrade.java +++ b/src/main/java/io/gate/gateapi/models/OptionsMyTrade.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 @@ -52,7 +52,7 @@ public class OptionsMyTrade { private String underlyingPrice; /** - * Trade role. Available values are `taker` and `maker` + * Trade role. taker - taker, maker - maker */ @JsonAdapter(RoleEnum.Adapter.class) public enum RoleEnum { @@ -110,7 +110,7 @@ public OptionsMyTrade id(Long id) { } /** - * Trade ID + * Fill ID * @return id **/ @javax.annotation.Nullable @@ -130,7 +130,7 @@ public OptionsMyTrade createTime(Double createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -170,7 +170,7 @@ public OptionsMyTrade orderId(Integer orderId) { } /** - * Order ID related + * Related order ID * @return orderId **/ @javax.annotation.Nullable @@ -210,7 +210,7 @@ public OptionsMyTrade price(String price) { } /** - * Trading price (quote currency) + * Trade price (quote currency) * @return price **/ @javax.annotation.Nullable @@ -250,7 +250,7 @@ public OptionsMyTrade role(RoleEnum role) { } /** - * Trade role. Available values are `taker` and `maker` + * Trade role. taker - taker, maker - maker * @return role **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsOrder.java b/src/main/java/io/gate/gateapi/models/OptionsOrder.java index 406b3cd..e6616ac 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsOrder.java +++ b/src/main/java/io/gate/gateapi/models/OptionsOrder.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; /** - * Options order detail + * Options order details */ public class OptionsOrder { public static final String SERIALIZED_NAME_ID = "id"; @@ -40,7 +40,7 @@ public class OptionsOrder { 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 + * 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 { @@ -58,7 +58,9 @@ public enum FinishAsEnum { POSITION_CLOSED("position_closed"), - REDUCE_OUT("reduce_out"); + REDUCE_OUT("reduce_out"), + + MMP_CANCELLED("mmp_cancelled"); private String value; @@ -103,7 +105,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 { @@ -189,8 +191,16 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @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 - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee + * 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 { @@ -312,7 +322,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 + * 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 @@ -322,7 +332,7 @@ public FinishAsEnum getFinishAs() { /** - * Order status - `open`: waiting to be traded - `finished`: finished + * Order status - `open`: Pending - `finished`: Completed * @return status **/ @javax.annotation.Nullable @@ -338,7 +348,7 @@ public OptionsOrder contract(String contract) { } /** - * Contract name + * Options identifier * @return contract **/ public String getContract() { @@ -357,7 +367,7 @@ public OptionsOrder 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() { @@ -376,7 +386,7 @@ public OptionsOrder 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 @@ -396,7 +406,7 @@ public OptionsOrder price(String price) { } /** - * Order price. 0 for market order with `tif` set as `ioc` (USDT) + * Order price. Price of 0 with `tif` set as `ioc` represents market order (quote currency) * @return price **/ @javax.annotation.Nullable @@ -479,6 +489,36 @@ public Boolean getIsLiq() { } + 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; @@ -486,7 +526,7 @@ public OptionsOrder tif(TifEnum tif) { } /** - * 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 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 @@ -500,7 +540,7 @@ public void setTif(TifEnum tif) { } /** - * Size left to be traded + * Unfilled quantity * @return left **/ @javax.annotation.Nullable @@ -510,7 +550,7 @@ public Long getLeft() { /** - * Fill price of the order + * Fill price * @return fillPrice **/ @javax.annotation.Nullable @@ -560,7 +600,7 @@ public String getMkfr() { /** - * Reference user ID + * Referrer user ID * @return refu **/ @javax.annotation.Nullable @@ -602,6 +642,8 @@ public boolean equals(java.lang.Object o) { 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) && @@ -614,7 +656,7 @@ public boolean equals(java.lang.Object o) { @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, refr); + 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); } @@ -637,6 +679,8 @@ public String toString() { 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"); diff --git a/src/main/java/io/gate/gateapi/models/OptionsPosition.java b/src/main/java/io/gate/gateapi/models/OptionsPosition.java index ec0bc55..edf15aa 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsPosition.java +++ b/src/main/java/io/gate/gateapi/models/OptionsPosition.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,7 +21,7 @@ import java.io.IOException; /** - * Options position information + * Options contract position details */ public class OptionsPosition { public static final String SERIALIZED_NAME_USER = "user"; @@ -130,7 +130,7 @@ public String getContract() { /** - * Position size (contract size) + * Position size (contract quantity) * @return size **/ @javax.annotation.Nullable @@ -170,7 +170,7 @@ public String getMarkIv() { /** - * Realized PNL + * Realized PnL * @return realisedPnl **/ @javax.annotation.Nullable @@ -190,7 +190,7 @@ public String getUnrealisedPnl() { /** - * Current open orders + * Current pending order quantity * @return pendingOrders **/ @javax.annotation.Nullable @@ -220,7 +220,7 @@ public void setCloseOrder(OptionsPositionCloseOrder closeOrder) { } /** - * Delta + * Greek letter delta * @return delta **/ @javax.annotation.Nullable @@ -230,7 +230,7 @@ public String getDelta() { /** - * Gamma + * Greek letter gamma * @return gamma **/ @javax.annotation.Nullable @@ -240,7 +240,7 @@ public String getGamma() { /** - * Vega + * Greek letter vega * @return vega **/ @javax.annotation.Nullable @@ -250,7 +250,7 @@ public String getVega() { /** - * Theta + * Greek letter theta * @return theta **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsPositionClose.java b/src/main/java/io/gate/gateapi/models/OptionsPositionClose.java index 5ab526d..b381613 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsPositionClose.java +++ b/src/main/java/io/gate/gateapi/models/OptionsPositionClose.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 OptionsPositionClose { private String contract; /** - * Position side, long or short + * Position side - `long`: Long position - `short`: Short position */ @JsonAdapter(SideEnum.Adapter.class) public enum SideEnum { @@ -116,7 +116,7 @@ public String getContract() { /** - * Position side, long or short + * Position side - `long`: Long position - `short`: Short position * @return side **/ @javax.annotation.Nullable @@ -126,7 +126,7 @@ public SideEnum getSide() { /** - * PNL + * PnL * @return pnl **/ @javax.annotation.Nullable @@ -136,7 +136,7 @@ public String getPnl() { /** - * Text of close order + * Source of close order. See `order.text` field for specific values * @return text **/ @javax.annotation.Nullable @@ -146,7 +146,7 @@ public String getText() { /** - * settlement size + * Settlement size * @return settleSize **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsPositionCloseOrder.java b/src/main/java/io/gate/gateapi/models/OptionsPositionCloseOrder.java index 7a2f9cb..0661e85 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsPositionCloseOrder.java +++ b/src/main/java/io/gate/gateapi/models/OptionsPositionCloseOrder.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 OptionsPositionCloseOrder { public static final String SERIALIZED_NAME_ID = "id"; @@ -43,7 +43,7 @@ public OptionsPositionCloseOrder id(Long id) { } /** - * Close order ID + * Order ID * @return id **/ @javax.annotation.Nullable @@ -63,7 +63,7 @@ public OptionsPositionCloseOrder price(String price) { } /** - * Close order price (quote currency) + * Order price (quote currency) * @return price **/ @javax.annotation.Nullable @@ -83,7 +83,7 @@ public OptionsPositionCloseOrder 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/OptionsSettlement.java b/src/main/java/io/gate/gateapi/models/OptionsSettlement.java index 887a20b..dc34021 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsSettlement.java +++ b/src/main/java/io/gate/gateapi/models/OptionsSettlement.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 @@ -55,7 +55,7 @@ public OptionsSettlement time(Double time) { } /** - * Last changed time of configuration + * Last configuration update time * @return time **/ @javax.annotation.Nullable @@ -95,7 +95,7 @@ public OptionsSettlement profit(String profit) { } /** - * Settlement profit per size (quote currency) + * Settlement profit per contract (quote currency) * @return profit **/ @javax.annotation.Nullable @@ -115,7 +115,7 @@ public OptionsSettlement fee(String fee) { } /** - * Settlement fee per size (quote currency) + * Settlement fee per contract (quote currency) * @return fee **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsTicker.java b/src/main/java/io/gate/gateapi/models/OptionsTicker.java index 50ff736..e04290f 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsTicker.java +++ b/src/main/java/io/gate/gateapi/models/OptionsTicker.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; /** - * Options contract detail + * Options contract details */ public class OptionsTicker { public static final String SERIALIZED_NAME_NAME = "name"; @@ -123,7 +123,7 @@ public OptionsTicker lastPrice(String lastPrice) { } /** - * Last trading price (quote currency) + * Last trade price (quote currency) * @return lastPrice **/ @javax.annotation.Nullable @@ -363,7 +363,7 @@ public OptionsTicker delta(String delta) { } /** - * Delta + * Greek letter delta * @return delta **/ @javax.annotation.Nullable @@ -383,7 +383,7 @@ public OptionsTicker gamma(String gamma) { } /** - * Gamma + * Greek letter gamma * @return gamma **/ @javax.annotation.Nullable @@ -403,7 +403,7 @@ public OptionsTicker vega(String vega) { } /** - * Vega + * Greek letter vega * @return vega **/ @javax.annotation.Nullable @@ -423,7 +423,7 @@ public OptionsTicker theta(String theta) { } /** - * Theta + * Greek letter theta * @return theta **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/OptionsUnderlying.java b/src/main/java/io/gate/gateapi/models/OptionsUnderlying.java index 306b613..883ff74 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsUnderlying.java +++ b/src/main/java/io/gate/gateapi/models/OptionsUnderlying.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/OptionsUnderlyingTicker.java b/src/main/java/io/gate/gateapi/models/OptionsUnderlyingTicker.java index e36a048..d77ea4b 100644 --- a/src/main/java/io/gate/gateapi/models/OptionsUnderlyingTicker.java +++ b/src/main/java/io/gate/gateapi/models/OptionsUnderlyingTicker.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/Order.java b/src/main/java/io/gate/gateapi/models/Order.java index 65b26a8..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 @@ -109,7 +109,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private String currencyPair; /** - * Order Type - limit : Limit Order - market : Market Order + * Order Type - limit : Limit Order - market : Market Order */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -159,63 +159,12 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type = TypeEnum.LIMIT; - /** - * Account type, spot - spot account, margin - margin account, cross_margin - cross margin account, portfolio - portfolio account Portfolio margin account must set to `cross_margin` - */ - @JsonAdapter(AccountEnum.Adapter.class) - public enum AccountEnum { - SPOT("spot"), - - MARGIN("margin"), - - CROSS_MARGIN("cross_margin"), - - PORTFOLIO("portfolio"); - - 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 { @@ -344,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; @@ -397,7 +350,7 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 { @@ -452,7 +405,7 @@ public StpActEnum read(final JsonReader jsonReader) throws IOException { 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 + * 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 { @@ -462,9 +415,23 @@ public enum FinishAsEnum { CANCELLED("cancelled"), + LIQUIDATE_CANCELLED("liquidate_cancelled"), + + DEPTH_NOT_ENOUGH("depth_not_enough"), + + TRADER_NOT_ENOUGH("trader_not_enough"), + + SMALL("small"), + IOC("ioc"), - STP("stp"); + POC("poc"), + + FOK("fok"), + + STP("stp"), + + UNKNOWN("unknown"); private String value; @@ -508,6 +475,10 @@ public FinishAsEnum read(final JsonReader jsonReader) throws IOException { @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 @@ -625,7 +596,7 @@ public Order type(TypeEnum type) { } /** - * Order Type - limit : Limit Order - market : Market Order + * Order Type - limit : Limit Order - market : Market Order * @return type **/ @javax.annotation.Nullable @@ -638,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 - spot account, margin - margin account, cross_margin - cross margin account, portfolio - portfolio account Portfolio margin account must set to `cross_margin` + * 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; } @@ -665,7 +636,7 @@ public Order side(SideEnum side) { } /** - * Order side + * Buy or sell order * @return side **/ public SideEnum getSide() { @@ -684,7 +655,7 @@ public Order amount(String amount) { } /** - * When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` + * 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() { @@ -703,7 +674,7 @@ public Order price(String price) { } /** - * Price can't be empty when `type`= `limit` + * Trading price, required when `type`=`limit` * @return price **/ @javax.annotation.Nullable @@ -743,7 +714,7 @@ public Order iceberg(String iceberg) { } /** - * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. + * Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported * @return iceberg **/ @javax.annotation.Nullable @@ -763,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 @@ -783,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 @@ -806,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 @@ -877,7 +858,7 @@ public String getGtFee() { /** - * GT used to deduct maker fee + * GT amount used to deduct maker fee * @return gtMakerFee **/ @javax.annotation.Nullable @@ -887,7 +868,7 @@ public String getGtMakerFee() { /** - * GT used to deduct taker fee + * GT amount used to deduct taker fee * @return gtTakerFee **/ @javax.annotation.Nullable @@ -897,7 +878,7 @@ public String getGtTakerFee() { /** - * Whether GT fee discount is used + * Whether GT fee deduction is enabled * @return gtDiscount **/ @javax.annotation.Nullable @@ -943,7 +924,7 @@ public Order stpAct(StpActEnum stpAct) { } /** - * 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, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled + * 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 @@ -957,7 +938,7 @@ public void setStpAct(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 + * 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 @@ -965,6 +946,26 @@ 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) { @@ -993,6 +994,7 @@ 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) && @@ -1007,12 +1009,13 @@ public boolean equals(java.lang.Object o) { 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.finishAs, order.finishAs) && + Objects.equals(this.actionMode, order.actionMode); } @Override public int hashCode() { - return Objects.hash(id, text, amendText, createTime, updateTime, createTimeMs, updateTimeMs, status, currencyPair, type, account, side, amount, price, timeInForce, iceberg, autoBorrow, autoRepay, left, fillPrice, filledTotal, avgDealPrice, fee, feeCurrency, pointFee, gtFee, gtMakerFee, gtTakerFee, gtDiscount, rebatedFee, rebatedFeeCurrency, stpId, stpAct, finishAs); + 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); } @@ -1039,6 +1042,7 @@ 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"); @@ -1054,6 +1058,7 @@ public String toString() { 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 index 2d8ca1f..da8eeb3 100644 --- a/src/main/java/io/gate/gateapi/models/OrderPatch.java +++ b/src/main/java/io/gate/gateapi/models/OrderPatch.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 @@ * 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; @@ -35,6 +43,50 @@ public class OrderPatch { @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) { @@ -43,7 +95,7 @@ public OrderPatch amount(String amount) { } /** - * New order amount. `amount` and `price` must specify one of them + * Trading quantity. Either `amount` or `price` must be specified * @return amount **/ @javax.annotation.Nullable @@ -63,7 +115,7 @@ public OrderPatch price(String price) { } /** - * New order price. `amount` and `Price` must specify one of them\" + * Trading price. Either `amount` or `price` must be specified * @return price **/ @javax.annotation.Nullable @@ -83,7 +135,7 @@ public OrderPatch amendText(String amendText) { } /** - * Custom info during amending order + * Custom info during order amendment * @return amendText **/ @javax.annotation.Nullable @@ -95,6 +147,26 @@ public String getAmendText() { 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) { @@ -104,14 +176,17 @@ public boolean equals(java.lang.Object o) { return false; } OrderPatch orderPatch = (OrderPatch) o; - return Objects.equals(this.amount, orderPatch.amount) && + 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.amendText, orderPatch.amendText) && + Objects.equals(this.actionMode, orderPatch.actionMode); } @Override public int hashCode() { - return Objects.hash(amount, price, amendText); + return Objects.hash(currencyPair, account, amount, price, amendText, actionMode); } @@ -119,9 +194,12 @@ public int hashCode() { 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(); } diff --git a/src/main/java/io/gate/gateapi/models/OrderResp.java b/src/main/java/io/gate/gateapi/models/OrderResp.java index 07fdfdf..024ca14 100644 --- a/src/main/java/io/gate/gateapi/models/OrderResp.java +++ b/src/main/java/io/gate/gateapi/models/OrderResp.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/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 index 8e7e06a..5015c6b 100644 --- a/src/main/java/io/gate/gateapi/models/PatchUniLend.java +++ b/src/main/java/io/gate/gateapi/models/PatchUniLend.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/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/PortfolioAccount.java b/src/main/java/io/gate/gateapi/models/PortfolioAccount.java deleted file mode 100644 index 8a4535d..0000000 --- a/src/main/java/io/gate/gateapi/models/PortfolioAccount.java +++ /dev/null @@ -1,491 +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.PortfolioMarginBalance; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * PortfolioAccount - */ -public class PortfolioAccount { - 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_INTEREST = "interest"; - @SerializedName(SERIALIZED_NAME_INTEREST) - private String interest; - - 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_PORTFOLIO_MARGIN_TOTAL = "portfolio_margin_total"; - @SerializedName(SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL) - private String portfolioMarginTotal; - - public static final String SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_LIAB = "portfolio_margin_total_liab"; - @SerializedName(SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_LIAB) - private String portfolioMarginTotalLiab; - - public static final String SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_EQUITY = "portfolio_margin_total_equity"; - @SerializedName(SERIALIZED_NAME_PORTFOLIO_MARGIN_TOTAL_EQUITY) - private String portfolioMarginTotalEquity; - - - public PortfolioAccount 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 PortfolioAccount refreshTime(Long refreshTime) { - - this.refreshTime = refreshTime; - return this; - } - - /** - * Time of the most recent refresh - * @return refreshTime - **/ - @javax.annotation.Nullable - public Long getRefreshTime() { - return refreshTime; - } - - - public void setRefreshTime(Long refreshTime) { - this.refreshTime = refreshTime; - } - - public PortfolioAccount 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 PortfolioAccount balances(Map balances) { - - this.balances = balances; - return this; - } - - public PortfolioAccount putBalancesItem(String key, PortfolioMarginBalance 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 PortfolioAccount total(String total) { - - this.total = total; - return this; - } - - /** - * Total account value in USDT, i.e., the sum of all currencies' - * @return total - **/ - @javax.annotation.Nullable - public String getTotal() { - return total; - } - - - public void setTotal(String total) { - this.total = total; - } - - public PortfolioAccount borrowed(String borrowed) { - - this.borrowed = borrowed; - return this; - } - - /** - * Total borrowed value in USDT, i.e., the sum of all currencies - * @return borrowed - **/ - @javax.annotation.Nullable - public String getBorrowed() { - return borrowed; - } - - - public void setBorrowed(String borrowed) { - this.borrowed = borrowed; - } - - public PortfolioAccount interest(String interest) { - - this.interest = interest; - return this; - } - - /** - * Total unpaid interests in USDT, i.e., the sum of all currencies - * @return interest - **/ - @javax.annotation.Nullable - public String getInterest() { - return interest; - } - - - public void setInterest(String interest) { - this.interest = interest; - } - - public PortfolioAccount 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 PortfolioAccount 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 PortfolioAccount 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 PortfolioAccount 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 PortfolioAccount 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 PortfolioAccount 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; - } - - public PortfolioAccount portfolioMarginTotal(String portfolioMarginTotal) { - - this.portfolioMarginTotal = portfolioMarginTotal; - return this; - } - - /** - * Total margin balance of the account - * @return portfolioMarginTotal - **/ - @javax.annotation.Nullable - public String getPortfolioMarginTotal() { - return portfolioMarginTotal; - } - - - public void setPortfolioMarginTotal(String portfolioMarginTotal) { - this.portfolioMarginTotal = portfolioMarginTotal; - } - - public PortfolioAccount portfolioMarginTotalLiab(String portfolioMarginTotalLiab) { - - this.portfolioMarginTotalLiab = portfolioMarginTotalLiab; - return this; - } - - /** - * Total liabilities of the account - * @return portfolioMarginTotalLiab - **/ - @javax.annotation.Nullable - public String getPortfolioMarginTotalLiab() { - return portfolioMarginTotalLiab; - } - - - public void setPortfolioMarginTotalLiab(String portfolioMarginTotalLiab) { - this.portfolioMarginTotalLiab = portfolioMarginTotalLiab; - } - - public PortfolioAccount portfolioMarginTotalEquity(String portfolioMarginTotalEquity) { - - this.portfolioMarginTotalEquity = portfolioMarginTotalEquity; - return this; - } - - /** - * Total equity of the account - * @return portfolioMarginTotalEquity - **/ - @javax.annotation.Nullable - public String getPortfolioMarginTotalEquity() { - return portfolioMarginTotalEquity; - } - - - public void setPortfolioMarginTotalEquity(String portfolioMarginTotalEquity) { - this.portfolioMarginTotalEquity = portfolioMarginTotalEquity; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PortfolioAccount portfolioAccount = (PortfolioAccount) o; - return Objects.equals(this.userId, portfolioAccount.userId) && - Objects.equals(this.refreshTime, portfolioAccount.refreshTime) && - Objects.equals(this.locked, portfolioAccount.locked) && - Objects.equals(this.balances, portfolioAccount.balances) && - Objects.equals(this.total, portfolioAccount.total) && - Objects.equals(this.borrowed, portfolioAccount.borrowed) && - Objects.equals(this.interest, portfolioAccount.interest) && - Objects.equals(this.totalInitialMargin, portfolioAccount.totalInitialMargin) && - Objects.equals(this.totalMarginBalance, portfolioAccount.totalMarginBalance) && - Objects.equals(this.totalMaintenanceMargin, portfolioAccount.totalMaintenanceMargin) && - Objects.equals(this.totalInitialMarginRate, portfolioAccount.totalInitialMarginRate) && - Objects.equals(this.totalMaintenanceMarginRate, portfolioAccount.totalMaintenanceMarginRate) && - Objects.equals(this.totalAvailableMargin, portfolioAccount.totalAvailableMargin) && - Objects.equals(this.portfolioMarginTotal, portfolioAccount.portfolioMarginTotal) && - Objects.equals(this.portfolioMarginTotalLiab, portfolioAccount.portfolioMarginTotalLiab) && - Objects.equals(this.portfolioMarginTotalEquity, portfolioAccount.portfolioMarginTotalEquity); - } - - @Override - public int hashCode() { - return Objects.hash(userId, refreshTime, locked, balances, total, borrowed, interest, totalInitialMargin, totalMarginBalance, totalMaintenanceMargin, totalInitialMarginRate, totalMaintenanceMarginRate, totalAvailableMargin, portfolioMarginTotal, portfolioMarginTotalLiab, portfolioMarginTotalEquity); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PortfolioAccount {\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(" interest: ").append(toIndentedString(interest)).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(" portfolioMarginTotal: ").append(toIndentedString(portfolioMarginTotal)).append("\n"); - sb.append(" portfolioMarginTotalLiab: ").append(toIndentedString(portfolioMarginTotalLiab)).append("\n"); - sb.append(" portfolioMarginTotalEquity: ").append(toIndentedString(portfolioMarginTotalEquity)).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/PortfolioMarginBalance.java b/src/main/java/io/gate/gateapi/models/PortfolioMarginBalance.java deleted file mode 100644 index c0f04e9..0000000 --- a/src/main/java/io/gate/gateapi/models/PortfolioMarginBalance.java +++ /dev/null @@ -1,297 +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; - -/** - * PortfolioMarginBalance - */ -public class PortfolioMarginBalance { - 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_INTEREST = "interest"; - @SerializedName(SERIALIZED_NAME_INTEREST) - private String interest; - - 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 PortfolioMarginBalance available(String available) { - - this.available = available; - return this; - } - - /** - * Available amount - * @return available - **/ - @javax.annotation.Nullable - public String getAvailable() { - return available; - } - - - public void setAvailable(String available) { - this.available = available; - } - - public PortfolioMarginBalance freeze(String freeze) { - - this.freeze = freeze; - return this; - } - - /** - * Locked amount - * @return freeze - **/ - @javax.annotation.Nullable - public String getFreeze() { - return freeze; - } - - - public void setFreeze(String freeze) { - this.freeze = freeze; - } - - public PortfolioMarginBalance borrowed(String borrowed) { - - this.borrowed = borrowed; - return this; - } - - /** - * Borrowed amount - * @return borrowed - **/ - @javax.annotation.Nullable - public String getBorrowed() { - return borrowed; - } - - - public void setBorrowed(String borrowed) { - this.borrowed = borrowed; - } - - public PortfolioMarginBalance interest(String interest) { - - this.interest = interest; - return this; - } - - /** - * Unpaid interests - * @return interest - **/ - @javax.annotation.Nullable - public String getInterest() { - return interest; - } - - - public void setInterest(String interest) { - this.interest = interest; - } - - public PortfolioMarginBalance negativeLiab(String negativeLiab) { - - this.negativeLiab = negativeLiab; - return this; - } - - /** - * Negative Liabilities - * @return negativeLiab - **/ - @javax.annotation.Nullable - public String getNegativeLiab() { - return negativeLiab; - } - - - public void setNegativeLiab(String negativeLiab) { - this.negativeLiab = negativeLiab; - } - - public PortfolioMarginBalance futuresPosLiab(String futuresPosLiab) { - - this.futuresPosLiab = futuresPosLiab; - return this; - } - - /** - * Borrowing to Open Positions in Futures - * @return futuresPosLiab - **/ - @javax.annotation.Nullable - public String getFuturesPosLiab() { - return futuresPosLiab; - } - - - public void setFuturesPosLiab(String futuresPosLiab) { - this.futuresPosLiab = futuresPosLiab; - } - - public PortfolioMarginBalance equity(String equity) { - - this.equity = equity; - return this; - } - - /** - * Equity - * @return equity - **/ - @javax.annotation.Nullable - public String getEquity() { - return equity; - } - - - public void setEquity(String equity) { - this.equity = equity; - } - - public PortfolioMarginBalance totalFreeze(String totalFreeze) { - - this.totalFreeze = totalFreeze; - return this; - } - - /** - * Total freeze - * @return totalFreeze - **/ - @javax.annotation.Nullable - public String getTotalFreeze() { - return totalFreeze; - } - - - public void setTotalFreeze(String totalFreeze) { - this.totalFreeze = totalFreeze; - } - - public PortfolioMarginBalance totalLiab(String totalLiab) { - - this.totalLiab = totalLiab; - return this; - } - - /** - * Total liabilities - * @return totalLiab - **/ - @javax.annotation.Nullable - public String getTotalLiab() { - return totalLiab; - } - - - public void setTotalLiab(String totalLiab) { - this.totalLiab = totalLiab; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PortfolioMarginBalance portfolioMarginBalance = (PortfolioMarginBalance) o; - return Objects.equals(this.available, portfolioMarginBalance.available) && - Objects.equals(this.freeze, portfolioMarginBalance.freeze) && - Objects.equals(this.borrowed, portfolioMarginBalance.borrowed) && - Objects.equals(this.interest, portfolioMarginBalance.interest) && - Objects.equals(this.negativeLiab, portfolioMarginBalance.negativeLiab) && - Objects.equals(this.futuresPosLiab, portfolioMarginBalance.futuresPosLiab) && - Objects.equals(this.equity, portfolioMarginBalance.equity) && - Objects.equals(this.totalFreeze, portfolioMarginBalance.totalFreeze) && - Objects.equals(this.totalLiab, portfolioMarginBalance.totalLiab); - } - - @Override - public int hashCode() { - return Objects.hash(available, freeze, borrowed, interest, negativeLiab, futuresPosLiab, equity, totalFreeze, totalLiab); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PortfolioMarginBalance {\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(" interest: ").append(toIndentedString(interest)).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("}"); - 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 7e25abb..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 @@ -88,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; @@ -117,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 { @@ -177,6 +189,26 @@ public ModeEnum read(final JsonReader jsonReader) throws IOException { @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 @@ -359,7 +391,7 @@ public String getUnrealisedPnl() { /** - * Realized PNL + * Realized PnL * @return realisedPnl **/ @javax.annotation.Nullable @@ -369,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 @@ -419,7 +481,7 @@ public Integer getAdlRanking() { /** - * Current open orders + * Current pending order quantity * @return pendingOrders **/ @javax.annotation.Nullable @@ -455,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 @@ -475,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 @@ -497,6 +559,66 @@ 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) { @@ -522,6 +644,9 @@ public boolean equals(java.lang.Object o) { 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) && @@ -531,12 +656,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.closeOrder, position.closeOrder) && Objects.equals(this.mode, position.mode) && Objects.equals(this.crossLeverageLimit, position.crossLeverageLimit) && - Objects.equals(this.updateTime, position.updateTime); + 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, initialMargin, maintenanceMargin, unrealisedPnl, realisedPnl, historyPnl, lastClosePnl, realisedPoint, historyPoint, adlRanking, pendingOrders, closeOrder, mode, crossLeverageLimit, updateTime); + 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); } @@ -560,6 +690,9 @@ public String toString() { 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"); @@ -570,6 +703,11 @@ public String toString() { 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 index a582469..a1ab151 100644 --- a/src/main/java/io/gate/gateapi/models/RepayLoan.java +++ b/src/main/java/io/gate/gateapi/models/RepayLoan.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 @@ -81,7 +81,7 @@ public RepayLoan repaidAll(Boolean repaidAll) { } /** - * Repayment method, set to `true` for full repayment, and `false` for partial repayment; When set to false for partial repayment, the repay_amount parameter cannot be greater than the remaining amount to be repaid by the user. + * 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() { 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 index 0357994..ca9dee6 100644 --- a/src/main/java/io/gate/gateapi/models/RepayRecord.java +++ b/src/main/java/io/gate/gateapi/models/RepayRecord.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 @@ -163,7 +163,7 @@ public RepayRecord collateralCurrency(String collateralCurrency) { } /** - * Collateral + * Collateral currency * @return collateralCurrency **/ @javax.annotation.Nullable @@ -183,7 +183,7 @@ public RepayRecord initLtv(String initLtv) { } /** - * The initial collateralization rate + * Initial collateralization rate * @return initLtv **/ @javax.annotation.Nullable @@ -303,7 +303,7 @@ public RepayRecord beforeLeftCollateral(String beforeLeftCollateral) { } /** - * Collateral quantity before repayment + * Collateral amount before repayment * @return beforeLeftCollateral **/ @javax.annotation.Nullable @@ -323,7 +323,7 @@ public RepayRecord afterLeftCollateral(String afterLeftCollateral) { } /** - * Collateral quantity after repayment + * Collateral amount after repayment * @return afterLeftCollateral **/ @javax.annotation.Nullable 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/RepayRequest.java b/src/main/java/io/gate/gateapi/models/RepayRequest.java deleted file mode 100644 index 8c83520..0000000 --- a/src/main/java/io/gate/gateapi/models/RepayRequest.java +++ /dev/null @@ -1,211 +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; - -/** - * RepayRequest - */ -public class RepayRequest { - 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; - - /** - * Repay mode. all - repay all; partial - repay only some portion - */ - @JsonAdapter(ModeEnum.Adapter.class) - public enum ModeEnum { - ALL("all"), - - PARTIAL("partial"); - - private String value; - - ModeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ModeEnum fromValue(String value) { - for (ModeEnum b : ModeEnum.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 ModeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ModeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ModeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_MODE = "mode"; - @SerializedName(SERIALIZED_NAME_MODE) - private ModeEnum mode; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private String amount; - - - public RepayRequest 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 RepayRequest 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 RepayRequest mode(ModeEnum mode) { - - this.mode = mode; - return this; - } - - /** - * Repay mode. all - repay all; partial - repay only some portion - * @return mode - **/ - public ModeEnum getMode() { - return mode; - } - - - public void setMode(ModeEnum mode) { - this.mode = mode; - } - - public RepayRequest amount(String amount) { - - this.amount = amount; - return this; - } - - /** - * Repay amount. Required in `partial` mode - * @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; - } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(currencyPair, currency, mode, amount); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RepayRequest {\n"); - sb.append(" currencyPair: ").append(toIndentedString(currencyPair)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" mode: ").append(toIndentedString(mode)).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/RepayResp.java b/src/main/java/io/gate/gateapi/models/RepayResp.java index 3280ef1..708657a 100644 --- a/src/main/java/io/gate/gateapi/models/RepayResp.java +++ b/src/main/java/io/gate/gateapi/models/RepayResp.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/Repayment.java b/src/main/java/io/gate/gateapi/models/Repayment.java deleted file mode 100644 index 27920e9..0000000 --- a/src/main/java/io/gate/gateapi/models/Repayment.java +++ /dev/null @@ -1,167 +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; - -/** - * Repayment - */ -public class Repayment { - 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_PRINCIPAL = "principal"; - @SerializedName(SERIALIZED_NAME_PRINCIPAL) - private String principal; - - public static final String SERIALIZED_NAME_INTEREST = "interest"; - @SerializedName(SERIALIZED_NAME_INTEREST) - private String interest; - - - public Repayment 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 Repayment createTime(String createTime) { - - this.createTime = createTime; - return this; - } - - /** - * Repayment time - * @return createTime - **/ - @javax.annotation.Nullable - public String getCreateTime() { - return createTime; - } - - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public Repayment principal(String principal) { - - this.principal = principal; - return this; - } - - /** - * Repaid principal - * @return principal - **/ - @javax.annotation.Nullable - public String getPrincipal() { - return principal; - } - - - public void setPrincipal(String principal) { - this.principal = principal; - } - - public Repayment interest(String interest) { - - this.interest = interest; - return this; - } - - /** - * Repaid interest - * @return interest - **/ - @javax.annotation.Nullable - public String getInterest() { - return interest; - } - - - public void setInterest(String interest) { - this.interest = interest; - } - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(id, createTime, principal, interest); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Repayment {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(); - } - - /** - * 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 index dfb393b..5194f10 100644 --- a/src/main/java/io/gate/gateapi/models/SavedAddress.java +++ b/src/main/java/io/gate/gateapi/models/SavedAddress.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/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/SpotAccountBook.java b/src/main/java/io/gate/gateapi/models/SpotAccountBook.java index a136761..f4f618d 100644 --- a/src/main/java/io/gate/gateapi/models/SpotAccountBook.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 @@ -47,6 +47,10 @@ public class SpotAccountBook { @SerializedName(SERIALIZED_NAME_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; @@ -159,7 +163,7 @@ public SpotAccountBook type(String type) { } /** - * Account book type. Please refer to [account book type](#accountbook-type) for more detail + * Account book type. Please refer to [account book type](#accountbook-type) for more detail * @return type **/ @javax.annotation.Nullable @@ -172,6 +176,26 @@ 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; @@ -206,12 +230,13 @@ public boolean equals(java.lang.Object o) { 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, text); + return Objects.hash(id, time, currency, change, balance, type, code, text); } @@ -225,6 +250,7 @@ public String toString() { 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 index 0e82538..d81a14e 100644 --- a/src/main/java/io/gate/gateapi/models/SpotFee.java +++ b/src/main/java/io/gate/gateapi/models/SpotFee.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 @@ -59,6 +59,10 @@ public class SpotFee { @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) { @@ -127,7 +131,7 @@ public SpotFee gtDiscount(Boolean gtDiscount) { } /** - * If GT deduction is enabled + * Whether GT deduction discount is enabled * @return gtDiscount **/ @javax.annotation.Nullable @@ -167,7 +171,7 @@ public SpotFee 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 @@ -207,7 +211,7 @@ public SpotFee 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 @@ -239,6 +243,26 @@ public String getCurrencyPair() { 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) { @@ -256,12 +280,13 @@ public boolean equals(java.lang.Object o) { 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.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); + return Objects.hash(userId, takerFee, makerFee, gtDiscount, gtTakerFee, gtMakerFee, loanFee, pointType, currencyPair, debitFee); } @@ -278,6 +303,7 @@ public String toString() { 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(); } 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 6be752b..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,7 +134,7 @@ public SideEnum read(final JsonReader jsonReader) throws IOException { private String amount; /** - * Trading account type. Portfolio margin account must set to `cross_margin` - normal: spot trading - margin: margin trading - cross_margin: cross_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 { @@ -95,7 +142,7 @@ public enum AccountEnum { MARGIN("margin"), - CROSS_MARGIN("cross_margin"); + UNIFIED("unified"); private String value; @@ -190,24 +237,36 @@ public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) 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; } @@ -256,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() { @@ -275,7 +334,7 @@ public SpotPricePutOrder account(AccountEnum account) { } /** - * Trading account type. Portfolio margin account must set to `cross_margin` - normal: spot trading - margin: margin trading - cross_margin: cross_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() { @@ -306,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) { @@ -320,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); } @@ -339,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 1a2985f..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"; @@ -131,7 +131,7 @@ public SpotPriceTriggeredOrder market(String market) { } /** - * Currency pair + * Market * @return market **/ public String getMarket() { @@ -144,7 +144,7 @@ public void setMarket(String market) { } /** - * Creation time + * Created time * @return ctime **/ @javax.annotation.Nullable @@ -154,7 +154,7 @@ public Long getCtime() { /** - * Finished time + * End time * @return ftime **/ @javax.annotation.Nullable @@ -164,7 +164,7 @@ public Long getFtime() { /** - * 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/StpGroup.java b/src/main/java/io/gate/gateapi/models/StpGroup.java index 08cf63b..bc53e57 100644 --- a/src/main/java/io/gate/gateapi/models/StpGroup.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 @@ -106,7 +106,7 @@ public StpGroup createTime(Long createTime) { } /** - * Creation time + * Created time * @return createTime **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/StpGroupUser.java b/src/main/java/io/gate/gateapi/models/StpGroupUser.java index 60ad0d5..f69d405 100644 --- a/src/main/java/io/gate/gateapi/models/StpGroupUser.java +++ b/src/main/java/io/gate/gateapi/models/StpGroupUser.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 @@ -83,7 +83,7 @@ public StpGroupUser createTime(Long createTime) { } /** - * Creation time + * Created time * @return createTime **/ @javax.annotation.Nullable 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 index a585182..29635d8 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccount.java +++ b/src/main/java/io/gate/gateapi/models/SubAccount.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,7 +63,7 @@ public SubAccount remark(String remark) { } /** - * custom text + * Remark * @return remark **/ @javax.annotation.Nullable @@ -83,7 +83,7 @@ public SubAccount loginName(String loginName) { } /** - * Sub-account login name: Only letters, numbers and underscores are supported, and cannot contain other illegal characters + * Sub-account login name: Only letters, numbers and underscores are supported, cannot contain other invalid characters * @return loginName **/ public String getLoginName() { @@ -136,7 +136,7 @@ public void setEmail(String email) { } /** - * State: 1-normal, 2-locked\" + * Sub-account status: 1-normal, 2-locked * @return state **/ @javax.annotation.Nullable @@ -146,7 +146,7 @@ public Integer getState() { /** - * \"Sub-account type: 1 - sub-account, 3 - cross margin account + * Sub-account type: 1-Regular sub-account, 3-Cross margin sub-account * @return type **/ @javax.annotation.Nullable @@ -156,7 +156,7 @@ public Integer getType() { /** - * The user id of the sub-account + * Sub-account user ID * @return userId **/ @javax.annotation.Nullable 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 index 5724aef..b1b2c3f 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccountCrossMarginBalance.java +++ b/src/main/java/io/gate/gateapi/models/SubAccountCrossMarginBalance.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/SubAccountFuturesBalance.java b/src/main/java/io/gate/gateapi/models/SubAccountFuturesBalance.java index 6447e60..8b01461 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccountFuturesBalance.java +++ b/src/main/java/io/gate/gateapi/models/SubAccountFuturesBalance.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/SubAccountKey.java b/src/main/java/io/gate/gateapi/models/SubAccountKey.java index 95836ec..3725e4b 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccountKey.java +++ b/src/main/java/io/gate/gateapi/models/SubAccountKey.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,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.gate.gateapi.models.ApiV4KeyPerm; +import io.gate.gateapi.models.SubAccountKeyPerms; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -28,7 +28,7 @@ public class SubAccountKey { public static final String SERIALIZED_NAME_USER_ID = "user_id"; @SerializedName(SERIALIZED_NAME_USER_ID) - private String userId; + private Long userId; public static final String SERIALIZED_NAME_MODE = "mode"; @SerializedName(SERIALIZED_NAME_MODE) @@ -40,7 +40,7 @@ public class SubAccountKey { public static final String SERIALIZED_NAME_PERMS = "perms"; @SerializedName(SERIALIZED_NAME_PERMS) - private List perms = null; + private List perms = null; public static final String SERIALIZED_NAME_IP_WHITELIST = "ip_whitelist"; @SerializedName(SERIALIZED_NAME_IP_WHITELIST) @@ -56,11 +56,15 @@ public class SubAccountKey { public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + private Long createdAt; public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; + private Long updatedAt; + + public static final String SERIALIZED_NAME_LAST_ACCESS = "last_access"; + @SerializedName(SERIALIZED_NAME_LAST_ACCESS) + private Long lastAccess; /** @@ -68,7 +72,7 @@ public class SubAccountKey { * @return userId **/ @javax.annotation.Nullable - public String getUserId() { + public Long getUserId() { return userId; } @@ -100,7 +104,7 @@ public SubAccountKey name(String name) { } /** - * API key name + * API Key Name * @return name **/ @javax.annotation.Nullable @@ -113,13 +117,13 @@ public void setName(String name) { this.name = name; } - public SubAccountKey perms(List perms) { + public SubAccountKey perms(List perms) { this.perms = perms; return this; } - public SubAccountKey addPermsItem(ApiV4KeyPerm permsItem) { + public SubAccountKey addPermsItem(SubAccountKeyPerms permsItem) { if (this.perms == null) { this.perms = new ArrayList<>(); } @@ -132,12 +136,12 @@ public SubAccountKey addPermsItem(ApiV4KeyPerm permsItem) { * @return perms **/ @javax.annotation.Nullable - public List getPerms() { + public List getPerms() { return perms; } - public void setPerms(List perms) { + public void setPerms(List perms) { this.perms = perms; } @@ -156,7 +160,7 @@ public SubAccountKey addIpWhitelistItem(String ipWhitelistItem) { } /** - * ip white list (list will be removed if no value is passed) + * IP whitelist (list will be cleared if no value is passed) * @return ipWhitelist **/ @javax.annotation.Nullable @@ -180,7 +184,7 @@ public String getKey() { /** - * State 1 - normal 2 - locked 3 - frozen + * Status: 1-Normal 2-Frozen 3-Locked * @return state **/ @javax.annotation.Nullable @@ -190,24 +194,34 @@ public Integer getState() { /** - * Creation time + * Created time * @return createdAt **/ @javax.annotation.Nullable - public String getCreatedAt() { + public Long getCreatedAt() { return createdAt; } /** - * Last update time + * Last Update Time * @return updatedAt **/ @javax.annotation.Nullable - public String getUpdatedAt() { + 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) { @@ -225,12 +239,13 @@ public boolean equals(java.lang.Object o) { 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.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); + return Objects.hash(userId, mode, name, perms, ipWhitelist, key, state, createdAt, updatedAt, lastAccess); } @@ -247,6 +262,7 @@ public String toString() { 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(); } 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 index 57d80b4..6f1dae5 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccountMarginBalance.java +++ b/src/main/java/io/gate/gateapi/models/SubAccountMarginBalance.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/SubAccountToSubAccount.java b/src/main/java/io/gate/gateapi/models/SubAccountToSubAccount.java index b627d4b..9d99d91 100644 --- a/src/main/java/io/gate/gateapi/models/SubAccountToSubAccount.java +++ b/src/main/java/io/gate/gateapi/models/SubAccountToSubAccount.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,115 +35,17 @@ public class SubAccountToSubAccount { @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_FROM) private String subAccountFrom; - /** - * Transfer from the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account - */ - @JsonAdapter(SubAccountFromTypeEnum.Adapter.class) - public enum SubAccountFromTypeEnum { - SPOT("spot"), - - FUTURES("futures"), - - CROSS_MARGIN("cross_margin"); - - private String value; - - SubAccountFromTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SubAccountFromTypeEnum fromValue(String value) { - for (SubAccountFromTypeEnum b : SubAccountFromTypeEnum.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 SubAccountFromTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SubAccountFromTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SubAccountFromTypeEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_SUB_ACCOUNT_FROM_TYPE = "sub_account_from_type"; @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_FROM_TYPE) - private SubAccountFromTypeEnum subAccountFromType; + private String subAccountFromType; public static final String SERIALIZED_NAME_SUB_ACCOUNT_TO = "sub_account_to"; @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TO) private String subAccountTo; - /** - * Transfer to the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account - */ - @JsonAdapter(SubAccountToTypeEnum.Adapter.class) - public enum SubAccountToTypeEnum { - SPOT("spot"), - - FUTURES("futures"), - - CROSS_MARGIN("cross_margin"); - - private String value; - - SubAccountToTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SubAccountToTypeEnum fromValue(String value) { - for (SubAccountToTypeEnum b : SubAccountToTypeEnum.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 SubAccountToTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SubAccountToTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SubAccountToTypeEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_SUB_ACCOUNT_TO_TYPE = "sub_account_to_type"; @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TO_TYPE) - private SubAccountToTypeEnum subAccountToType; + private String subAccountToType; public static final String SERIALIZED_NAME_AMOUNT = "amount"; @SerializedName(SERIALIZED_NAME_AMOUNT) @@ -176,7 +78,7 @@ public SubAccountToSubAccount subAccountType(String subAccountType) { } /** - * Transfer from the account. (deprecate, use `sub_account_from_type` and `sub_account_to_type` instead) + * Transfer from account (deprecated, use `sub_account_from_type` and `sub_account_to_type` instead) * @return subAccountType **/ @javax.annotation.Nullable @@ -208,22 +110,22 @@ public void setSubAccountFrom(String subAccountFrom) { this.subAccountFrom = subAccountFrom; } - public SubAccountToSubAccount subAccountFromType(SubAccountFromTypeEnum subAccountFromType) { + public SubAccountToSubAccount subAccountFromType(String subAccountFromType) { this.subAccountFromType = subAccountFromType; return this; } /** - * Transfer from the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account + * Source sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account * @return subAccountFromType **/ - public SubAccountFromTypeEnum getSubAccountFromType() { + public String getSubAccountFromType() { return subAccountFromType; } - public void setSubAccountFromType(SubAccountFromTypeEnum subAccountFromType) { + public void setSubAccountFromType(String subAccountFromType) { this.subAccountFromType = subAccountFromType; } @@ -246,22 +148,22 @@ public void setSubAccountTo(String subAccountTo) { this.subAccountTo = subAccountTo; } - public SubAccountToSubAccount subAccountToType(SubAccountToTypeEnum subAccountToType) { + public SubAccountToSubAccount subAccountToType(String subAccountToType) { this.subAccountToType = subAccountToType; return this; } /** - * Transfer to the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account + * Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account * @return subAccountToType **/ - public SubAccountToTypeEnum getSubAccountToType() { + public String getSubAccountToType() { return subAccountToType; } - public void setSubAccountToType(SubAccountToTypeEnum subAccountToType) { + public void setSubAccountToType(String subAccountToType) { this.subAccountToType = subAccountToType; } diff --git a/src/main/java/io/gate/gateapi/models/SubAccountTransfer.java b/src/main/java/io/gate/gateapi/models/SubAccountTransfer.java index 8e94927..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,196 +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_DIRECTION = "direction"; + @SerializedName(SERIALIZED_NAME_DIRECTION) + private String direction; 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_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, `cross_margin` - cross margin account, `delivery` - delivery account - */ - @JsonAdapter(SubAccountTypeEnum.Adapter.class) - public enum SubAccountTypeEnum { - SPOT("spot"), - - FUTURES("futures"), - - CROSS_MARGIN("cross_margin"), - - DELIVERY("delivery"); - - 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_SUB_ACCOUNT_TYPE = "sub_account_type"; - @SerializedName(SERIALIZED_NAME_SUB_ACCOUNT_TYPE) - private SubAccountTypeEnum subAccountType = SubAccountTypeEnum.SPOT; - - - 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) { @@ -234,16 +125,25 @@ public void setAmount(String amount) { this.amount = amount; } + public SubAccountTransfer direction(String direction) { + + this.direction = direction; + return this; + } + /** - * Main account user ID - * @return uid + * Transfer direction: to - transfer into sub-account, from - transfer out from sub-account + * @return direction **/ - @javax.annotation.Nullable - public String getUid() { - return uid; + public String getDirection() { + return direction; } + public void setDirection(String direction) { + this.direction = direction; + } + public SubAccountTransfer clientOrderId(String clientOrderId) { this.clientOrderId = clientOrderId; @@ -251,7 +151,7 @@ public SubAccountTransfer clientOrderId(String clientOrderId) { } /** - * The custom ID provided by the customer serves as a safeguard against duplicate transfers. It can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_', with a length ranging from 1 to 64 characters. + * 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 @@ -263,46 +163,6 @@ public String getClientOrderId() { public void setClientOrderId(String clientOrderId) { this.clientOrderId = clientOrderId; } - - /** - * Transfer timestamp - * @return timest - **/ - @javax.annotation.Nullable - public String getTimest() { - return timest; - } - - - /** - * Where the operation is initiated from - * @return source - **/ - @javax.annotation.Nullable - public String getSource() { - return source; - } - - - public SubAccountTransfer subAccountType(SubAccountTypeEnum subAccountType) { - - this.subAccountType = subAccountType; - return this; - } - - /** - * Target sub user's account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account, `delivery` - delivery account - * @return subAccountType - **/ - @javax.annotation.Nullable - public SubAccountTypeEnum getSubAccountType() { - return subAccountType; - } - - - public void setSubAccountType(SubAccountTypeEnum subAccountType) { - this.subAccountType = subAccountType; - } @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -312,20 +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.clientOrderId, subAccountTransfer.clientOrderId) && - 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, clientOrderId, timest, source, subAccountType); + return Objects.hash(subAccount, subAccountType, currency, amount, direction, clientOrderId); } @@ -333,15 +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(" subAccountType: ").append(toIndentedString(subAccountType)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).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("}"); 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 index 73e2f2b..7111ea2 100644 --- a/src/main/java/io/gate/gateapi/models/SubCrossMarginAccount.java +++ b/src/main/java/io/gate/gateapi/models/SubCrossMarginAccount.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,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.gate.gateapi.models.CrossMarginBalance1; +import io.gate.gateapi.models.CrossMarginBalance; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -37,7 +37,7 @@ public class SubCrossMarginAccount { public static final String SERIALIZED_NAME_BALANCES = "balances"; @SerializedName(SERIALIZED_NAME_BALANCES) - private Map balances = null; + private Map balances = null; public static final String SERIALIZED_NAME_TOTAL = "total"; @SerializedName(SERIALIZED_NAME_TOTAL) @@ -99,7 +99,7 @@ public SubCrossMarginAccount userId(Long userId) { } /** - * User ID of the cross margin account. 0 means that the subaccount has not yet opened a cross margin account + * Cross margin account user ID. 0 means this sub-account has not yet opened a cross margin account * @return userId **/ @javax.annotation.Nullable @@ -119,7 +119,7 @@ public SubCrossMarginAccount locked(Boolean locked) { } /** - * Whether account is locked + * Whether the account is locked * @return locked **/ @javax.annotation.Nullable @@ -132,13 +132,13 @@ public void setLocked(Boolean locked) { this.locked = locked; } - public SubCrossMarginAccount balances(Map balances) { + public SubCrossMarginAccount balances(Map balances) { this.balances = balances; return this; } - public SubCrossMarginAccount putBalancesItem(String key, CrossMarginBalance1 balancesItem) { + public SubCrossMarginAccount putBalancesItem(String key, CrossMarginBalance balancesItem) { if (this.balances == null) { this.balances = new HashMap<>(); } @@ -151,12 +151,12 @@ public SubCrossMarginAccount putBalancesItem(String key, CrossMarginBalance1 bal * @return balances **/ @javax.annotation.Nullable - public Map getBalances() { + public Map getBalances() { return balances; } - public void setBalances(Map balances) { + public void setBalances(Map balances) { this.balances = balances; } @@ -207,7 +207,7 @@ public SubCrossMarginAccount borrowedNet(String borrowedNet) { } /** - * Total borrowed value in USDT * borrowed factor + * Total borrowed value in USDT * leverage factor * @return borrowedNet **/ @javax.annotation.Nullable @@ -267,7 +267,7 @@ public SubCrossMarginAccount interest(String interest) { } /** - * Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` + * Total unpaid interest in USDT, i.e., the sum of all currencies' `interest*price*discount` * @return interest **/ @javax.annotation.Nullable @@ -287,7 +287,7 @@ public SubCrossMarginAccount risk(String risk) { } /** - * Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` + * Risk rate. When it falls below 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` * @return risk **/ @javax.annotation.Nullable 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 index a041735..dae8438 100644 --- a/src/main/java/io/gate/gateapi/models/SystemTime.java +++ b/src/main/java/io/gate/gateapi/models/SystemTime.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/Ticker.java b/src/main/java/io/gate/gateapi/models/Ticker.java index 1529d06..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,10 +35,18 @@ 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; @@ -144,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; @@ -164,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; @@ -171,7 +219,7 @@ public Ticker changePercentage(String changePercentage) { } /** - * Change percentage in the last 24h + * 24h price change percentage (negative for decrease, e.g., -7.45) * @return changePercentage **/ @javax.annotation.Nullable @@ -191,7 +239,7 @@ public Ticker changeUtc0(String changeUtc0) { } /** - * utc0 timezone, the percentage change in the last 24 hours + * UTC+0 timezone, 24h price change percentage, negative for decline (e.g., -7.45) * @return changeUtc0 **/ @javax.annotation.Nullable @@ -211,7 +259,7 @@ public Ticker changeUtc8(String changeUtc8) { } /** - * utc8 timezone, the percentage change in the last 24 hours + * UTC+8 timezone, 24h price change percentage, negative for decline (e.g., -7.45) * @return changeUtc8 **/ @javax.annotation.Nullable @@ -231,7 +279,7 @@ public Ticker baseVolume(String baseVolume) { } /** - * Base currency trade volume in the last 24h + * Base currency trading volume in the last 24h * @return baseVolume **/ @javax.annotation.Nullable @@ -251,7 +299,7 @@ public Ticker quoteVolume(String quoteVolume) { } /** - * Quote currency trade volume in the last 24h + * Quote currency trading volume in the last 24h * @return quoteVolume **/ @javax.annotation.Nullable @@ -271,7 +319,7 @@ public Ticker high24h(String high24h) { } /** - * Highest price in 24h + * 24h High * @return high24h **/ @javax.annotation.Nullable @@ -291,7 +339,7 @@ public Ticker low24h(String low24h) { } /** - * Lowest price in 24h + * 24h Low * @return low24h **/ @javax.annotation.Nullable @@ -331,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 @@ -351,7 +399,7 @@ public Ticker etfPreTimestamp(Long etfPreTimestamp) { } /** - * ETF previous re-balancing time + * ETF previous rebalancing time * @return etfPreTimestamp **/ @javax.annotation.Nullable @@ -395,7 +443,9 @@ 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) && @@ -411,7 +461,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(currencyPair, last, lowestAsk, highestBid, changePercentage, changeUtc0, changeUtc8, 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); } @@ -422,7 +472,9 @@ 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"); 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 8e90622..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. No value in public endpoints + * Trade role, not returned in public endpoints */ @JsonAdapter(RoleEnum.Adapter.class) public enum RoleEnum { @@ -189,7 +189,7 @@ public Trade id(String id) { } /** - * Trade ID + * Fill ID * @return id **/ @javax.annotation.Nullable @@ -209,7 +209,7 @@ public Trade createTime(String createTime) { } /** - * Trading time + * Fill Time * @return createTime **/ @javax.annotation.Nullable @@ -269,7 +269,7 @@ public Trade side(SideEnum side) { } /** - * Order side + * Buy or sell order * @return side **/ @javax.annotation.Nullable @@ -289,7 +289,7 @@ public Trade role(RoleEnum role) { } /** - * Trade role. No value in public endpoints + * Trade role, not returned in public endpoints * @return role **/ @javax.annotation.Nullable @@ -349,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 @@ -369,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 @@ -389,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 @@ -409,7 +409,7 @@ public Trade pointFee(String pointFee) { } /** - * Points used to deduct fee. No value in public endpoints + * Points used to deduct fee, not returned in public endpoints * @return pointFee **/ @javax.annotation.Nullable @@ -429,7 +429,7 @@ public Trade gtFee(String gtFee) { } /** - * GT used to deduct fee. No value in public endpoints + * GT used to deduct fee, not returned in public endpoints * @return gtFee **/ @javax.annotation.Nullable @@ -469,7 +469,7 @@ public Trade sequenceId(String sequenceId) { } /** - * Represents a unique and consecutive trade ID within a single market. It is used to track and identify trades in the specific market + * Consecutive trade ID within a single market. Used to track and identify trades in the specific market * @return sequenceId **/ @javax.annotation.Nullable @@ -489,7 +489,7 @@ public Trade text(String text) { } /** - * User defined information. No value in public endpoints + * User-defined information, not returned in public endpoints * @return text **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/TradeFee.java b/src/main/java/io/gate/gateapi/models/TradeFee.java index 4584534..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 @@ -71,6 +71,10 @@ public class TradeFee { @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) { @@ -139,7 +143,7 @@ public TradeFee gtDiscount(Boolean gtDiscount) { } /** - * If GT deduction is enabled + * Whether GT deduction discount is enabled * @return gtDiscount **/ @javax.annotation.Nullable @@ -179,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 @@ -219,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 @@ -239,7 +243,7 @@ public TradeFee futuresTakerFee(String futuresTakerFee) { } /** - * Futures trading taker fee + * Perpetual contract taker fee rate * @return futuresTakerFee **/ @javax.annotation.Nullable @@ -259,7 +263,7 @@ public TradeFee futuresMakerFee(String futuresMakerFee) { } /** - * Future trading maker fee + * Perpetual contract maker fee rate * @return futuresMakerFee **/ @javax.annotation.Nullable @@ -279,7 +283,7 @@ public TradeFee deliveryTakerFee(String deliveryTakerFee) { } /** - * Delivery trading taker fee + * Delivery contract taker fee rate * @return deliveryTakerFee **/ @javax.annotation.Nullable @@ -299,7 +303,7 @@ public TradeFee deliveryMakerFee(String deliveryMakerFee) { } /** - * Delivery trading maker fee + * Delivery contract maker fee rate * @return deliveryMakerFee **/ @javax.annotation.Nullable @@ -311,6 +315,26 @@ public String getDeliveryMakerFee() { 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) { @@ -331,12 +355,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.futuresTakerFee, tradeFee.futuresTakerFee) && Objects.equals(this.futuresMakerFee, tradeFee.futuresMakerFee) && Objects.equals(this.deliveryTakerFee, tradeFee.deliveryTakerFee) && - Objects.equals(this.deliveryMakerFee, tradeFee.deliveryMakerFee); + 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, deliveryTakerFee, deliveryMakerFee); + return Objects.hash(userId, takerFee, makerFee, gtDiscount, gtTakerFee, gtMakerFee, loanFee, pointType, futuresTakerFee, futuresMakerFee, deliveryTakerFee, deliveryMakerFee, debitFee); } @@ -356,6 +381,7 @@ public String toString() { 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 index 3788501..a0ae56a 100644 --- a/src/main/java/io/gate/gateapi/models/TransactionID.java +++ b/src/main/java/io/gate/gateapi/models/TransactionID.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,7 +35,7 @@ public TransactionID txId(Long txId) { } /** - * Order id + * Order ID * @return txId **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/Transfer.java b/src/main/java/io/gate/gateapi/models/Transfer.java index e7b20f6..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 - `options`: options 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,8 +40,6 @@ public enum FromEnum { DELIVERY("delivery"), - CROSS_MARGIN("cross_margin"), - OPTIONS("options"); private String value; @@ -99,8 +97,6 @@ public enum ToEnum { DELIVERY("delivery"), - CROSS_MARGIN("cross_margin"), - OPTIONS("options"); private String value; @@ -165,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() { @@ -241,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 @@ -261,7 +257,7 @@ public Transfer settle(String settle) { } /** - * Futures settle currency. Required if transferring from or to futures account + * 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/PortfolioTransferable.java b/src/main/java/io/gate/gateapi/models/TransferablesResult.java similarity index 75% rename from src/main/java/io/gate/gateapi/models/PortfolioTransferable.java rename to src/main/java/io/gate/gateapi/models/TransferablesResult.java index b928915..f4147d9 100644 --- a/src/main/java/io/gate/gateapi/models/PortfolioTransferable.java +++ b/src/main/java/io/gate/gateapi/models/TransferablesResult.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; /** - * PortfolioTransferable + * Batch query unified account maximum transferable results */ -public class PortfolioTransferable { +public class TransferablesResult { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; @@ -32,7 +32,7 @@ public class PortfolioTransferable { private String amount; - public PortfolioTransferable currency(String currency) { + public TransferablesResult currency(String currency) { this.currency = currency; return this; @@ -52,14 +52,14 @@ public void setCurrency(String currency) { this.currency = currency; } - public PortfolioTransferable amount(String amount) { + public TransferablesResult amount(String amount) { this.amount = amount; return this; } /** - * The maximum amount that can be transferred out + * Maximum transferable 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; } - PortfolioTransferable portfolioTransferable = (PortfolioTransferable) o; - return Objects.equals(this.currency, portfolioTransferable.currency) && - Objects.equals(this.amount, portfolioTransferable.amount); + TransferablesResult transferablesResult = (TransferablesResult) o; + return Objects.equals(this.currency, transferablesResult.currency) && + Objects.equals(this.amount, transferablesResult.amount); } @Override @@ -93,7 +93,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PortfolioTransferable {\n"); + sb.append("class TransferablesResult {\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/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 index 28d17da..37c370d 100644 --- a/src/main/java/io/gate/gateapi/models/TriggerTime.java +++ b/src/main/java/io/gate/gateapi/models/TriggerTime.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,7 +35,7 @@ public TriggerTime triggerTime(Long triggerTime) { } /** - * Timestamp of the end of the countdown, in milliseconds + * Timestamp when countdown ends, in milliseconds * @return triggerTime **/ @javax.annotation.Nullable 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/CrossMarginRepayRequest.java b/src/main/java/io/gate/gateapi/models/UidPushWithdrawal.java similarity index 60% rename from src/main/java/io/gate/gateapi/models/CrossMarginRepayRequest.java rename to src/main/java/io/gate/gateapi/models/UidPushWithdrawal.java index e471264..32ee3a2 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginRepayRequest.java +++ b/src/main/java/io/gate/gateapi/models/UidPushWithdrawal.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,13 @@ import java.io.IOException; /** - * CrossMarginRepayRequest + * UidPushWithdrawal */ -public class CrossMarginRepayRequest { +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; @@ -32,14 +36,33 @@ public class CrossMarginRepayRequest { private String amount; - public CrossMarginRepayRequest currency(String currency) { + 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; } /** - * Repayment currency + * Currency name * @return currency **/ public String getCurrency() { @@ -51,14 +74,14 @@ public void setCurrency(String currency) { this.currency = currency; } - public CrossMarginRepayRequest amount(String amount) { + public UidPushWithdrawal amount(String amount) { this.amount = amount; return this; } /** - * Repayment amount + * Transfer amount * @return amount **/ public String getAmount() { @@ -77,21 +100,23 @@ 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); + 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(currency, amount); + return Objects.hash(receiveUid, currency, amount); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CrossMarginRepayRequest {\n"); + 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("}"); 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 index 14fd851..21eef24 100644 --- a/src/main/java/io/gate/gateapi/models/UniCurrency.java +++ b/src/main/java/io/gate/gateapi/models/UniCurrency.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 @@ -55,7 +55,7 @@ public String getCurrency() { /** - * The minimum lending amount, in the unit of the currency. + * The minimum lending amount, in the unit of the currency * @return minLendAmount **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/UniCurrencyInterest.java b/src/main/java/io/gate/gateapi/models/UniCurrencyInterest.java index 661220b..609c2b1 100644 --- a/src/main/java/io/gate/gateapi/models/UniCurrencyInterest.java +++ b/src/main/java/io/gate/gateapi/models/UniCurrencyInterest.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,7 +43,7 @@ public String getCurrency() { /** - * Interest status: interest_dividend - regular dividend, interest_reinvest - interest reinvestment + * Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment * @return interestStatus **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/UniCurrencyPair.java b/src/main/java/io/gate/gateapi/models/UniCurrencyPair.java index c4b5cd2..16c27d7 100644 --- a/src/main/java/io/gate/gateapi/models/UniCurrencyPair.java +++ b/src/main/java/io/gate/gateapi/models/UniCurrencyPair.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/UniInterestRecord.java b/src/main/java/io/gate/gateapi/models/UniInterestRecord.java index 03e3a74..19c3fbb 100644 --- a/src/main/java/io/gate/gateapi/models/UniInterestRecord.java +++ b/src/main/java/io/gate/gateapi/models/UniInterestRecord.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 @@ -89,7 +89,7 @@ public String getInterest() { /** - * Interest status: interest_dividend - regular dividend, interest_reinvest - interest reinvestment + * Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment * @return interestStatus **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/UniLend.java b/src/main/java/io/gate/gateapi/models/UniLend.java index 5c89216..6008e2c 100644 --- a/src/main/java/io/gate/gateapi/models/UniLend.java +++ b/src/main/java/io/gate/gateapi/models/UniLend.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 @@ -85,7 +85,7 @@ public String getCurrentAmount() { /** - * Total amount + * Total Lending Amount * @return amount **/ @javax.annotation.Nullable @@ -95,7 +95,7 @@ public String getAmount() { /** - * Lent amount + * Lent Amount * @return lentAmount **/ @javax.annotation.Nullable @@ -105,7 +105,7 @@ public String getLentAmount() { /** - * Frozen amount + * Pending Redemption Amount * @return frozenAmount **/ @javax.annotation.Nullable @@ -125,7 +125,7 @@ public String getMinRate() { /** - * Interest status: interest_dividend - regular dividend, interest_reinvest - interest reinvestment + * Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment * @return interestStatus **/ @javax.annotation.Nullable @@ -135,7 +135,7 @@ public String getInterestStatus() { /** - * Amount not reinvested + * Non-reinvested Amount * @return reinvestLeftAmount **/ @javax.annotation.Nullable @@ -145,7 +145,7 @@ public String getReinvestLeftAmount() { /** - * Created time of the lending order + * Lending Order Creation Time * @return createTime **/ @javax.annotation.Nullable @@ -155,7 +155,7 @@ public Long getCreateTime() { /** - * Upated time of the lending order + * Lending Order Last Update Time * @return updateTime **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/UniLendInterest.java b/src/main/java/io/gate/gateapi/models/UniLendInterest.java index 4aad298..e7ec36c 100644 --- a/src/main/java/io/gate/gateapi/models/UniLendInterest.java +++ b/src/main/java/io/gate/gateapi/models/UniLendInterest.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,7 +43,7 @@ public String getCurrency() { /** - * Interest + * Interest income * @return interest **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/UniLendRecord.java b/src/main/java/io/gate/gateapi/models/UniLendRecord.java index 345c4f1..605c3fa 100644 --- a/src/main/java/io/gate/gateapi/models/UniLendRecord.java +++ b/src/main/java/io/gate/gateapi/models/UniLendRecord.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; /** - * Interest Record + * Lending Record */ public class UniLendRecord { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @@ -63,7 +63,7 @@ public String getCurrency() { /** - * current amount + * Current Amount * @return amount **/ @javax.annotation.Nullable @@ -73,7 +73,7 @@ public String getAmount() { /** - * Last wallet amount + * Previous Available Amount * @return lastWalletAmount **/ @javax.annotation.Nullable @@ -83,7 +83,7 @@ public String getLastWalletAmount() { /** - * Last lent amount + * Previous Lent Amount * @return lastLentAmount **/ @javax.annotation.Nullable @@ -93,7 +93,7 @@ public String getLastLentAmount() { /** - * Last frozen amount + * Previous Frozen Amount * @return lastFrozenAmount **/ @javax.annotation.Nullable @@ -103,7 +103,7 @@ public String getLastFrozenAmount() { /** - * Record type: lend - lend, redeem - redeem + * Record Type: lend - Lend, redeem - Redeem * @return type **/ @javax.annotation.Nullable diff --git a/src/main/java/io/gate/gateapi/models/UniLoan.java b/src/main/java/io/gate/gateapi/models/UniLoan.java index 35a7e06..80a9411 100644 --- a/src/main/java/io/gate/gateapi/models/UniLoan.java +++ b/src/main/java/io/gate/gateapi/models/UniLoan.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; /** - * Loan + * Borrowing */ public class UniLoan { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @@ -35,6 +35,10 @@ public class UniLoan { @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; @@ -65,7 +69,7 @@ public String getCurrencyPair() { /** - * amount + * Amount to Repay * @return amount **/ @javax.annotation.Nullable @@ -74,6 +78,16 @@ public String getAmount() { } + /** + * Loan type: platform borrowing - platform, margin borrowing - margin + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + /** * Created time * @return createTime @@ -85,7 +99,7 @@ public Long getCreateTime() { /** - * Updated time + * Last Update Time * @return updateTime **/ @javax.annotation.Nullable @@ -105,13 +119,14 @@ public boolean equals(java.lang.Object 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, createTime, updateTime); + return Objects.hash(currency, currencyPair, amount, type, createTime, updateTime); } @@ -122,6 +137,7 @@ public String toString() { 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("}"); diff --git a/src/main/java/io/gate/gateapi/models/UniLoanInterestRecord.java b/src/main/java/io/gate/gateapi/models/UniLoanInterestRecord.java index c7adeaa..1a9027c 100644 --- a/src/main/java/io/gate/gateapi/models/UniLoanInterestRecord.java +++ b/src/main/java/io/gate/gateapi/models/UniLoanInterestRecord.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; /** - * Interest record + * Interest Deduction Record */ public class UniLoanInterestRecord { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @@ -43,6 +43,10 @@ public class UniLoanInterestRecord { @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; @@ -69,7 +73,7 @@ public String getCurrencyPair() { /** - * Actual rate + * Actual Rate * @return actualRate **/ @javax.annotation.Nullable @@ -98,6 +102,16 @@ public Integer getStatus() { } + /** + * Type: platform - Platform borrowing, margin - Margin borrowing + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + /** * Created time * @return createTime @@ -121,12 +135,13 @@ public boolean equals(java.lang.Object o) { 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, createTime); + return Objects.hash(currency, currencyPair, actualRate, interest, status, type, createTime); } @@ -139,6 +154,7 @@ public String toString() { 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(); diff --git a/src/main/java/io/gate/gateapi/models/UniLoanRecord.java b/src/main/java/io/gate/gateapi/models/UniLoanRecord.java index b51c94d..d2879be 100644 --- a/src/main/java/io/gate/gateapi/models/UniLoanRecord.java +++ b/src/main/java/io/gate/gateapi/models/UniLoanRecord.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; /** - * Loan records + * Borrowing Records */ public class UniLoanRecord { public static final String SERIALIZED_NAME_TYPE = "type"; @@ -45,7 +45,7 @@ public class UniLoanRecord { /** - * type: borrow - borrow, repay - repay + * Type: `borrow` - borrow, `repay` - repay * @return type **/ @javax.annotation.Nullable @@ -75,7 +75,7 @@ public String getCurrency() { /** - * The amount of lending or repaying + * Borrow or repayment amount * @return amount **/ @javax.annotation.Nullable 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/PortfolioBorrowable.java b/src/main/java/io/gate/gateapi/models/UnifiedBorrowable.java similarity index 77% rename from src/main/java/io/gate/gateapi/models/PortfolioBorrowable.java rename to src/main/java/io/gate/gateapi/models/UnifiedBorrowable.java index 7f44e4c..e553e3f 100644 --- a/src/main/java/io/gate/gateapi/models/PortfolioBorrowable.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; /** - * PortfolioBorrowable + * UnifiedBorrowable */ -public class PortfolioBorrowable { +public class UnifiedBorrowable { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; @@ -32,7 +32,7 @@ public class PortfolioBorrowable { private String amount; - public PortfolioBorrowable 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 PortfolioBorrowable 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; } - PortfolioBorrowable portfolioBorrowable = (PortfolioBorrowable) o; - return Objects.equals(this.currency, portfolioBorrowable.currency) && - Objects.equals(this.amount, portfolioBorrowable.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 PortfolioBorrowable {\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 51% rename from src/main/java/io/gate/gateapi/models/CrossMarginCurrency.java rename to src/main/java/io/gate/gateapi/models/UnifiedCurrency.java index b7cf1b7..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,16 +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_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Integer status; + 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; @@ -80,27 +68,7 @@ public void setName(String name) { this.name = name; } - public CrossMarginCurrency rate(String rate) { - - this.rate = rate; - return this; - } - - /** - * Minimum lending rate (hourly 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; @@ -120,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 @@ -160,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 @@ -180,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 @@ -200,44 +148,24 @@ public void setTotalMaxBorrowAmount(String totalMaxBorrowAmount) { this.totalMaxBorrowAmount = totalMaxBorrowAmount; } - public CrossMarginCurrency price(String price) { - - this.price = price; - return this; - } - - /** - * Price change between this currency and USDT - * @return price - **/ - @javax.annotation.Nullable - public String getPrice() { - return price; - } - - - public void setPrice(String price) { - this.price = price; - } - - public CrossMarginCurrency status(Integer status) { + public UnifiedCurrency loanStatus(String loanStatus) { - this.status = status; + this.loanStatus = loanStatus; return this; } /** - * status - `0` : disable - `1` : enable - * @return status + * Lending status - `disable` : Lending prohibited - `enable` : Lending supported + * @return loanStatus **/ @javax.annotation.Nullable - public Integer getStatus() { - return status; + public String getLoanStatus() { + return loanStatus; } - public void setStatus(Integer status) { - this.status = status; + public void setLoanStatus(String loanStatus) { + this.loanStatus = loanStatus; } @Override public boolean equals(java.lang.Object o) { @@ -247,37 +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) && - Objects.equals(this.status, crossMarginCurrency.status); + 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, status); + 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(" status: ").append(toIndentedString(status)).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/PortfolioLoan.java b/src/main/java/io/gate/gateapi/models/UnifiedLoan.java similarity index 80% rename from src/main/java/io/gate/gateapi/models/PortfolioLoan.java rename to src/main/java/io/gate/gateapi/models/UnifiedLoan.java index 701d7dc..f69f3f0 100644 --- a/src/main/java/io/gate/gateapi/models/PortfolioLoan.java +++ b/src/main/java/io/gate/gateapi/models/UnifiedLoan.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,13 +22,13 @@ /** * Borrow or repay */ -public class PortfolioLoan { +public class UnifiedLoan { public static final String SERIALIZED_NAME_CURRENCY = "currency"; @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; /** - * type: borrow - borrow, repay - repay + * Type: `borrow` - borrow, `repay` - repay */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -91,7 +91,7 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { private String text; - public PortfolioLoan currency(String currency) { + public UnifiedLoan currency(String currency) { this.currency = currency; return this; @@ -110,14 +110,14 @@ public void setCurrency(String currency) { this.currency = currency; } - public PortfolioLoan type(TypeEnum type) { + public UnifiedLoan type(TypeEnum type) { this.type = type; return this; } /** - * type: borrow - borrow, repay - repay + * Type: `borrow` - borrow, `repay` - repay * @return type **/ public TypeEnum getType() { @@ -129,14 +129,14 @@ public void setType(TypeEnum type) { this.type = type; } - public PortfolioLoan amount(String amount) { + public UnifiedLoan amount(String amount) { this.amount = amount; return this; } /** - * The amount of lending or repaying + * Borrow or repayment amount * @return amount **/ public String getAmount() { @@ -148,14 +148,14 @@ public void setAmount(String amount) { this.amount = amount; } - public PortfolioLoan repaidAll(Boolean repaidAll) { + public UnifiedLoan repaidAll(Boolean repaidAll) { this.repaidAll = repaidAll; return this; } /** - * Full repayment. Repay operation only. If the value is `true`, the amount will be ignored and the loan will be repaid in full. + * Full repayment, only used for repayment operations. When set to `true`, overrides `amount` and directly repays the full amount * @return repaidAll **/ @javax.annotation.Nullable @@ -168,7 +168,7 @@ public void setRepaidAll(Boolean repaidAll) { this.repaidAll = repaidAll; } - public PortfolioLoan text(String text) { + public UnifiedLoan text(String text) { this.text = text; return this; @@ -195,12 +195,12 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PortfolioLoan portfolioLoan = (PortfolioLoan) o; - return Objects.equals(this.currency, portfolioLoan.currency) && - Objects.equals(this.type, portfolioLoan.type) && - Objects.equals(this.amount, portfolioLoan.amount) && - Objects.equals(this.repaidAll, portfolioLoan.repaidAll) && - Objects.equals(this.text, portfolioLoan.text); + 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 @@ -212,7 +212,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PortfolioLoan {\n"); + 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"); diff --git a/src/main/java/io/gate/gateapi/models/PortfolioLoanRecord.java b/src/main/java/io/gate/gateapi/models/UnifiedLoanRecord.java similarity index 63% rename from src/main/java/io/gate/gateapi/models/PortfolioLoanRecord.java rename to src/main/java/io/gate/gateapi/models/UnifiedLoanRecord.java index 395343a..b759379 100644 --- a/src/main/java/io/gate/gateapi/models/PortfolioLoanRecord.java +++ b/src/main/java/io/gate/gateapi/models/UnifiedLoanRecord.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; /** - * Loan records + * Borrowing Records */ -public class PortfolioLoanRecord { +public class UnifiedLoanRecord { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private Long id; @@ -35,6 +35,10 @@ public class PortfolioLoanRecord { @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; @@ -53,7 +57,7 @@ public class PortfolioLoanRecord { /** - * id + * ID * @return id **/ @javax.annotation.Nullable @@ -63,7 +67,7 @@ public Long getId() { /** - * type: borrow - borrow, repay - repay + * Type: `borrow` - borrow, `repay` - repay * @return type **/ @javax.annotation.Nullable @@ -73,7 +77,7 @@ public String getType() { /** - * Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment, cancel_auto_repay - automatic repayment after cancellation + * 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 @@ -82,6 +86,26 @@ public String getRepaymentType() { } + 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 @@ -103,7 +127,7 @@ public String getCurrency() { /** - * The amount of lending or repaying + * Borrow or repayment amount * @return amount **/ @javax.annotation.Nullable @@ -129,29 +153,31 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PortfolioLoanRecord portfolioLoanRecord = (PortfolioLoanRecord) o; - return Objects.equals(this.id, portfolioLoanRecord.id) && - Objects.equals(this.type, portfolioLoanRecord.type) && - Objects.equals(this.repaymentType, portfolioLoanRecord.repaymentType) && - Objects.equals(this.currencyPair, portfolioLoanRecord.currencyPair) && - Objects.equals(this.currency, portfolioLoanRecord.currency) && - Objects.equals(this.amount, portfolioLoanRecord.amount) && - Objects.equals(this.createTime, portfolioLoanRecord.createTime); + 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, currencyPair, currency, amount, createTime); + return Objects.hash(id, type, repaymentType, borrowType, currencyPair, currency, amount, createTime); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PortfolioLoanRecord {\n"); + 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"); 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/CrossMarginBorrowable.java b/src/main/java/io/gate/gateapi/models/UnifiedTransferable.java similarity index 76% rename from src/main/java/io/gate/gateapi/models/CrossMarginBorrowable.java rename to src/main/java/io/gate/gateapi/models/UnifiedTransferable.java index 3c63a77..6fd5153 100644 --- a/src/main/java/io/gate/gateapi/models/CrossMarginBorrowable.java +++ b/src/main/java/io/gate/gateapi/models/UnifiedTransferable.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 + * UnifiedTransferable */ -public class CrossMarginBorrowable { +public class UnifiedTransferable { 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 UnifiedTransferable currency(String currency) { this.currency = currency; return this; @@ -52,14 +52,14 @@ public void setCurrency(String currency) { this.currency = currency; } - public CrossMarginBorrowable amount(String amount) { + public UnifiedTransferable amount(String amount) { this.amount = amount; return this; } /** - * Max borrowable amount + * Maximum transferable 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; } - CrossMarginBorrowable crossMarginBorrowable = (CrossMarginBorrowable) o; - return Objects.equals(this.currency, crossMarginBorrowable.currency) && - Objects.equals(this.amount, crossMarginBorrowable.amount); + UnifiedTransferable unifiedTransferable = (UnifiedTransferable) o; + return Objects.equals(this.currency, unifiedTransferable.currency) && + Objects.equals(this.amount, unifiedTransferable.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 UnifiedTransferable {\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/UserLtvInfo.java b/src/main/java/io/gate/gateapi/models/UserLtvInfo.java index 3eec96e..496d13f 100644 --- a/src/main/java/io/gate/gateapi/models/UserLtvInfo.java +++ b/src/main/java/io/gate/gateapi/models/UserLtvInfo.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 @@ -59,7 +59,7 @@ public UserLtvInfo collateralCurrency(String collateralCurrency) { } /** - * Collateral + * Collateral currency * @return collateralCurrency **/ @javax.annotation.Nullable @@ -99,7 +99,7 @@ public UserLtvInfo initLtv(String initLtv) { } /** - * The initial collateralization rate + * Initial collateralization rate * @return initLtv **/ @javax.annotation.Nullable @@ -119,7 +119,7 @@ public UserLtvInfo alertLtv(String alertLtv) { } /** - * Warning collateralization ratio + * Warning collateralization rate * @return alertLtv **/ @javax.annotation.Nullable @@ -139,7 +139,7 @@ public UserLtvInfo liquidateLtv(String liquidateLtv) { } /** - * The liquidation collateralization rate + * Liquidation collateralization rate * @return liquidateLtv **/ @javax.annotation.Nullable 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 index 8887355..b416530 100644 --- a/src/main/java/io/gate/gateapi/models/UserTotalAmount.java +++ b/src/main/java/io/gate/gateapi/models/UserTotalAmount.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; /** - * Total borrowed amount and pledged collateral amount by the user + * User's total borrowing and collateral amount */ public class UserTotalAmount { public static final String SERIALIZED_NAME_BORROW_AMOUNT = "borrow_amount"; @@ -39,7 +39,7 @@ public UserTotalAmount borrowAmount(String borrowAmount) { } /** - * Total borrowing amount, calculated in USDT + * Total borrowing amount in USDT * @return borrowAmount **/ @javax.annotation.Nullable @@ -59,7 +59,7 @@ public UserTotalAmount collateralAmount(String collateralAmount) { } /** - * Total collateral amount, calculated in USDT + * Total collateral amount in USDT * @return collateralAmount **/ @javax.annotation.Nullable 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 "); + } + +} +