From 9c1612e8405f6b82ba10fda4c67f9df11ab3fdc3 Mon Sep 17 00:00:00 2001 From: theo-s68 <194042188+theo-s68@users.noreply.github.com> Date: Wed, 24 Sep 2025 14:39:50 +0700 Subject: [PATCH] generate clients --- clients/algo/docs/rest-api/migration-guide.md | 4 +- clients/c2c/docs/rest-api/migration-guide.md | 4 +- .../websocket/dtos/SessionLogonResponse.java | 341 -- .../dtos/SessionLogonResponseDTO.java | 10 - .../dtos/SessionLogonResponseResult.java | 466 -- .../convert/docs/rest-api/migration-guide.md | 4 +- .../docs/rest-api/migration-guide.md | 4 +- clients/crypto-loan/CHANGELOG.md | 11 + .../docs/CryptoLoanAdjustLtvResponse.md | 17 - .../docs/CryptoLoanBorrowRequest.md | 16 - .../docs/CryptoLoanBorrowResponse.md | 18 - .../CryptoLoanCustomizeMarginCallResponse.md | 14 - ...oanCustomizeMarginCallResponseRowsInner.md | 17 - .../docs/CryptoLoanRepayRequest.md | 17 - .../docs/CryptoLoanRepayResponse.md | 19 - .../docs/CryptoLoanRepayResponse1.md | 19 - .../docs/CryptoLoanRepayResponse2.md | 15 - .../docs/FlexibleLoanBorrowRequest.md | 2 + .../FlexibleLoanCollateralRepaymentRequest.md | 17 - ...FlexibleLoanCollateralRepaymentResponse.md | 19 - .../docs/GetCollateralAssetsDataResponse.md | 14 - ...etCollateralAssetsDataResponseRowsInner.md | 18 - .../docs/GetLoanOngoingOrdersResponse.md | 14 - .../GetLoanOngoingOrdersResponseRowsInner.md | 20 - .../docs/GetLoanableAssetsDataResponse.md | 14 - .../GetLoanableAssetsDataResponseRowsInner.md | 26 - .../docs/rest-api/migration-guide.md | 4 +- clients/crypto-loan/pom.xml | 4 +- .../crypto_loan/rest/api/FlexibleRateApi.java | 16 +- .../crypto_loan/rest/api/StableRateApi.java | 2 +- .../rest/model/FlexibleLoanBorrowRequest.java | 70 +- .../CHANGELOG.md | 9 + ...rmationResponseSymbolsInnerFiltersInner.md | 2 +- .../docs/rest-api/migration-guide.md | 4 +- .../derivatives-trading-coin-futures/pom.xml | 4 +- .../rest/api/AccountApi.java | 2 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/PortfolioMarginEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- ...ationResponseSymbolsInnerFiltersInner.java | 17 +- ...vativesTradingCoinFuturesWebSocketApi.java | 9 +- ...vesTradingCoinFuturesWebSocketStreams.java | 2 +- .../derivatives-trading-options/CHANGELOG.md | 13 + .../docs/AccountApi.md | 63 + ...geInformationResponseOptionSymbolsInner.md | 1 + .../docs/MarketMakerEndpointsApi.md | 63 - ...ginAccountInformationResponseAssetInner.md | 2 +- .../docs/rest-api/migration-guide.md | 4 +- clients/derivatives-trading-options/pom.xml | 4 +- .../rest/api/AccountApi.java | 136 +- .../api/DerivativesTradingOptionsRestApi.java | 46 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/MarketMakerBlockTradeApi.java | 2 +- .../rest/api/MarketMakerEndpointsApi.java | 136 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- ...InformationResponseOptionSymbolsInner.java | 49 + ...nAccountInformationResponseAssetInner.java | 49 +- ...vativesTradingOptionsWebSocketStreams.java | 2 +- .../rest/api/AccountApiTest.java | 31 + .../rest/api/MarketMakerEndpointsApiTest.java | 30 - .../docs/rest-api/migration-guide.md | 4 +- .../CHANGELOG.md | 16 +- .../docs/MarginMaxBorrowResponse.md | 4 +- .../docs/NewMarginOrderResponse.md | 2 +- .../docs/rest-api/migration-guide.md | 4 +- .../pom.xml | 4 +- .../rest/api/AccountApi.java | 2 +- .../rest/api/MarketDataApi.java | 2 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- .../rest/model/MarginMaxBorrowResponse.java | 34 +- .../rest/model/NewMarginOrderResponse.java | 18 +- ...radingPortfolioMarginWebSocketStreams.java | 2 +- .../CHANGELOG.md | 9 + ...AccountInformationV3ResponseAssetsInner.md | 1 - .../NotionalAndLeverageBracketsResponse.md | 2 +- ...rageBracketsResponse1InnerBracketsInner.md | 2 +- .../NotionalAndLeverageBracketsResponse2.md | 2 +- ...dLeverageBracketsResponse2BracketsInner.md | 18 + .../docs/rest-api/migration-guide.md | 4 +- .../derivatives-trading-usds-futures/pom.xml | 4 +- .../rest/JSON.java | 4 + .../rest/api/AccountApi.java | 2 +- .../rest/api/ConvertApi.java | 2 +- .../DerivativesTradingUsdsFuturesRestApi.java | 12 +- .../rest/api/MarketDataApi.java | 16 +- .../rest/api/PortfolioMarginEndpointsApi.java | 2 +- .../rest/api/TradeApi.java | 2 +- .../rest/api/UserDataStreamsApi.java | 2 +- ...countInformationV3ResponseAssetsInner.java | 40 +- ...geBracketsResponse1InnerBracketsInner.java | 9 +- .../NotionalAndLeverageBracketsResponse2.java | 12 +- ...everageBracketsResponse2BracketsInner.java | 396 ++ ...vativesTradingUsdsFuturesWebSocketApi.java | 9 +- ...vesTradingUsdsFuturesWebSocketStreams.java | 2 +- .../docs/rest-api/migration-guide.md | 4 +- clients/fiat/docs/rest-api/migration-guide.md | 4 +- .../docs/rest-api/migration-guide.md | 4 +- clients/margin-trading/CHANGELOG.md | 9 + .../docs/GetLimitPricePairsResponse.md | 13 + clients/margin-trading/docs/MarketDataApi.md | 59 + .../docs/rest-api/migration-guide.md | 4 +- clients/margin-trading/pom.xml | 4 +- .../client/margin_trading/rest/JSON.java | 3 + .../margin_trading/rest/api/AccountApi.java | 2 +- .../rest/api/BorrowRepayApi.java | 2 +- .../rest/api/MarginTradingRestApi.java | 31 + .../rest/api/MarketDataApi.java | 136 +- .../rest/api/RiskDataStreamApi.java | 2 +- .../margin_trading/rest/api/TradeApi.java | 2 +- .../rest/api/TradeDataStreamApi.java | 2 +- .../margin_trading/rest/api/TransferApi.java | 2 +- .../model/GetLimitPricePairsResponse.java | 235 + .../api/MarginTradingWebSocketStreams.java | 2 +- .../mining/docs/rest-api/migration-guide.md | 4 +- clients/nft/docs/rest-api/migration-guide.md | 4 +- clients/pay/CHANGELOG.md | 8 + ...yTradeHistoryResponseDataInnerPayerInfo.md | 1 - clients/pay/docs/PayApi.md | 2 +- clients/pay/docs/rest-api/migration-guide.md | 4 +- clients/pay/pom.xml | 4 +- .../connector/client/pay/rest/api/PayApi.java | 30 +- .../client/pay/rest/api/PayRestApi.java | 28 +- ...radeHistoryResponseDataInnerPayerInfo.java | 46 +- .../rebate/docs/rest-api/migration-guide.md | 4 +- clients/simple-earn/CHANGELOG.md | 37 + clients/simple-earn/docs/AccountApi.md | 483 -- clients/simple-earn/docs/EarnApi.md | 585 --- clients/simple-earn/docs/FlexibleLockedApi.md | 1666 +++++++ .../docs/GetRwusdAccountResponse.md | 14 + .../docs/GetRwusdQuotaDetailsResponse.md | 17 + ...QuotaDetailsResponseFastRedemptionQuota.md | 16 + ...aDetailsResponseStandardRedemptionQuota.md | 16 + ...sdQuotaDetailsResponseSubscriptionQuota.md | 15 + .../docs/GetRwusdRateHistoryResponse.md | 14 + .../GetRwusdRateHistoryResponseRowsInner.md | 14 + .../docs/GetRwusdRedemptionHistoryResponse.md | 14 + ...RwusdRedemptionHistoryResponseRowsInner.md | 20 + .../docs/GetRwusdRewardsHistoryResponse.md | 14 + ...GetRwusdRewardsHistoryResponseRowsInner.md | 16 + .../GetRwusdSubscriptionHistoryResponse.md | 14 + ...usdSubscriptionHistoryResponseRowsInner.md | 18 + ...arnFlexibleProductListResponseRowsInner.md | 2 +- ...ockedProductListResponseRowsInnerDetail.md | 4 +- clients/simple-earn/docs/HistoryApi.md | 614 --- .../docs/RedeemRwusdRequest.md} | 5 +- .../simple-earn/docs/RedeemRwusdResponse.md | 16 + clients/simple-earn/docs/RwusdApi.md | 546 +++ .../docs/SubscribeRwusdRequest.md} | 5 +- .../docs/SubscribeRwusdResponse.md | 14 + .../docs/rest-api/migration-guide.md | 4 +- clients/simple-earn/pom.xml | 4 +- .../client/simple_earn/rest/JSON.java | 53 + .../client/simple_earn/rest/api/EarnApi.java | 1504 ------ .../rest/api/FlexibleLockedApi.java | 4366 +++++++++++++++++ .../simple_earn/rest/api/HistoryApi.java | 1826 ------- .../api/{AccountApi.java => RwusdApi.java} | 693 ++- .../rest/api/SimpleEarnRestApi.java | 821 ++-- .../rest/model/GetRwusdAccountResponse.java | 251 + .../model/GetRwusdQuotaDetailsResponse.java | 392 ++ ...otaDetailsResponseFastRedemptionQuota.java | 353 ++ ...etailsResponseStandardRedemptionQuota.java | 350 ++ ...QuotaDetailsResponseSubscriptionQuota.java | 326 ++ .../model/GetRwusdRateHistoryResponse.java | 283 ++ .../GetRwusdRateHistoryResponseRowsInner.java | 259 + .../GetRwusdRedemptionHistoryResponse.java | 284 ++ ...usdRedemptionHistoryResponseRowsInner.java | 497 ++ .../model/GetRwusdRewardsHistoryResponse.java | 283 ++ ...tRwusdRewardsHistoryResponseRowsInner.java | 345 ++ .../GetRwusdSubscriptionHistoryResponse.java | 285 ++ ...dSubscriptionHistoryResponseRowsInner.java | 425 ++ ...nFlexibleProductListResponseRowsInner.java | 18 +- ...kedProductListResponseRowsInnerDetail.java | 34 +- .../rest/model/RedeemRwusdRequest.java | 289 ++ .../rest/model/RedeemRwusdResponse.java | 314 ++ .../rest/model/SubscribeRwusdRequest.java | 289 ++ .../rest/model/SubscribeRwusdResponse.java | 242 + .../simple_earn/rest/api/AccountApiTest.java | 316 -- .../simple_earn/rest/api/EarnApiTest.java | 419 -- .../rest/api/FlexibleLockedApiTest.java | 1049 ++++ .../simple_earn/rest/api/HistoryApiTest.java | 467 -- clients/staking/CHANGELOG.md | 8 + ...ockedProductListResponseRowsInnerDetail.md | 2 +- .../docs/GetSoftStakingProductListResponse.md | 16 + ...SoftStakingProductListResponseRowsInner.md | 18 + .../GetSoftStakingRewardsHistoryResponse.md | 14 + ...tStakingRewardsHistoryResponseRowsInner.md | 17 + .../staking/docs/SetSoftStakingResponse.md | 13 + clients/staking/docs/SoftStakingApi.md | 215 + .../staking/docs/rest-api/migration-guide.md | 4 +- clients/staking/pom.xml | 4 +- .../connector/client/staking/rest/JSON.java | 15 + .../staking/rest/api/EthStakingApi.java | 2 +- .../staking/rest/api/OnChainYieldsApi.java | 2 +- .../staking/rest/api/SoftStakingApi.java | 566 +++ .../staking/rest/api/SolStakingApi.java | 2 +- .../staking/rest/api/StakingRestApi.java | 90 + ...kedProductListResponseRowsInnerDetail.java | 18 +- .../GetSoftStakingProductListResponse.java | 359 ++ ...ftStakingProductListResponseRowsInner.java | 430 ++ .../GetSoftStakingRewardsHistoryResponse.java | 286 ++ ...takingRewardsHistoryResponseRowsInner.java | 384 ++ .../rest/model/SetSoftStakingResponse.java | 202 + .../docs/rest-api/migration-guide.md | 4 +- clients/vip-loan/CHANGELOG.md | 8 + clients/vip-loan/docs/VipLoanBorrowRequest.md | 1 + .../vip-loan/docs/VipLoanBorrowResponse1.md | 20 - .../vip-loan/docs/VipLoanBorrowResponse2.md | 19 - .../vip-loan/docs/rest-api/migration-guide.md | 4 +- clients/vip-loan/pom.xml | 4 +- .../vip_loan/rest/api/MarketDataApi.java | 2 +- .../client/vip_loan/rest/api/TradeApi.java | 6 +- .../vip_loan/rest/api/UserInformationApi.java | 2 +- .../rest/model/VipLoanBorrowRequest.java | 33 + clients/wallet/CHANGELOG.md | 10 + .../docs/AllCoinsInformationResponseInner.md | 14 +- ...nformationResponseInnerNetworkListInner.md | 41 +- ...seInnerNetworkListInnerNetworkListInner.md | 39 - clients/wallet/docs/AssetApi.md | 2 +- clients/wallet/docs/CapitalApi.md | 2 +- .../CheckQuestionnaireRequirementsResponse.md | 13 + .../docs/DepositHistoryResponseInner.md | 1 + ...esponse.md => DepositHistoryV2Response.md} | 2 +- .../docs/DepositHistoryV2ResponseInner.md | 26 + ...ositHistoryV2ResponseInnerQuestionnaire.md | 14 + clients/wallet/docs/TravelRuleApi.md | 196 +- clients/wallet/docs/VaspListResponse.md | 12 + ...ponseInner.md => VaspListResponseInner.md} | 2 +- .../wallet/docs/rest-api/migration-guide.md | 4 +- clients/wallet/pom.xml | 4 +- .../connector/client/wallet/rest/JSON.java | 28 +- .../client/wallet/rest/api/AccountApi.java | 2 +- .../client/wallet/rest/api/AssetApi.java | 5 +- .../client/wallet/rest/api/CapitalApi.java | 9 +- .../client/wallet/rest/api/OthersApi.java | 2 +- .../client/wallet/rest/api/TravelRuleApi.java | 517 +- .../client/wallet/rest/api/WalletRestApi.java | 155 +- .../AllCoinsInformationResponseInner.java | 452 +- ...ormationResponseInnerNetworkListInner.java | 1361 ++--- ...InnerNetworkListInnerNetworkListInner.java | 1355 ----- ...heckQuestionnaireRequirementsResponse.java | 229 + .../model/DepositHistoryResponseInner.java | 39 +- ...nse.java => DepositHistoryV2Response.java} | 44 +- .../model/DepositHistoryV2ResponseInner.java | 728 +++ ...itHistoryV2ResponseInnerQuestionnaire.java | 260 + .../wallet/rest/model/VaspListResponse.java | 182 + ...eInner.java => VaspListResponseInner.java} | 60 +- .../wallet/rest/api/TravelRuleApiTest.java | 14 +- examples/crypto-loan/pom.xml | 2 +- .../derivatives-trading-coin-futures/pom.xml | 2 +- examples/derivatives-trading-options/pom.xml | 2 +- ...OptionMarginAccountInformationExample.java | 4 +- .../pom.xml | 2 +- .../ChangeAutoRepayFuturesStatusExample.java | 2 +- .../derivatives-trading-usds-futures/pom.xml | 2 +- .../GetFundingRateHistoryExample.java | 2 +- .../marketdata/SymbolPriceTickerExample.java | 2 +- examples/margin-trading/pom.xml | 2 +- .../marketdata/GetLimitPricePairsExample.java | 60 + examples/pay/pom.xml | 2 +- .../rest/pay/GetPayTradeHistoryExample.java | 28 +- examples/simple-earn/pom.xml | 2 +- .../GetCollateralRecordExample.java | 4 +- .../GetFlexiblePersonalLeftQuotaExample.java | 4 +- .../GetFlexibleProductPositionExample.java | 4 +- .../GetFlexibleRedemptionRecordExample.java | 4 +- .../GetFlexibleRewardsHistoryExample.java | 6 +- ...GetFlexibleSubscriptionPreviewExample.java | 4 +- .../GetFlexibleSubscriptionRecordExample.java | 4 +- .../GetLockedPersonalLeftQuotaExample.java | 4 +- .../GetLockedProductPositionExample.java | 4 +- .../GetLockedRedemptionRecordExample.java | 4 +- .../GetLockedRewardsHistoryExample.java | 4 +- .../GetLockedSubscriptionPreviewExample.java | 4 +- .../GetLockedSubscriptionRecordExample.java | 4 +- .../GetRateHistoryExample.java | 4 +- ...tSimpleEarnFlexibleProductListExample.java | 4 +- ...GetSimpleEarnLockedProductListExample.java | 4 +- .../RedeemFlexibleProductExample.java | 4 +- .../RedeemLockedProductExample.java | 4 +- .../SetFlexibleAutoSubscribeExample.java | 4 +- .../SetLockedAutoSubscribeExample.java | 4 +- .../SetLockedProductRedeemOptionExample.java | 4 +- .../SimpleAccountExample.java | 4 +- .../SubscribeFlexibleProductExample.java | 4 +- .../SubscribeLockedProductExample.java | 4 +- .../rest/rwusd/GetRwusdAccountExample.java | 52 + .../rwusd/GetRwusdQuotaDetailsExample.java | 54 + .../rwusd/GetRwusdRateHistoryExample.java | 65 + .../GetRwusdRedemptionHistoryExample.java | 64 + .../rwusd/GetRwusdRewardsHistoryExample.java | 64 + .../GetRwusdSubscriptionHistoryExample.java | 66 + .../rest/rwusd/RedeemRwusdExample.java | 56 + .../rest/rwusd/SubscribeRwusdExample.java | 57 + examples/staking/pom.xml | 2 +- .../GetSoftStakingProductListExample.java | 55 + .../GetSoftStakingRewardsHistoryExample.java | 64 + .../softstaking/SetSoftStakingExample.java | 53 + examples/vip-loan/pom.xml | 2 +- examples/wallet/pom.xml | 2 +- .../asset/QueryUserWalletBalanceExample.java | 3 +- .../wallet/rest/capital/WithdrawExample.java | 7 +- ...heckQuestionnaireRequirementsExample.java} | 22 +- .../travelrule/DepositHistoryV2Example.java | 74 + .../FetchAddressVerificationListExample.java | 6 +- .../rest/travelrule/VaspListExample.java | 51 + .../travelrule/WithdrawHistoryV1Example.java | 10 +- .../travelrule/WithdrawHistoryV2Example.java | 11 +- 310 files changed, 22770 insertions(+), 11329 deletions(-) delete mode 100644 clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponse.java delete mode 100644 clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseDTO.java delete mode 100644 clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseResult.java delete mode 100644 clients/crypto-loan/docs/CryptoLoanAdjustLtvResponse.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanBorrowRequest.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanBorrowResponse.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponse.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponseRowsInner.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanRepayRequest.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanRepayResponse.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanRepayResponse1.md delete mode 100644 clients/crypto-loan/docs/CryptoLoanRepayResponse2.md delete mode 100644 clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentRequest.md delete mode 100644 clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentResponse.md delete mode 100644 clients/crypto-loan/docs/GetCollateralAssetsDataResponse.md delete mode 100644 clients/crypto-loan/docs/GetCollateralAssetsDataResponseRowsInner.md delete mode 100644 clients/crypto-loan/docs/GetLoanOngoingOrdersResponse.md delete mode 100644 clients/crypto-loan/docs/GetLoanOngoingOrdersResponseRowsInner.md delete mode 100644 clients/crypto-loan/docs/GetLoanableAssetsDataResponse.md delete mode 100644 clients/crypto-loan/docs/GetLoanableAssetsDataResponseRowsInner.md create mode 100644 clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2BracketsInner.md create mode 100644 clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2BracketsInner.java create mode 100644 clients/margin-trading/docs/GetLimitPricePairsResponse.md create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetLimitPricePairsResponse.java delete mode 100644 clients/simple-earn/docs/AccountApi.md delete mode 100644 clients/simple-earn/docs/EarnApi.md create mode 100644 clients/simple-earn/docs/FlexibleLockedApi.md create mode 100644 clients/simple-earn/docs/GetRwusdAccountResponse.md create mode 100644 clients/simple-earn/docs/GetRwusdQuotaDetailsResponse.md create mode 100644 clients/simple-earn/docs/GetRwusdQuotaDetailsResponseFastRedemptionQuota.md create mode 100644 clients/simple-earn/docs/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.md create mode 100644 clients/simple-earn/docs/GetRwusdQuotaDetailsResponseSubscriptionQuota.md create mode 100644 clients/simple-earn/docs/GetRwusdRateHistoryResponse.md create mode 100644 clients/simple-earn/docs/GetRwusdRateHistoryResponseRowsInner.md create mode 100644 clients/simple-earn/docs/GetRwusdRedemptionHistoryResponse.md create mode 100644 clients/simple-earn/docs/GetRwusdRedemptionHistoryResponseRowsInner.md create mode 100644 clients/simple-earn/docs/GetRwusdRewardsHistoryResponse.md create mode 100644 clients/simple-earn/docs/GetRwusdRewardsHistoryResponseRowsInner.md create mode 100644 clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponse.md create mode 100644 clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponseRowsInner.md delete mode 100644 clients/simple-earn/docs/HistoryApi.md rename clients/{crypto-loan/docs/CryptoLoanAdjustLtvRequest.md => simple-earn/docs/RedeemRwusdRequest.md} (67%) create mode 100644 clients/simple-earn/docs/RedeemRwusdResponse.md create mode 100644 clients/simple-earn/docs/RwusdApi.md rename clients/{crypto-loan/docs/CryptoLoanCustomizeMarginCallRequest.md => simple-earn/docs/SubscribeRwusdRequest.md} (65%) create mode 100644 clients/simple-earn/docs/SubscribeRwusdResponse.md delete mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/EarnApi.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java delete mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/HistoryApi.java rename clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/{AccountApi.java => RwusdApi.java} (61%) create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdAccountResponse.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponse.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseFastRedemptionQuota.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseSubscriptionQuota.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponseRowsInner.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponse.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponseRowsInner.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponse.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponseRowsInner.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponse.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponseRowsInner.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdRequest.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdResponse.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdRequest.java create mode 100644 clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdResponse.java delete mode 100644 clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/AccountApiTest.java delete mode 100644 clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/EarnApiTest.java create mode 100644 clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApiTest.java delete mode 100644 clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/HistoryApiTest.java create mode 100644 clients/staking/docs/GetSoftStakingProductListResponse.md create mode 100644 clients/staking/docs/GetSoftStakingProductListResponseRowsInner.md create mode 100644 clients/staking/docs/GetSoftStakingRewardsHistoryResponse.md create mode 100644 clients/staking/docs/GetSoftStakingRewardsHistoryResponseRowsInner.md create mode 100644 clients/staking/docs/SetSoftStakingResponse.md create mode 100644 clients/staking/docs/SoftStakingApi.md create mode 100644 clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java create mode 100644 clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponse.java create mode 100644 clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponseRowsInner.java create mode 100644 clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponse.java create mode 100644 clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponseRowsInner.java create mode 100644 clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SetSoftStakingResponse.java delete mode 100644 clients/vip-loan/docs/VipLoanBorrowResponse1.md delete mode 100644 clients/vip-loan/docs/VipLoanBorrowResponse2.md delete mode 100644 clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.md create mode 100644 clients/wallet/docs/CheckQuestionnaireRequirementsResponse.md rename clients/wallet/docs/{OnboardedVaspListResponse.md => DepositHistoryV2Response.md} (81%) create mode 100644 clients/wallet/docs/DepositHistoryV2ResponseInner.md create mode 100644 clients/wallet/docs/DepositHistoryV2ResponseInnerQuestionnaire.md create mode 100644 clients/wallet/docs/VaspListResponse.md rename clients/wallet/docs/{OnboardedVaspListResponseInner.md => VaspListResponseInner.md} (86%) delete mode 100644 clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.java create mode 100644 clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/CheckQuestionnaireRequirementsResponse.java rename clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/{OnboardedVaspListResponse.java => DepositHistoryV2Response.java} (76%) create mode 100644 clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInner.java create mode 100644 clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInnerQuestionnaire.java create mode 100644 clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/VaspListResponse.java rename clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/{OnboardedVaspListResponseInner.java => VaspListResponseInner.java} (76%) rename examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/{marketmakerendpoints => account}/OptionMarginAccountInformationExample.java (97%) create mode 100644 examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetLimitPricePairsExample.java rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetCollateralRecordExample.java (96%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{account => flexiblelocked}/GetFlexiblePersonalLeftQuotaExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{account => flexiblelocked}/GetFlexibleProductPositionExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetFlexibleRedemptionRecordExample.java (96%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetFlexibleRewardsHistoryExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/GetFlexibleSubscriptionPreviewExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetFlexibleSubscriptionRecordExample.java (96%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{account => flexiblelocked}/GetLockedPersonalLeftQuotaExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{account => flexiblelocked}/GetLockedProductPositionExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetLockedRedemptionRecordExample.java (96%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetLockedRewardsHistoryExample.java (96%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/GetLockedSubscriptionPreviewExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetLockedSubscriptionRecordExample.java (96%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{history => flexiblelocked}/GetRateHistoryExample.java (96%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{account => flexiblelocked}/GetSimpleEarnFlexibleProductListExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{account => flexiblelocked}/GetSimpleEarnLockedProductListExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/RedeemFlexibleProductExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/RedeemLockedProductExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/SetFlexibleAutoSubscribeExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/SetLockedAutoSubscribeExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/SetLockedProductRedeemOptionExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{account => flexiblelocked}/SimpleAccountExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/SubscribeFlexibleProductExample.java (95%) rename examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/{earn => flexiblelocked}/SubscribeLockedProductExample.java (95%) create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdAccountExample.java create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdQuotaDetailsExample.java create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRateHistoryExample.java create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRedemptionHistoryExample.java create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRewardsHistoryExample.java create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdSubscriptionHistoryExample.java create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/RedeemRwusdExample.java create mode 100644 examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/SubscribeRwusdExample.java create mode 100644 examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingProductListExample.java create mode 100644 examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingRewardsHistoryExample.java create mode 100644 examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/SetSoftStakingExample.java rename examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/{OnboardedVaspListExample.java => CheckQuestionnaireRequirementsExample.java} (66%) create mode 100644 examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java create mode 100644 examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/VaspListExample.java diff --git a/clients/algo/docs/rest-api/migration-guide.md b/clients/algo/docs/rest-api/migration-guide.md index efee4d725..cefdba291 100644 --- a/clients/algo/docs/rest-api/migration-guide.md +++ b/clients/algo/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-algo - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-algo - 1.2.0 + 1.2.1 ``` diff --git a/clients/c2c/docs/rest-api/migration-guide.md b/clients/c2c/docs/rest-api/migration-guide.md index 029ae3415..fe42fc741 100644 --- a/clients/c2c/docs/rest-api/migration-guide.md +++ b/clients/c2c/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-c2c - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-c2c - 1.2.0 + 1.2.1 ``` diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponse.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponse.java deleted file mode 100644 index c9b62b336..000000000 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponse.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Binance Public Spot WebSocket API - * OpenAPI Specifications for the Binance Public Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.common.websocket.dtos; - -import com.binance.connector.client.common.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import java.io.IOException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.HashSet; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; - -/** SessionLogonResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.11.0") -public class SessionLogonResponse extends BaseDTO { - private static final int DIFF_TILL_POSITION_INDEX = 1; - private static final int MAX_DECIMAL_DIGITS = 30; - private static DecimalFormat df; - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @jakarta.annotation.Nullable - private String id; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private Integer status; - - public static final String SERIALIZED_NAME_RESULT = "result"; - - @SerializedName(SERIALIZED_NAME_RESULT) - @jakarta.annotation.Nullable - private SessionLogonResponseResult result; - - public SessionLogonResponse() {} - - public SessionLogonResponse id(@jakarta.annotation.Nullable String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @jakarta.annotation.Nullable - public String getId() { - return id; - } - - public void setId(@jakarta.annotation.Nullable String id) { - this.id = id; - } - - public SessionLogonResponse status(@jakarta.annotation.Nullable Integer status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public Integer getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable Integer status) { - this.status = status; - } - - public SessionLogonResponse result( - @jakarta.annotation.Nullable SessionLogonResponseResult result) { - this.result = result; - return this; - } - - /** - * Get result - * - * @return result - */ - @jakarta.annotation.Nullable - @Valid - public SessionLogonResponseResult getResult() { - return result; - } - - public void setResult(@jakarta.annotation.Nullable SessionLogonResponseResult result) { - this.result = result; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionLogonResponse sessionLogonResponse = (SessionLogonResponse) o; - return Objects.equals(this.id, sessionLogonResponse.id) - && Objects.equals(this.status, sessionLogonResponse.status) - && Objects.equals(this.result, sessionLogonResponse.result); - } - - @Override - public int hashCode() { - return Objects.hash(id, status, result); - } - - @Override - public String toString() { - String sb = - "class SessionLogonResponse {\n" - + " id: " - + toIndentedString(id) - + "\n" - + " status: " - + toIndentedString(status) - + "\n" - + " result: " - + toIndentedString(result) - + "\n" - + "}"; - return sb; - } - - public String toUrlQueryString() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object idValue = getId(); - if (idValue != null) { - String idValueAsString = ""; - idValueAsString = idValue.toString(); - valMap.put("id", urlEncode(idValueAsString)); - } - Object statusValue = getStatus(); - if (statusValue != null) { - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - valMap.put("status", urlEncode(statusValueAsString)); - } - Object resultValue = getResult(); - if (resultValue != null) { - String resultValueAsString = ""; - resultValueAsString = resultValue.toString(); - valMap.put("result", urlEncode(resultValueAsString)); - } - valMap.put("timestamp", getTimestamp()); - return valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&")); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object idValue = getId(); - if (idValue != null) { - valMap.put("id", idValue); - } - Object statusValue = getStatus(); - if (statusValue != null) { - valMap.put("status", statusValue); - } - Object resultValue = getResult(); - if (resultValue != null) { - valMap.put("result", resultValue); - } - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String urlEncode(String s) { - return URLEncoder.encode(s, StandardCharsets.UTF_8); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - private static final HashSet openapiFields; - private static final HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("status"); - openapiFields.add("result"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionLogonResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionLogonResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in SessionLogonResponse is not found in" - + " the empty JSON string", - SessionLogonResponse.openapiRequiredFields)); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionLogonResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SessionLogonResponse` properties. JSON: %s", - entry.getKey(), jsonElement)); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - // validate the optional field `result` - if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { - SessionLogonResponseResult.validateJsonElement(jsonObj.get("result")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionLogonResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionLogonResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(SessionLogonResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionLogonResponse value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionLogonResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of SessionLogonResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionLogonResponse - * @throws IOException if the JSON string is invalid with respect to SessionLogonResponse - */ - public static SessionLogonResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionLogonResponse.class); - } - - /** - * Convert an instance of SessionLogonResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } - - private static DecimalFormat getFormatter() { - if (null == df) { - // Overrides the default Locale - DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH); - df = new DecimalFormat("#,##0.###", symbols); - df.setMaximumFractionDigits(MAX_DECIMAL_DIGITS); - df.setGroupingUsed(false); - } - return df; - } -} diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseDTO.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseDTO.java deleted file mode 100644 index 1b7eec496..000000000 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseDTO.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.binance.connector.client.common.websocket.dtos; - -public class SessionLogonResponseDTO { - private String apiKey; - private Long authorizedSince; - private Long connectedSince; - private Boolean returnRateLimits; - private Long serverTime; - private Boolean userDataStream; -} diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseResult.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseResult.java deleted file mode 100644 index e71d259dc..000000000 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/dtos/SessionLogonResponseResult.java +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Binance Public Spot WebSocket API - * OpenAPI Specifications for the Binance Public Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.common.websocket.dtos; - -import com.binance.connector.client.common.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.HashSet; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; - -/** SessionLogonResponseResult */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.11.0") -public class SessionLogonResponseResult extends BaseDTO { - private static final int DIFF_TILL_POSITION_INDEX = 1; - private static final int MAX_DECIMAL_DIGITS = 30; - private static DecimalFormat df; - public static final String SERIALIZED_NAME_API_KEY = "apiKey"; - - @SerializedName(SERIALIZED_NAME_API_KEY) - @jakarta.annotation.Nullable - private String apiKey; - - public static final String SERIALIZED_NAME_AUTHORIZED_SINCE = "authorizedSince"; - - @SerializedName(SERIALIZED_NAME_AUTHORIZED_SINCE) - @jakarta.annotation.Nullable - private Long authorizedSince; - - public static final String SERIALIZED_NAME_CONNECTED_SINCE = "connectedSince"; - - @SerializedName(SERIALIZED_NAME_CONNECTED_SINCE) - @jakarta.annotation.Nullable - private Long connectedSince; - - public static final String SERIALIZED_NAME_RETURN_RATE_LIMITS = "returnRateLimits"; - - @SerializedName(SERIALIZED_NAME_RETURN_RATE_LIMITS) - @jakarta.annotation.Nullable - private Boolean returnRateLimits; - - public static final String SERIALIZED_NAME_SERVER_TIME = "serverTime"; - - @SerializedName(SERIALIZED_NAME_SERVER_TIME) - @jakarta.annotation.Nullable - private Long serverTime; - - public static final String SERIALIZED_NAME_USER_DATA_STREAM = "userDataStream"; - - @SerializedName(SERIALIZED_NAME_USER_DATA_STREAM) - @jakarta.annotation.Nullable - private Boolean userDataStream; - - public SessionLogonResponseResult() {} - - public SessionLogonResponseResult apiKey(@jakarta.annotation.Nullable String apiKey) { - this.apiKey = apiKey; - return this; - } - - /** - * Get apiKey - * - * @return apiKey - */ - @jakarta.annotation.Nullable - public String getApiKey() { - return apiKey; - } - - public void setApiKey(@jakarta.annotation.Nullable String apiKey) { - this.apiKey = apiKey; - } - - public SessionLogonResponseResult authorizedSince( - @jakarta.annotation.Nullable Long authorizedSince) { - this.authorizedSince = authorizedSince; - return this; - } - - /** - * Get authorizedSince - * - * @return authorizedSince - */ - @jakarta.annotation.Nullable - public Long getAuthorizedSince() { - return authorizedSince; - } - - public void setAuthorizedSince(@jakarta.annotation.Nullable Long authorizedSince) { - this.authorizedSince = authorizedSince; - } - - public SessionLogonResponseResult connectedSince( - @jakarta.annotation.Nullable Long connectedSince) { - this.connectedSince = connectedSince; - return this; - } - - /** - * Get connectedSince - * - * @return connectedSince - */ - @jakarta.annotation.Nullable - public Long getConnectedSince() { - return connectedSince; - } - - public void setConnectedSince(@jakarta.annotation.Nullable Long connectedSince) { - this.connectedSince = connectedSince; - } - - public SessionLogonResponseResult returnRateLimits( - @jakarta.annotation.Nullable Boolean returnRateLimits) { - this.returnRateLimits = returnRateLimits; - return this; - } - - /** - * Get returnRateLimits - * - * @return returnRateLimits - */ - @jakarta.annotation.Nullable - public Boolean getReturnRateLimits() { - return returnRateLimits; - } - - public void setReturnRateLimits(@jakarta.annotation.Nullable Boolean returnRateLimits) { - this.returnRateLimits = returnRateLimits; - } - - public SessionLogonResponseResult serverTime(@jakarta.annotation.Nullable Long serverTime) { - this.serverTime = serverTime; - return this; - } - - /** - * Get serverTime - * - * @return serverTime - */ - @jakarta.annotation.Nullable - public Long getServerTime() { - return serverTime; - } - - public void setServerTime(@jakarta.annotation.Nullable Long serverTime) { - this.serverTime = serverTime; - } - - public SessionLogonResponseResult userDataStream( - @jakarta.annotation.Nullable Boolean userDataStream) { - this.userDataStream = userDataStream; - return this; - } - - /** - * Get userDataStream - * - * @return userDataStream - */ - @jakarta.annotation.Nullable - public Boolean getUserDataStream() { - return userDataStream; - } - - public void setUserDataStream(@jakarta.annotation.Nullable Boolean userDataStream) { - this.userDataStream = userDataStream; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionLogonResponseResult sessionLogonResponseResult = (SessionLogonResponseResult) o; - return Objects.equals(this.apiKey, sessionLogonResponseResult.apiKey) - && Objects.equals(this.authorizedSince, sessionLogonResponseResult.authorizedSince) - && Objects.equals(this.connectedSince, sessionLogonResponseResult.connectedSince) - && Objects.equals( - this.returnRateLimits, sessionLogonResponseResult.returnRateLimits) - && Objects.equals(this.serverTime, sessionLogonResponseResult.serverTime) - && Objects.equals(this.userDataStream, sessionLogonResponseResult.userDataStream); - } - - @Override - public int hashCode() { - return Objects.hash( - apiKey, - authorizedSince, - connectedSince, - returnRateLimits, - serverTime, - userDataStream); - } - - @Override - public String toString() { - String sb = - "class SessionLogonResponseResult {\n" - + " apiKey: " - + toIndentedString(apiKey) - + "\n" - + " authorizedSince: " - + toIndentedString(authorizedSince) - + "\n" - + " connectedSince: " - + toIndentedString(connectedSince) - + "\n" - + " returnRateLimits: " - + toIndentedString(returnRateLimits) - + "\n" - + " serverTime: " - + toIndentedString(serverTime) - + "\n" - + " userDataStream: " - + toIndentedString(userDataStream) - + "\n" - + "}"; - return sb; - } - - public String toUrlQueryString() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object apiKeyValue = getApiKey(); - if (apiKeyValue != null) { - String apiKeyValueAsString = ""; - apiKeyValueAsString = apiKeyValue.toString(); - valMap.put("apiKey", urlEncode(apiKeyValueAsString)); - } - Object authorizedSinceValue = getAuthorizedSince(); - if (authorizedSinceValue != null) { - String authorizedSinceValueAsString = ""; - authorizedSinceValueAsString = authorizedSinceValue.toString(); - valMap.put("authorizedSince", urlEncode(authorizedSinceValueAsString)); - } - Object connectedSinceValue = getConnectedSince(); - if (connectedSinceValue != null) { - String connectedSinceValueAsString = ""; - connectedSinceValueAsString = connectedSinceValue.toString(); - valMap.put("connectedSince", urlEncode(connectedSinceValueAsString)); - } - Object returnRateLimitsValue = getReturnRateLimits(); - if (returnRateLimitsValue != null) { - String returnRateLimitsValueAsString = ""; - returnRateLimitsValueAsString = returnRateLimitsValue.toString(); - valMap.put("returnRateLimits", urlEncode(returnRateLimitsValueAsString)); - } - Object serverTimeValue = getServerTime(); - if (serverTimeValue != null) { - String serverTimeValueAsString = ""; - serverTimeValueAsString = serverTimeValue.toString(); - valMap.put("serverTime", urlEncode(serverTimeValueAsString)); - } - Object userDataStreamValue = getUserDataStream(); - if (userDataStreamValue != null) { - String userDataStreamValueAsString = ""; - userDataStreamValueAsString = userDataStreamValue.toString(); - valMap.put("userDataStream", urlEncode(userDataStreamValueAsString)); - } - valMap.put("timestamp", getTimestamp()); - return valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&")); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object apiKeyValue = getApiKey(); - if (apiKeyValue != null) { - valMap.put("apiKey", apiKeyValue); - } - Object authorizedSinceValue = getAuthorizedSince(); - if (authorizedSinceValue != null) { - valMap.put("authorizedSince", authorizedSinceValue); - } - Object connectedSinceValue = getConnectedSince(); - if (connectedSinceValue != null) { - valMap.put("connectedSince", connectedSinceValue); - } - Object returnRateLimitsValue = getReturnRateLimits(); - if (returnRateLimitsValue != null) { - valMap.put("returnRateLimits", returnRateLimitsValue); - } - Object serverTimeValue = getServerTime(); - if (serverTimeValue != null) { - valMap.put("serverTime", serverTimeValue); - } - Object userDataStreamValue = getUserDataStream(); - if (userDataStreamValue != null) { - valMap.put("userDataStream", userDataStreamValue); - } - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String urlEncode(String s) { - return URLEncoder.encode(s, StandardCharsets.UTF_8); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - private static final HashSet openapiFields; - private static final HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiKey"); - openapiFields.add("authorizedSince"); - openapiFields.add("connectedSince"); - openapiFields.add("returnRateLimits"); - openapiFields.add("serverTime"); - openapiFields.add("userDataStream"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionLogonResponseResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionLogonResponseResult.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in SessionLogonResponseResult is not" - + " found in the empty JSON string", - SessionLogonResponseResult.openapiRequiredFields)); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionLogonResponseResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SessionLogonResponseResult` properties. JSON: %s", - entry.getKey(), jsonElement)); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("apiKey") != null && !jsonObj.get("apiKey").isJsonNull()) - && !jsonObj.get("apiKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `apiKey` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("apiKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionLogonResponseResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionLogonResponseResult' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(SessionLogonResponseResult.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionLogonResponseResult value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionLogonResponseResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of SessionLogonResponseResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionLogonResponseResult - * @throws IOException if the JSON string is invalid with respect to SessionLogonResponseResult - */ - public static SessionLogonResponseResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionLogonResponseResult.class); - } - - /** - * Convert an instance of SessionLogonResponseResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } - - private static DecimalFormat getFormatter() { - if (null == df) { - // Overrides the default Locale - DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH); - df = new DecimalFormat("#,##0.###", symbols); - df.setMaximumFractionDigits(MAX_DECIMAL_DIGITS); - df.setGroupingUsed(false); - } - return df; - } -} diff --git a/clients/convert/docs/rest-api/migration-guide.md b/clients/convert/docs/rest-api/migration-guide.md index 5e8cd74f7..fb5d60b3e 100644 --- a/clients/convert/docs/rest-api/migration-guide.md +++ b/clients/convert/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-convert - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-convert - 1.2.0 + 1.2.1 ``` diff --git a/clients/copy-trading/docs/rest-api/migration-guide.md b/clients/copy-trading/docs/rest-api/migration-guide.md index 5862150df..fc28fdac4 100644 --- a/clients/copy-trading/docs/rest-api/migration-guide.md +++ b/clients/copy-trading/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-copy-trading - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-copy-trading - 1.2.0 + 1.2.1 ``` diff --git a/clients/crypto-loan/CHANGELOG.md b/clients/crypto-loan/CHANGELOG.md index 92e3ddb93..7379054f7 100644 --- a/clients/crypto-loan/CHANGELOG.md +++ b/clients/crypto-loan/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Changed (2) + +- Added parameter `collateralAmount` + - affected methods: + - `flexibleLoanBorrow()` (`POST /sapi/v2/loan/flexible/borrow`) +- Added parameter `loanAmount` + - affected methods: + - `flexibleLoanBorrow()` (`POST /sapi/v2/loan/flexible/borrow`) + ## 2.1.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/crypto-loan/docs/CryptoLoanAdjustLtvResponse.md b/clients/crypto-loan/docs/CryptoLoanAdjustLtvResponse.md deleted file mode 100644 index fe7e8f708..000000000 --- a/clients/crypto-loan/docs/CryptoLoanAdjustLtvResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CryptoLoanAdjustLtvResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**direction** | **String** | | [optional] | -|**amount** | **String** | | [optional] | -|**currentLTV** | **String** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanBorrowRequest.md b/clients/crypto-loan/docs/CryptoLoanBorrowRequest.md deleted file mode 100644 index 8a87d9872..000000000 --- a/clients/crypto-loan/docs/CryptoLoanBorrowRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# CryptoLoanBorrowRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | | -|**collateralCoin** | **String** | | | -|**loanTerm** | **Long** | | | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanBorrowResponse.md b/clients/crypto-loan/docs/CryptoLoanBorrowResponse.md deleted file mode 100644 index c25bc49b0..000000000 --- a/clients/crypto-loan/docs/CryptoLoanBorrowResponse.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# CryptoLoanBorrowResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | [optional] | -|**loanAmount** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**collateralAmount** | **String** | | [optional] | -|**hourlyInterestRate** | **String** | | [optional] | -|**orderId** | **String** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponse.md b/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponse.md deleted file mode 100644 index c88f81c45..000000000 --- a/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# CryptoLoanCustomizeMarginCallResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rows** | [**List<CryptoLoanCustomizeMarginCallResponseRowsInner>**](CryptoLoanCustomizeMarginCallResponseRowsInner.md) | | [optional] | -|**total** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponseRowsInner.md b/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponseRowsInner.md deleted file mode 100644 index 914ee823d..000000000 --- a/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallResponseRowsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CryptoLoanCustomizeMarginCallResponseRowsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderId** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**preMarginCall** | **String** | | [optional] | -|**afterMarginCall** | **String** | | [optional] | -|**customizeTime** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanRepayRequest.md b/clients/crypto-loan/docs/CryptoLoanRepayRequest.md deleted file mode 100644 index cecb95b63..000000000 --- a/clients/crypto-loan/docs/CryptoLoanRepayRequest.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CryptoLoanRepayRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderId** | **Long** | | | -|**amount** | **Double** | | | -|**type** | **Long** | | [optional] | -|**collateralReturn** | **Boolean** | | [optional] | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanRepayResponse.md b/clients/crypto-loan/docs/CryptoLoanRepayResponse.md deleted file mode 100644 index 4052f43ff..000000000 --- a/clients/crypto-loan/docs/CryptoLoanRepayResponse.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CryptoLoanRepayResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | [optional] | -|**remainingPrincipal** | **String** | | [optional] | -|**remainingInterest** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**remainingCollateral** | **String** | | [optional] | -|**currentLTV** | **String** | | [optional] | -|**repayStatus** | **String** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanRepayResponse1.md b/clients/crypto-loan/docs/CryptoLoanRepayResponse1.md deleted file mode 100644 index 7dbada74e..000000000 --- a/clients/crypto-loan/docs/CryptoLoanRepayResponse1.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CryptoLoanRepayResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | [optional] | -|**remainingPrincipal** | **String** | | [optional] | -|**remainingInterest** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**remainingCollateral** | **String** | | [optional] | -|**currentLTV** | **String** | | [optional] | -|**repayStatus** | **String** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/CryptoLoanRepayResponse2.md b/clients/crypto-loan/docs/CryptoLoanRepayResponse2.md deleted file mode 100644 index 44be01a58..000000000 --- a/clients/crypto-loan/docs/CryptoLoanRepayResponse2.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# CryptoLoanRepayResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**repayStatus** | **String** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/FlexibleLoanBorrowRequest.md b/clients/crypto-loan/docs/FlexibleLoanBorrowRequest.md index d21fcea50..bae1abc8b 100644 --- a/clients/crypto-loan/docs/FlexibleLoanBorrowRequest.md +++ b/clients/crypto-loan/docs/FlexibleLoanBorrowRequest.md @@ -8,7 +8,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**loanCoin** | **String** | | | +|**loanAmount** | **Double** | | [optional] | |**collateralCoin** | **String** | | | +|**collateralAmount** | **Double** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentRequest.md b/clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentRequest.md deleted file mode 100644 index b95062305..000000000 --- a/clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentRequest.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FlexibleLoanCollateralRepaymentRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | | -|**collateralCoin** | **String** | | | -|**repayAmount** | **Double** | | | -|**fullRepayment** | **Boolean** | | [optional] | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentResponse.md b/clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentResponse.md deleted file mode 100644 index 57cee0ab2..000000000 --- a/clients/crypto-loan/docs/FlexibleLoanCollateralRepaymentResponse.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# FlexibleLoanCollateralRepaymentResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**remainingDebt** | **String** | | [optional] | -|**remainingCollateral** | **String** | | [optional] | -|**fullRepayment** | **Boolean** | | [optional] | -|**currentLTV** | **String** | | [optional] | -|**repayStatus** | **String** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/GetCollateralAssetsDataResponse.md b/clients/crypto-loan/docs/GetCollateralAssetsDataResponse.md deleted file mode 100644 index c14817214..000000000 --- a/clients/crypto-loan/docs/GetCollateralAssetsDataResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetCollateralAssetsDataResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rows** | [**List<GetCollateralAssetsDataResponseRowsInner>**](GetCollateralAssetsDataResponseRowsInner.md) | | [optional] | -|**total** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/GetCollateralAssetsDataResponseRowsInner.md b/clients/crypto-loan/docs/GetCollateralAssetsDataResponseRowsInner.md deleted file mode 100644 index 9981e2906..000000000 --- a/clients/crypto-loan/docs/GetCollateralAssetsDataResponseRowsInner.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetCollateralAssetsDataResponseRowsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**collateralCoin** | **String** | | [optional] | -|**initialLTV** | **String** | | [optional] | -|**marginCallLTV** | **String** | | [optional] | -|**liquidationLTV** | **String** | | [optional] | -|**maxLimit** | **String** | | [optional] | -|**vipLevel** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/GetLoanOngoingOrdersResponse.md b/clients/crypto-loan/docs/GetLoanOngoingOrdersResponse.md deleted file mode 100644 index a6420bab0..000000000 --- a/clients/crypto-loan/docs/GetLoanOngoingOrdersResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetLoanOngoingOrdersResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rows** | [**List<GetLoanOngoingOrdersResponseRowsInner>**](GetLoanOngoingOrdersResponseRowsInner.md) | | [optional] | -|**total** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/GetLoanOngoingOrdersResponseRowsInner.md b/clients/crypto-loan/docs/GetLoanOngoingOrdersResponseRowsInner.md deleted file mode 100644 index f075d7c80..000000000 --- a/clients/crypto-loan/docs/GetLoanOngoingOrdersResponseRowsInner.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# GetLoanOngoingOrdersResponseRowsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderId** | **Long** | | [optional] | -|**loanCoin** | **String** | | [optional] | -|**totalDebt** | **String** | | [optional] | -|**residualInterest** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**collateralAmount** | **String** | | [optional] | -|**currentLTV** | **String** | | [optional] | -|**expirationTime** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/GetLoanableAssetsDataResponse.md b/clients/crypto-loan/docs/GetLoanableAssetsDataResponse.md deleted file mode 100644 index e264a531a..000000000 --- a/clients/crypto-loan/docs/GetLoanableAssetsDataResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetLoanableAssetsDataResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rows** | [**List<GetLoanableAssetsDataResponseRowsInner>**](GetLoanableAssetsDataResponseRowsInner.md) | | [optional] | -|**total** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/GetLoanableAssetsDataResponseRowsInner.md b/clients/crypto-loan/docs/GetLoanableAssetsDataResponseRowsInner.md deleted file mode 100644 index 5b8f5aa00..000000000 --- a/clients/crypto-loan/docs/GetLoanableAssetsDataResponseRowsInner.md +++ /dev/null @@ -1,26 +0,0 @@ - - -# GetLoanableAssetsDataResponseRowsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanCoin** | **String** | | [optional] | -|**_7dHourlyInterestRate** | **String** | | [optional] | -|**_7dDailyInterestRate** | **String** | | [optional] | -|**_14dHourlyInterestRate** | **String** | | [optional] | -|**_14dDailyInterestRate** | **String** | | [optional] | -|**_30dHourlyInterestRate** | **String** | | [optional] | -|**_30dDailyInterestRate** | **String** | | [optional] | -|**_90dHourlyInterestRate** | **String** | | [optional] | -|**_90dDailyInterestRate** | **String** | | [optional] | -|**_180dHourlyInterestRate** | **String** | | [optional] | -|**_180dDailyInterestRate** | **String** | | [optional] | -|**minLimit** | **String** | | [optional] | -|**maxLimit** | **String** | | [optional] | -|**vipLevel** | **Long** | | [optional] | - - - diff --git a/clients/crypto-loan/docs/rest-api/migration-guide.md b/clients/crypto-loan/docs/rest-api/migration-guide.md index 277e548ce..e3d0863dd 100644 --- a/clients/crypto-loan/docs/rest-api/migration-guide.md +++ b/clients/crypto-loan/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-crypto-loan - 2.1.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-crypto-loan - 2.1.0 + 3.0.0 ``` diff --git a/clients/crypto-loan/pom.xml b/clients/crypto-loan/pom.xml index 01abc74a4..52bdfe5dd 100644 --- a/clients/crypto-loan/pom.xml +++ b/clients/crypto-loan/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-crypto-loan crypto-loan - 2.1.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java index 8f212c7c5..9d98056a6 100644 --- a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java @@ -57,7 +57,7 @@ public class FlexibleRateApi { private static final String USER_AGENT = String.format( - "binance-crypto-loan/2.1.1 (Java/%s; %s; %s)", + "binance-crypto-loan/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -455,10 +455,24 @@ private okhttp3.Call flexibleLoanBorrowCall(FlexibleLoanBorrowRequest flexibleLo localVarFormParams.put("loanCoin", flexibleLoanBorrowRequest.getLoanCoin()); } + if (flexibleLoanBorrowRequest.getLoanAmount() != null) { + localVarFormParams.put( + "loanAmount", + DecimalFormatter.getFormatter() + .format(flexibleLoanBorrowRequest.getLoanAmount())); + } + if (flexibleLoanBorrowRequest.getCollateralCoin() != null) { localVarFormParams.put("collateralCoin", flexibleLoanBorrowRequest.getCollateralCoin()); } + if (flexibleLoanBorrowRequest.getCollateralAmount() != null) { + localVarFormParams.put( + "collateralAmount", + DecimalFormatter.getFormatter() + .format(flexibleLoanBorrowRequest.getCollateralAmount())); + } + if (flexibleLoanBorrowRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", flexibleLoanBorrowRequest.getRecvWindow()); } diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java index 751f8c39f..85b727696 100644 --- a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java @@ -47,7 +47,7 @@ public class StableRateApi { private static final String USER_AGENT = String.format( - "binance-crypto-loan/2.1.1 (Java/%s; %s; %s)", + "binance-crypto-loan/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/FlexibleLoanBorrowRequest.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/FlexibleLoanBorrowRequest.java index 8bed7b7bd..4eef6e804 100644 --- a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/FlexibleLoanBorrowRequest.java +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/FlexibleLoanBorrowRequest.java @@ -22,6 +22,7 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -42,12 +43,24 @@ public class FlexibleLoanBorrowRequest { @jakarta.annotation.Nonnull private String loanCoin; + public static final String SERIALIZED_NAME_LOAN_AMOUNT = "loanAmount"; + + @SerializedName(SERIALIZED_NAME_LOAN_AMOUNT) + @jakarta.annotation.Nullable + private Double loanAmount; + public static final String SERIALIZED_NAME_COLLATERAL_COIN = "collateralCoin"; @SerializedName(SERIALIZED_NAME_COLLATERAL_COIN) @jakarta.annotation.Nonnull private String collateralCoin; + public static final String SERIALIZED_NAME_COLLATERAL_AMOUNT = "collateralAmount"; + + @SerializedName(SERIALIZED_NAME_COLLATERAL_AMOUNT) + @jakarta.annotation.Nullable + private Double collateralAmount; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -76,6 +89,26 @@ public void setLoanCoin(@jakarta.annotation.Nonnull String loanCoin) { this.loanCoin = loanCoin; } + public FlexibleLoanBorrowRequest loanAmount(@jakarta.annotation.Nullable Double loanAmount) { + this.loanAmount = loanAmount; + return this; + } + + /** + * Get loanAmount + * + * @return loanAmount + */ + @jakarta.annotation.Nullable + @Valid + public Double getLoanAmount() { + return loanAmount; + } + + public void setLoanAmount(@jakarta.annotation.Nullable Double loanAmount) { + this.loanAmount = loanAmount; + } + public FlexibleLoanBorrowRequest collateralCoin( @jakarta.annotation.Nonnull String collateralCoin) { this.collateralCoin = collateralCoin; @@ -97,6 +130,27 @@ public void setCollateralCoin(@jakarta.annotation.Nonnull String collateralCoin) this.collateralCoin = collateralCoin; } + public FlexibleLoanBorrowRequest collateralAmount( + @jakarta.annotation.Nullable Double collateralAmount) { + this.collateralAmount = collateralAmount; + return this; + } + + /** + * Get collateralAmount + * + * @return collateralAmount + */ + @jakarta.annotation.Nullable + @Valid + public Double getCollateralAmount() { + return collateralAmount; + } + + public void setCollateralAmount(@jakarta.annotation.Nullable Double collateralAmount) { + this.collateralAmount = collateralAmount; + } + public FlexibleLoanBorrowRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -126,13 +180,15 @@ public boolean equals(Object o) { } FlexibleLoanBorrowRequest flexibleLoanBorrowRequest = (FlexibleLoanBorrowRequest) o; return Objects.equals(this.loanCoin, flexibleLoanBorrowRequest.loanCoin) + && Objects.equals(this.loanAmount, flexibleLoanBorrowRequest.loanAmount) && Objects.equals(this.collateralCoin, flexibleLoanBorrowRequest.collateralCoin) + && Objects.equals(this.collateralAmount, flexibleLoanBorrowRequest.collateralAmount) && Objects.equals(this.recvWindow, flexibleLoanBorrowRequest.recvWindow); } @Override public int hashCode() { - return Objects.hash(loanCoin, collateralCoin, recvWindow); + return Objects.hash(loanCoin, loanAmount, collateralCoin, collateralAmount, recvWindow); } @Override @@ -140,7 +196,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FlexibleLoanBorrowRequest {\n"); sb.append(" loanCoin: ").append(toIndentedString(loanCoin)).append("\n"); + sb.append(" loanAmount: ").append(toIndentedString(loanAmount)).append("\n"); sb.append(" collateralCoin: ").append(toIndentedString(collateralCoin)).append("\n"); + sb.append(" collateralAmount: ").append(toIndentedString(collateralAmount)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -153,10 +211,18 @@ public String toUrlQueryString() { String loanCoinValueAsString = ""; loanCoinValueAsString = loanCoinValue.toString(); sb.append("loanCoin=").append(urlEncode(loanCoinValueAsString)).append(""); + Object loanAmountValue = getLoanAmount(); + String loanAmountValueAsString = ""; + loanAmountValueAsString = loanAmountValue.toString(); + sb.append("loanAmount=").append(urlEncode(loanAmountValueAsString)).append(""); Object collateralCoinValue = getCollateralCoin(); String collateralCoinValueAsString = ""; collateralCoinValueAsString = collateralCoinValue.toString(); sb.append("collateralCoin=").append(urlEncode(collateralCoinValueAsString)).append(""); + Object collateralAmountValue = getCollateralAmount(); + String collateralAmountValueAsString = ""; + collateralAmountValueAsString = collateralAmountValue.toString(); + sb.append("collateralAmount=").append(urlEncode(collateralAmountValueAsString)).append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -190,7 +256,9 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("loanCoin"); + openapiFields.add("loanAmount"); openapiFields.add("collateralCoin"); + openapiFields.add("collateralAmount"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index 6b434cb91..4d9e01c7a 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Changed (1) + +#### REST API + +- Modified response for `exchangeInformation()` method (`GET /dapi/v1/exchangeInfo`): + - `symbols`.`filters`.`multiplierDecimal`: type `integer` → `string` + ## 2.0.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/derivatives-trading-coin-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md b/clients/derivatives-trading-coin-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md index 1fae61531..255492ae3 100644 --- a/clients/derivatives-trading-coin-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md +++ b/clients/derivatives-trading-coin-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md @@ -17,7 +17,7 @@ |**limit** | **Long** | | [optional] | |**multiplierUp** | **String** | | [optional] | |**multiplierDown** | **String** | | [optional] | -|**multiplierDecimal** | **Long** | | [optional] | +|**multiplierDecimal** | **String** | | [optional] | diff --git a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md index 595840d7c..013186efa 100644 --- a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-coin-futures - 1.3.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-coin-futures - 1.3.0 + 3.0.0 ``` diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index 8272d7276..f19cefeaf 100644 --- a/clients/derivatives-trading-coin-futures/pom.xml +++ b/clients/derivatives-trading-coin-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-coin-futures derivatives-trading-coin-futures - 2.0.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java index 123825eac..4a7a62aaf 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java @@ -54,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java index 2d0c98e4a..14aa1ef09 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java @@ -69,7 +69,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java index 97bf12274..67ed4e88c 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java index 88ac47bae..f630dce0d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java @@ -76,7 +76,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java index 695b2f347..7237594da 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java index 520857206..4ab07d7d1 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java @@ -100,7 +100,7 @@ public class ExchangeInformationResponseSymbolsInnerFiltersInner { @SerializedName(SERIALIZED_NAME_MULTIPLIER_DECIMAL) @jakarta.annotation.Nullable - private Long multiplierDecimal; + private String multiplierDecimal; public ExchangeInformationResponseSymbolsInnerFiltersInner() {} @@ -305,7 +305,7 @@ public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown } public ExchangeInformationResponseSymbolsInnerFiltersInner multiplierDecimal( - @jakarta.annotation.Nullable Long multiplierDecimal) { + @jakarta.annotation.Nullable String multiplierDecimal) { this.multiplierDecimal = multiplierDecimal; return this; } @@ -316,11 +316,11 @@ public ExchangeInformationResponseSymbolsInnerFiltersInner multiplierDecimal( * @return multiplierDecimal */ @jakarta.annotation.Nullable - public Long getMultiplierDecimal() { + public String getMultiplierDecimal() { return multiplierDecimal; } - public void setMultiplierDecimal(@jakarta.annotation.Nullable Long multiplierDecimal) { + public void setMultiplierDecimal(@jakarta.annotation.Nullable String multiplierDecimal) { this.multiplierDecimal = multiplierDecimal; } @@ -585,6 +585,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("multiplierDown").toString())); } + if ((jsonObj.get("multiplierDecimal") != null + && !jsonObj.get("multiplierDecimal").isJsonNull()) + && !jsonObj.get("multiplierDecimal").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierDecimal` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("multiplierDecimal").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java index d66585480..5408a23c4 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java @@ -27,12 +27,14 @@ import com.binance.connector.client.derivatives_trading_coin_futures.websocket.api.model.QueryOrderResponse; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.api.model.StartUserDataStreamRequest; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.api.model.StartUserDataStreamResponse; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.CompletableFuture; public class DerivativesTradingCoinFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -48,6 +50,11 @@ public DerivativesTradingCoinFuturesWebSocketApi(WebSocketClientConfiguration co public DerivativesTradingCoinFuturesWebSocketApi(ConnectionInterface connection) { connection.setUserAgent(USER_AGENT); + List logonMethods = new ArrayList<>(); + List logoutMethods = new ArrayList<>(); + + connection.setLogonMethods(logonMethods); + connection.setLogoutMethods(logoutMethods); if (!connection.isConnected()) { connection.connect(); } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java index 5ed162a87..07f915e09 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java @@ -58,7 +58,7 @@ public class DerivativesTradingCoinFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-options/CHANGELOG.md b/clients/derivatives-trading-options/CHANGELOG.md index 885bab501..7290df346 100644 --- a/clients/derivatives-trading-options/CHANGELOG.md +++ b/clients/derivatives-trading-options/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Changed (4) + +#### REST API + +- Modified response for `exchangeInformation()` method (`GET /eapi/v1/exchangeInfo`): + - `optionSymbols`: item property `liquidationFeeRate` added + +- Modified response for `optionMarginAccountInformation()` method (`GET /eapi/v1/marginAccount`): + - `asset`: item property `adjustedEquity` added + - `asset`: item property `lpProfit` deleted + ## 2.0.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/derivatives-trading-options/docs/AccountApi.md b/clients/derivatives-trading-options/docs/AccountApi.md index 4322ffeb6..a348742ac 100644 --- a/clients/derivatives-trading-options/docs/AccountApi.md +++ b/clients/derivatives-trading-options/docs/AccountApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://eapi.binance.com* | [**getDownloadIdForOptionTransactionHistory**](AccountApi.md#getDownloadIdForOptionTransactionHistory) | **GET** /eapi/v1/income/asyn | Get Download Id For Option Transaction History (USER_DATA) | | [**getOptionTransactionHistoryDownloadLinkById**](AccountApi.md#getOptionTransactionHistoryDownloadLinkById) | **GET** /eapi/v1/income/asyn/id | Get Option Transaction History Download Link by Id (USER_DATA) | | [**optionAccountInformation**](AccountApi.md#optionAccountInformation) | **GET** /eapi/v1/account | Option Account Information(TRADE) | +| [**optionMarginAccountInformation**](AccountApi.md#optionMarginAccountInformation) | **GET** /eapi/v1/marginAccount | Option Margin Account Information (USER_DATA) | @@ -274,3 +275,65 @@ No authorization required |-------------|-------------|------------------| | **200** | Option Account Information | - | + +# **optionMarginAccountInformation** +> OptionMarginAccountInformationResponse optionMarginAccountInformation(recvWindow) + +Option Margin Account Information (USER_DATA) + +Get current account information. Weight: 3 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.rest.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://eapi.binance.com"); + + AccountApi apiInstance = new AccountApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + OptionMarginAccountInformationResponse result = apiInstance.optionMarginAccountInformation(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#optionMarginAccountInformation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**OptionMarginAccountInformationResponse**](OptionMarginAccountInformationResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Option Margin Account Information | - | + diff --git a/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md b/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md index 15ac19235..de23ca13c 100644 --- a/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md +++ b/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md @@ -16,6 +16,7 @@ |**unit** | **Long** | | [optional] | |**makerFeeRate** | **String** | | [optional] | |**takerFeeRate** | **String** | | [optional] | +|**liquidationFeeRate** | **String** | | [optional] | |**minQty** | **String** | | [optional] | |**maxQty** | **String** | | [optional] | |**initialMargin** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/MarketMakerEndpointsApi.md b/clients/derivatives-trading-options/docs/MarketMakerEndpointsApi.md index a5507852c..33f4ed14d 100644 --- a/clients/derivatives-trading-options/docs/MarketMakerEndpointsApi.md +++ b/clients/derivatives-trading-options/docs/MarketMakerEndpointsApi.md @@ -7,7 +7,6 @@ All URIs are relative to *https://eapi.binance.com* | [**autoCancelAllOpenOrders**](MarketMakerEndpointsApi.md#autoCancelAllOpenOrders) | **POST** /eapi/v1/countdownCancelAllHeartBeat | Auto-Cancel All Open Orders (Kill-Switch) Heartbeat (TRADE) | | [**getAutoCancelAllOpenOrders**](MarketMakerEndpointsApi.md#getAutoCancelAllOpenOrders) | **GET** /eapi/v1/countdownCancelAll | Get Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) | | [**getMarketMakerProtectionConfig**](MarketMakerEndpointsApi.md#getMarketMakerProtectionConfig) | **GET** /eapi/v1/mmp | Get Market Maker Protection Config (TRADE) | -| [**optionMarginAccountInformation**](MarketMakerEndpointsApi.md#optionMarginAccountInformation) | **GET** /eapi/v1/marginAccount | Option Margin Account Information (USER_DATA) | | [**resetMarketMakerProtectionConfig**](MarketMakerEndpointsApi.md#resetMarketMakerProtectionConfig) | **POST** /eapi/v1/mmpReset | Reset Market Maker Protection Config (TRADE) | | [**setAutoCancelAllOpenOrders**](MarketMakerEndpointsApi.md#setAutoCancelAllOpenOrders) | **POST** /eapi/v1/countdownCancelAll | Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) | | [**setMarketMakerProtectionConfig**](MarketMakerEndpointsApi.md#setMarketMakerProtectionConfig) | **POST** /eapi/v1/mmpSet | Set Market Maker Protection Config (TRADE) | @@ -203,68 +202,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Market Maker Protection Config | - | - -# **optionMarginAccountInformation** -> OptionMarginAccountInformationResponse optionMarginAccountInformation(recvWindow) - -Option Margin Account Information (USER_DATA) - -Get current account information. Weight: 3 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.rest.api.MarketMakerEndpointsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://eapi.binance.com"); - - MarketMakerEndpointsApi apiInstance = new MarketMakerEndpointsApi(defaultClient); - Long recvWindow = 56L; // Long | - try { - OptionMarginAccountInformationResponse result = apiInstance.optionMarginAccountInformation(recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketMakerEndpointsApi#optionMarginAccountInformation"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**OptionMarginAccountInformationResponse**](OptionMarginAccountInformationResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Option Margin Account Information | - | - # **resetMarketMakerProtectionConfig** > ResetMarketMakerProtectionConfigResponse resetMarketMakerProtectionConfig(resetMarketMakerProtectionConfigRequest) diff --git a/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponseAssetInner.md b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponseAssetInner.md index dcc5faecc..8f862ee2c 100644 --- a/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponseAssetInner.md +++ b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponseAssetInner.md @@ -14,7 +14,7 @@ |**initialMargin** | **String** | | [optional] | |**maintMargin** | **String** | | [optional] | |**unrealizedPNL** | **String** | | [optional] | -|**lpProfit** | **String** | | [optional] | +|**adjustedEquity** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md index 5a7a923fa..d01f1248e 100644 --- a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-options - 1.3.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-options - 1.3.0 + 3.0.0 ``` diff --git a/clients/derivatives-trading-options/pom.xml b/clients/derivatives-trading-options/pom.xml index 311b2ce7a..66bc71ad0 100644 --- a/clients/derivatives-trading-options/pom.xml +++ b/clients/derivatives-trading-options/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-options derivatives-trading-options - 2.0.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java index 9d3d7f51c..8774f4fcd 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java @@ -23,6 +23,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.GetDownloadIdForOptionTransactionHistoryResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetOptionTransactionHistoryDownloadLinkByIdResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionAccountInformationResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validation; @@ -45,7 +46,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -718,4 +719,137 @@ public ApiResponse optionAccountInformation(Lo new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } + + /** + * Build call for optionMarginAccountInformation + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Option Margin Account Information -
+ * + * @see Option + * Margin Account Information (USER_DATA) Documentation + */ + private okhttp3.Call optionMarginAccountInformationCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/eapi/v1/marginAccount"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call optionMarginAccountInformationValidateBeforeCall(Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("optionMarginAccountInformation", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return optionMarginAccountInformationCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Option Margin Account Information (USER_DATA) Get current account information. Weight: 3 + * + * @param recvWindow (optional) + * @return ApiResponse<OptionMarginAccountInformationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Option Margin Account Information -
+ * + * @see Option + * Margin Account Information (USER_DATA) Documentation + */ + public ApiResponse optionMarginAccountInformation( + Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = optionMarginAccountInformationValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java index 9546aa050..7bc18632e 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java @@ -195,6 +195,29 @@ public ApiResponse optionAccountInformation(Lo return accountApi.optionAccountInformation(recvWindow); } + /** + * Option Margin Account Information (USER_DATA) Get current account information. Weight: 3 + * + * @param recvWindow (optional) + * @return ApiResponse<OptionMarginAccountInformationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Option Margin Account Information -
+ * + * @see Option + * Margin Account Information (USER_DATA) Documentation + */ + public ApiResponse optionMarginAccountInformation( + Long recvWindow) throws ApiException { + return accountApi.optionMarginAccountInformation(recvWindow); + } + /** * Check Server Time Test connectivity to the Rest API and get the current server time. Weight: * 1 @@ -767,29 +790,6 @@ public ApiResponse getMarketMakerProtect return marketMakerEndpointsApi.getMarketMakerProtectionConfig(underlying, recvWindow); } - /** - * Option Margin Account Information (USER_DATA) Get current account information. Weight: 3 - * - * @param recvWindow (optional) - * @return ApiResponse<OptionMarginAccountInformationResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Option Margin Account Information -
- * - * @see Option - * Margin Account Information (USER_DATA) Documentation - */ - public ApiResponse optionMarginAccountInformation( - Long recvWindow) throws ApiException { - return marketMakerEndpointsApi.optionMarginAccountInformation(recvWindow); - } - /** * Reset Market Maker Protection Config (TRADE) Reset MMP, start MMP order again. Weight: 1 * diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java index dd4b4c56f..d8084b67d 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java @@ -53,7 +53,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java index c9ef0213c..03ae60e5c 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java @@ -53,7 +53,7 @@ public class MarketMakerBlockTradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java index f67e364db..373a7dfbf 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java @@ -24,7 +24,6 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.AutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetAutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetMarketMakerProtectionConfigResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.ResetMarketMakerProtectionConfigRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.ResetMarketMakerProtectionConfigResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.SetAutoCancelAllOpenOrdersRequest; @@ -54,7 +53,7 @@ public class MarketMakerEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -530,139 +529,6 @@ public ApiResponse getMarketMakerProtect return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Build call for optionMarginAccountInformation - * - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Option Margin Account Information -
- * - * @see Option - * Margin Account Information (USER_DATA) Documentation - */ - private okhttp3.Call optionMarginAccountInformationCall(Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/eapi/v1/marginAccount"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call optionMarginAccountInformationValidateBeforeCall(Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {recvWindow}; - Method method = this.getClass().getMethod("optionMarginAccountInformation", Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return optionMarginAccountInformationCall(recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Option Margin Account Information (USER_DATA) Get current account information. Weight: 3 - * - * @param recvWindow (optional) - * @return ApiResponse<OptionMarginAccountInformationResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Option Margin Account Information -
- * - * @see Option - * Margin Account Information (USER_DATA) Documentation - */ - public ApiResponse optionMarginAccountInformation( - Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = optionMarginAccountInformationValidateBeforeCall(recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - /** * Build call for resetMarketMakerProtectionConfig * diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java index 9fd50802f..6ea4d5712 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java @@ -60,7 +60,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java index 34d885e87..b61e3cf3f 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java index 8f0737aab..f5944e59a 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java @@ -96,6 +96,12 @@ public class ExchangeInformationResponseOptionSymbolsInner { @jakarta.annotation.Nullable private String takerFeeRate; + public static final String SERIALIZED_NAME_LIQUIDATION_FEE_RATE = "liquidationFeeRate"; + + @SerializedName(SERIALIZED_NAME_LIQUIDATION_FEE_RATE) + @jakarta.annotation.Nullable + private String liquidationFeeRate; + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; @SerializedName(SERIALIZED_NAME_MIN_QTY) @@ -347,6 +353,26 @@ public void setTakerFeeRate(@jakarta.annotation.Nullable String takerFeeRate) { this.takerFeeRate = takerFeeRate; } + public ExchangeInformationResponseOptionSymbolsInner liquidationFeeRate( + @jakarta.annotation.Nullable String liquidationFeeRate) { + this.liquidationFeeRate = liquidationFeeRate; + return this; + } + + /** + * Get liquidationFeeRate + * + * @return liquidationFeeRate + */ + @jakarta.annotation.Nullable + public String getLiquidationFeeRate() { + return liquidationFeeRate; + } + + public void setLiquidationFeeRate(@jakarta.annotation.Nullable String liquidationFeeRate) { + this.liquidationFeeRate = liquidationFeeRate; + } + public ExchangeInformationResponseOptionSymbolsInner minQty( @jakarta.annotation.Nullable String minQty) { this.minQty = minQty; @@ -555,6 +581,9 @@ public boolean equals(Object o) { && Objects.equals( this.takerFeeRate, exchangeInformationResponseOptionSymbolsInner.takerFeeRate) + && Objects.equals( + this.liquidationFeeRate, + exchangeInformationResponseOptionSymbolsInner.liquidationFeeRate) && Objects.equals(this.minQty, exchangeInformationResponseOptionSymbolsInner.minQty) && Objects.equals(this.maxQty, exchangeInformationResponseOptionSymbolsInner.maxQty) && Objects.equals( @@ -590,6 +619,7 @@ public int hashCode() { unit, makerFeeRate, takerFeeRate, + liquidationFeeRate, minQty, maxQty, initialMargin, @@ -614,6 +644,9 @@ public String toString() { sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); sb.append(" makerFeeRate: ").append(toIndentedString(makerFeeRate)).append("\n"); sb.append(" takerFeeRate: ").append(toIndentedString(takerFeeRate)).append("\n"); + sb.append(" liquidationFeeRate: ") + .append(toIndentedString(liquidationFeeRate)) + .append("\n"); sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); sb.append(" initialMargin: ").append(toIndentedString(initialMargin)).append("\n"); @@ -671,6 +704,12 @@ public String toUrlQueryString() { String takerFeeRateValueAsString = ""; takerFeeRateValueAsString = takerFeeRateValue.toString(); sb.append("takerFeeRate=").append(urlEncode(takerFeeRateValueAsString)).append(""); + Object liquidationFeeRateValue = getLiquidationFeeRate(); + String liquidationFeeRateValueAsString = ""; + liquidationFeeRateValueAsString = liquidationFeeRateValue.toString(); + sb.append("liquidationFeeRate=") + .append(urlEncode(liquidationFeeRateValueAsString)) + .append(""); Object minQtyValue = getMinQty(); String minQtyValueAsString = ""; minQtyValueAsString = minQtyValue.toString(); @@ -748,6 +787,7 @@ private String toIndentedString(Object o) { openapiFields.add("unit"); openapiFields.add("makerFeeRate"); openapiFields.add("takerFeeRate"); + openapiFields.add("liquidationFeeRate"); openapiFields.add("minQty"); openapiFields.add("maxQty"); openapiFields.add("initialMargin"); @@ -851,6 +891,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("takerFeeRate").toString())); } + if ((jsonObj.get("liquidationFeeRate") != null + && !jsonObj.get("liquidationFeeRate").isJsonNull()) + && !jsonObj.get("liquidationFeeRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `liquidationFeeRate` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("liquidationFeeRate").toString())); + } if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) && !jsonObj.get("minQty").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponseAssetInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponseAssetInner.java index a1f352775..ee1b95588 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponseAssetInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponseAssetInner.java @@ -78,11 +78,11 @@ public class OptionMarginAccountInformationResponseAssetInner { @jakarta.annotation.Nullable private String unrealizedPNL; - public static final String SERIALIZED_NAME_LP_PROFIT = "lpProfit"; + public static final String SERIALIZED_NAME_ADJUSTED_EQUITY = "adjustedEquity"; - @SerializedName(SERIALIZED_NAME_LP_PROFIT) + @SerializedName(SERIALIZED_NAME_ADJUSTED_EQUITY) @jakarta.annotation.Nullable - private String lpProfit; + private String adjustedEquity; public OptionMarginAccountInformationResponseAssetInner() {} @@ -226,24 +226,24 @@ public void setUnrealizedPNL(@jakarta.annotation.Nullable String unrealizedPNL) this.unrealizedPNL = unrealizedPNL; } - public OptionMarginAccountInformationResponseAssetInner lpProfit( - @jakarta.annotation.Nullable String lpProfit) { - this.lpProfit = lpProfit; + public OptionMarginAccountInformationResponseAssetInner adjustedEquity( + @jakarta.annotation.Nullable String adjustedEquity) { + this.adjustedEquity = adjustedEquity; return this; } /** - * Get lpProfit + * Get adjustedEquity * - * @return lpProfit + * @return adjustedEquity */ @jakarta.annotation.Nullable - public String getLpProfit() { - return lpProfit; + public String getAdjustedEquity() { + return adjustedEquity; } - public void setLpProfit(@jakarta.annotation.Nullable String lpProfit) { - this.lpProfit = lpProfit; + public void setAdjustedEquity(@jakarta.annotation.Nullable String adjustedEquity) { + this.adjustedEquity = adjustedEquity; } @Override @@ -275,7 +275,8 @@ public boolean equals(Object o) { this.unrealizedPNL, optionMarginAccountInformationResponseAssetInner.unrealizedPNL) && Objects.equals( - this.lpProfit, optionMarginAccountInformationResponseAssetInner.lpProfit); + this.adjustedEquity, + optionMarginAccountInformationResponseAssetInner.adjustedEquity); } @Override @@ -288,7 +289,7 @@ public int hashCode() { initialMargin, maintMargin, unrealizedPNL, - lpProfit); + adjustedEquity); } @Override @@ -302,7 +303,7 @@ public String toString() { sb.append(" initialMargin: ").append(toIndentedString(initialMargin)).append("\n"); sb.append(" maintMargin: ").append(toIndentedString(maintMargin)).append("\n"); sb.append(" unrealizedPNL: ").append(toIndentedString(unrealizedPNL)).append("\n"); - sb.append(" lpProfit: ").append(toIndentedString(lpProfit)).append("\n"); + sb.append(" adjustedEquity: ").append(toIndentedString(adjustedEquity)).append("\n"); sb.append("}"); return sb.toString(); } @@ -338,10 +339,10 @@ public String toUrlQueryString() { String unrealizedPNLValueAsString = ""; unrealizedPNLValueAsString = unrealizedPNLValue.toString(); sb.append("unrealizedPNL=").append(urlEncode(unrealizedPNLValueAsString)).append(""); - Object lpProfitValue = getLpProfit(); - String lpProfitValueAsString = ""; - lpProfitValueAsString = lpProfitValue.toString(); - sb.append("lpProfit=").append(urlEncode(lpProfitValueAsString)).append(""); + Object adjustedEquityValue = getAdjustedEquity(); + String adjustedEquityValueAsString = ""; + adjustedEquityValueAsString = adjustedEquityValue.toString(); + sb.append("adjustedEquity=").append(urlEncode(adjustedEquityValueAsString)).append(""); return sb.toString(); } @@ -377,7 +378,7 @@ private String toIndentedString(Object o) { openapiFields.add("initialMargin"); openapiFields.add("maintMargin"); openapiFields.add("unrealizedPNL"); - openapiFields.add("lpProfit"); + openapiFields.add("adjustedEquity"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -461,13 +462,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("unrealizedPNL").toString())); } - if ((jsonObj.get("lpProfit") != null && !jsonObj.get("lpProfit").isJsonNull()) - && !jsonObj.get("lpProfit").isJsonPrimitive()) { + if ((jsonObj.get("adjustedEquity") != null && !jsonObj.get("adjustedEquity").isJsonNull()) + && !jsonObj.get("adjustedEquity").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `lpProfit` to be a primitive type in the JSON" + "Expected the field `adjustedEquity` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("lpProfit").toString())); + jsonObj.get("adjustedEquity").toString())); } } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java index 894b469b2..1401cc401 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java @@ -38,7 +38,7 @@ public class DerivativesTradingOptionsWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java index 9cf270a37..cb8a495d3 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java @@ -27,6 +27,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.GetDownloadIdForOptionTransactionHistoryResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetOptionTransactionHistoryDownloadLinkByIdResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionAccountInformationResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; import jakarta.validation.constraints.*; import okhttp3.Call; import okhttp3.Request; @@ -215,4 +216,34 @@ public void optionAccountInformationTest() throws ApiException, CryptoException actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/account", actualRequest.url().encodedPath()); } + + /** + * Option Margin Account Information (USER_DATA) + * + *

Get current account information. Weight: 3 + * + * @throws ApiException if the Api call fails + */ + @Test + public void optionMarginAccountInformationTest() throws ApiException, CryptoException { + Long recvWindow = 5000L; + ApiResponse response = + api.optionMarginAccountInformation(recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals( + "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", + actualRequest.url().queryParameter("signature")); + assertEquals("/eapi/v1/marginAccount", actualRequest.url().encodedPath()); + } } diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java index 124601aaf..942731443 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java @@ -191,36 +191,6 @@ public void getMarketMakerProtectionConfigTest() throws ApiException, CryptoExce assertEquals("/eapi/v1/mmp", actualRequest.url().encodedPath()); } - /** - * Option Margin Account Information (USER_DATA) - * - *

Get current account information. Weight: 3 - * - * @throws ApiException if the Api call fails - */ - @Test - public void optionMarginAccountInformationTest() throws ApiException, CryptoException { - Long recvWindow = 5000L; - ApiResponse response = - api.optionMarginAccountInformation(recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", - actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/marginAccount", actualRequest.url().encodedPath()); - } - /** * Reset Market Maker Protection Config (TRADE) * diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md index 474a95af0..11b8536ae 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-portfolio-margin-pro - 2.1.0 + 3.0.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin-pro - 2.1.0 + 3.0.1 ``` diff --git a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md index 801394a99..d8fc853e2 100644 --- a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md @@ -1,10 +1,24 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Changed (2) + +#### REST API + +- Modified response for `marginMaxBorrow()` (`GET /papi/v1/margin/maxBorrowable`): + - `amount`: type `number` → `string` + - `borrowLimit`: type `integer` → `string` + +- Modified response for `newMarginOrder()` (`POST /papi/v1/margin/order`): + - `marginBuyBorrowAmount`: type `integer` → `string` + ## 2.0.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. -## 3.0.0 - 2025-07-16 +## 2.0.0 - 2025-07-16 ### Added (1) diff --git a/clients/derivatives-trading-portfolio-margin/docs/MarginMaxBorrowResponse.md b/clients/derivatives-trading-portfolio-margin/docs/MarginMaxBorrowResponse.md index 16cf0b410..9d092f6a1 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/MarginMaxBorrowResponse.md +++ b/clients/derivatives-trading-portfolio-margin/docs/MarginMaxBorrowResponse.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**amount** | **Double** | | [optional] | -|**borrowLimit** | **Long** | | [optional] | +|**amount** | **String** | | [optional] | +|**borrowLimit** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/NewMarginOrderResponse.md b/clients/derivatives-trading-portfolio-margin/docs/NewMarginOrderResponse.md index ff189723c..348344535 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/NewMarginOrderResponse.md +++ b/clients/derivatives-trading-portfolio-margin/docs/NewMarginOrderResponse.md @@ -19,7 +19,7 @@ |**timeInForce** | **String** | | [optional] | |**type** | **String** | | [optional] | |**side** | **String** | | [optional] | -|**marginBuyBorrowAmount** | **Long** | | [optional] | +|**marginBuyBorrowAmount** | **String** | | [optional] | |**marginBuyBorrowAsset** | **String** | | [optional] | |**fills** | [**List<NewMarginOrderResponseFillsInner>**](NewMarginOrderResponseFillsInner.md) | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md index 0de3a84fb..edfc715ab 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-portfolio-margin - 1.3.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin - 1.3.0 + 3.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin/pom.xml b/clients/derivatives-trading-portfolio-margin/pom.xml index 93990c1d6..d502e8bc9 100644 --- a/clients/derivatives-trading-portfolio-margin/pom.xml +++ b/clients/derivatives-trading-portfolio-margin/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin derivatives-trading-portfolio-margin - 2.0.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java index 1bf3a2fd3..b3778a54a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java @@ -94,7 +94,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java index 92ccf91b3..d658cc274 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java @@ -40,7 +40,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java index 94afcfc84..3216e3dc4 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java @@ -112,7 +112,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java index b62a4e0ee..10dd885b9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java index 99da5df46..e40c23a43 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java @@ -22,7 +22,6 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -41,17 +40,17 @@ public class MarginMaxBorrowResponse { @SerializedName(SERIALIZED_NAME_AMOUNT) @jakarta.annotation.Nullable - private Double amount; + private String amount; public static final String SERIALIZED_NAME_BORROW_LIMIT = "borrowLimit"; @SerializedName(SERIALIZED_NAME_BORROW_LIMIT) @jakarta.annotation.Nullable - private Long borrowLimit; + private String borrowLimit; public MarginMaxBorrowResponse() {} - public MarginMaxBorrowResponse amount(@jakarta.annotation.Nullable Double amount) { + public MarginMaxBorrowResponse amount(@jakarta.annotation.Nullable String amount) { this.amount = amount; return this; } @@ -62,16 +61,15 @@ public MarginMaxBorrowResponse amount(@jakarta.annotation.Nullable Double amount * @return amount */ @jakarta.annotation.Nullable - @Valid - public Double getAmount() { + public String getAmount() { return amount; } - public void setAmount(@jakarta.annotation.Nullable Double amount) { + public void setAmount(@jakarta.annotation.Nullable String amount) { this.amount = amount; } - public MarginMaxBorrowResponse borrowLimit(@jakarta.annotation.Nullable Long borrowLimit) { + public MarginMaxBorrowResponse borrowLimit(@jakarta.annotation.Nullable String borrowLimit) { this.borrowLimit = borrowLimit; return this; } @@ -82,11 +80,11 @@ public MarginMaxBorrowResponse borrowLimit(@jakarta.annotation.Nullable Long bor * @return borrowLimit */ @jakarta.annotation.Nullable - public Long getBorrowLimit() { + public String getBorrowLimit() { return borrowLimit; } - public void setBorrowLimit(@jakarta.annotation.Nullable Long borrowLimit) { + public void setBorrowLimit(@jakarta.annotation.Nullable String borrowLimit) { this.borrowLimit = borrowLimit; } @@ -182,6 +180,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("borrowLimit") != null && !jsonObj.get("borrowLimit").isJsonNull()) + && !jsonObj.get("borrowLimit").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `borrowLimit` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("borrowLimit").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java index 507808ca3..836ca37a0 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java @@ -118,7 +118,7 @@ public class NewMarginOrderResponse { @SerializedName(SERIALIZED_NAME_MARGIN_BUY_BORROW_AMOUNT) @jakarta.annotation.Nullable - private Long marginBuyBorrowAmount; + private String marginBuyBorrowAmount; public static final String SERIALIZED_NAME_MARGIN_BUY_BORROW_ASSET = "marginBuyBorrowAsset"; @@ -364,7 +364,7 @@ public void setSide(@jakarta.annotation.Nullable String side) { } public NewMarginOrderResponse marginBuyBorrowAmount( - @jakarta.annotation.Nullable Long marginBuyBorrowAmount) { + @jakarta.annotation.Nullable String marginBuyBorrowAmount) { this.marginBuyBorrowAmount = marginBuyBorrowAmount; return this; } @@ -375,11 +375,12 @@ public NewMarginOrderResponse marginBuyBorrowAmount( * @return marginBuyBorrowAmount */ @jakarta.annotation.Nullable - public Long getMarginBuyBorrowAmount() { + public String getMarginBuyBorrowAmount() { return marginBuyBorrowAmount; } - public void setMarginBuyBorrowAmount(@jakarta.annotation.Nullable Long marginBuyBorrowAmount) { + public void setMarginBuyBorrowAmount( + @jakarta.annotation.Nullable String marginBuyBorrowAmount) { this.marginBuyBorrowAmount = marginBuyBorrowAmount; } @@ -730,6 +731,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("side").toString())); } + if ((jsonObj.get("marginBuyBorrowAmount") != null + && !jsonObj.get("marginBuyBorrowAmount").isJsonNull()) + && !jsonObj.get("marginBuyBorrowAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marginBuyBorrowAmount` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("marginBuyBorrowAmount").toString())); + } if ((jsonObj.get("marginBuyBorrowAsset") != null && !jsonObj.get("marginBuyBorrowAsset").isJsonNull()) && !jsonObj.get("marginBuyBorrowAsset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java index b1d1e21fb..6588ca37e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/2.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index 3025b88eb..4cd09bc86 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 5.0.0 - 2025-09-22 + +### Changed (1) + +#### REST API + +- Modified response for `accountInformationV3()` method (`GET /fapi/v3/account`): + - `assets`: item property `marginAvailable` deleted + ## 4.0.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3ResponseAssetsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV3ResponseAssetsInner.md index 6fd3293c2..dd8238d16 100644 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3ResponseAssetsInner.md +++ b/clients/derivatives-trading-usds-futures/docs/AccountInformationV3ResponseAssetsInner.md @@ -20,7 +20,6 @@ |**availableBalance** | **String** | | [optional] | |**maxWithdrawAmount** | **String** | | [optional] | |**updateTime** | **Long** | | [optional] | -|**marginAvailable** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse.md b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse.md index 9cd25df7a..91d401101 100644 --- a/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse.md +++ b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | |**notionalCoef** | **Double** | | [optional] | -|**brackets** | [**List<NotionalAndLeverageBracketsResponse1InnerBracketsInner>**](NotionalAndLeverageBracketsResponse1InnerBracketsInner.md) | | [optional] | +|**brackets** | [**List<NotionalAndLeverageBracketsResponse2BracketsInner>**](NotionalAndLeverageBracketsResponse2BracketsInner.md) | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse1InnerBracketsInner.md b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse1InnerBracketsInner.md index eb00eb934..5bb51622f 100644 --- a/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse1InnerBracketsInner.md +++ b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse1InnerBracketsInner.md @@ -12,7 +12,7 @@ |**notionalCap** | **Long** | | [optional] | |**notionalFloor** | **Long** | | [optional] | |**maintMarginRatio** | **Double** | | [optional] | -|**cum** | **Long** | | [optional] | +|**cum** | **Double** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2.md b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2.md index bb20bcab3..859456eff 100644 --- a/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2.md +++ b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | |**notionalCoef** | **Double** | | [optional] | -|**brackets** | [**List<NotionalAndLeverageBracketsResponse1InnerBracketsInner>**](NotionalAndLeverageBracketsResponse1InnerBracketsInner.md) | | [optional] | +|**brackets** | [**List<NotionalAndLeverageBracketsResponse2BracketsInner>**](NotionalAndLeverageBracketsResponse2BracketsInner.md) | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2BracketsInner.md b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2BracketsInner.md new file mode 100644 index 000000000..27745fc70 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/NotionalAndLeverageBracketsResponse2BracketsInner.md @@ -0,0 +1,18 @@ + + +# NotionalAndLeverageBracketsResponse2BracketsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bracket** | **Long** | | [optional] | +|**initialLeverage** | **Long** | | [optional] | +|**notionalCap** | **Long** | | [optional] | +|**notionalFloor** | **Long** | | [optional] | +|**maintMarginRatio** | **Double** | | [optional] | +|**cum** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md index d8a405ec8..a3ec9e9ee 100644 --- a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-usds-futures - 3.1.0 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-usds-futures - 3.1.0 + 5.0.0 ``` diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index 1c015b3df..97ebdb9c1 100644 --- a/clients/derivatives-trading-usds-futures/pom.xml +++ b/clients/derivatives-trading-usds-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-usds-futures derivatives-trading-usds-futures - 4.0.1 + 5.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java index 7286b9262..8f6608ced 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java @@ -465,6 +465,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .NotionalAndLeverageBracketsResponse2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .NotionalAndLeverageBracketsResponse2BracketsInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .OldTradesLookupResponse.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java index 136b2b9af..d513bba1b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java @@ -64,7 +64,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java index 4d79f8a16..524002002 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java @@ -49,7 +49,7 @@ public class ConvertApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java index abd72c723..7dfc15d4f 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java @@ -965,8 +965,8 @@ public ApiResponse exchangeInformation() throws Api /** * Get Funding Rate History Get Funding Rate History * If `startTime` and - * `endTime` are not sent, the most recent `limit` datas are returned. * If - * the number of data between `startTime` and `endTime` is larger than + * `endTime` are not sent, the most recent 200 records are returned. * If the number + * of data between `startTime` and `endTime` is larger than * `limit`, return as `startTime` + `limit`. * In ascending order. * Weight: share 500/5min/IP rate limit with GET /fapi/v1/fundingInfo * @@ -1450,9 +1450,9 @@ public ApiResponse symbolOrderBookTicker(String s } /** - * Symbol Price Ticker Latest price for a symbol or symbols. * If the symbol is not sent, prices - * for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 when the - * symbol parameter is omitted + * Symbol Price Ticker(Deprecated) Latest price for a symbol or symbols. * If the symbol is not + * sent, prices for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 + * when the symbol parameter is omitted * * @param symbol (optional) * @return ApiResponse<SymbolPriceTickerResponse> @@ -1467,7 +1467,7 @@ public ApiResponse symbolOrderBookTicker(String s * * @see Symbol - * Price Ticker Documentation + * Price Ticker(Deprecated) Documentation */ public ApiResponse symbolPriceTicker(String symbol) throws ApiException { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java index 059045bcd..50271bd9f 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java @@ -74,7 +74,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1200,8 +1200,8 @@ private okhttp3.Call getFundingRateHistoryValidateBeforeCall( /** * Get Funding Rate History Get Funding Rate History * If `startTime` and - * `endTime` are not sent, the most recent `limit` datas are returned. * If - * the number of data between `startTime` and `endTime` is larger than + * `endTime` are not sent, the most recent 200 records are returned. * If the number + * of data between `startTime` and `endTime` is larger than * `limit`, return as `startTime` + `limit`. * In ascending order. * Weight: share 500/5min/IP rate limit with GET /fapi/v1/fundingInfo * @@ -3796,7 +3796,7 @@ public ApiResponse symbolOrderBookTicker(String s * * @see Symbol - * Price Ticker Documentation + * Price Ticker(Deprecated) Documentation */ private okhttp3.Call symbolPriceTickerCall(String symbol) throws ApiException { String basePath = null; @@ -3887,9 +3887,9 @@ private okhttp3.Call symbolPriceTickerValidateBeforeCall(String symbol) throws A } /** - * Symbol Price Ticker Latest price for a symbol or symbols. * If the symbol is not sent, prices - * for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 when the - * symbol parameter is omitted + * Symbol Price Ticker(Deprecated) Latest price for a symbol or symbols. * If the symbol is not + * sent, prices for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 + * when the symbol parameter is omitted * * @param symbol (optional) * @return ApiResponse<SymbolPriceTickerResponse> @@ -3904,7 +3904,7 @@ private okhttp3.Call symbolPriceTickerValidateBeforeCall(String symbol) throws A * * @see Symbol - * Price Ticker Documentation + * Price Ticker(Deprecated) Documentation */ public ApiResponse symbolPriceTicker(String symbol) throws ApiException { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java index 84bbd999e..87ea852c8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java index 213cfcd6d..ed5e2b461 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java @@ -83,7 +83,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java index e82ff8de0..22abbc407 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java @@ -43,7 +43,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java index 58284f145..08c9ffc9f 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java @@ -114,12 +114,6 @@ public class AccountInformationV3ResponseAssetsInner { @jakarta.annotation.Nullable private Long updateTime; - public static final String SERIALIZED_NAME_MARGIN_AVAILABLE = "marginAvailable"; - - @SerializedName(SERIALIZED_NAME_MARGIN_AVAILABLE) - @jakarta.annotation.Nullable - private Boolean marginAvailable; - public AccountInformationV3ResponseAssetsInner() {} public AccountInformationV3ResponseAssetsInner asset( @@ -384,26 +378,6 @@ public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { this.updateTime = updateTime; } - public AccountInformationV3ResponseAssetsInner marginAvailable( - @jakarta.annotation.Nullable Boolean marginAvailable) { - this.marginAvailable = marginAvailable; - return this; - } - - /** - * Get marginAvailable - * - * @return marginAvailable - */ - @jakarta.annotation.Nullable - public Boolean getMarginAvailable() { - return marginAvailable; - } - - public void setMarginAvailable(@jakarta.annotation.Nullable Boolean marginAvailable) { - this.marginAvailable = marginAvailable; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -444,10 +418,7 @@ public boolean equals(Object o) { this.maxWithdrawAmount, accountInformationV3ResponseAssetsInner.maxWithdrawAmount) && Objects.equals( - this.updateTime, accountInformationV3ResponseAssetsInner.updateTime) - && Objects.equals( - this.marginAvailable, - accountInformationV3ResponseAssetsInner.marginAvailable); + this.updateTime, accountInformationV3ResponseAssetsInner.updateTime); } @Override @@ -465,8 +436,7 @@ public int hashCode() { crossUnPnl, availableBalance, maxWithdrawAmount, - updateTime, - marginAvailable); + updateTime); } @Override @@ -492,7 +462,6 @@ public String toString() { sb.append(" availableBalance: ").append(toIndentedString(availableBalance)).append("\n"); sb.append(" maxWithdrawAmount: ").append(toIndentedString(maxWithdrawAmount)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); - sb.append(" marginAvailable: ").append(toIndentedString(marginAvailable)).append("\n"); sb.append("}"); return sb.toString(); } @@ -560,10 +529,6 @@ public String toUrlQueryString() { String updateTimeValueAsString = ""; updateTimeValueAsString = updateTimeValue.toString(); sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); - Object marginAvailableValue = getMarginAvailable(); - String marginAvailableValueAsString = ""; - marginAvailableValueAsString = marginAvailableValue.toString(); - sb.append("marginAvailable=").append(urlEncode(marginAvailableValueAsString)).append(""); return sb.toString(); } @@ -605,7 +570,6 @@ private String toIndentedString(Object o) { openapiFields.add("availableBalance"); openapiFields.add("maxWithdrawAmount"); openapiFields.add("updateTime"); - openapiFields.add("marginAvailable"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java index eee49592b..59d10b1ef 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java @@ -71,7 +71,7 @@ public class NotionalAndLeverageBracketsResponse1InnerBracketsInner { @SerializedName(SERIALIZED_NAME_CUM) @jakarta.annotation.Nullable - private Long cum; + private Double cum; public NotionalAndLeverageBracketsResponse1InnerBracketsInner() {} @@ -177,7 +177,7 @@ public void setMaintMarginRatio(@jakarta.annotation.Nullable Double maintMarginR } public NotionalAndLeverageBracketsResponse1InnerBracketsInner cum( - @jakarta.annotation.Nullable Long cum) { + @jakarta.annotation.Nullable Double cum) { this.cum = cum; return this; } @@ -188,11 +188,12 @@ public NotionalAndLeverageBracketsResponse1InnerBracketsInner cum( * @return cum */ @jakarta.annotation.Nullable - public Long getCum() { + @Valid + public Double getCum() { return cum; } - public void setCum(@jakarta.annotation.Nullable Long cum) { + public void setCum(@jakarta.annotation.Nullable Double cum) { this.cum = cum; } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java index 03038f134..3162888a7 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java @@ -58,7 +58,7 @@ public class NotionalAndLeverageBracketsResponse2 { @SerializedName(SERIALIZED_NAME_BRACKETS) @jakarta.annotation.Nullable - private List<@Valid NotionalAndLeverageBracketsResponse1InnerBracketsInner> brackets; + private List<@Valid NotionalAndLeverageBracketsResponse2BracketsInner> brackets; public NotionalAndLeverageBracketsResponse2() {} @@ -104,13 +104,13 @@ public void setNotionalCoef(@jakarta.annotation.Nullable Double notionalCoef) { public NotionalAndLeverageBracketsResponse2 brackets( @jakarta.annotation.Nullable - List<@Valid NotionalAndLeverageBracketsResponse1InnerBracketsInner> brackets) { + List<@Valid NotionalAndLeverageBracketsResponse2BracketsInner> brackets) { this.brackets = brackets; return this; } public NotionalAndLeverageBracketsResponse2 addBracketsItem( - NotionalAndLeverageBracketsResponse1InnerBracketsInner bracketsItem) { + NotionalAndLeverageBracketsResponse2BracketsInner bracketsItem) { if (this.brackets == null) { this.brackets = new ArrayList<>(); } @@ -125,13 +125,13 @@ public NotionalAndLeverageBracketsResponse2 addBracketsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid NotionalAndLeverageBracketsResponse1InnerBracketsInner> getBrackets() { + public List<@Valid NotionalAndLeverageBracketsResponse2BracketsInner> getBrackets() { return brackets; } public void setBrackets( @jakarta.annotation.Nullable - List<@Valid NotionalAndLeverageBracketsResponse1InnerBracketsInner> brackets) { + List<@Valid NotionalAndLeverageBracketsResponse2BracketsInner> brackets) { this.brackets = brackets; } @@ -263,7 +263,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `brackets` (array) for (int i = 0; i < jsonArraybrackets.size(); i++) { - NotionalAndLeverageBracketsResponse1InnerBracketsInner.validateJsonElement( + NotionalAndLeverageBracketsResponse2BracketsInner.validateJsonElement( jsonArraybrackets.get(i)); } ; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2BracketsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2BracketsInner.java new file mode 100644 index 000000000..a3ac44d81 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2BracketsInner.java @@ -0,0 +1,396 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** NotionalAndLeverageBracketsResponse2BracketsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NotionalAndLeverageBracketsResponse2BracketsInner { + public static final String SERIALIZED_NAME_BRACKET = "bracket"; + + @SerializedName(SERIALIZED_NAME_BRACKET) + @jakarta.annotation.Nullable + private Long bracket; + + public static final String SERIALIZED_NAME_INITIAL_LEVERAGE = "initialLeverage"; + + @SerializedName(SERIALIZED_NAME_INITIAL_LEVERAGE) + @jakarta.annotation.Nullable + private Long initialLeverage; + + public static final String SERIALIZED_NAME_NOTIONAL_CAP = "notionalCap"; + + @SerializedName(SERIALIZED_NAME_NOTIONAL_CAP) + @jakarta.annotation.Nullable + private Long notionalCap; + + public static final String SERIALIZED_NAME_NOTIONAL_FLOOR = "notionalFloor"; + + @SerializedName(SERIALIZED_NAME_NOTIONAL_FLOOR) + @jakarta.annotation.Nullable + private Long notionalFloor; + + public static final String SERIALIZED_NAME_MAINT_MARGIN_RATIO = "maintMarginRatio"; + + @SerializedName(SERIALIZED_NAME_MAINT_MARGIN_RATIO) + @jakarta.annotation.Nullable + private Double maintMarginRatio; + + public static final String SERIALIZED_NAME_CUM = "cum"; + + @SerializedName(SERIALIZED_NAME_CUM) + @jakarta.annotation.Nullable + private Long cum; + + public NotionalAndLeverageBracketsResponse2BracketsInner() {} + + public NotionalAndLeverageBracketsResponse2BracketsInner bracket( + @jakarta.annotation.Nullable Long bracket) { + this.bracket = bracket; + return this; + } + + /** + * Get bracket + * + * @return bracket + */ + @jakarta.annotation.Nullable + public Long getBracket() { + return bracket; + } + + public void setBracket(@jakarta.annotation.Nullable Long bracket) { + this.bracket = bracket; + } + + public NotionalAndLeverageBracketsResponse2BracketsInner initialLeverage( + @jakarta.annotation.Nullable Long initialLeverage) { + this.initialLeverage = initialLeverage; + return this; + } + + /** + * Get initialLeverage + * + * @return initialLeverage + */ + @jakarta.annotation.Nullable + public Long getInitialLeverage() { + return initialLeverage; + } + + public void setInitialLeverage(@jakarta.annotation.Nullable Long initialLeverage) { + this.initialLeverage = initialLeverage; + } + + public NotionalAndLeverageBracketsResponse2BracketsInner notionalCap( + @jakarta.annotation.Nullable Long notionalCap) { + this.notionalCap = notionalCap; + return this; + } + + /** + * Get notionalCap + * + * @return notionalCap + */ + @jakarta.annotation.Nullable + public Long getNotionalCap() { + return notionalCap; + } + + public void setNotionalCap(@jakarta.annotation.Nullable Long notionalCap) { + this.notionalCap = notionalCap; + } + + public NotionalAndLeverageBracketsResponse2BracketsInner notionalFloor( + @jakarta.annotation.Nullable Long notionalFloor) { + this.notionalFloor = notionalFloor; + return this; + } + + /** + * Get notionalFloor + * + * @return notionalFloor + */ + @jakarta.annotation.Nullable + public Long getNotionalFloor() { + return notionalFloor; + } + + public void setNotionalFloor(@jakarta.annotation.Nullable Long notionalFloor) { + this.notionalFloor = notionalFloor; + } + + public NotionalAndLeverageBracketsResponse2BracketsInner maintMarginRatio( + @jakarta.annotation.Nullable Double maintMarginRatio) { + this.maintMarginRatio = maintMarginRatio; + return this; + } + + /** + * Get maintMarginRatio + * + * @return maintMarginRatio + */ + @jakarta.annotation.Nullable + @Valid + public Double getMaintMarginRatio() { + return maintMarginRatio; + } + + public void setMaintMarginRatio(@jakarta.annotation.Nullable Double maintMarginRatio) { + this.maintMarginRatio = maintMarginRatio; + } + + public NotionalAndLeverageBracketsResponse2BracketsInner cum( + @jakarta.annotation.Nullable Long cum) { + this.cum = cum; + return this; + } + + /** + * Get cum + * + * @return cum + */ + @jakarta.annotation.Nullable + public Long getCum() { + return cum; + } + + public void setCum(@jakarta.annotation.Nullable Long cum) { + this.cum = cum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotionalAndLeverageBracketsResponse2BracketsInner + notionalAndLeverageBracketsResponse2BracketsInner = + (NotionalAndLeverageBracketsResponse2BracketsInner) o; + return Objects.equals( + this.bracket, notionalAndLeverageBracketsResponse2BracketsInner.bracket) + && Objects.equals( + this.initialLeverage, + notionalAndLeverageBracketsResponse2BracketsInner.initialLeverage) + && Objects.equals( + this.notionalCap, + notionalAndLeverageBracketsResponse2BracketsInner.notionalCap) + && Objects.equals( + this.notionalFloor, + notionalAndLeverageBracketsResponse2BracketsInner.notionalFloor) + && Objects.equals( + this.maintMarginRatio, + notionalAndLeverageBracketsResponse2BracketsInner.maintMarginRatio) + && Objects.equals(this.cum, notionalAndLeverageBracketsResponse2BracketsInner.cum); + } + + @Override + public int hashCode() { + return Objects.hash( + bracket, initialLeverage, notionalCap, notionalFloor, maintMarginRatio, cum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotionalAndLeverageBracketsResponse2BracketsInner {\n"); + sb.append(" bracket: ").append(toIndentedString(bracket)).append("\n"); + sb.append(" initialLeverage: ").append(toIndentedString(initialLeverage)).append("\n"); + sb.append(" notionalCap: ").append(toIndentedString(notionalCap)).append("\n"); + sb.append(" notionalFloor: ").append(toIndentedString(notionalFloor)).append("\n"); + sb.append(" maintMarginRatio: ").append(toIndentedString(maintMarginRatio)).append("\n"); + sb.append(" cum: ").append(toIndentedString(cum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object bracketValue = getBracket(); + String bracketValueAsString = ""; + bracketValueAsString = bracketValue.toString(); + sb.append("bracket=").append(urlEncode(bracketValueAsString)).append(""); + Object initialLeverageValue = getInitialLeverage(); + String initialLeverageValueAsString = ""; + initialLeverageValueAsString = initialLeverageValue.toString(); + sb.append("initialLeverage=").append(urlEncode(initialLeverageValueAsString)).append(""); + Object notionalCapValue = getNotionalCap(); + String notionalCapValueAsString = ""; + notionalCapValueAsString = notionalCapValue.toString(); + sb.append("notionalCap=").append(urlEncode(notionalCapValueAsString)).append(""); + Object notionalFloorValue = getNotionalFloor(); + String notionalFloorValueAsString = ""; + notionalFloorValueAsString = notionalFloorValue.toString(); + sb.append("notionalFloor=").append(urlEncode(notionalFloorValueAsString)).append(""); + Object maintMarginRatioValue = getMaintMarginRatio(); + String maintMarginRatioValueAsString = ""; + maintMarginRatioValueAsString = maintMarginRatioValue.toString(); + sb.append("maintMarginRatio=").append(urlEncode(maintMarginRatioValueAsString)).append(""); + Object cumValue = getCum(); + String cumValueAsString = ""; + cumValueAsString = cumValue.toString(); + sb.append("cum=").append(urlEncode(cumValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bracket"); + openapiFields.add("initialLeverage"); + openapiFields.add("notionalCap"); + openapiFields.add("notionalFloor"); + openapiFields.add("maintMarginRatio"); + openapiFields.add("cum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * NotionalAndLeverageBracketsResponse2BracketsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotionalAndLeverageBracketsResponse2BracketsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " NotionalAndLeverageBracketsResponse2BracketsInner is not" + + " found in the empty JSON string", + NotionalAndLeverageBracketsResponse2BracketsInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NotionalAndLeverageBracketsResponse2BracketsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'NotionalAndLeverageBracketsResponse2BracketsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(NotionalAndLeverageBracketsResponse2BracketsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + NotionalAndLeverageBracketsResponse2BracketsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NotionalAndLeverageBracketsResponse2BracketsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NotionalAndLeverageBracketsResponse2BracketsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotionalAndLeverageBracketsResponse2BracketsInner + * @throws IOException if the JSON string is invalid with respect to + * NotionalAndLeverageBracketsResponse2BracketsInner + */ + public static NotionalAndLeverageBracketsResponse2BracketsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, NotionalAndLeverageBracketsResponse2BracketsInner.class); + } + + /** + * Convert an instance of NotionalAndLeverageBracketsResponse2BracketsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java index ba1f83af7..f5b1a9431 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java @@ -39,12 +39,14 @@ import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.SymbolOrderBookTickerResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.SymbolPriceTickerRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.SymbolPriceTickerResponse; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.CompletableFuture; public class DerivativesTradingUsdsFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -61,6 +63,11 @@ public DerivativesTradingUsdsFuturesWebSocketApi(WebSocketClientConfiguration co public DerivativesTradingUsdsFuturesWebSocketApi(ConnectionInterface connection) { connection.setUserAgent(USER_AGENT); + List logonMethods = new ArrayList<>(); + List logoutMethods = new ArrayList<>(); + + connection.setLogonMethods(logonMethods); + connection.setLogoutMethods(logoutMethods); if (!connection.isConnected()) { connection.connect(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java index bf70d0d74..119db05c8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java @@ -56,7 +56,7 @@ public class DerivativesTradingUsdsFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/4.0.1 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/dual-investment/docs/rest-api/migration-guide.md b/clients/dual-investment/docs/rest-api/migration-guide.md index 82afe1592..2e0d2e95b 100644 --- a/clients/dual-investment/docs/rest-api/migration-guide.md +++ b/clients/dual-investment/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-dual-investment - 2.1.0 + 2.1.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-dual-investment - 2.1.0 + 2.1.1 ``` diff --git a/clients/fiat/docs/rest-api/migration-guide.md b/clients/fiat/docs/rest-api/migration-guide.md index 3f1c035f0..adbb3cda4 100644 --- a/clients/fiat/docs/rest-api/migration-guide.md +++ b/clients/fiat/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-fiat - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-fiat - 1.2.0 + 1.2.1 ``` diff --git a/clients/gift-card/docs/rest-api/migration-guide.md b/clients/gift-card/docs/rest-api/migration-guide.md index 5e1ebd097..7c6cd5c5d 100644 --- a/clients/gift-card/docs/rest-api/migration-guide.md +++ b/clients/gift-card/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-gift-card - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-gift-card - 1.2.0 + 1.2.1 ``` diff --git a/clients/margin-trading/CHANGELOG.md b/clients/margin-trading/CHANGELOG.md index 63c48ac45..f8d82311f 100644 --- a/clients/margin-trading/CHANGELOG.md +++ b/clients/margin-trading/CHANGELOG.md @@ -1,6 +1,15 @@ # Changelog +## 4.0.0 - 2025-09-22 + +### Added (1) + +#### REST API + +- `getLimitPricePairs()` (`GET /sapi/v1/margin/limit-price-pairs`) + ## 3.0.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/margin-trading/docs/GetLimitPricePairsResponse.md b/clients/margin-trading/docs/GetLimitPricePairsResponse.md new file mode 100644 index 000000000..6982e35c5 --- /dev/null +++ b/clients/margin-trading/docs/GetLimitPricePairsResponse.md @@ -0,0 +1,13 @@ + + +# GetLimitPricePairsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**crossMarginSymbols** | **List<String>** | | [optional] | + + + diff --git a/clients/margin-trading/docs/MarketDataApi.md b/clients/margin-trading/docs/MarketDataApi.md index 74a6d60fe..9ccf3acbf 100644 --- a/clients/margin-trading/docs/MarketDataApi.md +++ b/clients/margin-trading/docs/MarketDataApi.md @@ -9,6 +9,7 @@ All URIs are relative to *https://api.binance.com* | [**getAllIsolatedMarginSymbol**](MarketDataApi.md#getAllIsolatedMarginSymbol) | **GET** /sapi/v1/margin/isolated/allPairs | Get All Isolated Margin Symbol(MARKET_DATA) | | [**getAllMarginAssets**](MarketDataApi.md#getAllMarginAssets) | **GET** /sapi/v1/margin/allAssets | Get All Margin Assets (MARKET_DATA) | | [**getDelistSchedule**](MarketDataApi.md#getDelistSchedule) | **GET** /sapi/v1/margin/delist-schedule | Get Delist Schedule (MARKET_DATA) | +| [**getLimitPricePairs**](MarketDataApi.md#getLimitPricePairs) | **GET** /sapi/v1/margin/limit-price-pairs | Get Limit Price Pairs(MARKET_DATA) | | [**getListSchedule**](MarketDataApi.md#getListSchedule) | **GET** /sapi/v1/margin/list-schedule | Get list Schedule (MARKET_DATA) | | [**queryIsolatedMarginTierData**](MarketDataApi.md#queryIsolatedMarginTierData) | **GET** /sapi/v1/margin/isolatedMarginTier | Query Isolated Margin Tier Data (USER_DATA) | | [**queryLiabilityCoinLeverageBracketInCrossMarginProMode**](MarketDataApi.md#queryLiabilityCoinLeverageBracketInCrossMarginProMode) | **GET** /sapi/v1/margin/leverageBracket | Query Liability Coin Leverage Bracket in Cross Margin Pro Mode(MARKET_DATA) | @@ -324,6 +325,64 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Delist Schedule | - | + +# **getLimitPricePairs** +> GetLimitPricePairsResponse getLimitPricePairs() + +Get Limit Price Pairs(MARKET_DATA) + +Query trading pairs with restriction on limit price range. In margin trading, you can place orders with limit price. Limit price should be within (-15%, 15%) of current index price for a list of margin trading pairs. This rule only impacts limit sell orders with limit price that is lower than current index price and limit buy orders with limit price that is higher than current index price. - Buy order: Your order will be rejected with an error message notification if the limit price is 15% above the index price. - Sell order: Your order will be rejected with an error message notification if the limit price is 15% below the index price. Please review the limit price order placing strategy, backtest and calibrate the planned order size with the trading volume and order book depth to prevent trading loss. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.margin_trading.ApiClient; +import com.binance.connector.client.margin_trading.ApiException; +import com.binance.connector.client.margin_trading.Configuration; +import com.binance.connector.client.margin_trading.models.*; +import com.binance.connector.client.margin_trading.rest.api.MarketDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + MarketDataApi apiInstance = new MarketDataApi(defaultClient); + try { + GetLimitPricePairsResponse result = apiInstance.getLimitPricePairs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketDataApi#getLimitPricePairs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GetLimitPricePairsResponse**](GetLimitPricePairsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Limit Price Pairs | - | + # **getListSchedule** > GetListScheduleResponse getListSchedule(recvWindow) diff --git a/clients/margin-trading/docs/rest-api/migration-guide.md b/clients/margin-trading/docs/rest-api/migration-guide.md index c5291cbe2..ab9323162 100644 --- a/clients/margin-trading/docs/rest-api/migration-guide.md +++ b/clients/margin-trading/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-margin-trading - 2.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-margin-trading - 2.0.0 + 4.0.0 ``` diff --git a/clients/margin-trading/pom.xml b/clients/margin-trading/pom.xml index 1b387392e..79a1728eb 100644 --- a/clients/margin-trading/pom.xml +++ b/clients/margin-trading/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-margin-trading margin-trading - 3.0.1 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java index 1e592b9d9..11722ebb6 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java @@ -196,6 +196,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .GetInterestHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.rest.model + .GetLimitPricePairsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse .CustomTypeAdapterFactory()); diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java index a7033bda1..d40412349 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java @@ -55,7 +55,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java index 0eb803f70..3906d04df 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java @@ -49,7 +49,7 @@ public class BorrowRepayApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java index 01e5c5dd6..c398cc0b6 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java @@ -23,6 +23,7 @@ import com.binance.connector.client.margin_trading.rest.model.GetForceLiquidationRecordResponse; import com.binance.connector.client.margin_trading.rest.model.GetFutureHourlyInterestRateResponse; import com.binance.connector.client.margin_trading.rest.model.GetInterestHistoryResponse; +import com.binance.connector.client.margin_trading.rest.model.GetLimitPricePairsResponse; import com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse; import com.binance.connector.client.margin_trading.rest.model.GetSmallLiabilityExchangeCoinListResponse; import com.binance.connector.client.margin_trading.rest.model.GetSmallLiabilityExchangeHistoryResponse; @@ -717,6 +718,36 @@ public ApiResponse getDelistSchedule(Long recvWindow) return marketDataApi.getDelistSchedule(recvWindow); } + /** + * Get Limit Price Pairs(MARKET_DATA) Query trading pairs with restriction on limit price range. + * In margin trading, you can place orders with limit price. Limit price should be within (-15%, + * 15%) of current index price for a list of margin trading pairs. This rule only impacts limit + * sell orders with limit price that is lower than current index price and limit buy orders with + * limit price that is higher than current index price. - Buy order: Your order will be rejected + * with an error message notification if the limit price is 15% above the index price. - Sell + * order: Your order will be rejected with an error message notification if the limit price is + * 15% below the index price. Please review the limit price order placing strategy, backtest and + * calibrate the planned order size with the trading volume and order book depth to prevent + * trading loss. Weight: 1 + * + * @return ApiResponse<GetLimitPricePairsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Limit Price Pairs -
+ * + * @see Get + * Limit Price Pairs(MARKET_DATA) Documentation + */ + public ApiResponse getLimitPricePairs() throws ApiException { + return marketDataApi.getLimitPricePairs(); + } + /** * Get list Schedule (MARKET_DATA) Get the upcoming tokens or symbols listing schedule for Cross * Margin and Isolated Margin. Weight: 100 diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java index 8cd99d3fe..b730e67d9 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java @@ -24,6 +24,7 @@ import com.binance.connector.client.margin_trading.rest.model.GetAllIsolatedMarginSymbolResponse; import com.binance.connector.client.margin_trading.rest.model.GetAllMarginAssetsResponse; import com.binance.connector.client.margin_trading.rest.model.GetDelistScheduleResponse; +import com.binance.connector.client.margin_trading.rest.model.GetLimitPricePairsResponse; import com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse; import com.binance.connector.client.margin_trading.rest.model.QueryIsolatedMarginTierDataResponse; import com.binance.connector.client.margin_trading.rest.model.QueryLiabilityCoinLeverageBracketInCrossMarginProModeResponse; @@ -51,7 +52,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -750,6 +751,139 @@ public ApiResponse getDelistSchedule(Long recvWindow) return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for getLimitPricePairs + * + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Limit Price Pairs -
+ * + * @see Get + * Limit Price Pairs(MARKET_DATA) Documentation + */ + private okhttp3.Call getLimitPricePairsCall() throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/margin/limit-price-pairs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLimitPricePairsValidateBeforeCall() throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {}; + Method method = this.getClass().getMethod("getLimitPricePairs"); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLimitPricePairsCall(); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Limit Price Pairs(MARKET_DATA) Query trading pairs with restriction on limit price range. + * In margin trading, you can place orders with limit price. Limit price should be within (-15%, + * 15%) of current index price for a list of margin trading pairs. This rule only impacts limit + * sell orders with limit price that is lower than current index price and limit buy orders with + * limit price that is higher than current index price. - Buy order: Your order will be rejected + * with an error message notification if the limit price is 15% above the index price. - Sell + * order: Your order will be rejected with an error message notification if the limit price is + * 15% below the index price. Please review the limit price order placing strategy, backtest and + * calibrate the planned order size with the trading volume and order book depth to prevent + * trading loss. Weight: 1 + * + * @return ApiResponse<GetLimitPricePairsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Limit Price Pairs -
+ * + * @see Get + * Limit Price Pairs(MARKET_DATA) Documentation + */ + public ApiResponse getLimitPricePairs() throws ApiException { + okhttp3.Call localVarCall = getLimitPricePairsValidateBeforeCall(); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getListSchedule * diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java index 72321a938..4853fbf2f 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java @@ -44,7 +44,7 @@ public class RiskDataStreamApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java index dea5dcde5..64449e2dd 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java @@ -74,7 +74,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java index 6992ae3bc..7aeea1177 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java @@ -47,7 +47,7 @@ public class TradeDataStreamApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java index 678f465c1..1a55cb7c0 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java @@ -43,7 +43,7 @@ public class TransferApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetLimitPricePairsResponse.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetLimitPricePairsResponse.java new file mode 100644 index 000000000..7c75633ab --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetLimitPricePairsResponse.java @@ -0,0 +1,235 @@ +/* + * Binance Margin Trading REST API + * OpenAPI Specification for the Binance Margin Trading REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.margin_trading.rest.model; + +import com.binance.connector.client.margin_trading.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetLimitPricePairsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetLimitPricePairsResponse { + public static final String SERIALIZED_NAME_CROSS_MARGIN_SYMBOLS = "crossMarginSymbols"; + + @SerializedName(SERIALIZED_NAME_CROSS_MARGIN_SYMBOLS) + @jakarta.annotation.Nullable + private List crossMarginSymbols; + + public GetLimitPricePairsResponse() {} + + public GetLimitPricePairsResponse crossMarginSymbols( + @jakarta.annotation.Nullable List crossMarginSymbols) { + this.crossMarginSymbols = crossMarginSymbols; + return this; + } + + public GetLimitPricePairsResponse addCrossMarginSymbolsItem(String crossMarginSymbolsItem) { + if (this.crossMarginSymbols == null) { + this.crossMarginSymbols = new ArrayList<>(); + } + this.crossMarginSymbols.add(crossMarginSymbolsItem); + return this; + } + + /** + * Get crossMarginSymbols + * + * @return crossMarginSymbols + */ + @jakarta.annotation.Nullable + public List getCrossMarginSymbols() { + return crossMarginSymbols; + } + + public void setCrossMarginSymbols( + @jakarta.annotation.Nullable List crossMarginSymbols) { + this.crossMarginSymbols = crossMarginSymbols; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLimitPricePairsResponse getLimitPricePairsResponse = (GetLimitPricePairsResponse) o; + return Objects.equals( + this.crossMarginSymbols, getLimitPricePairsResponse.crossMarginSymbols); + } + + @Override + public int hashCode() { + return Objects.hash(crossMarginSymbols); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLimitPricePairsResponse {\n"); + sb.append(" crossMarginSymbols: ") + .append(toIndentedString(crossMarginSymbols)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object crossMarginSymbolsValue = getCrossMarginSymbols(); + String crossMarginSymbolsValueAsString = ""; + crossMarginSymbolsValueAsString = + (String) + ((Collection) crossMarginSymbolsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("crossMarginSymbols=") + .append(urlEncode(crossMarginSymbolsValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("crossMarginSymbols"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetLimitPricePairsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetLimitPricePairsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetLimitPricePairsResponse is not" + + " found in the empty JSON string", + GetLimitPricePairsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("crossMarginSymbols") != null + && !jsonObj.get("crossMarginSymbols").isJsonNull() + && !jsonObj.get("crossMarginSymbols").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `crossMarginSymbols` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("crossMarginSymbols").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLimitPricePairsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetLimitPricePairsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetLimitPricePairsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetLimitPricePairsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLimitPricePairsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLimitPricePairsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetLimitPricePairsResponse + * @throws IOException if the JSON string is invalid with respect to GetLimitPricePairsResponse + */ + public static GetLimitPricePairsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetLimitPricePairsResponse.class); + } + + /** + * Convert an instance of GetLimitPricePairsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java index c02a2be0f..3b47db89f 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java @@ -20,7 +20,7 @@ public class MarginTradingWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-margin-trading/3.0.1 (Java/%s; %s; %s)", + "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/mining/docs/rest-api/migration-guide.md b/clients/mining/docs/rest-api/migration-guide.md index eed88fbfe..8a4bf5aa5 100644 --- a/clients/mining/docs/rest-api/migration-guide.md +++ b/clients/mining/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-mining - 2.1.0 + 2.1.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-mining - 2.1.0 + 2.1.1 ``` diff --git a/clients/nft/docs/rest-api/migration-guide.md b/clients/nft/docs/rest-api/migration-guide.md index 8dfcea9b3..bc3837234 100644 --- a/clients/nft/docs/rest-api/migration-guide.md +++ b/clients/nft/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-nft - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-nft - 1.2.0 + 1.2.1 ``` diff --git a/clients/pay/CHANGELOG.md b/clients/pay/CHANGELOG.md index b3a923ee8..42f6f64cd 100644 --- a/clients/pay/CHANGELOG.md +++ b/clients/pay/CHANGELOG.md @@ -1,6 +1,14 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Changed (1) + +- Modified response for `getPayTradeHistory()` (`GET /sapi/v1/pay/transactions`): + - `data`.`payerInfo`: property `accountId` deleted + ## 2.1.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/pay/docs/GetPayTradeHistoryResponseDataInnerPayerInfo.md b/clients/pay/docs/GetPayTradeHistoryResponseDataInnerPayerInfo.md index 41592206a..00aff2087 100644 --- a/clients/pay/docs/GetPayTradeHistoryResponseDataInnerPayerInfo.md +++ b/clients/pay/docs/GetPayTradeHistoryResponseDataInnerPayerInfo.md @@ -10,7 +10,6 @@ |**name** | **String** | | [optional] | |**type** | **String** | | [optional] | |**binanceId** | **String** | | [optional] | -|**accountId** | **String** | | [optional] | diff --git a/clients/pay/docs/PayApi.md b/clients/pay/docs/PayApi.md index e44005fa1..1d2a4ffed 100644 --- a/clients/pay/docs/PayApi.md +++ b/clients/pay/docs/PayApi.md @@ -13,7 +13,7 @@ All URIs are relative to *https://api.binance.com* Get Pay Trade History -Get Pay Trade History * If startTime and endTime are not sent, the recent 90 days' data will be returned. * The max interval between startTime and endTime is 90 days. * Support for querying orders within the last 18 months. * For payerInfo and receiverInfo,there are different return values in different orderTypes. * Sender's perspective when orderType is C2C * payerInfo : binanceId * receiverInfo : name, binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input) * Receiver's perspective when orderType is C2C * payerInfo : name, accountId * receiverInfo : binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * receiverInfo : name(the value is always \"Crypto Box\") * Receiver's perspective when orderType is CRYPTO_BOX * payerInfo : name, accountId * receiverInfo : binanceId * Sender's perspective when orderType is PAY * payerInfo : binanceId * receiverInfo : name * Receiver's perspective when orderType is PAY * payerInfo : name, accountId * receiverInfo : binanceId, name * Sender's perspective when orderType is PAY_REFUND * payerInfo : binanceId, name * receiverInfo : name, accountId * Receiver's perspective when orderType is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * Sender's perspective when orderType is PAYOUT * payerInfo : binanceId, name * receiverInfo : name, accountId * Receiver's perspective when orderType is PAYOUT * payerInfo : name * receiverInfo : binanceId * Receiver's perspective when orderType is CRYPTO_BOX_RF * payerInfo : name(the value is always \"Crypto Box\") * receiverInfo : binanceId * Sender's perspective when orderType is REMITTANCE * payerInfo : binanceId * receiverInfo : name, institutionName, cardNumber, digitalWalletId Weight: 3000 +Get Pay Trade History * If startTime and endTime are not sent, the recent 90 days' data will be returned. * The max interval between startTime and endTime is 90 days. * Support for querying orders within the last 18 months. * For payerInfo and receiverInfo,there are different return values in different orderTypes. * Sender's perspective when orderType is C2C * payerInfo : binanceId * receiverInfo : name, binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input) * Receiver's perspective when orderType is C2C * payerInfo : name * receiverInfo : binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * receiverInfo : name(the value is always \"Crypto Box\") * Receiver's perspective when orderType is CRYPTO_BOX * payerInfo : name * receiverInfo : binanceId * Sender's perspective when orderType is PAY * payerInfo : binanceId * receiverInfo : name * Receiver's perspective when orderType is PAY * payerInfo : name * receiverInfo : binanceId, name * Sender's perspective when orderType is PAY_REFUND * payerInfo : binanceId, name * receiverInfo : name, accountId * Receiver's perspective when orderType is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * Sender's perspective when orderType is PAYOUT * payerInfo : binanceId, name * receiverInfo : name, accountId * Receiver's perspective when orderType is PAYOUT * payerInfo : name * receiverInfo : binanceId * Receiver's perspective when orderType is CRYPTO_BOX_RF * payerInfo : name(the value is always \"Crypto Box\") * receiverInfo : binanceId * Sender's perspective when orderType is REMITTANCE * payerInfo : binanceId * receiverInfo : name, institutionName, cardNumber, digitalWalletId Weight: 3000 ### Example ```java diff --git a/clients/pay/docs/rest-api/migration-guide.md b/clients/pay/docs/rest-api/migration-guide.md index c93905235..8d940dd81 100644 --- a/clients/pay/docs/rest-api/migration-guide.md +++ b/clients/pay/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-pay - 2.1.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-pay - 2.1.0 + 3.0.0 ``` diff --git a/clients/pay/pom.xml b/clients/pay/pom.xml index 53edd8f75..d102d8a30 100644 --- a/clients/pay/pom.xml +++ b/clients/pay/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-pay pay - 2.1.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java index 630ea5e9e..adc406824 100644 --- a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java +++ b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayApi.java @@ -42,7 +42,7 @@ public class PayApi { private static final String USER_AGENT = String.format( - "binance-pay/2.1.1 (Java/%s; %s; %s)", + "binance-pay/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -215,21 +215,21 @@ private okhttp3.Call getPayTradeHistoryValidateBeforeCall( * receiverInfo,there are different return values in different orderTypes. * Sender's * perspective when orderType is C2C * payerInfo : binanceId * receiverInfo : name, * binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input) * - * Receiver's perspective when orderType is C2C * payerInfo : name, accountId * receiverInfo - * : binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * + * Receiver's perspective when orderType is C2C * payerInfo : name * receiverInfo : + * binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * * receiverInfo : name(the value is always \"Crypto Box\") * Receiver's - * perspective when orderType is CRYPTO_BOX * payerInfo : name, accountId * receiverInfo : - * binanceId * Sender's perspective when orderType is PAY * payerInfo : binanceId * - * receiverInfo : name * Receiver's perspective when orderType is PAY * payerInfo : name, - * accountId * receiverInfo : binanceId, name * Sender's perspective when orderType is - * PAY_REFUND * payerInfo : binanceId, name * receiverInfo : name, accountId * Receiver's - * perspective when orderType is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * - * Sender's perspective when orderType is PAYOUT * payerInfo : binanceId, name * - * receiverInfo : name, accountId * Receiver's perspective when orderType is PAYOUT * - * payerInfo : name * receiverInfo : binanceId * Receiver's perspective when orderType is - * CRYPTO_BOX_RF * payerInfo : name(the value is always \"Crypto Box\") * receiverInfo - * : binanceId * Sender's perspective when orderType is REMITTANCE * payerInfo : binanceId * - * receiverInfo : name, institutionName, cardNumber, digitalWalletId Weight: 3000 + * perspective when orderType is CRYPTO_BOX * payerInfo : name * receiverInfo : binanceId * + * Sender's perspective when orderType is PAY * payerInfo : binanceId * receiverInfo : name + * * Receiver's perspective when orderType is PAY * payerInfo : name * receiverInfo : + * binanceId, name * Sender's perspective when orderType is PAY_REFUND * payerInfo : + * binanceId, name * receiverInfo : name, accountId * Receiver's perspective when orderType + * is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * Sender's perspective when + * orderType is PAYOUT * payerInfo : binanceId, name * receiverInfo : name, accountId * + * Receiver's perspective when orderType is PAYOUT * payerInfo : name * receiverInfo : + * binanceId * Receiver's perspective when orderType is CRYPTO_BOX_RF * payerInfo : name(the + * value is always \"Crypto Box\") * receiverInfo : binanceId * Sender's + * perspective when orderType is REMITTANCE * payerInfo : binanceId * receiverInfo : name, + * institutionName, cardNumber, digitalWalletId Weight: 3000 * * @param startTime (optional) * @param endTime (optional) diff --git a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayRestApi.java b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayRestApi.java index 153829850..a4c7378a0 100644 --- a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayRestApi.java +++ b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/api/PayRestApi.java @@ -26,21 +26,21 @@ public PayRestApi(ApiClient apiClient) { * receiverInfo,there are different return values in different orderTypes. * Sender's * perspective when orderType is C2C * payerInfo : binanceId * receiverInfo : name, * binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input) * - * Receiver's perspective when orderType is C2C * payerInfo : name, accountId * receiverInfo - * : binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * + * Receiver's perspective when orderType is C2C * payerInfo : name * receiverInfo : + * binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * * receiverInfo : name(the value is always \"Crypto Box\") * Receiver's - * perspective when orderType is CRYPTO_BOX * payerInfo : name, accountId * receiverInfo : - * binanceId * Sender's perspective when orderType is PAY * payerInfo : binanceId * - * receiverInfo : name * Receiver's perspective when orderType is PAY * payerInfo : name, - * accountId * receiverInfo : binanceId, name * Sender's perspective when orderType is - * PAY_REFUND * payerInfo : binanceId, name * receiverInfo : name, accountId * Receiver's - * perspective when orderType is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * - * Sender's perspective when orderType is PAYOUT * payerInfo : binanceId, name * - * receiverInfo : name, accountId * Receiver's perspective when orderType is PAYOUT * - * payerInfo : name * receiverInfo : binanceId * Receiver's perspective when orderType is - * CRYPTO_BOX_RF * payerInfo : name(the value is always \"Crypto Box\") * receiverInfo - * : binanceId * Sender's perspective when orderType is REMITTANCE * payerInfo : binanceId * - * receiverInfo : name, institutionName, cardNumber, digitalWalletId Weight: 3000 + * perspective when orderType is CRYPTO_BOX * payerInfo : name * receiverInfo : binanceId * + * Sender's perspective when orderType is PAY * payerInfo : binanceId * receiverInfo : name + * * Receiver's perspective when orderType is PAY * payerInfo : name * receiverInfo : + * binanceId, name * Sender's perspective when orderType is PAY_REFUND * payerInfo : + * binanceId, name * receiverInfo : name, accountId * Receiver's perspective when orderType + * is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * Sender's perspective when + * orderType is PAYOUT * payerInfo : binanceId, name * receiverInfo : name, accountId * + * Receiver's perspective when orderType is PAYOUT * payerInfo : name * receiverInfo : + * binanceId * Receiver's perspective when orderType is CRYPTO_BOX_RF * payerInfo : name(the + * value is always \"Crypto Box\") * receiverInfo : binanceId * Sender's + * perspective when orderType is REMITTANCE * payerInfo : binanceId * receiverInfo : name, + * institutionName, cardNumber, digitalWalletId Weight: 3000 * * @param startTime (optional) * @param endTime (optional) diff --git a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerPayerInfo.java b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerPayerInfo.java index 1d0afeb15..0c4e15681 100644 --- a/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerPayerInfo.java +++ b/clients/pay/src/main/java/com/binance/connector/client/pay/rest/model/GetPayTradeHistoryResponseDataInnerPayerInfo.java @@ -54,12 +54,6 @@ public class GetPayTradeHistoryResponseDataInnerPayerInfo { @jakarta.annotation.Nullable private String binanceId; - public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; - - @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) - @jakarta.annotation.Nullable - private String accountId; - public GetPayTradeHistoryResponseDataInnerPayerInfo() {} public GetPayTradeHistoryResponseDataInnerPayerInfo name( @@ -122,26 +116,6 @@ public void setBinanceId(@jakarta.annotation.Nullable String binanceId) { this.binanceId = binanceId; } - public GetPayTradeHistoryResponseDataInnerPayerInfo accountId( - @jakarta.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Get accountId - * - * @return accountId - */ - @jakarta.annotation.Nullable - public String getAccountId() { - return accountId; - } - - public void setAccountId(@jakarta.annotation.Nullable String accountId) { - this.accountId = accountId; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -155,14 +129,12 @@ public boolean equals(Object o) { return Objects.equals(this.name, getPayTradeHistoryResponseDataInnerPayerInfo.name) && Objects.equals(this.type, getPayTradeHistoryResponseDataInnerPayerInfo.type) && Objects.equals( - this.binanceId, getPayTradeHistoryResponseDataInnerPayerInfo.binanceId) - && Objects.equals( - this.accountId, getPayTradeHistoryResponseDataInnerPayerInfo.accountId); + this.binanceId, getPayTradeHistoryResponseDataInnerPayerInfo.binanceId); } @Override public int hashCode() { - return Objects.hash(name, type, binanceId, accountId); + return Objects.hash(name, type, binanceId); } @Override @@ -172,7 +144,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" binanceId: ").append(toIndentedString(binanceId)).append("\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -192,10 +163,6 @@ public String toUrlQueryString() { String binanceIdValueAsString = ""; binanceIdValueAsString = binanceIdValue.toString(); sb.append("binanceId=").append(urlEncode(binanceIdValueAsString)).append(""); - Object accountIdValue = getAccountId(); - String accountIdValueAsString = ""; - accountIdValueAsString = accountIdValue.toString(); - sb.append("accountId=").append(urlEncode(accountIdValueAsString)).append(""); return sb.toString(); } @@ -227,7 +194,6 @@ private String toIndentedString(Object o) { openapiFields.add("name"); openapiFields.add("type"); openapiFields.add("binanceId"); - openapiFields.add("accountId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -278,14 +244,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("binanceId").toString())); } - if ((jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) - && !jsonObj.get("accountId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `accountId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("accountId").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/rebate/docs/rest-api/migration-guide.md b/clients/rebate/docs/rest-api/migration-guide.md index ae03e2b60..e08a1349b 100644 --- a/clients/rebate/docs/rest-api/migration-guide.md +++ b/clients/rebate/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-rebate - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-rebate - 1.2.0 + 1.2.1 ``` diff --git a/clients/simple-earn/CHANGELOG.md b/clients/simple-earn/CHANGELOG.md index 0bf614ad6..da007d898 100644 --- a/clients/simple-earn/CHANGELOG.md +++ b/clients/simple-earn/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Added (8) + +- `getRwusdAccount()` (`GET /sapi/v1/rwusd/account`) +- `getRwusdQuotaDetails()` (`GET /sapi/v1/rwusd/quota`) +- `getRwusdRateHistory()` (`GET /sapi/v1/rwusd/history/rateHistory`) +- `getRwusdRedemptionHistory()` (`GET /sapi/v1/rwusd/history/redemptionHistory`) +- `getRwusdRewardsHistory()` (`GET /sapi/v1/rwusd/history/rewardsHistory`) +- `getRwusdSubscriptionHistory()` (`GET /sapi/v1/rwusd/history/subscriptionHistory`) +- `redeemRwusd()` (`POST /sapi/v1/rwusd/redeem`) +- `subscribeRwusd()` (`POST /sapi/v1/rwusd/subscribe`) + +### Changed (3) + +- Modified parameter `amount`: + - affected methods: + - `subscribeFlexibleProduct()` (`POST /sapi/v1/simple-earn/flexible/subscribe`) + - `getFlexibleSubscriptionPreview()` (`GET /sapi/v1/simple-earn/flexible/subscriptionPreview`) + - `subscribeLockedProduct()` (`POST /sapi/v1/simple-earn/locked/subscribe`) + - `getLockedSubscriptionPreview()` (`GET /sapi/v1/simple-earn/locked/subscriptionPreview`) +- Modified parameter `asset`: + - affected methods: + - `getFlexibleRedemptionRecord()` (`GET /sapi/v1/simple-earn/flexible/history/redemptionRecord`) + - `getFlexibleRewardsHistory()` (`GET /sapi/v1/simple-earn/flexible/history/rewardsRecord`) + - `getFlexibleSubscriptionRecord()` (`GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord`) + - `getSimpleEarnFlexibleProductList()` (`GET /sapi/v1/simple-earn/flexible/list`) + - `getFlexibleProductPosition()` (`GET /sapi/v1/simple-earn/flexible/position`) + - `getLockedRedemptionRecord()` (`GET /sapi/v1/simple-earn/locked/history/redemptionRecord`) + - `getLockedRewardsHistory()` (`GET /sapi/v1/simple-earn/locked/history/rewardsRecord`) + - `getLockedSubscriptionRecord()` (`GET /sapi/v1/simple-earn/locked/history/subscriptionRecord`) + - `getSimpleEarnLockedProductList()` (`GET /sapi/v1/simple-earn/locked/list`) + - `getLockedProductPosition()` (`GET /sapi/v1/simple-earn/locked/position`) +- Modified parameter `type`: + - affected methods: + - `getFlexibleRewardsHistory()` (`GET /sapi/v1/simple-earn/flexible/history/rewardsRecord`) + ## 2.1.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/simple-earn/docs/AccountApi.md b/clients/simple-earn/docs/AccountApi.md deleted file mode 100644 index 1b1ee9a82..000000000 --- a/clients/simple-earn/docs/AccountApi.md +++ /dev/null @@ -1,483 +0,0 @@ -# AccountApi - -All URIs are relative to *https://api.binance.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getFlexiblePersonalLeftQuota**](AccountApi.md#getFlexiblePersonalLeftQuota) | **GET** /sapi/v1/simple-earn/flexible/personalLeftQuota | Get Flexible Personal Left Quota(USER_DATA) | -| [**getFlexibleProductPosition**](AccountApi.md#getFlexibleProductPosition) | **GET** /sapi/v1/simple-earn/flexible/position | Get Flexible Product Position(USER_DATA) | -| [**getLockedPersonalLeftQuota**](AccountApi.md#getLockedPersonalLeftQuota) | **GET** /sapi/v1/simple-earn/locked/personalLeftQuota | Get Locked Personal Left Quota(USER_DATA) | -| [**getLockedProductPosition**](AccountApi.md#getLockedProductPosition) | **GET** /sapi/v1/simple-earn/locked/position | Get Locked Product Position | -| [**getSimpleEarnFlexibleProductList**](AccountApi.md#getSimpleEarnFlexibleProductList) | **GET** /sapi/v1/simple-earn/flexible/list | Get Simple Earn Flexible Product List(USER_DATA) | -| [**getSimpleEarnLockedProductList**](AccountApi.md#getSimpleEarnLockedProductList) | **GET** /sapi/v1/simple-earn/locked/list | Get Simple Earn Locked Product List(USER_DATA) | -| [**simpleAccount**](AccountApi.md#simpleAccount) | **GET** /sapi/v1/simple-earn/account | Simple Account(USER_DATA) | - - - -# **getFlexiblePersonalLeftQuota** -> GetFlexiblePersonalLeftQuotaResponse getFlexiblePersonalLeftQuota(productId, recvWindow) - -Get Flexible Personal Left Quota(USER_DATA) - -Get Flexible Personal Left Quota Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - String productId = "productId_example"; // String | - Long recvWindow = 56L; // Long | - try { - GetFlexiblePersonalLeftQuotaResponse result = apiInstance.getFlexiblePersonalLeftQuota(productId, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getFlexiblePersonalLeftQuota"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **String**| | | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetFlexiblePersonalLeftQuotaResponse**](GetFlexiblePersonalLeftQuotaResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Flexible Personal Left Quota | - | - - -# **getFlexibleProductPosition** -> GetFlexibleProductPositionResponse getFlexibleProductPosition(asset, productId, current, size, recvWindow) - -Get Flexible Product Position(USER_DATA) - -Get Flexible Product Position Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - String asset = "asset_example"; // String | - String productId = "productId_example"; // String | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetFlexibleProductPositionResponse result = apiInstance.getFlexibleProductPosition(asset, productId, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getFlexibleProductPosition"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **asset** | **String**| | [optional] | -| **productId** | **String**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetFlexibleProductPositionResponse**](GetFlexibleProductPositionResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Flexible Product Position | - | - - -# **getLockedPersonalLeftQuota** -> GetLockedPersonalLeftQuotaResponse getLockedPersonalLeftQuota(projectId, recvWindow) - -Get Locked Personal Left Quota(USER_DATA) - -Get Locked Personal Left Quota Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - String projectId = "projectId_example"; // String | - Long recvWindow = 56L; // Long | - try { - GetLockedPersonalLeftQuotaResponse result = apiInstance.getLockedPersonalLeftQuota(projectId, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getLockedPersonalLeftQuota"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **projectId** | **String**| | | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetLockedPersonalLeftQuotaResponse**](GetLockedPersonalLeftQuotaResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Locked Personal Left Quota | - | - - -# **getLockedProductPosition** -> GetLockedProductPositionResponse getLockedProductPosition(asset, positionId, projectId, current, size, recvWindow) - -Get Locked Product Position - -Get Locked Product Position Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - String asset = "asset_example"; // String | - String positionId = "positionId_example"; // String | - String projectId = "projectId_example"; // String | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetLockedProductPositionResponse result = apiInstance.getLockedProductPosition(asset, positionId, projectId, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getLockedProductPosition"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **asset** | **String**| | [optional] | -| **positionId** | **String**| | [optional] | -| **projectId** | **String**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetLockedProductPositionResponse**](GetLockedProductPositionResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Locked Product Position | - | - - -# **getSimpleEarnFlexibleProductList** -> GetSimpleEarnFlexibleProductListResponse getSimpleEarnFlexibleProductList(asset, current, size, recvWindow) - -Get Simple Earn Flexible Product List(USER_DATA) - -Get available Simple Earn flexible product list Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - String asset = "asset_example"; // String | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetSimpleEarnFlexibleProductListResponse result = apiInstance.getSimpleEarnFlexibleProductList(asset, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getSimpleEarnFlexibleProductList"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **asset** | **String**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetSimpleEarnFlexibleProductListResponse**](GetSimpleEarnFlexibleProductListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Simple Earn Flexible Product List | - | - - -# **getSimpleEarnLockedProductList** -> GetSimpleEarnLockedProductListResponse getSimpleEarnLockedProductList(asset, current, size, recvWindow) - -Get Simple Earn Locked Product List(USER_DATA) - -Get Simple Earn Locked Product List * Get available Simple Earn locked product list Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - String asset = "asset_example"; // String | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetSimpleEarnLockedProductListResponse result = apiInstance.getSimpleEarnLockedProductList(asset, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getSimpleEarnLockedProductList"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **asset** | **String**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetSimpleEarnLockedProductListResponse**](GetSimpleEarnLockedProductListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Simple Earn Locked Product List | - | - - -# **simpleAccount** -> SimpleAccountResponse simpleAccount(recvWindow) - -Simple Account(USER_DATA) - -Simple Account query Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - Long recvWindow = 56L; // Long | - try { - SimpleAccountResponse result = apiInstance.simpleAccount(recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#simpleAccount"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**SimpleAccountResponse**](SimpleAccountResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Simple Account | - | - diff --git a/clients/simple-earn/docs/EarnApi.md b/clients/simple-earn/docs/EarnApi.md deleted file mode 100644 index 28c6467af..000000000 --- a/clients/simple-earn/docs/EarnApi.md +++ /dev/null @@ -1,585 +0,0 @@ -# EarnApi - -All URIs are relative to *https://api.binance.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getFlexibleSubscriptionPreview**](EarnApi.md#getFlexibleSubscriptionPreview) | **GET** /sapi/v1/simple-earn/flexible/subscriptionPreview | Get Flexible Subscription Preview(USER_DATA) | -| [**getLockedSubscriptionPreview**](EarnApi.md#getLockedSubscriptionPreview) | **GET** /sapi/v1/simple-earn/locked/subscriptionPreview | Get Locked Subscription Preview(USER_DATA) | -| [**redeemFlexibleProduct**](EarnApi.md#redeemFlexibleProduct) | **POST** /sapi/v1/simple-earn/flexible/redeem | Redeem Flexible Product(TRADE) | -| [**redeemLockedProduct**](EarnApi.md#redeemLockedProduct) | **POST** /sapi/v1/simple-earn/locked/redeem | Redeem Locked Product(TRADE) | -| [**setFlexibleAutoSubscribe**](EarnApi.md#setFlexibleAutoSubscribe) | **POST** /sapi/v1/simple-earn/flexible/setAutoSubscribe | Set Flexible Auto Subscribe(USER_DATA) | -| [**setLockedAutoSubscribe**](EarnApi.md#setLockedAutoSubscribe) | **POST** /sapi/v1/simple-earn/locked/setAutoSubscribe | Set Locked Auto Subscribe(USER_DATA) | -| [**setLockedProductRedeemOption**](EarnApi.md#setLockedProductRedeemOption) | **POST** /sapi/v1/simple-earn/locked/setRedeemOption | Set Locked Product Redeem Option(USER_DATA) | -| [**subscribeFlexibleProduct**](EarnApi.md#subscribeFlexibleProduct) | **POST** /sapi/v1/simple-earn/flexible/subscribe | Subscribe Flexible Product(TRADE) | -| [**subscribeLockedProduct**](EarnApi.md#subscribeLockedProduct) | **POST** /sapi/v1/simple-earn/locked/subscribe | Subscribe Locked Product(TRADE) | - - - -# **getFlexibleSubscriptionPreview** -> GetFlexibleSubscriptionPreviewResponse getFlexibleSubscriptionPreview(productId, amount, recvWindow) - -Get Flexible Subscription Preview(USER_DATA) - -Get Flexible Subscription Preview Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - String productId = "productId_example"; // String | - Double amount = 3.4D; // Double | - Long recvWindow = 56L; // Long | - try { - GetFlexibleSubscriptionPreviewResponse result = apiInstance.getFlexibleSubscriptionPreview(productId, amount, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#getFlexibleSubscriptionPreview"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **String**| | | -| **amount** | **Double**| | | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetFlexibleSubscriptionPreviewResponse**](GetFlexibleSubscriptionPreviewResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Flexible Subscription Preview | - | - - -# **getLockedSubscriptionPreview** -> GetLockedSubscriptionPreviewResponse getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow) - -Get Locked Subscription Preview(USER_DATA) - -Get Locked Subscription Preview Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - String projectId = "projectId_example"; // String | - Double amount = 3.4D; // Double | - Boolean autoSubscribe = true; // Boolean | true or false, default true. - Long recvWindow = 56L; // Long | - try { - GetLockedSubscriptionPreviewResponse result = apiInstance.getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#getLockedSubscriptionPreview"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **projectId** | **String**| | | -| **amount** | **Double**| | | -| **autoSubscribe** | **Boolean**| true or false, default true. | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetLockedSubscriptionPreviewResponse**](GetLockedSubscriptionPreviewResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Locked Subscription Preview | - | - - -# **redeemFlexibleProduct** -> RedeemFlexibleProductResponse redeemFlexibleProduct(redeemFlexibleProductRequest) - -Redeem Flexible Product(TRADE) - -Redeem Flexible Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - RedeemFlexibleProductRequest redeemFlexibleProductRequest = new RedeemFlexibleProductRequest(); // RedeemFlexibleProductRequest | - try { - RedeemFlexibleProductResponse result = apiInstance.redeemFlexibleProduct(redeemFlexibleProductRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#redeemFlexibleProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **redeemFlexibleProductRequest** | [**RedeemFlexibleProductRequest**](RedeemFlexibleProductRequest.md)| | | - -### Return type - -[**RedeemFlexibleProductResponse**](RedeemFlexibleProductResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Redeem Flexible Product | - | - - -# **redeemLockedProduct** -> RedeemLockedProductResponse redeemLockedProduct(redeemLockedProductRequest) - -Redeem Locked Product(TRADE) - -Redeem Locked Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1/3s per account - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - RedeemLockedProductRequest redeemLockedProductRequest = new RedeemLockedProductRequest(); // RedeemLockedProductRequest | - try { - RedeemLockedProductResponse result = apiInstance.redeemLockedProduct(redeemLockedProductRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#redeemLockedProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **redeemLockedProductRequest** | [**RedeemLockedProductRequest**](RedeemLockedProductRequest.md)| | | - -### Return type - -[**RedeemLockedProductResponse**](RedeemLockedProductResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Redeem Locked Product | - | - - -# **setFlexibleAutoSubscribe** -> SetFlexibleAutoSubscribeResponse setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest) - -Set Flexible Auto Subscribe(USER_DATA) - -Set Flexible Auto Subscribe Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest = new SetFlexibleAutoSubscribeRequest(); // SetFlexibleAutoSubscribeRequest | - try { - SetFlexibleAutoSubscribeResponse result = apiInstance.setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#setFlexibleAutoSubscribe"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **setFlexibleAutoSubscribeRequest** | [**SetFlexibleAutoSubscribeRequest**](SetFlexibleAutoSubscribeRequest.md)| | | - -### Return type - -[**SetFlexibleAutoSubscribeResponse**](SetFlexibleAutoSubscribeResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Set Flexible Auto Subscribe | - | - - -# **setLockedAutoSubscribe** -> SetLockedAutoSubscribeResponse setLockedAutoSubscribe(setLockedAutoSubscribeRequest) - -Set Locked Auto Subscribe(USER_DATA) - -Set locked auto subscribe Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest = new SetLockedAutoSubscribeRequest(); // SetLockedAutoSubscribeRequest | - try { - SetLockedAutoSubscribeResponse result = apiInstance.setLockedAutoSubscribe(setLockedAutoSubscribeRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#setLockedAutoSubscribe"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **setLockedAutoSubscribeRequest** | [**SetLockedAutoSubscribeRequest**](SetLockedAutoSubscribeRequest.md)| | | - -### Return type - -[**SetLockedAutoSubscribeResponse**](SetLockedAutoSubscribeResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Set Locked Auto Subscribe | - | - - -# **setLockedProductRedeemOption** -> SetLockedProductRedeemOptionResponse setLockedProductRedeemOption(setLockedProductRedeemOptionRequest) - -Set Locked Product Redeem Option(USER_DATA) - -Set redeem option for Locked product Weight: 50 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest = new SetLockedProductRedeemOptionRequest(); // SetLockedProductRedeemOptionRequest | - try { - SetLockedProductRedeemOptionResponse result = apiInstance.setLockedProductRedeemOption(setLockedProductRedeemOptionRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#setLockedProductRedeemOption"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **setLockedProductRedeemOptionRequest** | [**SetLockedProductRedeemOptionRequest**](SetLockedProductRedeemOptionRequest.md)| | | - -### Return type - -[**SetLockedProductRedeemOptionResponse**](SetLockedProductRedeemOptionResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Set Locked Product Redeem Option | - | - - -# **subscribeFlexibleProduct** -> SubscribeFlexibleProductResponse subscribeFlexibleProduct(subscribeFlexibleProductRequest) - -Subscribe Flexible Product(TRADE) - -Subscribe Flexible Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - SubscribeFlexibleProductRequest subscribeFlexibleProductRequest = new SubscribeFlexibleProductRequest(); // SubscribeFlexibleProductRequest | - try { - SubscribeFlexibleProductResponse result = apiInstance.subscribeFlexibleProduct(subscribeFlexibleProductRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#subscribeFlexibleProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **subscribeFlexibleProductRequest** | [**SubscribeFlexibleProductRequest**](SubscribeFlexibleProductRequest.md)| | | - -### Return type - -[**SubscribeFlexibleProductResponse**](SubscribeFlexibleProductResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Subscribe Flexible Product | - | - - -# **subscribeLockedProduct** -> SubscribeLockedProductResponse subscribeLockedProduct(subscribeLockedProductRequest) - -Subscribe Locked Product(TRADE) - -Subscribe Locked Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.EarnApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - EarnApi apiInstance = new EarnApi(defaultClient); - SubscribeLockedProductRequest subscribeLockedProductRequest = new SubscribeLockedProductRequest(); // SubscribeLockedProductRequest | - try { - SubscribeLockedProductResponse result = apiInstance.subscribeLockedProduct(subscribeLockedProductRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling EarnApi#subscribeLockedProduct"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **subscribeLockedProductRequest** | [**SubscribeLockedProductRequest**](SubscribeLockedProductRequest.md)| | | - -### Return type - -[**SubscribeLockedProductResponse**](SubscribeLockedProductResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Subscribe Locked Product | - | - diff --git a/clients/simple-earn/docs/FlexibleLockedApi.md b/clients/simple-earn/docs/FlexibleLockedApi.md new file mode 100644 index 000000000..c2226b1a8 --- /dev/null +++ b/clients/simple-earn/docs/FlexibleLockedApi.md @@ -0,0 +1,1666 @@ +# FlexibleLockedApi + +All URIs are relative to *https://api.binance.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getCollateralRecord**](FlexibleLockedApi.md#getCollateralRecord) | **GET** /sapi/v1/simple-earn/flexible/history/collateralRecord | Get Collateral Record(USER_DATA) | +| [**getFlexiblePersonalLeftQuota**](FlexibleLockedApi.md#getFlexiblePersonalLeftQuota) | **GET** /sapi/v1/simple-earn/flexible/personalLeftQuota | Get Flexible Personal Left Quota(USER_DATA) | +| [**getFlexibleProductPosition**](FlexibleLockedApi.md#getFlexibleProductPosition) | **GET** /sapi/v1/simple-earn/flexible/position | Get Flexible Product Position(USER_DATA) | +| [**getFlexibleRedemptionRecord**](FlexibleLockedApi.md#getFlexibleRedemptionRecord) | **GET** /sapi/v1/simple-earn/flexible/history/redemptionRecord | Get Flexible Redemption Record(USER_DATA) | +| [**getFlexibleRewardsHistory**](FlexibleLockedApi.md#getFlexibleRewardsHistory) | **GET** /sapi/v1/simple-earn/flexible/history/rewardsRecord | Get Flexible Rewards History(USER_DATA) | +| [**getFlexibleSubscriptionPreview**](FlexibleLockedApi.md#getFlexibleSubscriptionPreview) | **GET** /sapi/v1/simple-earn/flexible/subscriptionPreview | Get Flexible Subscription Preview(USER_DATA) | +| [**getFlexibleSubscriptionRecord**](FlexibleLockedApi.md#getFlexibleSubscriptionRecord) | **GET** /sapi/v1/simple-earn/flexible/history/subscriptionRecord | Get Flexible Subscription Record(USER_DATA) | +| [**getLockedPersonalLeftQuota**](FlexibleLockedApi.md#getLockedPersonalLeftQuota) | **GET** /sapi/v1/simple-earn/locked/personalLeftQuota | Get Locked Personal Left Quota(USER_DATA) | +| [**getLockedProductPosition**](FlexibleLockedApi.md#getLockedProductPosition) | **GET** /sapi/v1/simple-earn/locked/position | Get Locked Product Position | +| [**getLockedRedemptionRecord**](FlexibleLockedApi.md#getLockedRedemptionRecord) | **GET** /sapi/v1/simple-earn/locked/history/redemptionRecord | Get Locked Redemption Record(USER_DATA) | +| [**getLockedRewardsHistory**](FlexibleLockedApi.md#getLockedRewardsHistory) | **GET** /sapi/v1/simple-earn/locked/history/rewardsRecord | Get Locked Rewards History(USER_DATA) | +| [**getLockedSubscriptionPreview**](FlexibleLockedApi.md#getLockedSubscriptionPreview) | **GET** /sapi/v1/simple-earn/locked/subscriptionPreview | Get Locked Subscription Preview(USER_DATA) | +| [**getLockedSubscriptionRecord**](FlexibleLockedApi.md#getLockedSubscriptionRecord) | **GET** /sapi/v1/simple-earn/locked/history/subscriptionRecord | Get Locked Subscription Record(USER_DATA) | +| [**getRateHistory**](FlexibleLockedApi.md#getRateHistory) | **GET** /sapi/v1/simple-earn/flexible/history/rateHistory | Get Rate History(USER_DATA) | +| [**getSimpleEarnFlexibleProductList**](FlexibleLockedApi.md#getSimpleEarnFlexibleProductList) | **GET** /sapi/v1/simple-earn/flexible/list | Get Simple Earn Flexible Product List(USER_DATA) | +| [**getSimpleEarnLockedProductList**](FlexibleLockedApi.md#getSimpleEarnLockedProductList) | **GET** /sapi/v1/simple-earn/locked/list | Get Simple Earn Locked Product List(USER_DATA) | +| [**redeemFlexibleProduct**](FlexibleLockedApi.md#redeemFlexibleProduct) | **POST** /sapi/v1/simple-earn/flexible/redeem | Redeem Flexible Product(TRADE) | +| [**redeemLockedProduct**](FlexibleLockedApi.md#redeemLockedProduct) | **POST** /sapi/v1/simple-earn/locked/redeem | Redeem Locked Product(TRADE) | +| [**setFlexibleAutoSubscribe**](FlexibleLockedApi.md#setFlexibleAutoSubscribe) | **POST** /sapi/v1/simple-earn/flexible/setAutoSubscribe | Set Flexible Auto Subscribe(USER_DATA) | +| [**setLockedAutoSubscribe**](FlexibleLockedApi.md#setLockedAutoSubscribe) | **POST** /sapi/v1/simple-earn/locked/setAutoSubscribe | Set Locked Auto Subscribe(USER_DATA) | +| [**setLockedProductRedeemOption**](FlexibleLockedApi.md#setLockedProductRedeemOption) | **POST** /sapi/v1/simple-earn/locked/setRedeemOption | Set Locked Product Redeem Option(USER_DATA) | +| [**simpleAccount**](FlexibleLockedApi.md#simpleAccount) | **GET** /sapi/v1/simple-earn/account | Simple Account(USER_DATA) | +| [**subscribeFlexibleProduct**](FlexibleLockedApi.md#subscribeFlexibleProduct) | **POST** /sapi/v1/simple-earn/flexible/subscribe | Subscribe Flexible Product(TRADE) | +| [**subscribeLockedProduct**](FlexibleLockedApi.md#subscribeLockedProduct) | **POST** /sapi/v1/simple-earn/locked/subscribe | Subscribe Locked Product(TRADE) | + + + +# **getCollateralRecord** +> GetCollateralRecordResponse getCollateralRecord(productId, startTime, endTime, current, size, recvWindow) + +Get Collateral Record(USER_DATA) + +Get Collateral Record * The time between `startTime` and `endTime` cannot be longer than 30 days. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String productId = "productId_example"; // String | + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetCollateralRecordResponse result = apiInstance.getCollateralRecord(productId, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getCollateralRecord"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **String**| | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetCollateralRecordResponse**](GetCollateralRecordResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Collateral Record | - | + + +# **getFlexiblePersonalLeftQuota** +> GetFlexiblePersonalLeftQuotaResponse getFlexiblePersonalLeftQuota(productId, recvWindow) + +Get Flexible Personal Left Quota(USER_DATA) + +Get Flexible Personal Left Quota Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String productId = "productId_example"; // String | + Long recvWindow = 56L; // Long | + try { + GetFlexiblePersonalLeftQuotaResponse result = apiInstance.getFlexiblePersonalLeftQuota(productId, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getFlexiblePersonalLeftQuota"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **String**| | | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetFlexiblePersonalLeftQuotaResponse**](GetFlexiblePersonalLeftQuotaResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Flexible Personal Left Quota | - | + + +# **getFlexibleProductPosition** +> GetFlexibleProductPositionResponse getFlexibleProductPosition(asset, productId, current, size, recvWindow) + +Get Flexible Product Position(USER_DATA) + +Get Flexible Product Position Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String asset = "asset_example"; // String | USDC or USDT + String productId = "productId_example"; // String | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetFlexibleProductPositionResponse result = apiInstance.getFlexibleProductPosition(asset, productId, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getFlexibleProductPosition"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| USDC or USDT | [optional] | +| **productId** | **String**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetFlexibleProductPositionResponse**](GetFlexibleProductPositionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Flexible Product Position | - | + + +# **getFlexibleRedemptionRecord** +> GetFlexibleRedemptionRecordResponse getFlexibleRedemptionRecord(productId, redeemId, asset, startTime, endTime, current, size, recvWindow) + +Get Flexible Redemption Record(USER_DATA) + +Get Flexible Redemption Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String productId = "productId_example"; // String | + String redeemId = "redeemId_example"; // String | + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetFlexibleRedemptionRecordResponse result = apiInstance.getFlexibleRedemptionRecord(productId, redeemId, asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getFlexibleRedemptionRecord"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **String**| | [optional] | +| **redeemId** | **String**| | [optional] | +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetFlexibleRedemptionRecordResponse**](GetFlexibleRedemptionRecordResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Flexible Redemption Record | - | + + +# **getFlexibleRewardsHistory** +> GetFlexibleRewardsHistoryResponse getFlexibleRewardsHistory(type, productId, asset, startTime, endTime, current, size, recvWindow) + +Get Flexible Rewards History(USER_DATA) + +Get Flexible Rewards History * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String type = "type_example"; // String | `BONUS` - Bonus tiered APR, `REALTIME` Real-time APR, `REWARDS` Historical rewards,`ALL`(set to default) + String productId = "productId_example"; // String | + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetFlexibleRewardsHistoryResponse result = apiInstance.getFlexibleRewardsHistory(type, productId, asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getFlexibleRewardsHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **type** | **String**| `BONUS` - Bonus tiered APR, `REALTIME` Real-time APR, `REWARDS` Historical rewards,`ALL`(set to default) | | +| **productId** | **String**| | [optional] | +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetFlexibleRewardsHistoryResponse**](GetFlexibleRewardsHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Flexible Rewards History | - | + + +# **getFlexibleSubscriptionPreview** +> GetFlexibleSubscriptionPreviewResponse getFlexibleSubscriptionPreview(productId, amount, recvWindow) + +Get Flexible Subscription Preview(USER_DATA) + +Get Flexible Subscription Preview Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String productId = "productId_example"; // String | + Double amount = 3.4D; // Double | + Long recvWindow = 56L; // Long | + try { + GetFlexibleSubscriptionPreviewResponse result = apiInstance.getFlexibleSubscriptionPreview(productId, amount, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getFlexibleSubscriptionPreview"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **String**| | | +| **amount** | **Double**| | | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetFlexibleSubscriptionPreviewResponse**](GetFlexibleSubscriptionPreviewResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Flexible Subscription Preview | - | + + +# **getFlexibleSubscriptionRecord** +> GetFlexibleSubscriptionRecordResponse getFlexibleSubscriptionRecord(productId, purchaseId, asset, startTime, endTime, current, size, recvWindow) + +Get Flexible Subscription Record(USER_DATA) + +Get Flexible Subscription Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String productId = "productId_example"; // String | + String purchaseId = "purchaseId_example"; // String | + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetFlexibleSubscriptionRecordResponse result = apiInstance.getFlexibleSubscriptionRecord(productId, purchaseId, asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getFlexibleSubscriptionRecord"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **String**| | [optional] | +| **purchaseId** | **String**| | [optional] | +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetFlexibleSubscriptionRecordResponse**](GetFlexibleSubscriptionRecordResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Flexible Subscription Record | - | + + +# **getLockedPersonalLeftQuota** +> GetLockedPersonalLeftQuotaResponse getLockedPersonalLeftQuota(projectId, recvWindow) + +Get Locked Personal Left Quota(USER_DATA) + +Get Locked Personal Left Quota Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String projectId = "projectId_example"; // String | + Long recvWindow = 56L; // Long | + try { + GetLockedPersonalLeftQuotaResponse result = apiInstance.getLockedPersonalLeftQuota(projectId, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getLockedPersonalLeftQuota"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **projectId** | **String**| | | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetLockedPersonalLeftQuotaResponse**](GetLockedPersonalLeftQuotaResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Locked Personal Left Quota | - | + + +# **getLockedProductPosition** +> GetLockedProductPositionResponse getLockedProductPosition(asset, positionId, projectId, current, size, recvWindow) + +Get Locked Product Position + +Get Locked Product Position Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String asset = "asset_example"; // String | USDC or USDT + String positionId = "positionId_example"; // String | + String projectId = "projectId_example"; // String | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetLockedProductPositionResponse result = apiInstance.getLockedProductPosition(asset, positionId, projectId, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getLockedProductPosition"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| USDC or USDT | [optional] | +| **positionId** | **String**| | [optional] | +| **projectId** | **String**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetLockedProductPositionResponse**](GetLockedProductPositionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Locked Product Position | - | + + +# **getLockedRedemptionRecord** +> GetLockedRedemptionRecordResponse getLockedRedemptionRecord(positionId, redeemId, asset, startTime, endTime, current, size, recvWindow) + +Get Locked Redemption Record(USER_DATA) + +Get Locked Redemption Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String positionId = "positionId_example"; // String | + String redeemId = "redeemId_example"; // String | + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetLockedRedemptionRecordResponse result = apiInstance.getLockedRedemptionRecord(positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getLockedRedemptionRecord"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **positionId** | **String**| | [optional] | +| **redeemId** | **String**| | [optional] | +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetLockedRedemptionRecordResponse**](GetLockedRedemptionRecordResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Locked Redemption Record | - | + + +# **getLockedRewardsHistory** +> GetLockedRewardsHistoryResponse getLockedRewardsHistory(positionId, asset, startTime, endTime, current, size, recvWindow) + +Get Locked Rewards History(USER_DATA) + +Get Locked Rewards History * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String positionId = "positionId_example"; // String | + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetLockedRewardsHistoryResponse result = apiInstance.getLockedRewardsHistory(positionId, asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getLockedRewardsHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **positionId** | **String**| | [optional] | +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetLockedRewardsHistoryResponse**](GetLockedRewardsHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Locked Rewards History | - | + + +# **getLockedSubscriptionPreview** +> GetLockedSubscriptionPreviewResponse getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow) + +Get Locked Subscription Preview(USER_DATA) + +Get Locked Subscription Preview Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String projectId = "projectId_example"; // String | + Double amount = 3.4D; // Double | + Boolean autoSubscribe = true; // Boolean | true or false, default true. + Long recvWindow = 56L; // Long | + try { + GetLockedSubscriptionPreviewResponse result = apiInstance.getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getLockedSubscriptionPreview"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **projectId** | **String**| | | +| **amount** | **Double**| | | +| **autoSubscribe** | **Boolean**| true or false, default true. | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetLockedSubscriptionPreviewResponse**](GetLockedSubscriptionPreviewResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Locked Subscription Preview | - | + + +# **getLockedSubscriptionRecord** +> GetLockedSubscriptionRecordResponse getLockedSubscriptionRecord(purchaseId, asset, startTime, endTime, current, size, recvWindow) + +Get Locked Subscription Record(USER_DATA) + +Get Locked Subscription Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String purchaseId = "purchaseId_example"; // String | + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetLockedSubscriptionRecordResponse result = apiInstance.getLockedSubscriptionRecord(purchaseId, asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getLockedSubscriptionRecord"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **purchaseId** | **String**| | [optional] | +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetLockedSubscriptionRecordResponse**](GetLockedSubscriptionRecordResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Locked Subscription Record | - | + + +# **getRateHistory** +> GetRateHistoryResponse getRateHistory(productId, aprPeriod, startTime, endTime, current, size, recvWindow) + +Get Rate History(USER_DATA) + +Get Rate History * The time between startTime and endTime cannot be longer than 1 year. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String productId = "productId_example"; // String | + String aprPeriod = "aprPeriod_example"; // String | \"DAY\",\"YEAR\",default\"DAY\" + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetRateHistoryResponse result = apiInstance.getRateHistory(productId, aprPeriod, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getRateHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **productId** | **String**| | | +| **aprPeriod** | **String**| \"DAY\",\"YEAR\",default\"DAY\" | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetRateHistoryResponse**](GetRateHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Rate History | - | + + +# **getSimpleEarnFlexibleProductList** +> GetSimpleEarnFlexibleProductListResponse getSimpleEarnFlexibleProductList(asset, current, size, recvWindow) + +Get Simple Earn Flexible Product List(USER_DATA) + +Get available Simple Earn flexible product list Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String asset = "asset_example"; // String | USDC or USDT + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetSimpleEarnFlexibleProductListResponse result = apiInstance.getSimpleEarnFlexibleProductList(asset, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getSimpleEarnFlexibleProductList"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| USDC or USDT | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetSimpleEarnFlexibleProductListResponse**](GetSimpleEarnFlexibleProductListResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Simple Earn Flexible Product List | - | + + +# **getSimpleEarnLockedProductList** +> GetSimpleEarnLockedProductListResponse getSimpleEarnLockedProductList(asset, current, size, recvWindow) + +Get Simple Earn Locked Product List(USER_DATA) + +Get Simple Earn Locked Product List * Get available Simple Earn locked product list Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + String asset = "asset_example"; // String | USDC or USDT + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetSimpleEarnLockedProductListResponse result = apiInstance.getSimpleEarnLockedProductList(asset, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#getSimpleEarnLockedProductList"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| USDC or USDT | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetSimpleEarnLockedProductListResponse**](GetSimpleEarnLockedProductListResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Simple Earn Locked Product List | - | + + +# **redeemFlexibleProduct** +> RedeemFlexibleProductResponse redeemFlexibleProduct(redeemFlexibleProductRequest) + +Redeem Flexible Product(TRADE) + +Redeem Flexible Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + RedeemFlexibleProductRequest redeemFlexibleProductRequest = new RedeemFlexibleProductRequest(); // RedeemFlexibleProductRequest | + try { + RedeemFlexibleProductResponse result = apiInstance.redeemFlexibleProduct(redeemFlexibleProductRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#redeemFlexibleProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **redeemFlexibleProductRequest** | [**RedeemFlexibleProductRequest**](RedeemFlexibleProductRequest.md)| | | + +### Return type + +[**RedeemFlexibleProductResponse**](RedeemFlexibleProductResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Redeem Flexible Product | - | + + +# **redeemLockedProduct** +> RedeemLockedProductResponse redeemLockedProduct(redeemLockedProductRequest) + +Redeem Locked Product(TRADE) + +Redeem Locked Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1/3s per account + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + RedeemLockedProductRequest redeemLockedProductRequest = new RedeemLockedProductRequest(); // RedeemLockedProductRequest | + try { + RedeemLockedProductResponse result = apiInstance.redeemLockedProduct(redeemLockedProductRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#redeemLockedProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **redeemLockedProductRequest** | [**RedeemLockedProductRequest**](RedeemLockedProductRequest.md)| | | + +### Return type + +[**RedeemLockedProductResponse**](RedeemLockedProductResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Redeem Locked Product | - | + + +# **setFlexibleAutoSubscribe** +> SetFlexibleAutoSubscribeResponse setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest) + +Set Flexible Auto Subscribe(USER_DATA) + +Set Flexible Auto Subscribe Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest = new SetFlexibleAutoSubscribeRequest(); // SetFlexibleAutoSubscribeRequest | + try { + SetFlexibleAutoSubscribeResponse result = apiInstance.setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#setFlexibleAutoSubscribe"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **setFlexibleAutoSubscribeRequest** | [**SetFlexibleAutoSubscribeRequest**](SetFlexibleAutoSubscribeRequest.md)| | | + +### Return type + +[**SetFlexibleAutoSubscribeResponse**](SetFlexibleAutoSubscribeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Set Flexible Auto Subscribe | - | + + +# **setLockedAutoSubscribe** +> SetLockedAutoSubscribeResponse setLockedAutoSubscribe(setLockedAutoSubscribeRequest) + +Set Locked Auto Subscribe(USER_DATA) + +Set locked auto subscribe Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest = new SetLockedAutoSubscribeRequest(); // SetLockedAutoSubscribeRequest | + try { + SetLockedAutoSubscribeResponse result = apiInstance.setLockedAutoSubscribe(setLockedAutoSubscribeRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#setLockedAutoSubscribe"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **setLockedAutoSubscribeRequest** | [**SetLockedAutoSubscribeRequest**](SetLockedAutoSubscribeRequest.md)| | | + +### Return type + +[**SetLockedAutoSubscribeResponse**](SetLockedAutoSubscribeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Set Locked Auto Subscribe | - | + + +# **setLockedProductRedeemOption** +> SetLockedProductRedeemOptionResponse setLockedProductRedeemOption(setLockedProductRedeemOptionRequest) + +Set Locked Product Redeem Option(USER_DATA) + +Set redeem option for Locked product Weight: 50 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest = new SetLockedProductRedeemOptionRequest(); // SetLockedProductRedeemOptionRequest | + try { + SetLockedProductRedeemOptionResponse result = apiInstance.setLockedProductRedeemOption(setLockedProductRedeemOptionRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#setLockedProductRedeemOption"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **setLockedProductRedeemOptionRequest** | [**SetLockedProductRedeemOptionRequest**](SetLockedProductRedeemOptionRequest.md)| | | + +### Return type + +[**SetLockedProductRedeemOptionResponse**](SetLockedProductRedeemOptionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Set Locked Product Redeem Option | - | + + +# **simpleAccount** +> SimpleAccountResponse simpleAccount(recvWindow) + +Simple Account(USER_DATA) + +Simple Account query Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + SimpleAccountResponse result = apiInstance.simpleAccount(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#simpleAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**SimpleAccountResponse**](SimpleAccountResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Simple Account | - | + + +# **subscribeFlexibleProduct** +> SubscribeFlexibleProductResponse subscribeFlexibleProduct(subscribeFlexibleProductRequest) + +Subscribe Flexible Product(TRADE) + +Subscribe Flexible Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + SubscribeFlexibleProductRequest subscribeFlexibleProductRequest = new SubscribeFlexibleProductRequest(); // SubscribeFlexibleProductRequest | + try { + SubscribeFlexibleProductResponse result = apiInstance.subscribeFlexibleProduct(subscribeFlexibleProductRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#subscribeFlexibleProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **subscribeFlexibleProductRequest** | [**SubscribeFlexibleProductRequest**](SubscribeFlexibleProductRequest.md)| | | + +### Return type + +[**SubscribeFlexibleProductResponse**](SubscribeFlexibleProductResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscribe Flexible Product | - | + + +# **subscribeLockedProduct** +> SubscribeLockedProductResponse subscribeLockedProduct(subscribeLockedProductRequest) + +Subscribe Locked Product(TRADE) + +Subscribe Locked Product * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.FlexibleLockedApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); + SubscribeLockedProductRequest subscribeLockedProductRequest = new SubscribeLockedProductRequest(); // SubscribeLockedProductRequest | + try { + SubscribeLockedProductResponse result = apiInstance.subscribeLockedProduct(subscribeLockedProductRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleLockedApi#subscribeLockedProduct"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **subscribeLockedProductRequest** | [**SubscribeLockedProductRequest**](SubscribeLockedProductRequest.md)| | | + +### Return type + +[**SubscribeLockedProductResponse**](SubscribeLockedProductResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscribe Locked Product | - | + diff --git a/clients/simple-earn/docs/GetRwusdAccountResponse.md b/clients/simple-earn/docs/GetRwusdAccountResponse.md new file mode 100644 index 000000000..6cbb52c25 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdAccountResponse.md @@ -0,0 +1,14 @@ + + +# GetRwusdAccountResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rwusdAmount** | **String** | | [optional] | +|**totalProfit** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdQuotaDetailsResponse.md b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponse.md new file mode 100644 index 000000000..5d7386661 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponse.md @@ -0,0 +1,17 @@ + + +# GetRwusdQuotaDetailsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionQuota** | [**GetRwusdQuotaDetailsResponseSubscriptionQuota**](GetRwusdQuotaDetailsResponseSubscriptionQuota.md) | | [optional] | +|**fastRedemptionQuota** | [**GetRwusdQuotaDetailsResponseFastRedemptionQuota**](GetRwusdQuotaDetailsResponseFastRedemptionQuota.md) | | [optional] | +|**standardRedemptionQuota** | [**GetRwusdQuotaDetailsResponseStandardRedemptionQuota**](GetRwusdQuotaDetailsResponseStandardRedemptionQuota.md) | | [optional] | +|**subscribeEnable** | **Boolean** | | [optional] | +|**redeemEnable** | **Boolean** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseFastRedemptionQuota.md b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseFastRedemptionQuota.md new file mode 100644 index 000000000..373c210c3 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseFastRedemptionQuota.md @@ -0,0 +1,16 @@ + + +# GetRwusdQuotaDetailsResponseFastRedemptionQuota + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**leftQuota** | **String** | | [optional] | +|**minimum** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**freeQuota** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.md b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.md new file mode 100644 index 000000000..a87d21550 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.md @@ -0,0 +1,16 @@ + + +# GetRwusdQuotaDetailsResponseStandardRedemptionQuota + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**leftQuota** | **String** | | [optional] | +|**minimum** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**redeemPeriod** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseSubscriptionQuota.md b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseSubscriptionQuota.md new file mode 100644 index 000000000..9a806ad10 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdQuotaDetailsResponseSubscriptionQuota.md @@ -0,0 +1,15 @@ + + +# GetRwusdQuotaDetailsResponseSubscriptionQuota + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**assets** | **List<String>** | | [optional] | +|**leftQuota** | **String** | | [optional] | +|**minimum** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRateHistoryResponse.md b/clients/simple-earn/docs/GetRwusdRateHistoryResponse.md new file mode 100644 index 000000000..078a547a4 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdRateHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetRwusdRateHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetRwusdRateHistoryResponseRowsInner>**](GetRwusdRateHistoryResponseRowsInner.md) | | [optional] | +|**total** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRateHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetRwusdRateHistoryResponseRowsInner.md new file mode 100644 index 000000000..d015a4e4f --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdRateHistoryResponseRowsInner.md @@ -0,0 +1,14 @@ + + +# GetRwusdRateHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**annualPercentageRate** | **String** | | [optional] | +|**time** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRedemptionHistoryResponse.md b/clients/simple-earn/docs/GetRwusdRedemptionHistoryResponse.md new file mode 100644 index 000000000..7996ddf7c --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdRedemptionHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetRwusdRedemptionHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetRwusdRedemptionHistoryResponseRowsInner>**](GetRwusdRedemptionHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRedemptionHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetRwusdRedemptionHistoryResponseRowsInner.md new file mode 100644 index 000000000..5a1a547ea --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdRedemptionHistoryResponseRowsInner.md @@ -0,0 +1,20 @@ + + +# GetRwusdRedemptionHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**time** | **Long** | | [optional] | +|**asset** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**receiveAsset** | **String** | | [optional] | +|**receiveAmount** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**arrivalTime** | **Long** | | [optional] | +|**status** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRewardsHistoryResponse.md b/clients/simple-earn/docs/GetRwusdRewardsHistoryResponse.md new file mode 100644 index 000000000..3e689bb31 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdRewardsHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetRwusdRewardsHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetRwusdRewardsHistoryResponseRowsInner>**](GetRwusdRewardsHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRewardsHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetRwusdRewardsHistoryResponseRowsInner.md new file mode 100644 index 000000000..768f2c70b --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdRewardsHistoryResponseRowsInner.md @@ -0,0 +1,16 @@ + + +# GetRwusdRewardsHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**time** | **Long** | | [optional] | +|**rewardsAmount** | **String** | | [optional] | +|**rwusdPosition** | **String** | | [optional] | +|**annualPercentageRate** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponse.md b/clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponse.md new file mode 100644 index 000000000..65cd6092f --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetRwusdSubscriptionHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetRwusdSubscriptionHistoryResponseRowsInner>**](GetRwusdSubscriptionHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponseRowsInner.md new file mode 100644 index 000000000..9e6cc8fd2 --- /dev/null +++ b/clients/simple-earn/docs/GetRwusdSubscriptionHistoryResponseRowsInner.md @@ -0,0 +1,18 @@ + + +# GetRwusdSubscriptionHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**time** | **Long** | | [optional] | +|**asset** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**receiveAsset** | **String** | | [optional] | +|**receiveAmount** | **String** | | [optional] | +|**status** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetSimpleEarnFlexibleProductListResponseRowsInner.md b/clients/simple-earn/docs/GetSimpleEarnFlexibleProductListResponseRowsInner.md index 7533d741a..a75364f07 100644 --- a/clients/simple-earn/docs/GetSimpleEarnFlexibleProductListResponseRowsInner.md +++ b/clients/simple-earn/docs/GetSimpleEarnFlexibleProductListResponseRowsInner.md @@ -17,7 +17,7 @@ |**hot** | **Boolean** | | [optional] | |**minPurchaseAmount** | **String** | | [optional] | |**productId** | **String** | | [optional] | -|**subscriptionStartTime** | **String** | | [optional] | +|**subscriptionStartTime** | **Long** | | [optional] | |**status** | **String** | | [optional] | diff --git a/clients/simple-earn/docs/GetSimpleEarnLockedProductListResponseRowsInnerDetail.md b/clients/simple-earn/docs/GetSimpleEarnLockedProductListResponseRowsInnerDetail.md index f6e31ea5d..115ad6c04 100644 --- a/clients/simple-earn/docs/GetSimpleEarnLockedProductListResponseRowsInnerDetail.md +++ b/clients/simple-earn/docs/GetSimpleEarnLockedProductListResponseRowsInnerDetail.md @@ -14,12 +14,12 @@ |**isSoldOut** | **Boolean** | | [optional] | |**apr** | **String** | | [optional] | |**status** | **String** | | [optional] | -|**subscriptionStartTime** | **String** | | [optional] | +|**subscriptionStartTime** | **Long** | | [optional] | |**extraRewardAsset** | **String** | | [optional] | |**extraRewardAPR** | **String** | | [optional] | |**boostRewardAsset** | **String** | | [optional] | |**boostApr** | **String** | | [optional] | -|**boostEndTime** | **String** | | [optional] | +|**boostEndTime** | **Long** | | [optional] | diff --git a/clients/simple-earn/docs/HistoryApi.md b/clients/simple-earn/docs/HistoryApi.md deleted file mode 100644 index cf308db66..000000000 --- a/clients/simple-earn/docs/HistoryApi.md +++ /dev/null @@ -1,614 +0,0 @@ -# HistoryApi - -All URIs are relative to *https://api.binance.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getCollateralRecord**](HistoryApi.md#getCollateralRecord) | **GET** /sapi/v1/simple-earn/flexible/history/collateralRecord | Get Collateral Record(USER_DATA) | -| [**getFlexibleRedemptionRecord**](HistoryApi.md#getFlexibleRedemptionRecord) | **GET** /sapi/v1/simple-earn/flexible/history/redemptionRecord | Get Flexible Redemption Record(USER_DATA) | -| [**getFlexibleRewardsHistory**](HistoryApi.md#getFlexibleRewardsHistory) | **GET** /sapi/v1/simple-earn/flexible/history/rewardsRecord | Get Flexible Rewards History(USER_DATA) | -| [**getFlexibleSubscriptionRecord**](HistoryApi.md#getFlexibleSubscriptionRecord) | **GET** /sapi/v1/simple-earn/flexible/history/subscriptionRecord | Get Flexible Subscription Record(USER_DATA) | -| [**getLockedRedemptionRecord**](HistoryApi.md#getLockedRedemptionRecord) | **GET** /sapi/v1/simple-earn/locked/history/redemptionRecord | Get Locked Redemption Record(USER_DATA) | -| [**getLockedRewardsHistory**](HistoryApi.md#getLockedRewardsHistory) | **GET** /sapi/v1/simple-earn/locked/history/rewardsRecord | Get Locked Rewards History(USER_DATA) | -| [**getLockedSubscriptionRecord**](HistoryApi.md#getLockedSubscriptionRecord) | **GET** /sapi/v1/simple-earn/locked/history/subscriptionRecord | Get Locked Subscription Record(USER_DATA) | -| [**getRateHistory**](HistoryApi.md#getRateHistory) | **GET** /sapi/v1/simple-earn/flexible/history/rateHistory | Get Rate History(USER_DATA) | - - - -# **getCollateralRecord** -> GetCollateralRecordResponse getCollateralRecord(productId, startTime, endTime, current, size, recvWindow) - -Get Collateral Record(USER_DATA) - -Get Collateral Record * The time between `startTime` and `endTime` cannot be longer than 30 days. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String productId = "productId_example"; // String | - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetCollateralRecordResponse result = apiInstance.getCollateralRecord(productId, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getCollateralRecord"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **String**| | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetCollateralRecordResponse**](GetCollateralRecordResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Collateral Record | - | - - -# **getFlexibleRedemptionRecord** -> GetFlexibleRedemptionRecordResponse getFlexibleRedemptionRecord(productId, redeemId, asset, startTime, endTime, current, size, recvWindow) - -Get Flexible Redemption Record(USER_DATA) - -Get Flexible Redemption Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String productId = "productId_example"; // String | - String redeemId = "redeemId_example"; // String | - String asset = "asset_example"; // String | - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetFlexibleRedemptionRecordResponse result = apiInstance.getFlexibleRedemptionRecord(productId, redeemId, asset, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getFlexibleRedemptionRecord"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **String**| | [optional] | -| **redeemId** | **String**| | [optional] | -| **asset** | **String**| | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetFlexibleRedemptionRecordResponse**](GetFlexibleRedemptionRecordResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Flexible Redemption Record | - | - - -# **getFlexibleRewardsHistory** -> GetFlexibleRewardsHistoryResponse getFlexibleRewardsHistory(type, productId, asset, startTime, endTime, current, size, recvWindow) - -Get Flexible Rewards History(USER_DATA) - -Get Flexible Rewards History * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String type = "type_example"; // String | `Bonus` - Bonus tiered APR, `REALTIME` Real-time APR, `REWARDS` Historical rewards,`ALL`(set to default) - String productId = "productId_example"; // String | - String asset = "asset_example"; // String | - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetFlexibleRewardsHistoryResponse result = apiInstance.getFlexibleRewardsHistory(type, productId, asset, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getFlexibleRewardsHistory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **type** | **String**| `Bonus` - Bonus tiered APR, `REALTIME` Real-time APR, `REWARDS` Historical rewards,`ALL`(set to default) | | -| **productId** | **String**| | [optional] | -| **asset** | **String**| | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetFlexibleRewardsHistoryResponse**](GetFlexibleRewardsHistoryResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Flexible Rewards History | - | - - -# **getFlexibleSubscriptionRecord** -> GetFlexibleSubscriptionRecordResponse getFlexibleSubscriptionRecord(productId, purchaseId, asset, startTime, endTime, current, size, recvWindow) - -Get Flexible Subscription Record(USER_DATA) - -Get Flexible Subscription Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String productId = "productId_example"; // String | - String purchaseId = "purchaseId_example"; // String | - String asset = "asset_example"; // String | - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetFlexibleSubscriptionRecordResponse result = apiInstance.getFlexibleSubscriptionRecord(productId, purchaseId, asset, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getFlexibleSubscriptionRecord"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **String**| | [optional] | -| **purchaseId** | **String**| | [optional] | -| **asset** | **String**| | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetFlexibleSubscriptionRecordResponse**](GetFlexibleSubscriptionRecordResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Flexible Subscription Record | - | - - -# **getLockedRedemptionRecord** -> GetLockedRedemptionRecordResponse getLockedRedemptionRecord(positionId, redeemId, asset, startTime, endTime, current, size, recvWindow) - -Get Locked Redemption Record(USER_DATA) - -Get Locked Redemption Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String positionId = "positionId_example"; // String | - String redeemId = "redeemId_example"; // String | - String asset = "asset_example"; // String | - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetLockedRedemptionRecordResponse result = apiInstance.getLockedRedemptionRecord(positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getLockedRedemptionRecord"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **positionId** | **String**| | [optional] | -| **redeemId** | **String**| | [optional] | -| **asset** | **String**| | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetLockedRedemptionRecordResponse**](GetLockedRedemptionRecordResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Locked Redemption Record | - | - - -# **getLockedRewardsHistory** -> GetLockedRewardsHistoryResponse getLockedRewardsHistory(positionId, asset, startTime, endTime, current, size, recvWindow) - -Get Locked Rewards History(USER_DATA) - -Get Locked Rewards History * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String positionId = "positionId_example"; // String | - String asset = "asset_example"; // String | - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetLockedRewardsHistoryResponse result = apiInstance.getLockedRewardsHistory(positionId, asset, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getLockedRewardsHistory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **positionId** | **String**| | [optional] | -| **asset** | **String**| | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetLockedRewardsHistoryResponse**](GetLockedRewardsHistoryResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Locked Rewards History | - | - - -# **getLockedSubscriptionRecord** -> GetLockedSubscriptionRecordResponse getLockedSubscriptionRecord(purchaseId, asset, startTime, endTime, current, size, recvWindow) - -Get Locked Subscription Record(USER_DATA) - -Get Locked Subscription Record * The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String purchaseId = "purchaseId_example"; // String | - String asset = "asset_example"; // String | - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetLockedSubscriptionRecordResponse result = apiInstance.getLockedSubscriptionRecord(purchaseId, asset, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getLockedSubscriptionRecord"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **purchaseId** | **String**| | [optional] | -| **asset** | **String**| | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetLockedSubscriptionRecordResponse**](GetLockedSubscriptionRecordResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Locked Subscription Record | - | - - -# **getRateHistory** -> GetRateHistoryResponse getRateHistory(productId, aprPeriod, startTime, endTime, current, size, recvWindow) - -Get Rate History(USER_DATA) - -Get Rate History * The time between startTime and endTime cannot be longer than 1 year. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 150 - -### Example -```java -// Import classes: -import com.binance.connector.client.simple_earn.ApiClient; -import com.binance.connector.client.simple_earn.ApiException; -import com.binance.connector.client.simple_earn.Configuration; -import com.binance.connector.client.simple_earn.models.*; -import com.binance.connector.client.simple_earn.rest.api.HistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - HistoryApi apiInstance = new HistoryApi(defaultClient); - String productId = "productId_example"; // String | - String aprPeriod = "aprPeriod_example"; // String | \"DAY\",\"YEAR\",default\"DAY\" - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | - try { - GetRateHistoryResponse result = apiInstance.getRateHistory(productId, aprPeriod, startTime, endTime, current, size, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling HistoryApi#getRateHistory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **productId** | **String**| | | -| **aprPeriod** | **String**| \"DAY\",\"YEAR\",default\"DAY\" | [optional] | -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetRateHistoryResponse**](GetRateHistoryResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Rate History | - | - diff --git a/clients/crypto-loan/docs/CryptoLoanAdjustLtvRequest.md b/clients/simple-earn/docs/RedeemRwusdRequest.md similarity index 67% rename from clients/crypto-loan/docs/CryptoLoanAdjustLtvRequest.md rename to clients/simple-earn/docs/RedeemRwusdRequest.md index 620e26a5a..fe2ee820e 100644 --- a/clients/crypto-loan/docs/CryptoLoanAdjustLtvRequest.md +++ b/clients/simple-earn/docs/RedeemRwusdRequest.md @@ -1,15 +1,14 @@ -# CryptoLoanAdjustLtvRequest +# RedeemRwusdRequest ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**orderId** | **Long** | | | |**amount** | **Double** | | | -|**direction** | **String** | | | +|**type** | **String** | | | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/simple-earn/docs/RedeemRwusdResponse.md b/clients/simple-earn/docs/RedeemRwusdResponse.md new file mode 100644 index 000000000..da6307f51 --- /dev/null +++ b/clients/simple-earn/docs/RedeemRwusdResponse.md @@ -0,0 +1,16 @@ + + +# RedeemRwusdResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | +|**receiveAmount** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**arrivalTime** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/RwusdApi.md b/clients/simple-earn/docs/RwusdApi.md new file mode 100644 index 000000000..5bdb3bffd --- /dev/null +++ b/clients/simple-earn/docs/RwusdApi.md @@ -0,0 +1,546 @@ +# RwusdApi + +All URIs are relative to *https://api.binance.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getRwusdAccount**](RwusdApi.md#getRwusdAccount) | **GET** /sapi/v1/rwusd/account | Get RWUSD Account (USER_DATA) | +| [**getRwusdQuotaDetails**](RwusdApi.md#getRwusdQuotaDetails) | **GET** /sapi/v1/rwusd/quota | Get RWUSD Quota Details (USER_DATA) | +| [**getRwusdRateHistory**](RwusdApi.md#getRwusdRateHistory) | **GET** /sapi/v1/rwusd/history/rateHistory | Get RWUSD Rate History (USER_DATA) | +| [**getRwusdRedemptionHistory**](RwusdApi.md#getRwusdRedemptionHistory) | **GET** /sapi/v1/rwusd/history/redemptionHistory | Get RWUSD Redemption History (USER_DATA) | +| [**getRwusdRewardsHistory**](RwusdApi.md#getRwusdRewardsHistory) | **GET** /sapi/v1/rwusd/history/rewardsHistory | Get RWUSD Rewards History (USER_DATA) | +| [**getRwusdSubscriptionHistory**](RwusdApi.md#getRwusdSubscriptionHistory) | **GET** /sapi/v1/rwusd/history/subscriptionHistory | Get RWUSD subscription history(USER_DATA) | +| [**redeemRwusd**](RwusdApi.md#redeemRwusd) | **POST** /sapi/v1/rwusd/redeem | Redeem RWUSD(TRADE) | +| [**subscribeRwusd**](RwusdApi.md#subscribeRwusd) | **POST** /sapi/v1/rwusd/subscribe | Subscribe RWUSD(TRADE) | + + + +# **getRwusdAccount** +> GetRwusdAccountResponse getRwusdAccount(recvWindow) + +Get RWUSD Account (USER_DATA) + +Get RWUSD account information. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + GetRwusdAccountResponse result = apiInstance.getRwusdAccount(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#getRwusdAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetRwusdAccountResponse**](GetRwusdAccountResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get RWUSD Account | - | + + +# **getRwusdQuotaDetails** +> GetRwusdQuotaDetailsResponse getRwusdQuotaDetails(recvWindow) + +Get RWUSD Quota Details (USER_DATA) + +Get RWUSD quota details including subscription quota, fast redemption quota, and standard redemption quota. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + GetRwusdQuotaDetailsResponse result = apiInstance.getRwusdQuotaDetails(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#getRwusdQuotaDetails"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetRwusdQuotaDetailsResponse**](GetRwusdQuotaDetailsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get RWUSD Quota Details | - | + + +# **getRwusdRateHistory** +> GetRwusdRateHistoryResponse getRwusdRateHistory(startTime, endTime, current, size, recvWindow) + +Get RWUSD Rate History (USER_DATA) + +Get RWUSD rate history sorted by descending order. * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetRwusdRateHistoryResponse result = apiInstance.getRwusdRateHistory(startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#getRwusdRateHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetRwusdRateHistoryResponse**](GetRwusdRateHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get RWUSD Rate History | - | + + +# **getRwusdRedemptionHistory** +> GetRwusdRedemptionHistoryResponse getRwusdRedemptionHistory(startTime, endTime, current, size, recvWindow) + +Get RWUSD Redemption History (USER_DATA) + +Get RWUSD redemption history. * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetRwusdRedemptionHistoryResponse result = apiInstance.getRwusdRedemptionHistory(startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#getRwusdRedemptionHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetRwusdRedemptionHistoryResponse**](GetRwusdRedemptionHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get RWUSD Redemption History | - | + + +# **getRwusdRewardsHistory** +> GetRwusdRewardsHistoryResponse getRwusdRewardsHistory(startTime, endTime, current, size, recvWindow) + +Get RWUSD Rewards History (USER_DATA) + +Get RWUSD rewards history. * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetRwusdRewardsHistoryResponse result = apiInstance.getRwusdRewardsHistory(startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#getRwusdRewardsHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetRwusdRewardsHistoryResponse**](GetRwusdRewardsHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get RWUSD Rewards History | - | + + +# **getRwusdSubscriptionHistory** +> GetRwusdSubscriptionHistoryResponse getRwusdSubscriptionHistory(asset, startTime, endTime, current, size, recvWindow) + +Get RWUSD subscription history(USER_DATA) + +Get RWUSD subscription history * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time advanced by one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetRwusdSubscriptionHistoryResponse result = apiInstance.getRwusdSubscriptionHistory(asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#getRwusdSubscriptionHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetRwusdSubscriptionHistoryResponse**](GetRwusdSubscriptionHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get RWUSD subscription history | - | + + +# **redeemRwusd** +> RedeemRwusdResponse redeemRwusd(redeemRwusdRequest) + +Redeem RWUSD(TRADE) + +Redeem RWUSD to USDC * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + RedeemRwusdRequest redeemRwusdRequest = new RedeemRwusdRequest(); // RedeemRwusdRequest | + try { + RedeemRwusdResponse result = apiInstance.redeemRwusd(redeemRwusdRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#redeemRwusd"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **redeemRwusdRequest** | [**RedeemRwusdRequest**](RedeemRwusdRequest.md)| | | + +### Return type + +[**RedeemRwusdResponse**](RedeemRwusdResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Redeem RWUSD | - | + + +# **subscribeRwusd** +> SubscribeRwusdResponse subscribeRwusd(subscribeRwusdRequest) + +Subscribe RWUSD(TRADE) + +Subscribe RWUSD * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.RwusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + RwusdApi apiInstance = new RwusdApi(defaultClient); + SubscribeRwusdRequest subscribeRwusdRequest = new SubscribeRwusdRequest(); // SubscribeRwusdRequest | + try { + SubscribeRwusdResponse result = apiInstance.subscribeRwusd(subscribeRwusdRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwusdApi#subscribeRwusd"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **subscribeRwusdRequest** | [**SubscribeRwusdRequest**](SubscribeRwusdRequest.md)| | | + +### Return type + +[**SubscribeRwusdResponse**](SubscribeRwusdResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscribe RWUSD | - | + diff --git a/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallRequest.md b/clients/simple-earn/docs/SubscribeRwusdRequest.md similarity index 65% rename from clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallRequest.md rename to clients/simple-earn/docs/SubscribeRwusdRequest.md index 4016a4bc6..e742fc7ea 100644 --- a/clients/crypto-loan/docs/CryptoLoanCustomizeMarginCallRequest.md +++ b/clients/simple-earn/docs/SubscribeRwusdRequest.md @@ -1,13 +1,14 @@ -# CryptoLoanCustomizeMarginCallRequest +# SubscribeRwusdRequest ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**marginCall** | **Double** | | | +|**asset** | **String** | | | +|**amount** | **Double** | | | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/simple-earn/docs/SubscribeRwusdResponse.md b/clients/simple-earn/docs/SubscribeRwusdResponse.md new file mode 100644 index 000000000..62ff7ba8a --- /dev/null +++ b/clients/simple-earn/docs/SubscribeRwusdResponse.md @@ -0,0 +1,14 @@ + + +# SubscribeRwusdResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | +|**rwusdAmount** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/rest-api/migration-guide.md b/clients/simple-earn/docs/rest-api/migration-guide.md index c028e9a19..0357605ee 100644 --- a/clients/simple-earn/docs/rest-api/migration-guide.md +++ b/clients/simple-earn/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-simple-earn - 2.1.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-simple-earn - 2.1.0 + 3.0.0 ``` diff --git a/clients/simple-earn/pom.xml b/clients/simple-earn/pom.xml index 5d77eb5bc..214c28f6e 100644 --- a/clients/simple-earn/pom.xml +++ b/clients/simple-earn/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-simple-earn simple-earn - 2.1.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java index 1669c7308..580082eea 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java @@ -187,6 +187,47 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model .GetRateHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.GetRwusdAccountResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.GetRwusdQuotaDetailsResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdQuotaDetailsResponseFastRedemptionQuota + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdQuotaDetailsResponseStandardRedemptionQuota + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdQuotaDetailsResponseSubscriptionQuota.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.GetRwusdRateHistoryResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdRateHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdRedemptionHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdRedemptionHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdRewardsHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdRewardsHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdSubscriptionHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetRwusdSubscriptionHistoryResponseRowsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model .GetSimpleEarnFlexibleProductListResponse.CustomTypeAdapterFactory()); @@ -221,6 +262,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.RedeemRwusdRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.RedeemRwusdResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model .SetFlexibleAutoSubscribeRequest.CustomTypeAdapterFactory()); @@ -254,6 +301,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model .SubscribeLockedProductResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdResponse + .CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/EarnApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/EarnApi.java deleted file mode 100644 index 1a83da0a1..000000000 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/EarnApi.java +++ /dev/null @@ -1,1504 +0,0 @@ -/* - * Binance Simple Earn REST API - * OpenAPI Specification for the Binance Simple Earn REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.simple_earn.rest.api; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.DecimalFormatter; -import com.binance.connector.client.common.Pair; -import com.binance.connector.client.common.SystemUtil; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionPreviewResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionPreviewResponse; -import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest; -import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductResponse; -import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductRequest; -import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductResponse; -import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeRequest; -import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeResponse; -import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeRequest; -import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeResponse; -import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionRequest; -import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionResponse; -import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductRequest; -import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductResponse; -import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductRequest; -import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductResponse; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Valid; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import jakarta.validation.executable.ExecutableValidator; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class EarnApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - private static final String USER_AGENT = - String.format( - "binance-simple-earn/2.1.1 (Java/%s; %s; %s)", - SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - private static final boolean HAS_TIME_UNIT = false; - - public EarnApi(ClientConfiguration clientConfiguration) { - this(new ApiClient(clientConfiguration)); - } - - public EarnApi(ApiClient apiClient) { - apiClient.setUserAgent(USER_AGENT); - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getFlexibleSubscriptionPreview - * - * @param productId (required) - * @param amount (required) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Preview -
- * - * @see Get - * Flexible Subscription Preview(USER_DATA) Documentation - */ - private okhttp3.Call getFlexibleSubscriptionPreviewCall( - String productId, Double amount, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/subscriptionPreview"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); - } - - if (amount != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair( - "amount", DecimalFormatter.getFormatter().format(amount))); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getFlexibleSubscriptionPreviewValidateBeforeCall( - String productId, Double amount, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {productId, amount, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getFlexibleSubscriptionPreview", - String.class, - Double.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getFlexibleSubscriptionPreviewCall(productId, amount, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Flexible Subscription Preview(USER_DATA) Get Flexible Subscription Preview Weight: 150 - * - * @param productId (required) - * @param amount (required) - * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleSubscriptionPreviewResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Preview -
- * - * @see Get - * Flexible Subscription Preview(USER_DATA) Documentation - */ - public ApiResponse getFlexibleSubscriptionPreview( - @NotNull String productId, @NotNull Double amount, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getFlexibleSubscriptionPreviewValidateBeforeCall(productId, amount, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getLockedSubscriptionPreview - * - * @param projectId (required) - * @param amount (required) - * @param autoSubscribe true or false, default true. (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Preview -
- * - * @see Get - * Locked Subscription Preview(USER_DATA) Documentation - */ - private okhttp3.Call getLockedSubscriptionPreviewCall( - String projectId, Double amount, Boolean autoSubscribe, Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/subscriptionPreview"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (projectId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectId", projectId)); - } - - if (amount != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair( - "amount", DecimalFormatter.getFormatter().format(amount))); - } - - if (autoSubscribe != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("autoSubscribe", autoSubscribe)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getLockedSubscriptionPreviewValidateBeforeCall( - String projectId, Double amount, Boolean autoSubscribe, Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {projectId, amount, autoSubscribe, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getLockedSubscriptionPreview", - String.class, - Double.class, - Boolean.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getLockedSubscriptionPreviewCall( - projectId, amount, autoSubscribe, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Locked Subscription Preview(USER_DATA) Get Locked Subscription Preview Weight: 150 - * - * @param projectId (required) - * @param amount (required) - * @param autoSubscribe true or false, default true. (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetLockedSubscriptionPreviewResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Preview -
- * - * @see Get - * Locked Subscription Preview(USER_DATA) Documentation - */ - public ApiResponse getLockedSubscriptionPreview( - @NotNull String projectId, - @NotNull Double amount, - Boolean autoSubscribe, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getLockedSubscriptionPreviewValidateBeforeCall( - projectId, amount, autoSubscribe, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for redeemFlexibleProduct - * - * @param redeemFlexibleProductRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Redeem Flexible Product -
- * - * @see Redeem - * Flexible Product(TRADE) Documentation - */ - private okhttp3.Call redeemFlexibleProductCall( - RedeemFlexibleProductRequest redeemFlexibleProductRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/redeem"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (redeemFlexibleProductRequest.getProductId() != null) { - localVarFormParams.put("productId", redeemFlexibleProductRequest.getProductId()); - } - - if (redeemFlexibleProductRequest.getRedeemAll() != null) { - localVarFormParams.put("redeemAll", redeemFlexibleProductRequest.getRedeemAll()); - } - - if (redeemFlexibleProductRequest.getAmount() != null) { - localVarFormParams.put( - "amount", - DecimalFormatter.getFormatter() - .format(redeemFlexibleProductRequest.getAmount())); - } - - if (redeemFlexibleProductRequest.getDestAccount() != null) { - localVarFormParams.put("destAccount", redeemFlexibleProductRequest.getDestAccount()); - } - - if (redeemFlexibleProductRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", redeemFlexibleProductRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call redeemFlexibleProductValidateBeforeCall( - RedeemFlexibleProductRequest redeemFlexibleProductRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {redeemFlexibleProductRequest}; - Method method = - this.getClass() - .getMethod("redeemFlexibleProduct", RedeemFlexibleProductRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return redeemFlexibleProductCall(redeemFlexibleProductRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Redeem Flexible Product(TRADE) Redeem Flexible Product * You need to open `Enable Spot - * & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 - * - * @param redeemFlexibleProductRequest (required) - * @return ApiResponse<RedeemFlexibleProductResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Redeem Flexible Product -
- * - * @see Redeem - * Flexible Product(TRADE) Documentation - */ - public ApiResponse redeemFlexibleProduct( - @Valid @NotNull RedeemFlexibleProductRequest redeemFlexibleProductRequest) - throws ApiException { - okhttp3.Call localVarCall = - redeemFlexibleProductValidateBeforeCall(redeemFlexibleProductRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for redeemLockedProduct - * - * @param redeemLockedProductRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Redeem Locked Product -
- * - * @see Redeem - * Locked Product(TRADE) Documentation - */ - private okhttp3.Call redeemLockedProductCall( - RedeemLockedProductRequest redeemLockedProductRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/redeem"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (redeemLockedProductRequest.getPositionId() != null) { - localVarFormParams.put("positionId", redeemLockedProductRequest.getPositionId()); - } - - if (redeemLockedProductRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", redeemLockedProductRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call redeemLockedProductValidateBeforeCall( - RedeemLockedProductRequest redeemLockedProductRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {redeemLockedProductRequest}; - Method method = - this.getClass() - .getMethod("redeemLockedProduct", RedeemLockedProductRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return redeemLockedProductCall(redeemLockedProductRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Redeem Locked Product(TRADE) Redeem Locked Product * You need to open `Enable Spot & - * Margin Trading` permission for the API Key which requests this endpoint. Weight: 1/3s - * per account - * - * @param redeemLockedProductRequest (required) - * @return ApiResponse<RedeemLockedProductResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Redeem Locked Product -
- * - * @see Redeem - * Locked Product(TRADE) Documentation - */ - public ApiResponse redeemLockedProduct( - @Valid @NotNull RedeemLockedProductRequest redeemLockedProductRequest) - throws ApiException { - okhttp3.Call localVarCall = - redeemLockedProductValidateBeforeCall(redeemLockedProductRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for setFlexibleAutoSubscribe - * - * @param setFlexibleAutoSubscribeRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Set Flexible Auto Subscribe -
- * - * @see Set - * Flexible Auto Subscribe(USER_DATA) Documentation - */ - private okhttp3.Call setFlexibleAutoSubscribeCall( - SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/setAutoSubscribe"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (setFlexibleAutoSubscribeRequest.getProductId() != null) { - localVarFormParams.put("productId", setFlexibleAutoSubscribeRequest.getProductId()); - } - - if (setFlexibleAutoSubscribeRequest.getAutoSubscribe() != null) { - localVarFormParams.put( - "autoSubscribe", setFlexibleAutoSubscribeRequest.getAutoSubscribe()); - } - - if (setFlexibleAutoSubscribeRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", setFlexibleAutoSubscribeRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call setFlexibleAutoSubscribeValidateBeforeCall( - SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {setFlexibleAutoSubscribeRequest}; - Method method = - this.getClass() - .getMethod( - "setFlexibleAutoSubscribe", - SetFlexibleAutoSubscribeRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return setFlexibleAutoSubscribeCall(setFlexibleAutoSubscribeRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Set Flexible Auto Subscribe(USER_DATA) Set Flexible Auto Subscribe Weight: 150 - * - * @param setFlexibleAutoSubscribeRequest (required) - * @return ApiResponse<SetFlexibleAutoSubscribeResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Set Flexible Auto Subscribe -
- * - * @see Set - * Flexible Auto Subscribe(USER_DATA) Documentation - */ - public ApiResponse setFlexibleAutoSubscribe( - @Valid @NotNull SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest) - throws ApiException { - okhttp3.Call localVarCall = - setFlexibleAutoSubscribeValidateBeforeCall(setFlexibleAutoSubscribeRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for setLockedAutoSubscribe - * - * @param setLockedAutoSubscribeRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Set Locked Auto Subscribe -
- * - * @see Set - * Locked Auto Subscribe(USER_DATA) Documentation - */ - private okhttp3.Call setLockedAutoSubscribeCall( - SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/setAutoSubscribe"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (setLockedAutoSubscribeRequest.getPositionId() != null) { - localVarFormParams.put("positionId", setLockedAutoSubscribeRequest.getPositionId()); - } - - if (setLockedAutoSubscribeRequest.getAutoSubscribe() != null) { - localVarFormParams.put( - "autoSubscribe", setLockedAutoSubscribeRequest.getAutoSubscribe()); - } - - if (setLockedAutoSubscribeRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", setLockedAutoSubscribeRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call setLockedAutoSubscribeValidateBeforeCall( - SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {setLockedAutoSubscribeRequest}; - Method method = - this.getClass() - .getMethod( - "setLockedAutoSubscribe", SetLockedAutoSubscribeRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return setLockedAutoSubscribeCall(setLockedAutoSubscribeRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Set Locked Auto Subscribe(USER_DATA) Set locked auto subscribe Weight: 150 - * - * @param setLockedAutoSubscribeRequest (required) - * @return ApiResponse<SetLockedAutoSubscribeResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Set Locked Auto Subscribe -
- * - * @see Set - * Locked Auto Subscribe(USER_DATA) Documentation - */ - public ApiResponse setLockedAutoSubscribe( - @Valid @NotNull SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest) - throws ApiException { - okhttp3.Call localVarCall = - setLockedAutoSubscribeValidateBeforeCall(setLockedAutoSubscribeRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for setLockedProductRedeemOption - * - * @param setLockedProductRedeemOptionRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Set Locked Product Redeem Option -
- * - * @see Set - * Locked Product Redeem Option(USER_DATA) Documentation - */ - private okhttp3.Call setLockedProductRedeemOptionCall( - SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/setRedeemOption"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (setLockedProductRedeemOptionRequest.getPositionId() != null) { - localVarFormParams.put( - "positionId", setLockedProductRedeemOptionRequest.getPositionId()); - } - - if (setLockedProductRedeemOptionRequest.getRedeemTo() != null) { - localVarFormParams.put("redeemTo", setLockedProductRedeemOptionRequest.getRedeemTo()); - } - - if (setLockedProductRedeemOptionRequest.getRecvWindow() != null) { - localVarFormParams.put( - "recvWindow", setLockedProductRedeemOptionRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call setLockedProductRedeemOptionValidateBeforeCall( - SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {setLockedProductRedeemOptionRequest}; - Method method = - this.getClass() - .getMethod( - "setLockedProductRedeemOption", - SetLockedProductRedeemOptionRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return setLockedProductRedeemOptionCall(setLockedProductRedeemOptionRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Set Locked Product Redeem Option(USER_DATA) Set redeem option for Locked product Weight: 50 - * - * @param setLockedProductRedeemOptionRequest (required) - * @return ApiResponse<SetLockedProductRedeemOptionResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Set Locked Product Redeem Option -
- * - * @see Set - * Locked Product Redeem Option(USER_DATA) Documentation - */ - public ApiResponse setLockedProductRedeemOption( - @Valid @NotNull SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest) - throws ApiException { - okhttp3.Call localVarCall = - setLockedProductRedeemOptionValidateBeforeCall(setLockedProductRedeemOptionRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for subscribeFlexibleProduct - * - * @param subscribeFlexibleProductRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Subscribe Flexible Product -
- * - * @see Subscribe - * Flexible Product(TRADE) Documentation - */ - private okhttp3.Call subscribeFlexibleProductCall( - SubscribeFlexibleProductRequest subscribeFlexibleProductRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/subscribe"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (subscribeFlexibleProductRequest.getProductId() != null) { - localVarFormParams.put("productId", subscribeFlexibleProductRequest.getProductId()); - } - - if (subscribeFlexibleProductRequest.getAmount() != null) { - localVarFormParams.put( - "amount", - DecimalFormatter.getFormatter() - .format(subscribeFlexibleProductRequest.getAmount())); - } - - if (subscribeFlexibleProductRequest.getAutoSubscribe() != null) { - localVarFormParams.put( - "autoSubscribe", subscribeFlexibleProductRequest.getAutoSubscribe()); - } - - if (subscribeFlexibleProductRequest.getSourceAccount() != null) { - localVarFormParams.put( - "sourceAccount", subscribeFlexibleProductRequest.getSourceAccount()); - } - - if (subscribeFlexibleProductRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", subscribeFlexibleProductRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call subscribeFlexibleProductValidateBeforeCall( - SubscribeFlexibleProductRequest subscribeFlexibleProductRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {subscribeFlexibleProductRequest}; - Method method = - this.getClass() - .getMethod( - "subscribeFlexibleProduct", - SubscribeFlexibleProductRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return subscribeFlexibleProductCall(subscribeFlexibleProductRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Subscribe Flexible Product(TRADE) Subscribe Flexible Product * You need to open `Enable - * Spot & Margin Trading` permission for the API Key which requests this endpoint. - * Weight: 1 - * - * @param subscribeFlexibleProductRequest (required) - * @return ApiResponse<SubscribeFlexibleProductResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Subscribe Flexible Product -
- * - * @see Subscribe - * Flexible Product(TRADE) Documentation - */ - public ApiResponse subscribeFlexibleProduct( - @Valid @NotNull SubscribeFlexibleProductRequest subscribeFlexibleProductRequest) - throws ApiException { - okhttp3.Call localVarCall = - subscribeFlexibleProductValidateBeforeCall(subscribeFlexibleProductRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for subscribeLockedProduct - * - * @param subscribeLockedProductRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Subscribe Locked Product -
- * - * @see Subscribe - * Locked Product(TRADE) Documentation - */ - private okhttp3.Call subscribeLockedProductCall( - SubscribeLockedProductRequest subscribeLockedProductRequest) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/subscribe"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (subscribeLockedProductRequest.getProjectId() != null) { - localVarFormParams.put("projectId", subscribeLockedProductRequest.getProjectId()); - } - - if (subscribeLockedProductRequest.getAmount() != null) { - localVarFormParams.put( - "amount", - DecimalFormatter.getFormatter() - .format(subscribeLockedProductRequest.getAmount())); - } - - if (subscribeLockedProductRequest.getAutoSubscribe() != null) { - localVarFormParams.put( - "autoSubscribe", subscribeLockedProductRequest.getAutoSubscribe()); - } - - if (subscribeLockedProductRequest.getSourceAccount() != null) { - localVarFormParams.put( - "sourceAccount", subscribeLockedProductRequest.getSourceAccount()); - } - - if (subscribeLockedProductRequest.getRedeemTo() != null) { - localVarFormParams.put("redeemTo", subscribeLockedProductRequest.getRedeemTo()); - } - - if (subscribeLockedProductRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", subscribeLockedProductRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call subscribeLockedProductValidateBeforeCall( - SubscribeLockedProductRequest subscribeLockedProductRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {subscribeLockedProductRequest}; - Method method = - this.getClass() - .getMethod( - "subscribeLockedProduct", SubscribeLockedProductRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return subscribeLockedProductCall(subscribeLockedProductRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Subscribe Locked Product(TRADE) Subscribe Locked Product * You need to open `Enable Spot - * & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 - * - * @param subscribeLockedProductRequest (required) - * @return ApiResponse<SubscribeLockedProductResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Subscribe Locked Product -
- * - * @see Subscribe - * Locked Product(TRADE) Documentation - */ - public ApiResponse subscribeLockedProduct( - @Valid @NotNull SubscribeLockedProductRequest subscribeLockedProductRequest) - throws ApiException { - okhttp3.Call localVarCall = - subscribeLockedProductValidateBeforeCall(subscribeLockedProductRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } -} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java new file mode 100644 index 000000000..b20eeadb0 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java @@ -0,0 +1,4366 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.api; + +import com.binance.connector.client.common.ApiClient; +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.Pair; +import com.binance.connector.client.common.SystemUtil; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.simple_earn.rest.model.GetCollateralRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexiblePersonalLeftQuotaResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleProductPositionResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRedemptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionPreviewResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedPersonalLeftQuotaResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedProductPositionResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedRedemptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionPreviewResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRateHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnFlexibleProductListResponse; +import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnLockedProductListResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductResponse; +import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeRequest; +import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeResponse; +import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeRequest; +import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeResponse; +import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionRequest; +import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionResponse; +import com.binance.connector.client.simple_earn.rest.model.SimpleAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductResponse; +import com.google.gson.reflect.TypeToken; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Valid; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.*; +import jakarta.validation.executable.ExecutableValidator; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; + +public class FlexibleLockedApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + private static final String USER_AGENT = + String.format( + "binance-simple-earn/3.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private static final boolean HAS_TIME_UNIT = false; + + public FlexibleLockedApi(ClientConfiguration clientConfiguration) { + this(new ApiClient(clientConfiguration)); + } + + public FlexibleLockedApi(ApiClient apiClient) { + apiClient.setUserAgent(USER_AGENT); + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getCollateralRecord + * + * @param productId (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Collateral Record -
+ * + * @see Get + * Collateral Record(USER_DATA) Documentation + */ + private okhttp3.Call getCollateralRecordCall( + String productId, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/history/collateralRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCollateralRecordValidateBeforeCall( + String productId, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {productId, startTime, endTime, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getCollateralRecord", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getCollateralRecordCall( + productId, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Collateral Record(USER_DATA) Get Collateral Record * The time between + * `startTime` and `endTime` cannot be longer than 30 days. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 1 + * + * @param productId (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetCollateralRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Collateral Record -
+ * + * @see Get + * Collateral Record(USER_DATA) Documentation + */ + public ApiResponse getCollateralRecord( + String productId, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getCollateralRecordValidateBeforeCall( + productId, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getFlexiblePersonalLeftQuota + * + * @param productId (required) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Personal Left Quota -
+ * + * @see Get + * Flexible Personal Left Quota(USER_DATA) Documentation + */ + private okhttp3.Call getFlexiblePersonalLeftQuotaCall(String productId, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/personalLeftQuota"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFlexiblePersonalLeftQuotaValidateBeforeCall( + String productId, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {productId, recvWindow}; + Method method = + this.getClass() + .getMethod("getFlexiblePersonalLeftQuota", String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getFlexiblePersonalLeftQuotaCall(productId, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Flexible Personal Left Quota(USER_DATA) Get Flexible Personal Left Quota Weight: 150 + * + * @param productId (required) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexiblePersonalLeftQuotaResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Personal Left Quota -
+ * + * @see Get + * Flexible Personal Left Quota(USER_DATA) Documentation + */ + public ApiResponse getFlexiblePersonalLeftQuota( + @NotNull String productId, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + getFlexiblePersonalLeftQuotaValidateBeforeCall(productId, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getFlexibleProductPosition + * + * @param asset USDC or USDT (optional) + * @param productId (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Product Position -
+ * + * @see Get + * Flexible Product Position(USER_DATA) Documentation + */ + private okhttp3.Call getFlexibleProductPositionCall( + String asset, String productId, Long current, Long size, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/position"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFlexibleProductPositionValidateBeforeCall( + String asset, String productId, Long current, Long size, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {asset, productId, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getFlexibleProductPosition", + String.class, + String.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getFlexibleProductPositionCall(asset, productId, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Flexible Product Position(USER_DATA) Get Flexible Product Position Weight: 150 + * + * @param asset USDC or USDT (optional) + * @param productId (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleProductPositionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Product Position -
+ * + * @see Get + * Flexible Product Position(USER_DATA) Documentation + */ + public ApiResponse getFlexibleProductPosition( + String asset, String productId, Long current, Long size, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getFlexibleProductPositionValidateBeforeCall( + asset, productId, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getFlexibleRedemptionRecord + * + * @param productId (optional) + * @param redeemId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Redemption Record -
+ * + * @see Get + * Flexible Redemption Record(USER_DATA) Documentation + */ + private okhttp3.Call getFlexibleRedemptionRecordCall( + String productId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/history/redemptionRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (redeemId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("redeemId", redeemId)); + } + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFlexibleRedemptionRecordValidateBeforeCall( + String productId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + productId, redeemId, asset, startTime, endTime, current, size, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getFlexibleRedemptionRecord", + String.class, + String.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getFlexibleRedemptionRecordCall( + productId, redeemId, asset, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Flexible Redemption Record(USER_DATA) Get Flexible Redemption Record * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param productId (optional) + * @param redeemId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleRedemptionRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Redemption Record -
+ * + * @see Get + * Flexible Redemption Record(USER_DATA) Documentation + */ + public ApiResponse getFlexibleRedemptionRecord( + String productId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getFlexibleRedemptionRecordValidateBeforeCall( + productId, redeemId, asset, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getFlexibleRewardsHistory + * + * @param type `BONUS` - Bonus tiered APR, `REALTIME` Real-time APR, + * `REWARDS` Historical rewards,`ALL`(set to default) (required) + * @param productId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Rewards History -
+ * + * @see Get + * Flexible Rewards History(USER_DATA) Documentation + */ + private okhttp3.Call getFlexibleRewardsHistoryCall( + String type, + String productId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/history/rewardsRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFlexibleRewardsHistoryValidateBeforeCall( + String type, + String productId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + type, productId, asset, startTime, endTime, current, size, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getFlexibleRewardsHistory", + String.class, + String.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getFlexibleRewardsHistoryCall( + type, productId, asset, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Flexible Rewards History(USER_DATA) Get Flexible Rewards History * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param type `BONUS` - Bonus tiered APR, `REALTIME` Real-time APR, + * `REWARDS` Historical rewards,`ALL`(set to default) (required) + * @param productId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleRewardsHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Rewards History -
+ * + * @see Get + * Flexible Rewards History(USER_DATA) Documentation + */ + public ApiResponse getFlexibleRewardsHistory( + @NotNull String type, + String productId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getFlexibleRewardsHistoryValidateBeforeCall( + type, productId, asset, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getFlexibleSubscriptionPreview + * + * @param productId (required) + * @param amount (required) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Preview -
+ * + * @see Get + * Flexible Subscription Preview(USER_DATA) Documentation + */ + private okhttp3.Call getFlexibleSubscriptionPreviewCall( + String productId, Double amount, Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/subscriptionPreview"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (amount != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "amount", DecimalFormatter.getFormatter().format(amount))); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFlexibleSubscriptionPreviewValidateBeforeCall( + String productId, Double amount, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {productId, amount, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getFlexibleSubscriptionPreview", + String.class, + Double.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getFlexibleSubscriptionPreviewCall(productId, amount, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Flexible Subscription Preview(USER_DATA) Get Flexible Subscription Preview Weight: 150 + * + * @param productId (required) + * @param amount (required) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleSubscriptionPreviewResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Preview -
+ * + * @see Get + * Flexible Subscription Preview(USER_DATA) Documentation + */ + public ApiResponse getFlexibleSubscriptionPreview( + @NotNull String productId, @NotNull Double amount, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getFlexibleSubscriptionPreviewValidateBeforeCall(productId, amount, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getFlexibleSubscriptionRecord + * + * @param productId (optional) + * @param purchaseId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Record -
+ * + * @see Get + * Flexible Subscription Record(USER_DATA) Documentation + */ + private okhttp3.Call getFlexibleSubscriptionRecordCall( + String productId, + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/history/subscriptionRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (purchaseId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("purchaseId", purchaseId)); + } + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFlexibleSubscriptionRecordValidateBeforeCall( + String productId, + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + productId, purchaseId, asset, startTime, endTime, current, size, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getFlexibleSubscriptionRecord", + String.class, + String.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getFlexibleSubscriptionRecordCall( + productId, + purchaseId, + asset, + startTime, + endTime, + current, + size, + recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Flexible Subscription Record(USER_DATA) Get Flexible Subscription Record * The time + * between `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param productId (optional) + * @param purchaseId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleSubscriptionRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Record -
+ * + * @see Get + * Flexible Subscription Record(USER_DATA) Documentation + */ + public ApiResponse getFlexibleSubscriptionRecord( + String productId, + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getFlexibleSubscriptionRecordValidateBeforeCall( + productId, + purchaseId, + asset, + startTime, + endTime, + current, + size, + recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getLockedPersonalLeftQuota + * + * @param projectId (required) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Personal Left Quota -
+ * + * @see Get + * Locked Personal Left Quota(USER_DATA) Documentation + */ + private okhttp3.Call getLockedPersonalLeftQuotaCall(String projectId, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/personalLeftQuota"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (projectId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectId", projectId)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLockedPersonalLeftQuotaValidateBeforeCall( + String projectId, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {projectId, recvWindow}; + Method method = + this.getClass() + .getMethod("getLockedPersonalLeftQuota", String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLockedPersonalLeftQuotaCall(projectId, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Locked Personal Left Quota(USER_DATA) Get Locked Personal Left Quota Weight: 150 + * + * @param projectId (required) + * @param recvWindow (optional) + * @return ApiResponse<GetLockedPersonalLeftQuotaResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Personal Left Quota -
+ * + * @see Get + * Locked Personal Left Quota(USER_DATA) Documentation + */ + public ApiResponse getLockedPersonalLeftQuota( + @NotNull String projectId, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + getLockedPersonalLeftQuotaValidateBeforeCall(projectId, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getLockedProductPosition + * + * @param asset USDC or USDT (optional) + * @param positionId (optional) + * @param projectId (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Product Position -
+ * + * @see Get + * Locked Product Position Documentation + */ + private okhttp3.Call getLockedProductPositionCall( + String asset, + String positionId, + String projectId, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/position"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (positionId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("positionId", positionId)); + } + + if (projectId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectId", projectId)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLockedProductPositionValidateBeforeCall( + String asset, + String positionId, + String projectId, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {asset, positionId, projectId, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getLockedProductPosition", + String.class, + String.class, + String.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLockedProductPositionCall( + asset, positionId, projectId, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Locked Product Position Get Locked Product Position Weight: 150 + * + * @param asset USDC or USDT (optional) + * @param positionId (optional) + * @param projectId (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetLockedProductPositionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Product Position -
+ * + * @see Get + * Locked Product Position Documentation + */ + public ApiResponse getLockedProductPosition( + String asset, + String positionId, + String projectId, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getLockedProductPositionValidateBeforeCall( + asset, positionId, projectId, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getLockedRedemptionRecord + * + * @param positionId (optional) + * @param redeemId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Redemption Record -
+ * + * @see Get + * Locked Redemption Record(USER_DATA) Documentation + */ + private okhttp3.Call getLockedRedemptionRecordCall( + String positionId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/history/redemptionRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (positionId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("positionId", positionId)); + } + + if (redeemId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("redeemId", redeemId)); + } + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLockedRedemptionRecordValidateBeforeCall( + String positionId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + positionId, redeemId, asset, startTime, endTime, current, size, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getLockedRedemptionRecord", + String.class, + String.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLockedRedemptionRecordCall( + positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Locked Redemption Record(USER_DATA) Get Locked Redemption Record * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param positionId (optional) + * @param redeemId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetLockedRedemptionRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Redemption Record -
+ * + * @see Get + * Locked Redemption Record(USER_DATA) Documentation + */ + public ApiResponse getLockedRedemptionRecord( + String positionId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getLockedRedemptionRecordValidateBeforeCall( + positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getLockedRewardsHistory + * + * @param positionId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Rewards History -
+ * + * @see Get + * Locked Rewards History(USER_DATA) Documentation + */ + private okhttp3.Call getLockedRewardsHistoryCall( + String positionId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/history/rewardsRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (positionId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("positionId", positionId)); + } + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLockedRewardsHistoryValidateBeforeCall( + String positionId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + positionId, asset, startTime, endTime, current, size, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getLockedRewardsHistory", + String.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLockedRewardsHistoryCall( + positionId, asset, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Locked Rewards History(USER_DATA) Get Locked Rewards History * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param positionId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetLockedRewardsHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Rewards History -
+ * + * @see Get + * Locked Rewards History(USER_DATA) Documentation + */ + public ApiResponse getLockedRewardsHistory( + String positionId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getLockedRewardsHistoryValidateBeforeCall( + positionId, asset, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getLockedSubscriptionPreview + * + * @param projectId (required) + * @param amount (required) + * @param autoSubscribe true or false, default true. (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Preview -
+ * + * @see Get + * Locked Subscription Preview(USER_DATA) Documentation + */ + private okhttp3.Call getLockedSubscriptionPreviewCall( + String projectId, Double amount, Boolean autoSubscribe, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/subscriptionPreview"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (projectId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectId", projectId)); + } + + if (amount != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "amount", DecimalFormatter.getFormatter().format(amount))); + } + + if (autoSubscribe != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("autoSubscribe", autoSubscribe)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLockedSubscriptionPreviewValidateBeforeCall( + String projectId, Double amount, Boolean autoSubscribe, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {projectId, amount, autoSubscribe, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getLockedSubscriptionPreview", + String.class, + Double.class, + Boolean.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLockedSubscriptionPreviewCall( + projectId, amount, autoSubscribe, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Locked Subscription Preview(USER_DATA) Get Locked Subscription Preview Weight: 150 + * + * @param projectId (required) + * @param amount (required) + * @param autoSubscribe true or false, default true. (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetLockedSubscriptionPreviewResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Preview -
+ * + * @see Get + * Locked Subscription Preview(USER_DATA) Documentation + */ + public ApiResponse getLockedSubscriptionPreview( + @NotNull String projectId, + @NotNull Double amount, + Boolean autoSubscribe, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getLockedSubscriptionPreviewValidateBeforeCall( + projectId, amount, autoSubscribe, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getLockedSubscriptionRecord + * + * @param purchaseId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Record -
+ * + * @see Get + * Locked Subscription Record(USER_DATA) Documentation + */ + private okhttp3.Call getLockedSubscriptionRecordCall( + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/history/subscriptionRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (purchaseId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("purchaseId", purchaseId)); + } + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLockedSubscriptionRecordValidateBeforeCall( + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + purchaseId, asset, startTime, endTime, current, size, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getLockedSubscriptionRecord", + String.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLockedSubscriptionRecordCall( + purchaseId, asset, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Locked Subscription Record(USER_DATA) Get Locked Subscription Record * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param purchaseId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetLockedSubscriptionRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Record -
+ * + * @see Get + * Locked Subscription Record(USER_DATA) Documentation + */ + public ApiResponse getLockedSubscriptionRecord( + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getLockedSubscriptionRecordValidateBeforeCall( + purchaseId, asset, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getRateHistory + * + * @param productId (required) + * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Rate History -
+ * + * @see Get + * Rate History(USER_DATA) Documentation + */ + private okhttp3.Call getRateHistoryCall( + String productId, + String aprPeriod, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/history/rateHistory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (productId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + } + + if (aprPeriod != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("aprPeriod", aprPeriod)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRateHistoryValidateBeforeCall( + String productId, + String aprPeriod, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + productId, aprPeriod, startTime, endTime, current, size, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getRateHistory", + String.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getRateHistoryCall( + productId, aprPeriod, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Rate History(USER_DATA) Get Rate History * The time between startTime and endTime cannot + * be longer than 1 year. * If `startTime` and `endTime` are both not sent, + * then the last 30 days' data will be returned. * If `startTime` is sent but + * `endTime` is not sent, the next 30 days' data beginning from + * `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @param productId (required) + * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Rate History -
+ * + * @see Get + * Rate History(USER_DATA) Documentation + */ + public ApiResponse getRateHistory( + @NotNull String productId, + String aprPeriod, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getRateHistoryValidateBeforeCall( + productId, aprPeriod, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getSimpleEarnFlexibleProductList + * + * @param asset USDC or USDT (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Flexible Product List -
+ * + * @see Get + * Simple Earn Flexible Product List(USER_DATA) Documentation + */ + private okhttp3.Call getSimpleEarnFlexibleProductListCall( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/list"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSimpleEarnFlexibleProductListValidateBeforeCall( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {asset, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getSimpleEarnFlexibleProductList", + String.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getSimpleEarnFlexibleProductListCall(asset, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Simple Earn Flexible Product List(USER_DATA) Get available Simple Earn flexible product + * list Weight: 150 + * + * @param asset USDC or USDT (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetSimpleEarnFlexibleProductListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Flexible Product List -
+ * + * @see Get + * Simple Earn Flexible Product List(USER_DATA) Documentation + */ + public ApiResponse getSimpleEarnFlexibleProductList( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + getSimpleEarnFlexibleProductListValidateBeforeCall( + asset, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getSimpleEarnLockedProductList + * + * @param asset USDC or USDT (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Locked Product List -
+ * + * @see Get + * Simple Earn Locked Product List(USER_DATA) Documentation + */ + private okhttp3.Call getSimpleEarnLockedProductListCall( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/list"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSimpleEarnLockedProductListValidateBeforeCall( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {asset, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getSimpleEarnLockedProductList", + String.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getSimpleEarnLockedProductListCall(asset, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Simple Earn Locked Product List(USER_DATA) Get Simple Earn Locked Product List * Get + * available Simple Earn locked product list Weight: 150 + * + * @param asset USDC or USDT (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetSimpleEarnLockedProductListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Locked Product List -
+ * + * @see Get + * Simple Earn Locked Product List(USER_DATA) Documentation + */ + public ApiResponse getSimpleEarnLockedProductList( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + getSimpleEarnLockedProductListValidateBeforeCall(asset, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for redeemFlexibleProduct + * + * @param redeemFlexibleProductRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Redeem Flexible Product -
+ * + * @see Redeem + * Flexible Product(TRADE) Documentation + */ + private okhttp3.Call redeemFlexibleProductCall( + RedeemFlexibleProductRequest redeemFlexibleProductRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/redeem"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (redeemFlexibleProductRequest.getProductId() != null) { + localVarFormParams.put("productId", redeemFlexibleProductRequest.getProductId()); + } + + if (redeemFlexibleProductRequest.getRedeemAll() != null) { + localVarFormParams.put("redeemAll", redeemFlexibleProductRequest.getRedeemAll()); + } + + if (redeemFlexibleProductRequest.getAmount() != null) { + localVarFormParams.put( + "amount", + DecimalFormatter.getFormatter() + .format(redeemFlexibleProductRequest.getAmount())); + } + + if (redeemFlexibleProductRequest.getDestAccount() != null) { + localVarFormParams.put("destAccount", redeemFlexibleProductRequest.getDestAccount()); + } + + if (redeemFlexibleProductRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", redeemFlexibleProductRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call redeemFlexibleProductValidateBeforeCall( + RedeemFlexibleProductRequest redeemFlexibleProductRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {redeemFlexibleProductRequest}; + Method method = + this.getClass() + .getMethod("redeemFlexibleProduct", RedeemFlexibleProductRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return redeemFlexibleProductCall(redeemFlexibleProductRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Redeem Flexible Product(TRADE) Redeem Flexible Product * You need to open `Enable Spot + * & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 + * + * @param redeemFlexibleProductRequest (required) + * @return ApiResponse<RedeemFlexibleProductResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Redeem Flexible Product -
+ * + * @see Redeem + * Flexible Product(TRADE) Documentation + */ + public ApiResponse redeemFlexibleProduct( + @Valid @NotNull RedeemFlexibleProductRequest redeemFlexibleProductRequest) + throws ApiException { + okhttp3.Call localVarCall = + redeemFlexibleProductValidateBeforeCall(redeemFlexibleProductRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for redeemLockedProduct + * + * @param redeemLockedProductRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Redeem Locked Product -
+ * + * @see Redeem + * Locked Product(TRADE) Documentation + */ + private okhttp3.Call redeemLockedProductCall( + RedeemLockedProductRequest redeemLockedProductRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/redeem"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (redeemLockedProductRequest.getPositionId() != null) { + localVarFormParams.put("positionId", redeemLockedProductRequest.getPositionId()); + } + + if (redeemLockedProductRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", redeemLockedProductRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call redeemLockedProductValidateBeforeCall( + RedeemLockedProductRequest redeemLockedProductRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {redeemLockedProductRequest}; + Method method = + this.getClass() + .getMethod("redeemLockedProduct", RedeemLockedProductRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return redeemLockedProductCall(redeemLockedProductRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Redeem Locked Product(TRADE) Redeem Locked Product * You need to open `Enable Spot & + * Margin Trading` permission for the API Key which requests this endpoint. Weight: 1/3s + * per account + * + * @param redeemLockedProductRequest (required) + * @return ApiResponse<RedeemLockedProductResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Redeem Locked Product -
+ * + * @see Redeem + * Locked Product(TRADE) Documentation + */ + public ApiResponse redeemLockedProduct( + @Valid @NotNull RedeemLockedProductRequest redeemLockedProductRequest) + throws ApiException { + okhttp3.Call localVarCall = + redeemLockedProductValidateBeforeCall(redeemLockedProductRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for setFlexibleAutoSubscribe + * + * @param setFlexibleAutoSubscribeRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Flexible Auto Subscribe -
+ * + * @see Set + * Flexible Auto Subscribe(USER_DATA) Documentation + */ + private okhttp3.Call setFlexibleAutoSubscribeCall( + SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/setAutoSubscribe"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (setFlexibleAutoSubscribeRequest.getProductId() != null) { + localVarFormParams.put("productId", setFlexibleAutoSubscribeRequest.getProductId()); + } + + if (setFlexibleAutoSubscribeRequest.getAutoSubscribe() != null) { + localVarFormParams.put( + "autoSubscribe", setFlexibleAutoSubscribeRequest.getAutoSubscribe()); + } + + if (setFlexibleAutoSubscribeRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", setFlexibleAutoSubscribeRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setFlexibleAutoSubscribeValidateBeforeCall( + SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {setFlexibleAutoSubscribeRequest}; + Method method = + this.getClass() + .getMethod( + "setFlexibleAutoSubscribe", + SetFlexibleAutoSubscribeRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return setFlexibleAutoSubscribeCall(setFlexibleAutoSubscribeRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Set Flexible Auto Subscribe(USER_DATA) Set Flexible Auto Subscribe Weight: 150 + * + * @param setFlexibleAutoSubscribeRequest (required) + * @return ApiResponse<SetFlexibleAutoSubscribeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Flexible Auto Subscribe -
+ * + * @see Set + * Flexible Auto Subscribe(USER_DATA) Documentation + */ + public ApiResponse setFlexibleAutoSubscribe( + @Valid @NotNull SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest) + throws ApiException { + okhttp3.Call localVarCall = + setFlexibleAutoSubscribeValidateBeforeCall(setFlexibleAutoSubscribeRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for setLockedAutoSubscribe + * + * @param setLockedAutoSubscribeRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Locked Auto Subscribe -
+ * + * @see Set + * Locked Auto Subscribe(USER_DATA) Documentation + */ + private okhttp3.Call setLockedAutoSubscribeCall( + SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/setAutoSubscribe"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (setLockedAutoSubscribeRequest.getPositionId() != null) { + localVarFormParams.put("positionId", setLockedAutoSubscribeRequest.getPositionId()); + } + + if (setLockedAutoSubscribeRequest.getAutoSubscribe() != null) { + localVarFormParams.put( + "autoSubscribe", setLockedAutoSubscribeRequest.getAutoSubscribe()); + } + + if (setLockedAutoSubscribeRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", setLockedAutoSubscribeRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setLockedAutoSubscribeValidateBeforeCall( + SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {setLockedAutoSubscribeRequest}; + Method method = + this.getClass() + .getMethod( + "setLockedAutoSubscribe", SetLockedAutoSubscribeRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return setLockedAutoSubscribeCall(setLockedAutoSubscribeRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Set Locked Auto Subscribe(USER_DATA) Set locked auto subscribe Weight: 150 + * + * @param setLockedAutoSubscribeRequest (required) + * @return ApiResponse<SetLockedAutoSubscribeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Locked Auto Subscribe -
+ * + * @see Set + * Locked Auto Subscribe(USER_DATA) Documentation + */ + public ApiResponse setLockedAutoSubscribe( + @Valid @NotNull SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest) + throws ApiException { + okhttp3.Call localVarCall = + setLockedAutoSubscribeValidateBeforeCall(setLockedAutoSubscribeRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for setLockedProductRedeemOption + * + * @param setLockedProductRedeemOptionRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Locked Product Redeem Option -
+ * + * @see Set + * Locked Product Redeem Option(USER_DATA) Documentation + */ + private okhttp3.Call setLockedProductRedeemOptionCall( + SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/setRedeemOption"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (setLockedProductRedeemOptionRequest.getPositionId() != null) { + localVarFormParams.put( + "positionId", setLockedProductRedeemOptionRequest.getPositionId()); + } + + if (setLockedProductRedeemOptionRequest.getRedeemTo() != null) { + localVarFormParams.put("redeemTo", setLockedProductRedeemOptionRequest.getRedeemTo()); + } + + if (setLockedProductRedeemOptionRequest.getRecvWindow() != null) { + localVarFormParams.put( + "recvWindow", setLockedProductRedeemOptionRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setLockedProductRedeemOptionValidateBeforeCall( + SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {setLockedProductRedeemOptionRequest}; + Method method = + this.getClass() + .getMethod( + "setLockedProductRedeemOption", + SetLockedProductRedeemOptionRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return setLockedProductRedeemOptionCall(setLockedProductRedeemOptionRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Set Locked Product Redeem Option(USER_DATA) Set redeem option for Locked product Weight: 50 + * + * @param setLockedProductRedeemOptionRequest (required) + * @return ApiResponse<SetLockedProductRedeemOptionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Locked Product Redeem Option -
+ * + * @see Set + * Locked Product Redeem Option(USER_DATA) Documentation + */ + public ApiResponse setLockedProductRedeemOption( + @Valid @NotNull SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest) + throws ApiException { + okhttp3.Call localVarCall = + setLockedProductRedeemOptionValidateBeforeCall(setLockedProductRedeemOptionRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for simpleAccount + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Simple Account -
+ * + * @see Simple + * Account(USER_DATA) Documentation + */ + private okhttp3.Call simpleAccountCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/account"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call simpleAccountValidateBeforeCall(Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("simpleAccount", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return simpleAccountCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Simple Account(USER_DATA) Simple Account query Weight: 150 + * + * @param recvWindow (optional) + * @return ApiResponse<SimpleAccountResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Simple Account -
+ * + * @see Simple + * Account(USER_DATA) Documentation + */ + public ApiResponse simpleAccount(Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = simpleAccountValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for subscribeFlexibleProduct + * + * @param subscribeFlexibleProductRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Subscribe Flexible Product -
+ * + * @see Subscribe + * Flexible Product(TRADE) Documentation + */ + private okhttp3.Call subscribeFlexibleProductCall( + SubscribeFlexibleProductRequest subscribeFlexibleProductRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/flexible/subscribe"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (subscribeFlexibleProductRequest.getProductId() != null) { + localVarFormParams.put("productId", subscribeFlexibleProductRequest.getProductId()); + } + + if (subscribeFlexibleProductRequest.getAmount() != null) { + localVarFormParams.put( + "amount", + DecimalFormatter.getFormatter() + .format(subscribeFlexibleProductRequest.getAmount())); + } + + if (subscribeFlexibleProductRequest.getAutoSubscribe() != null) { + localVarFormParams.put( + "autoSubscribe", subscribeFlexibleProductRequest.getAutoSubscribe()); + } + + if (subscribeFlexibleProductRequest.getSourceAccount() != null) { + localVarFormParams.put( + "sourceAccount", subscribeFlexibleProductRequest.getSourceAccount()); + } + + if (subscribeFlexibleProductRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", subscribeFlexibleProductRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subscribeFlexibleProductValidateBeforeCall( + SubscribeFlexibleProductRequest subscribeFlexibleProductRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {subscribeFlexibleProductRequest}; + Method method = + this.getClass() + .getMethod( + "subscribeFlexibleProduct", + SubscribeFlexibleProductRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return subscribeFlexibleProductCall(subscribeFlexibleProductRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Subscribe Flexible Product(TRADE) Subscribe Flexible Product * You need to open `Enable + * Spot & Margin Trading` permission for the API Key which requests this endpoint. + * Weight: 1 + * + * @param subscribeFlexibleProductRequest (required) + * @return ApiResponse<SubscribeFlexibleProductResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Subscribe Flexible Product -
+ * + * @see Subscribe + * Flexible Product(TRADE) Documentation + */ + public ApiResponse subscribeFlexibleProduct( + @Valid @NotNull SubscribeFlexibleProductRequest subscribeFlexibleProductRequest) + throws ApiException { + okhttp3.Call localVarCall = + subscribeFlexibleProductValidateBeforeCall(subscribeFlexibleProductRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for subscribeLockedProduct + * + * @param subscribeLockedProductRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Subscribe Locked Product -
+ * + * @see Subscribe + * Locked Product(TRADE) Documentation + */ + private okhttp3.Call subscribeLockedProductCall( + SubscribeLockedProductRequest subscribeLockedProductRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/simple-earn/locked/subscribe"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (subscribeLockedProductRequest.getProjectId() != null) { + localVarFormParams.put("projectId", subscribeLockedProductRequest.getProjectId()); + } + + if (subscribeLockedProductRequest.getAmount() != null) { + localVarFormParams.put( + "amount", + DecimalFormatter.getFormatter() + .format(subscribeLockedProductRequest.getAmount())); + } + + if (subscribeLockedProductRequest.getAutoSubscribe() != null) { + localVarFormParams.put( + "autoSubscribe", subscribeLockedProductRequest.getAutoSubscribe()); + } + + if (subscribeLockedProductRequest.getSourceAccount() != null) { + localVarFormParams.put( + "sourceAccount", subscribeLockedProductRequest.getSourceAccount()); + } + + if (subscribeLockedProductRequest.getRedeemTo() != null) { + localVarFormParams.put("redeemTo", subscribeLockedProductRequest.getRedeemTo()); + } + + if (subscribeLockedProductRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", subscribeLockedProductRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subscribeLockedProductValidateBeforeCall( + SubscribeLockedProductRequest subscribeLockedProductRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {subscribeLockedProductRequest}; + Method method = + this.getClass() + .getMethod( + "subscribeLockedProduct", SubscribeLockedProductRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return subscribeLockedProductCall(subscribeLockedProductRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Subscribe Locked Product(TRADE) Subscribe Locked Product * You need to open `Enable Spot + * & Margin Trading` permission for the API Key which requests this endpoint. Weight: 1 + * + * @param subscribeLockedProductRequest (required) + * @return ApiResponse<SubscribeLockedProductResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Subscribe Locked Product -
+ * + * @see Subscribe + * Locked Product(TRADE) Documentation + */ + public ApiResponse subscribeLockedProduct( + @Valid @NotNull SubscribeLockedProductRequest subscribeLockedProductRequest) + throws ApiException { + okhttp3.Call localVarCall = + subscribeLockedProductValidateBeforeCall(subscribeLockedProductRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/HistoryApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/HistoryApi.java deleted file mode 100644 index 232a47724..000000000 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/HistoryApi.java +++ /dev/null @@ -1,1826 +0,0 @@ -/* - * Binance Simple Earn REST API - * OpenAPI Specification for the Binance Simple Earn REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.simple_earn.rest.api; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.Pair; -import com.binance.connector.client.common.SystemUtil; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.binance.connector.client.simple_earn.rest.model.GetCollateralRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRedemptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRewardsHistoryResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedRedemptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedRewardsHistoryResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetRateHistoryResponse; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import jakarta.validation.executable.ExecutableValidator; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class HistoryApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - private static final String USER_AGENT = - String.format( - "binance-simple-earn/2.1.1 (Java/%s; %s; %s)", - SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - private static final boolean HAS_TIME_UNIT = false; - - public HistoryApi(ClientConfiguration clientConfiguration) { - this(new ApiClient(clientConfiguration)); - } - - public HistoryApi(ApiClient apiClient) { - apiClient.setUserAgent(USER_AGENT); - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getCollateralRecord - * - * @param productId (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Collateral Record -
- * - * @see Get - * Collateral Record(USER_DATA) Documentation - */ - private okhttp3.Call getCollateralRecordCall( - String productId, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/history/collateralRecord"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getCollateralRecordValidateBeforeCall( - String productId, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {productId, startTime, endTime, current, size, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getCollateralRecord", - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getCollateralRecordCall( - productId, startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Collateral Record(USER_DATA) Get Collateral Record * The time between - * `startTime` and `endTime` cannot be longer than 30 days. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 1 - * - * @param productId (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetCollateralRecordResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Collateral Record -
- * - * @see Get - * Collateral Record(USER_DATA) Documentation - */ - public ApiResponse getCollateralRecord( - String productId, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getCollateralRecordValidateBeforeCall( - productId, startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getFlexibleRedemptionRecord - * - * @param productId (optional) - * @param redeemId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Redemption Record -
- * - * @see Get - * Flexible Redemption Record(USER_DATA) Documentation - */ - private okhttp3.Call getFlexibleRedemptionRecordCall( - String productId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/history/redemptionRecord"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); - } - - if (redeemId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("redeemId", redeemId)); - } - - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getFlexibleRedemptionRecordValidateBeforeCall( - String productId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - productId, redeemId, asset, startTime, endTime, current, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "getFlexibleRedemptionRecord", - String.class, - String.class, - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getFlexibleRedemptionRecordCall( - productId, redeemId, asset, startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Flexible Redemption Record(USER_DATA) Get Flexible Redemption Record * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 - * - * @param productId (optional) - * @param redeemId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleRedemptionRecordResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Redemption Record -
- * - * @see Get - * Flexible Redemption Record(USER_DATA) Documentation - */ - public ApiResponse getFlexibleRedemptionRecord( - String productId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getFlexibleRedemptionRecordValidateBeforeCall( - productId, redeemId, asset, startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getFlexibleRewardsHistory - * - * @param type `Bonus` - Bonus tiered APR, `REALTIME` Real-time APR, - * `REWARDS` Historical rewards,`ALL`(set to default) (required) - * @param productId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Rewards History -
- * - * @see Get - * Flexible Rewards History(USER_DATA) Documentation - */ - private okhttp3.Call getFlexibleRewardsHistoryCall( - String type, - String productId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/history/rewardsRecord"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); - } - - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (type != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getFlexibleRewardsHistoryValidateBeforeCall( - String type, - String productId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - type, productId, asset, startTime, endTime, current, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "getFlexibleRewardsHistory", - String.class, - String.class, - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getFlexibleRewardsHistoryCall( - type, productId, asset, startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Flexible Rewards History(USER_DATA) Get Flexible Rewards History * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 - * - * @param type `Bonus` - Bonus tiered APR, `REALTIME` Real-time APR, - * `REWARDS` Historical rewards,`ALL`(set to default) (required) - * @param productId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleRewardsHistoryResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Rewards History -
- * - * @see Get - * Flexible Rewards History(USER_DATA) Documentation - */ - public ApiResponse getFlexibleRewardsHistory( - @NotNull String type, - String productId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getFlexibleRewardsHistoryValidateBeforeCall( - type, productId, asset, startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getFlexibleSubscriptionRecord - * - * @param productId (optional) - * @param purchaseId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Record -
- * - * @see Get - * Flexible Subscription Record(USER_DATA) Documentation - */ - private okhttp3.Call getFlexibleSubscriptionRecordCall( - String productId, - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/history/subscriptionRecord"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); - } - - if (purchaseId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("purchaseId", purchaseId)); - } - - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getFlexibleSubscriptionRecordValidateBeforeCall( - String productId, - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - productId, purchaseId, asset, startTime, endTime, current, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "getFlexibleSubscriptionRecord", - String.class, - String.class, - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getFlexibleSubscriptionRecordCall( - productId, - purchaseId, - asset, - startTime, - endTime, - current, - size, - recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Flexible Subscription Record(USER_DATA) Get Flexible Subscription Record * The time - * between `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 - * - * @param productId (optional) - * @param purchaseId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleSubscriptionRecordResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Record -
- * - * @see Get - * Flexible Subscription Record(USER_DATA) Documentation - */ - public ApiResponse getFlexibleSubscriptionRecord( - String productId, - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getFlexibleSubscriptionRecordValidateBeforeCall( - productId, - purchaseId, - asset, - startTime, - endTime, - current, - size, - recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getLockedRedemptionRecord - * - * @param positionId (optional) - * @param redeemId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Redemption Record -
- * - * @see Get - * Locked Redemption Record(USER_DATA) Documentation - */ - private okhttp3.Call getLockedRedemptionRecordCall( - String positionId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/history/redemptionRecord"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (positionId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("positionId", positionId)); - } - - if (redeemId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("redeemId", redeemId)); - } - - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getLockedRedemptionRecordValidateBeforeCall( - String positionId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - positionId, redeemId, asset, startTime, endTime, current, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "getLockedRedemptionRecord", - String.class, - String.class, - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getLockedRedemptionRecordCall( - positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Locked Redemption Record(USER_DATA) Get Locked Redemption Record * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 - * - * @param positionId (optional) - * @param redeemId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetLockedRedemptionRecordResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Redemption Record -
- * - * @see Get - * Locked Redemption Record(USER_DATA) Documentation - */ - public ApiResponse getLockedRedemptionRecord( - String positionId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getLockedRedemptionRecordValidateBeforeCall( - positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getLockedRewardsHistory - * - * @param positionId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Rewards History -
- * - * @see Get - * Locked Rewards History(USER_DATA) Documentation - */ - private okhttp3.Call getLockedRewardsHistoryCall( - String positionId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/history/rewardsRecord"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (positionId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("positionId", positionId)); - } - - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getLockedRewardsHistoryValidateBeforeCall( - String positionId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - positionId, asset, startTime, endTime, current, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "getLockedRewardsHistory", - String.class, - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getLockedRewardsHistoryCall( - positionId, asset, startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Locked Rewards History(USER_DATA) Get Locked Rewards History * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 - * - * @param positionId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetLockedRewardsHistoryResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Rewards History -
- * - * @see Get - * Locked Rewards History(USER_DATA) Documentation - */ - public ApiResponse getLockedRewardsHistory( - String positionId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getLockedRewardsHistoryValidateBeforeCall( - positionId, asset, startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getLockedSubscriptionRecord - * - * @param purchaseId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Record -
- * - * @see Get - * Locked Subscription Record(USER_DATA) Documentation - */ - private okhttp3.Call getLockedSubscriptionRecordCall( - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/history/subscriptionRecord"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (purchaseId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("purchaseId", purchaseId)); - } - - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getLockedSubscriptionRecordValidateBeforeCall( - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - purchaseId, asset, startTime, endTime, current, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "getLockedSubscriptionRecord", - String.class, - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getLockedSubscriptionRecordCall( - purchaseId, asset, startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Locked Subscription Record(USER_DATA) Get Locked Subscription Record * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 - * - * @param purchaseId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetLockedSubscriptionRecordResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Record -
- * - * @see Get - * Locked Subscription Record(USER_DATA) Documentation - */ - public ApiResponse getLockedSubscriptionRecord( - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getLockedSubscriptionRecordValidateBeforeCall( - purchaseId, asset, startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getRateHistory - * - * @param productId (required) - * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Rate History -
- * - * @see Get - * Rate History(USER_DATA) Documentation - */ - private okhttp3.Call getRateHistoryCall( - String productId, - String aprPeriod, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/history/rateHistory"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); - } - - if (aprPeriod != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("aprPeriod", aprPeriod)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getRateHistoryValidateBeforeCall( - String productId, - String aprPeriod, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - productId, aprPeriod, startTime, endTime, current, size, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "getRateHistory", - String.class, - String.class, - Long.class, - Long.class, - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getRateHistoryCall( - productId, aprPeriod, startTime, endTime, current, size, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Rate History(USER_DATA) Get Rate History * The time between startTime and endTime cannot - * be longer than 1 year. * If `startTime` and `endTime` are both not sent, - * then the last 30 days' data will be returned. * If `startTime` is sent but - * `endTime` is not sent, the next 30 days' data beginning from - * `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 - * - * @param productId (required) - * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetRateHistoryResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Rate History -
- * - * @see Get - * Rate History(USER_DATA) Documentation - */ - public ApiResponse getRateHistory( - @NotNull String productId, - String aprPeriod, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getRateHistoryValidateBeforeCall( - productId, aprPeriod, startTime, endTime, current, size, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } -} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/AccountApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java similarity index 61% rename from clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/AccountApi.java rename to clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java index f7be858e6..b5375833e 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/AccountApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java @@ -15,19 +15,24 @@ import com.binance.connector.client.common.ApiClient; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.Pair; import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.binance.connector.client.simple_earn.rest.model.GetFlexiblePersonalLeftQuotaResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleProductPositionResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedPersonalLeftQuotaResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedProductPositionResponse; -import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnFlexibleProductListResponse; -import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnLockedProductListResponse; -import com.binance.connector.client.simple_earn.rest.model.SimpleAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdQuotaDetailsResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRateHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRedemptionHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdSubscriptionHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemRwusdRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemRwusdResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; +import jakarta.validation.Valid; import jakarta.validation.Validation; import jakarta.validation.Validator; import jakarta.validation.constraints.*; @@ -41,22 +46,22 @@ import java.util.Set; import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; -public class AccountApi { +public class RwusdApi { private ApiClient localVarApiClient; private int localHostIndex; private String localCustomBaseUrl; private static final String USER_AGENT = String.format( - "binance-simple-earn/2.1.1 (Java/%s; %s; %s)", + "binance-simple-earn/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; - public AccountApi(ClientConfiguration clientConfiguration) { + public RwusdApi(ClientConfiguration clientConfiguration) { this(new ApiClient(clientConfiguration)); } - public AccountApi(ApiClient apiClient) { + public RwusdApi(ApiClient apiClient) { apiClient.setUserAgent(USER_AGENT); this.localVarApiClient = apiClient; } @@ -86,9 +91,8 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for getFlexiblePersonalLeftQuota + * Build call for getRwusdAccount * - * @param productId (required) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -96,15 +100,13 @@ public void setCustomBaseUrl(String customBaseUrl) { * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Personal Left Quota -
200 Get RWUSD Account -
* - * @see Get - * Flexible Personal Left Quota(USER_DATA) Documentation + * @see Get RWUSD + * Account (USER_DATA) Documentation */ - private okhttp3.Call getFlexiblePersonalLeftQuotaCall(String productId, Long recvWindow) - throws ApiException { + private okhttp3.Call getRwusdAccountCall(Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -121,7 +123,7 @@ private okhttp3.Call getFlexiblePersonalLeftQuotaCall(String productId, Long rec Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/personalLeftQuota"; + String localVarPath = "/sapi/v1/rwusd/account"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -129,10 +131,137 @@ private okhttp3.Call getFlexiblePersonalLeftQuotaCall(String productId, Long rec Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRwusdAccountValidateBeforeCall(Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("getRwusdAccount", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getRwusdAccountCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get RWUSD Account (USER_DATA) Get RWUSD account information. Weight: 150 + * + * @param recvWindow (optional) + * @return ApiResponse<GetRwusdAccountResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get RWUSD Account -
+ * + * @see Get RWUSD + * Account (USER_DATA) Documentation + */ + public ApiResponse getRwusdAccount(Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getRwusdAccountValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getRwusdQuotaDetails + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get RWUSD Quota Details -
+ * + * @see Get + * RWUSD Quota Details (USER_DATA) Documentation + */ + private okhttp3.Call getRwusdQuotaDetailsCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; } + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/rwusd/quota"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -168,8 +297,8 @@ private okhttp3.Call getFlexiblePersonalLeftQuotaCall(String productId, Long rec } @SuppressWarnings("rawtypes") - private okhttp3.Call getFlexiblePersonalLeftQuotaValidateBeforeCall( - String productId, Long recvWindow) throws ApiException { + private okhttp3.Call getRwusdQuotaDetailsValidateBeforeCall(Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -179,15 +308,13 @@ private okhttp3.Call getFlexiblePersonalLeftQuotaValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {productId, recvWindow}; - Method method = - this.getClass() - .getMethod("getFlexiblePersonalLeftQuota", String.class, Long.class); - Set> violations = + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("getRwusdQuotaDetails", Long.class); + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getFlexiblePersonalLeftQuotaCall(productId, recvWindow); + return getRwusdQuotaDetailsCall(recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -201,38 +328,37 @@ private okhttp3.Call getFlexiblePersonalLeftQuotaValidateBeforeCall( } /** - * Get Flexible Personal Left Quota(USER_DATA) Get Flexible Personal Left Quota Weight: 150 + * Get RWUSD Quota Details (USER_DATA) Get RWUSD quota details including subscription quota, + * fast redemption quota, and standard redemption quota. Weight: 150 * - * @param productId (required) * @param recvWindow (optional) - * @return ApiResponse<GetFlexiblePersonalLeftQuotaResponse> + * @return ApiResponse<GetRwusdQuotaDetailsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Personal Left Quota -
200 Get RWUSD Quota Details -
* * @see Get - * Flexible Personal Left Quota(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/account/Get-RWUSD-Quota-Details">Get + * RWUSD Quota Details (USER_DATA) Documentation */ - public ApiResponse getFlexiblePersonalLeftQuota( - @NotNull String productId, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = - getFlexiblePersonalLeftQuotaValidateBeforeCall(productId, recvWindow); + public ApiResponse getRwusdQuotaDetails(Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getRwusdQuotaDetailsValidateBeforeCall(recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for getFlexibleProductPosition + * Build call for getRwusdRateHistory * - * @param asset (optional) - * @param productId (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) @@ -242,15 +368,15 @@ public ApiResponse getFlexiblePersonalLeft * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Product Position -
200 Get RWUSD Rate History -
* * @see Get - * Flexible Product Position(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rate-History">Get + * RWUSD Rate History (USER_DATA) Documentation */ - private okhttp3.Call getFlexibleProductPositionCall( - String asset, String productId, Long current, Long size, Long recvWindow) + private okhttp3.Call getRwusdRateHistoryCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -268,7 +394,7 @@ private okhttp3.Call getFlexibleProductPositionCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/position"; + String localVarPath = "/sapi/v1/rwusd/history/rateHistory"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -276,12 +402,12 @@ private okhttp3.Call getFlexibleProductPositionCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } - if (productId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("productId", productId)); + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); } if (current != null) { @@ -327,8 +453,8 @@ private okhttp3.Call getFlexibleProductPositionCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getFlexibleProductPositionValidateBeforeCall( - String asset, String productId, Long current, Long size, Long recvWindow) + private okhttp3.Call getRwusdRateHistoryValidateBeforeCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { try { Validator validator = @@ -339,21 +465,21 @@ private okhttp3.Call getFlexibleProductPositionValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {asset, productId, current, size, recvWindow}; + Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; Method method = this.getClass() .getMethod( - "getFlexibleProductPosition", - String.class, - String.class, + "getRwusdRateHistory", + Long.class, + Long.class, Long.class, Long.class, Long.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getFlexibleProductPositionCall(asset, productId, current, size, recvWindow); + return getRwusdRateHistoryCall(startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -367,42 +493,53 @@ private okhttp3.Call getFlexibleProductPositionValidateBeforeCall( } /** - * Get Flexible Product Position(USER_DATA) Get Flexible Product Position Weight: 150 + * Get RWUSD Rate History (USER_DATA) Get RWUSD rate history sorted by descending order. * The + * time between `startTime` and `endTime` cannot be longer than 6 months. * + * If `startTime` and `endTime` are both not sent, then the last 30 + * days' data will be returned. * If `startTime` is sent but `endTime` + * is not sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 * - * @param asset (optional) - * @param productId (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleProductPositionResponse> + * @return ApiResponse<GetRwusdRateHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Product Position -
200 Get RWUSD Rate History -
* * @see Get - * Flexible Product Position(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rate-History">Get + * RWUSD Rate History (USER_DATA) Documentation */ - public ApiResponse getFlexibleProductPosition( - String asset, String productId, Long current, Long size, Long recvWindow) + public ApiResponse getRwusdRateHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - getFlexibleProductPositionValidateBeforeCall( - asset, productId, current, size, recvWindow); + getRwusdRateHistoryValidateBeforeCall( + startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for getLockedPersonalLeftQuota + * Build call for getRwusdRedemptionHistory * - * @param projectId (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -410,14 +547,15 @@ public ApiResponse getFlexibleProductPositio * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Personal Left Quota -
200 Get RWUSD Redemption History -
* * @see Get - * Locked Personal Left Quota(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Redemption-History">Get + * RWUSD Redemption History (USER_DATA) Documentation */ - private okhttp3.Call getLockedPersonalLeftQuotaCall(String projectId, Long recvWindow) + private okhttp3.Call getRwusdRedemptionHistoryCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -435,7 +573,7 @@ private okhttp3.Call getLockedPersonalLeftQuotaCall(String projectId, Long recvW Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/personalLeftQuota"; + String localVarPath = "/sapi/v1/rwusd/history/redemptionHistory"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -443,8 +581,20 @@ private okhttp3.Call getLockedPersonalLeftQuotaCall(String projectId, Long recvW Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (projectId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectId", projectId)); + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); } if (recvWindow != null) { @@ -482,8 +632,9 @@ private okhttp3.Call getLockedPersonalLeftQuotaCall(String projectId, Long recvW } @SuppressWarnings("rawtypes") - private okhttp3.Call getLockedPersonalLeftQuotaValidateBeforeCall( - String projectId, Long recvWindow) throws ApiException { + private okhttp3.Call getRwusdRedemptionHistoryValidateBeforeCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -493,15 +644,21 @@ private okhttp3.Call getLockedPersonalLeftQuotaValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {projectId, recvWindow}; + Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; Method method = this.getClass() - .getMethod("getLockedPersonalLeftQuota", String.class, Long.class); - Set> violations = + .getMethod( + "getRwusdRedemptionHistory", + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getLockedPersonalLeftQuotaCall(projectId, recvWindow); + return getRwusdRedemptionHistoryCall(startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -515,39 +672,51 @@ private okhttp3.Call getLockedPersonalLeftQuotaValidateBeforeCall( } /** - * Get Locked Personal Left Quota(USER_DATA) Get Locked Personal Left Quota Weight: 150 + * Get RWUSD Redemption History (USER_DATA) Get RWUSD redemption history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 * - * @param projectId (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetLockedPersonalLeftQuotaResponse> + * @return ApiResponse<GetRwusdRedemptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Personal Left Quota -
200 Get RWUSD Redemption History -
* * @see Get - * Locked Personal Left Quota(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Redemption-History">Get + * RWUSD Redemption History (USER_DATA) Documentation */ - public ApiResponse getLockedPersonalLeftQuota( - @NotNull String projectId, Long recvWindow) throws ApiException { + public ApiResponse getRwusdRedemptionHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { okhttp3.Call localVarCall = - getLockedPersonalLeftQuotaValidateBeforeCall(projectId, recvWindow); + getRwusdRedemptionHistoryValidateBeforeCall( + startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for getLockedProductPosition + * Build call for getRwusdRewardsHistory * - * @param asset (optional) - * @param positionId (optional) - * @param projectId (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) @@ -557,20 +726,15 @@ public ApiResponse getLockedPersonalLeftQuot * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Product Position -
200 Get RWUSD Rewards History -
* * @see Get - * Locked Product Position Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rewards-History">Get + * RWUSD Rewards History (USER_DATA) Documentation */ - private okhttp3.Call getLockedProductPositionCall( - String asset, - String positionId, - String projectId, - Long current, - Long size, - Long recvWindow) + private okhttp3.Call getRwusdRewardsHistoryCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -588,7 +752,7 @@ private okhttp3.Call getLockedProductPositionCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/position"; + String localVarPath = "/sapi/v1/rwusd/history/rewardsHistory"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -596,16 +760,12 @@ private okhttp3.Call getLockedProductPositionCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } - if (positionId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("positionId", positionId)); - } - - if (projectId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectId", projectId)); + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); } if (current != null) { @@ -651,13 +811,8 @@ private okhttp3.Call getLockedProductPositionCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getLockedProductPositionValidateBeforeCall( - String asset, - String positionId, - String projectId, - Long current, - Long size, - Long recvWindow) + private okhttp3.Call getRwusdRewardsHistoryValidateBeforeCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { try { Validator validator = @@ -668,23 +823,21 @@ private okhttp3.Call getLockedProductPositionValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {asset, positionId, projectId, current, size, recvWindow}; + Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; Method method = this.getClass() .getMethod( - "getLockedProductPosition", - String.class, - String.class, - String.class, + "getRwusdRewardsHistory", + Long.class, + Long.class, Long.class, Long.class, Long.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getLockedProductPositionCall( - asset, positionId, projectId, current, size, recvWindow); + return getRwusdRewardsHistoryCall(startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -698,48 +851,52 @@ private okhttp3.Call getLockedProductPositionValidateBeforeCall( } /** - * Get Locked Product Position Get Locked Product Position Weight: 150 + * Get RWUSD Rewards History (USER_DATA) Get RWUSD rewards history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 * - * @param asset (optional) - * @param positionId (optional) - * @param projectId (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetLockedProductPositionResponse> + * @return ApiResponse<GetRwusdRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Product Position -
200 Get RWUSD Rewards History -
* * @see Get - * Locked Product Position Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rewards-History">Get + * RWUSD Rewards History (USER_DATA) Documentation */ - public ApiResponse getLockedProductPosition( - String asset, - String positionId, - String projectId, - Long current, - Long size, - Long recvWindow) + public ApiResponse getRwusdRewardsHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - getLockedProductPositionValidateBeforeCall( - asset, positionId, projectId, current, size, recvWindow); + getRwusdRewardsHistoryValidateBeforeCall( + startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for getSimpleEarnFlexibleProductList + * Build call for getRwusdSubscriptionHistory * - * @param asset (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) @@ -749,15 +906,16 @@ public ApiResponse getLockedProductPosition( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Flexible Product List -
200 Get RWUSD subscription history -
* * @see Get - * Simple Earn Flexible Product List(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-subscription-history">Get + * RWUSD subscription history(USER_DATA) Documentation */ - private okhttp3.Call getSimpleEarnFlexibleProductListCall( - String asset, Long current, Long size, Long recvWindow) throws ApiException { + private okhttp3.Call getRwusdSubscriptionHistoryCall( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -774,7 +932,7 @@ private okhttp3.Call getSimpleEarnFlexibleProductListCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/flexible/list"; + String localVarPath = "/sapi/v1/rwusd/history/subscriptionHistory"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -786,6 +944,14 @@ private okhttp3.Call getSimpleEarnFlexibleProductListCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); } + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + if (current != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); } @@ -829,8 +995,9 @@ private okhttp3.Call getSimpleEarnFlexibleProductListCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getSimpleEarnFlexibleProductListValidateBeforeCall( - String asset, Long current, Long size, Long recvWindow) throws ApiException { + private okhttp3.Call getRwusdSubscriptionHistoryValidateBeforeCall( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -840,20 +1007,23 @@ private okhttp3.Call getSimpleEarnFlexibleProductListValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {asset, current, size, recvWindow}; + Object[] parameterValues = {asset, startTime, endTime, current, size, recvWindow}; Method method = this.getClass() .getMethod( - "getSimpleEarnFlexibleProductList", + "getRwusdSubscriptionHistory", String.class, Long.class, Long.class, + Long.class, + Long.class, Long.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getSimpleEarnFlexibleProductListCall(asset, current, size, recvWindow); + return getRwusdSubscriptionHistoryCall( + asset, startTime, endTime, current, size, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -867,59 +1037,65 @@ private okhttp3.Call getSimpleEarnFlexibleProductListValidateBeforeCall( } /** - * Get Simple Earn Flexible Product List(USER_DATA) Get available Simple Earn flexible product - * list Weight: 150 + * Get RWUSD subscription history(USER_DATA) Get RWUSD subscription history * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time + * advanced by one month, and data between `startTime` and `endTime` will be + * returned. Weight: 150 * - * @param asset (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetSimpleEarnFlexibleProductListResponse> + * @return ApiResponse<GetRwusdSubscriptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Flexible Product List -
200 Get RWUSD subscription history -
* * @see Get - * Simple Earn Flexible Product List(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-subscription-history">Get + * RWUSD subscription history(USER_DATA) Documentation */ - public ApiResponse getSimpleEarnFlexibleProductList( - String asset, Long current, Long size, Long recvWindow) throws ApiException { + public ApiResponse getRwusdSubscriptionHistory( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { okhttp3.Call localVarCall = - getSimpleEarnFlexibleProductListValidateBeforeCall( - asset, current, size, recvWindow); + getRwusdSubscriptionHistoryValidateBeforeCall( + asset, startTime, endTime, current, size, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for getSimpleEarnLockedProductList + * Build call for redeemRwusd * - * @param asset (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param redeemRwusdRequest (required) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Locked Product List -
200 Redeem RWUSD -
* - * @see Get - * Simple Earn Locked Product List(USER_DATA) Documentation + * @see Redeem + * RWUSD(TRADE) Documentation */ - private okhttp3.Call getSimpleEarnLockedProductListCall( - String asset, Long current, Long size, Long recvWindow) throws ApiException { + private okhttp3.Call redeemRwusdCall(RedeemRwusdRequest redeemRwusdRequest) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -936,7 +1112,7 @@ private okhttp3.Call getSimpleEarnLockedProductListCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/locked/list"; + String localVarPath = "/sapi/v1/rwusd/redeem"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -944,20 +1120,18 @@ private okhttp3.Call getSimpleEarnLockedProductListCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (asset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + if (redeemRwusdRequest.getAmount() != null) { + localVarFormParams.put( + "amount", + DecimalFormatter.getFormatter().format(redeemRwusdRequest.getAmount())); } - if (current != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + if (redeemRwusdRequest.getType() != null) { + localVarFormParams.put("type", redeemRwusdRequest.getType()); } - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + if (redeemRwusdRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", redeemRwusdRequest.getRecvWindow()); } final String[] localVarAccepts = {"application/json"}; @@ -980,7 +1154,7 @@ private okhttp3.Call getSimpleEarnLockedProductListCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -991,8 +1165,8 @@ private okhttp3.Call getSimpleEarnLockedProductListCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getSimpleEarnLockedProductListValidateBeforeCall( - String asset, Long current, Long size, Long recvWindow) throws ApiException { + private okhttp3.Call redeemRwusdValidateBeforeCall(RedeemRwusdRequest redeemRwusdRequest) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1002,20 +1176,13 @@ private okhttp3.Call getSimpleEarnLockedProductListValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {asset, current, size, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getSimpleEarnLockedProductList", - String.class, - Long.class, - Long.class, - Long.class); - Set> violations = + Object[] parameterValues = {redeemRwusdRequest}; + Method method = this.getClass().getMethod("redeemRwusd", RedeemRwusdRequest.class); + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getSimpleEarnLockedProductListCall(asset, current, size, recvWindow); + return redeemRwusdCall(redeemRwusdRequest); } else { throw new ConstraintViolationException((Set) violations); } @@ -1029,53 +1196,50 @@ private okhttp3.Call getSimpleEarnLockedProductListValidateBeforeCall( } /** - * Get Simple Earn Locked Product List(USER_DATA) Get Simple Earn Locked Product List * Get - * available Simple Earn locked product list Weight: 150 + * Redeem RWUSD(TRADE) Redeem RWUSD to USDC * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 * - * @param asset (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetSimpleEarnLockedProductListResponse> + * @param redeemRwusdRequest (required) + * @return ApiResponse<RedeemRwusdResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Locked Product List -
200 Redeem RWUSD -
* - * @see Get - * Simple Earn Locked Product List(USER_DATA) Documentation + * @see Redeem + * RWUSD(TRADE) Documentation */ - public ApiResponse getSimpleEarnLockedProductList( - String asset, Long current, Long size, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = - getSimpleEarnLockedProductListValidateBeforeCall(asset, current, size, recvWindow); + public ApiResponse redeemRwusd( + @Valid @NotNull RedeemRwusdRequest redeemRwusdRequest) throws ApiException { + okhttp3.Call localVarCall = redeemRwusdValidateBeforeCall(redeemRwusdRequest); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for simpleAccount + * Build call for subscribeRwusd * - * @param recvWindow (optional) + * @param subscribeRwusdRequest (required) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Simple Account -
200 Subscribe RWUSD -
* - * @see Simple - * Account(USER_DATA) Documentation + * @see Subscribe + * RWUSD(TRADE) Documentation */ - private okhttp3.Call simpleAccountCall(Long recvWindow) throws ApiException { + private okhttp3.Call subscribeRwusdCall(SubscribeRwusdRequest subscribeRwusdRequest) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1092,7 +1256,7 @@ private okhttp3.Call simpleAccountCall(Long recvWindow) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/simple-earn/account"; + String localVarPath = "/sapi/v1/rwusd/subscribe"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1100,8 +1264,18 @@ private okhttp3.Call simpleAccountCall(Long recvWindow) throws ApiException { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + if (subscribeRwusdRequest.getAsset() != null) { + localVarFormParams.put("asset", subscribeRwusdRequest.getAsset()); + } + + if (subscribeRwusdRequest.getAmount() != null) { + localVarFormParams.put( + "amount", + DecimalFormatter.getFormatter().format(subscribeRwusdRequest.getAmount())); + } + + if (subscribeRwusdRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", subscribeRwusdRequest.getRecvWindow()); } final String[] localVarAccepts = {"application/json"}; @@ -1124,7 +1298,7 @@ private okhttp3.Call simpleAccountCall(Long recvWindow) throws ApiException { return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1135,7 +1309,8 @@ private okhttp3.Call simpleAccountCall(Long recvWindow) throws ApiException { } @SuppressWarnings("rawtypes") - private okhttp3.Call simpleAccountValidateBeforeCall(Long recvWindow) throws ApiException { + private okhttp3.Call subscribeRwusdValidateBeforeCall( + SubscribeRwusdRequest subscribeRwusdRequest) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1145,13 +1320,14 @@ private okhttp3.Call simpleAccountValidateBeforeCall(Long recvWindow) throws Api .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {recvWindow}; - Method method = this.getClass().getMethod("simpleAccount", Long.class); - Set> violations = + Object[] parameterValues = {subscribeRwusdRequest}; + Method method = + this.getClass().getMethod("subscribeRwusd", SubscribeRwusdRequest.class); + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return simpleAccountCall(recvWindow); + return subscribeRwusdCall(subscribeRwusdRequest); } else { throw new ConstraintViolationException((Set) violations); } @@ -1165,26 +1341,29 @@ private okhttp3.Call simpleAccountValidateBeforeCall(Long recvWindow) throws Api } /** - * Simple Account(USER_DATA) Simple Account query Weight: 150 + * Subscribe RWUSD(TRADE) Subscribe RWUSD * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 * - * @param recvWindow (optional) - * @return ApiResponse<SimpleAccountResponse> + * @param subscribeRwusdRequest (required) + * @return ApiResponse<SubscribeRwusdResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Simple Account -
200 Subscribe RWUSD -
* - * @see Simple - * Account(USER_DATA) Documentation + * @see Subscribe + * RWUSD(TRADE) Documentation */ - public ApiResponse simpleAccount(Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = simpleAccountValidateBeforeCall(recvWindow); + public ApiResponse subscribeRwusd( + @Valid @NotNull SubscribeRwusdRequest subscribeRwusdRequest) throws ApiException { + okhttp3.Call localVarCall = subscribeRwusdValidateBeforeCall(subscribeRwusdRequest); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } } diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java index b57ad481a..67aaade45 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java @@ -19,12 +19,20 @@ import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionPreviewResponse; import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionRecordResponse; import com.binance.connector.client.simple_earn.rest.model.GetRateHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdQuotaDetailsResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRateHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRedemptionHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdSubscriptionHistoryResponse; import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnFlexibleProductListResponse; import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnLockedProductListResponse; import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest; import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductResponse; import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductRequest; import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemRwusdRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemRwusdResponse; import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeRequest; import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeResponse; import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeRequest; @@ -36,21 +44,62 @@ import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductResponse; import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductRequest; import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdResponse; public class SimpleEarnRestApi { - private final AccountApi accountApi; - private final EarnApi earnApi; - private final HistoryApi historyApi; + private final FlexibleLockedApi flexibleLockedApi; + private final RwusdApi rwusdApi; public SimpleEarnRestApi(ClientConfiguration configuration) { this(SimpleEarnRestApiUtil.getDefaultClient(configuration)); } public SimpleEarnRestApi(ApiClient apiClient) { - this.accountApi = new AccountApi(apiClient); - this.earnApi = new EarnApi(apiClient); - this.historyApi = new HistoryApi(apiClient); + this.flexibleLockedApi = new FlexibleLockedApi(apiClient); + this.rwusdApi = new RwusdApi(apiClient); + } + + /** + * Get Collateral Record(USER_DATA) Get Collateral Record * The time between + * `startTime` and `endTime` cannot be longer than 30 days. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 1 + * + * @param productId (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetCollateralRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Collateral Record -
+ * + * @see Get + * Collateral Record(USER_DATA) Documentation + */ + public ApiResponse getCollateralRecord( + String productId, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getCollateralRecord( + productId, startTime, endTime, current, size, recvWindow); } /** @@ -69,18 +118,18 @@ public SimpleEarnRestApi(ApiClient apiClient) { * * * @see Get + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Personal-Left-Quota">Get * Flexible Personal Left Quota(USER_DATA) Documentation */ public ApiResponse getFlexiblePersonalLeftQuota( String productId, Long recvWindow) throws ApiException { - return accountApi.getFlexiblePersonalLeftQuota(productId, recvWindow); + return flexibleLockedApi.getFlexiblePersonalLeftQuota(productId, recvWindow); } /** * Get Flexible Product Position(USER_DATA) Get Flexible Product Position Weight: 150 * - * @param asset (optional) + * @param asset USDC or USDT (optional) * @param productId (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) @@ -96,13 +145,175 @@ public ApiResponse getFlexiblePersonalLeft * * * @see Get + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Product-Position">Get * Flexible Product Position(USER_DATA) Documentation */ public ApiResponse getFlexibleProductPosition( String asset, String productId, Long current, Long size, Long recvWindow) throws ApiException { - return accountApi.getFlexibleProductPosition(asset, productId, current, size, recvWindow); + return flexibleLockedApi.getFlexibleProductPosition( + asset, productId, current, size, recvWindow); + } + + /** + * Get Flexible Redemption Record(USER_DATA) Get Flexible Redemption Record * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param productId (optional) + * @param redeemId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleRedemptionRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Redemption Record -
+ * + * @see Get + * Flexible Redemption Record(USER_DATA) Documentation + */ + public ApiResponse getFlexibleRedemptionRecord( + String productId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getFlexibleRedemptionRecord( + productId, redeemId, asset, startTime, endTime, current, size, recvWindow); + } + + /** + * Get Flexible Rewards History(USER_DATA) Get Flexible Rewards History * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param type `BONUS` - Bonus tiered APR, `REALTIME` Real-time APR, + * `REWARDS` Historical rewards,`ALL`(set to default) (required) + * @param productId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleRewardsHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Rewards History -
+ * + * @see Get + * Flexible Rewards History(USER_DATA) Documentation + */ + public ApiResponse getFlexibleRewardsHistory( + String type, + String productId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getFlexibleRewardsHistory( + type, productId, asset, startTime, endTime, current, size, recvWindow); + } + + /** + * Get Flexible Subscription Preview(USER_DATA) Get Flexible Subscription Preview Weight: 150 + * + * @param productId (required) + * @param amount (required) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleSubscriptionPreviewResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Preview -
+ * + * @see Get + * Flexible Subscription Preview(USER_DATA) Documentation + */ + public ApiResponse getFlexibleSubscriptionPreview( + String productId, Double amount, Long recvWindow) throws ApiException { + return flexibleLockedApi.getFlexibleSubscriptionPreview(productId, amount, recvWindow); + } + + /** + * Get Flexible Subscription Record(USER_DATA) Get Flexible Subscription Record * The time + * between `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param productId (optional) + * @param purchaseId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetFlexibleSubscriptionRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Record -
+ * + * @see Get + * Flexible Subscription Record(USER_DATA) Documentation + */ + public ApiResponse getFlexibleSubscriptionRecord( + String productId, + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getFlexibleSubscriptionRecord( + productId, purchaseId, asset, startTime, endTime, current, size, recvWindow); } /** @@ -121,18 +332,18 @@ public ApiResponse getFlexibleProductPositio * * * @see Get + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Personal-Left-Quota">Get * Locked Personal Left Quota(USER_DATA) Documentation */ public ApiResponse getLockedPersonalLeftQuota( String projectId, Long recvWindow) throws ApiException { - return accountApi.getLockedPersonalLeftQuota(projectId, recvWindow); + return flexibleLockedApi.getLockedPersonalLeftQuota(projectId, recvWindow); } /** * Get Locked Product Position Get Locked Product Position Weight: 150 * - * @param asset (optional) + * @param asset USDC or USDT (optional) * @param positionId (optional) * @param projectId (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) @@ -149,7 +360,7 @@ public ApiResponse getLockedPersonalLeftQuot * * * @see Get + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Product-Position">Get * Locked Product Position Documentation */ public ApiResponse getLockedProductPosition( @@ -160,135 +371,264 @@ public ApiResponse getLockedProductPosition( Long size, Long recvWindow) throws ApiException { - return accountApi.getLockedProductPosition( + return flexibleLockedApi.getLockedProductPosition( asset, positionId, projectId, current, size, recvWindow); } /** - * Get Simple Earn Flexible Product List(USER_DATA) Get available Simple Earn flexible product - * list Weight: 150 + * Get Locked Redemption Record(USER_DATA) Get Locked Redemption Record * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 * - * @param asset (optional) + * @param positionId (optional) + * @param redeemId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetSimpleEarnFlexibleProductListResponse> + * @return ApiResponse<GetLockedRedemptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Flexible Product List -
200 Get Locked Redemption Record -
* * @see Get - * Simple Earn Flexible Product List(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Redemption-Record">Get + * Locked Redemption Record(USER_DATA) Documentation */ - public ApiResponse getSimpleEarnFlexibleProductList( - String asset, Long current, Long size, Long recvWindow) throws ApiException { - return accountApi.getSimpleEarnFlexibleProductList(asset, current, size, recvWindow); + public ApiResponse getLockedRedemptionRecord( + String positionId, + String redeemId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getLockedRedemptionRecord( + positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); } /** - * Get Simple Earn Locked Product List(USER_DATA) Get Simple Earn Locked Product List * Get - * available Simple Earn locked product list Weight: 150 + * Get Locked Rewards History(USER_DATA) Get Locked Rewards History * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 * - * @param asset (optional) + * @param positionId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetSimpleEarnLockedProductListResponse> + * @return ApiResponse<GetLockedRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Simple Earn Locked Product List -
200 Get Locked Rewards History -
* * @see Get - * Simple Earn Locked Product List(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Rewards-History">Get + * Locked Rewards History(USER_DATA) Documentation */ - public ApiResponse getSimpleEarnLockedProductList( - String asset, Long current, Long size, Long recvWindow) throws ApiException { - return accountApi.getSimpleEarnLockedProductList(asset, current, size, recvWindow); + public ApiResponse getLockedRewardsHistory( + String positionId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getLockedRewardsHistory( + positionId, asset, startTime, endTime, current, size, recvWindow); } /** - * Simple Account(USER_DATA) Simple Account query Weight: 150 + * Get Locked Subscription Preview(USER_DATA) Get Locked Subscription Preview Weight: 150 * + * @param projectId (required) + * @param amount (required) + * @param autoSubscribe true or false, default true. (optional) * @param recvWindow (optional) - * @return ApiResponse<SimpleAccountResponse> + * @return ApiResponse<GetLockedSubscriptionPreviewResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * + *
Response Details
Status Code Description Response Headers
200 Simple Account -
200 Get Locked Subscription Preview -
+ * + * @see Get + * Locked Subscription Preview(USER_DATA) Documentation + */ + public ApiResponse getLockedSubscriptionPreview( + String projectId, Double amount, Boolean autoSubscribe, Long recvWindow) + throws ApiException { + return flexibleLockedApi.getLockedSubscriptionPreview( + projectId, amount, autoSubscribe, recvWindow); + } + + /** + * Get Locked Subscription Record(USER_DATA) Get Locked Subscription Record * The time between + * `startTime` and `endTime` cannot be longer than 3 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, the next 30 days' data beginning from `startTime` will be returned. * If + * `endTime` is sent but `startTime` is not sent, the 30 days' data + * before `endTime` will be returned. Weight: 150 + * + * @param purchaseId (optional) + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetLockedSubscriptionRecordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Record -
+ * + * @see Get + * Locked Subscription Record(USER_DATA) Documentation + */ + public ApiResponse getLockedSubscriptionRecord( + String purchaseId, + String asset, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getLockedSubscriptionRecord( + purchaseId, asset, startTime, endTime, current, size, recvWindow); + } + + /** + * Get Rate History(USER_DATA) Get Rate History * The time between startTime and endTime cannot + * be longer than 1 year. * If `startTime` and `endTime` are both not sent, + * then the last 30 days' data will be returned. * If `startTime` is sent but + * `endTime` is not sent, the next 30 days' data beginning from + * `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @param productId (required) + * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * *
Response Details
Status Code Description Response Headers
200 Get Rate History -
* - * @see Simple - * Account(USER_DATA) Documentation + * @see Get + * Rate History(USER_DATA) Documentation */ - public ApiResponse simpleAccount(Long recvWindow) throws ApiException { - return accountApi.simpleAccount(recvWindow); + public ApiResponse getRateHistory( + String productId, + String aprPeriod, + Long startTime, + Long endTime, + Long current, + Long size, + Long recvWindow) + throws ApiException { + return flexibleLockedApi.getRateHistory( + productId, aprPeriod, startTime, endTime, current, size, recvWindow); } /** - * Get Flexible Subscription Preview(USER_DATA) Get Flexible Subscription Preview Weight: 150 + * Get Simple Earn Flexible Product List(USER_DATA) Get available Simple Earn flexible product + * list Weight: 150 * - * @param productId (required) - * @param amount (required) + * @param asset USDC or USDT (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleSubscriptionPreviewResponse> + * @return ApiResponse<GetSimpleEarnFlexibleProductListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Preview -
200 Get Simple Earn Flexible Product List -
* * @see Get - * Flexible Subscription Preview(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Flexible-Product-List">Get + * Simple Earn Flexible Product List(USER_DATA) Documentation */ - public ApiResponse getFlexibleSubscriptionPreview( - String productId, Double amount, Long recvWindow) throws ApiException { - return earnApi.getFlexibleSubscriptionPreview(productId, amount, recvWindow); + public ApiResponse getSimpleEarnFlexibleProductList( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + return flexibleLockedApi.getSimpleEarnFlexibleProductList(asset, current, size, recvWindow); } /** - * Get Locked Subscription Preview(USER_DATA) Get Locked Subscription Preview Weight: 150 + * Get Simple Earn Locked Product List(USER_DATA) Get Simple Earn Locked Product List * Get + * available Simple Earn locked product list Weight: 150 * - * @param projectId (required) - * @param amount (required) - * @param autoSubscribe true or false, default true. (optional) + * @param asset USDC or USDT (optional) + * @param current Currently querying the page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetLockedSubscriptionPreviewResponse> + * @return ApiResponse<GetSimpleEarnLockedProductListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Preview -
200 Get Simple Earn Locked Product List -
* * @see Get - * Locked Subscription Preview(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Locked-Product-List">Get + * Simple Earn Locked Product List(USER_DATA) Documentation */ - public ApiResponse getLockedSubscriptionPreview( - String projectId, Double amount, Boolean autoSubscribe, Long recvWindow) - throws ApiException { - return earnApi.getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow); + public ApiResponse getSimpleEarnLockedProductList( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + return flexibleLockedApi.getSimpleEarnLockedProductList(asset, current, size, recvWindow); } /** @@ -307,12 +647,12 @@ public ApiResponse getLockedSubscriptionPr * * * @see Redeem + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Flexible-Product">Redeem * Flexible Product(TRADE) Documentation */ public ApiResponse redeemFlexibleProduct( RedeemFlexibleProductRequest redeemFlexibleProductRequest) throws ApiException { - return earnApi.redeemFlexibleProduct(redeemFlexibleProductRequest); + return flexibleLockedApi.redeemFlexibleProduct(redeemFlexibleProductRequest); } /** @@ -332,12 +672,12 @@ public ApiResponse redeemFlexibleProduct( * * * @see Redeem + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Locked-Product">Redeem * Locked Product(TRADE) Documentation */ public ApiResponse redeemLockedProduct( RedeemLockedProductRequest redeemLockedProductRequest) throws ApiException { - return earnApi.redeemLockedProduct(redeemLockedProductRequest); + return flexibleLockedApi.redeemLockedProduct(redeemLockedProductRequest); } /** @@ -355,12 +695,12 @@ public ApiResponse redeemLockedProduct( * * * @see Set + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Flexible-Auto-Subscribe">Set * Flexible Auto Subscribe(USER_DATA) Documentation */ public ApiResponse setFlexibleAutoSubscribe( SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest) throws ApiException { - return earnApi.setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest); + return flexibleLockedApi.setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest); } /** @@ -378,12 +718,12 @@ public ApiResponse setFlexibleAutoSubscribe( * * * @see Set + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Auto-Subscribe">Set * Locked Auto Subscribe(USER_DATA) Documentation */ public ApiResponse setLockedAutoSubscribe( SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest) throws ApiException { - return earnApi.setLockedAutoSubscribe(setLockedAutoSubscribeRequest); + return flexibleLockedApi.setLockedAutoSubscribe(setLockedAutoSubscribeRequest); } /** @@ -401,13 +741,35 @@ public ApiResponse setLockedAutoSubscribe( * * * @see Set + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Redeem-Option">Set * Locked Product Redeem Option(USER_DATA) Documentation */ public ApiResponse setLockedProductRedeemOption( SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest) throws ApiException { - return earnApi.setLockedProductRedeemOption(setLockedProductRedeemOptionRequest); + return flexibleLockedApi.setLockedProductRedeemOption(setLockedProductRedeemOptionRequest); + } + + /** + * Simple Account(USER_DATA) Simple Account query Weight: 150 + * + * @param recvWindow (optional) + * @return ApiResponse<SimpleAccountResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Simple Account -
+ * + * @see Simple + * Account(USER_DATA) Documentation + */ + public ApiResponse simpleAccount(Long recvWindow) throws ApiException { + return flexibleLockedApi.simpleAccount(recvWindow); } /** @@ -427,12 +789,12 @@ public ApiResponse setLockedProductRedeemO * * * @see Subscribe + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Subscribe-Flexible-Product">Subscribe * Flexible Product(TRADE) Documentation */ public ApiResponse subscribeFlexibleProduct( SubscribeFlexibleProductRequest subscribeFlexibleProductRequest) throws ApiException { - return earnApi.subscribeFlexibleProduct(subscribeFlexibleProductRequest); + return flexibleLockedApi.subscribeFlexibleProduct(subscribeFlexibleProductRequest); } /** @@ -451,361 +813,250 @@ public ApiResponse subscribeFlexibleProduct( * * * @see Subscribe + * href="https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Subscribe-Locked-Product">Subscribe * Locked Product(TRADE) Documentation */ public ApiResponse subscribeLockedProduct( SubscribeLockedProductRequest subscribeLockedProductRequest) throws ApiException { - return earnApi.subscribeLockedProduct(subscribeLockedProductRequest); + return flexibleLockedApi.subscribeLockedProduct(subscribeLockedProductRequest); } /** - * Get Collateral Record(USER_DATA) Get Collateral Record * The time between - * `startTime` and `endTime` cannot be longer than 30 days. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 1 + * Get RWUSD Account (USER_DATA) Get RWUSD account information. Weight: 150 * - * @param productId (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetCollateralRecordResponse> + * @return ApiResponse<GetRwusdAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Collateral Record -
200 Get RWUSD Account -
* - * @see Get - * Collateral Record(USER_DATA) Documentation + * @see Get RWUSD + * Account (USER_DATA) Documentation */ - public ApiResponse getCollateralRecord( - String productId, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) + public ApiResponse getRwusdAccount(Long recvWindow) throws ApiException { - return historyApi.getCollateralRecord( - productId, startTime, endTime, current, size, recvWindow); + return rwusdApi.getRwusdAccount(recvWindow); } /** - * Get Flexible Redemption Record(USER_DATA) Get Flexible Redemption Record * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 + * Get RWUSD Quota Details (USER_DATA) Get RWUSD quota details including subscription quota, + * fast redemption quota, and standard redemption quota. Weight: 150 * - * @param productId (optional) - * @param redeemId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleRedemptionRecordResponse> + * @return ApiResponse<GetRwusdQuotaDetailsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Redemption Record -
200 Get RWUSD Quota Details -
* * @see Get - * Flexible Redemption Record(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/account/Get-RWUSD-Quota-Details">Get + * RWUSD Quota Details (USER_DATA) Documentation */ - public ApiResponse getFlexibleRedemptionRecord( - String productId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) + public ApiResponse getRwusdQuotaDetails(Long recvWindow) throws ApiException { - return historyApi.getFlexibleRedemptionRecord( - productId, redeemId, asset, startTime, endTime, current, size, recvWindow); + return rwusdApi.getRwusdQuotaDetails(recvWindow); } /** - * Get Flexible Rewards History(USER_DATA) Get Flexible Rewards History * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 + * Get RWUSD Rate History (USER_DATA) Get RWUSD rate history sorted by descending order. * The + * time between `startTime` and `endTime` cannot be longer than 6 months. * + * If `startTime` and `endTime` are both not sent, then the last 30 + * days' data will be returned. * If `startTime` is sent but `endTime` + * is not sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 * - * @param type `Bonus` - Bonus tiered APR, `REALTIME` Real-time APR, - * `REWARDS` Historical rewards,`ALL`(set to default) (required) - * @param productId (optional) - * @param asset (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleRewardsHistoryResponse> + * @return ApiResponse<GetRwusdRateHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Rewards History -
200 Get RWUSD Rate History -
* * @see Get - * Flexible Rewards History(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rate-History">Get + * RWUSD Rate History (USER_DATA) Documentation */ - public ApiResponse getFlexibleRewardsHistory( - String type, - String productId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) + public ApiResponse getRwusdRateHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return historyApi.getFlexibleRewardsHistory( - type, productId, asset, startTime, endTime, current, size, recvWindow); + return rwusdApi.getRwusdRateHistory(startTime, endTime, current, size, recvWindow); } /** - * Get Flexible Subscription Record(USER_DATA) Get Flexible Subscription Record * The time - * between `startTime` and `endTime` cannot be longer than 3 months. * If + * Get RWUSD Redemption History (USER_DATA) Get RWUSD redemption history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If * `startTime` and `endTime` are both not sent, then the last 30 days' * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 * - * @param productId (optional) - * @param purchaseId (optional) - * @param asset (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetFlexibleSubscriptionRecordResponse> + * @return ApiResponse<GetRwusdRedemptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Flexible Subscription Record -
200 Get RWUSD Redemption History -
* * @see Get - * Flexible Subscription Record(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Redemption-History">Get + * RWUSD Redemption History (USER_DATA) Documentation */ - public ApiResponse getFlexibleSubscriptionRecord( - String productId, - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) + public ApiResponse getRwusdRedemptionHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return historyApi.getFlexibleSubscriptionRecord( - productId, purchaseId, asset, startTime, endTime, current, size, recvWindow); + return rwusdApi.getRwusdRedemptionHistory(startTime, endTime, current, size, recvWindow); } /** - * Get Locked Redemption Record(USER_DATA) Get Locked Redemption Record * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If + * Get RWUSD Rewards History (USER_DATA) Get RWUSD rewards history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If * `startTime` and `endTime` are both not sent, then the last 30 days' * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 * - * @param positionId (optional) - * @param redeemId (optional) - * @param asset (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetLockedRedemptionRecordResponse> + * @return ApiResponse<GetRwusdRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Redemption Record -
200 Get RWUSD Rewards History -
* * @see Get - * Locked Redemption Record(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rewards-History">Get + * RWUSD Rewards History (USER_DATA) Documentation */ - public ApiResponse getLockedRedemptionRecord( - String positionId, - String redeemId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) + public ApiResponse getRwusdRewardsHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return historyApi.getLockedRedemptionRecord( - positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); + return rwusdApi.getRwusdRewardsHistory(startTime, endTime, current, size, recvWindow); } /** - * Get Locked Rewards History(USER_DATA) Get Locked Rewards History * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If + * Get RWUSD subscription history(USER_DATA) Get RWUSD subscription history * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If * `startTime` and `endTime` are both not sent, then the last 30 days' * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time + * advanced by one month, and data between `startTime` and `endTime` will be + * returned. Weight: 150 * - * @param positionId (optional) - * @param asset (optional) + * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) * @param current Currently querying the page. Start from 1. Default:1 (optional) * @param size Default:10, Max:100 (optional) * @param recvWindow (optional) - * @return ApiResponse<GetLockedRewardsHistoryResponse> + * @return ApiResponse<GetRwusdSubscriptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Rewards History -
200 Get RWUSD subscription history -
* * @see Get - * Locked Rewards History(USER_DATA) Documentation + * href="https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-subscription-history">Get + * RWUSD subscription history(USER_DATA) Documentation */ - public ApiResponse getLockedRewardsHistory( - String positionId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) + public ApiResponse getRwusdSubscriptionHistory( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) throws ApiException { - return historyApi.getLockedRewardsHistory( - positionId, asset, startTime, endTime, current, size, recvWindow); + return rwusdApi.getRwusdSubscriptionHistory( + asset, startTime, endTime, current, size, recvWindow); } /** - * Get Locked Subscription Record(USER_DATA) Get Locked Subscription Record * The time between - * `startTime` and `endTime` cannot be longer than 3 months. * If - * `startTime` and `endTime` are both not sent, then the last 30 days' - * data will be returned. * If `startTime` is sent but `endTime` is not - * sent, the next 30 days' data beginning from `startTime` will be returned. * If - * `endTime` is sent but `startTime` is not sent, the 30 days' data - * before `endTime` will be returned. Weight: 150 + * Redeem RWUSD(TRADE) Redeem RWUSD to USDC * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 * - * @param purchaseId (optional) - * @param asset (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetLockedSubscriptionRecordResponse> + * @param redeemRwusdRequest (required) + * @return ApiResponse<RedeemRwusdResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Locked Subscription Record -
200 Redeem RWUSD -
* - * @see Get - * Locked Subscription Record(USER_DATA) Documentation + * @see Redeem + * RWUSD(TRADE) Documentation */ - public ApiResponse getLockedSubscriptionRecord( - String purchaseId, - String asset, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) + public ApiResponse redeemRwusd(RedeemRwusdRequest redeemRwusdRequest) throws ApiException { - return historyApi.getLockedSubscriptionRecord( - purchaseId, asset, startTime, endTime, current, size, recvWindow); + return rwusdApi.redeemRwusd(redeemRwusdRequest); } /** - * Get Rate History(USER_DATA) Get Rate History * The time between startTime and endTime cannot - * be longer than 1 year. * If `startTime` and `endTime` are both not sent, - * then the last 30 days' data will be returned. * If `startTime` is sent but - * `endTime` is not sent, the next 30 days' data beginning from - * `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 + * Subscribe RWUSD(TRADE) Subscribe RWUSD * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 * - * @param productId (required) - * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) - * @param startTime (optional) - * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) - * @return ApiResponse<GetRateHistoryResponse> + * @param subscribeRwusdRequest (required) + * @return ApiResponse<SubscribeRwusdResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Get Rate History -
200 Subscribe RWUSD -
* - * @see Get - * Rate History(USER_DATA) Documentation + * @see Subscribe + * RWUSD(TRADE) Documentation */ - public ApiResponse getRateHistory( - String productId, - String aprPeriod, - Long startTime, - Long endTime, - Long current, - Long size, - Long recvWindow) - throws ApiException { - return historyApi.getRateHistory( - productId, aprPeriod, startTime, endTime, current, size, recvWindow); + public ApiResponse subscribeRwusd( + SubscribeRwusdRequest subscribeRwusdRequest) throws ApiException { + return rwusdApi.subscribeRwusd(subscribeRwusdRequest); } } diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdAccountResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdAccountResponse.java new file mode 100644 index 000000000..a24676c8a --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdAccountResponse.java @@ -0,0 +1,251 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdAccountResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdAccountResponse { + public static final String SERIALIZED_NAME_RWUSD_AMOUNT = "rwusdAmount"; + + @SerializedName(SERIALIZED_NAME_RWUSD_AMOUNT) + @jakarta.annotation.Nullable + private String rwusdAmount; + + public static final String SERIALIZED_NAME_TOTAL_PROFIT = "totalProfit"; + + @SerializedName(SERIALIZED_NAME_TOTAL_PROFIT) + @jakarta.annotation.Nullable + private String totalProfit; + + public GetRwusdAccountResponse() {} + + public GetRwusdAccountResponse rwusdAmount(@jakarta.annotation.Nullable String rwusdAmount) { + this.rwusdAmount = rwusdAmount; + return this; + } + + /** + * Get rwusdAmount + * + * @return rwusdAmount + */ + @jakarta.annotation.Nullable + public String getRwusdAmount() { + return rwusdAmount; + } + + public void setRwusdAmount(@jakarta.annotation.Nullable String rwusdAmount) { + this.rwusdAmount = rwusdAmount; + } + + public GetRwusdAccountResponse totalProfit(@jakarta.annotation.Nullable String totalProfit) { + this.totalProfit = totalProfit; + return this; + } + + /** + * Get totalProfit + * + * @return totalProfit + */ + @jakarta.annotation.Nullable + public String getTotalProfit() { + return totalProfit; + } + + public void setTotalProfit(@jakarta.annotation.Nullable String totalProfit) { + this.totalProfit = totalProfit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdAccountResponse getRwusdAccountResponse = (GetRwusdAccountResponse) o; + return Objects.equals(this.rwusdAmount, getRwusdAccountResponse.rwusdAmount) + && Objects.equals(this.totalProfit, getRwusdAccountResponse.totalProfit); + } + + @Override + public int hashCode() { + return Objects.hash(rwusdAmount, totalProfit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdAccountResponse {\n"); + sb.append(" rwusdAmount: ").append(toIndentedString(rwusdAmount)).append("\n"); + sb.append(" totalProfit: ").append(toIndentedString(totalProfit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rwusdAmountValue = getRwusdAmount(); + String rwusdAmountValueAsString = ""; + rwusdAmountValueAsString = rwusdAmountValue.toString(); + sb.append("rwusdAmount=").append(urlEncode(rwusdAmountValueAsString)).append(""); + Object totalProfitValue = getTotalProfit(); + String totalProfitValueAsString = ""; + totalProfitValueAsString = totalProfitValue.toString(); + sb.append("totalProfit=").append(urlEncode(totalProfitValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rwusdAmount"); + openapiFields.add("totalProfit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetRwusdAccountResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdAccountResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwusdAccountResponse is not found" + + " in the empty JSON string", + GetRwusdAccountResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rwusdAmount") != null && !jsonObj.get("rwusdAmount").isJsonNull()) + && !jsonObj.get("rwusdAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rwusdAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rwusdAmount").toString())); + } + if ((jsonObj.get("totalProfit") != null && !jsonObj.get("totalProfit").isJsonNull()) + && !jsonObj.get("totalProfit").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalProfit` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("totalProfit").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdAccountResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwusdAccountResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetRwusdAccountResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwusdAccountResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdAccountResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdAccountResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdAccountResponse + * @throws IOException if the JSON string is invalid with respect to GetRwusdAccountResponse + */ + public static GetRwusdAccountResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdAccountResponse.class); + } + + /** + * Convert an instance of GetRwusdAccountResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponse.java new file mode 100644 index 000000000..2c34d4d3b --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponse.java @@ -0,0 +1,392 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdQuotaDetailsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdQuotaDetailsResponse { + public static final String SERIALIZED_NAME_SUBSCRIPTION_QUOTA = "subscriptionQuota"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_QUOTA) + @jakarta.annotation.Nullable + private GetRwusdQuotaDetailsResponseSubscriptionQuota subscriptionQuota; + + public static final String SERIALIZED_NAME_FAST_REDEMPTION_QUOTA = "fastRedemptionQuota"; + + @SerializedName(SERIALIZED_NAME_FAST_REDEMPTION_QUOTA) + @jakarta.annotation.Nullable + private GetRwusdQuotaDetailsResponseFastRedemptionQuota fastRedemptionQuota; + + public static final String SERIALIZED_NAME_STANDARD_REDEMPTION_QUOTA = + "standardRedemptionQuota"; + + @SerializedName(SERIALIZED_NAME_STANDARD_REDEMPTION_QUOTA) + @jakarta.annotation.Nullable + private GetRwusdQuotaDetailsResponseStandardRedemptionQuota standardRedemptionQuota; + + public static final String SERIALIZED_NAME_SUBSCRIBE_ENABLE = "subscribeEnable"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIBE_ENABLE) + @jakarta.annotation.Nullable + private Boolean subscribeEnable; + + public static final String SERIALIZED_NAME_REDEEM_ENABLE = "redeemEnable"; + + @SerializedName(SERIALIZED_NAME_REDEEM_ENABLE) + @jakarta.annotation.Nullable + private Boolean redeemEnable; + + public GetRwusdQuotaDetailsResponse() {} + + public GetRwusdQuotaDetailsResponse subscriptionQuota( + @jakarta.annotation.Nullable + GetRwusdQuotaDetailsResponseSubscriptionQuota subscriptionQuota) { + this.subscriptionQuota = subscriptionQuota; + return this; + } + + /** + * Get subscriptionQuota + * + * @return subscriptionQuota + */ + @jakarta.annotation.Nullable + @Valid + public GetRwusdQuotaDetailsResponseSubscriptionQuota getSubscriptionQuota() { + return subscriptionQuota; + } + + public void setSubscriptionQuota( + @jakarta.annotation.Nullable + GetRwusdQuotaDetailsResponseSubscriptionQuota subscriptionQuota) { + this.subscriptionQuota = subscriptionQuota; + } + + public GetRwusdQuotaDetailsResponse fastRedemptionQuota( + @jakarta.annotation.Nullable + GetRwusdQuotaDetailsResponseFastRedemptionQuota fastRedemptionQuota) { + this.fastRedemptionQuota = fastRedemptionQuota; + return this; + } + + /** + * Get fastRedemptionQuota + * + * @return fastRedemptionQuota + */ + @jakarta.annotation.Nullable + @Valid + public GetRwusdQuotaDetailsResponseFastRedemptionQuota getFastRedemptionQuota() { + return fastRedemptionQuota; + } + + public void setFastRedemptionQuota( + @jakarta.annotation.Nullable + GetRwusdQuotaDetailsResponseFastRedemptionQuota fastRedemptionQuota) { + this.fastRedemptionQuota = fastRedemptionQuota; + } + + public GetRwusdQuotaDetailsResponse standardRedemptionQuota( + @jakarta.annotation.Nullable + GetRwusdQuotaDetailsResponseStandardRedemptionQuota standardRedemptionQuota) { + this.standardRedemptionQuota = standardRedemptionQuota; + return this; + } + + /** + * Get standardRedemptionQuota + * + * @return standardRedemptionQuota + */ + @jakarta.annotation.Nullable + @Valid + public GetRwusdQuotaDetailsResponseStandardRedemptionQuota getStandardRedemptionQuota() { + return standardRedemptionQuota; + } + + public void setStandardRedemptionQuota( + @jakarta.annotation.Nullable + GetRwusdQuotaDetailsResponseStandardRedemptionQuota standardRedemptionQuota) { + this.standardRedemptionQuota = standardRedemptionQuota; + } + + public GetRwusdQuotaDetailsResponse subscribeEnable( + @jakarta.annotation.Nullable Boolean subscribeEnable) { + this.subscribeEnable = subscribeEnable; + return this; + } + + /** + * Get subscribeEnable + * + * @return subscribeEnable + */ + @jakarta.annotation.Nullable + public Boolean getSubscribeEnable() { + return subscribeEnable; + } + + public void setSubscribeEnable(@jakarta.annotation.Nullable Boolean subscribeEnable) { + this.subscribeEnable = subscribeEnable; + } + + public GetRwusdQuotaDetailsResponse redeemEnable( + @jakarta.annotation.Nullable Boolean redeemEnable) { + this.redeemEnable = redeemEnable; + return this; + } + + /** + * Get redeemEnable + * + * @return redeemEnable + */ + @jakarta.annotation.Nullable + public Boolean getRedeemEnable() { + return redeemEnable; + } + + public void setRedeemEnable(@jakarta.annotation.Nullable Boolean redeemEnable) { + this.redeemEnable = redeemEnable; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdQuotaDetailsResponse getRwusdQuotaDetailsResponse = + (GetRwusdQuotaDetailsResponse) o; + return Objects.equals( + this.subscriptionQuota, getRwusdQuotaDetailsResponse.subscriptionQuota) + && Objects.equals( + this.fastRedemptionQuota, getRwusdQuotaDetailsResponse.fastRedemptionQuota) + && Objects.equals( + this.standardRedemptionQuota, + getRwusdQuotaDetailsResponse.standardRedemptionQuota) + && Objects.equals( + this.subscribeEnable, getRwusdQuotaDetailsResponse.subscribeEnable) + && Objects.equals(this.redeemEnable, getRwusdQuotaDetailsResponse.redeemEnable); + } + + @Override + public int hashCode() { + return Objects.hash( + subscriptionQuota, + fastRedemptionQuota, + standardRedemptionQuota, + subscribeEnable, + redeemEnable); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdQuotaDetailsResponse {\n"); + sb.append(" subscriptionQuota: ").append(toIndentedString(subscriptionQuota)).append("\n"); + sb.append(" fastRedemptionQuota: ") + .append(toIndentedString(fastRedemptionQuota)) + .append("\n"); + sb.append(" standardRedemptionQuota: ") + .append(toIndentedString(standardRedemptionQuota)) + .append("\n"); + sb.append(" subscribeEnable: ").append(toIndentedString(subscribeEnable)).append("\n"); + sb.append(" redeemEnable: ").append(toIndentedString(redeemEnable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object subscriptionQuotaValue = getSubscriptionQuota(); + String subscriptionQuotaValueAsString = ""; + subscriptionQuotaValueAsString = subscriptionQuotaValue.toString(); + sb.append("subscriptionQuota=") + .append(urlEncode(subscriptionQuotaValueAsString)) + .append(""); + Object fastRedemptionQuotaValue = getFastRedemptionQuota(); + String fastRedemptionQuotaValueAsString = ""; + fastRedemptionQuotaValueAsString = fastRedemptionQuotaValue.toString(); + sb.append("fastRedemptionQuota=") + .append(urlEncode(fastRedemptionQuotaValueAsString)) + .append(""); + Object standardRedemptionQuotaValue = getStandardRedemptionQuota(); + String standardRedemptionQuotaValueAsString = ""; + standardRedemptionQuotaValueAsString = standardRedemptionQuotaValue.toString(); + sb.append("standardRedemptionQuota=") + .append(urlEncode(standardRedemptionQuotaValueAsString)) + .append(""); + Object subscribeEnableValue = getSubscribeEnable(); + String subscribeEnableValueAsString = ""; + subscribeEnableValueAsString = subscribeEnableValue.toString(); + sb.append("subscribeEnable=").append(urlEncode(subscribeEnableValueAsString)).append(""); + Object redeemEnableValue = getRedeemEnable(); + String redeemEnableValueAsString = ""; + redeemEnableValueAsString = redeemEnableValue.toString(); + sb.append("redeemEnable=").append(urlEncode(redeemEnableValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscriptionQuota"); + openapiFields.add("fastRedemptionQuota"); + openapiFields.add("standardRedemptionQuota"); + openapiFields.add("subscribeEnable"); + openapiFields.add("redeemEnable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdQuotaDetailsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdQuotaDetailsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwusdQuotaDetailsResponse is not" + + " found in the empty JSON string", + GetRwusdQuotaDetailsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `subscriptionQuota` + if (jsonObj.get("subscriptionQuota") != null + && !jsonObj.get("subscriptionQuota").isJsonNull()) { + GetRwusdQuotaDetailsResponseSubscriptionQuota.validateJsonElement( + jsonObj.get("subscriptionQuota")); + } + // validate the optional field `fastRedemptionQuota` + if (jsonObj.get("fastRedemptionQuota") != null + && !jsonObj.get("fastRedemptionQuota").isJsonNull()) { + GetRwusdQuotaDetailsResponseFastRedemptionQuota.validateJsonElement( + jsonObj.get("fastRedemptionQuota")); + } + // validate the optional field `standardRedemptionQuota` + if (jsonObj.get("standardRedemptionQuota") != null + && !jsonObj.get("standardRedemptionQuota").isJsonNull()) { + GetRwusdQuotaDetailsResponseStandardRedemptionQuota.validateJsonElement( + jsonObj.get("standardRedemptionQuota")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdQuotaDetailsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwusdQuotaDetailsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwusdQuotaDetailsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwusdQuotaDetailsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdQuotaDetailsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdQuotaDetailsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdQuotaDetailsResponse + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdQuotaDetailsResponse + */ + public static GetRwusdQuotaDetailsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdQuotaDetailsResponse.class); + } + + /** + * Convert an instance of GetRwusdQuotaDetailsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseFastRedemptionQuota.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseFastRedemptionQuota.java new file mode 100644 index 000000000..99bd1c587 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseFastRedemptionQuota.java @@ -0,0 +1,353 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdQuotaDetailsResponseFastRedemptionQuota */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdQuotaDetailsResponseFastRedemptionQuota { + public static final String SERIALIZED_NAME_LEFT_QUOTA = "leftQuota"; + + @SerializedName(SERIALIZED_NAME_LEFT_QUOTA) + @jakarta.annotation.Nullable + private String leftQuota; + + public static final String SERIALIZED_NAME_MINIMUM = "minimum"; + + @SerializedName(SERIALIZED_NAME_MINIMUM) + @jakarta.annotation.Nullable + private String minimum; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_FREE_QUOTA = "freeQuota"; + + @SerializedName(SERIALIZED_NAME_FREE_QUOTA) + @jakarta.annotation.Nullable + private String freeQuota; + + public GetRwusdQuotaDetailsResponseFastRedemptionQuota() {} + + public GetRwusdQuotaDetailsResponseFastRedemptionQuota leftQuota( + @jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + return this; + } + + /** + * Get leftQuota + * + * @return leftQuota + */ + @jakarta.annotation.Nullable + public String getLeftQuota() { + return leftQuota; + } + + public void setLeftQuota(@jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + } + + public GetRwusdQuotaDetailsResponseFastRedemptionQuota minimum( + @jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get minimum + * + * @return minimum + */ + @jakarta.annotation.Nullable + public String getMinimum() { + return minimum; + } + + public void setMinimum(@jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + } + + public GetRwusdQuotaDetailsResponseFastRedemptionQuota fee( + @jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public GetRwusdQuotaDetailsResponseFastRedemptionQuota freeQuota( + @jakarta.annotation.Nullable String freeQuota) { + this.freeQuota = freeQuota; + return this; + } + + /** + * Get freeQuota + * + * @return freeQuota + */ + @jakarta.annotation.Nullable + public String getFreeQuota() { + return freeQuota; + } + + public void setFreeQuota(@jakarta.annotation.Nullable String freeQuota) { + this.freeQuota = freeQuota; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdQuotaDetailsResponseFastRedemptionQuota + getRwusdQuotaDetailsResponseFastRedemptionQuota = + (GetRwusdQuotaDetailsResponseFastRedemptionQuota) o; + return Objects.equals( + this.leftQuota, getRwusdQuotaDetailsResponseFastRedemptionQuota.leftQuota) + && Objects.equals( + this.minimum, getRwusdQuotaDetailsResponseFastRedemptionQuota.minimum) + && Objects.equals(this.fee, getRwusdQuotaDetailsResponseFastRedemptionQuota.fee) + && Objects.equals( + this.freeQuota, getRwusdQuotaDetailsResponseFastRedemptionQuota.freeQuota); + } + + @Override + public int hashCode() { + return Objects.hash(leftQuota, minimum, fee, freeQuota); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdQuotaDetailsResponseFastRedemptionQuota {\n"); + sb.append(" leftQuota: ").append(toIndentedString(leftQuota)).append("\n"); + sb.append(" minimum: ").append(toIndentedString(minimum)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" freeQuota: ").append(toIndentedString(freeQuota)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object leftQuotaValue = getLeftQuota(); + String leftQuotaValueAsString = ""; + leftQuotaValueAsString = leftQuotaValue.toString(); + sb.append("leftQuota=").append(urlEncode(leftQuotaValueAsString)).append(""); + Object minimumValue = getMinimum(); + String minimumValueAsString = ""; + minimumValueAsString = minimumValue.toString(); + sb.append("minimum=").append(urlEncode(minimumValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object freeQuotaValue = getFreeQuota(); + String freeQuotaValueAsString = ""; + freeQuotaValueAsString = freeQuotaValue.toString(); + sb.append("freeQuota=").append(urlEncode(freeQuotaValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("leftQuota"); + openapiFields.add("minimum"); + openapiFields.add("fee"); + openapiFields.add("freeQuota"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdQuotaDetailsResponseFastRedemptionQuota + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdQuotaDetailsResponseFastRedemptionQuota.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwusdQuotaDetailsResponseFastRedemptionQuota is not" + + " found in the empty JSON string", + GetRwusdQuotaDetailsResponseFastRedemptionQuota + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("leftQuota") != null && !jsonObj.get("leftQuota").isJsonNull()) + && !jsonObj.get("leftQuota").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `leftQuota` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("leftQuota").toString())); + } + if ((jsonObj.get("minimum") != null && !jsonObj.get("minimum").isJsonNull()) + && !jsonObj.get("minimum").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minimum` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minimum").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + if ((jsonObj.get("freeQuota") != null && !jsonObj.get("freeQuota").isJsonNull()) + && !jsonObj.get("freeQuota").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `freeQuota` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("freeQuota").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdQuotaDetailsResponseFastRedemptionQuota.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwusdQuotaDetailsResponseFastRedemptionQuota' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetRwusdQuotaDetailsResponseFastRedemptionQuota.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetRwusdQuotaDetailsResponseFastRedemptionQuota value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdQuotaDetailsResponseFastRedemptionQuota read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdQuotaDetailsResponseFastRedemptionQuota given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdQuotaDetailsResponseFastRedemptionQuota + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdQuotaDetailsResponseFastRedemptionQuota + */ + public static GetRwusdQuotaDetailsResponseFastRedemptionQuota fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwusdQuotaDetailsResponseFastRedemptionQuota.class); + } + + /** + * Convert an instance of GetRwusdQuotaDetailsResponseFastRedemptionQuota to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.java new file mode 100644 index 000000000..718602d93 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseStandardRedemptionQuota.java @@ -0,0 +1,350 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdQuotaDetailsResponseStandardRedemptionQuota */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdQuotaDetailsResponseStandardRedemptionQuota { + public static final String SERIALIZED_NAME_LEFT_QUOTA = "leftQuota"; + + @SerializedName(SERIALIZED_NAME_LEFT_QUOTA) + @jakarta.annotation.Nullable + private String leftQuota; + + public static final String SERIALIZED_NAME_MINIMUM = "minimum"; + + @SerializedName(SERIALIZED_NAME_MINIMUM) + @jakarta.annotation.Nullable + private String minimum; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_REDEEM_PERIOD = "redeemPeriod"; + + @SerializedName(SERIALIZED_NAME_REDEEM_PERIOD) + @jakarta.annotation.Nullable + private Long redeemPeriod; + + public GetRwusdQuotaDetailsResponseStandardRedemptionQuota() {} + + public GetRwusdQuotaDetailsResponseStandardRedemptionQuota leftQuota( + @jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + return this; + } + + /** + * Get leftQuota + * + * @return leftQuota + */ + @jakarta.annotation.Nullable + public String getLeftQuota() { + return leftQuota; + } + + public void setLeftQuota(@jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + } + + public GetRwusdQuotaDetailsResponseStandardRedemptionQuota minimum( + @jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get minimum + * + * @return minimum + */ + @jakarta.annotation.Nullable + public String getMinimum() { + return minimum; + } + + public void setMinimum(@jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + } + + public GetRwusdQuotaDetailsResponseStandardRedemptionQuota fee( + @jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public GetRwusdQuotaDetailsResponseStandardRedemptionQuota redeemPeriod( + @jakarta.annotation.Nullable Long redeemPeriod) { + this.redeemPeriod = redeemPeriod; + return this; + } + + /** + * Get redeemPeriod + * + * @return redeemPeriod + */ + @jakarta.annotation.Nullable + public Long getRedeemPeriod() { + return redeemPeriod; + } + + public void setRedeemPeriod(@jakarta.annotation.Nullable Long redeemPeriod) { + this.redeemPeriod = redeemPeriod; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdQuotaDetailsResponseStandardRedemptionQuota + getRwusdQuotaDetailsResponseStandardRedemptionQuota = + (GetRwusdQuotaDetailsResponseStandardRedemptionQuota) o; + return Objects.equals( + this.leftQuota, + getRwusdQuotaDetailsResponseStandardRedemptionQuota.leftQuota) + && Objects.equals( + this.minimum, getRwusdQuotaDetailsResponseStandardRedemptionQuota.minimum) + && Objects.equals(this.fee, getRwusdQuotaDetailsResponseStandardRedemptionQuota.fee) + && Objects.equals( + this.redeemPeriod, + getRwusdQuotaDetailsResponseStandardRedemptionQuota.redeemPeriod); + } + + @Override + public int hashCode() { + return Objects.hash(leftQuota, minimum, fee, redeemPeriod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdQuotaDetailsResponseStandardRedemptionQuota {\n"); + sb.append(" leftQuota: ").append(toIndentedString(leftQuota)).append("\n"); + sb.append(" minimum: ").append(toIndentedString(minimum)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" redeemPeriod: ").append(toIndentedString(redeemPeriod)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object leftQuotaValue = getLeftQuota(); + String leftQuotaValueAsString = ""; + leftQuotaValueAsString = leftQuotaValue.toString(); + sb.append("leftQuota=").append(urlEncode(leftQuotaValueAsString)).append(""); + Object minimumValue = getMinimum(); + String minimumValueAsString = ""; + minimumValueAsString = minimumValue.toString(); + sb.append("minimum=").append(urlEncode(minimumValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object redeemPeriodValue = getRedeemPeriod(); + String redeemPeriodValueAsString = ""; + redeemPeriodValueAsString = redeemPeriodValue.toString(); + sb.append("redeemPeriod=").append(urlEncode(redeemPeriodValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("leftQuota"); + openapiFields.add("minimum"); + openapiFields.add("fee"); + openapiFields.add("redeemPeriod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdQuotaDetailsResponseStandardRedemptionQuota + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdQuotaDetailsResponseStandardRedemptionQuota.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwusdQuotaDetailsResponseStandardRedemptionQuota is not" + + " found in the empty JSON string", + GetRwusdQuotaDetailsResponseStandardRedemptionQuota + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("leftQuota") != null && !jsonObj.get("leftQuota").isJsonNull()) + && !jsonObj.get("leftQuota").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `leftQuota` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("leftQuota").toString())); + } + if ((jsonObj.get("minimum") != null && !jsonObj.get("minimum").isJsonNull()) + && !jsonObj.get("minimum").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minimum` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minimum").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdQuotaDetailsResponseStandardRedemptionQuota.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwusdQuotaDetailsResponseStandardRedemptionQuota' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetRwusdQuotaDetailsResponseStandardRedemptionQuota.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetRwusdQuotaDetailsResponseStandardRedemptionQuota value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdQuotaDetailsResponseStandardRedemptionQuota read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdQuotaDetailsResponseStandardRedemptionQuota given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of GetRwusdQuotaDetailsResponseStandardRedemptionQuota + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdQuotaDetailsResponseStandardRedemptionQuota + */ + public static GetRwusdQuotaDetailsResponseStandardRedemptionQuota fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwusdQuotaDetailsResponseStandardRedemptionQuota.class); + } + + /** + * Convert an instance of GetRwusdQuotaDetailsResponseStandardRedemptionQuota to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseSubscriptionQuota.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseSubscriptionQuota.java new file mode 100644 index 000000000..933ee0e03 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdQuotaDetailsResponseSubscriptionQuota.java @@ -0,0 +1,326 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetRwusdQuotaDetailsResponseSubscriptionQuota */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdQuotaDetailsResponseSubscriptionQuota { + public static final String SERIALIZED_NAME_ASSETS = "assets"; + + @SerializedName(SERIALIZED_NAME_ASSETS) + @jakarta.annotation.Nullable + private List assets; + + public static final String SERIALIZED_NAME_LEFT_QUOTA = "leftQuota"; + + @SerializedName(SERIALIZED_NAME_LEFT_QUOTA) + @jakarta.annotation.Nullable + private String leftQuota; + + public static final String SERIALIZED_NAME_MINIMUM = "minimum"; + + @SerializedName(SERIALIZED_NAME_MINIMUM) + @jakarta.annotation.Nullable + private String minimum; + + public GetRwusdQuotaDetailsResponseSubscriptionQuota() {} + + public GetRwusdQuotaDetailsResponseSubscriptionQuota assets( + @jakarta.annotation.Nullable List assets) { + this.assets = assets; + return this; + } + + public GetRwusdQuotaDetailsResponseSubscriptionQuota addAssetsItem(String assetsItem) { + if (this.assets == null) { + this.assets = new ArrayList<>(); + } + this.assets.add(assetsItem); + return this; + } + + /** + * Get assets + * + * @return assets + */ + @jakarta.annotation.Nullable + public List getAssets() { + return assets; + } + + public void setAssets(@jakarta.annotation.Nullable List assets) { + this.assets = assets; + } + + public GetRwusdQuotaDetailsResponseSubscriptionQuota leftQuota( + @jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + return this; + } + + /** + * Get leftQuota + * + * @return leftQuota + */ + @jakarta.annotation.Nullable + public String getLeftQuota() { + return leftQuota; + } + + public void setLeftQuota(@jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + } + + public GetRwusdQuotaDetailsResponseSubscriptionQuota minimum( + @jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get minimum + * + * @return minimum + */ + @jakarta.annotation.Nullable + public String getMinimum() { + return minimum; + } + + public void setMinimum(@jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdQuotaDetailsResponseSubscriptionQuota + getRwusdQuotaDetailsResponseSubscriptionQuota = + (GetRwusdQuotaDetailsResponseSubscriptionQuota) o; + return Objects.equals(this.assets, getRwusdQuotaDetailsResponseSubscriptionQuota.assets) + && Objects.equals( + this.leftQuota, getRwusdQuotaDetailsResponseSubscriptionQuota.leftQuota) + && Objects.equals( + this.minimum, getRwusdQuotaDetailsResponseSubscriptionQuota.minimum); + } + + @Override + public int hashCode() { + return Objects.hash(assets, leftQuota, minimum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdQuotaDetailsResponseSubscriptionQuota {\n"); + sb.append(" assets: ").append(toIndentedString(assets)).append("\n"); + sb.append(" leftQuota: ").append(toIndentedString(leftQuota)).append("\n"); + sb.append(" minimum: ").append(toIndentedString(minimum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetsValue = getAssets(); + String assetsValueAsString = ""; + assetsValueAsString = + (String) + ((Collection) assetsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("assets=").append(urlEncode(assetsValueAsString)).append(""); + Object leftQuotaValue = getLeftQuota(); + String leftQuotaValueAsString = ""; + leftQuotaValueAsString = leftQuotaValue.toString(); + sb.append("leftQuota=").append(urlEncode(leftQuotaValueAsString)).append(""); + Object minimumValue = getMinimum(); + String minimumValueAsString = ""; + minimumValueAsString = minimumValue.toString(); + sb.append("minimum=").append(urlEncode(minimumValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assets"); + openapiFields.add("leftQuota"); + openapiFields.add("minimum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdQuotaDetailsResponseSubscriptionQuota + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdQuotaDetailsResponseSubscriptionQuota.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwusdQuotaDetailsResponseSubscriptionQuota is not found" + + " in the empty JSON string", + GetRwusdQuotaDetailsResponseSubscriptionQuota.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("assets") != null + && !jsonObj.get("assets").isJsonNull() + && !jsonObj.get("assets").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `assets` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("assets").toString())); + } + if ((jsonObj.get("leftQuota") != null && !jsonObj.get("leftQuota").isJsonNull()) + && !jsonObj.get("leftQuota").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `leftQuota` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("leftQuota").toString())); + } + if ((jsonObj.get("minimum") != null && !jsonObj.get("minimum").isJsonNull()) + && !jsonObj.get("minimum").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minimum` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minimum").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdQuotaDetailsResponseSubscriptionQuota.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwusdQuotaDetailsResponseSubscriptionQuota' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetRwusdQuotaDetailsResponseSubscriptionQuota.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwusdQuotaDetailsResponseSubscriptionQuota value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdQuotaDetailsResponseSubscriptionQuota read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdQuotaDetailsResponseSubscriptionQuota given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdQuotaDetailsResponseSubscriptionQuota + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdQuotaDetailsResponseSubscriptionQuota + */ + public static GetRwusdQuotaDetailsResponseSubscriptionQuota fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwusdQuotaDetailsResponseSubscriptionQuota.class); + } + + /** + * Convert an instance of GetRwusdQuotaDetailsResponseSubscriptionQuota to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java new file mode 100644 index 000000000..7642e2ca0 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java @@ -0,0 +1,283 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetRwusdRateHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdRateHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetRwusdRateHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private String total; + + public GetRwusdRateHistoryResponse() {} + + public GetRwusdRateHistoryResponse rows( + @jakarta.annotation.Nullable List<@Valid GetRwusdRateHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetRwusdRateHistoryResponse addRowsItem(GetRwusdRateHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwusdRateHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable List<@Valid GetRwusdRateHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetRwusdRateHistoryResponse total(@jakarta.annotation.Nullable String total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public String getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable String total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdRateHistoryResponse getRwusdRateHistoryResponse = (GetRwusdRateHistoryResponse) o; + return Objects.equals(this.rows, getRwusdRateHistoryResponse.rows) + && Objects.equals(this.total, getRwusdRateHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdRateHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdRateHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdRateHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwusdRateHistoryResponse is not" + + " found in the empty JSON string", + GetRwusdRateHistoryResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetRwusdRateHistoryResponseRowsInner.validateJsonElement(jsonArrayrows.get(i)); + } + ; + } + } + if ((jsonObj.get("total") != null && !jsonObj.get("total").isJsonNull()) + && !jsonObj.get("total").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `total` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("total").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdRateHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwusdRateHistoryResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetRwusdRateHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwusdRateHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdRateHistoryResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdRateHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdRateHistoryResponse + * @throws IOException if the JSON string is invalid with respect to GetRwusdRateHistoryResponse + */ + public static GetRwusdRateHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdRateHistoryResponse.class); + } + + /** + * Convert an instance of GetRwusdRateHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponseRowsInner.java new file mode 100644 index 000000000..a4d8a8696 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponseRowsInner.java @@ -0,0 +1,259 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdRateHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdRateHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE = "annualPercentageRate"; + + @SerializedName(SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE) + @jakarta.annotation.Nullable + private String annualPercentageRate; + + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public GetRwusdRateHistoryResponseRowsInner() {} + + public GetRwusdRateHistoryResponseRowsInner annualPercentageRate( + @jakarta.annotation.Nullable String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + return this; + } + + /** + * Get annualPercentageRate + * + * @return annualPercentageRate + */ + @jakarta.annotation.Nullable + public String getAnnualPercentageRate() { + return annualPercentageRate; + } + + public void setAnnualPercentageRate(@jakarta.annotation.Nullable String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + } + + public GetRwusdRateHistoryResponseRowsInner time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdRateHistoryResponseRowsInner getRwusdRateHistoryResponseRowsInner = + (GetRwusdRateHistoryResponseRowsInner) o; + return Objects.equals( + this.annualPercentageRate, + getRwusdRateHistoryResponseRowsInner.annualPercentageRate) + && Objects.equals(this.time, getRwusdRateHistoryResponseRowsInner.time); + } + + @Override + public int hashCode() { + return Objects.hash(annualPercentageRate, time); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdRateHistoryResponseRowsInner {\n"); + sb.append(" annualPercentageRate: ") + .append(toIndentedString(annualPercentageRate)) + .append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object annualPercentageRateValue = getAnnualPercentageRate(); + String annualPercentageRateValueAsString = ""; + annualPercentageRateValueAsString = annualPercentageRateValue.toString(); + sb.append("annualPercentageRate=") + .append(urlEncode(annualPercentageRateValueAsString)) + .append(""); + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("annualPercentageRate"); + openapiFields.add("time"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdRateHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdRateHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwusdRateHistoryResponseRowsInner" + + " is not found in the empty JSON string", + GetRwusdRateHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("annualPercentageRate") != null + && !jsonObj.get("annualPercentageRate").isJsonNull()) + && !jsonObj.get("annualPercentageRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `annualPercentageRate` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("annualPercentageRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdRateHistoryResponseRowsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwusdRateHistoryResponseRowsInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwusdRateHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwusdRateHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdRateHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdRateHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdRateHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdRateHistoryResponseRowsInner + */ + public static GetRwusdRateHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdRateHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetRwusdRateHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponse.java new file mode 100644 index 000000000..862c66a51 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponse.java @@ -0,0 +1,284 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetRwusdRedemptionHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdRedemptionHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetRwusdRedemptionHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetRwusdRedemptionHistoryResponse() {} + + public GetRwusdRedemptionHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetRwusdRedemptionHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetRwusdRedemptionHistoryResponse addRowsItem( + GetRwusdRedemptionHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwusdRedemptionHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetRwusdRedemptionHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetRwusdRedemptionHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdRedemptionHistoryResponse getRwusdRedemptionHistoryResponse = + (GetRwusdRedemptionHistoryResponse) o; + return Objects.equals(this.rows, getRwusdRedemptionHistoryResponse.rows) + && Objects.equals(this.total, getRwusdRedemptionHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdRedemptionHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdRedemptionHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdRedemptionHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwusdRedemptionHistoryResponse is" + + " not found in the empty JSON string", + GetRwusdRedemptionHistoryResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetRwusdRedemptionHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdRedemptionHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwusdRedemptionHistoryResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwusdRedemptionHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwusdRedemptionHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdRedemptionHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdRedemptionHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdRedemptionHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdRedemptionHistoryResponse + */ + public static GetRwusdRedemptionHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdRedemptionHistoryResponse.class); + } + + /** + * Convert an instance of GetRwusdRedemptionHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponseRowsInner.java new file mode 100644 index 000000000..bcbc879b7 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRedemptionHistoryResponseRowsInner.java @@ -0,0 +1,497 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdRedemptionHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdRedemptionHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_RECEIVE_ASSET = "receiveAsset"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_ASSET) + @jakarta.annotation.Nullable + private String receiveAsset; + + public static final String SERIALIZED_NAME_RECEIVE_AMOUNT = "receiveAmount"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_AMOUNT) + @jakarta.annotation.Nullable + private String receiveAmount; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_ARRIVAL_TIME = "arrivalTime"; + + @SerializedName(SERIALIZED_NAME_ARRIVAL_TIME) + @jakarta.annotation.Nullable + private Long arrivalTime; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public GetRwusdRedemptionHistoryResponseRowsInner() {} + + public GetRwusdRedemptionHistoryResponseRowsInner time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public GetRwusdRedemptionHistoryResponseRowsInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetRwusdRedemptionHistoryResponseRowsInner amount( + @jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public GetRwusdRedemptionHistoryResponseRowsInner receiveAsset( + @jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + return this; + } + + /** + * Get receiveAsset + * + * @return receiveAsset + */ + @jakarta.annotation.Nullable + public String getReceiveAsset() { + return receiveAsset; + } + + public void setReceiveAsset(@jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + } + + public GetRwusdRedemptionHistoryResponseRowsInner receiveAmount( + @jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + return this; + } + + /** + * Get receiveAmount + * + * @return receiveAmount + */ + @jakarta.annotation.Nullable + public String getReceiveAmount() { + return receiveAmount; + } + + public void setReceiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + } + + public GetRwusdRedemptionHistoryResponseRowsInner fee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public GetRwusdRedemptionHistoryResponseRowsInner arrivalTime( + @jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + return this; + } + + /** + * Get arrivalTime + * + * @return arrivalTime + */ + @jakarta.annotation.Nullable + public Long getArrivalTime() { + return arrivalTime; + } + + public void setArrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + } + + public GetRwusdRedemptionHistoryResponseRowsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdRedemptionHistoryResponseRowsInner getRwusdRedemptionHistoryResponseRowsInner = + (GetRwusdRedemptionHistoryResponseRowsInner) o; + return Objects.equals(this.time, getRwusdRedemptionHistoryResponseRowsInner.time) + && Objects.equals(this.asset, getRwusdRedemptionHistoryResponseRowsInner.asset) + && Objects.equals(this.amount, getRwusdRedemptionHistoryResponseRowsInner.amount) + && Objects.equals( + this.receiveAsset, getRwusdRedemptionHistoryResponseRowsInner.receiveAsset) + && Objects.equals( + this.receiveAmount, + getRwusdRedemptionHistoryResponseRowsInner.receiveAmount) + && Objects.equals(this.fee, getRwusdRedemptionHistoryResponseRowsInner.fee) + && Objects.equals( + this.arrivalTime, getRwusdRedemptionHistoryResponseRowsInner.arrivalTime) + && Objects.equals(this.status, getRwusdRedemptionHistoryResponseRowsInner.status); + } + + @Override + public int hashCode() { + return Objects.hash( + time, asset, amount, receiveAsset, receiveAmount, fee, arrivalTime, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdRedemptionHistoryResponseRowsInner {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" receiveAsset: ").append(toIndentedString(receiveAsset)).append("\n"); + sb.append(" receiveAmount: ").append(toIndentedString(receiveAmount)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" arrivalTime: ").append(toIndentedString(arrivalTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object receiveAssetValue = getReceiveAsset(); + String receiveAssetValueAsString = ""; + receiveAssetValueAsString = receiveAssetValue.toString(); + sb.append("receiveAsset=").append(urlEncode(receiveAssetValueAsString)).append(""); + Object receiveAmountValue = getReceiveAmount(); + String receiveAmountValueAsString = ""; + receiveAmountValueAsString = receiveAmountValue.toString(); + sb.append("receiveAmount=").append(urlEncode(receiveAmountValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object arrivalTimeValue = getArrivalTime(); + String arrivalTimeValueAsString = ""; + arrivalTimeValueAsString = arrivalTimeValue.toString(); + sb.append("arrivalTime=").append(urlEncode(arrivalTimeValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("time"); + openapiFields.add("asset"); + openapiFields.add("amount"); + openapiFields.add("receiveAsset"); + openapiFields.add("receiveAmount"); + openapiFields.add("fee"); + openapiFields.add("arrivalTime"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdRedemptionHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdRedemptionHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwusdRedemptionHistoryResponseRowsInner is not found in" + + " the empty JSON string", + GetRwusdRedemptionHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("receiveAsset") != null && !jsonObj.get("receiveAsset").isJsonNull()) + && !jsonObj.get("receiveAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAsset").toString())); + } + if ((jsonObj.get("receiveAmount") != null && !jsonObj.get("receiveAmount").isJsonNull()) + && !jsonObj.get("receiveAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAmount").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdRedemptionHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwusdRedemptionHistoryResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwusdRedemptionHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwusdRedemptionHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdRedemptionHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdRedemptionHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdRedemptionHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdRedemptionHistoryResponseRowsInner + */ + public static GetRwusdRedemptionHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwusdRedemptionHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetRwusdRedemptionHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponse.java new file mode 100644 index 000000000..92345b0bc --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponse.java @@ -0,0 +1,283 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetRwusdRewardsHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdRewardsHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetRwusdRewardsHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetRwusdRewardsHistoryResponse() {} + + public GetRwusdRewardsHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetRwusdRewardsHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetRwusdRewardsHistoryResponse addRowsItem( + GetRwusdRewardsHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwusdRewardsHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetRwusdRewardsHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetRwusdRewardsHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdRewardsHistoryResponse getRwusdRewardsHistoryResponse = + (GetRwusdRewardsHistoryResponse) o; + return Objects.equals(this.rows, getRwusdRewardsHistoryResponse.rows) + && Objects.equals(this.total, getRwusdRewardsHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdRewardsHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdRewardsHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdRewardsHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwusdRewardsHistoryResponse is not" + + " found in the empty JSON string", + GetRwusdRewardsHistoryResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetRwusdRewardsHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdRewardsHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwusdRewardsHistoryResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwusdRewardsHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwusdRewardsHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdRewardsHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdRewardsHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdRewardsHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdRewardsHistoryResponse + */ + public static GetRwusdRewardsHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdRewardsHistoryResponse.class); + } + + /** + * Convert an instance of GetRwusdRewardsHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponseRowsInner.java new file mode 100644 index 000000000..e6acb3327 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRewardsHistoryResponseRowsInner.java @@ -0,0 +1,345 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdRewardsHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdRewardsHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_REWARDS_AMOUNT = "rewardsAmount"; + + @SerializedName(SERIALIZED_NAME_REWARDS_AMOUNT) + @jakarta.annotation.Nullable + private String rewardsAmount; + + public static final String SERIALIZED_NAME_RWUSD_POSITION = "rwusdPosition"; + + @SerializedName(SERIALIZED_NAME_RWUSD_POSITION) + @jakarta.annotation.Nullable + private String rwusdPosition; + + public static final String SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE = "annualPercentageRate"; + + @SerializedName(SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE) + @jakarta.annotation.Nullable + private String annualPercentageRate; + + public GetRwusdRewardsHistoryResponseRowsInner() {} + + public GetRwusdRewardsHistoryResponseRowsInner time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public GetRwusdRewardsHistoryResponseRowsInner rewardsAmount( + @jakarta.annotation.Nullable String rewardsAmount) { + this.rewardsAmount = rewardsAmount; + return this; + } + + /** + * Get rewardsAmount + * + * @return rewardsAmount + */ + @jakarta.annotation.Nullable + public String getRewardsAmount() { + return rewardsAmount; + } + + public void setRewardsAmount(@jakarta.annotation.Nullable String rewardsAmount) { + this.rewardsAmount = rewardsAmount; + } + + public GetRwusdRewardsHistoryResponseRowsInner rwusdPosition( + @jakarta.annotation.Nullable String rwusdPosition) { + this.rwusdPosition = rwusdPosition; + return this; + } + + /** + * Get rwusdPosition + * + * @return rwusdPosition + */ + @jakarta.annotation.Nullable + public String getRwusdPosition() { + return rwusdPosition; + } + + public void setRwusdPosition(@jakarta.annotation.Nullable String rwusdPosition) { + this.rwusdPosition = rwusdPosition; + } + + public GetRwusdRewardsHistoryResponseRowsInner annualPercentageRate( + @jakarta.annotation.Nullable String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + return this; + } + + /** + * Get annualPercentageRate + * + * @return annualPercentageRate + */ + @jakarta.annotation.Nullable + public String getAnnualPercentageRate() { + return annualPercentageRate; + } + + public void setAnnualPercentageRate(@jakarta.annotation.Nullable String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdRewardsHistoryResponseRowsInner getRwusdRewardsHistoryResponseRowsInner = + (GetRwusdRewardsHistoryResponseRowsInner) o; + return Objects.equals(this.time, getRwusdRewardsHistoryResponseRowsInner.time) + && Objects.equals( + this.rewardsAmount, getRwusdRewardsHistoryResponseRowsInner.rewardsAmount) + && Objects.equals( + this.rwusdPosition, getRwusdRewardsHistoryResponseRowsInner.rwusdPosition) + && Objects.equals( + this.annualPercentageRate, + getRwusdRewardsHistoryResponseRowsInner.annualPercentageRate); + } + + @Override + public int hashCode() { + return Objects.hash(time, rewardsAmount, rwusdPosition, annualPercentageRate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdRewardsHistoryResponseRowsInner {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" rewardsAmount: ").append(toIndentedString(rewardsAmount)).append("\n"); + sb.append(" rwusdPosition: ").append(toIndentedString(rwusdPosition)).append("\n"); + sb.append(" annualPercentageRate: ") + .append(toIndentedString(annualPercentageRate)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object rewardsAmountValue = getRewardsAmount(); + String rewardsAmountValueAsString = ""; + rewardsAmountValueAsString = rewardsAmountValue.toString(); + sb.append("rewardsAmount=").append(urlEncode(rewardsAmountValueAsString)).append(""); + Object rwusdPositionValue = getRwusdPosition(); + String rwusdPositionValueAsString = ""; + rwusdPositionValueAsString = rwusdPositionValue.toString(); + sb.append("rwusdPosition=").append(urlEncode(rwusdPositionValueAsString)).append(""); + Object annualPercentageRateValue = getAnnualPercentageRate(); + String annualPercentageRateValueAsString = ""; + annualPercentageRateValueAsString = annualPercentageRateValue.toString(); + sb.append("annualPercentageRate=") + .append(urlEncode(annualPercentageRateValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("time"); + openapiFields.add("rewardsAmount"); + openapiFields.add("rwusdPosition"); + openapiFields.add("annualPercentageRate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdRewardsHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdRewardsHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwusdRewardsHistoryResponseRowsInner is not found in the" + + " empty JSON string", + GetRwusdRewardsHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rewardsAmount") != null && !jsonObj.get("rewardsAmount").isJsonNull()) + && !jsonObj.get("rewardsAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rewardsAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rewardsAmount").toString())); + } + if ((jsonObj.get("rwusdPosition") != null && !jsonObj.get("rwusdPosition").isJsonNull()) + && !jsonObj.get("rwusdPosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rwusdPosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rwusdPosition").toString())); + } + if ((jsonObj.get("annualPercentageRate") != null + && !jsonObj.get("annualPercentageRate").isJsonNull()) + && !jsonObj.get("annualPercentageRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `annualPercentageRate` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("annualPercentageRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdRewardsHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetRwusdRewardsHistoryResponseRowsInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwusdRewardsHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwusdRewardsHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdRewardsHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdRewardsHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdRewardsHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdRewardsHistoryResponseRowsInner + */ + public static GetRwusdRewardsHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdRewardsHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetRwusdRewardsHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponse.java new file mode 100644 index 000000000..a7001f88e --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponse.java @@ -0,0 +1,285 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetRwusdSubscriptionHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdSubscriptionHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetRwusdSubscriptionHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetRwusdSubscriptionHistoryResponse() {} + + public GetRwusdSubscriptionHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetRwusdSubscriptionHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetRwusdSubscriptionHistoryResponse addRowsItem( + GetRwusdSubscriptionHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwusdSubscriptionHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetRwusdSubscriptionHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetRwusdSubscriptionHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdSubscriptionHistoryResponse getRwusdSubscriptionHistoryResponse = + (GetRwusdSubscriptionHistoryResponse) o; + return Objects.equals(this.rows, getRwusdSubscriptionHistoryResponse.rows) + && Objects.equals(this.total, getRwusdSubscriptionHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdSubscriptionHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdSubscriptionHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdSubscriptionHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwusdSubscriptionHistoryResponse is" + + " not found in the empty JSON string", + GetRwusdSubscriptionHistoryResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetRwusdSubscriptionHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdSubscriptionHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwusdSubscriptionHistoryResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwusdSubscriptionHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwusdSubscriptionHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdSubscriptionHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdSubscriptionHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdSubscriptionHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdSubscriptionHistoryResponse + */ + public static GetRwusdSubscriptionHistoryResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwusdSubscriptionHistoryResponse.class); + } + + /** + * Convert an instance of GetRwusdSubscriptionHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponseRowsInner.java new file mode 100644 index 000000000..18fe6b042 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdSubscriptionHistoryResponseRowsInner.java @@ -0,0 +1,425 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetRwusdSubscriptionHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetRwusdSubscriptionHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_RECEIVE_ASSET = "receiveAsset"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_ASSET) + @jakarta.annotation.Nullable + private String receiveAsset; + + public static final String SERIALIZED_NAME_RECEIVE_AMOUNT = "receiveAmount"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_AMOUNT) + @jakarta.annotation.Nullable + private String receiveAmount; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public GetRwusdSubscriptionHistoryResponseRowsInner() {} + + public GetRwusdSubscriptionHistoryResponseRowsInner time( + @jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public GetRwusdSubscriptionHistoryResponseRowsInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetRwusdSubscriptionHistoryResponseRowsInner amount( + @jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public GetRwusdSubscriptionHistoryResponseRowsInner receiveAsset( + @jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + return this; + } + + /** + * Get receiveAsset + * + * @return receiveAsset + */ + @jakarta.annotation.Nullable + public String getReceiveAsset() { + return receiveAsset; + } + + public void setReceiveAsset(@jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + } + + public GetRwusdSubscriptionHistoryResponseRowsInner receiveAmount( + @jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + return this; + } + + /** + * Get receiveAmount + * + * @return receiveAmount + */ + @jakarta.annotation.Nullable + public String getReceiveAmount() { + return receiveAmount; + } + + public void setReceiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + } + + public GetRwusdSubscriptionHistoryResponseRowsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwusdSubscriptionHistoryResponseRowsInner getRwusdSubscriptionHistoryResponseRowsInner = + (GetRwusdSubscriptionHistoryResponseRowsInner) o; + return Objects.equals(this.time, getRwusdSubscriptionHistoryResponseRowsInner.time) + && Objects.equals(this.asset, getRwusdSubscriptionHistoryResponseRowsInner.asset) + && Objects.equals(this.amount, getRwusdSubscriptionHistoryResponseRowsInner.amount) + && Objects.equals( + this.receiveAsset, + getRwusdSubscriptionHistoryResponseRowsInner.receiveAsset) + && Objects.equals( + this.receiveAmount, + getRwusdSubscriptionHistoryResponseRowsInner.receiveAmount) + && Objects.equals(this.status, getRwusdSubscriptionHistoryResponseRowsInner.status); + } + + @Override + public int hashCode() { + return Objects.hash(time, asset, amount, receiveAsset, receiveAmount, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwusdSubscriptionHistoryResponseRowsInner {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" receiveAsset: ").append(toIndentedString(receiveAsset)).append("\n"); + sb.append(" receiveAmount: ").append(toIndentedString(receiveAmount)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object receiveAssetValue = getReceiveAsset(); + String receiveAssetValueAsString = ""; + receiveAssetValueAsString = receiveAssetValue.toString(); + sb.append("receiveAsset=").append(urlEncode(receiveAssetValueAsString)).append(""); + Object receiveAmountValue = getReceiveAmount(); + String receiveAmountValueAsString = ""; + receiveAmountValueAsString = receiveAmountValue.toString(); + sb.append("receiveAmount=").append(urlEncode(receiveAmountValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("time"); + openapiFields.add("asset"); + openapiFields.add("amount"); + openapiFields.add("receiveAsset"); + openapiFields.add("receiveAmount"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetRwusdSubscriptionHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwusdSubscriptionHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwusdSubscriptionHistoryResponseRowsInner is not found" + + " in the empty JSON string", + GetRwusdSubscriptionHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("receiveAsset") != null && !jsonObj.get("receiveAsset").isJsonNull()) + && !jsonObj.get("receiveAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAsset").toString())); + } + if ((jsonObj.get("receiveAmount") != null && !jsonObj.get("receiveAmount").isJsonNull()) + && !jsonObj.get("receiveAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAmount").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwusdSubscriptionHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwusdSubscriptionHistoryResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetRwusdSubscriptionHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwusdSubscriptionHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwusdSubscriptionHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwusdSubscriptionHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwusdSubscriptionHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwusdSubscriptionHistoryResponseRowsInner + */ + public static GetRwusdSubscriptionHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwusdSubscriptionHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetRwusdSubscriptionHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnFlexibleProductListResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnFlexibleProductListResponseRowsInner.java index 1583e7bcc..b08fecb6f 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnFlexibleProductListResponseRowsInner.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnFlexibleProductListResponseRowsInner.java @@ -104,7 +104,7 @@ public class GetSimpleEarnFlexibleProductListResponseRowsInner { @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_TIME) @jakarta.annotation.Nullable - private String subscriptionStartTime; + private Long subscriptionStartTime; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -324,7 +324,7 @@ public void setProductId(@jakarta.annotation.Nullable String productId) { } public GetSimpleEarnFlexibleProductListResponseRowsInner subscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { + @jakarta.annotation.Nullable Long subscriptionStartTime) { this.subscriptionStartTime = subscriptionStartTime; return this; } @@ -335,12 +335,11 @@ public GetSimpleEarnFlexibleProductListResponseRowsInner subscriptionStartTime( * @return subscriptionStartTime */ @jakarta.annotation.Nullable - public String getSubscriptionStartTime() { + public Long getSubscriptionStartTime() { return subscriptionStartTime; } - public void setSubscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { + public void setSubscriptionStartTime(@jakarta.annotation.Nullable Long subscriptionStartTime) { this.subscriptionStartTime = subscriptionStartTime; } @@ -628,15 +627,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("productId").toString())); } - if ((jsonObj.get("subscriptionStartTime") != null - && !jsonObj.get("subscriptionStartTime").isJsonNull()) - && !jsonObj.get("subscriptionStartTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionStartTime` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("subscriptionStartTime").toString())); - } if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnLockedProductListResponseRowsInnerDetail.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnLockedProductListResponseRowsInnerDetail.java index 38ce084b5..f151d6762 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnLockedProductListResponseRowsInnerDetail.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetSimpleEarnLockedProductListResponseRowsInnerDetail.java @@ -82,7 +82,7 @@ public class GetSimpleEarnLockedProductListResponseRowsInnerDetail { @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_TIME) @jakarta.annotation.Nullable - private String subscriptionStartTime; + private Long subscriptionStartTime; public static final String SERIALIZED_NAME_EXTRA_REWARD_ASSET = "extraRewardAsset"; @@ -112,7 +112,7 @@ public class GetSimpleEarnLockedProductListResponseRowsInnerDetail { @SerializedName(SERIALIZED_NAME_BOOST_END_TIME) @jakarta.annotation.Nullable - private String boostEndTime; + private Long boostEndTime; public GetSimpleEarnLockedProductListResponseRowsInnerDetail() {} @@ -257,7 +257,7 @@ public void setStatus(@jakarta.annotation.Nullable String status) { } public GetSimpleEarnLockedProductListResponseRowsInnerDetail subscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { + @jakarta.annotation.Nullable Long subscriptionStartTime) { this.subscriptionStartTime = subscriptionStartTime; return this; } @@ -268,12 +268,11 @@ public GetSimpleEarnLockedProductListResponseRowsInnerDetail subscriptionStartTi * @return subscriptionStartTime */ @jakarta.annotation.Nullable - public String getSubscriptionStartTime() { + public Long getSubscriptionStartTime() { return subscriptionStartTime; } - public void setSubscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { + public void setSubscriptionStartTime(@jakarta.annotation.Nullable Long subscriptionStartTime) { this.subscriptionStartTime = subscriptionStartTime; } @@ -358,7 +357,7 @@ public void setBoostApr(@jakarta.annotation.Nullable String boostApr) { } public GetSimpleEarnLockedProductListResponseRowsInnerDetail boostEndTime( - @jakarta.annotation.Nullable String boostEndTime) { + @jakarta.annotation.Nullable Long boostEndTime) { this.boostEndTime = boostEndTime; return this; } @@ -369,11 +368,11 @@ public GetSimpleEarnLockedProductListResponseRowsInnerDetail boostEndTime( * @return boostEndTime */ @jakarta.annotation.Nullable - public String getBoostEndTime() { + public Long getBoostEndTime() { return boostEndTime; } - public void setBoostEndTime(@jakarta.annotation.Nullable String boostEndTime) { + public void setBoostEndTime(@jakarta.annotation.Nullable Long boostEndTime) { this.boostEndTime = boostEndTime; } @@ -624,15 +623,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("status").toString())); } - if ((jsonObj.get("subscriptionStartTime") != null - && !jsonObj.get("subscriptionStartTime").isJsonNull()) - && !jsonObj.get("subscriptionStartTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionStartTime` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("subscriptionStartTime").toString())); - } if ((jsonObj.get("extraRewardAsset") != null && !jsonObj.get("extraRewardAsset").isJsonNull()) && !jsonObj.get("extraRewardAsset").isJsonPrimitive()) { @@ -667,14 +657,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("boostApr").toString())); } - if ((jsonObj.get("boostEndTime") != null && !jsonObj.get("boostEndTime").isJsonNull()) - && !jsonObj.get("boostEndTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `boostEndTime` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("boostEndTime").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdRequest.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdRequest.java new file mode 100644 index 000000000..62aa45c2c --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdRequest.java @@ -0,0 +1,289 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** RedeemRwusdRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RedeemRwusdRequest { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Double amount; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public RedeemRwusdRequest() {} + + public RedeemRwusdRequest amount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + } + + public RedeemRwusdRequest type(@jakarta.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nonnull + @NotNull + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nonnull String type) { + this.type = type; + } + + public RedeemRwusdRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RedeemRwusdRequest redeemRwusdRequest = (RedeemRwusdRequest) o; + return Objects.equals(this.amount, redeemRwusdRequest.amount) + && Objects.equals(this.type, redeemRwusdRequest.type) + && Objects.equals(this.recvWindow, redeemRwusdRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(amount, type, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RedeemRwusdRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("type"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RedeemRwusdRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RedeemRwusdRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RedeemRwusdRequest is not found in the" + + " empty JSON string", + RedeemRwusdRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RedeemRwusdRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RedeemRwusdRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RedeemRwusdRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RedeemRwusdRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RedeemRwusdRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RedeemRwusdRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RedeemRwusdRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RedeemRwusdRequest + * @throws IOException if the JSON string is invalid with respect to RedeemRwusdRequest + */ + public static RedeemRwusdRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RedeemRwusdRequest.class); + } + + /** + * Convert an instance of RedeemRwusdRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdResponse.java new file mode 100644 index 000000000..88d77e2cd --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemRwusdResponse.java @@ -0,0 +1,314 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** RedeemRwusdResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RedeemRwusdResponse { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public static final String SERIALIZED_NAME_RECEIVE_AMOUNT = "receiveAmount"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_AMOUNT) + @jakarta.annotation.Nullable + private String receiveAmount; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_ARRIVAL_TIME = "arrivalTime"; + + @SerializedName(SERIALIZED_NAME_ARRIVAL_TIME) + @jakarta.annotation.Nullable + private Long arrivalTime; + + public RedeemRwusdResponse() {} + + public RedeemRwusdResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Get success + * + * @return success + */ + @jakarta.annotation.Nullable + public Boolean getSuccess() { + return success; + } + + public void setSuccess(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + } + + public RedeemRwusdResponse receiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + return this; + } + + /** + * Get receiveAmount + * + * @return receiveAmount + */ + @jakarta.annotation.Nullable + public String getReceiveAmount() { + return receiveAmount; + } + + public void setReceiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + } + + public RedeemRwusdResponse fee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public RedeemRwusdResponse arrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + return this; + } + + /** + * Get arrivalTime + * + * @return arrivalTime + */ + @jakarta.annotation.Nullable + public Long getArrivalTime() { + return arrivalTime; + } + + public void setArrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RedeemRwusdResponse redeemRwusdResponse = (RedeemRwusdResponse) o; + return Objects.equals(this.success, redeemRwusdResponse.success) + && Objects.equals(this.receiveAmount, redeemRwusdResponse.receiveAmount) + && Objects.equals(this.fee, redeemRwusdResponse.fee) + && Objects.equals(this.arrivalTime, redeemRwusdResponse.arrivalTime); + } + + @Override + public int hashCode() { + return Objects.hash(success, receiveAmount, fee, arrivalTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RedeemRwusdResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" receiveAmount: ").append(toIndentedString(receiveAmount)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" arrivalTime: ").append(toIndentedString(arrivalTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object successValue = getSuccess(); + String successValueAsString = ""; + successValueAsString = successValue.toString(); + sb.append("success=").append(urlEncode(successValueAsString)).append(""); + Object receiveAmountValue = getReceiveAmount(); + String receiveAmountValueAsString = ""; + receiveAmountValueAsString = receiveAmountValue.toString(); + sb.append("receiveAmount=").append(urlEncode(receiveAmountValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object arrivalTimeValue = getArrivalTime(); + String arrivalTimeValueAsString = ""; + arrivalTimeValueAsString = arrivalTimeValue.toString(); + sb.append("arrivalTime=").append(urlEncode(arrivalTimeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("receiveAmount"); + openapiFields.add("fee"); + openapiFields.add("arrivalTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RedeemRwusdResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RedeemRwusdResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RedeemRwusdResponse is not found in" + + " the empty JSON string", + RedeemRwusdResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("receiveAmount") != null && !jsonObj.get("receiveAmount").isJsonNull()) + && !jsonObj.get("receiveAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAmount").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RedeemRwusdResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RedeemRwusdResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RedeemRwusdResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RedeemRwusdResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RedeemRwusdResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RedeemRwusdResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RedeemRwusdResponse + * @throws IOException if the JSON string is invalid with respect to RedeemRwusdResponse + */ + public static RedeemRwusdResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RedeemRwusdResponse.class); + } + + /** + * Convert an instance of RedeemRwusdResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdRequest.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdRequest.java new file mode 100644 index 000000000..38f76377f --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdRequest.java @@ -0,0 +1,289 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SubscribeRwusdRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SubscribeRwusdRequest { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nonnull + private String asset; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Double amount; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public SubscribeRwusdRequest() {} + + public SubscribeRwusdRequest asset(@jakarta.annotation.Nonnull String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nonnull + @NotNull + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nonnull String asset) { + this.asset = asset; + } + + public SubscribeRwusdRequest amount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + } + + public SubscribeRwusdRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscribeRwusdRequest subscribeRwusdRequest = (SubscribeRwusdRequest) o; + return Objects.equals(this.asset, subscribeRwusdRequest.asset) + && Objects.equals(this.amount, subscribeRwusdRequest.amount) + && Objects.equals(this.recvWindow, subscribeRwusdRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(asset, amount, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscribeRwusdRequest {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asset"); + openapiFields.add("amount"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("asset"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscribeRwusdRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubscribeRwusdRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubscribeRwusdRequest is not found in" + + " the empty JSON string", + SubscribeRwusdRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscribeRwusdRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscribeRwusdRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscribeRwusdRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SubscribeRwusdRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscribeRwusdRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscribeRwusdRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubscribeRwusdRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscribeRwusdRequest + * @throws IOException if the JSON string is invalid with respect to SubscribeRwusdRequest + */ + public static SubscribeRwusdRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscribeRwusdRequest.class); + } + + /** + * Convert an instance of SubscribeRwusdRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdResponse.java new file mode 100644 index 000000000..d0b63808a --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeRwusdResponse.java @@ -0,0 +1,242 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SubscribeRwusdResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SubscribeRwusdResponse { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public static final String SERIALIZED_NAME_RWUSD_AMOUNT = "rwusdAmount"; + + @SerializedName(SERIALIZED_NAME_RWUSD_AMOUNT) + @jakarta.annotation.Nullable + private String rwusdAmount; + + public SubscribeRwusdResponse() {} + + public SubscribeRwusdResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Get success + * + * @return success + */ + @jakarta.annotation.Nullable + public Boolean getSuccess() { + return success; + } + + public void setSuccess(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + } + + public SubscribeRwusdResponse rwusdAmount(@jakarta.annotation.Nullable String rwusdAmount) { + this.rwusdAmount = rwusdAmount; + return this; + } + + /** + * Get rwusdAmount + * + * @return rwusdAmount + */ + @jakarta.annotation.Nullable + public String getRwusdAmount() { + return rwusdAmount; + } + + public void setRwusdAmount(@jakarta.annotation.Nullable String rwusdAmount) { + this.rwusdAmount = rwusdAmount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscribeRwusdResponse subscribeRwusdResponse = (SubscribeRwusdResponse) o; + return Objects.equals(this.success, subscribeRwusdResponse.success) + && Objects.equals(this.rwusdAmount, subscribeRwusdResponse.rwusdAmount); + } + + @Override + public int hashCode() { + return Objects.hash(success, rwusdAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscribeRwusdResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" rwusdAmount: ").append(toIndentedString(rwusdAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object successValue = getSuccess(); + String successValueAsString = ""; + successValueAsString = successValue.toString(); + sb.append("success=").append(urlEncode(successValueAsString)).append(""); + Object rwusdAmountValue = getRwusdAmount(); + String rwusdAmountValueAsString = ""; + rwusdAmountValueAsString = rwusdAmountValue.toString(); + sb.append("rwusdAmount=").append(urlEncode(rwusdAmountValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("rwusdAmount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscribeRwusdResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubscribeRwusdResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubscribeRwusdResponse is not found in" + + " the empty JSON string", + SubscribeRwusdResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rwusdAmount") != null && !jsonObj.get("rwusdAmount").isJsonNull()) + && !jsonObj.get("rwusdAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rwusdAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rwusdAmount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscribeRwusdResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscribeRwusdResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SubscribeRwusdResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscribeRwusdResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscribeRwusdResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubscribeRwusdResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscribeRwusdResponse + * @throws IOException if the JSON string is invalid with respect to SubscribeRwusdResponse + */ + public static SubscribeRwusdResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscribeRwusdResponse.class); + } + + /** + * Convert an instance of SubscribeRwusdResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/AccountApiTest.java b/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/AccountApiTest.java deleted file mode 100644 index b7cb44bbf..000000000 --- a/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/AccountApiTest.java +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Binance Simple Earn REST API - * OpenAPI Specification for the Binance Simple Earn REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.simple_earn.rest.api; - -import static org.junit.Assert.assertEquals; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; -import com.binance.connector.client.common.auth.SignatureAuthentication; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.sign.HmacSignatureGenerator; -import com.binance.connector.client.common.sign.SignatureGenerator; -import com.binance.connector.client.simple_earn.rest.model.GetFlexiblePersonalLeftQuotaResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleProductPositionResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedPersonalLeftQuotaResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedProductPositionResponse; -import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnFlexibleProductListResponse; -import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnLockedProductListResponse; -import com.binance.connector.client.simple_earn.rest.model.SimpleAccountResponse; -import jakarta.validation.constraints.*; -import okhttp3.Call; -import okhttp3.Request; -import org.bouncycastle.crypto.CryptoException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -/** API tests for AccountApi */ -public class AccountApiTest { - - private AccountApi api; - private ApiClient apiClientSpy; - private SignatureGenerator signatureGeneratorSpy; - - @BeforeEach - public void initApiClient() throws ApiException { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - clientConfiguration.setUrl("http://localhost:8080"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setSecretKey("secretKey"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - HmacSignatureGenerator signatureGenerator = - new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); - signatureGeneratorSpy = Mockito.spy(signatureGenerator); - SignatureAuthentication signatureAuthentication = - new SignatureAuthentication( - signatureConfiguration.getApiKey(), signatureGeneratorSpy); - SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); - Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); - - BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); - Mockito.doReturn(authenticationSpy) - .when(factoryMock) - .getAuthentication(signatureConfiguration); - - ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); - - apiClientSpy = Mockito.spy(apiClient); - Mockito.doReturn(new ApiResponse<>(200, null)) - .when(apiClientSpy) - .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); - Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); - Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - - api = new AccountApi(apiClientSpy); - } - - /** - * Get Flexible Personal Left Quota(USER_DATA) - * - *

Get Flexible Personal Left Quota Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getFlexiblePersonalLeftQuotaTest() throws ApiException, CryptoException { - String productId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - api.getFlexiblePersonalLeftQuota(productId, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "productId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "3449171bcce7a8aa43ee9684da7eebf17feeecb24ed8fd2858ca78fcc5d87e85", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/personalLeftQuota", - actualRequest.url().encodedPath()); - } - - /** - * Get Flexible Product Position(USER_DATA) - * - *

Get Flexible Product Position Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getFlexibleProductPositionTest() throws ApiException, CryptoException { - String asset = ""; - String productId = "1"; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getFlexibleProductPosition(asset, productId, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "asset=&productId=1¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "1cc1b386baba7fc174869f28bbc9dcbfff30e18b98f074dd3f90eadd0fee8692", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/flexible/position", actualRequest.url().encodedPath()); - } - - /** - * Get Locked Personal Left Quota(USER_DATA) - * - *

Get Locked Personal Left Quota Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getLockedPersonalLeftQuotaTest() throws ApiException, CryptoException { - String projectId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - api.getLockedPersonalLeftQuota(projectId, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "projectId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "7df8536b8711da59322819086e27ee0e183d18d1f4d6a68377c9c4a87f835ab8", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/locked/personalLeftQuota", actualRequest.url().encodedPath()); - } - - /** - * Get Locked Product Position - * - *

Get Locked Product Position Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getLockedProductPositionTest() throws ApiException, CryptoException { - String asset = ""; - String positionId = "1"; - String projectId = "1"; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getLockedProductPosition( - asset, positionId, projectId, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("3fa625e0c98e6f4e9f1ec21a44584f64734fa62a263ad96d4bea3583baa409d7", actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/locked/position", actualRequest.url().encodedPath()); - } - - /** - * Get Simple Earn Flexible Product List(USER_DATA) - * - *

Get available Simple Earn flexible product list Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSimpleEarnFlexibleProductListTest() throws ApiException, CryptoException { - String asset = ""; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getSimpleEarnFlexibleProductList(asset, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "asset=¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "a8d7174d9767b6c5ac9e2a1b5c161cef80476f7dbb006361943091d5b77cd212", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/flexible/list", actualRequest.url().encodedPath()); - } - - /** - * Get Simple Earn Locked Product List(USER_DATA) - * - *

Get Simple Earn Locked Product List * Get available Simple Earn locked product list - * Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getSimpleEarnLockedProductListTest() throws ApiException, CryptoException { - String asset = ""; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getSimpleEarnLockedProductList(asset, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "asset=¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "a8d7174d9767b6c5ac9e2a1b5c161cef80476f7dbb006361943091d5b77cd212", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/locked/list", actualRequest.url().encodedPath()); - } - - /** - * Simple Account(USER_DATA) - * - *

Simple Account query Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void simpleAccountTest() throws ApiException, CryptoException { - Long recvWindow = 5000L; - ApiResponse response = api.simpleAccount(recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/account", actualRequest.url().encodedPath()); - } -} diff --git a/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/EarnApiTest.java b/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/EarnApiTest.java deleted file mode 100644 index 7d6f90919..000000000 --- a/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/EarnApiTest.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Binance Simple Earn REST API - * OpenAPI Specification for the Binance Simple Earn REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.simple_earn.rest.api; - -import static org.junit.Assert.assertEquals; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; -import com.binance.connector.client.common.auth.SignatureAuthentication; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.sign.HmacSignatureGenerator; -import com.binance.connector.client.common.sign.SignatureGenerator; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionPreviewResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionPreviewResponse; -import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest; -import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductResponse; -import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductRequest; -import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductResponse; -import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeRequest; -import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeResponse; -import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeRequest; -import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeResponse; -import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionRequest; -import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionResponse; -import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductRequest; -import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductResponse; -import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductRequest; -import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductResponse; -import jakarta.validation.constraints.*; -import okhttp3.Call; -import okhttp3.Request; -import org.bouncycastle.crypto.CryptoException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -/** API tests for EarnApi */ -public class EarnApiTest { - - private EarnApi api; - private ApiClient apiClientSpy; - private SignatureGenerator signatureGeneratorSpy; - - @BeforeEach - public void initApiClient() throws ApiException { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - clientConfiguration.setUrl("http://localhost:8080"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setSecretKey("secretKey"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - HmacSignatureGenerator signatureGenerator = - new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); - signatureGeneratorSpy = Mockito.spy(signatureGenerator); - SignatureAuthentication signatureAuthentication = - new SignatureAuthentication( - signatureConfiguration.getApiKey(), signatureGeneratorSpy); - SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); - Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); - - BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); - Mockito.doReturn(authenticationSpy) - .when(factoryMock) - .getAuthentication(signatureConfiguration); - - ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); - - apiClientSpy = Mockito.spy(apiClient); - Mockito.doReturn(new ApiResponse<>(200, null)) - .when(apiClientSpy) - .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); - Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); - Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - - api = new EarnApi(apiClientSpy); - } - - /** - * Get Flexible Subscription Preview(USER_DATA) - * - *

Get Flexible Subscription Preview Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getFlexibleSubscriptionPreviewTest() throws ApiException, CryptoException { - String productId = "1"; - Double amount = 1d; - Long recvWindow = 5000L; - ApiResponse response = - api.getFlexibleSubscriptionPreview(productId, amount, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "productId=1&amount=1&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "00a7c80c0c410b10c6a3067e01f82fc810a365b87c83c5086e7224f826896ff5", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/subscriptionPreview", - actualRequest.url().encodedPath()); - } - - /** - * Get Locked Subscription Preview(USER_DATA) - * - *

Get Locked Subscription Preview Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getLockedSubscriptionPreviewTest() throws ApiException, CryptoException { - String projectId = "1"; - Double amount = 1d; - Boolean autoSubscribe = false; - Long recvWindow = 5000L; - ApiResponse response = - api.getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "projectId=1&amount=1&autoSubscribe=false&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "ed6d60bbbd167523b7f2ff4be5baa4485dbf0f39322a1cb34907612d59aac34a", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/locked/subscriptionPreview", - actualRequest.url().encodedPath()); - } - - /** - * Redeem Flexible Product(TRADE) - * - *

Redeem Flexible Product * You need to open `Enable Spot & Margin Trading` - * permission for the API Key which requests this endpoint. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void redeemFlexibleProductTest() throws ApiException, CryptoException { - RedeemFlexibleProductRequest redeemFlexibleProductRequest = - new RedeemFlexibleProductRequest(); - - redeemFlexibleProductRequest.productId("1"); - - ApiResponse response = - api.redeemFlexibleProduct(redeemFlexibleProductRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("timestamp=1736393892000productId=1", signInputCaptor.getValue()); - assertEquals( - "c4c7af86a6a8cfafc9909bb0dec0f67695e17aba2a88ca75e983de6e0b915279", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/flexible/redeem", actualRequest.url().encodedPath()); - } - - /** - * Redeem Locked Product(TRADE) - * - *

Redeem Locked Product * You need to open `Enable Spot & Margin Trading` - * permission for the API Key which requests this endpoint. Weight: 1/3s per account - * - * @throws ApiException if the Api call fails - */ - @Test - public void redeemLockedProductTest() throws ApiException, CryptoException { - RedeemLockedProductRequest redeemLockedProductRequest = new RedeemLockedProductRequest(); - - redeemLockedProductRequest.positionId("1"); - - ApiResponse response = - api.redeemLockedProduct(redeemLockedProductRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("timestamp=1736393892000positionId=1", signInputCaptor.getValue()); - assertEquals( - "05345189012e725ecf394a569c76b468c3a9d6377f5b644a1b90e1551920ce91", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/locked/redeem", actualRequest.url().encodedPath()); - } - - /** - * Set Flexible Auto Subscribe(USER_DATA) - * - *

Set Flexible Auto Subscribe Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void setFlexibleAutoSubscribeTest() throws ApiException, CryptoException { - SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest = - new SetFlexibleAutoSubscribeRequest(); - - setFlexibleAutoSubscribeRequest.productId("1"); - setFlexibleAutoSubscribeRequest.autoSubscribe(false); - - ApiResponse response = - api.setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000productId=1&autoSubscribe=false", - signInputCaptor.getValue()); - assertEquals( - "7f0e71e1d2216401bdf0ebda0fabfe4e4c1000d47e4c68eb693dac11779f033f", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/setAutoSubscribe", - actualRequest.url().encodedPath()); - } - - /** - * Set Locked Auto Subscribe(USER_DATA) - * - *

Set locked auto subscribe Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void setLockedAutoSubscribeTest() throws ApiException, CryptoException { - SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest = - new SetLockedAutoSubscribeRequest(); - - setLockedAutoSubscribeRequest.positionId("1"); - setLockedAutoSubscribeRequest.autoSubscribe(false); - - ApiResponse response = - api.setLockedAutoSubscribe(setLockedAutoSubscribeRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000positionId=1&autoSubscribe=false", - signInputCaptor.getValue()); - assertEquals( - "3a195934cb713ee1998b4fa336da6ec3a9a4b2087a91d11a2d5602c7af3474e0", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/locked/setAutoSubscribe", actualRequest.url().encodedPath()); - } - - /** - * Set Locked Product Redeem Option(USER_DATA) - * - *

Set redeem option for Locked product Weight: 50 - * - * @throws ApiException if the Api call fails - */ - @Test - public void setLockedProductRedeemOptionTest() throws ApiException, CryptoException { - SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest = - new SetLockedProductRedeemOptionRequest(); - - setLockedProductRedeemOptionRequest.positionId("1"); - setLockedProductRedeemOptionRequest.redeemTo(""); - - ApiResponse response = - api.setLockedProductRedeemOption(setLockedProductRedeemOptionRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("timestamp=1736393892000positionId=1&redeemTo=", signInputCaptor.getValue()); - assertEquals( - "f8aaddc07f48085384e59233efb3421133330e9bcd0357b99332f1202fe03d70", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/locked/setRedeemOption", actualRequest.url().encodedPath()); - } - - /** - * Subscribe Flexible Product(TRADE) - * - *

Subscribe Flexible Product * You need to open `Enable Spot & Margin Trading` - * permission for the API Key which requests this endpoint. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void subscribeFlexibleProductTest() throws ApiException, CryptoException { - SubscribeFlexibleProductRequest subscribeFlexibleProductRequest = - new SubscribeFlexibleProductRequest(); - - subscribeFlexibleProductRequest.productId("1"); - subscribeFlexibleProductRequest.amount(1d); - - ApiResponse response = - api.subscribeFlexibleProduct(subscribeFlexibleProductRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("timestamp=1736393892000amount=1&productId=1", signInputCaptor.getValue()); - assertEquals( - "d71f21fc51817b324b37ac741557e5f0e37ba4c300b9b0dcf20dadffde1a1e1a", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/flexible/subscribe", actualRequest.url().encodedPath()); - } - - /** - * Subscribe Locked Product(TRADE) - * - *

Subscribe Locked Product * You need to open `Enable Spot & Margin Trading` - * permission for the API Key which requests this endpoint. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void subscribeLockedProductTest() throws ApiException, CryptoException { - SubscribeLockedProductRequest subscribeLockedProductRequest = - new SubscribeLockedProductRequest(); - - subscribeLockedProductRequest.projectId("1"); - subscribeLockedProductRequest.amount(1d); - - ApiResponse response = - api.subscribeLockedProduct(subscribeLockedProductRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("timestamp=1736393892000amount=1&projectId=1", signInputCaptor.getValue()); - assertEquals( - "7ef22d632c2aec6bea9e728707f8eac15fbf16144341682080788f00ceb268ac", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/simple-earn/locked/subscribe", actualRequest.url().encodedPath()); - } -} diff --git a/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApiTest.java b/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApiTest.java new file mode 100644 index 000000000..099b34dba --- /dev/null +++ b/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApiTest.java @@ -0,0 +1,1049 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.api; + +import static org.junit.Assert.assertEquals; + +import com.binance.connector.client.common.ApiClient; +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; +import com.binance.connector.client.common.auth.SignatureAuthentication; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.common.sign.HmacSignatureGenerator; +import com.binance.connector.client.common.sign.SignatureGenerator; +import com.binance.connector.client.simple_earn.rest.model.GetCollateralRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexiblePersonalLeftQuotaResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleProductPositionResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRedemptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionPreviewResponse; +import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedPersonalLeftQuotaResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedProductPositionResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedRedemptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionPreviewResponse; +import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionRecordResponse; +import com.binance.connector.client.simple_earn.rest.model.GetRateHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnFlexibleProductListResponse; +import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnLockedProductListResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductResponse; +import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeRequest; +import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeResponse; +import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeRequest; +import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeResponse; +import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionRequest; +import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionResponse; +import com.binance.connector.client.simple_earn.rest.model.SimpleAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductResponse; +import okhttp3.Call; +import okhttp3.Request; +import org.bouncycastle.crypto.CryptoException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; + +/** API tests for AccountApi */ +public class FlexibleLockedApiTest { + + private FlexibleLockedApi api; + private ApiClient apiClientSpy; + private SignatureGenerator signatureGeneratorSpy; + + @BeforeEach + public void initApiClient() throws ApiException { + ClientConfiguration clientConfiguration = new ClientConfiguration(); + clientConfiguration.setUrl("http://localhost:8080"); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + + HmacSignatureGenerator signatureGenerator = + new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); + signatureGeneratorSpy = Mockito.spy(signatureGenerator); + SignatureAuthentication signatureAuthentication = + new SignatureAuthentication( + signatureConfiguration.getApiKey(), signatureGeneratorSpy); + SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); + Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); + + BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); + Mockito.doReturn(authenticationSpy) + .when(factoryMock) + .getAuthentication(signatureConfiguration); + + ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); + + apiClientSpy = Mockito.spy(apiClient); + Mockito.doReturn(new ApiResponse<>(200, null)) + .when(apiClientSpy) + .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); + Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); + Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); + + api = new FlexibleLockedApi(apiClientSpy); + } + + /** + * Get Flexible Personal Left Quota(USER_DATA) + * + *

Get Flexible Personal Left Quota Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFlexiblePersonalLeftQuotaTest() throws ApiException, CryptoException { + String productId = "1"; + Long recvWindow = 5000L; + ApiResponse response = + api.getFlexiblePersonalLeftQuota(productId, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "productId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals( + "3449171bcce7a8aa43ee9684da7eebf17feeecb24ed8fd2858ca78fcc5d87e85", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/personalLeftQuota", + actualRequest.url().encodedPath()); + } + + /** + * Get Flexible Product Position(USER_DATA) + * + *

Get Flexible Product Position Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFlexibleProductPositionTest() throws ApiException, CryptoException { + String asset = ""; + String productId = "1"; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getFlexibleProductPosition(asset, productId, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "asset=&productId=1¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "1cc1b386baba7fc174869f28bbc9dcbfff30e18b98f074dd3f90eadd0fee8692", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/flexible/position", actualRequest.url().encodedPath()); + } + + /** + * Get Locked Personal Left Quota(USER_DATA) + * + *

Get Locked Personal Left Quota Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getLockedPersonalLeftQuotaTest() throws ApiException, CryptoException { + String projectId = "1"; + Long recvWindow = 5000L; + ApiResponse response = + api.getLockedPersonalLeftQuota(projectId, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "projectId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals( + "7df8536b8711da59322819086e27ee0e183d18d1f4d6a68377c9c4a87f835ab8", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/locked/personalLeftQuota", actualRequest.url().encodedPath()); + } + + /** + * Get Locked Product Position + * + *

Get Locked Product Position Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getLockedProductPositionTest() throws ApiException, CryptoException { + String asset = ""; + String positionId = "1"; + String projectId = "1"; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getLockedProductPosition( + asset, positionId, projectId, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("3fa625e0c98e6f4e9f1ec21a44584f64734fa62a263ad96d4bea3583baa409d7", actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/locked/position", actualRequest.url().encodedPath()); + } + + /** + * Get Simple Earn Flexible Product List(USER_DATA) + * + *

Get available Simple Earn flexible product list Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSimpleEarnFlexibleProductListTest() throws ApiException, CryptoException { + String asset = ""; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getSimpleEarnFlexibleProductList(asset, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "asset=¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "a8d7174d9767b6c5ac9e2a1b5c161cef80476f7dbb006361943091d5b77cd212", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/flexible/list", actualRequest.url().encodedPath()); + } + + /** + * Get Simple Earn Locked Product List(USER_DATA) + * + *

Get Simple Earn Locked Product List * Get available Simple Earn locked product list + * Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSimpleEarnLockedProductListTest() throws ApiException, CryptoException { + String asset = ""; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getSimpleEarnLockedProductList(asset, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "asset=¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "a8d7174d9767b6c5ac9e2a1b5c161cef80476f7dbb006361943091d5b77cd212", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/locked/list", actualRequest.url().encodedPath()); + } + + /** + * Simple Account(USER_DATA) + * + *

Simple Account query Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void simpleAccountTest() throws ApiException, CryptoException { + Long recvWindow = 5000L; + ApiResponse response = api.simpleAccount(recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals( + "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/account", actualRequest.url().encodedPath()); + } + + /** + * Get Flexible Subscription Preview(USER_DATA) + * + *

Get Flexible Subscription Preview Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFlexibleSubscriptionPreviewTest() throws ApiException, CryptoException { + String productId = "1"; + Double amount = 1d; + Long recvWindow = 5000L; + ApiResponse response = + api.getFlexibleSubscriptionPreview(productId, amount, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "productId=1&amount=1&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "00a7c80c0c410b10c6a3067e01f82fc810a365b87c83c5086e7224f826896ff5", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/subscriptionPreview", + actualRequest.url().encodedPath()); + } + + /** + * Get Locked Subscription Preview(USER_DATA) + * + *

Get Locked Subscription Preview Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getLockedSubscriptionPreviewTest() throws ApiException, CryptoException { + String projectId = "1"; + Double amount = 1d; + Boolean autoSubscribe = false; + Long recvWindow = 5000L; + ApiResponse response = + api.getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "projectId=1&amount=1&autoSubscribe=false&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "ed6d60bbbd167523b7f2ff4be5baa4485dbf0f39322a1cb34907612d59aac34a", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/locked/subscriptionPreview", + actualRequest.url().encodedPath()); + } + + /** + * Redeem Flexible Product(TRADE) + * + *

Redeem Flexible Product * You need to open `Enable Spot & Margin Trading` + * permission for the API Key which requests this endpoint. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + @Test + public void redeemFlexibleProductTest() throws ApiException, CryptoException { + RedeemFlexibleProductRequest redeemFlexibleProductRequest = + new RedeemFlexibleProductRequest(); + + redeemFlexibleProductRequest.productId("1"); + + ApiResponse response = + api.redeemFlexibleProduct(redeemFlexibleProductRequest); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("timestamp=1736393892000productId=1", signInputCaptor.getValue()); + assertEquals( + "c4c7af86a6a8cfafc9909bb0dec0f67695e17aba2a88ca75e983de6e0b915279", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/flexible/redeem", actualRequest.url().encodedPath()); + } + + /** + * Redeem Locked Product(TRADE) + * + *

Redeem Locked Product * You need to open `Enable Spot & Margin Trading` + * permission for the API Key which requests this endpoint. Weight: 1/3s per account + * + * @throws ApiException if the Api call fails + */ + @Test + public void redeemLockedProductTest() throws ApiException, CryptoException { + RedeemLockedProductRequest redeemLockedProductRequest = new RedeemLockedProductRequest(); + + redeemLockedProductRequest.positionId("1"); + + ApiResponse response = + api.redeemLockedProduct(redeemLockedProductRequest); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("timestamp=1736393892000positionId=1", signInputCaptor.getValue()); + assertEquals( + "05345189012e725ecf394a569c76b468c3a9d6377f5b644a1b90e1551920ce91", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/locked/redeem", actualRequest.url().encodedPath()); + } + + /** + * Set Flexible Auto Subscribe(USER_DATA) + * + *

Set Flexible Auto Subscribe Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void setFlexibleAutoSubscribeTest() throws ApiException, CryptoException { + SetFlexibleAutoSubscribeRequest setFlexibleAutoSubscribeRequest = + new SetFlexibleAutoSubscribeRequest(); + + setFlexibleAutoSubscribeRequest.productId("1"); + setFlexibleAutoSubscribeRequest.autoSubscribe(false); + + ApiResponse response = + api.setFlexibleAutoSubscribe(setFlexibleAutoSubscribeRequest); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "timestamp=1736393892000productId=1&autoSubscribe=false", + signInputCaptor.getValue()); + assertEquals( + "7f0e71e1d2216401bdf0ebda0fabfe4e4c1000d47e4c68eb693dac11779f033f", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/setAutoSubscribe", + actualRequest.url().encodedPath()); + } + + /** + * Set Locked Auto Subscribe(USER_DATA) + * + *

Set locked auto subscribe Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void setLockedAutoSubscribeTest() throws ApiException, CryptoException { + SetLockedAutoSubscribeRequest setLockedAutoSubscribeRequest = + new SetLockedAutoSubscribeRequest(); + + setLockedAutoSubscribeRequest.positionId("1"); + setLockedAutoSubscribeRequest.autoSubscribe(false); + + ApiResponse response = + api.setLockedAutoSubscribe(setLockedAutoSubscribeRequest); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "timestamp=1736393892000positionId=1&autoSubscribe=false", + signInputCaptor.getValue()); + assertEquals( + "3a195934cb713ee1998b4fa336da6ec3a9a4b2087a91d11a2d5602c7af3474e0", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/locked/setAutoSubscribe", actualRequest.url().encodedPath()); + } + + /** + * Set Locked Product Redeem Option(USER_DATA) + * + *

Set redeem option for Locked product Weight: 50 + * + * @throws ApiException if the Api call fails + */ + @Test + public void setLockedProductRedeemOptionTest() throws ApiException, CryptoException { + SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest = + new SetLockedProductRedeemOptionRequest(); + + setLockedProductRedeemOptionRequest.positionId("1"); + setLockedProductRedeemOptionRequest.redeemTo(""); + + ApiResponse response = + api.setLockedProductRedeemOption(setLockedProductRedeemOptionRequest); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("timestamp=1736393892000positionId=1&redeemTo=", signInputCaptor.getValue()); + assertEquals( + "f8aaddc07f48085384e59233efb3421133330e9bcd0357b99332f1202fe03d70", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/locked/setRedeemOption", actualRequest.url().encodedPath()); + } + + /** + * Subscribe Flexible Product(TRADE) + * + *

Subscribe Flexible Product * You need to open `Enable Spot & Margin Trading` + * permission for the API Key which requests this endpoint. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + @Test + public void subscribeFlexibleProductTest() throws ApiException, CryptoException { + SubscribeFlexibleProductRequest subscribeFlexibleProductRequest = + new SubscribeFlexibleProductRequest(); + + subscribeFlexibleProductRequest.productId("1"); + subscribeFlexibleProductRequest.amount(1d); + + ApiResponse response = + api.subscribeFlexibleProduct(subscribeFlexibleProductRequest); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("timestamp=1736393892000amount=1&productId=1", signInputCaptor.getValue()); + assertEquals( + "d71f21fc51817b324b37ac741557e5f0e37ba4c300b9b0dcf20dadffde1a1e1a", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/flexible/subscribe", actualRequest.url().encodedPath()); + } + + /** + * Subscribe Locked Product(TRADE) + * + *

Subscribe Locked Product * You need to open `Enable Spot & Margin Trading` + * permission for the API Key which requests this endpoint. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + @Test + public void subscribeLockedProductTest() throws ApiException, CryptoException { + SubscribeLockedProductRequest subscribeLockedProductRequest = + new SubscribeLockedProductRequest(); + + subscribeLockedProductRequest.projectId("1"); + subscribeLockedProductRequest.amount(1d); + + ApiResponse response = + api.subscribeLockedProduct(subscribeLockedProductRequest); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals("timestamp=1736393892000amount=1&projectId=1", signInputCaptor.getValue()); + assertEquals( + "7ef22d632c2aec6bea9e728707f8eac15fbf16144341682080788f00ceb268ac", + actualRequest.url().queryParameter("signature")); + assertEquals("/sapi/v1/simple-earn/locked/subscribe", actualRequest.url().encodedPath()); + } + + /** + * Get Collateral Record(USER_DATA) + * + *

Get Collateral Record * The time between `startTime` and `endTime` + * cannot be longer than 30 days. * If `startTime` and `endTime` are both + * not sent, then the last 30 days' data will be returned. * If `startTime` is + * sent but `endTime` is not sent, the next 30 days' data beginning from + * `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCollateralRecordTest() throws ApiException, CryptoException { + String productId = "1"; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getCollateralRecord(productId, startTime, endTime, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "productId=1&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "906323d23878072da9680bca3160b76d28b6ea07530e027f762757a381c263c0", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/history/collateralRecord", + actualRequest.url().encodedPath()); + } + + /** + * Get Flexible Redemption Record(USER_DATA) + * + *

Get Flexible Redemption Record * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFlexibleRedemptionRecordTest() throws ApiException, CryptoException { + String productId = "1"; + String redeemId = "1"; + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getFlexibleRedemptionRecord( + productId, redeemId, asset, startTime, endTime, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "productId=1&redeemId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "d1703f8758c55672f9a39da68d446692dde9bf216f7ebef51b7093b2a9d37bd1", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/history/redemptionRecord", + actualRequest.url().encodedPath()); + } + + /** + * Get Flexible Rewards History(USER_DATA) + * + *

Get Flexible Rewards History * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFlexibleRewardsHistoryTest() throws ApiException, CryptoException { + String type = "Bonus"; + String productId = "1"; + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = null; + Long size = null; + Long recvWindow = null; + ApiResponse response = + api.getFlexibleRewardsHistory(type, productId, asset, startTime, endTime, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "productId=1&asset=&startTime=1623319461670&endTime=1641782889000&type=Bonus×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "aaca82b4120f35ab3bf0bc811eb9e830f570191c637ef87b11b4e820934b3f50", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/history/rewardsRecord", + actualRequest.url().encodedPath()); + } + + /** + * Get Flexible Subscription Record(USER_DATA) + * + *

Get Flexible Subscription Record * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFlexibleSubscriptionRecordTest() throws ApiException, CryptoException { + String productId = "1"; + String purchaseId = "1"; + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getFlexibleSubscriptionRecord( + productId, + purchaseId, + asset, + startTime, + endTime, + current, + size, + recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "productId=1&purchaseId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "e68ebd079318006615cac9e1f467bdc7c3ac82bf05a7180825541e5925b07e51", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/history/subscriptionRecord", + actualRequest.url().encodedPath()); + } + + /** + * Get Locked Redemption Record(USER_DATA) + * + *

Get Locked Redemption Record * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getLockedRedemptionRecordTest() throws ApiException, CryptoException { + String positionId = "1"; + String redeemId = "1"; + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getLockedRedemptionRecord( + positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "positionId=1&redeemId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "b969874fd814b72e7c29bdebdc319072c1dc23126f0a117b9b22f3617918204d", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/locked/history/redemptionRecord", + actualRequest.url().encodedPath()); + } + + /** + * Get Locked Rewards History(USER_DATA) + * + *

Get Locked Rewards History * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getLockedRewardsHistoryTest() throws ApiException, CryptoException { + String positionId = "1"; + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getLockedRewardsHistory( + positionId, asset, startTime, endTime, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "positionId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "fa00e647d10a074646817619a9a8485086bbc8257eed00382562bf960d5f0143", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/locked/history/rewardsRecord", + actualRequest.url().encodedPath()); + } + + /** + * Get Locked Subscription Record(USER_DATA) + * + *

Get Locked Subscription Record * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getLockedSubscriptionRecordTest() throws ApiException, CryptoException { + String purchaseId = "1"; + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getLockedSubscriptionRecord( + purchaseId, asset, startTime, endTime, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "purchaseId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "bd233092b66eaad8df11be01a5a41670f67daa39dfc19880a9d14424471cfba7", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/locked/history/subscriptionRecord", + actualRequest.url().encodedPath()); + } + + /** + * Get Rate History(USER_DATA) + * + *

Get Rate History * The time between startTime and endTime cannot be longer than 1 year. * + * If `startTime` and `endTime` are both not sent, then the last 30 + * days' data will be returned. * If `startTime` is sent but `endTime` + * is not sent, the next 30 days' data beginning from `startTime` will be + * returned. * If `endTime` is sent but `startTime` is not sent, the 30 + * days' data before `endTime` will be returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRateHistoryTest() throws ApiException, CryptoException { + String productId = "1"; + String aprPeriod = "DAY"; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + api.getRateHistory( + productId, aprPeriod, startTime, endTime, current, size, recvWindow); + + ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); + Mockito.verify(apiClientSpy) + .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); + + ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); + + Call captorValue = callArgumentCaptor.getValue(); + Request actualRequest = captorValue.request(); + + assertEquals( + "productId=1&aprPeriod=DAY&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "0af754bef31bbc2eacb35fc0379a27fbebb9e93765a6b817a1c1a593149b478f", + actualRequest.url().queryParameter("signature")); + assertEquals( + "/sapi/v1/simple-earn/flexible/history/rateHistory", + actualRequest.url().encodedPath()); + } +} diff --git a/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/HistoryApiTest.java b/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/HistoryApiTest.java deleted file mode 100644 index 12ddd830e..000000000 --- a/clients/simple-earn/src/test/java/com/binance/connector/client/simple_earn/rest/api/HistoryApiTest.java +++ /dev/null @@ -1,467 +0,0 @@ -/* - * Binance Simple Earn REST API - * OpenAPI Specification for the Binance Simple Earn REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.simple_earn.rest.api; - -import static org.junit.Assert.assertEquals; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; -import com.binance.connector.client.common.auth.SignatureAuthentication; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.sign.HmacSignatureGenerator; -import com.binance.connector.client.common.sign.SignatureGenerator; -import com.binance.connector.client.simple_earn.rest.model.GetCollateralRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRedemptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRewardsHistoryResponse; -import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedRedemptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedRewardsHistoryResponse; -import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionRecordResponse; -import com.binance.connector.client.simple_earn.rest.model.GetRateHistoryResponse; -import jakarta.validation.constraints.*; -import okhttp3.Call; -import okhttp3.Request; -import org.bouncycastle.crypto.CryptoException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -/** API tests for HistoryApi */ -public class HistoryApiTest { - - private HistoryApi api; - private ApiClient apiClientSpy; - private SignatureGenerator signatureGeneratorSpy; - - @BeforeEach - public void initApiClient() throws ApiException { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - clientConfiguration.setUrl("http://localhost:8080"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setSecretKey("secretKey"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - HmacSignatureGenerator signatureGenerator = - new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); - signatureGeneratorSpy = Mockito.spy(signatureGenerator); - SignatureAuthentication signatureAuthentication = - new SignatureAuthentication( - signatureConfiguration.getApiKey(), signatureGeneratorSpy); - SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); - Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); - - BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); - Mockito.doReturn(authenticationSpy) - .when(factoryMock) - .getAuthentication(signatureConfiguration); - - ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); - - apiClientSpy = Mockito.spy(apiClient); - Mockito.doReturn(new ApiResponse<>(200, null)) - .when(apiClientSpy) - .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); - Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); - Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - - api = new HistoryApi(apiClientSpy); - } - - /** - * Get Collateral Record(USER_DATA) - * - *

Get Collateral Record * The time between `startTime` and `endTime` - * cannot be longer than 30 days. * If `startTime` and `endTime` are both - * not sent, then the last 30 days' data will be returned. * If `startTime` is - * sent but `endTime` is not sent, the next 30 days' data beginning from - * `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getCollateralRecordTest() throws ApiException, CryptoException { - String productId = "1"; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getCollateralRecord(productId, startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "productId=1&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "906323d23878072da9680bca3160b76d28b6ea07530e027f762757a381c263c0", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/history/collateralRecord", - actualRequest.url().encodedPath()); - } - - /** - * Get Flexible Redemption Record(USER_DATA) - * - *

Get Flexible Redemption Record * The time between `startTime` and - * `endTime` cannot be longer than 3 months. * If `startTime` and - * `endTime` are both not sent, then the last 30 days' data will be returned. * If - * `startTime` is sent but `endTime` is not sent, the next 30 days' data - * beginning from `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getFlexibleRedemptionRecordTest() throws ApiException, CryptoException { - String productId = "1"; - String redeemId = "1"; - String asset = ""; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getFlexibleRedemptionRecord( - productId, redeemId, asset, startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "productId=1&redeemId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "d1703f8758c55672f9a39da68d446692dde9bf216f7ebef51b7093b2a9d37bd1", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/history/redemptionRecord", - actualRequest.url().encodedPath()); - } - - /** - * Get Flexible Rewards History(USER_DATA) - * - *

Get Flexible Rewards History * The time between `startTime` and - * `endTime` cannot be longer than 3 months. * If `startTime` and - * `endTime` are both not sent, then the last 30 days' data will be returned. * If - * `startTime` is sent but `endTime` is not sent, the next 30 days' data - * beginning from `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getFlexibleRewardsHistoryTest() throws ApiException, CryptoException { - String type = "Bonus"; - String productId = "1"; - String asset = ""; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = null; - Long size = null; - Long recvWindow = null; - ApiResponse response = - api.getFlexibleRewardsHistory(type, productId, asset, startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "productId=1&asset=&startTime=1623319461670&endTime=1641782889000&type=Bonus×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "aaca82b4120f35ab3bf0bc811eb9e830f570191c637ef87b11b4e820934b3f50", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/history/rewardsRecord", - actualRequest.url().encodedPath()); - } - - /** - * Get Flexible Subscription Record(USER_DATA) - * - *

Get Flexible Subscription Record * The time between `startTime` and - * `endTime` cannot be longer than 3 months. * If `startTime` and - * `endTime` are both not sent, then the last 30 days' data will be returned. * If - * `startTime` is sent but `endTime` is not sent, the next 30 days' data - * beginning from `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getFlexibleSubscriptionRecordTest() throws ApiException, CryptoException { - String productId = "1"; - String purchaseId = "1"; - String asset = ""; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getFlexibleSubscriptionRecord( - productId, - purchaseId, - asset, - startTime, - endTime, - current, - size, - recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "productId=1&purchaseId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "e68ebd079318006615cac9e1f467bdc7c3ac82bf05a7180825541e5925b07e51", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/history/subscriptionRecord", - actualRequest.url().encodedPath()); - } - - /** - * Get Locked Redemption Record(USER_DATA) - * - *

Get Locked Redemption Record * The time between `startTime` and - * `endTime` cannot be longer than 3 months. * If `startTime` and - * `endTime` are both not sent, then the last 30 days' data will be returned. * If - * `startTime` is sent but `endTime` is not sent, the next 30 days' data - * beginning from `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getLockedRedemptionRecordTest() throws ApiException, CryptoException { - String positionId = "1"; - String redeemId = "1"; - String asset = ""; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getLockedRedemptionRecord( - positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "positionId=1&redeemId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "b969874fd814b72e7c29bdebdc319072c1dc23126f0a117b9b22f3617918204d", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/locked/history/redemptionRecord", - actualRequest.url().encodedPath()); - } - - /** - * Get Locked Rewards History(USER_DATA) - * - *

Get Locked Rewards History * The time between `startTime` and - * `endTime` cannot be longer than 3 months. * If `startTime` and - * `endTime` are both not sent, then the last 30 days' data will be returned. * If - * `startTime` is sent but `endTime` is not sent, the next 30 days' data - * beginning from `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getLockedRewardsHistoryTest() throws ApiException, CryptoException { - String positionId = "1"; - String asset = ""; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getLockedRewardsHistory( - positionId, asset, startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "positionId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "fa00e647d10a074646817619a9a8485086bbc8257eed00382562bf960d5f0143", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/locked/history/rewardsRecord", - actualRequest.url().encodedPath()); - } - - /** - * Get Locked Subscription Record(USER_DATA) - * - *

Get Locked Subscription Record * The time between `startTime` and - * `endTime` cannot be longer than 3 months. * If `startTime` and - * `endTime` are both not sent, then the last 30 days' data will be returned. * If - * `startTime` is sent but `endTime` is not sent, the next 30 days' data - * beginning from `startTime` will be returned. * If `endTime` is sent but - * `startTime` is not sent, the 30 days' data before `endTime` will be - * returned. Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getLockedSubscriptionRecordTest() throws ApiException, CryptoException { - String purchaseId = "1"; - String asset = ""; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getLockedSubscriptionRecord( - purchaseId, asset, startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "purchaseId=1&asset=&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "bd233092b66eaad8df11be01a5a41670f67daa39dfc19880a9d14424471cfba7", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/locked/history/subscriptionRecord", - actualRequest.url().encodedPath()); - } - - /** - * Get Rate History(USER_DATA) - * - *

Get Rate History * The time between startTime and endTime cannot be longer than 1 year. * - * If `startTime` and `endTime` are both not sent, then the last 30 - * days' data will be returned. * If `startTime` is sent but `endTime` - * is not sent, the next 30 days' data beginning from `startTime` will be - * returned. * If `endTime` is sent but `startTime` is not sent, the 30 - * days' data before `endTime` will be returned. Weight: 150 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getRateHistoryTest() throws ApiException, CryptoException { - String productId = "1"; - String aprPeriod = "DAY"; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long current = 1L; - Long size = 10L; - Long recvWindow = 5000L; - ApiResponse response = - api.getRateHistory( - productId, aprPeriod, startTime, endTime, current, size, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "productId=1&aprPeriod=DAY&startTime=1623319461670&endTime=1641782889000¤t=1&size=10&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "0af754bef31bbc2eacb35fc0379a27fbebb9e93765a6b817a1c1a593149b478f", - actualRequest.url().queryParameter("signature")); - assertEquals( - "/sapi/v1/simple-earn/flexible/history/rateHistory", - actualRequest.url().encodedPath()); - } -} diff --git a/clients/staking/CHANGELOG.md b/clients/staking/CHANGELOG.md index 4a217b9bc..93d2a2d4c 100644 --- a/clients/staking/CHANGELOG.md +++ b/clients/staking/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Added (3) + +- `getSoftStakingProductList()` (`GET /sapi/v1/soft-staking/list`) +- `getSoftStakingRewardsHistory()` (`GET /sapi/v1/soft-staking/history/rewardsRecord`) +- `setSoftStaking()` (`GET /sapi/v1/soft-staking/set`) + ## 2.1.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/staking/docs/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.md b/clients/staking/docs/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.md index 5f0b8c675..5a8911e6b 100644 --- a/clients/staking/docs/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.md +++ b/clients/staking/docs/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.md @@ -14,7 +14,7 @@ |**isSoldOut** | **Boolean** | | [optional] | |**apr** | **String** | | [optional] | |**status** | **String** | | [optional] | -|**subscriptionStartTime** | **String** | | [optional] | +|**subscriptionStartTime** | **Long** | | [optional] | |**canRedeemToFlex** | **Boolean** | | [optional] | diff --git a/clients/staking/docs/GetSoftStakingProductListResponse.md b/clients/staking/docs/GetSoftStakingProductListResponse.md new file mode 100644 index 000000000..fecabd845 --- /dev/null +++ b/clients/staking/docs/GetSoftStakingProductListResponse.md @@ -0,0 +1,16 @@ + + +# GetSoftStakingProductListResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **Boolean** | | [optional] | +|**totalRewardsUsdt** | **String** | | [optional] | +|**rows** | [**List<GetSoftStakingProductListResponseRowsInner>**](GetSoftStakingProductListResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/staking/docs/GetSoftStakingProductListResponseRowsInner.md b/clients/staking/docs/GetSoftStakingProductListResponseRowsInner.md new file mode 100644 index 000000000..2a70af18b --- /dev/null +++ b/clients/staking/docs/GetSoftStakingProductListResponseRowsInner.md @@ -0,0 +1,18 @@ + + +# GetSoftStakingProductListResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**asset** | **String** | | [optional] | +|**minAmount** | **String** | | [optional] | +|**maxCap** | **String** | | [optional] | +|**apr** | **String** | | [optional] | +|**stakedAmount** | **String** | | [optional] | +|**totalProfit** | **String** | | [optional] | + + + diff --git a/clients/staking/docs/GetSoftStakingRewardsHistoryResponse.md b/clients/staking/docs/GetSoftStakingRewardsHistoryResponse.md new file mode 100644 index 000000000..2c810a954 --- /dev/null +++ b/clients/staking/docs/GetSoftStakingRewardsHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetSoftStakingRewardsHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetSoftStakingRewardsHistoryResponseRowsInner>**](GetSoftStakingRewardsHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/staking/docs/GetSoftStakingRewardsHistoryResponseRowsInner.md b/clients/staking/docs/GetSoftStakingRewardsHistoryResponseRowsInner.md new file mode 100644 index 000000000..e7d7f4fd4 --- /dev/null +++ b/clients/staking/docs/GetSoftStakingRewardsHistoryResponseRowsInner.md @@ -0,0 +1,17 @@ + + +# GetSoftStakingRewardsHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**asset** | **String** | | [optional] | +|**rewards** | **String** | | [optional] | +|**rewardAsset** | **String** | | [optional] | +|**avgAmount** | **String** | | [optional] | +|**time** | **Long** | | [optional] | + + + diff --git a/clients/staking/docs/SetSoftStakingResponse.md b/clients/staking/docs/SetSoftStakingResponse.md new file mode 100644 index 000000000..09b97ebb3 --- /dev/null +++ b/clients/staking/docs/SetSoftStakingResponse.md @@ -0,0 +1,13 @@ + + +# SetSoftStakingResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/staking/docs/SoftStakingApi.md b/clients/staking/docs/SoftStakingApi.md new file mode 100644 index 000000000..252a2468b --- /dev/null +++ b/clients/staking/docs/SoftStakingApi.md @@ -0,0 +1,215 @@ +# SoftStakingApi + +All URIs are relative to *https://api.binance.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getSoftStakingProductList**](SoftStakingApi.md#getSoftStakingProductList) | **GET** /sapi/v1/soft-staking/list | Get Soft Staking Product List (USER_DATA) | +| [**getSoftStakingRewardsHistory**](SoftStakingApi.md#getSoftStakingRewardsHistory) | **GET** /sapi/v1/soft-staking/history/rewardsRecord | Get Soft Staking Rewards History(USER_DATA) | +| [**setSoftStaking**](SoftStakingApi.md#setSoftStaking) | **GET** /sapi/v1/soft-staking/set | Set Soft Staking (USER_DATA) | + + + +# **getSoftStakingProductList** +> GetSoftStakingProductListResponse getSoftStakingProductList(asset, current, size, recvWindow) + +Get Soft Staking Product List (USER_DATA) + +Get the available Soft Staking product list. Weight: 50 + +### Example +```java +// Import classes: +import com.binance.connector.client.staking.ApiClient; +import com.binance.connector.client.staking.ApiException; +import com.binance.connector.client.staking.Configuration; +import com.binance.connector.client.staking.models.*; +import com.binance.connector.client.staking.rest.api.SoftStakingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + SoftStakingApi apiInstance = new SoftStakingApi(defaultClient); + String asset = "asset_example"; // String | + Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetSoftStakingProductListResponse result = apiInstance.getSoftStakingProductList(asset, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SoftStakingApi#getSoftStakingProductList"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| | [optional] | +| **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetSoftStakingProductListResponse**](GetSoftStakingProductListResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Soft Staking Product List | - | + + +# **getSoftStakingRewardsHistory** +> GetSoftStakingRewardsHistoryResponse getSoftStakingRewardsHistory(asset, startTime, endTime, current, size, recvWindow) + +Get Soft Staking Rewards History(USER_DATA) + +* The time between `startTime` and `endTime` cannot be longer than 3 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned. * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned. Weight: 50 + +### Example +```java +// Import classes: +import com.binance.connector.client.staking.ApiClient; +import com.binance.connector.client.staking.ApiException; +import com.binance.connector.client.staking.Configuration; +import com.binance.connector.client.staking.models.*; +import com.binance.connector.client.staking.rest.api.SoftStakingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + SoftStakingApi apiInstance = new SoftStakingApi(defaultClient); + String asset = "asset_example"; // String | + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 + Long size = 56L; // Long | Default:10, Max:100 + Long recvWindow = 56L; // Long | + try { + GetSoftStakingRewardsHistoryResponse result = apiInstance.getSoftStakingRewardsHistory(asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SoftStakingApi#getSoftStakingRewardsHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | +| **size** | **Long**| Default:10, Max:100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetSoftStakingRewardsHistoryResponse**](GetSoftStakingRewardsHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Soft Staking Rewards History | - | + + +# **setSoftStaking** +> SetSoftStakingResponse setSoftStaking(softStaking, recvWindow) + +Set Soft Staking (USER_DATA) + +Enable or disable Soft Staking. Weight: 50 + +### Example +```java +// Import classes: +import com.binance.connector.client.staking.ApiClient; +import com.binance.connector.client.staking.ApiException; +import com.binance.connector.client.staking.Configuration; +import com.binance.connector.client.staking.models.*; +import com.binance.connector.client.staking.rest.api.SoftStakingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + SoftStakingApi apiInstance = new SoftStakingApi(defaultClient); + Boolean softStaking = true; // Boolean | true or false + Long recvWindow = 56L; // Long | + try { + SetSoftStakingResponse result = apiInstance.setSoftStaking(softStaking, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SoftStakingApi#setSoftStaking"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **softStaking** | **Boolean**| true or false | | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**SetSoftStakingResponse**](SetSoftStakingResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Set Soft Staking | - | + diff --git a/clients/staking/docs/rest-api/migration-guide.md b/clients/staking/docs/rest-api/migration-guide.md index f2260cf0a..69e7317f5 100644 --- a/clients/staking/docs/rest-api/migration-guide.md +++ b/clients/staking/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-staking - 2.1.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-staking - 2.1.0 + 3.0.0 ``` diff --git a/clients/staking/pom.xml b/clients/staking/pom.xml index 48319ee75..2446190ae 100644 --- a/clients/staking/pom.xml +++ b/clients/staking/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-staking staking - 2.1.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/JSON.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/JSON.java index 94616b3b2..af86761e7 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/JSON.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/JSON.java @@ -212,6 +212,18 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.staking.rest.model .GetOnChainYieldsLockedSubscriptionRecordResponseRowsInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.staking.rest.model + .GetSoftStakingProductListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.staking.rest.model + .GetSoftStakingProductListResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.staking.rest.model + .GetSoftStakingRewardsHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.staking.rest.model + .GetSoftStakingRewardsHistoryResponseRowsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.staking.rest.model.GetSolRedemptionHistoryResponse .CustomTypeAdapterFactory()); @@ -292,6 +304,9 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.staking.rest.model .SetOnChainYieldsLockedProductRedeemOptionResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.staking.rest.model.SetSoftStakingResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.staking.rest.model.SolStakingAccountResponse .CustomTypeAdapterFactory()); diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java index 944c2c53c..b20208987 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java @@ -57,7 +57,7 @@ public class EthStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/2.1.1 (Java/%s; %s; %s)", + "binance-staking/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java index f8523d50a..285973a8b 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java @@ -59,7 +59,7 @@ public class OnChainYieldsApi { private static final String USER_AGENT = String.format( - "binance-staking/2.1.1 (Java/%s; %s; %s)", + "binance-staking/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java new file mode 100644 index 000000000..75d30b93e --- /dev/null +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java @@ -0,0 +1,566 @@ +/* + * Binance Staking REST API + * OpenAPI Specification for the Binance Staking REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.api; + +import com.binance.connector.client.common.ApiClient; +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.Pair; +import com.binance.connector.client.common.SystemUtil; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.staking.rest.model.GetSoftStakingProductListResponse; +import com.binance.connector.client.staking.rest.model.GetSoftStakingRewardsHistoryResponse; +import com.binance.connector.client.staking.rest.model.SetSoftStakingResponse; +import com.google.gson.reflect.TypeToken; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.*; +import jakarta.validation.executable.ExecutableValidator; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; + +public class SoftStakingApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + private static final String USER_AGENT = + String.format( + "binance-staking/3.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private static final boolean HAS_TIME_UNIT = false; + + public SoftStakingApi(ClientConfiguration clientConfiguration) { + this(new ApiClient(clientConfiguration)); + } + + public SoftStakingApi(ApiClient apiClient) { + apiClient.setUserAgent(USER_AGENT); + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSoftStakingProductList + * + * @param asset (optional) + * @param current Currently querying page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Soft Staking Product List -
+ * + * @see Get Soft Staking + * Product List (USER_DATA) Documentation + */ + private okhttp3.Call getSoftStakingProductListCall( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/soft-staking/list"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSoftStakingProductListValidateBeforeCall( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {asset, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getSoftStakingProductList", + String.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getSoftStakingProductListCall(asset, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Soft Staking Product List (USER_DATA) Get the available Soft Staking product list. + * Weight: 50 + * + * @param asset (optional) + * @param current Currently querying page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetSoftStakingProductListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Soft Staking Product List -
+ * + * @see Get Soft Staking + * Product List (USER_DATA) Documentation + */ + public ApiResponse getSoftStakingProductList( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + getSoftStakingProductListValidateBeforeCall(asset, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getSoftStakingRewardsHistory + * + * @param asset (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Soft Staking Rewards History -
+ * + * @see Get + * Soft Staking Rewards History(USER_DATA) Documentation + */ + private okhttp3.Call getSoftStakingRewardsHistoryCall( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/soft-staking/history/rewardsRecord"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSoftStakingRewardsHistoryValidateBeforeCall( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {asset, startTime, endTime, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getSoftStakingRewardsHistory", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getSoftStakingRewardsHistoryCall( + asset, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Soft Staking Rewards History(USER_DATA) * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 50 + * + * @param asset (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetSoftStakingRewardsHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Soft Staking Rewards History -
+ * + * @see Get + * Soft Staking Rewards History(USER_DATA) Documentation + */ + public ApiResponse getSoftStakingRewardsHistory( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getSoftStakingRewardsHistoryValidateBeforeCall( + asset, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for setSoftStaking + * + * @param softStaking true or false (required) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Soft Staking -
+ * + * @see Set + * Soft Staking (USER_DATA) Documentation + */ + private okhttp3.Call setSoftStakingCall(Boolean softStaking, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/soft-staking/set"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (softStaking != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("softStaking", softStaking)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setSoftStakingValidateBeforeCall(Boolean softStaking, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {softStaking, recvWindow}; + Method method = this.getClass().getMethod("setSoftStaking", Boolean.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return setSoftStakingCall(softStaking, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Set Soft Staking (USER_DATA) Enable or disable Soft Staking. Weight: 50 + * + * @param softStaking true or false (required) + * @param recvWindow (optional) + * @return ApiResponse<SetSoftStakingResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Soft Staking -
+ * + * @see Set + * Soft Staking (USER_DATA) Documentation + */ + public ApiResponse setSoftStaking( + @NotNull Boolean softStaking, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = setSoftStakingValidateBeforeCall(softStaking, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } +} diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java index 4636d490c..22ca90671 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java @@ -57,7 +57,7 @@ public class SolStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/2.1.1 (Java/%s; %s; %s)", + "binance-staking/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java index 552028ba7..05649b4b9 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/StakingRestApi.java @@ -21,6 +21,8 @@ import com.binance.connector.client.staking.rest.model.GetOnChainYieldsLockedRewardsHistoryResponse; import com.binance.connector.client.staking.rest.model.GetOnChainYieldsLockedSubscriptionPreviewResponse; import com.binance.connector.client.staking.rest.model.GetOnChainYieldsLockedSubscriptionRecordResponse; +import com.binance.connector.client.staking.rest.model.GetSoftStakingProductListResponse; +import com.binance.connector.client.staking.rest.model.GetSoftStakingRewardsHistoryResponse; import com.binance.connector.client.staking.rest.model.GetSolRedemptionHistoryResponse; import com.binance.connector.client.staking.rest.model.GetSolStakingHistoryResponse; import com.binance.connector.client.staking.rest.model.GetSolStakingQuotaDetailsResponse; @@ -40,6 +42,7 @@ import com.binance.connector.client.staking.rest.model.SetOnChainYieldsLockedAutoSubscribeResponse; import com.binance.connector.client.staking.rest.model.SetOnChainYieldsLockedProductRedeemOptionRequest; import com.binance.connector.client.staking.rest.model.SetOnChainYieldsLockedProductRedeemOptionResponse; +import com.binance.connector.client.staking.rest.model.SetSoftStakingResponse; import com.binance.connector.client.staking.rest.model.SolStakingAccountResponse; import com.binance.connector.client.staking.rest.model.SubscribeEthStakingRequest; import com.binance.connector.client.staking.rest.model.SubscribeEthStakingResponse; @@ -54,6 +57,7 @@ public class StakingRestApi { private final EthStakingApi ethStakingApi; private final OnChainYieldsApi onChainYieldsApi; + private final SoftStakingApi softStakingApi; private final SolStakingApi solStakingApi; public StakingRestApi(ClientConfiguration configuration) { @@ -63,6 +67,7 @@ public StakingRestApi(ClientConfiguration configuration) { public StakingRestApi(ApiClient apiClient) { this.ethStakingApi = new EthStakingApi(apiClient); this.onChainYieldsApi = new OnChainYieldsApi(apiClient); + this.softStakingApi = new SoftStakingApi(apiClient); this.solStakingApi = new SolStakingApi(apiClient); } @@ -778,6 +783,91 @@ public ApiResponse redeemOnChainYields subscribeOnChainYieldsLockedProductRequest); } + /** + * Get Soft Staking Product List (USER_DATA) Get the available Soft Staking product list. + * Weight: 50 + * + * @param asset (optional) + * @param current Currently querying page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetSoftStakingProductListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Soft Staking Product List -
+ * + * @see Get Soft Staking + * Product List (USER_DATA) Documentation + */ + public ApiResponse getSoftStakingProductList( + String asset, Long current, Long size, Long recvWindow) throws ApiException { + return softStakingApi.getSoftStakingProductList(asset, current, size, recvWindow); + } + + /** + * Get Soft Staking Rewards History(USER_DATA) * The time between `startTime` and + * `endTime` cannot be longer than 3 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, the next 30 days' data + * beginning from `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 50 + * + * @param asset (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Start from 1. Default:1 (optional) + * @param size Default:10, Max:100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetSoftStakingRewardsHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Soft Staking Rewards History -
+ * + * @see Get + * Soft Staking Rewards History(USER_DATA) Documentation + */ + public ApiResponse getSoftStakingRewardsHistory( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + return softStakingApi.getSoftStakingRewardsHistory( + asset, startTime, endTime, current, size, recvWindow); + } + + /** + * Set Soft Staking (USER_DATA) Enable or disable Soft Staking. Weight: 50 + * + * @param softStaking true or false (required) + * @param recvWindow (optional) + * @return ApiResponse<SetSoftStakingResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Set Soft Staking -
+ * + * @see Set + * Soft Staking (USER_DATA) Documentation + */ + public ApiResponse setSoftStaking(Boolean softStaking, Long recvWindow) + throws ApiException { + return softStakingApi.setSoftStaking(softStaking, recvWindow); + } + /** * Claim Boost Rewards(TRADE) Claim Boost APR Airdrop Rewards * You need to open Enable Spot * & Margin Trading permission for the API Key which requests this endpoint. Weight: 150 diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.java index 4f99f1d57..4905616fa 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetOnChainYieldsLockedProductListResponseRowsInnerDetail.java @@ -82,7 +82,7 @@ public class GetOnChainYieldsLockedProductListResponseRowsInnerDetail { @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_START_TIME) @jakarta.annotation.Nullable - private String subscriptionStartTime; + private Long subscriptionStartTime; public static final String SERIALIZED_NAME_CAN_REDEEM_TO_FLEX = "canRedeemToFlex"; @@ -233,7 +233,7 @@ public void setStatus(@jakarta.annotation.Nullable String status) { } public GetOnChainYieldsLockedProductListResponseRowsInnerDetail subscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { + @jakarta.annotation.Nullable Long subscriptionStartTime) { this.subscriptionStartTime = subscriptionStartTime; return this; } @@ -244,12 +244,11 @@ public GetOnChainYieldsLockedProductListResponseRowsInnerDetail subscriptionStar * @return subscriptionStartTime */ @jakarta.annotation.Nullable - public String getSubscriptionStartTime() { + public Long getSubscriptionStartTime() { return subscriptionStartTime; } - public void setSubscriptionStartTime( - @jakarta.annotation.Nullable String subscriptionStartTime) { + public void setSubscriptionStartTime(@jakarta.annotation.Nullable Long subscriptionStartTime) { this.subscriptionStartTime = subscriptionStartTime; } @@ -482,15 +481,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("status").toString())); } - if ((jsonObj.get("subscriptionStartTime") != null - && !jsonObj.get("subscriptionStartTime").isJsonNull()) - && !jsonObj.get("subscriptionStartTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `subscriptionStartTime` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("subscriptionStartTime").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponse.java new file mode 100644 index 000000000..f819a77bb --- /dev/null +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponse.java @@ -0,0 +1,359 @@ +/* + * Binance Staking REST API + * OpenAPI Specification for the Binance Staking REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.model; + +import com.binance.connector.client.staking.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetSoftStakingProductListResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetSoftStakingProductListResponse { + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private Boolean status; + + public static final String SERIALIZED_NAME_TOTAL_REWARDS_USDT = "totalRewardsUsdt"; + + @SerializedName(SERIALIZED_NAME_TOTAL_REWARDS_USDT) + @jakarta.annotation.Nullable + private String totalRewardsUsdt; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetSoftStakingProductListResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetSoftStakingProductListResponse() {} + + public GetSoftStakingProductListResponse status(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public Boolean getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable Boolean status) { + this.status = status; + } + + public GetSoftStakingProductListResponse totalRewardsUsdt( + @jakarta.annotation.Nullable String totalRewardsUsdt) { + this.totalRewardsUsdt = totalRewardsUsdt; + return this; + } + + /** + * Get totalRewardsUsdt + * + * @return totalRewardsUsdt + */ + @jakarta.annotation.Nullable + public String getTotalRewardsUsdt() { + return totalRewardsUsdt; + } + + public void setTotalRewardsUsdt(@jakarta.annotation.Nullable String totalRewardsUsdt) { + this.totalRewardsUsdt = totalRewardsUsdt; + } + + public GetSoftStakingProductListResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetSoftStakingProductListResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetSoftStakingProductListResponse addRowsItem( + GetSoftStakingProductListResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetSoftStakingProductListResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetSoftStakingProductListResponseRowsInner> rows) { + this.rows = rows; + } + + public GetSoftStakingProductListResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSoftStakingProductListResponse getSoftStakingProductListResponse = + (GetSoftStakingProductListResponse) o; + return Objects.equals(this.status, getSoftStakingProductListResponse.status) + && Objects.equals( + this.totalRewardsUsdt, getSoftStakingProductListResponse.totalRewardsUsdt) + && Objects.equals(this.rows, getSoftStakingProductListResponse.rows) + && Objects.equals(this.total, getSoftStakingProductListResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(status, totalRewardsUsdt, rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSoftStakingProductListResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" totalRewardsUsdt: ").append(toIndentedString(totalRewardsUsdt)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object totalRewardsUsdtValue = getTotalRewardsUsdt(); + String totalRewardsUsdtValueAsString = ""; + totalRewardsUsdtValueAsString = totalRewardsUsdtValue.toString(); + sb.append("totalRewardsUsdt=").append(urlEncode(totalRewardsUsdtValueAsString)).append(""); + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("totalRewardsUsdt"); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetSoftStakingProductListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSoftStakingProductListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSoftStakingProductListResponse is" + + " not found in the empty JSON string", + GetSoftStakingProductListResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("totalRewardsUsdt") != null + && !jsonObj.get("totalRewardsUsdt").isJsonNull()) + && !jsonObj.get("totalRewardsUsdt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalRewardsUsdt` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("totalRewardsUsdt").toString())); + } + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetSoftStakingProductListResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSoftStakingProductListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSoftStakingProductListResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetSoftStakingProductListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSoftStakingProductListResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSoftStakingProductListResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSoftStakingProductListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSoftStakingProductListResponse + * @throws IOException if the JSON string is invalid with respect to + * GetSoftStakingProductListResponse + */ + public static GetSoftStakingProductListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSoftStakingProductListResponse.class); + } + + /** + * Convert an instance of GetSoftStakingProductListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponseRowsInner.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponseRowsInner.java new file mode 100644 index 000000000..cd4a3d416 --- /dev/null +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingProductListResponseRowsInner.java @@ -0,0 +1,430 @@ +/* + * Binance Staking REST API + * OpenAPI Specification for the Binance Staking REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.model; + +import com.binance.connector.client.staking.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetSoftStakingProductListResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetSoftStakingProductListResponseRowsInner { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_MIN_AMOUNT = "minAmount"; + + @SerializedName(SERIALIZED_NAME_MIN_AMOUNT) + @jakarta.annotation.Nullable + private String minAmount; + + public static final String SERIALIZED_NAME_MAX_CAP = "maxCap"; + + @SerializedName(SERIALIZED_NAME_MAX_CAP) + @jakarta.annotation.Nullable + private String maxCap; + + public static final String SERIALIZED_NAME_APR = "apr"; + + @SerializedName(SERIALIZED_NAME_APR) + @jakarta.annotation.Nullable + private String apr; + + public static final String SERIALIZED_NAME_STAKED_AMOUNT = "stakedAmount"; + + @SerializedName(SERIALIZED_NAME_STAKED_AMOUNT) + @jakarta.annotation.Nullable + private String stakedAmount; + + public static final String SERIALIZED_NAME_TOTAL_PROFIT = "totalProfit"; + + @SerializedName(SERIALIZED_NAME_TOTAL_PROFIT) + @jakarta.annotation.Nullable + private String totalProfit; + + public GetSoftStakingProductListResponseRowsInner() {} + + public GetSoftStakingProductListResponseRowsInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetSoftStakingProductListResponseRowsInner minAmount( + @jakarta.annotation.Nullable String minAmount) { + this.minAmount = minAmount; + return this; + } + + /** + * Get minAmount + * + * @return minAmount + */ + @jakarta.annotation.Nullable + public String getMinAmount() { + return minAmount; + } + + public void setMinAmount(@jakarta.annotation.Nullable String minAmount) { + this.minAmount = minAmount; + } + + public GetSoftStakingProductListResponseRowsInner maxCap( + @jakarta.annotation.Nullable String maxCap) { + this.maxCap = maxCap; + return this; + } + + /** + * Get maxCap + * + * @return maxCap + */ + @jakarta.annotation.Nullable + public String getMaxCap() { + return maxCap; + } + + public void setMaxCap(@jakarta.annotation.Nullable String maxCap) { + this.maxCap = maxCap; + } + + public GetSoftStakingProductListResponseRowsInner apr(@jakarta.annotation.Nullable String apr) { + this.apr = apr; + return this; + } + + /** + * Get apr + * + * @return apr + */ + @jakarta.annotation.Nullable + public String getApr() { + return apr; + } + + public void setApr(@jakarta.annotation.Nullable String apr) { + this.apr = apr; + } + + public GetSoftStakingProductListResponseRowsInner stakedAmount( + @jakarta.annotation.Nullable String stakedAmount) { + this.stakedAmount = stakedAmount; + return this; + } + + /** + * Get stakedAmount + * + * @return stakedAmount + */ + @jakarta.annotation.Nullable + public String getStakedAmount() { + return stakedAmount; + } + + public void setStakedAmount(@jakarta.annotation.Nullable String stakedAmount) { + this.stakedAmount = stakedAmount; + } + + public GetSoftStakingProductListResponseRowsInner totalProfit( + @jakarta.annotation.Nullable String totalProfit) { + this.totalProfit = totalProfit; + return this; + } + + /** + * Get totalProfit + * + * @return totalProfit + */ + @jakarta.annotation.Nullable + public String getTotalProfit() { + return totalProfit; + } + + public void setTotalProfit(@jakarta.annotation.Nullable String totalProfit) { + this.totalProfit = totalProfit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSoftStakingProductListResponseRowsInner getSoftStakingProductListResponseRowsInner = + (GetSoftStakingProductListResponseRowsInner) o; + return Objects.equals(this.asset, getSoftStakingProductListResponseRowsInner.asset) + && Objects.equals( + this.minAmount, getSoftStakingProductListResponseRowsInner.minAmount) + && Objects.equals(this.maxCap, getSoftStakingProductListResponseRowsInner.maxCap) + && Objects.equals(this.apr, getSoftStakingProductListResponseRowsInner.apr) + && Objects.equals( + this.stakedAmount, getSoftStakingProductListResponseRowsInner.stakedAmount) + && Objects.equals( + this.totalProfit, getSoftStakingProductListResponseRowsInner.totalProfit); + } + + @Override + public int hashCode() { + return Objects.hash(asset, minAmount, maxCap, apr, stakedAmount, totalProfit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSoftStakingProductListResponseRowsInner {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" minAmount: ").append(toIndentedString(minAmount)).append("\n"); + sb.append(" maxCap: ").append(toIndentedString(maxCap)).append("\n"); + sb.append(" apr: ").append(toIndentedString(apr)).append("\n"); + sb.append(" stakedAmount: ").append(toIndentedString(stakedAmount)).append("\n"); + sb.append(" totalProfit: ").append(toIndentedString(totalProfit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object minAmountValue = getMinAmount(); + String minAmountValueAsString = ""; + minAmountValueAsString = minAmountValue.toString(); + sb.append("minAmount=").append(urlEncode(minAmountValueAsString)).append(""); + Object maxCapValue = getMaxCap(); + String maxCapValueAsString = ""; + maxCapValueAsString = maxCapValue.toString(); + sb.append("maxCap=").append(urlEncode(maxCapValueAsString)).append(""); + Object aprValue = getApr(); + String aprValueAsString = ""; + aprValueAsString = aprValue.toString(); + sb.append("apr=").append(urlEncode(aprValueAsString)).append(""); + Object stakedAmountValue = getStakedAmount(); + String stakedAmountValueAsString = ""; + stakedAmountValueAsString = stakedAmountValue.toString(); + sb.append("stakedAmount=").append(urlEncode(stakedAmountValueAsString)).append(""); + Object totalProfitValue = getTotalProfit(); + String totalProfitValueAsString = ""; + totalProfitValueAsString = totalProfitValue.toString(); + sb.append("totalProfit=").append(urlEncode(totalProfitValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asset"); + openapiFields.add("minAmount"); + openapiFields.add("maxCap"); + openapiFields.add("apr"); + openapiFields.add("stakedAmount"); + openapiFields.add("totalProfit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetSoftStakingProductListResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSoftStakingProductListResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetSoftStakingProductListResponseRowsInner is not found in" + + " the empty JSON string", + GetSoftStakingProductListResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("minAmount") != null && !jsonObj.get("minAmount").isJsonNull()) + && !jsonObj.get("minAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minAmount").toString())); + } + if ((jsonObj.get("maxCap") != null && !jsonObj.get("maxCap").isJsonNull()) + && !jsonObj.get("maxCap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxCap` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxCap").toString())); + } + if ((jsonObj.get("apr") != null && !jsonObj.get("apr").isJsonNull()) + && !jsonObj.get("apr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `apr` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("apr").toString())); + } + if ((jsonObj.get("stakedAmount") != null && !jsonObj.get("stakedAmount").isJsonNull()) + && !jsonObj.get("stakedAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stakedAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stakedAmount").toString())); + } + if ((jsonObj.get("totalProfit") != null && !jsonObj.get("totalProfit").isJsonNull()) + && !jsonObj.get("totalProfit").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalProfit` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("totalProfit").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSoftStakingProductListResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetSoftStakingProductListResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetSoftStakingProductListResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetSoftStakingProductListResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSoftStakingProductListResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSoftStakingProductListResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSoftStakingProductListResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetSoftStakingProductListResponseRowsInner + */ + public static GetSoftStakingProductListResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetSoftStakingProductListResponseRowsInner.class); + } + + /** + * Convert an instance of GetSoftStakingProductListResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponse.java new file mode 100644 index 000000000..b9805e048 --- /dev/null +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponse.java @@ -0,0 +1,286 @@ +/* + * Binance Staking REST API + * OpenAPI Specification for the Binance Staking REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.model; + +import com.binance.connector.client.staking.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetSoftStakingRewardsHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetSoftStakingRewardsHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetSoftStakingRewardsHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetSoftStakingRewardsHistoryResponse() {} + + public GetSoftStakingRewardsHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetSoftStakingRewardsHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetSoftStakingRewardsHistoryResponse addRowsItem( + GetSoftStakingRewardsHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetSoftStakingRewardsHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetSoftStakingRewardsHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetSoftStakingRewardsHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSoftStakingRewardsHistoryResponse getSoftStakingRewardsHistoryResponse = + (GetSoftStakingRewardsHistoryResponse) o; + return Objects.equals(this.rows, getSoftStakingRewardsHistoryResponse.rows) + && Objects.equals(this.total, getSoftStakingRewardsHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSoftStakingRewardsHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetSoftStakingRewardsHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSoftStakingRewardsHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSoftStakingRewardsHistoryResponse" + + " is not found in the empty JSON string", + GetSoftStakingRewardsHistoryResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetSoftStakingRewardsHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSoftStakingRewardsHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSoftStakingRewardsHistoryResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetSoftStakingRewardsHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetSoftStakingRewardsHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSoftStakingRewardsHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSoftStakingRewardsHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSoftStakingRewardsHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetSoftStakingRewardsHistoryResponse + */ + public static GetSoftStakingRewardsHistoryResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetSoftStakingRewardsHistoryResponse.class); + } + + /** + * Convert an instance of GetSoftStakingRewardsHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponseRowsInner.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponseRowsInner.java new file mode 100644 index 000000000..a658d9ab5 --- /dev/null +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetSoftStakingRewardsHistoryResponseRowsInner.java @@ -0,0 +1,384 @@ +/* + * Binance Staking REST API + * OpenAPI Specification for the Binance Staking REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.model; + +import com.binance.connector.client.staking.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetSoftStakingRewardsHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetSoftStakingRewardsHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_REWARDS = "rewards"; + + @SerializedName(SERIALIZED_NAME_REWARDS) + @jakarta.annotation.Nullable + private String rewards; + + public static final String SERIALIZED_NAME_REWARD_ASSET = "rewardAsset"; + + @SerializedName(SERIALIZED_NAME_REWARD_ASSET) + @jakarta.annotation.Nullable + private String rewardAsset; + + public static final String SERIALIZED_NAME_AVG_AMOUNT = "avgAmount"; + + @SerializedName(SERIALIZED_NAME_AVG_AMOUNT) + @jakarta.annotation.Nullable + private String avgAmount; + + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public GetSoftStakingRewardsHistoryResponseRowsInner() {} + + public GetSoftStakingRewardsHistoryResponseRowsInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetSoftStakingRewardsHistoryResponseRowsInner rewards( + @jakarta.annotation.Nullable String rewards) { + this.rewards = rewards; + return this; + } + + /** + * Get rewards + * + * @return rewards + */ + @jakarta.annotation.Nullable + public String getRewards() { + return rewards; + } + + public void setRewards(@jakarta.annotation.Nullable String rewards) { + this.rewards = rewards; + } + + public GetSoftStakingRewardsHistoryResponseRowsInner rewardAsset( + @jakarta.annotation.Nullable String rewardAsset) { + this.rewardAsset = rewardAsset; + return this; + } + + /** + * Get rewardAsset + * + * @return rewardAsset + */ + @jakarta.annotation.Nullable + public String getRewardAsset() { + return rewardAsset; + } + + public void setRewardAsset(@jakarta.annotation.Nullable String rewardAsset) { + this.rewardAsset = rewardAsset; + } + + public GetSoftStakingRewardsHistoryResponseRowsInner avgAmount( + @jakarta.annotation.Nullable String avgAmount) { + this.avgAmount = avgAmount; + return this; + } + + /** + * Get avgAmount + * + * @return avgAmount + */ + @jakarta.annotation.Nullable + public String getAvgAmount() { + return avgAmount; + } + + public void setAvgAmount(@jakarta.annotation.Nullable String avgAmount) { + this.avgAmount = avgAmount; + } + + public GetSoftStakingRewardsHistoryResponseRowsInner time( + @jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSoftStakingRewardsHistoryResponseRowsInner + getSoftStakingRewardsHistoryResponseRowsInner = + (GetSoftStakingRewardsHistoryResponseRowsInner) o; + return Objects.equals(this.asset, getSoftStakingRewardsHistoryResponseRowsInner.asset) + && Objects.equals( + this.rewards, getSoftStakingRewardsHistoryResponseRowsInner.rewards) + && Objects.equals( + this.rewardAsset, getSoftStakingRewardsHistoryResponseRowsInner.rewardAsset) + && Objects.equals( + this.avgAmount, getSoftStakingRewardsHistoryResponseRowsInner.avgAmount) + && Objects.equals(this.time, getSoftStakingRewardsHistoryResponseRowsInner.time); + } + + @Override + public int hashCode() { + return Objects.hash(asset, rewards, rewardAsset, avgAmount, time); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSoftStakingRewardsHistoryResponseRowsInner {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" rewards: ").append(toIndentedString(rewards)).append("\n"); + sb.append(" rewardAsset: ").append(toIndentedString(rewardAsset)).append("\n"); + sb.append(" avgAmount: ").append(toIndentedString(avgAmount)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object rewardsValue = getRewards(); + String rewardsValueAsString = ""; + rewardsValueAsString = rewardsValue.toString(); + sb.append("rewards=").append(urlEncode(rewardsValueAsString)).append(""); + Object rewardAssetValue = getRewardAsset(); + String rewardAssetValueAsString = ""; + rewardAssetValueAsString = rewardAssetValue.toString(); + sb.append("rewardAsset=").append(urlEncode(rewardAssetValueAsString)).append(""); + Object avgAmountValue = getAvgAmount(); + String avgAmountValueAsString = ""; + avgAmountValueAsString = avgAmountValue.toString(); + sb.append("avgAmount=").append(urlEncode(avgAmountValueAsString)).append(""); + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asset"); + openapiFields.add("rewards"); + openapiFields.add("rewardAsset"); + openapiFields.add("avgAmount"); + openapiFields.add("time"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetSoftStakingRewardsHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSoftStakingRewardsHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetSoftStakingRewardsHistoryResponseRowsInner is not found" + + " in the empty JSON string", + GetSoftStakingRewardsHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("rewards") != null && !jsonObj.get("rewards").isJsonNull()) + && !jsonObj.get("rewards").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rewards` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("rewards").toString())); + } + if ((jsonObj.get("rewardAsset") != null && !jsonObj.get("rewardAsset").isJsonNull()) + && !jsonObj.get("rewardAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rewardAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rewardAsset").toString())); + } + if ((jsonObj.get("avgAmount") != null && !jsonObj.get("avgAmount").isJsonNull()) + && !jsonObj.get("avgAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avgAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("avgAmount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSoftStakingRewardsHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetSoftStakingRewardsHistoryResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetSoftStakingRewardsHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetSoftStakingRewardsHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSoftStakingRewardsHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSoftStakingRewardsHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSoftStakingRewardsHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetSoftStakingRewardsHistoryResponseRowsInner + */ + public static GetSoftStakingRewardsHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetSoftStakingRewardsHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetSoftStakingRewardsHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SetSoftStakingResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SetSoftStakingResponse.java new file mode 100644 index 000000000..11561c534 --- /dev/null +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/SetSoftStakingResponse.java @@ -0,0 +1,202 @@ +/* + * Binance Staking REST API + * OpenAPI Specification for the Binance Staking REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.model; + +import com.binance.connector.client.staking.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SetSoftStakingResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SetSoftStakingResponse { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public SetSoftStakingResponse() {} + + public SetSoftStakingResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Get success + * + * @return success + */ + @jakarta.annotation.Nullable + public Boolean getSuccess() { + return success; + } + + public void setSuccess(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetSoftStakingResponse setSoftStakingResponse = (SetSoftStakingResponse) o; + return Objects.equals(this.success, setSoftStakingResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetSoftStakingResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object successValue = getSuccess(); + String successValueAsString = ""; + successValueAsString = successValue.toString(); + sb.append("success=").append(urlEncode(successValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SetSoftStakingResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetSoftStakingResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SetSoftStakingResponse is not found in" + + " the empty JSON string", + SetSoftStakingResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetSoftStakingResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetSoftStakingResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SetSoftStakingResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SetSoftStakingResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetSoftStakingResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SetSoftStakingResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetSoftStakingResponse + * @throws IOException if the JSON string is invalid with respect to SetSoftStakingResponse + */ + public static SetSoftStakingResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetSoftStakingResponse.class); + } + + /** + * Convert an instance of SetSoftStakingResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/sub-account/docs/rest-api/migration-guide.md b/clients/sub-account/docs/rest-api/migration-guide.md index 139e08444..6bf784f4f 100644 --- a/clients/sub-account/docs/rest-api/migration-guide.md +++ b/clients/sub-account/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-sub-account - 3.0.0 + 3.0.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-sub-account - 3.0.0 + 3.0.1 ``` diff --git a/clients/vip-loan/CHANGELOG.md b/clients/vip-loan/CHANGELOG.md index f26956034..3dad0479a 100644 --- a/clients/vip-loan/CHANGELOG.md +++ b/clients/vip-loan/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.0.0 - 2025-09-22 + +### Changed (1) + +- Added parameter `loanTerm` + - affected methods: + - `vipLoanBorrow()` (`POST /sapi/v1/loan/vip/borrow`) + ## 1.2.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/vip-loan/docs/VipLoanBorrowRequest.md b/clients/vip-loan/docs/VipLoanBorrowRequest.md index ba0dbaba2..63e4fb250 100644 --- a/clients/vip-loan/docs/VipLoanBorrowRequest.md +++ b/clients/vip-loan/docs/VipLoanBorrowRequest.md @@ -13,6 +13,7 @@ |**collateralAccountId** | **Long** | | | |**collateralCoin** | **String** | | | |**isFlexibleRate** | **Boolean** | | | +|**loanTerm** | **Long** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/vip-loan/docs/VipLoanBorrowResponse1.md b/clients/vip-loan/docs/VipLoanBorrowResponse1.md deleted file mode 100644 index d92ec4909..000000000 --- a/clients/vip-loan/docs/VipLoanBorrowResponse1.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# VipLoanBorrowResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanAccountId** | **String** | | [optional] | -|**requestId** | **String** | | [optional] | -|**loanCoin** | **String** | | [optional] | -|**isFlexibleRate** | **String** | | [optional] | -|**loanAmount** | **String** | | [optional] | -|**collateralAccountId** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | -|**loanTerm** | **String** | | [optional] | - - - diff --git a/clients/vip-loan/docs/VipLoanBorrowResponse2.md b/clients/vip-loan/docs/VipLoanBorrowResponse2.md deleted file mode 100644 index 82a864f0c..000000000 --- a/clients/vip-loan/docs/VipLoanBorrowResponse2.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# VipLoanBorrowResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**loanAccountId** | **String** | | [optional] | -|**requestId** | **String** | | [optional] | -|**loanCoin** | **String** | | [optional] | -|**isFlexibleRate** | **String** | | [optional] | -|**loanAmount** | **String** | | [optional] | -|**collateralAccountId** | **String** | | [optional] | -|**collateralCoin** | **String** | | [optional] | - - - diff --git a/clients/vip-loan/docs/rest-api/migration-guide.md b/clients/vip-loan/docs/rest-api/migration-guide.md index f86c16ce5..f556ce5c5 100644 --- a/clients/vip-loan/docs/rest-api/migration-guide.md +++ b/clients/vip-loan/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-vip-loan - 1.2.0 + 2.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-vip-loan - 1.2.0 + 2.0.0 ``` diff --git a/clients/vip-loan/pom.xml b/clients/vip-loan/pom.xml index 28400e3bf..a05efd3dc 100644 --- a/clients/vip-loan/pom.xml +++ b/clients/vip-loan/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-vip-loan vip-loan - 1.2.1 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java index 5f994a997..efb0ff51e 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java @@ -44,7 +44,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-vip-loan/1.2.1 (Java/%s; %s; %s)", + "binance-vip-loan/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java index 6d51eed4d..259ceb5d1 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java @@ -49,7 +49,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-vip-loan/1.2.1 (Java/%s; %s; %s)", + "binance-vip-loan/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -155,6 +155,10 @@ private okhttp3.Call vipLoanBorrowCall(VipLoanBorrowRequest vipLoanBorrowRequest localVarFormParams.put("isFlexibleRate", vipLoanBorrowRequest.getIsFlexibleRate()); } + if (vipLoanBorrowRequest.getLoanTerm() != null) { + localVarFormParams.put("loanTerm", vipLoanBorrowRequest.getLoanTerm()); + } + if (vipLoanBorrowRequest.getRecvWindow() != null) { localVarFormParams.put("recvWindow", vipLoanBorrowRequest.getRecvWindow()); } diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java index 5bdcc973c..539d84e1e 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java @@ -44,7 +44,7 @@ public class UserInformationApi { private static final String USER_AGENT = String.format( - "binance-vip-loan/1.2.1 (Java/%s; %s; %s)", + "binance-vip-loan/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/VipLoanBorrowRequest.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/VipLoanBorrowRequest.java index cce315588..c91242bce 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/VipLoanBorrowRequest.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/VipLoanBorrowRequest.java @@ -73,6 +73,12 @@ public class VipLoanBorrowRequest { @jakarta.annotation.Nonnull private Boolean isFlexibleRate; + public static final String SERIALIZED_NAME_LOAN_TERM = "loanTerm"; + + @SerializedName(SERIALIZED_NAME_LOAN_TERM) + @jakarta.annotation.Nullable + private Long loanTerm; + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -203,6 +209,25 @@ public void setIsFlexibleRate(@jakarta.annotation.Nonnull Boolean isFlexibleRate this.isFlexibleRate = isFlexibleRate; } + public VipLoanBorrowRequest loanTerm(@jakarta.annotation.Nullable Long loanTerm) { + this.loanTerm = loanTerm; + return this; + } + + /** + * Get loanTerm + * + * @return loanTerm + */ + @jakarta.annotation.Nullable + public Long getLoanTerm() { + return loanTerm; + } + + public void setLoanTerm(@jakarta.annotation.Nullable Long loanTerm) { + this.loanTerm = loanTerm; + } + public VipLoanBorrowRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { this.recvWindow = recvWindow; return this; @@ -238,6 +263,7 @@ public boolean equals(Object o) { this.collateralAccountId, vipLoanBorrowRequest.collateralAccountId) && Objects.equals(this.collateralCoin, vipLoanBorrowRequest.collateralCoin) && Objects.equals(this.isFlexibleRate, vipLoanBorrowRequest.isFlexibleRate) + && Objects.equals(this.loanTerm, vipLoanBorrowRequest.loanTerm) && Objects.equals(this.recvWindow, vipLoanBorrowRequest.recvWindow); } @@ -250,6 +276,7 @@ public int hashCode() { collateralAccountId, collateralCoin, isFlexibleRate, + loanTerm, recvWindow); } @@ -265,6 +292,7 @@ public String toString() { .append("\n"); sb.append(" collateralCoin: ").append(toIndentedString(collateralCoin)).append("\n"); sb.append(" isFlexibleRate: ").append(toIndentedString(isFlexibleRate)).append("\n"); + sb.append(" loanTerm: ").append(toIndentedString(loanTerm)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -299,6 +327,10 @@ public String toUrlQueryString() { String isFlexibleRateValueAsString = ""; isFlexibleRateValueAsString = isFlexibleRateValue.toString(); sb.append("isFlexibleRate=").append(urlEncode(isFlexibleRateValueAsString)).append(""); + Object loanTermValue = getLoanTerm(); + String loanTermValueAsString = ""; + loanTermValueAsString = loanTermValue.toString(); + sb.append("loanTerm=").append(urlEncode(loanTermValueAsString)).append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -337,6 +369,7 @@ private String toIndentedString(Object o) { openapiFields.add("collateralAccountId"); openapiFields.add("collateralCoin"); openapiFields.add("isFlexibleRate"); + openapiFields.add("loanTerm"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) diff --git a/clients/wallet/CHANGELOG.md b/clients/wallet/CHANGELOG.md index 3a0974884..72bfa5b51 100644 --- a/clients/wallet/CHANGELOG.md +++ b/clients/wallet/CHANGELOG.md @@ -1,6 +1,16 @@ # Changelog +## 3.0.0 - 2025-09-22 + +### Changed (1) + +- Modified response for `depositHistory()` (`GET /sapi/v1/capital/deposit/hisrec`): + - item property `travelRuleStatus` added +- Modified response for `allCoinsInformation()` (`GET /sapi/v1/capital/config/getall`): + - `networkList`: item property `withdrawTag` added + ## 2.1.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/wallet/docs/AllCoinsInformationResponseInner.md b/clients/wallet/docs/AllCoinsInformationResponseInner.md index 1e615ae2a..28ae8890d 100644 --- a/clients/wallet/docs/AllCoinsInformationResponseInner.md +++ b/clients/wallet/docs/AllCoinsInformationResponseInner.md @@ -9,18 +9,18 @@ |------------ | ------------- | ------------- | -------------| |**coin** | **String** | | [optional] | |**depositAllEnable** | **Boolean** | | [optional] | +|**withdrawAllEnable** | **Boolean** | | [optional] | +|**name** | **String** | | [optional] | |**free** | **String** | | [optional] | +|**locked** | **String** | | [optional] | |**freeze** | **String** | | [optional] | -|**ipoable** | **String** | | [optional] | +|**withdrawing** | **String** | | [optional] | |**ipoing** | **String** | | [optional] | -|**isLegalMoney** | **Boolean** | | [optional] | -|**locked** | **String** | | [optional] | -|**name** | **String** | | [optional] | -|**networkList** | [**List<AllCoinsInformationResponseInnerNetworkListInner>**](AllCoinsInformationResponseInnerNetworkListInner.md) | | [optional] | +|**ipoable** | **String** | | [optional] | |**storage** | **String** | | [optional] | +|**isLegalMoney** | **Boolean** | | [optional] | |**trading** | **Boolean** | | [optional] | -|**withdrawAllEnable** | **Boolean** | | [optional] | -|**withdrawing** | **String** | | [optional] | +|**networkList** | [**List<AllCoinsInformationResponseInnerNetworkListInner>**](AllCoinsInformationResponseInnerNetworkListInner.md) | | [optional] | diff --git a/clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInner.md b/clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInner.md index 16912029e..e38c6d314 100644 --- a/clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInner.md +++ b/clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInner.md @@ -7,41 +7,34 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**addressRegex** | **String** | | [optional] | +|**network** | **String** | | [optional] | |**coin** | **String** | | [optional] | -|**depositDesc** | **String** | | [optional] | -|**depositEnable** | **Boolean** | | [optional] | +|**withdrawIntegerMultiple** | **String** | | [optional] | |**isDefault** | **Boolean** | | [optional] | -|**memoRegex** | **String** | | [optional] | -|**minConfirm** | **Long** | | [optional] | -|**name** | **String** | | [optional] | -|**network** | **String** | | [optional] | -|**specialTips** | **String** | | [optional] | -|**unLockConfirm** | **Long** | | [optional] | -|**withdrawDesc** | **String** | | [optional] | +|**depositEnable** | **Boolean** | | [optional] | |**withdrawEnable** | **Boolean** | | [optional] | +|**depositDesc** | **String** | | [optional] | +|**withdrawDesc** | **String** | | [optional] | +|**specialTips** | **String** | | [optional] | +|**specialWithdrawTips** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**resetAddressStatus** | **Boolean** | | [optional] | +|**addressRegex** | **String** | | [optional] | +|**memoRegex** | **String** | | [optional] | |**withdrawFee** | **String** | | [optional] | -|**withdrawIntegerMultiple** | **String** | | [optional] | -|**withdrawMax** | **String** | | [optional] | |**withdrawMin** | **String** | | [optional] | +|**withdrawMax** | **String** | | [optional] | |**withdrawInternalMin** | **String** | | [optional] | +|**depositDust** | **String** | | [optional] | +|**minConfirm** | **Long** | | [optional] | +|**unLockConfirm** | **Long** | | [optional] | |**sameAddress** | **Boolean** | | [optional] | +|**withdrawTag** | **Boolean** | | [optional] | |**estimatedArrivalTime** | **Long** | | [optional] | |**busy** | **Boolean** | | [optional] | |**contractAddressUrl** | **String** | | [optional] | |**contractAddress** | **String** | | [optional] | -|**depositAllEnable** | **Boolean** | | [optional] | -|**withdrawAllEnable** | **Boolean** | | [optional] | -|**free** | **String** | | [optional] | -|**locked** | **String** | | [optional] | -|**freeze** | **String** | | [optional] | -|**withdrawing** | **String** | | [optional] | -|**ipoing** | **String** | | [optional] | -|**ipoable** | **String** | | [optional] | -|**storage** | **String** | | [optional] | -|**isLegalMoney** | **Boolean** | | [optional] | -|**trading** | **Boolean** | | [optional] | -|**networkList** | [**List<AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner>**](AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.md) | | [optional] | +|**denomination** | **Long** | | [optional] | diff --git a/clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.md b/clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.md deleted file mode 100644 index 3de18f807..000000000 --- a/clients/wallet/docs/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.md +++ /dev/null @@ -1,39 +0,0 @@ - - -# AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**network** | **String** | | [optional] | -|**coin** | **String** | | [optional] | -|**withdrawIntegerMultiple** | **String** | | [optional] | -|**isDefault** | **Boolean** | | [optional] | -|**depositEnable** | **Boolean** | | [optional] | -|**withdrawEnable** | **Boolean** | | [optional] | -|**depositDesc** | **String** | | [optional] | -|**withdrawDesc** | **String** | | [optional] | -|**specialTips** | **String** | | [optional] | -|**specialWithdrawTips** | **String** | | [optional] | -|**name** | **String** | | [optional] | -|**resetAddressStatus** | **Boolean** | | [optional] | -|**addressRegex** | **String** | | [optional] | -|**memoRegex** | **String** | | [optional] | -|**withdrawFee** | **String** | | [optional] | -|**withdrawMin** | **String** | | [optional] | -|**withdrawMax** | **String** | | [optional] | -|**withdrawInternalMin** | **String** | | [optional] | -|**depositDust** | **String** | | [optional] | -|**minConfirm** | **Long** | | [optional] | -|**unLockConfirm** | **Long** | | [optional] | -|**sameAddress** | **Boolean** | | [optional] | -|**estimatedArrivalTime** | **Long** | | [optional] | -|**busy** | **Boolean** | | [optional] | -|**contractAddressUrl** | **String** | | [optional] | -|**contractAddress** | **String** | | [optional] | -|**denomination** | **Long** | | [optional] | - - - diff --git a/clients/wallet/docs/AssetApi.md b/clients/wallet/docs/AssetApi.md index 07c84e1f9..3eddf88f1 100644 --- a/clients/wallet/docs/AssetApi.md +++ b/clients/wallet/docs/AssetApi.md @@ -695,7 +695,7 @@ No authorization required Query User Wallet Balance (USER_DATA) -Query User Wallet Balance * You need to open Permits Universal Transfer permission for the API Key which requests this endpoint. Weight: 60 +Query User Wallet Balance Weight: 60 ### Example ```java diff --git a/clients/wallet/docs/CapitalApi.md b/clients/wallet/docs/CapitalApi.md index c17e3157d..691b26ab9 100644 --- a/clients/wallet/docs/CapitalApi.md +++ b/clients/wallet/docs/CapitalApi.md @@ -471,7 +471,7 @@ No authorization required Withdraw(USER_DATA) -Submit a withdraw request. * If `network` not send, return with default network of the coin. * You can get `network` and `isDefault` in `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`. Weight: 900 +Submit a withdraw request. * If `network` not send, return with default network of the coin. * You can get `network` and `isDefault` in `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`. * To check if travel rule is required, by using `GET /sapi/v1/localentity/questionnaire-requirements` and if it returns anything other than `NIL` you will need update SAPI to `POST /sapi/v1/localentity/withdraw/apply` else you can continue `POST /sapi/v1/capital/withdraw/apply`. Please note that if you are required to comply to travel rule please refer to the Travel Rule SAPI. Weight: 900 ### Example ```java diff --git a/clients/wallet/docs/CheckQuestionnaireRequirementsResponse.md b/clients/wallet/docs/CheckQuestionnaireRequirementsResponse.md new file mode 100644 index 000000000..c293f338c --- /dev/null +++ b/clients/wallet/docs/CheckQuestionnaireRequirementsResponse.md @@ -0,0 +1,13 @@ + + +# CheckQuestionnaireRequirementsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**questionnaireCountryCode** | **String** | | [optional] | + + + diff --git a/clients/wallet/docs/DepositHistoryResponseInner.md b/clients/wallet/docs/DepositHistoryResponseInner.md index 16048c163..efeba8552 100644 --- a/clients/wallet/docs/DepositHistoryResponseInner.md +++ b/clients/wallet/docs/DepositHistoryResponseInner.md @@ -21,6 +21,7 @@ |**confirmTimes** | **String** | | [optional] | |**unlockConfirm** | **Long** | | [optional] | |**walletType** | **Long** | | [optional] | +|**travelRuleStatus** | **Long** | | [optional] | diff --git a/clients/wallet/docs/OnboardedVaspListResponse.md b/clients/wallet/docs/DepositHistoryV2Response.md similarity index 81% rename from clients/wallet/docs/OnboardedVaspListResponse.md rename to clients/wallet/docs/DepositHistoryV2Response.md index c9cba55e2..8bcfb6e49 100644 --- a/clients/wallet/docs/OnboardedVaspListResponse.md +++ b/clients/wallet/docs/DepositHistoryV2Response.md @@ -1,6 +1,6 @@ -# OnboardedVaspListResponse +# DepositHistoryV2Response ## Properties diff --git a/clients/wallet/docs/DepositHistoryV2ResponseInner.md b/clients/wallet/docs/DepositHistoryV2ResponseInner.md new file mode 100644 index 000000000..0e689b186 --- /dev/null +++ b/clients/wallet/docs/DepositHistoryV2ResponseInner.md @@ -0,0 +1,26 @@ + + +# DepositHistoryV2ResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**depositId** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**network** | **String** | | [optional] | +|**coin** | **String** | | [optional] | +|**depositStatus** | **Long** | | [optional] | +|**travelRuleReqStatus** | **Long** | | [optional] | +|**address** | **String** | | [optional] | +|**addressTag** | **String** | | [optional] | +|**txId** | **String** | | [optional] | +|**transferType** | **Long** | | [optional] | +|**confirmTimes** | **String** | | [optional] | +|**requireQuestionnaire** | **Boolean** | | [optional] | +|**questionnaire** | [**DepositHistoryV2ResponseInnerQuestionnaire**](DepositHistoryV2ResponseInnerQuestionnaire.md) | | [optional] | +|**insertTime** | **Long** | | [optional] | + + + diff --git a/clients/wallet/docs/DepositHistoryV2ResponseInnerQuestionnaire.md b/clients/wallet/docs/DepositHistoryV2ResponseInnerQuestionnaire.md new file mode 100644 index 000000000..3f6eedf04 --- /dev/null +++ b/clients/wallet/docs/DepositHistoryV2ResponseInnerQuestionnaire.md @@ -0,0 +1,14 @@ + + +# DepositHistoryV2ResponseInnerQuestionnaire + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**vaspName** | **String** | | [optional] | +|**depositOriginator** | **Long** | | [optional] | + + + diff --git a/clients/wallet/docs/TravelRuleApi.md b/clients/wallet/docs/TravelRuleApi.md index abccfec33..3e56f3f07 100644 --- a/clients/wallet/docs/TravelRuleApi.md +++ b/clients/wallet/docs/TravelRuleApi.md @@ -5,11 +5,13 @@ All URIs are relative to *https://api.binance.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**brokerWithdraw**](TravelRuleApi.md#brokerWithdraw) | **POST** /sapi/v1/localentity/broker/withdraw/apply | Broker Withdraw (for brokers of local entities that require travel rule) (USER_DATA) | +| [**checkQuestionnaireRequirements**](TravelRuleApi.md#checkQuestionnaireRequirements) | **GET** /sapi/v1/localentity/questionnaire-requirements | Check Questionnaire Requirements (for local entities that require travel rule) (supporting network) (USER_DATA) | | [**depositHistoryTravelRule**](TravelRuleApi.md#depositHistoryTravelRule) | **GET** /sapi/v1/localentity/deposit/history | Deposit History (for local entities that required travel rule) (supporting network) (USER_DATA) | +| [**depositHistoryV2**](TravelRuleApi.md#depositHistoryV2) | **GET** /sapi/v2/localentity/deposit/history | Deposit History V2 (for local entities that required travel rule) (supporting network) (USER_DATA) | | [**fetchAddressVerificationList**](TravelRuleApi.md#fetchAddressVerificationList) | **GET** /sapi/v1/addressVerify/list | Fetch address verification list (USER_DATA) | -| [**onboardedVaspList**](TravelRuleApi.md#onboardedVaspList) | **GET** /sapi/v1/localentity/vasp | Onboarded VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) | | [**submitDepositQuestionnaire**](TravelRuleApi.md#submitDepositQuestionnaire) | **PUT** /sapi/v1/localentity/broker/deposit/provide-info | Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA) | | [**submitDepositQuestionnaireTravelRule**](TravelRuleApi.md#submitDepositQuestionnaireTravelRule) | **PUT** /sapi/v1/localentity/deposit/provide-info | Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA) | +| [**vaspList**](TravelRuleApi.md#vaspList) | **GET** /sapi/v1/localentity/vasp | VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) | | [**withdrawHistoryV1**](TravelRuleApi.md#withdrawHistoryV1) | **GET** /sapi/v1/localentity/withdraw/history | Withdraw History (for local entities that require travel rule) (supporting network) (USER_DATA) | | [**withdrawHistoryV2**](TravelRuleApi.md#withdrawHistoryV2) | **GET** /sapi/v2/localentity/withdraw/history | Withdraw History V2 (for local entities that require travel rule) (supporting network) (USER_DATA) | | [**withdrawTravelRule**](TravelRuleApi.md#withdrawTravelRule) | **POST** /sapi/v1/localentity/withdraw/apply | Withdraw (for local entities that require travel rule) (USER_DATA) | @@ -77,6 +79,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Broker Withdraw | - | + +# **checkQuestionnaireRequirements** +> CheckQuestionnaireRequirementsResponse checkQuestionnaireRequirements(recvWindow) + +Check Questionnaire Requirements (for local entities that require travel rule) (supporting network) (USER_DATA) + +This API will return user-specific Travel Rule questionnaire requirement information in reference to the current API key. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.wallet.ApiClient; +import com.binance.connector.client.wallet.ApiException; +import com.binance.connector.client.wallet.Configuration; +import com.binance.connector.client.wallet.models.*; +import com.binance.connector.client.wallet.rest.api.TravelRuleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + TravelRuleApi apiInstance = new TravelRuleApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + CheckQuestionnaireRequirementsResponse result = apiInstance.checkQuestionnaireRequirements(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TravelRuleApi#checkQuestionnaireRequirements"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**CheckQuestionnaireRequirementsResponse**](CheckQuestionnaireRequirementsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Check Questionnaire Requirements | - | + # **depositHistoryTravelRule** > DepositHistoryTravelRuleResponse depositHistoryTravelRule(trId, txId, tranId, network, coin, travelRuleStatus, pendingQuestionnaire, startTime, endTime, offset, limit) @@ -159,13 +223,13 @@ No authorization required |-------------|-------------|------------------| | **200** | Deposit History | - | - -# **fetchAddressVerificationList** -> FetchAddressVerificationListResponse fetchAddressVerificationList() + +# **depositHistoryV2** +> DepositHistoryV2Response depositHistoryV2(depositId, txId, network, coin, retrieveQuestionnaire, startTime, endTime, offset, limit) -Fetch address verification list (USER_DATA) +Deposit History V2 (for local entities that required travel rule) (supporting network) (USER_DATA) -Fetch address verification list Weight: 10 +Fetch deposit history for local entities that with required travel rule information. * Please notice the default `startTime` and `endTime` to make sure that time interval is within * If both ``startTime`` and ``endTime`` are sent, time between ``startTime`` and ``endTime`` must Weight: 1 ### Example ```java @@ -182,11 +246,20 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TravelRuleApi apiInstance = new TravelRuleApi(defaultClient); + String depositId = "depositId_example"; // String | Comma(,) separated list of wallet tran Ids. + String txId = "txId_example"; // String | + String network = "network_example"; // String | + String coin = "coin_example"; // String | + Boolean retrieveQuestionnaire = true; // Boolean | true: return `questionnaire` within response. + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long offset = 56L; // Long | Default: 0 + Long limit = 56L; // Long | min 7, max 30, default 7 try { - FetchAddressVerificationListResponse result = apiInstance.fetchAddressVerificationList(); + DepositHistoryV2Response result = apiInstance.depositHistoryV2(depositId, txId, network, coin, retrieveQuestionnaire, startTime, endTime, offset, limit); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling TravelRuleApi#fetchAddressVerificationList"); + System.err.println("Exception when calling TravelRuleApi#depositHistoryV2"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -197,11 +270,22 @@ public class Example { ``` ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **depositId** | **String**| Comma(,) separated list of wallet tran Ids. | [optional] | +| **txId** | **String**| | [optional] | +| **network** | **String**| | [optional] | +| **coin** | **String**| | [optional] | +| **retrieveQuestionnaire** | **Boolean**| true: return `questionnaire` within response. | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **offset** | **Long**| Default: 0 | [optional] | +| **limit** | **Long**| min 7, max 30, default 7 | [optional] | ### Return type -[**FetchAddressVerificationListResponse**](FetchAddressVerificationListResponse.md) +[**DepositHistoryV2Response**](DepositHistoryV2Response.md) ### Authorization @@ -215,15 +299,15 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Fetch address verification list | - | +| **200** | Deposit History V2 | - | - -# **onboardedVaspList** -> OnboardedVaspListResponse onboardedVaspList() + +# **fetchAddressVerificationList** +> FetchAddressVerificationListResponse fetchAddressVerificationList(recvWindow) -Onboarded VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) +Fetch address verification list (USER_DATA) -Fetch the onboarded VASP list for local entities that required travel rule. * This endpoint specifically uses per second IP rate limit, user's total second level IP rate Weight: 18000 Request limit: 10 requests per second > * This endpoint specifically uses per second IP rate limit, user's total second level IP rate limit is 180000/second. Response from the endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP. +Fetch address verification list for user to check on status and other details for the addresses stored in Address Book. Weight: 1 ### Example ```java @@ -240,11 +324,12 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TravelRuleApi apiInstance = new TravelRuleApi(defaultClient); + Long recvWindow = 56L; // Long | try { - OnboardedVaspListResponse result = apiInstance.onboardedVaspList(); + FetchAddressVerificationListResponse result = apiInstance.fetchAddressVerificationList(recvWindow); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling TravelRuleApi#onboardedVaspList"); + System.err.println("Exception when calling TravelRuleApi#fetchAddressVerificationList"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -255,11 +340,14 @@ public class Example { ``` ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | ### Return type -[**OnboardedVaspListResponse**](OnboardedVaspListResponse.md) +[**FetchAddressVerificationListResponse**](FetchAddressVerificationListResponse.md) ### Authorization @@ -273,7 +361,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Onboarded VASP list | - | +| **200** | Fetch address verification list | - | # **submitDepositQuestionnaire** @@ -399,13 +487,75 @@ No authorization required |-------------|-------------|------------------| | **200** | Submit Deposit Questionnaire | - | + +# **vaspList** +> VaspListResponse vaspList(recvWindow) + +VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) + +Fetch the VASP list for local entities. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.wallet.ApiClient; +import com.binance.connector.client.wallet.ApiException; +import com.binance.connector.client.wallet.Configuration; +import com.binance.connector.client.wallet.models.*; +import com.binance.connector.client.wallet.rest.api.TravelRuleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + TravelRuleApi apiInstance = new TravelRuleApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + VaspListResponse result = apiInstance.vaspList(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TravelRuleApi#vaspList"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**VaspListResponse**](VaspListResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | VASP list | - | + # **withdrawHistoryV1** > WithdrawHistoryV1Response withdrawHistoryV1(trId, txId, withdrawOrderId, network, coin, travelRuleStatus, offset, limit, startTime, endTime, recvWindow) Withdraw History (for local entities that require travel rule) (supporting network) (USER_DATA) -Fetch withdraw history for local entities that required travel rule. * This endpoint specifically uses per second IP rate limit, user's total second level IP rate * `network` may not be in the response for old withdraw. * Please notice the default `startTime` and `endTime` to make sure that time interval is within * If both `startTime` and `endTime`are sent, time between `startTime`and `endTime`must be less Weight: 18000 Request limit: 10 requests per second > * This endpoint specifically uses per second IP rate limit, user's total second level IP rate limit is 180000/second. Response from the endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP. +Fetch withdraw history for local entities that required travel rule. * `network` may not be in the response for old withdraw. * Please notice the default `startTime` and `endTime` to make sure that time interval is within * If both `startTime` and `endTime`are sent, time between `startTime`and `endTime`must be less Weight: 1 ### Example ```java @@ -487,7 +637,7 @@ No authorization required Withdraw History V2 (for local entities that require travel rule) (supporting network) (USER_DATA) -Fetch withdraw history for local entities that required travel rule. * This endpoint specifically uses per second IP rate limit, user's total second level IP rate * `network` may not be in the response for old withdraw. * Withdrawal made through /sapi/v1/capital/withdraw/apply may not be in the response. * Please notice the default `startTime` and `endTime` to make sure that time interval is within * If both `startTime` and `endTime`are sent, time between `startTime`and `endTime`must be less * If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days. * If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default. * Maximum support trId,txId number is 45. * WithdrawOrderId only support 1. * If responsible does not include withdrawalStatus, please input trId or txId retrieve the data. Weight: 18000 Request limit: 10 requests per second > * This endpoint specifically uses per second IP rate limit, user's total second level IP rate limit is 180000/second. Response from the endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP. +Fetch withdraw history for local entities that required travel rule. * `network` may not be in the response for old withdraw. * Withdrawal made through /sapi/v1/capital/withdraw/apply may not be in the response. * Please notice the default `startTime` and `endTime` to make sure that time interval is within * If both `startTime` and `endTime`are sent, time between `startTime`and `endTime`must be less * If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days. * If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default. * Maximum support trId,txId number is 45. * WithdrawOrderId only support 1. * If responsible does not include withdrawalStatus, please input trId or txId retrieve the data. Weight: 1 ### Example ```java diff --git a/clients/wallet/docs/VaspListResponse.md b/clients/wallet/docs/VaspListResponse.md new file mode 100644 index 000000000..3e013b9a5 --- /dev/null +++ b/clients/wallet/docs/VaspListResponse.md @@ -0,0 +1,12 @@ + + +# VaspListResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/wallet/docs/OnboardedVaspListResponseInner.md b/clients/wallet/docs/VaspListResponseInner.md similarity index 86% rename from clients/wallet/docs/OnboardedVaspListResponseInner.md rename to clients/wallet/docs/VaspListResponseInner.md index 0e90d38d1..158c95a63 100644 --- a/clients/wallet/docs/OnboardedVaspListResponseInner.md +++ b/clients/wallet/docs/VaspListResponseInner.md @@ -1,6 +1,6 @@ -# OnboardedVaspListResponseInner +# VaspListResponseInner ## Properties diff --git a/clients/wallet/docs/rest-api/migration-guide.md b/clients/wallet/docs/rest-api/migration-guide.md index d05501380..2c2adf048 100644 --- a/clients/wallet/docs/rest-api/migration-guide.md +++ b/clients/wallet/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-wallet - 2.1.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-wallet - 2.1.0 + 3.0.0 ``` diff --git a/clients/wallet/pom.xml b/clients/wallet/pom.xml index b2d8d45a7..058489bd4 100644 --- a/clients/wallet/pom.xml +++ b/clients/wallet/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-wallet wallet - 2.1.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.0.1 \ No newline at end of file diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java index 056c79b56..b38053ddf 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java @@ -134,10 +134,6 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.wallet.rest.model .AllCoinsInformationResponseInnerNetworkListInner .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.wallet.rest.model - .AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.AssetDetailResponse .CustomTypeAdapterFactory()); @@ -159,6 +155,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.BrokerWithdrawResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .CheckQuestionnaireRequirementsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.DailyAccountSnapshotResponse .CustomTypeAdapterFactory()); @@ -200,6 +199,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model .DepositHistoryTravelRuleResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.DepositHistoryV2Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.DepositHistoryV2ResponseInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .DepositHistoryV2ResponseInnerQuestionnaire.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.DisableFastWithdrawSwitchRequest .CustomTypeAdapterFactory()); @@ -298,12 +306,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model .GetSymbolsDelistScheduleForSpotResponseInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.wallet.rest.model.OnboardedVaspListResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.wallet.rest.model.OnboardedVaspListResponseInner - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model .OneClickArrivalDepositApplyRequest.CustomTypeAdapterFactory()); @@ -373,6 +375,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.UserUniversalTransferResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.VaspListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.VaspListResponseInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.WithdrawHistoryResponse .CustomTypeAdapterFactory()); diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java index d084afbf0..4e2b13ba3 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java @@ -49,7 +49,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-wallet/2.1.1 (Java/%s; %s; %s)", + "binance-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java index 25010c1bc..2a4aa9686 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java @@ -64,7 +64,7 @@ public class AssetApi { private static final String USER_AGENT = String.format( - "binance-wallet/2.1.1 (Java/%s; %s; %s)", + "binance-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1868,8 +1868,7 @@ private okhttp3.Call queryUserWalletBalanceValidateBeforeCall( } /** - * Query User Wallet Balance (USER_DATA) Query User Wallet Balance * You need to open Permits - * Universal Transfer permission for the API Key which requests this endpoint. Weight: 60 + * Query User Wallet Balance (USER_DATA) Query User Wallet Balance Weight: 60 * * @param quoteAsset `USDT`, `ETH`, `USDC`, `BNB`, etc. * default `BTC` (optional) diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java index b6dedae12..4c3f3e439 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java @@ -54,7 +54,7 @@ public class CapitalApi { private static final String USER_AGENT = String.format( - "binance-wallet/2.1.1 (Java/%s; %s; %s)", + "binance-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1344,7 +1344,12 @@ private okhttp3.Call withdrawValidateBeforeCall(WithdrawRequest withdrawRequest) * Withdraw(USER_DATA) Submit a withdraw request. * If `network` not send, return with * default network of the coin. * You can get `network` and `isDefault` in * `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall - * (HMAC SHA256)`. Weight: 900 + * (HMAC SHA256)`. * To check if travel rule is required, by using `GET + * /sapi/v1/localentity/questionnaire-requirements` and if it returns anything other than + * `NIL` you will need update SAPI to `POST + * /sapi/v1/localentity/withdraw/apply` else you can continue `POST + * /sapi/v1/capital/withdraw/apply`. Please note that if you are required to comply to + * travel rule please refer to the Travel Rule SAPI. Weight: 900 * * @param withdrawRequest (required) * @return ApiResponse<WithdrawResponse> diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java index 579a8d2a5..1057eca6e 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java @@ -43,7 +43,7 @@ public class OthersApi { private static final String USER_AGENT = String.format( - "binance-wallet/2.1.1 (Java/%s; %s; %s)", + "binance-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java index 4bba2561a..24a597b1e 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java @@ -22,13 +22,15 @@ import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.wallet.rest.model.BrokerWithdrawRequest; import com.binance.connector.client.wallet.rest.model.BrokerWithdrawResponse; +import com.binance.connector.client.wallet.rest.model.CheckQuestionnaireRequirementsResponse; import com.binance.connector.client.wallet.rest.model.DepositHistoryTravelRuleResponse; +import com.binance.connector.client.wallet.rest.model.DepositHistoryV2Response; import com.binance.connector.client.wallet.rest.model.FetchAddressVerificationListResponse; -import com.binance.connector.client.wallet.rest.model.OnboardedVaspListResponse; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireRequest; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireResponse; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleRequest; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleResponse; +import com.binance.connector.client.wallet.rest.model.VaspListResponse; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV1Response; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV2Response; import com.binance.connector.client.wallet.rest.model.WithdrawTravelRuleRequest; @@ -56,7 +58,7 @@ public class TravelRuleApi { private static final String USER_AGENT = String.format( - "binance-wallet/2.1.1 (Java/%s; %s; %s)", + "binance-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -281,6 +283,143 @@ public ApiResponse brokerWithdraw( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for checkQuestionnaireRequirements + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Check Questionnaire Requirements -
+ * + * @see Check + * Questionnaire Requirements (for local entities that require travel rule) (supporting + * network) (USER_DATA) Documentation + */ + private okhttp3.Call checkQuestionnaireRequirementsCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/localentity/questionnaire-requirements"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call checkQuestionnaireRequirementsValidateBeforeCall(Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("checkQuestionnaireRequirements", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return checkQuestionnaireRequirementsCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Check Questionnaire Requirements (for local entities that require travel rule) (supporting + * network) (USER_DATA) This API will return user-specific Travel Rule questionnaire requirement + * information in reference to the current API key. Weight: 1 + * + * @param recvWindow (optional) + * @return ApiResponse<CheckQuestionnaireRequirementsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Check Questionnaire Requirements -
+ * + * @see Check + * Questionnaire Requirements (for local entities that require travel rule) (supporting + * network) (USER_DATA) Documentation + */ + public ApiResponse checkQuestionnaireRequirements( + Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = checkQuestionnaireRequirementsValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for depositHistoryTravelRule * @@ -568,22 +707,43 @@ public ApiResponse depositHistoryTravelRule( } /** - * Build call for fetchAddressVerificationList + * Build call for depositHistoryV2 * + * @param depositId Comma(,) separated list of wallet tran Ids. (optional) + * @param txId (optional) + * @param network (optional) + * @param coin (optional) + * @param retrieveQuestionnaire true: return `questionnaire` within response. + * (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param offset Default: 0 (optional) + * @param limit min 7, max 30, default 7 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Fetch address verification list -
200 Deposit History V2 -
* * @see Fetch - * address verification list (USER_DATA) Documentation + * href="https://developers.binance.com/docs/wallet/travel-rule/Deposit-History-V2">Deposit + * History V2 (for local entities that required travel rule) (supporting network) + * (USER_DATA) Documentation */ - private okhttp3.Call fetchAddressVerificationListCall() throws ApiException { + private okhttp3.Call depositHistoryV2Call( + String depositId, + String txId, + String network, + String coin, + Boolean retrieveQuestionnaire, + Long startTime, + Long endTime, + Long offset, + Long limit) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -600,7 +760,7 @@ private okhttp3.Call fetchAddressVerificationListCall() throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/addressVerify/list"; + String localVarPath = "/sapi/v2/localentity/deposit/history"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -608,6 +768,44 @@ private okhttp3.Call fetchAddressVerificationListCall() throws ApiException { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (depositId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("depositId", depositId)); + } + + if (txId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("txId", txId)); + } + + if (network != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("network", network)); + } + + if (coin != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("coin", coin)); + } + + if (retrieveQuestionnaire != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "retrieveQuestionnaire", retrieveQuestionnaire)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -639,7 +837,17 @@ private okhttp3.Call fetchAddressVerificationListCall() throws ApiException { } @SuppressWarnings("rawtypes") - private okhttp3.Call fetchAddressVerificationListValidateBeforeCall() throws ApiException { + private okhttp3.Call depositHistoryV2ValidateBeforeCall( + String depositId, + String txId, + String network, + String coin, + Boolean retrieveQuestionnaire, + Long startTime, + Long endTime, + Long offset, + Long limit) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -649,13 +857,44 @@ private okhttp3.Call fetchAddressVerificationListValidateBeforeCall() throws Api .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {}; - Method method = this.getClass().getMethod("fetchAddressVerificationList"); + Object[] parameterValues = { + depositId, + txId, + network, + coin, + retrieveQuestionnaire, + startTime, + endTime, + offset, + limit + }; + Method method = + this.getClass() + .getMethod( + "depositHistoryV2", + String.class, + String.class, + String.class, + String.class, + Boolean.class, + Long.class, + Long.class, + Long.class, + Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return fetchAddressVerificationListCall(); + return depositHistoryV2Call( + depositId, + txId, + network, + coin, + retrieveQuestionnaire, + startTime, + endTime, + offset, + limit); } else { throw new ConstraintViolationException((Set) violations); } @@ -669,48 +908,83 @@ private okhttp3.Call fetchAddressVerificationListValidateBeforeCall() throws Api } /** - * Fetch address verification list (USER_DATA) Fetch address verification list Weight: 10 + * Deposit History V2 (for local entities that required travel rule) (supporting network) + * (USER_DATA) Fetch deposit history for local entities that with required travel rule + * information. * Please notice the default `startTime` and `endTime` to + * make sure that time interval is within * If both ``startTime`` and + * ``endTime`` are sent, time between ``startTime`` and + * ``endTime`` must Weight: 1 * - * @return ApiResponse<FetchAddressVerificationListResponse> + * @param depositId Comma(,) separated list of wallet tran Ids. (optional) + * @param txId (optional) + * @param network (optional) + * @param coin (optional) + * @param retrieveQuestionnaire true: return `questionnaire` within response. + * (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param offset Default: 0 (optional) + * @param limit min 7, max 30, default 7 (optional) + * @return ApiResponse<DepositHistoryV2Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Fetch address verification list -
200 Deposit History V2 -
* * @see Fetch - * address verification list (USER_DATA) Documentation + * href="https://developers.binance.com/docs/wallet/travel-rule/Deposit-History-V2">Deposit + * History V2 (for local entities that required travel rule) (supporting network) + * (USER_DATA) Documentation */ - public ApiResponse fetchAddressVerificationList() + public ApiResponse depositHistoryV2( + String depositId, + String txId, + String network, + String coin, + Boolean retrieveQuestionnaire, + Long startTime, + Long endTime, + Long offset, + Long limit) throws ApiException { - okhttp3.Call localVarCall = fetchAddressVerificationListValidateBeforeCall(); + okhttp3.Call localVarCall = + depositHistoryV2ValidateBeforeCall( + depositId, + txId, + network, + coin, + retrieveQuestionnaire, + startTime, + endTime, + offset, + limit); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for onboardedVaspList + * Build call for fetchAddressVerificationList * + * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Onboarded VASP list -
200 Fetch address verification list -
* * @see Onboarded - * VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) - * Documentation + * href="https://developers.binance.com/docs/wallet/travel-rule/address-verification-list">Fetch + * address verification list (USER_DATA) Documentation */ - private okhttp3.Call onboardedVaspListCall() throws ApiException { + private okhttp3.Call fetchAddressVerificationListCall(Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -727,7 +1001,7 @@ private okhttp3.Call onboardedVaspListCall() throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sapi/v1/localentity/vasp"; + String localVarPath = "/sapi/v1/addressVerify/list"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -735,6 +1009,10 @@ private okhttp3.Call onboardedVaspListCall() throws ApiException { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -766,7 +1044,8 @@ private okhttp3.Call onboardedVaspListCall() throws ApiException { } @SuppressWarnings("rawtypes") - private okhttp3.Call onboardedVaspListValidateBeforeCall() throws ApiException { + private okhttp3.Call fetchAddressVerificationListValidateBeforeCall(Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -776,13 +1055,13 @@ private okhttp3.Call onboardedVaspListValidateBeforeCall() throws ApiException { .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {}; - Method method = this.getClass().getMethod("onboardedVaspList"); + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("fetchAddressVerificationList", Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return onboardedVaspListCall(); + return fetchAddressVerificationListCall(recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -796,33 +1075,29 @@ private okhttp3.Call onboardedVaspListValidateBeforeCall() throws ApiException { } /** - * Onboarded VASP list (for local entities that require travel rule) (supporting network) - * (USER_DATA) Fetch the onboarded VASP list for local entities that required travel rule. * - * This endpoint specifically uses per second IP rate limit, user's total second level IP - * rate Weight: 18000 Request limit: 10 requests per second > * This endpoint specifically - * uses per second IP rate limit, user's total second level IP rate limit is 180000/second. - * Response from the endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight - * used by the current IP. + * Fetch address verification list (USER_DATA) Fetch address verification list for user to check + * on status and other details for the addresses stored in Address Book. Weight: 1 * - * @return ApiResponse<OnboardedVaspListResponse> + * @param recvWindow (optional) + * @return ApiResponse<FetchAddressVerificationListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Onboarded VASP list -
200 Fetch address verification list -
* * @see Onboarded - * VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) - * Documentation + * href="https://developers.binance.com/docs/wallet/travel-rule/address-verification-list">Fetch + * address verification list (USER_DATA) Documentation */ - public ApiResponse onboardedVaspList() throws ApiException { - okhttp3.Call localVarCall = onboardedVaspListValidateBeforeCall(); + public ApiResponse fetchAddressVerificationList( + Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = fetchAddressVerificationListValidateBeforeCall(recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1178,6 +1453,139 @@ private okhttp3.Call submitDepositQuestionnaireTravelRuleValidateBeforeCall( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for vaspList + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 VASP list -
+ * + * @see VASP + * list (for local entities that require travel rule) (supporting network) (USER_DATA) + * Documentation + */ + private okhttp3.Call vaspListCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/localentity/vasp"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vaspListValidateBeforeCall(Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("vaspList", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return vaspListCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) + * Fetch the VASP list for local entities. Weight: 1 + * + * @param recvWindow (optional) + * @return ApiResponse<VaspListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 VASP list -
+ * + * @see VASP + * list (for local entities that require travel rule) (supporting network) (USER_DATA) + * Documentation + */ + public ApiResponse vaspList(Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = vaspListValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for withdrawHistoryV1 * @@ -1401,15 +1809,11 @@ private okhttp3.Call withdrawHistoryV1ValidateBeforeCall( /** * Withdraw History (for local entities that require travel rule) (supporting network) - * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * This - * endpoint specifically uses per second IP rate limit, user's total second level IP rate * + * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * * `network` may not be in the response for old withdraw. * Please notice the default * `startTime` and `endTime` to make sure that time interval is within * If * both `startTime` and `endTime`are sent, time between - * `startTime`and `endTime`must be less Weight: 18000 Request limit: 10 - * requests per second > * This endpoint specifically uses per second IP rate limit, - * user's total second level IP rate limit is 180000/second. Response from the endpoint - * contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP. + * `startTime`and `endTime`must be less Weight: 1 * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) @@ -1692,8 +2096,7 @@ private okhttp3.Call withdrawHistoryV2ValidateBeforeCall( /** * Withdraw History V2 (for local entities that require travel rule) (supporting network) - * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * This - * endpoint specifically uses per second IP rate limit, user's total second level IP rate * + * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * * `network` may not be in the response for old withdraw. * Withdrawal made through * /sapi/v1/capital/withdraw/apply may not be in the response. * Please notice the default * `startTime` and `endTime` to make sure that time interval is within * If @@ -1702,11 +2105,7 @@ private okhttp3.Call withdrawHistoryV2ValidateBeforeCall( * between startTime and endTime must be less than 7 days. * If withdrawOrderId is sent, * startTime and endTime are not sent, will return last 7 days records by default. * Maximum * support trId,txId number is 45. * WithdrawOrderId only support 1. * If responsible does not - * include withdrawalStatus, please input trId or txId retrieve the data. Weight: 18000 Request - * limit: 10 requests per second > * This endpoint specifically uses per second IP rate - * limit, user's total second level IP rate limit is 180000/second. Response from the - * endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the - * current IP. + * include withdrawalStatus, please input trId or txId retrieve the data. Weight: 1 * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java index a4ce500aa..421bdab9a 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java @@ -13,10 +13,12 @@ import com.binance.connector.client.wallet.rest.model.AssetDividendRecordResponse; import com.binance.connector.client.wallet.rest.model.BrokerWithdrawRequest; import com.binance.connector.client.wallet.rest.model.BrokerWithdrawResponse; +import com.binance.connector.client.wallet.rest.model.CheckQuestionnaireRequirementsResponse; import com.binance.connector.client.wallet.rest.model.DailyAccountSnapshotResponse; import com.binance.connector.client.wallet.rest.model.DepositAddressResponse; import com.binance.connector.client.wallet.rest.model.DepositHistoryResponse; import com.binance.connector.client.wallet.rest.model.DepositHistoryTravelRuleResponse; +import com.binance.connector.client.wallet.rest.model.DepositHistoryV2Response; import com.binance.connector.client.wallet.rest.model.DisableFastWithdrawSwitchRequest; import com.binance.connector.client.wallet.rest.model.DustTransferRequest; import com.binance.connector.client.wallet.rest.model.DustTransferResponse; @@ -34,7 +36,6 @@ import com.binance.connector.client.wallet.rest.model.GetCloudMiningPaymentAndRefundHistoryResponse; import com.binance.connector.client.wallet.rest.model.GetOpenSymbolListResponse; import com.binance.connector.client.wallet.rest.model.GetSymbolsDelistScheduleForSpotResponse; -import com.binance.connector.client.wallet.rest.model.OnboardedVaspListResponse; import com.binance.connector.client.wallet.rest.model.OneClickArrivalDepositApplyRequest; import com.binance.connector.client.wallet.rest.model.OneClickArrivalDepositApplyResponse; import com.binance.connector.client.wallet.rest.model.QueryUserDelegationHistoryResponse; @@ -52,6 +53,7 @@ import com.binance.connector.client.wallet.rest.model.UserAssetResponse; import com.binance.connector.client.wallet.rest.model.UserUniversalTransferRequest; import com.binance.connector.client.wallet.rest.model.UserUniversalTransferResponse; +import com.binance.connector.client.wallet.rest.model.VaspListResponse; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryResponse; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV1Response; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV2Response; @@ -543,8 +545,7 @@ public ApiResponse queryUserUniversal } /** - * Query User Wallet Balance (USER_DATA) Query User Wallet Balance * You need to open Permits - * Universal Transfer permission for the API Key which requests this endpoint. Weight: 60 + * Query User Wallet Balance (USER_DATA) Query User Wallet Balance Weight: 60 * * @param quoteAsset `USDT`, `ETH`, `USDC`, `BNB`, etc. * default `BTC` (optional) @@ -890,7 +891,12 @@ public ApiResponse oneClickArrivalDepositAp * Withdraw(USER_DATA) Submit a withdraw request. * If `network` not send, return with * default network of the coin. * You can get `network` and `isDefault` in * `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall - * (HMAC SHA256)`. Weight: 900 + * (HMAC SHA256)`. * To check if travel rule is required, by using `GET + * /sapi/v1/localentity/questionnaire-requirements` and if it returns anything other than + * `NIL` you will need update SAPI to `POST + * /sapi/v1/localentity/withdraw/apply` else you can continue `POST + * /sapi/v1/capital/withdraw/apply`. Please note that if you are required to comply to + * travel rule please refer to the Travel Rule SAPI. Weight: 900 * * @param withdrawRequest (required) * @return ApiResponse<WithdrawResponse> @@ -1044,6 +1050,32 @@ public ApiResponse brokerWithdraw( return travelRuleApi.brokerWithdraw(brokerWithdrawRequest); } + /** + * Check Questionnaire Requirements (for local entities that require travel rule) (supporting + * network) (USER_DATA) This API will return user-specific Travel Rule questionnaire requirement + * information in reference to the current API key. Weight: 1 + * + * @param recvWindow (optional) + * @return ApiResponse<CheckQuestionnaireRequirementsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Check Questionnaire Requirements -
+ * + * @see Check + * Questionnaire Requirements (for local entities that require travel rule) (supporting + * network) (USER_DATA) Documentation + */ + public ApiResponse checkQuestionnaireRequirements( + Long recvWindow) throws ApiException { + return travelRuleApi.checkQuestionnaireRequirements(recvWindow); + } + /** * Deposit History (for local entities that required travel rule) (supporting network) * (USER_DATA) Fetch deposit history for local entities that required travel rule. * Please @@ -1106,53 +1138,83 @@ public ApiResponse depositHistoryTravelRule( } /** - * Fetch address verification list (USER_DATA) Fetch address verification list Weight: 10 + * Deposit History V2 (for local entities that required travel rule) (supporting network) + * (USER_DATA) Fetch deposit history for local entities that with required travel rule + * information. * Please notice the default `startTime` and `endTime` to + * make sure that time interval is within * If both ``startTime`` and + * ``endTime`` are sent, time between ``startTime`` and + * ``endTime`` must Weight: 1 * - * @return ApiResponse<FetchAddressVerificationListResponse> + * @param depositId Comma(,) separated list of wallet tran Ids. (optional) + * @param txId (optional) + * @param network (optional) + * @param coin (optional) + * @param retrieveQuestionnaire true: return `questionnaire` within response. + * (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param offset Default: 0 (optional) + * @param limit min 7, max 30, default 7 (optional) + * @return ApiResponse<DepositHistoryV2Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Fetch address verification list -
200 Deposit History V2 -
* * @see Fetch - * address verification list (USER_DATA) Documentation + * href="https://developers.binance.com/docs/wallet/travel-rule/Deposit-History-V2">Deposit + * History V2 (for local entities that required travel rule) (supporting network) + * (USER_DATA) Documentation */ - public ApiResponse fetchAddressVerificationList() + public ApiResponse depositHistoryV2( + String depositId, + String txId, + String network, + String coin, + Boolean retrieveQuestionnaire, + Long startTime, + Long endTime, + Long offset, + Long limit) throws ApiException { - return travelRuleApi.fetchAddressVerificationList(); + return travelRuleApi.depositHistoryV2( + depositId, + txId, + network, + coin, + retrieveQuestionnaire, + startTime, + endTime, + offset, + limit); } /** - * Onboarded VASP list (for local entities that require travel rule) (supporting network) - * (USER_DATA) Fetch the onboarded VASP list for local entities that required travel rule. * - * This endpoint specifically uses per second IP rate limit, user's total second level IP - * rate Weight: 18000 Request limit: 10 requests per second > * This endpoint specifically - * uses per second IP rate limit, user's total second level IP rate limit is 180000/second. - * Response from the endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight - * used by the current IP. - * - * @return ApiResponse<OnboardedVaspListResponse> + * Fetch address verification list (USER_DATA) Fetch address verification list for user to check + * on status and other details for the addresses stored in Address Book. Weight: 1 + * + * @param recvWindow (optional) + * @return ApiResponse<FetchAddressVerificationListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Onboarded VASP list -
200 Fetch address verification list -
* * @see Onboarded - * VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) - * Documentation + * href="https://developers.binance.com/docs/wallet/travel-rule/address-verification-list">Fetch + * address verification list (USER_DATA) Documentation */ - public ApiResponse onboardedVaspList() throws ApiException { - return travelRuleApi.onboardedVaspList(); + public ApiResponse fetchAddressVerificationList( + Long recvWindow) throws ApiException { + return travelRuleApi.fetchAddressVerificationList(recvWindow); } /** @@ -1218,17 +1280,37 @@ public ApiResponse submitDepositQuestionnair submitDepositQuestionnaireTravelRuleRequest); } + /** + * VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) + * Fetch the VASP list for local entities. Weight: 1 + * + * @param recvWindow (optional) + * @return ApiResponse<VaspListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 VASP list -
+ * + * @see VASP + * list (for local entities that require travel rule) (supporting network) (USER_DATA) + * Documentation + */ + public ApiResponse vaspList(Long recvWindow) throws ApiException { + return travelRuleApi.vaspList(recvWindow); + } + /** * Withdraw History (for local entities that require travel rule) (supporting network) - * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * This - * endpoint specifically uses per second IP rate limit, user's total second level IP rate * + * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * * `network` may not be in the response for old withdraw. * Please notice the default * `startTime` and `endTime` to make sure that time interval is within * If * both `startTime` and `endTime`are sent, time between - * `startTime`and `endTime`must be less Weight: 18000 Request limit: 10 - * requests per second > * This endpoint specifically uses per second IP rate limit, - * user's total second level IP rate limit is 180000/second. Response from the endpoint - * contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP. + * `startTime`and `endTime`must be less Weight: 1 * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) @@ -1286,8 +1368,7 @@ public ApiResponse withdrawHistoryV1( /** * Withdraw History V2 (for local entities that require travel rule) (supporting network) - * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * This - * endpoint specifically uses per second IP rate limit, user's total second level IP rate * + * (USER_DATA) Fetch withdraw history for local entities that required travel rule. * * `network` may not be in the response for old withdraw. * Withdrawal made through * /sapi/v1/capital/withdraw/apply may not be in the response. * Please notice the default * `startTime` and `endTime` to make sure that time interval is within * If @@ -1296,11 +1377,7 @@ public ApiResponse withdrawHistoryV1( * between startTime and endTime must be less than 7 days. * If withdrawOrderId is sent, * startTime and endTime are not sent, will return last 7 days records by default. * Maximum * support trId,txId number is 45. * WithdrawOrderId only support 1. * If responsible does not - * include withdrawalStatus, please input trId or txId retrieve the data. Weight: 18000 Request - * limit: 10 requests per second > * This endpoint specifically uses per second IP rate - * limit, user's total second level IP rate limit is 180000/second. Response from the - * endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the - * current IP. + * include withdrawalStatus, please input trId or txId retrieve the data. Weight: 1 * * @param trId Comma(,) separated list of travel rule record Ids. (optional) * @param txId (optional) diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInner.java index 768e02da4..85f4de4a8 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInner.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInner.java @@ -54,53 +54,53 @@ public class AllCoinsInformationResponseInner { @jakarta.annotation.Nullable private Boolean depositAllEnable; - public static final String SERIALIZED_NAME_FREE = "free"; + public static final String SERIALIZED_NAME_WITHDRAW_ALL_ENABLE = "withdrawAllEnable"; - @SerializedName(SERIALIZED_NAME_FREE) + @SerializedName(SERIALIZED_NAME_WITHDRAW_ALL_ENABLE) @jakarta.annotation.Nullable - private String free; + private Boolean withdrawAllEnable; - public static final String SERIALIZED_NAME_FREEZE = "freeze"; + public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_FREEZE) + @SerializedName(SERIALIZED_NAME_NAME) @jakarta.annotation.Nullable - private String freeze; + private String name; - public static final String SERIALIZED_NAME_IPOABLE = "ipoable"; + public static final String SERIALIZED_NAME_FREE = "free"; - @SerializedName(SERIALIZED_NAME_IPOABLE) + @SerializedName(SERIALIZED_NAME_FREE) @jakarta.annotation.Nullable - private String ipoable; + private String free; - public static final String SERIALIZED_NAME_IPOING = "ipoing"; + public static final String SERIALIZED_NAME_LOCKED = "locked"; - @SerializedName(SERIALIZED_NAME_IPOING) + @SerializedName(SERIALIZED_NAME_LOCKED) @jakarta.annotation.Nullable - private String ipoing; + private String locked; - public static final String SERIALIZED_NAME_IS_LEGAL_MONEY = "isLegalMoney"; + public static final String SERIALIZED_NAME_FREEZE = "freeze"; - @SerializedName(SERIALIZED_NAME_IS_LEGAL_MONEY) + @SerializedName(SERIALIZED_NAME_FREEZE) @jakarta.annotation.Nullable - private Boolean isLegalMoney; + private String freeze; - public static final String SERIALIZED_NAME_LOCKED = "locked"; + public static final String SERIALIZED_NAME_WITHDRAWING = "withdrawing"; - @SerializedName(SERIALIZED_NAME_LOCKED) + @SerializedName(SERIALIZED_NAME_WITHDRAWING) @jakarta.annotation.Nullable - private String locked; + private String withdrawing; - public static final String SERIALIZED_NAME_NAME = "name"; + public static final String SERIALIZED_NAME_IPOING = "ipoing"; - @SerializedName(SERIALIZED_NAME_NAME) + @SerializedName(SERIALIZED_NAME_IPOING) @jakarta.annotation.Nullable - private String name; + private String ipoing; - public static final String SERIALIZED_NAME_NETWORK_LIST = "networkList"; + public static final String SERIALIZED_NAME_IPOABLE = "ipoable"; - @SerializedName(SERIALIZED_NAME_NETWORK_LIST) + @SerializedName(SERIALIZED_NAME_IPOABLE) @jakarta.annotation.Nullable - private List<@Valid AllCoinsInformationResponseInnerNetworkListInner> networkList; + private String ipoable; public static final String SERIALIZED_NAME_STORAGE = "storage"; @@ -108,23 +108,23 @@ public class AllCoinsInformationResponseInner { @jakarta.annotation.Nullable private String storage; - public static final String SERIALIZED_NAME_TRADING = "trading"; + public static final String SERIALIZED_NAME_IS_LEGAL_MONEY = "isLegalMoney"; - @SerializedName(SERIALIZED_NAME_TRADING) + @SerializedName(SERIALIZED_NAME_IS_LEGAL_MONEY) @jakarta.annotation.Nullable - private Boolean trading; + private Boolean isLegalMoney; - public static final String SERIALIZED_NAME_WITHDRAW_ALL_ENABLE = "withdrawAllEnable"; + public static final String SERIALIZED_NAME_TRADING = "trading"; - @SerializedName(SERIALIZED_NAME_WITHDRAW_ALL_ENABLE) + @SerializedName(SERIALIZED_NAME_TRADING) @jakarta.annotation.Nullable - private Boolean withdrawAllEnable; + private Boolean trading; - public static final String SERIALIZED_NAME_WITHDRAWING = "withdrawing"; + public static final String SERIALIZED_NAME_NETWORK_LIST = "networkList"; - @SerializedName(SERIALIZED_NAME_WITHDRAWING) + @SerializedName(SERIALIZED_NAME_NETWORK_LIST) @jakarta.annotation.Nullable - private String withdrawing; + private List<@Valid AllCoinsInformationResponseInnerNetworkListInner> networkList; public AllCoinsInformationResponseInner() {} @@ -167,171 +167,158 @@ public void setDepositAllEnable(@jakarta.annotation.Nullable Boolean depositAllE this.depositAllEnable = depositAllEnable; } - public AllCoinsInformationResponseInner free(@jakarta.annotation.Nullable String free) { - this.free = free; + public AllCoinsInformationResponseInner withdrawAllEnable( + @jakarta.annotation.Nullable Boolean withdrawAllEnable) { + this.withdrawAllEnable = withdrawAllEnable; return this; } /** - * Get free + * Get withdrawAllEnable * - * @return free + * @return withdrawAllEnable */ @jakarta.annotation.Nullable - public String getFree() { - return free; + public Boolean getWithdrawAllEnable() { + return withdrawAllEnable; } - public void setFree(@jakarta.annotation.Nullable String free) { - this.free = free; + public void setWithdrawAllEnable(@jakarta.annotation.Nullable Boolean withdrawAllEnable) { + this.withdrawAllEnable = withdrawAllEnable; } - public AllCoinsInformationResponseInner freeze(@jakarta.annotation.Nullable String freeze) { - this.freeze = freeze; + public AllCoinsInformationResponseInner name(@jakarta.annotation.Nullable String name) { + this.name = name; return this; } /** - * Get freeze + * Get name * - * @return freeze + * @return name */ @jakarta.annotation.Nullable - public String getFreeze() { - return freeze; + public String getName() { + return name; } - public void setFreeze(@jakarta.annotation.Nullable String freeze) { - this.freeze = freeze; + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; } - public AllCoinsInformationResponseInner ipoable(@jakarta.annotation.Nullable String ipoable) { - this.ipoable = ipoable; + public AllCoinsInformationResponseInner free(@jakarta.annotation.Nullable String free) { + this.free = free; return this; } /** - * Get ipoable + * Get free * - * @return ipoable + * @return free */ @jakarta.annotation.Nullable - public String getIpoable() { - return ipoable; + public String getFree() { + return free; } - public void setIpoable(@jakarta.annotation.Nullable String ipoable) { - this.ipoable = ipoable; + public void setFree(@jakarta.annotation.Nullable String free) { + this.free = free; } - public AllCoinsInformationResponseInner ipoing(@jakarta.annotation.Nullable String ipoing) { - this.ipoing = ipoing; + public AllCoinsInformationResponseInner locked(@jakarta.annotation.Nullable String locked) { + this.locked = locked; return this; } /** - * Get ipoing + * Get locked * - * @return ipoing + * @return locked */ @jakarta.annotation.Nullable - public String getIpoing() { - return ipoing; + public String getLocked() { + return locked; } - public void setIpoing(@jakarta.annotation.Nullable String ipoing) { - this.ipoing = ipoing; + public void setLocked(@jakarta.annotation.Nullable String locked) { + this.locked = locked; } - public AllCoinsInformationResponseInner isLegalMoney( - @jakarta.annotation.Nullable Boolean isLegalMoney) { - this.isLegalMoney = isLegalMoney; + public AllCoinsInformationResponseInner freeze(@jakarta.annotation.Nullable String freeze) { + this.freeze = freeze; return this; } /** - * Get isLegalMoney + * Get freeze * - * @return isLegalMoney + * @return freeze */ @jakarta.annotation.Nullable - public Boolean getIsLegalMoney() { - return isLegalMoney; + public String getFreeze() { + return freeze; } - public void setIsLegalMoney(@jakarta.annotation.Nullable Boolean isLegalMoney) { - this.isLegalMoney = isLegalMoney; + public void setFreeze(@jakarta.annotation.Nullable String freeze) { + this.freeze = freeze; } - public AllCoinsInformationResponseInner locked(@jakarta.annotation.Nullable String locked) { - this.locked = locked; + public AllCoinsInformationResponseInner withdrawing( + @jakarta.annotation.Nullable String withdrawing) { + this.withdrawing = withdrawing; return this; } /** - * Get locked + * Get withdrawing * - * @return locked + * @return withdrawing */ @jakarta.annotation.Nullable - public String getLocked() { - return locked; + public String getWithdrawing() { + return withdrawing; } - public void setLocked(@jakarta.annotation.Nullable String locked) { - this.locked = locked; + public void setWithdrawing(@jakarta.annotation.Nullable String withdrawing) { + this.withdrawing = withdrawing; } - public AllCoinsInformationResponseInner name(@jakarta.annotation.Nullable String name) { - this.name = name; + public AllCoinsInformationResponseInner ipoing(@jakarta.annotation.Nullable String ipoing) { + this.ipoing = ipoing; return this; } /** - * Get name + * Get ipoing * - * @return name + * @return ipoing */ @jakarta.annotation.Nullable - public String getName() { - return name; - } - - public void setName(@jakarta.annotation.Nullable String name) { - this.name = name; + public String getIpoing() { + return ipoing; } - public AllCoinsInformationResponseInner networkList( - @jakarta.annotation.Nullable - List<@Valid AllCoinsInformationResponseInnerNetworkListInner> networkList) { - this.networkList = networkList; - return this; + public void setIpoing(@jakarta.annotation.Nullable String ipoing) { + this.ipoing = ipoing; } - public AllCoinsInformationResponseInner addNetworkListItem( - AllCoinsInformationResponseInnerNetworkListInner networkListItem) { - if (this.networkList == null) { - this.networkList = new ArrayList<>(); - } - this.networkList.add(networkListItem); + public AllCoinsInformationResponseInner ipoable(@jakarta.annotation.Nullable String ipoable) { + this.ipoable = ipoable; return this; } /** - * Get networkList + * Get ipoable * - * @return networkList + * @return ipoable */ @jakarta.annotation.Nullable - @Valid - public List<@Valid AllCoinsInformationResponseInnerNetworkListInner> getNetworkList() { - return networkList; + public String getIpoable() { + return ipoable; } - public void setNetworkList( - @jakarta.annotation.Nullable - List<@Valid AllCoinsInformationResponseInnerNetworkListInner> networkList) { - this.networkList = networkList; + public void setIpoable(@jakarta.annotation.Nullable String ipoable) { + this.ipoable = ipoable; } public AllCoinsInformationResponseInner storage(@jakarta.annotation.Nullable String storage) { @@ -353,63 +340,76 @@ public void setStorage(@jakarta.annotation.Nullable String storage) { this.storage = storage; } - public AllCoinsInformationResponseInner trading(@jakarta.annotation.Nullable Boolean trading) { - this.trading = trading; + public AllCoinsInformationResponseInner isLegalMoney( + @jakarta.annotation.Nullable Boolean isLegalMoney) { + this.isLegalMoney = isLegalMoney; return this; } /** - * Get trading + * Get isLegalMoney * - * @return trading + * @return isLegalMoney */ @jakarta.annotation.Nullable - public Boolean getTrading() { - return trading; + public Boolean getIsLegalMoney() { + return isLegalMoney; } - public void setTrading(@jakarta.annotation.Nullable Boolean trading) { - this.trading = trading; + public void setIsLegalMoney(@jakarta.annotation.Nullable Boolean isLegalMoney) { + this.isLegalMoney = isLegalMoney; } - public AllCoinsInformationResponseInner withdrawAllEnable( - @jakarta.annotation.Nullable Boolean withdrawAllEnable) { - this.withdrawAllEnable = withdrawAllEnable; + public AllCoinsInformationResponseInner trading(@jakarta.annotation.Nullable Boolean trading) { + this.trading = trading; return this; } /** - * Get withdrawAllEnable + * Get trading * - * @return withdrawAllEnable + * @return trading */ @jakarta.annotation.Nullable - public Boolean getWithdrawAllEnable() { - return withdrawAllEnable; + public Boolean getTrading() { + return trading; } - public void setWithdrawAllEnable(@jakarta.annotation.Nullable Boolean withdrawAllEnable) { - this.withdrawAllEnable = withdrawAllEnable; + public void setTrading(@jakarta.annotation.Nullable Boolean trading) { + this.trading = trading; } - public AllCoinsInformationResponseInner withdrawing( - @jakarta.annotation.Nullable String withdrawing) { - this.withdrawing = withdrawing; + public AllCoinsInformationResponseInner networkList( + @jakarta.annotation.Nullable + List<@Valid AllCoinsInformationResponseInnerNetworkListInner> networkList) { + this.networkList = networkList; + return this; + } + + public AllCoinsInformationResponseInner addNetworkListItem( + AllCoinsInformationResponseInnerNetworkListInner networkListItem) { + if (this.networkList == null) { + this.networkList = new ArrayList<>(); + } + this.networkList.add(networkListItem); return this; } /** - * Get withdrawing + * Get networkList * - * @return withdrawing + * @return networkList */ @jakarta.annotation.Nullable - public String getWithdrawing() { - return withdrawing; + @Valid + public List<@Valid AllCoinsInformationResponseInnerNetworkListInner> getNetworkList() { + return networkList; } - public void setWithdrawing(@jakarta.annotation.Nullable String withdrawing) { - this.withdrawing = withdrawing; + public void setNetworkList( + @jakarta.annotation.Nullable + List<@Valid AllCoinsInformationResponseInnerNetworkListInner> networkList) { + this.networkList = networkList; } @Override @@ -425,19 +425,19 @@ public boolean equals(Object o) { return Objects.equals(this.coin, allCoinsInformationResponseInner.coin) && Objects.equals( this.depositAllEnable, allCoinsInformationResponseInner.depositAllEnable) + && Objects.equals( + this.withdrawAllEnable, allCoinsInformationResponseInner.withdrawAllEnable) + && Objects.equals(this.name, allCoinsInformationResponseInner.name) && Objects.equals(this.free, allCoinsInformationResponseInner.free) + && Objects.equals(this.locked, allCoinsInformationResponseInner.locked) && Objects.equals(this.freeze, allCoinsInformationResponseInner.freeze) - && Objects.equals(this.ipoable, allCoinsInformationResponseInner.ipoable) + && Objects.equals(this.withdrawing, allCoinsInformationResponseInner.withdrawing) && Objects.equals(this.ipoing, allCoinsInformationResponseInner.ipoing) - && Objects.equals(this.isLegalMoney, allCoinsInformationResponseInner.isLegalMoney) - && Objects.equals(this.locked, allCoinsInformationResponseInner.locked) - && Objects.equals(this.name, allCoinsInformationResponseInner.name) - && Objects.equals(this.networkList, allCoinsInformationResponseInner.networkList) + && Objects.equals(this.ipoable, allCoinsInformationResponseInner.ipoable) && Objects.equals(this.storage, allCoinsInformationResponseInner.storage) + && Objects.equals(this.isLegalMoney, allCoinsInformationResponseInner.isLegalMoney) && Objects.equals(this.trading, allCoinsInformationResponseInner.trading) - && Objects.equals( - this.withdrawAllEnable, allCoinsInformationResponseInner.withdrawAllEnable) - && Objects.equals(this.withdrawing, allCoinsInformationResponseInner.withdrawing); + && Objects.equals(this.networkList, allCoinsInformationResponseInner.networkList); } @Override @@ -445,18 +445,18 @@ public int hashCode() { return Objects.hash( coin, depositAllEnable, + withdrawAllEnable, + name, free, + locked, freeze, - ipoable, + withdrawing, ipoing, - isLegalMoney, - locked, - name, - networkList, + ipoable, storage, + isLegalMoney, trading, - withdrawAllEnable, - withdrawing); + networkList); } @Override @@ -465,18 +465,18 @@ public String toString() { sb.append("class AllCoinsInformationResponseInner {\n"); sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); sb.append(" depositAllEnable: ").append(toIndentedString(depositAllEnable)).append("\n"); + sb.append(" withdrawAllEnable: ").append(toIndentedString(withdrawAllEnable)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" free: ").append(toIndentedString(free)).append("\n"); + sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); sb.append(" freeze: ").append(toIndentedString(freeze)).append("\n"); - sb.append(" ipoable: ").append(toIndentedString(ipoable)).append("\n"); + sb.append(" withdrawing: ").append(toIndentedString(withdrawing)).append("\n"); sb.append(" ipoing: ").append(toIndentedString(ipoing)).append("\n"); - sb.append(" isLegalMoney: ").append(toIndentedString(isLegalMoney)).append("\n"); - sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" networkList: ").append(toIndentedString(networkList)).append("\n"); + sb.append(" ipoable: ").append(toIndentedString(ipoable)).append("\n"); sb.append(" storage: ").append(toIndentedString(storage)).append("\n"); + sb.append(" isLegalMoney: ").append(toIndentedString(isLegalMoney)).append("\n"); sb.append(" trading: ").append(toIndentedString(trading)).append("\n"); - sb.append(" withdrawAllEnable: ").append(toIndentedString(withdrawAllEnable)).append("\n"); - sb.append(" withdrawing: ").append(toIndentedString(withdrawing)).append("\n"); + sb.append(" networkList: ").append(toIndentedString(networkList)).append("\n"); sb.append("}"); return sb.toString(); } @@ -492,34 +492,52 @@ public String toUrlQueryString() { String depositAllEnableValueAsString = ""; depositAllEnableValueAsString = depositAllEnableValue.toString(); sb.append("depositAllEnable=").append(urlEncode(depositAllEnableValueAsString)).append(""); + Object withdrawAllEnableValue = getWithdrawAllEnable(); + String withdrawAllEnableValueAsString = ""; + withdrawAllEnableValueAsString = withdrawAllEnableValue.toString(); + sb.append("withdrawAllEnable=") + .append(urlEncode(withdrawAllEnableValueAsString)) + .append(""); + Object nameValue = getName(); + String nameValueAsString = ""; + nameValueAsString = nameValue.toString(); + sb.append("name=").append(urlEncode(nameValueAsString)).append(""); Object freeValue = getFree(); String freeValueAsString = ""; freeValueAsString = freeValue.toString(); sb.append("free=").append(urlEncode(freeValueAsString)).append(""); + Object lockedValue = getLocked(); + String lockedValueAsString = ""; + lockedValueAsString = lockedValue.toString(); + sb.append("locked=").append(urlEncode(lockedValueAsString)).append(""); Object freezeValue = getFreeze(); String freezeValueAsString = ""; freezeValueAsString = freezeValue.toString(); sb.append("freeze=").append(urlEncode(freezeValueAsString)).append(""); - Object ipoableValue = getIpoable(); - String ipoableValueAsString = ""; - ipoableValueAsString = ipoableValue.toString(); - sb.append("ipoable=").append(urlEncode(ipoableValueAsString)).append(""); + Object withdrawingValue = getWithdrawing(); + String withdrawingValueAsString = ""; + withdrawingValueAsString = withdrawingValue.toString(); + sb.append("withdrawing=").append(urlEncode(withdrawingValueAsString)).append(""); Object ipoingValue = getIpoing(); String ipoingValueAsString = ""; ipoingValueAsString = ipoingValue.toString(); sb.append("ipoing=").append(urlEncode(ipoingValueAsString)).append(""); + Object ipoableValue = getIpoable(); + String ipoableValueAsString = ""; + ipoableValueAsString = ipoableValue.toString(); + sb.append("ipoable=").append(urlEncode(ipoableValueAsString)).append(""); + Object storageValue = getStorage(); + String storageValueAsString = ""; + storageValueAsString = storageValue.toString(); + sb.append("storage=").append(urlEncode(storageValueAsString)).append(""); Object isLegalMoneyValue = getIsLegalMoney(); String isLegalMoneyValueAsString = ""; isLegalMoneyValueAsString = isLegalMoneyValue.toString(); sb.append("isLegalMoney=").append(urlEncode(isLegalMoneyValueAsString)).append(""); - Object lockedValue = getLocked(); - String lockedValueAsString = ""; - lockedValueAsString = lockedValue.toString(); - sb.append("locked=").append(urlEncode(lockedValueAsString)).append(""); - Object nameValue = getName(); - String nameValueAsString = ""; - nameValueAsString = nameValue.toString(); - sb.append("name=").append(urlEncode(nameValueAsString)).append(""); + Object tradingValue = getTrading(); + String tradingValueAsString = ""; + tradingValueAsString = tradingValue.toString(); + sb.append("trading=").append(urlEncode(tradingValueAsString)).append(""); Object networkListValue = getNetworkList(); String networkListValueAsString = ""; networkListValueAsString = @@ -527,24 +545,6 @@ public String toUrlQueryString() { ((Collection) networkListValue) .stream().map(Object::toString).collect(Collectors.joining(",")); sb.append("networkList=").append(urlEncode(networkListValueAsString)).append(""); - Object storageValue = getStorage(); - String storageValueAsString = ""; - storageValueAsString = storageValue.toString(); - sb.append("storage=").append(urlEncode(storageValueAsString)).append(""); - Object tradingValue = getTrading(); - String tradingValueAsString = ""; - tradingValueAsString = tradingValue.toString(); - sb.append("trading=").append(urlEncode(tradingValueAsString)).append(""); - Object withdrawAllEnableValue = getWithdrawAllEnable(); - String withdrawAllEnableValueAsString = ""; - withdrawAllEnableValueAsString = withdrawAllEnableValue.toString(); - sb.append("withdrawAllEnable=") - .append(urlEncode(withdrawAllEnableValueAsString)) - .append(""); - Object withdrawingValue = getWithdrawing(); - String withdrawingValueAsString = ""; - withdrawingValueAsString = withdrawingValue.toString(); - sb.append("withdrawing=").append(urlEncode(withdrawingValueAsString)).append(""); return sb.toString(); } @@ -575,18 +575,18 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("coin"); openapiFields.add("depositAllEnable"); + openapiFields.add("withdrawAllEnable"); + openapiFields.add("name"); openapiFields.add("free"); + openapiFields.add("locked"); openapiFields.add("freeze"); - openapiFields.add("ipoable"); + openapiFields.add("withdrawing"); openapiFields.add("ipoing"); - openapiFields.add("isLegalMoney"); - openapiFields.add("locked"); - openapiFields.add("name"); - openapiFields.add("networkList"); + openapiFields.add("ipoable"); openapiFields.add("storage"); + openapiFields.add("isLegalMoney"); openapiFields.add("trading"); - openapiFields.add("withdrawAllEnable"); - openapiFields.add("withdrawing"); + openapiFields.add("networkList"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -619,6 +619,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("coin").toString())); } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } if ((jsonObj.get("free") != null && !jsonObj.get("free").isJsonNull()) && !jsonObj.get("free").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -627,6 +635,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("free").toString())); } + if ((jsonObj.get("locked") != null && !jsonObj.get("locked").isJsonNull()) + && !jsonObj.get("locked").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `locked` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("locked").toString())); + } if ((jsonObj.get("freeze") != null && !jsonObj.get("freeze").isJsonNull()) && !jsonObj.get("freeze").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -635,13 +651,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("freeze").toString())); } - if ((jsonObj.get("ipoable") != null && !jsonObj.get("ipoable").isJsonNull()) - && !jsonObj.get("ipoable").isJsonPrimitive()) { + if ((jsonObj.get("withdrawing") != null && !jsonObj.get("withdrawing").isJsonNull()) + && !jsonObj.get("withdrawing").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `ipoable` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("ipoable").toString())); + "Expected the field `withdrawing` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("withdrawing").toString())); } if ((jsonObj.get("ipoing") != null && !jsonObj.get("ipoing").isJsonNull()) && !jsonObj.get("ipoing").isJsonPrimitive()) { @@ -651,21 +667,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("ipoing").toString())); } - if ((jsonObj.get("locked") != null && !jsonObj.get("locked").isJsonNull()) - && !jsonObj.get("locked").isJsonPrimitive()) { + if ((jsonObj.get("ipoable") != null && !jsonObj.get("ipoable").isJsonNull()) + && !jsonObj.get("ipoable").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `locked` to be a primitive type in the JSON string" + "Expected the field `ipoable` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("locked").toString())); + jsonObj.get("ipoable").toString())); } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { + if ((jsonObj.get("storage") != null && !jsonObj.get("storage").isJsonNull()) + && !jsonObj.get("storage").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `name` to be a primitive type in the JSON string" + "Expected the field `storage` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("name").toString())); + jsonObj.get("storage").toString())); } if (jsonObj.get("networkList") != null && !jsonObj.get("networkList").isJsonNull()) { JsonArray jsonArraynetworkList = jsonObj.getAsJsonArray("networkList"); @@ -687,22 +703,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - if ((jsonObj.get("storage") != null && !jsonObj.get("storage").isJsonNull()) - && !jsonObj.get("storage").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `storage` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("storage").toString())); - } - if ((jsonObj.get("withdrawing") != null && !jsonObj.get("withdrawing").isJsonNull()) - && !jsonObj.get("withdrawing").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawing` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("withdrawing").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInner.java index e42397405..5b031fc6b 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInner.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInner.java @@ -14,7 +14,6 @@ import com.binance.connector.client.wallet.rest.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -23,18 +22,13 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; import java.util.HashSet; -import java.util.List; import java.util.Objects; -import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; /** AllCoinsInformationResponseInnerNetworkListInner */ @@ -42,11 +36,11 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class AllCoinsInformationResponseInnerNetworkListInner { - public static final String SERIALIZED_NAME_ADDRESS_REGEX = "addressRegex"; + public static final String SERIALIZED_NAME_NETWORK = "network"; - @SerializedName(SERIALIZED_NAME_ADDRESS_REGEX) + @SerializedName(SERIALIZED_NAME_NETWORK) @jakarta.annotation.Nullable - private String addressRegex; + private String network; public static final String SERIALIZED_NAME_COIN = "coin"; @@ -54,17 +48,12 @@ public class AllCoinsInformationResponseInnerNetworkListInner { @jakarta.annotation.Nullable private String coin; - public static final String SERIALIZED_NAME_DEPOSIT_DESC = "depositDesc"; - - @SerializedName(SERIALIZED_NAME_DEPOSIT_DESC) - @jakarta.annotation.Nullable - private String depositDesc; - - public static final String SERIALIZED_NAME_DEPOSIT_ENABLE = "depositEnable"; + public static final String SERIALIZED_NAME_WITHDRAW_INTEGER_MULTIPLE = + "withdrawIntegerMultiple"; - @SerializedName(SERIALIZED_NAME_DEPOSIT_ENABLE) + @SerializedName(SERIALIZED_NAME_WITHDRAW_INTEGER_MULTIPLE) @jakarta.annotation.Nullable - private Boolean depositEnable; + private String withdrawIntegerMultiple; public static final String SERIALIZED_NAME_IS_DEFAULT = "isDefault"; @@ -72,29 +61,29 @@ public class AllCoinsInformationResponseInnerNetworkListInner { @jakarta.annotation.Nullable private Boolean isDefault; - public static final String SERIALIZED_NAME_MEMO_REGEX = "memoRegex"; + public static final String SERIALIZED_NAME_DEPOSIT_ENABLE = "depositEnable"; - @SerializedName(SERIALIZED_NAME_MEMO_REGEX) + @SerializedName(SERIALIZED_NAME_DEPOSIT_ENABLE) @jakarta.annotation.Nullable - private String memoRegex; + private Boolean depositEnable; - public static final String SERIALIZED_NAME_MIN_CONFIRM = "minConfirm"; + public static final String SERIALIZED_NAME_WITHDRAW_ENABLE = "withdrawEnable"; - @SerializedName(SERIALIZED_NAME_MIN_CONFIRM) + @SerializedName(SERIALIZED_NAME_WITHDRAW_ENABLE) @jakarta.annotation.Nullable - private Long minConfirm; + private Boolean withdrawEnable; - public static final String SERIALIZED_NAME_NAME = "name"; + public static final String SERIALIZED_NAME_DEPOSIT_DESC = "depositDesc"; - @SerializedName(SERIALIZED_NAME_NAME) + @SerializedName(SERIALIZED_NAME_DEPOSIT_DESC) @jakarta.annotation.Nullable - private String name; + private String depositDesc; - public static final String SERIALIZED_NAME_NETWORK = "network"; + public static final String SERIALIZED_NAME_WITHDRAW_DESC = "withdrawDesc"; - @SerializedName(SERIALIZED_NAME_NETWORK) + @SerializedName(SERIALIZED_NAME_WITHDRAW_DESC) @jakarta.annotation.Nullable - private String network; + private String withdrawDesc; public static final String SERIALIZED_NAME_SPECIAL_TIPS = "specialTips"; @@ -102,42 +91,41 @@ public class AllCoinsInformationResponseInnerNetworkListInner { @jakarta.annotation.Nullable private String specialTips; - public static final String SERIALIZED_NAME_UN_LOCK_CONFIRM = "unLockConfirm"; + public static final String SERIALIZED_NAME_SPECIAL_WITHDRAW_TIPS = "specialWithdrawTips"; - @SerializedName(SERIALIZED_NAME_UN_LOCK_CONFIRM) + @SerializedName(SERIALIZED_NAME_SPECIAL_WITHDRAW_TIPS) @jakarta.annotation.Nullable - private Long unLockConfirm; + private String specialWithdrawTips; - public static final String SERIALIZED_NAME_WITHDRAW_DESC = "withdrawDesc"; + public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_WITHDRAW_DESC) + @SerializedName(SERIALIZED_NAME_NAME) @jakarta.annotation.Nullable - private String withdrawDesc; + private String name; - public static final String SERIALIZED_NAME_WITHDRAW_ENABLE = "withdrawEnable"; + public static final String SERIALIZED_NAME_RESET_ADDRESS_STATUS = "resetAddressStatus"; - @SerializedName(SERIALIZED_NAME_WITHDRAW_ENABLE) + @SerializedName(SERIALIZED_NAME_RESET_ADDRESS_STATUS) @jakarta.annotation.Nullable - private Boolean withdrawEnable; + private Boolean resetAddressStatus; - public static final String SERIALIZED_NAME_WITHDRAW_FEE = "withdrawFee"; + public static final String SERIALIZED_NAME_ADDRESS_REGEX = "addressRegex"; - @SerializedName(SERIALIZED_NAME_WITHDRAW_FEE) + @SerializedName(SERIALIZED_NAME_ADDRESS_REGEX) @jakarta.annotation.Nullable - private String withdrawFee; + private String addressRegex; - public static final String SERIALIZED_NAME_WITHDRAW_INTEGER_MULTIPLE = - "withdrawIntegerMultiple"; + public static final String SERIALIZED_NAME_MEMO_REGEX = "memoRegex"; - @SerializedName(SERIALIZED_NAME_WITHDRAW_INTEGER_MULTIPLE) + @SerializedName(SERIALIZED_NAME_MEMO_REGEX) @jakarta.annotation.Nullable - private String withdrawIntegerMultiple; + private String memoRegex; - public static final String SERIALIZED_NAME_WITHDRAW_MAX = "withdrawMax"; + public static final String SERIALIZED_NAME_WITHDRAW_FEE = "withdrawFee"; - @SerializedName(SERIALIZED_NAME_WITHDRAW_MAX) + @SerializedName(SERIALIZED_NAME_WITHDRAW_FEE) @jakarta.annotation.Nullable - private String withdrawMax; + private String withdrawFee; public static final String SERIALIZED_NAME_WITHDRAW_MIN = "withdrawMin"; @@ -145,18 +133,48 @@ public class AllCoinsInformationResponseInnerNetworkListInner { @jakarta.annotation.Nullable private String withdrawMin; + public static final String SERIALIZED_NAME_WITHDRAW_MAX = "withdrawMax"; + + @SerializedName(SERIALIZED_NAME_WITHDRAW_MAX) + @jakarta.annotation.Nullable + private String withdrawMax; + public static final String SERIALIZED_NAME_WITHDRAW_INTERNAL_MIN = "withdrawInternalMin"; @SerializedName(SERIALIZED_NAME_WITHDRAW_INTERNAL_MIN) @jakarta.annotation.Nullable private String withdrawInternalMin; + public static final String SERIALIZED_NAME_DEPOSIT_DUST = "depositDust"; + + @SerializedName(SERIALIZED_NAME_DEPOSIT_DUST) + @jakarta.annotation.Nullable + private String depositDust; + + public static final String SERIALIZED_NAME_MIN_CONFIRM = "minConfirm"; + + @SerializedName(SERIALIZED_NAME_MIN_CONFIRM) + @jakarta.annotation.Nullable + private Long minConfirm; + + public static final String SERIALIZED_NAME_UN_LOCK_CONFIRM = "unLockConfirm"; + + @SerializedName(SERIALIZED_NAME_UN_LOCK_CONFIRM) + @jakarta.annotation.Nullable + private Long unLockConfirm; + public static final String SERIALIZED_NAME_SAME_ADDRESS = "sameAddress"; @SerializedName(SERIALIZED_NAME_SAME_ADDRESS) @jakarta.annotation.Nullable private Boolean sameAddress; + public static final String SERIALIZED_NAME_WITHDRAW_TAG = "withdrawTag"; + + @SerializedName(SERIALIZED_NAME_WITHDRAW_TAG) + @jakarta.annotation.Nullable + private Boolean withdrawTag; + public static final String SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; @SerializedName(SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME) @@ -181,99 +199,32 @@ public class AllCoinsInformationResponseInnerNetworkListInner { @jakarta.annotation.Nullable private String contractAddress; - public static final String SERIALIZED_NAME_DEPOSIT_ALL_ENABLE = "depositAllEnable"; + public static final String SERIALIZED_NAME_DENOMINATION = "denomination"; - @SerializedName(SERIALIZED_NAME_DEPOSIT_ALL_ENABLE) + @SerializedName(SERIALIZED_NAME_DENOMINATION) @jakarta.annotation.Nullable - private Boolean depositAllEnable; - - public static final String SERIALIZED_NAME_WITHDRAW_ALL_ENABLE = "withdrawAllEnable"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_ALL_ENABLE) - @jakarta.annotation.Nullable - private Boolean withdrawAllEnable; - - public static final String SERIALIZED_NAME_FREE = "free"; - - @SerializedName(SERIALIZED_NAME_FREE) - @jakarta.annotation.Nullable - private String free; - - public static final String SERIALIZED_NAME_LOCKED = "locked"; - - @SerializedName(SERIALIZED_NAME_LOCKED) - @jakarta.annotation.Nullable - private String locked; - - public static final String SERIALIZED_NAME_FREEZE = "freeze"; - - @SerializedName(SERIALIZED_NAME_FREEZE) - @jakarta.annotation.Nullable - private String freeze; - - public static final String SERIALIZED_NAME_WITHDRAWING = "withdrawing"; - - @SerializedName(SERIALIZED_NAME_WITHDRAWING) - @jakarta.annotation.Nullable - private String withdrawing; - - public static final String SERIALIZED_NAME_IPOING = "ipoing"; - - @SerializedName(SERIALIZED_NAME_IPOING) - @jakarta.annotation.Nullable - private String ipoing; - - public static final String SERIALIZED_NAME_IPOABLE = "ipoable"; - - @SerializedName(SERIALIZED_NAME_IPOABLE) - @jakarta.annotation.Nullable - private String ipoable; - - public static final String SERIALIZED_NAME_STORAGE = "storage"; - - @SerializedName(SERIALIZED_NAME_STORAGE) - @jakarta.annotation.Nullable - private String storage; - - public static final String SERIALIZED_NAME_IS_LEGAL_MONEY = "isLegalMoney"; - - @SerializedName(SERIALIZED_NAME_IS_LEGAL_MONEY) - @jakarta.annotation.Nullable - private Boolean isLegalMoney; - - public static final String SERIALIZED_NAME_TRADING = "trading"; - - @SerializedName(SERIALIZED_NAME_TRADING) - @jakarta.annotation.Nullable - private Boolean trading; - - public static final String SERIALIZED_NAME_NETWORK_LIST = "networkList"; - - @SerializedName(SERIALIZED_NAME_NETWORK_LIST) - @jakarta.annotation.Nullable - private List<@Valid AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner> - networkList; + private Long denomination; public AllCoinsInformationResponseInnerNetworkListInner() {} - public AllCoinsInformationResponseInnerNetworkListInner addressRegex( - @jakarta.annotation.Nullable String addressRegex) { - this.addressRegex = addressRegex; + public AllCoinsInformationResponseInnerNetworkListInner network( + @jakarta.annotation.Nullable String network) { + this.network = network; return this; } /** - * Get addressRegex + * Get network * - * @return addressRegex + * @return network */ @jakarta.annotation.Nullable - public String getAddressRegex() { - return addressRegex; + public String getNetwork() { + return network; } - public void setAddressRegex(@jakarta.annotation.Nullable String addressRegex) { - this.addressRegex = addressRegex; + public void setNetwork(@jakarta.annotation.Nullable String network) { + this.network = network; } public AllCoinsInformationResponseInnerNetworkListInner coin( @@ -296,44 +247,25 @@ public void setCoin(@jakarta.annotation.Nullable String coin) { this.coin = coin; } - public AllCoinsInformationResponseInnerNetworkListInner depositDesc( - @jakarta.annotation.Nullable String depositDesc) { - this.depositDesc = depositDesc; - return this; - } - - /** - * Get depositDesc - * - * @return depositDesc - */ - @jakarta.annotation.Nullable - public String getDepositDesc() { - return depositDesc; - } - - public void setDepositDesc(@jakarta.annotation.Nullable String depositDesc) { - this.depositDesc = depositDesc; - } - - public AllCoinsInformationResponseInnerNetworkListInner depositEnable( - @jakarta.annotation.Nullable Boolean depositEnable) { - this.depositEnable = depositEnable; + public AllCoinsInformationResponseInnerNetworkListInner withdrawIntegerMultiple( + @jakarta.annotation.Nullable String withdrawIntegerMultiple) { + this.withdrawIntegerMultiple = withdrawIntegerMultiple; return this; } /** - * Get depositEnable + * Get withdrawIntegerMultiple * - * @return depositEnable + * @return withdrawIntegerMultiple */ @jakarta.annotation.Nullable - public Boolean getDepositEnable() { - return depositEnable; + public String getWithdrawIntegerMultiple() { + return withdrawIntegerMultiple; } - public void setDepositEnable(@jakarta.annotation.Nullable Boolean depositEnable) { - this.depositEnable = depositEnable; + public void setWithdrawIntegerMultiple( + @jakarta.annotation.Nullable String withdrawIntegerMultiple) { + this.withdrawIntegerMultiple = withdrawIntegerMultiple; } public AllCoinsInformationResponseInnerNetworkListInner isDefault( @@ -356,144 +288,24 @@ public void setIsDefault(@jakarta.annotation.Nullable Boolean isDefault) { this.isDefault = isDefault; } - public AllCoinsInformationResponseInnerNetworkListInner memoRegex( - @jakarta.annotation.Nullable String memoRegex) { - this.memoRegex = memoRegex; - return this; - } - - /** - * Get memoRegex - * - * @return memoRegex - */ - @jakarta.annotation.Nullable - public String getMemoRegex() { - return memoRegex; - } - - public void setMemoRegex(@jakarta.annotation.Nullable String memoRegex) { - this.memoRegex = memoRegex; - } - - public AllCoinsInformationResponseInnerNetworkListInner minConfirm( - @jakarta.annotation.Nullable Long minConfirm) { - this.minConfirm = minConfirm; - return this; - } - - /** - * Get minConfirm - * - * @return minConfirm - */ - @jakarta.annotation.Nullable - public Long getMinConfirm() { - return minConfirm; - } - - public void setMinConfirm(@jakarta.annotation.Nullable Long minConfirm) { - this.minConfirm = minConfirm; - } - - public AllCoinsInformationResponseInnerNetworkListInner name( - @jakarta.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - public void setName(@jakarta.annotation.Nullable String name) { - this.name = name; - } - - public AllCoinsInformationResponseInnerNetworkListInner network( - @jakarta.annotation.Nullable String network) { - this.network = network; - return this; - } - - /** - * Get network - * - * @return network - */ - @jakarta.annotation.Nullable - public String getNetwork() { - return network; - } - - public void setNetwork(@jakarta.annotation.Nullable String network) { - this.network = network; - } - - public AllCoinsInformationResponseInnerNetworkListInner specialTips( - @jakarta.annotation.Nullable String specialTips) { - this.specialTips = specialTips; - return this; - } - - /** - * Get specialTips - * - * @return specialTips - */ - @jakarta.annotation.Nullable - public String getSpecialTips() { - return specialTips; - } - - public void setSpecialTips(@jakarta.annotation.Nullable String specialTips) { - this.specialTips = specialTips; - } - - public AllCoinsInformationResponseInnerNetworkListInner unLockConfirm( - @jakarta.annotation.Nullable Long unLockConfirm) { - this.unLockConfirm = unLockConfirm; - return this; - } - - /** - * Get unLockConfirm - * - * @return unLockConfirm - */ - @jakarta.annotation.Nullable - public Long getUnLockConfirm() { - return unLockConfirm; - } - - public void setUnLockConfirm(@jakarta.annotation.Nullable Long unLockConfirm) { - this.unLockConfirm = unLockConfirm; - } - - public AllCoinsInformationResponseInnerNetworkListInner withdrawDesc( - @jakarta.annotation.Nullable String withdrawDesc) { - this.withdrawDesc = withdrawDesc; + public AllCoinsInformationResponseInnerNetworkListInner depositEnable( + @jakarta.annotation.Nullable Boolean depositEnable) { + this.depositEnable = depositEnable; return this; } /** - * Get withdrawDesc + * Get depositEnable * - * @return withdrawDesc + * @return depositEnable */ @jakarta.annotation.Nullable - public String getWithdrawDesc() { - return withdrawDesc; + public Boolean getDepositEnable() { + return depositEnable; } - public void setWithdrawDesc(@jakarta.annotation.Nullable String withdrawDesc) { - this.withdrawDesc = withdrawDesc; + public void setDepositEnable(@jakarta.annotation.Nullable Boolean depositEnable) { + this.depositEnable = depositEnable; } public AllCoinsInformationResponseInnerNetworkListInner withdrawEnable( @@ -516,461 +328,444 @@ public void setWithdrawEnable(@jakarta.annotation.Nullable Boolean withdrawEnabl this.withdrawEnable = withdrawEnable; } - public AllCoinsInformationResponseInnerNetworkListInner withdrawFee( - @jakarta.annotation.Nullable String withdrawFee) { - this.withdrawFee = withdrawFee; + public AllCoinsInformationResponseInnerNetworkListInner depositDesc( + @jakarta.annotation.Nullable String depositDesc) { + this.depositDesc = depositDesc; return this; } /** - * Get withdrawFee + * Get depositDesc * - * @return withdrawFee + * @return depositDesc */ @jakarta.annotation.Nullable - public String getWithdrawFee() { - return withdrawFee; + public String getDepositDesc() { + return depositDesc; } - public void setWithdrawFee(@jakarta.annotation.Nullable String withdrawFee) { - this.withdrawFee = withdrawFee; + public void setDepositDesc(@jakarta.annotation.Nullable String depositDesc) { + this.depositDesc = depositDesc; } - public AllCoinsInformationResponseInnerNetworkListInner withdrawIntegerMultiple( - @jakarta.annotation.Nullable String withdrawIntegerMultiple) { - this.withdrawIntegerMultiple = withdrawIntegerMultiple; + public AllCoinsInformationResponseInnerNetworkListInner withdrawDesc( + @jakarta.annotation.Nullable String withdrawDesc) { + this.withdrawDesc = withdrawDesc; return this; } /** - * Get withdrawIntegerMultiple + * Get withdrawDesc * - * @return withdrawIntegerMultiple + * @return withdrawDesc */ @jakarta.annotation.Nullable - public String getWithdrawIntegerMultiple() { - return withdrawIntegerMultiple; + public String getWithdrawDesc() { + return withdrawDesc; } - public void setWithdrawIntegerMultiple( - @jakarta.annotation.Nullable String withdrawIntegerMultiple) { - this.withdrawIntegerMultiple = withdrawIntegerMultiple; + public void setWithdrawDesc(@jakarta.annotation.Nullable String withdrawDesc) { + this.withdrawDesc = withdrawDesc; } - public AllCoinsInformationResponseInnerNetworkListInner withdrawMax( - @jakarta.annotation.Nullable String withdrawMax) { - this.withdrawMax = withdrawMax; + public AllCoinsInformationResponseInnerNetworkListInner specialTips( + @jakarta.annotation.Nullable String specialTips) { + this.specialTips = specialTips; return this; } /** - * Get withdrawMax + * Get specialTips * - * @return withdrawMax + * @return specialTips */ @jakarta.annotation.Nullable - public String getWithdrawMax() { - return withdrawMax; + public String getSpecialTips() { + return specialTips; } - public void setWithdrawMax(@jakarta.annotation.Nullable String withdrawMax) { - this.withdrawMax = withdrawMax; + public void setSpecialTips(@jakarta.annotation.Nullable String specialTips) { + this.specialTips = specialTips; } - public AllCoinsInformationResponseInnerNetworkListInner withdrawMin( - @jakarta.annotation.Nullable String withdrawMin) { - this.withdrawMin = withdrawMin; + public AllCoinsInformationResponseInnerNetworkListInner specialWithdrawTips( + @jakarta.annotation.Nullable String specialWithdrawTips) { + this.specialWithdrawTips = specialWithdrawTips; return this; } /** - * Get withdrawMin + * Get specialWithdrawTips * - * @return withdrawMin + * @return specialWithdrawTips */ @jakarta.annotation.Nullable - public String getWithdrawMin() { - return withdrawMin; + public String getSpecialWithdrawTips() { + return specialWithdrawTips; } - public void setWithdrawMin(@jakarta.annotation.Nullable String withdrawMin) { - this.withdrawMin = withdrawMin; + public void setSpecialWithdrawTips(@jakarta.annotation.Nullable String specialWithdrawTips) { + this.specialWithdrawTips = specialWithdrawTips; } - public AllCoinsInformationResponseInnerNetworkListInner withdrawInternalMin( - @jakarta.annotation.Nullable String withdrawInternalMin) { - this.withdrawInternalMin = withdrawInternalMin; + public AllCoinsInformationResponseInnerNetworkListInner name( + @jakarta.annotation.Nullable String name) { + this.name = name; return this; } /** - * Get withdrawInternalMin + * Get name * - * @return withdrawInternalMin + * @return name */ @jakarta.annotation.Nullable - public String getWithdrawInternalMin() { - return withdrawInternalMin; + public String getName() { + return name; } - public void setWithdrawInternalMin(@jakarta.annotation.Nullable String withdrawInternalMin) { - this.withdrawInternalMin = withdrawInternalMin; + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; } - public AllCoinsInformationResponseInnerNetworkListInner sameAddress( - @jakarta.annotation.Nullable Boolean sameAddress) { - this.sameAddress = sameAddress; + public AllCoinsInformationResponseInnerNetworkListInner resetAddressStatus( + @jakarta.annotation.Nullable Boolean resetAddressStatus) { + this.resetAddressStatus = resetAddressStatus; return this; } /** - * Get sameAddress + * Get resetAddressStatus * - * @return sameAddress + * @return resetAddressStatus */ @jakarta.annotation.Nullable - public Boolean getSameAddress() { - return sameAddress; + public Boolean getResetAddressStatus() { + return resetAddressStatus; } - public void setSameAddress(@jakarta.annotation.Nullable Boolean sameAddress) { - this.sameAddress = sameAddress; + public void setResetAddressStatus(@jakarta.annotation.Nullable Boolean resetAddressStatus) { + this.resetAddressStatus = resetAddressStatus; } - public AllCoinsInformationResponseInnerNetworkListInner estimatedArrivalTime( - @jakarta.annotation.Nullable Long estimatedArrivalTime) { - this.estimatedArrivalTime = estimatedArrivalTime; + public AllCoinsInformationResponseInnerNetworkListInner addressRegex( + @jakarta.annotation.Nullable String addressRegex) { + this.addressRegex = addressRegex; return this; } /** - * Get estimatedArrivalTime + * Get addressRegex * - * @return estimatedArrivalTime + * @return addressRegex */ @jakarta.annotation.Nullable - public Long getEstimatedArrivalTime() { - return estimatedArrivalTime; + public String getAddressRegex() { + return addressRegex; } - public void setEstimatedArrivalTime(@jakarta.annotation.Nullable Long estimatedArrivalTime) { - this.estimatedArrivalTime = estimatedArrivalTime; + public void setAddressRegex(@jakarta.annotation.Nullable String addressRegex) { + this.addressRegex = addressRegex; } - public AllCoinsInformationResponseInnerNetworkListInner busy( - @jakarta.annotation.Nullable Boolean busy) { - this.busy = busy; + public AllCoinsInformationResponseInnerNetworkListInner memoRegex( + @jakarta.annotation.Nullable String memoRegex) { + this.memoRegex = memoRegex; return this; } /** - * Get busy + * Get memoRegex * - * @return busy + * @return memoRegex */ @jakarta.annotation.Nullable - public Boolean getBusy() { - return busy; + public String getMemoRegex() { + return memoRegex; } - public void setBusy(@jakarta.annotation.Nullable Boolean busy) { - this.busy = busy; + public void setMemoRegex(@jakarta.annotation.Nullable String memoRegex) { + this.memoRegex = memoRegex; } - public AllCoinsInformationResponseInnerNetworkListInner contractAddressUrl( - @jakarta.annotation.Nullable String contractAddressUrl) { - this.contractAddressUrl = contractAddressUrl; + public AllCoinsInformationResponseInnerNetworkListInner withdrawFee( + @jakarta.annotation.Nullable String withdrawFee) { + this.withdrawFee = withdrawFee; return this; } /** - * Get contractAddressUrl + * Get withdrawFee * - * @return contractAddressUrl + * @return withdrawFee */ @jakarta.annotation.Nullable - public String getContractAddressUrl() { - return contractAddressUrl; + public String getWithdrawFee() { + return withdrawFee; } - public void setContractAddressUrl(@jakarta.annotation.Nullable String contractAddressUrl) { - this.contractAddressUrl = contractAddressUrl; + public void setWithdrawFee(@jakarta.annotation.Nullable String withdrawFee) { + this.withdrawFee = withdrawFee; } - public AllCoinsInformationResponseInnerNetworkListInner contractAddress( - @jakarta.annotation.Nullable String contractAddress) { - this.contractAddress = contractAddress; + public AllCoinsInformationResponseInnerNetworkListInner withdrawMin( + @jakarta.annotation.Nullable String withdrawMin) { + this.withdrawMin = withdrawMin; return this; } /** - * Get contractAddress + * Get withdrawMin * - * @return contractAddress + * @return withdrawMin */ @jakarta.annotation.Nullable - public String getContractAddress() { - return contractAddress; + public String getWithdrawMin() { + return withdrawMin; } - public void setContractAddress(@jakarta.annotation.Nullable String contractAddress) { - this.contractAddress = contractAddress; + public void setWithdrawMin(@jakarta.annotation.Nullable String withdrawMin) { + this.withdrawMin = withdrawMin; } - public AllCoinsInformationResponseInnerNetworkListInner depositAllEnable( - @jakarta.annotation.Nullable Boolean depositAllEnable) { - this.depositAllEnable = depositAllEnable; + public AllCoinsInformationResponseInnerNetworkListInner withdrawMax( + @jakarta.annotation.Nullable String withdrawMax) { + this.withdrawMax = withdrawMax; return this; } /** - * Get depositAllEnable + * Get withdrawMax * - * @return depositAllEnable + * @return withdrawMax */ @jakarta.annotation.Nullable - public Boolean getDepositAllEnable() { - return depositAllEnable; + public String getWithdrawMax() { + return withdrawMax; } - public void setDepositAllEnable(@jakarta.annotation.Nullable Boolean depositAllEnable) { - this.depositAllEnable = depositAllEnable; + public void setWithdrawMax(@jakarta.annotation.Nullable String withdrawMax) { + this.withdrawMax = withdrawMax; } - public AllCoinsInformationResponseInnerNetworkListInner withdrawAllEnable( - @jakarta.annotation.Nullable Boolean withdrawAllEnable) { - this.withdrawAllEnable = withdrawAllEnable; + public AllCoinsInformationResponseInnerNetworkListInner withdrawInternalMin( + @jakarta.annotation.Nullable String withdrawInternalMin) { + this.withdrawInternalMin = withdrawInternalMin; return this; } /** - * Get withdrawAllEnable + * Get withdrawInternalMin * - * @return withdrawAllEnable + * @return withdrawInternalMin */ @jakarta.annotation.Nullable - public Boolean getWithdrawAllEnable() { - return withdrawAllEnable; + public String getWithdrawInternalMin() { + return withdrawInternalMin; } - public void setWithdrawAllEnable(@jakarta.annotation.Nullable Boolean withdrawAllEnable) { - this.withdrawAllEnable = withdrawAllEnable; + public void setWithdrawInternalMin(@jakarta.annotation.Nullable String withdrawInternalMin) { + this.withdrawInternalMin = withdrawInternalMin; } - public AllCoinsInformationResponseInnerNetworkListInner free( - @jakarta.annotation.Nullable String free) { - this.free = free; + public AllCoinsInformationResponseInnerNetworkListInner depositDust( + @jakarta.annotation.Nullable String depositDust) { + this.depositDust = depositDust; return this; } /** - * Get free + * Get depositDust * - * @return free + * @return depositDust */ @jakarta.annotation.Nullable - public String getFree() { - return free; + public String getDepositDust() { + return depositDust; } - public void setFree(@jakarta.annotation.Nullable String free) { - this.free = free; + public void setDepositDust(@jakarta.annotation.Nullable String depositDust) { + this.depositDust = depositDust; } - public AllCoinsInformationResponseInnerNetworkListInner locked( - @jakarta.annotation.Nullable String locked) { - this.locked = locked; + public AllCoinsInformationResponseInnerNetworkListInner minConfirm( + @jakarta.annotation.Nullable Long minConfirm) { + this.minConfirm = minConfirm; return this; } /** - * Get locked + * Get minConfirm * - * @return locked + * @return minConfirm */ @jakarta.annotation.Nullable - public String getLocked() { - return locked; + public Long getMinConfirm() { + return minConfirm; } - public void setLocked(@jakarta.annotation.Nullable String locked) { - this.locked = locked; + public void setMinConfirm(@jakarta.annotation.Nullable Long minConfirm) { + this.minConfirm = minConfirm; } - public AllCoinsInformationResponseInnerNetworkListInner freeze( - @jakarta.annotation.Nullable String freeze) { - this.freeze = freeze; + public AllCoinsInformationResponseInnerNetworkListInner unLockConfirm( + @jakarta.annotation.Nullable Long unLockConfirm) { + this.unLockConfirm = unLockConfirm; return this; } /** - * Get freeze + * Get unLockConfirm * - * @return freeze + * @return unLockConfirm */ @jakarta.annotation.Nullable - public String getFreeze() { - return freeze; + public Long getUnLockConfirm() { + return unLockConfirm; } - public void setFreeze(@jakarta.annotation.Nullable String freeze) { - this.freeze = freeze; + public void setUnLockConfirm(@jakarta.annotation.Nullable Long unLockConfirm) { + this.unLockConfirm = unLockConfirm; } - public AllCoinsInformationResponseInnerNetworkListInner withdrawing( - @jakarta.annotation.Nullable String withdrawing) { - this.withdrawing = withdrawing; + public AllCoinsInformationResponseInnerNetworkListInner sameAddress( + @jakarta.annotation.Nullable Boolean sameAddress) { + this.sameAddress = sameAddress; return this; } /** - * Get withdrawing + * Get sameAddress * - * @return withdrawing + * @return sameAddress */ @jakarta.annotation.Nullable - public String getWithdrawing() { - return withdrawing; + public Boolean getSameAddress() { + return sameAddress; } - public void setWithdrawing(@jakarta.annotation.Nullable String withdrawing) { - this.withdrawing = withdrawing; + public void setSameAddress(@jakarta.annotation.Nullable Boolean sameAddress) { + this.sameAddress = sameAddress; } - public AllCoinsInformationResponseInnerNetworkListInner ipoing( - @jakarta.annotation.Nullable String ipoing) { - this.ipoing = ipoing; + public AllCoinsInformationResponseInnerNetworkListInner withdrawTag( + @jakarta.annotation.Nullable Boolean withdrawTag) { + this.withdrawTag = withdrawTag; return this; } /** - * Get ipoing + * Get withdrawTag * - * @return ipoing + * @return withdrawTag */ @jakarta.annotation.Nullable - public String getIpoing() { - return ipoing; + public Boolean getWithdrawTag() { + return withdrawTag; } - public void setIpoing(@jakarta.annotation.Nullable String ipoing) { - this.ipoing = ipoing; + public void setWithdrawTag(@jakarta.annotation.Nullable Boolean withdrawTag) { + this.withdrawTag = withdrawTag; } - public AllCoinsInformationResponseInnerNetworkListInner ipoable( - @jakarta.annotation.Nullable String ipoable) { - this.ipoable = ipoable; + public AllCoinsInformationResponseInnerNetworkListInner estimatedArrivalTime( + @jakarta.annotation.Nullable Long estimatedArrivalTime) { + this.estimatedArrivalTime = estimatedArrivalTime; return this; } /** - * Get ipoable + * Get estimatedArrivalTime * - * @return ipoable + * @return estimatedArrivalTime */ @jakarta.annotation.Nullable - public String getIpoable() { - return ipoable; + public Long getEstimatedArrivalTime() { + return estimatedArrivalTime; } - public void setIpoable(@jakarta.annotation.Nullable String ipoable) { - this.ipoable = ipoable; + public void setEstimatedArrivalTime(@jakarta.annotation.Nullable Long estimatedArrivalTime) { + this.estimatedArrivalTime = estimatedArrivalTime; } - public AllCoinsInformationResponseInnerNetworkListInner storage( - @jakarta.annotation.Nullable String storage) { - this.storage = storage; + public AllCoinsInformationResponseInnerNetworkListInner busy( + @jakarta.annotation.Nullable Boolean busy) { + this.busy = busy; return this; } /** - * Get storage + * Get busy * - * @return storage + * @return busy */ @jakarta.annotation.Nullable - public String getStorage() { - return storage; + public Boolean getBusy() { + return busy; } - public void setStorage(@jakarta.annotation.Nullable String storage) { - this.storage = storage; + public void setBusy(@jakarta.annotation.Nullable Boolean busy) { + this.busy = busy; } - public AllCoinsInformationResponseInnerNetworkListInner isLegalMoney( - @jakarta.annotation.Nullable Boolean isLegalMoney) { - this.isLegalMoney = isLegalMoney; + public AllCoinsInformationResponseInnerNetworkListInner contractAddressUrl( + @jakarta.annotation.Nullable String contractAddressUrl) { + this.contractAddressUrl = contractAddressUrl; return this; } /** - * Get isLegalMoney + * Get contractAddressUrl * - * @return isLegalMoney + * @return contractAddressUrl */ @jakarta.annotation.Nullable - public Boolean getIsLegalMoney() { - return isLegalMoney; + public String getContractAddressUrl() { + return contractAddressUrl; } - public void setIsLegalMoney(@jakarta.annotation.Nullable Boolean isLegalMoney) { - this.isLegalMoney = isLegalMoney; + public void setContractAddressUrl(@jakarta.annotation.Nullable String contractAddressUrl) { + this.contractAddressUrl = contractAddressUrl; } - public AllCoinsInformationResponseInnerNetworkListInner trading( - @jakarta.annotation.Nullable Boolean trading) { - this.trading = trading; + public AllCoinsInformationResponseInnerNetworkListInner contractAddress( + @jakarta.annotation.Nullable String contractAddress) { + this.contractAddress = contractAddress; return this; } /** - * Get trading + * Get contractAddress * - * @return trading + * @return contractAddress */ @jakarta.annotation.Nullable - public Boolean getTrading() { - return trading; - } - - public void setTrading(@jakarta.annotation.Nullable Boolean trading) { - this.trading = trading; + public String getContractAddress() { + return contractAddress; } - public AllCoinsInformationResponseInnerNetworkListInner networkList( - @jakarta.annotation.Nullable - List<@Valid AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner> - networkList) { - this.networkList = networkList; - return this; + public void setContractAddress(@jakarta.annotation.Nullable String contractAddress) { + this.contractAddress = contractAddress; } - public AllCoinsInformationResponseInnerNetworkListInner addNetworkListItem( - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner networkListItem) { - if (this.networkList == null) { - this.networkList = new ArrayList<>(); - } - this.networkList.add(networkListItem); + public AllCoinsInformationResponseInnerNetworkListInner denomination( + @jakarta.annotation.Nullable Long denomination) { + this.denomination = denomination; return this; } /** - * Get networkList + * Get denomination * - * @return networkList + * @return denomination */ @jakarta.annotation.Nullable - @Valid - public List<@Valid AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner> - getNetworkList() { - return networkList; + public Long getDenomination() { + return denomination; } - public void setNetworkList( - @jakarta.annotation.Nullable - List<@Valid AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner> - networkList) { - this.networkList = networkList; + public void setDenomination(@jakarta.annotation.Nullable Long denomination) { + this.denomination = denomination; } @Override @@ -985,55 +780,67 @@ public boolean equals(Object o) { allCoinsInformationResponseInnerNetworkListInner = (AllCoinsInformationResponseInnerNetworkListInner) o; return Objects.equals( - this.addressRegex, - allCoinsInformationResponseInnerNetworkListInner.addressRegex) + this.network, allCoinsInformationResponseInnerNetworkListInner.network) && Objects.equals(this.coin, allCoinsInformationResponseInnerNetworkListInner.coin) && Objects.equals( - this.depositDesc, - allCoinsInformationResponseInnerNetworkListInner.depositDesc) + this.withdrawIntegerMultiple, + allCoinsInformationResponseInnerNetworkListInner.withdrawIntegerMultiple) + && Objects.equals( + this.isDefault, allCoinsInformationResponseInnerNetworkListInner.isDefault) && Objects.equals( this.depositEnable, allCoinsInformationResponseInnerNetworkListInner.depositEnable) && Objects.equals( - this.isDefault, allCoinsInformationResponseInnerNetworkListInner.isDefault) - && Objects.equals( - this.memoRegex, allCoinsInformationResponseInnerNetworkListInner.memoRegex) + this.withdrawEnable, + allCoinsInformationResponseInnerNetworkListInner.withdrawEnable) && Objects.equals( - this.minConfirm, - allCoinsInformationResponseInnerNetworkListInner.minConfirm) - && Objects.equals(this.name, allCoinsInformationResponseInnerNetworkListInner.name) + this.depositDesc, + allCoinsInformationResponseInnerNetworkListInner.depositDesc) && Objects.equals( - this.network, allCoinsInformationResponseInnerNetworkListInner.network) + this.withdrawDesc, + allCoinsInformationResponseInnerNetworkListInner.withdrawDesc) && Objects.equals( this.specialTips, allCoinsInformationResponseInnerNetworkListInner.specialTips) && Objects.equals( - this.unLockConfirm, - allCoinsInformationResponseInnerNetworkListInner.unLockConfirm) + this.specialWithdrawTips, + allCoinsInformationResponseInnerNetworkListInner.specialWithdrawTips) + && Objects.equals(this.name, allCoinsInformationResponseInnerNetworkListInner.name) && Objects.equals( - this.withdrawDesc, - allCoinsInformationResponseInnerNetworkListInner.withdrawDesc) + this.resetAddressStatus, + allCoinsInformationResponseInnerNetworkListInner.resetAddressStatus) && Objects.equals( - this.withdrawEnable, - allCoinsInformationResponseInnerNetworkListInner.withdrawEnable) + this.addressRegex, + allCoinsInformationResponseInnerNetworkListInner.addressRegex) + && Objects.equals( + this.memoRegex, allCoinsInformationResponseInnerNetworkListInner.memoRegex) && Objects.equals( this.withdrawFee, allCoinsInformationResponseInnerNetworkListInner.withdrawFee) && Objects.equals( - this.withdrawIntegerMultiple, - allCoinsInformationResponseInnerNetworkListInner.withdrawIntegerMultiple) + this.withdrawMin, + allCoinsInformationResponseInnerNetworkListInner.withdrawMin) && Objects.equals( this.withdrawMax, allCoinsInformationResponseInnerNetworkListInner.withdrawMax) - && Objects.equals( - this.withdrawMin, - allCoinsInformationResponseInnerNetworkListInner.withdrawMin) && Objects.equals( this.withdrawInternalMin, allCoinsInformationResponseInnerNetworkListInner.withdrawInternalMin) + && Objects.equals( + this.depositDust, + allCoinsInformationResponseInnerNetworkListInner.depositDust) + && Objects.equals( + this.minConfirm, + allCoinsInformationResponseInnerNetworkListInner.minConfirm) + && Objects.equals( + this.unLockConfirm, + allCoinsInformationResponseInnerNetworkListInner.unLockConfirm) && Objects.equals( this.sameAddress, allCoinsInformationResponseInnerNetworkListInner.sameAddress) + && Objects.equals( + this.withdrawTag, + allCoinsInformationResponseInnerNetworkListInner.withdrawTag) && Objects.equals( this.estimatedArrivalTime, allCoinsInformationResponseInnerNetworkListInner.estimatedArrivalTime) @@ -1045,102 +852,78 @@ public boolean equals(Object o) { this.contractAddress, allCoinsInformationResponseInnerNetworkListInner.contractAddress) && Objects.equals( - this.depositAllEnable, - allCoinsInformationResponseInnerNetworkListInner.depositAllEnable) - && Objects.equals( - this.withdrawAllEnable, - allCoinsInformationResponseInnerNetworkListInner.withdrawAllEnable) - && Objects.equals(this.free, allCoinsInformationResponseInnerNetworkListInner.free) - && Objects.equals( - this.locked, allCoinsInformationResponseInnerNetworkListInner.locked) - && Objects.equals( - this.freeze, allCoinsInformationResponseInnerNetworkListInner.freeze) - && Objects.equals( - this.withdrawing, - allCoinsInformationResponseInnerNetworkListInner.withdrawing) - && Objects.equals( - this.ipoing, allCoinsInformationResponseInnerNetworkListInner.ipoing) - && Objects.equals( - this.ipoable, allCoinsInformationResponseInnerNetworkListInner.ipoable) - && Objects.equals( - this.storage, allCoinsInformationResponseInnerNetworkListInner.storage) - && Objects.equals( - this.isLegalMoney, - allCoinsInformationResponseInnerNetworkListInner.isLegalMoney) - && Objects.equals( - this.trading, allCoinsInformationResponseInnerNetworkListInner.trading) - && Objects.equals( - this.networkList, - allCoinsInformationResponseInnerNetworkListInner.networkList); + this.denomination, + allCoinsInformationResponseInnerNetworkListInner.denomination); } @Override public int hashCode() { return Objects.hash( - addressRegex, + network, coin, - depositDesc, - depositEnable, + withdrawIntegerMultiple, isDefault, - memoRegex, - minConfirm, - name, - network, - specialTips, - unLockConfirm, - withdrawDesc, + depositEnable, withdrawEnable, + depositDesc, + withdrawDesc, + specialTips, + specialWithdrawTips, + name, + resetAddressStatus, + addressRegex, + memoRegex, withdrawFee, - withdrawIntegerMultiple, - withdrawMax, withdrawMin, + withdrawMax, withdrawInternalMin, + depositDust, + minConfirm, + unLockConfirm, sameAddress, + withdrawTag, estimatedArrivalTime, busy, contractAddressUrl, contractAddress, - depositAllEnable, - withdrawAllEnable, - free, - locked, - freeze, - withdrawing, - ipoing, - ipoable, - storage, - isLegalMoney, - trading, - networkList); + denomination); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AllCoinsInformationResponseInnerNetworkListInner {\n"); - sb.append(" addressRegex: ").append(toIndentedString(addressRegex)).append("\n"); - sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); - sb.append(" depositDesc: ").append(toIndentedString(depositDesc)).append("\n"); - sb.append(" depositEnable: ").append(toIndentedString(depositEnable)).append("\n"); - sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); - sb.append(" memoRegex: ").append(toIndentedString(memoRegex)).append("\n"); - sb.append(" minConfirm: ").append(toIndentedString(minConfirm)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" network: ").append(toIndentedString(network)).append("\n"); - sb.append(" specialTips: ").append(toIndentedString(specialTips)).append("\n"); - sb.append(" unLockConfirm: ").append(toIndentedString(unLockConfirm)).append("\n"); - sb.append(" withdrawDesc: ").append(toIndentedString(withdrawDesc)).append("\n"); - sb.append(" withdrawEnable: ").append(toIndentedString(withdrawEnable)).append("\n"); - sb.append(" withdrawFee: ").append(toIndentedString(withdrawFee)).append("\n"); + sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); sb.append(" withdrawIntegerMultiple: ") .append(toIndentedString(withdrawIntegerMultiple)) .append("\n"); - sb.append(" withdrawMax: ").append(toIndentedString(withdrawMax)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" depositEnable: ").append(toIndentedString(depositEnable)).append("\n"); + sb.append(" withdrawEnable: ").append(toIndentedString(withdrawEnable)).append("\n"); + sb.append(" depositDesc: ").append(toIndentedString(depositDesc)).append("\n"); + sb.append(" withdrawDesc: ").append(toIndentedString(withdrawDesc)).append("\n"); + sb.append(" specialTips: ").append(toIndentedString(specialTips)).append("\n"); + sb.append(" specialWithdrawTips: ") + .append(toIndentedString(specialWithdrawTips)) + .append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" resetAddressStatus: ") + .append(toIndentedString(resetAddressStatus)) + .append("\n"); + sb.append(" addressRegex: ").append(toIndentedString(addressRegex)).append("\n"); + sb.append(" memoRegex: ").append(toIndentedString(memoRegex)).append("\n"); + sb.append(" withdrawFee: ").append(toIndentedString(withdrawFee)).append("\n"); sb.append(" withdrawMin: ").append(toIndentedString(withdrawMin)).append("\n"); + sb.append(" withdrawMax: ").append(toIndentedString(withdrawMax)).append("\n"); sb.append(" withdrawInternalMin: ") .append(toIndentedString(withdrawInternalMin)) .append("\n"); + sb.append(" depositDust: ").append(toIndentedString(depositDust)).append("\n"); + sb.append(" minConfirm: ").append(toIndentedString(minConfirm)).append("\n"); + sb.append(" unLockConfirm: ").append(toIndentedString(unLockConfirm)).append("\n"); sb.append(" sameAddress: ").append(toIndentedString(sameAddress)).append("\n"); + sb.append(" withdrawTag: ").append(toIndentedString(withdrawTag)).append("\n"); sb.append(" estimatedArrivalTime: ") .append(toIndentedString(estimatedArrivalTime)) .append("\n"); @@ -1149,18 +932,7 @@ public String toString() { .append(toIndentedString(contractAddressUrl)) .append("\n"); sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); - sb.append(" depositAllEnable: ").append(toIndentedString(depositAllEnable)).append("\n"); - sb.append(" withdrawAllEnable: ").append(toIndentedString(withdrawAllEnable)).append("\n"); - sb.append(" free: ").append(toIndentedString(free)).append("\n"); - sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); - sb.append(" freeze: ").append(toIndentedString(freeze)).append("\n"); - sb.append(" withdrawing: ").append(toIndentedString(withdrawing)).append("\n"); - sb.append(" ipoing: ").append(toIndentedString(ipoing)).append("\n"); - sb.append(" ipoable: ").append(toIndentedString(ipoable)).append("\n"); - sb.append(" storage: ").append(toIndentedString(storage)).append("\n"); - sb.append(" isLegalMoney: ").append(toIndentedString(isLegalMoney)).append("\n"); - sb.append(" trading: ").append(toIndentedString(trading)).append("\n"); - sb.append(" networkList: ").append(toIndentedString(networkList)).append("\n"); + sb.append(" denomination: ").append(toIndentedString(denomination)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1168,86 +940,106 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object addressRegexValue = getAddressRegex(); - String addressRegexValueAsString = ""; - addressRegexValueAsString = addressRegexValue.toString(); - sb.append("addressRegex=").append(urlEncode(addressRegexValueAsString)).append(""); + Object networkValue = getNetwork(); + String networkValueAsString = ""; + networkValueAsString = networkValue.toString(); + sb.append("network=").append(urlEncode(networkValueAsString)).append(""); Object coinValue = getCoin(); String coinValueAsString = ""; coinValueAsString = coinValue.toString(); sb.append("coin=").append(urlEncode(coinValueAsString)).append(""); - Object depositDescValue = getDepositDesc(); - String depositDescValueAsString = ""; - depositDescValueAsString = depositDescValue.toString(); - sb.append("depositDesc=").append(urlEncode(depositDescValueAsString)).append(""); - Object depositEnableValue = getDepositEnable(); - String depositEnableValueAsString = ""; - depositEnableValueAsString = depositEnableValue.toString(); - sb.append("depositEnable=").append(urlEncode(depositEnableValueAsString)).append(""); + Object withdrawIntegerMultipleValue = getWithdrawIntegerMultiple(); + String withdrawIntegerMultipleValueAsString = ""; + withdrawIntegerMultipleValueAsString = withdrawIntegerMultipleValue.toString(); + sb.append("withdrawIntegerMultiple=") + .append(urlEncode(withdrawIntegerMultipleValueAsString)) + .append(""); Object isDefaultValue = getIsDefault(); String isDefaultValueAsString = ""; isDefaultValueAsString = isDefaultValue.toString(); sb.append("isDefault=").append(urlEncode(isDefaultValueAsString)).append(""); - Object memoRegexValue = getMemoRegex(); - String memoRegexValueAsString = ""; - memoRegexValueAsString = memoRegexValue.toString(); - sb.append("memoRegex=").append(urlEncode(memoRegexValueAsString)).append(""); - Object minConfirmValue = getMinConfirm(); - String minConfirmValueAsString = ""; - minConfirmValueAsString = minConfirmValue.toString(); - sb.append("minConfirm=").append(urlEncode(minConfirmValueAsString)).append(""); - Object nameValue = getName(); - String nameValueAsString = ""; - nameValueAsString = nameValue.toString(); - sb.append("name=").append(urlEncode(nameValueAsString)).append(""); - Object networkValue = getNetwork(); - String networkValueAsString = ""; - networkValueAsString = networkValue.toString(); - sb.append("network=").append(urlEncode(networkValueAsString)).append(""); - Object specialTipsValue = getSpecialTips(); - String specialTipsValueAsString = ""; - specialTipsValueAsString = specialTipsValue.toString(); - sb.append("specialTips=").append(urlEncode(specialTipsValueAsString)).append(""); - Object unLockConfirmValue = getUnLockConfirm(); - String unLockConfirmValueAsString = ""; - unLockConfirmValueAsString = unLockConfirmValue.toString(); - sb.append("unLockConfirm=").append(urlEncode(unLockConfirmValueAsString)).append(""); - Object withdrawDescValue = getWithdrawDesc(); - String withdrawDescValueAsString = ""; - withdrawDescValueAsString = withdrawDescValue.toString(); - sb.append("withdrawDesc=").append(urlEncode(withdrawDescValueAsString)).append(""); + Object depositEnableValue = getDepositEnable(); + String depositEnableValueAsString = ""; + depositEnableValueAsString = depositEnableValue.toString(); + sb.append("depositEnable=").append(urlEncode(depositEnableValueAsString)).append(""); Object withdrawEnableValue = getWithdrawEnable(); String withdrawEnableValueAsString = ""; withdrawEnableValueAsString = withdrawEnableValue.toString(); sb.append("withdrawEnable=").append(urlEncode(withdrawEnableValueAsString)).append(""); + Object depositDescValue = getDepositDesc(); + String depositDescValueAsString = ""; + depositDescValueAsString = depositDescValue.toString(); + sb.append("depositDesc=").append(urlEncode(depositDescValueAsString)).append(""); + Object withdrawDescValue = getWithdrawDesc(); + String withdrawDescValueAsString = ""; + withdrawDescValueAsString = withdrawDescValue.toString(); + sb.append("withdrawDesc=").append(urlEncode(withdrawDescValueAsString)).append(""); + Object specialTipsValue = getSpecialTips(); + String specialTipsValueAsString = ""; + specialTipsValueAsString = specialTipsValue.toString(); + sb.append("specialTips=").append(urlEncode(specialTipsValueAsString)).append(""); + Object specialWithdrawTipsValue = getSpecialWithdrawTips(); + String specialWithdrawTipsValueAsString = ""; + specialWithdrawTipsValueAsString = specialWithdrawTipsValue.toString(); + sb.append("specialWithdrawTips=") + .append(urlEncode(specialWithdrawTipsValueAsString)) + .append(""); + Object nameValue = getName(); + String nameValueAsString = ""; + nameValueAsString = nameValue.toString(); + sb.append("name=").append(urlEncode(nameValueAsString)).append(""); + Object resetAddressStatusValue = getResetAddressStatus(); + String resetAddressStatusValueAsString = ""; + resetAddressStatusValueAsString = resetAddressStatusValue.toString(); + sb.append("resetAddressStatus=") + .append(urlEncode(resetAddressStatusValueAsString)) + .append(""); + Object addressRegexValue = getAddressRegex(); + String addressRegexValueAsString = ""; + addressRegexValueAsString = addressRegexValue.toString(); + sb.append("addressRegex=").append(urlEncode(addressRegexValueAsString)).append(""); + Object memoRegexValue = getMemoRegex(); + String memoRegexValueAsString = ""; + memoRegexValueAsString = memoRegexValue.toString(); + sb.append("memoRegex=").append(urlEncode(memoRegexValueAsString)).append(""); Object withdrawFeeValue = getWithdrawFee(); String withdrawFeeValueAsString = ""; withdrawFeeValueAsString = withdrawFeeValue.toString(); sb.append("withdrawFee=").append(urlEncode(withdrawFeeValueAsString)).append(""); - Object withdrawIntegerMultipleValue = getWithdrawIntegerMultiple(); - String withdrawIntegerMultipleValueAsString = ""; - withdrawIntegerMultipleValueAsString = withdrawIntegerMultipleValue.toString(); - sb.append("withdrawIntegerMultiple=") - .append(urlEncode(withdrawIntegerMultipleValueAsString)) - .append(""); - Object withdrawMaxValue = getWithdrawMax(); - String withdrawMaxValueAsString = ""; - withdrawMaxValueAsString = withdrawMaxValue.toString(); - sb.append("withdrawMax=").append(urlEncode(withdrawMaxValueAsString)).append(""); Object withdrawMinValue = getWithdrawMin(); String withdrawMinValueAsString = ""; withdrawMinValueAsString = withdrawMinValue.toString(); sb.append("withdrawMin=").append(urlEncode(withdrawMinValueAsString)).append(""); + Object withdrawMaxValue = getWithdrawMax(); + String withdrawMaxValueAsString = ""; + withdrawMaxValueAsString = withdrawMaxValue.toString(); + sb.append("withdrawMax=").append(urlEncode(withdrawMaxValueAsString)).append(""); Object withdrawInternalMinValue = getWithdrawInternalMin(); String withdrawInternalMinValueAsString = ""; withdrawInternalMinValueAsString = withdrawInternalMinValue.toString(); sb.append("withdrawInternalMin=") .append(urlEncode(withdrawInternalMinValueAsString)) .append(""); + Object depositDustValue = getDepositDust(); + String depositDustValueAsString = ""; + depositDustValueAsString = depositDustValue.toString(); + sb.append("depositDust=").append(urlEncode(depositDustValueAsString)).append(""); + Object minConfirmValue = getMinConfirm(); + String minConfirmValueAsString = ""; + minConfirmValueAsString = minConfirmValue.toString(); + sb.append("minConfirm=").append(urlEncode(minConfirmValueAsString)).append(""); + Object unLockConfirmValue = getUnLockConfirm(); + String unLockConfirmValueAsString = ""; + unLockConfirmValueAsString = unLockConfirmValue.toString(); + sb.append("unLockConfirm=").append(urlEncode(unLockConfirmValueAsString)).append(""); Object sameAddressValue = getSameAddress(); String sameAddressValueAsString = ""; sameAddressValueAsString = sameAddressValue.toString(); sb.append("sameAddress=").append(urlEncode(sameAddressValueAsString)).append(""); + Object withdrawTagValue = getWithdrawTag(); + String withdrawTagValueAsString = ""; + withdrawTagValueAsString = withdrawTagValue.toString(); + sb.append("withdrawTag=").append(urlEncode(withdrawTagValueAsString)).append(""); Object estimatedArrivalTimeValue = getEstimatedArrivalTime(); String estimatedArrivalTimeValueAsString = ""; estimatedArrivalTimeValueAsString = estimatedArrivalTimeValue.toString(); @@ -1268,59 +1060,10 @@ public String toUrlQueryString() { String contractAddressValueAsString = ""; contractAddressValueAsString = contractAddressValue.toString(); sb.append("contractAddress=").append(urlEncode(contractAddressValueAsString)).append(""); - Object depositAllEnableValue = getDepositAllEnable(); - String depositAllEnableValueAsString = ""; - depositAllEnableValueAsString = depositAllEnableValue.toString(); - sb.append("depositAllEnable=").append(urlEncode(depositAllEnableValueAsString)).append(""); - Object withdrawAllEnableValue = getWithdrawAllEnable(); - String withdrawAllEnableValueAsString = ""; - withdrawAllEnableValueAsString = withdrawAllEnableValue.toString(); - sb.append("withdrawAllEnable=") - .append(urlEncode(withdrawAllEnableValueAsString)) - .append(""); - Object freeValue = getFree(); - String freeValueAsString = ""; - freeValueAsString = freeValue.toString(); - sb.append("free=").append(urlEncode(freeValueAsString)).append(""); - Object lockedValue = getLocked(); - String lockedValueAsString = ""; - lockedValueAsString = lockedValue.toString(); - sb.append("locked=").append(urlEncode(lockedValueAsString)).append(""); - Object freezeValue = getFreeze(); - String freezeValueAsString = ""; - freezeValueAsString = freezeValue.toString(); - sb.append("freeze=").append(urlEncode(freezeValueAsString)).append(""); - Object withdrawingValue = getWithdrawing(); - String withdrawingValueAsString = ""; - withdrawingValueAsString = withdrawingValue.toString(); - sb.append("withdrawing=").append(urlEncode(withdrawingValueAsString)).append(""); - Object ipoingValue = getIpoing(); - String ipoingValueAsString = ""; - ipoingValueAsString = ipoingValue.toString(); - sb.append("ipoing=").append(urlEncode(ipoingValueAsString)).append(""); - Object ipoableValue = getIpoable(); - String ipoableValueAsString = ""; - ipoableValueAsString = ipoableValue.toString(); - sb.append("ipoable=").append(urlEncode(ipoableValueAsString)).append(""); - Object storageValue = getStorage(); - String storageValueAsString = ""; - storageValueAsString = storageValue.toString(); - sb.append("storage=").append(urlEncode(storageValueAsString)).append(""); - Object isLegalMoneyValue = getIsLegalMoney(); - String isLegalMoneyValueAsString = ""; - isLegalMoneyValueAsString = isLegalMoneyValue.toString(); - sb.append("isLegalMoney=").append(urlEncode(isLegalMoneyValueAsString)).append(""); - Object tradingValue = getTrading(); - String tradingValueAsString = ""; - tradingValueAsString = tradingValue.toString(); - sb.append("trading=").append(urlEncode(tradingValueAsString)).append(""); - Object networkListValue = getNetworkList(); - String networkListValueAsString = ""; - networkListValueAsString = - (String) - ((Collection) networkListValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("networkList=").append(urlEncode(networkListValueAsString)).append(""); + Object denominationValue = getDenomination(); + String denominationValueAsString = ""; + denominationValueAsString = denominationValue.toString(); + sb.append("denomination=").append(urlEncode(denominationValueAsString)).append(""); return sb.toString(); } @@ -1349,41 +1092,34 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("addressRegex"); + openapiFields.add("network"); openapiFields.add("coin"); - openapiFields.add("depositDesc"); - openapiFields.add("depositEnable"); + openapiFields.add("withdrawIntegerMultiple"); openapiFields.add("isDefault"); - openapiFields.add("memoRegex"); - openapiFields.add("minConfirm"); - openapiFields.add("name"); - openapiFields.add("network"); - openapiFields.add("specialTips"); - openapiFields.add("unLockConfirm"); - openapiFields.add("withdrawDesc"); + openapiFields.add("depositEnable"); openapiFields.add("withdrawEnable"); + openapiFields.add("depositDesc"); + openapiFields.add("withdrawDesc"); + openapiFields.add("specialTips"); + openapiFields.add("specialWithdrawTips"); + openapiFields.add("name"); + openapiFields.add("resetAddressStatus"); + openapiFields.add("addressRegex"); + openapiFields.add("memoRegex"); openapiFields.add("withdrawFee"); - openapiFields.add("withdrawIntegerMultiple"); - openapiFields.add("withdrawMax"); openapiFields.add("withdrawMin"); + openapiFields.add("withdrawMax"); openapiFields.add("withdrawInternalMin"); + openapiFields.add("depositDust"); + openapiFields.add("minConfirm"); + openapiFields.add("unLockConfirm"); openapiFields.add("sameAddress"); + openapiFields.add("withdrawTag"); openapiFields.add("estimatedArrivalTime"); openapiFields.add("busy"); openapiFields.add("contractAddressUrl"); openapiFields.add("contractAddress"); - openapiFields.add("depositAllEnable"); - openapiFields.add("withdrawAllEnable"); - openapiFields.add("free"); - openapiFields.add("locked"); - openapiFields.add("freeze"); - openapiFields.add("withdrawing"); - openapiFields.add("ipoing"); - openapiFields.add("ipoable"); - openapiFields.add("storage"); - openapiFields.add("isLegalMoney"); - openapiFields.add("trading"); - openapiFields.add("networkList"); + openapiFields.add("denomination"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1411,13 +1147,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("addressRegex") != null && !jsonObj.get("addressRegex").isJsonNull()) - && !jsonObj.get("addressRegex").isJsonPrimitive()) { + if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) + && !jsonObj.get("network").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `addressRegex` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("addressRegex").toString())); + "Expected the field `network` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("network").toString())); } if ((jsonObj.get("coin") != null && !jsonObj.get("coin").isJsonNull()) && !jsonObj.get("coin").isJsonPrimitive()) { @@ -1427,6 +1163,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("coin").toString())); } + if ((jsonObj.get("withdrawIntegerMultiple") != null + && !jsonObj.get("withdrawIntegerMultiple").isJsonNull()) + && !jsonObj.get("withdrawIntegerMultiple").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `withdrawIntegerMultiple` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("withdrawIntegerMultiple").toString())); + } if ((jsonObj.get("depositDesc") != null && !jsonObj.get("depositDesc").isJsonNull()) && !jsonObj.get("depositDesc").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1435,13 +1180,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("depositDesc").toString())); } - if ((jsonObj.get("memoRegex") != null && !jsonObj.get("memoRegex").isJsonNull()) - && !jsonObj.get("memoRegex").isJsonPrimitive()) { + if ((jsonObj.get("withdrawDesc") != null && !jsonObj.get("withdrawDesc").isJsonNull()) + && !jsonObj.get("withdrawDesc").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `memoRegex` to be a primitive type in the JSON" + "Expected the field `withdrawDesc` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("memoRegex").toString())); + jsonObj.get("withdrawDesc").toString())); + } + if ((jsonObj.get("specialTips") != null && !jsonObj.get("specialTips").isJsonNull()) + && !jsonObj.get("specialTips").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `specialTips` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("specialTips").toString())); + } + if ((jsonObj.get("specialWithdrawTips") != null + && !jsonObj.get("specialWithdrawTips").isJsonNull()) + && !jsonObj.get("specialWithdrawTips").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `specialWithdrawTips` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("specialWithdrawTips").toString())); } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { @@ -1451,29 +1213,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("name").toString())); } - if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) - && !jsonObj.get("network").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `network` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("network").toString())); - } - if ((jsonObj.get("specialTips") != null && !jsonObj.get("specialTips").isJsonNull()) - && !jsonObj.get("specialTips").isJsonPrimitive()) { + if ((jsonObj.get("addressRegex") != null && !jsonObj.get("addressRegex").isJsonNull()) + && !jsonObj.get("addressRegex").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `specialTips` to be a primitive type in the JSON" + "Expected the field `addressRegex` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("specialTips").toString())); + jsonObj.get("addressRegex").toString())); } - if ((jsonObj.get("withdrawDesc") != null && !jsonObj.get("withdrawDesc").isJsonNull()) - && !jsonObj.get("withdrawDesc").isJsonPrimitive()) { + if ((jsonObj.get("memoRegex") != null && !jsonObj.get("memoRegex").isJsonNull()) + && !jsonObj.get("memoRegex").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `withdrawDesc` to be a primitive type in the JSON" + "Expected the field `memoRegex` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("withdrawDesc").toString())); + jsonObj.get("memoRegex").toString())); } if ((jsonObj.get("withdrawFee") != null && !jsonObj.get("withdrawFee").isJsonNull()) && !jsonObj.get("withdrawFee").isJsonPrimitive()) { @@ -1483,14 +1237,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("withdrawFee").toString())); } - if ((jsonObj.get("withdrawIntegerMultiple") != null - && !jsonObj.get("withdrawIntegerMultiple").isJsonNull()) - && !jsonObj.get("withdrawIntegerMultiple").isJsonPrimitive()) { + if ((jsonObj.get("withdrawMin") != null && !jsonObj.get("withdrawMin").isJsonNull()) + && !jsonObj.get("withdrawMin").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `withdrawIntegerMultiple` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("withdrawIntegerMultiple").toString())); + "Expected the field `withdrawMin` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("withdrawMin").toString())); } if ((jsonObj.get("withdrawMax") != null && !jsonObj.get("withdrawMax").isJsonNull()) && !jsonObj.get("withdrawMax").isJsonPrimitive()) { @@ -1500,14 +1253,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("withdrawMax").toString())); } - if ((jsonObj.get("withdrawMin") != null && !jsonObj.get("withdrawMin").isJsonNull()) - && !jsonObj.get("withdrawMin").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawMin` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("withdrawMin").toString())); - } if ((jsonObj.get("withdrawInternalMin") != null && !jsonObj.get("withdrawInternalMin").isJsonNull()) && !jsonObj.get("withdrawInternalMin").isJsonPrimitive()) { @@ -1517,6 +1262,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("withdrawInternalMin").toString())); } + if ((jsonObj.get("depositDust") != null && !jsonObj.get("depositDust").isJsonNull()) + && !jsonObj.get("depositDust").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `depositDust` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("depositDust").toString())); + } if ((jsonObj.get("contractAddressUrl") != null && !jsonObj.get("contractAddressUrl").isJsonNull()) && !jsonObj.get("contractAddressUrl").isJsonPrimitive()) { @@ -1534,82 +1287,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("contractAddress").toString())); } - if ((jsonObj.get("free") != null && !jsonObj.get("free").isJsonNull()) - && !jsonObj.get("free").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `free` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("free").toString())); - } - if ((jsonObj.get("locked") != null && !jsonObj.get("locked").isJsonNull()) - && !jsonObj.get("locked").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `locked` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("locked").toString())); - } - if ((jsonObj.get("freeze") != null && !jsonObj.get("freeze").isJsonNull()) - && !jsonObj.get("freeze").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `freeze` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("freeze").toString())); - } - if ((jsonObj.get("withdrawing") != null && !jsonObj.get("withdrawing").isJsonNull()) - && !jsonObj.get("withdrawing").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawing` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("withdrawing").toString())); - } - if ((jsonObj.get("ipoing") != null && !jsonObj.get("ipoing").isJsonNull()) - && !jsonObj.get("ipoing").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ipoing` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("ipoing").toString())); - } - if ((jsonObj.get("ipoable") != null && !jsonObj.get("ipoable").isJsonNull()) - && !jsonObj.get("ipoable").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ipoable` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("ipoable").toString())); - } - if ((jsonObj.get("storage") != null && !jsonObj.get("storage").isJsonNull()) - && !jsonObj.get("storage").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `storage` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("storage").toString())); - } - if (jsonObj.get("networkList") != null && !jsonObj.get("networkList").isJsonNull()) { - JsonArray jsonArraynetworkList = jsonObj.getAsJsonArray("networkList"); - if (jsonArraynetworkList != null) { - // ensure the json data is an array - if (!jsonObj.get("networkList").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `networkList` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("networkList").toString())); - } - - // validate the optional field `networkList` (array) - for (int i = 0; i < jsonArraynetworkList.size(); i++) { - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .validateJsonElement(jsonArraynetworkList.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.java deleted file mode 100644 index 1da26c927..000000000 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.java +++ /dev/null @@ -1,1355 +0,0 @@ -/* - * Binance Wallet REST API - * OpenAPI Specification for the Binance Wallet REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.wallet.rest.model; - -import com.binance.connector.client.wallet.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner { - public static final String SERIALIZED_NAME_NETWORK = "network"; - - @SerializedName(SERIALIZED_NAME_NETWORK) - @jakarta.annotation.Nullable - private String network; - - public static final String SERIALIZED_NAME_COIN = "coin"; - - @SerializedName(SERIALIZED_NAME_COIN) - @jakarta.annotation.Nullable - private String coin; - - public static final String SERIALIZED_NAME_WITHDRAW_INTEGER_MULTIPLE = - "withdrawIntegerMultiple"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_INTEGER_MULTIPLE) - @jakarta.annotation.Nullable - private String withdrawIntegerMultiple; - - public static final String SERIALIZED_NAME_IS_DEFAULT = "isDefault"; - - @SerializedName(SERIALIZED_NAME_IS_DEFAULT) - @jakarta.annotation.Nullable - private Boolean isDefault; - - public static final String SERIALIZED_NAME_DEPOSIT_ENABLE = "depositEnable"; - - @SerializedName(SERIALIZED_NAME_DEPOSIT_ENABLE) - @jakarta.annotation.Nullable - private Boolean depositEnable; - - public static final String SERIALIZED_NAME_WITHDRAW_ENABLE = "withdrawEnable"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_ENABLE) - @jakarta.annotation.Nullable - private Boolean withdrawEnable; - - public static final String SERIALIZED_NAME_DEPOSIT_DESC = "depositDesc"; - - @SerializedName(SERIALIZED_NAME_DEPOSIT_DESC) - @jakarta.annotation.Nullable - private String depositDesc; - - public static final String SERIALIZED_NAME_WITHDRAW_DESC = "withdrawDesc"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_DESC) - @jakarta.annotation.Nullable - private String withdrawDesc; - - public static final String SERIALIZED_NAME_SPECIAL_TIPS = "specialTips"; - - @SerializedName(SERIALIZED_NAME_SPECIAL_TIPS) - @jakarta.annotation.Nullable - private String specialTips; - - public static final String SERIALIZED_NAME_SPECIAL_WITHDRAW_TIPS = "specialWithdrawTips"; - - @SerializedName(SERIALIZED_NAME_SPECIAL_WITHDRAW_TIPS) - @jakarta.annotation.Nullable - private String specialWithdrawTips; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - @jakarta.annotation.Nullable - private String name; - - public static final String SERIALIZED_NAME_RESET_ADDRESS_STATUS = "resetAddressStatus"; - - @SerializedName(SERIALIZED_NAME_RESET_ADDRESS_STATUS) - @jakarta.annotation.Nullable - private Boolean resetAddressStatus; - - public static final String SERIALIZED_NAME_ADDRESS_REGEX = "addressRegex"; - - @SerializedName(SERIALIZED_NAME_ADDRESS_REGEX) - @jakarta.annotation.Nullable - private String addressRegex; - - public static final String SERIALIZED_NAME_MEMO_REGEX = "memoRegex"; - - @SerializedName(SERIALIZED_NAME_MEMO_REGEX) - @jakarta.annotation.Nullable - private String memoRegex; - - public static final String SERIALIZED_NAME_WITHDRAW_FEE = "withdrawFee"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_FEE) - @jakarta.annotation.Nullable - private String withdrawFee; - - public static final String SERIALIZED_NAME_WITHDRAW_MIN = "withdrawMin"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_MIN) - @jakarta.annotation.Nullable - private String withdrawMin; - - public static final String SERIALIZED_NAME_WITHDRAW_MAX = "withdrawMax"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_MAX) - @jakarta.annotation.Nullable - private String withdrawMax; - - public static final String SERIALIZED_NAME_WITHDRAW_INTERNAL_MIN = "withdrawInternalMin"; - - @SerializedName(SERIALIZED_NAME_WITHDRAW_INTERNAL_MIN) - @jakarta.annotation.Nullable - private String withdrawInternalMin; - - public static final String SERIALIZED_NAME_DEPOSIT_DUST = "depositDust"; - - @SerializedName(SERIALIZED_NAME_DEPOSIT_DUST) - @jakarta.annotation.Nullable - private String depositDust; - - public static final String SERIALIZED_NAME_MIN_CONFIRM = "minConfirm"; - - @SerializedName(SERIALIZED_NAME_MIN_CONFIRM) - @jakarta.annotation.Nullable - private Long minConfirm; - - public static final String SERIALIZED_NAME_UN_LOCK_CONFIRM = "unLockConfirm"; - - @SerializedName(SERIALIZED_NAME_UN_LOCK_CONFIRM) - @jakarta.annotation.Nullable - private Long unLockConfirm; - - public static final String SERIALIZED_NAME_SAME_ADDRESS = "sameAddress"; - - @SerializedName(SERIALIZED_NAME_SAME_ADDRESS) - @jakarta.annotation.Nullable - private Boolean sameAddress; - - public static final String SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; - - @SerializedName(SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME) - @jakarta.annotation.Nullable - private Long estimatedArrivalTime; - - public static final String SERIALIZED_NAME_BUSY = "busy"; - - @SerializedName(SERIALIZED_NAME_BUSY) - @jakarta.annotation.Nullable - private Boolean busy; - - public static final String SERIALIZED_NAME_CONTRACT_ADDRESS_URL = "contractAddressUrl"; - - @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS_URL) - @jakarta.annotation.Nullable - private String contractAddressUrl; - - public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; - - @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) - @jakarta.annotation.Nullable - private String contractAddress; - - public static final String SERIALIZED_NAME_DENOMINATION = "denomination"; - - @SerializedName(SERIALIZED_NAME_DENOMINATION) - @jakarta.annotation.Nullable - private Long denomination; - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner() {} - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner network( - @jakarta.annotation.Nullable String network) { - this.network = network; - return this; - } - - /** - * Get network - * - * @return network - */ - @jakarta.annotation.Nullable - public String getNetwork() { - return network; - } - - public void setNetwork(@jakarta.annotation.Nullable String network) { - this.network = network; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner coin( - @jakarta.annotation.Nullable String coin) { - this.coin = coin; - return this; - } - - /** - * Get coin - * - * @return coin - */ - @jakarta.annotation.Nullable - public String getCoin() { - return coin; - } - - public void setCoin(@jakarta.annotation.Nullable String coin) { - this.coin = coin; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner withdrawIntegerMultiple( - @jakarta.annotation.Nullable String withdrawIntegerMultiple) { - this.withdrawIntegerMultiple = withdrawIntegerMultiple; - return this; - } - - /** - * Get withdrawIntegerMultiple - * - * @return withdrawIntegerMultiple - */ - @jakarta.annotation.Nullable - public String getWithdrawIntegerMultiple() { - return withdrawIntegerMultiple; - } - - public void setWithdrawIntegerMultiple( - @jakarta.annotation.Nullable String withdrawIntegerMultiple) { - this.withdrawIntegerMultiple = withdrawIntegerMultiple; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner isDefault( - @jakarta.annotation.Nullable Boolean isDefault) { - this.isDefault = isDefault; - return this; - } - - /** - * Get isDefault - * - * @return isDefault - */ - @jakarta.annotation.Nullable - public Boolean getIsDefault() { - return isDefault; - } - - public void setIsDefault(@jakarta.annotation.Nullable Boolean isDefault) { - this.isDefault = isDefault; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner depositEnable( - @jakarta.annotation.Nullable Boolean depositEnable) { - this.depositEnable = depositEnable; - return this; - } - - /** - * Get depositEnable - * - * @return depositEnable - */ - @jakarta.annotation.Nullable - public Boolean getDepositEnable() { - return depositEnable; - } - - public void setDepositEnable(@jakarta.annotation.Nullable Boolean depositEnable) { - this.depositEnable = depositEnable; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner withdrawEnable( - @jakarta.annotation.Nullable Boolean withdrawEnable) { - this.withdrawEnable = withdrawEnable; - return this; - } - - /** - * Get withdrawEnable - * - * @return withdrawEnable - */ - @jakarta.annotation.Nullable - public Boolean getWithdrawEnable() { - return withdrawEnable; - } - - public void setWithdrawEnable(@jakarta.annotation.Nullable Boolean withdrawEnable) { - this.withdrawEnable = withdrawEnable; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner depositDesc( - @jakarta.annotation.Nullable String depositDesc) { - this.depositDesc = depositDesc; - return this; - } - - /** - * Get depositDesc - * - * @return depositDesc - */ - @jakarta.annotation.Nullable - public String getDepositDesc() { - return depositDesc; - } - - public void setDepositDesc(@jakarta.annotation.Nullable String depositDesc) { - this.depositDesc = depositDesc; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner withdrawDesc( - @jakarta.annotation.Nullable String withdrawDesc) { - this.withdrawDesc = withdrawDesc; - return this; - } - - /** - * Get withdrawDesc - * - * @return withdrawDesc - */ - @jakarta.annotation.Nullable - public String getWithdrawDesc() { - return withdrawDesc; - } - - public void setWithdrawDesc(@jakarta.annotation.Nullable String withdrawDesc) { - this.withdrawDesc = withdrawDesc; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner specialTips( - @jakarta.annotation.Nullable String specialTips) { - this.specialTips = specialTips; - return this; - } - - /** - * Get specialTips - * - * @return specialTips - */ - @jakarta.annotation.Nullable - public String getSpecialTips() { - return specialTips; - } - - public void setSpecialTips(@jakarta.annotation.Nullable String specialTips) { - this.specialTips = specialTips; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner specialWithdrawTips( - @jakarta.annotation.Nullable String specialWithdrawTips) { - this.specialWithdrawTips = specialWithdrawTips; - return this; - } - - /** - * Get specialWithdrawTips - * - * @return specialWithdrawTips - */ - @jakarta.annotation.Nullable - public String getSpecialWithdrawTips() { - return specialWithdrawTips; - } - - public void setSpecialWithdrawTips(@jakarta.annotation.Nullable String specialWithdrawTips) { - this.specialWithdrawTips = specialWithdrawTips; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner name( - @jakarta.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @jakarta.annotation.Nullable - public String getName() { - return name; - } - - public void setName(@jakarta.annotation.Nullable String name) { - this.name = name; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner resetAddressStatus( - @jakarta.annotation.Nullable Boolean resetAddressStatus) { - this.resetAddressStatus = resetAddressStatus; - return this; - } - - /** - * Get resetAddressStatus - * - * @return resetAddressStatus - */ - @jakarta.annotation.Nullable - public Boolean getResetAddressStatus() { - return resetAddressStatus; - } - - public void setResetAddressStatus(@jakarta.annotation.Nullable Boolean resetAddressStatus) { - this.resetAddressStatus = resetAddressStatus; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner addressRegex( - @jakarta.annotation.Nullable String addressRegex) { - this.addressRegex = addressRegex; - return this; - } - - /** - * Get addressRegex - * - * @return addressRegex - */ - @jakarta.annotation.Nullable - public String getAddressRegex() { - return addressRegex; - } - - public void setAddressRegex(@jakarta.annotation.Nullable String addressRegex) { - this.addressRegex = addressRegex; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner memoRegex( - @jakarta.annotation.Nullable String memoRegex) { - this.memoRegex = memoRegex; - return this; - } - - /** - * Get memoRegex - * - * @return memoRegex - */ - @jakarta.annotation.Nullable - public String getMemoRegex() { - return memoRegex; - } - - public void setMemoRegex(@jakarta.annotation.Nullable String memoRegex) { - this.memoRegex = memoRegex; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner withdrawFee( - @jakarta.annotation.Nullable String withdrawFee) { - this.withdrawFee = withdrawFee; - return this; - } - - /** - * Get withdrawFee - * - * @return withdrawFee - */ - @jakarta.annotation.Nullable - public String getWithdrawFee() { - return withdrawFee; - } - - public void setWithdrawFee(@jakarta.annotation.Nullable String withdrawFee) { - this.withdrawFee = withdrawFee; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner withdrawMin( - @jakarta.annotation.Nullable String withdrawMin) { - this.withdrawMin = withdrawMin; - return this; - } - - /** - * Get withdrawMin - * - * @return withdrawMin - */ - @jakarta.annotation.Nullable - public String getWithdrawMin() { - return withdrawMin; - } - - public void setWithdrawMin(@jakarta.annotation.Nullable String withdrawMin) { - this.withdrawMin = withdrawMin; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner withdrawMax( - @jakarta.annotation.Nullable String withdrawMax) { - this.withdrawMax = withdrawMax; - return this; - } - - /** - * Get withdrawMax - * - * @return withdrawMax - */ - @jakarta.annotation.Nullable - public String getWithdrawMax() { - return withdrawMax; - } - - public void setWithdrawMax(@jakarta.annotation.Nullable String withdrawMax) { - this.withdrawMax = withdrawMax; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner withdrawInternalMin( - @jakarta.annotation.Nullable String withdrawInternalMin) { - this.withdrawInternalMin = withdrawInternalMin; - return this; - } - - /** - * Get withdrawInternalMin - * - * @return withdrawInternalMin - */ - @jakarta.annotation.Nullable - public String getWithdrawInternalMin() { - return withdrawInternalMin; - } - - public void setWithdrawInternalMin(@jakarta.annotation.Nullable String withdrawInternalMin) { - this.withdrawInternalMin = withdrawInternalMin; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner depositDust( - @jakarta.annotation.Nullable String depositDust) { - this.depositDust = depositDust; - return this; - } - - /** - * Get depositDust - * - * @return depositDust - */ - @jakarta.annotation.Nullable - public String getDepositDust() { - return depositDust; - } - - public void setDepositDust(@jakarta.annotation.Nullable String depositDust) { - this.depositDust = depositDust; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner minConfirm( - @jakarta.annotation.Nullable Long minConfirm) { - this.minConfirm = minConfirm; - return this; - } - - /** - * Get minConfirm - * - * @return minConfirm - */ - @jakarta.annotation.Nullable - public Long getMinConfirm() { - return minConfirm; - } - - public void setMinConfirm(@jakarta.annotation.Nullable Long minConfirm) { - this.minConfirm = minConfirm; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner unLockConfirm( - @jakarta.annotation.Nullable Long unLockConfirm) { - this.unLockConfirm = unLockConfirm; - return this; - } - - /** - * Get unLockConfirm - * - * @return unLockConfirm - */ - @jakarta.annotation.Nullable - public Long getUnLockConfirm() { - return unLockConfirm; - } - - public void setUnLockConfirm(@jakarta.annotation.Nullable Long unLockConfirm) { - this.unLockConfirm = unLockConfirm; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner sameAddress( - @jakarta.annotation.Nullable Boolean sameAddress) { - this.sameAddress = sameAddress; - return this; - } - - /** - * Get sameAddress - * - * @return sameAddress - */ - @jakarta.annotation.Nullable - public Boolean getSameAddress() { - return sameAddress; - } - - public void setSameAddress(@jakarta.annotation.Nullable Boolean sameAddress) { - this.sameAddress = sameAddress; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner estimatedArrivalTime( - @jakarta.annotation.Nullable Long estimatedArrivalTime) { - this.estimatedArrivalTime = estimatedArrivalTime; - return this; - } - - /** - * Get estimatedArrivalTime - * - * @return estimatedArrivalTime - */ - @jakarta.annotation.Nullable - public Long getEstimatedArrivalTime() { - return estimatedArrivalTime; - } - - public void setEstimatedArrivalTime(@jakarta.annotation.Nullable Long estimatedArrivalTime) { - this.estimatedArrivalTime = estimatedArrivalTime; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner busy( - @jakarta.annotation.Nullable Boolean busy) { - this.busy = busy; - return this; - } - - /** - * Get busy - * - * @return busy - */ - @jakarta.annotation.Nullable - public Boolean getBusy() { - return busy; - } - - public void setBusy(@jakarta.annotation.Nullable Boolean busy) { - this.busy = busy; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner contractAddressUrl( - @jakarta.annotation.Nullable String contractAddressUrl) { - this.contractAddressUrl = contractAddressUrl; - return this; - } - - /** - * Get contractAddressUrl - * - * @return contractAddressUrl - */ - @jakarta.annotation.Nullable - public String getContractAddressUrl() { - return contractAddressUrl; - } - - public void setContractAddressUrl(@jakarta.annotation.Nullable String contractAddressUrl) { - this.contractAddressUrl = contractAddressUrl; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner contractAddress( - @jakarta.annotation.Nullable String contractAddress) { - this.contractAddress = contractAddress; - return this; - } - - /** - * Get contractAddress - * - * @return contractAddress - */ - @jakarta.annotation.Nullable - public String getContractAddress() { - return contractAddress; - } - - public void setContractAddress(@jakarta.annotation.Nullable String contractAddress) { - this.contractAddress = contractAddress; - } - - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner denomination( - @jakarta.annotation.Nullable Long denomination) { - this.denomination = denomination; - return this; - } - - /** - * Get denomination - * - * @return denomination - */ - @jakarta.annotation.Nullable - public Long getDenomination() { - return denomination; - } - - public void setDenomination(@jakarta.annotation.Nullable Long denomination) { - this.denomination = denomination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner = - (AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner) o; - return Objects.equals( - this.network, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner.network) - && Objects.equals( - this.coin, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner.coin) - && Objects.equals( - this.withdrawIntegerMultiple, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .withdrawIntegerMultiple) - && Objects.equals( - this.isDefault, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner.isDefault) - && Objects.equals( - this.depositEnable, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .depositEnable) - && Objects.equals( - this.withdrawEnable, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .withdrawEnable) - && Objects.equals( - this.depositDesc, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .depositDesc) - && Objects.equals( - this.withdrawDesc, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .withdrawDesc) - && Objects.equals( - this.specialTips, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .specialTips) - && Objects.equals( - this.specialWithdrawTips, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .specialWithdrawTips) - && Objects.equals( - this.name, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner.name) - && Objects.equals( - this.resetAddressStatus, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .resetAddressStatus) - && Objects.equals( - this.addressRegex, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .addressRegex) - && Objects.equals( - this.memoRegex, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner.memoRegex) - && Objects.equals( - this.withdrawFee, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .withdrawFee) - && Objects.equals( - this.withdrawMin, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .withdrawMin) - && Objects.equals( - this.withdrawMax, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .withdrawMax) - && Objects.equals( - this.withdrawInternalMin, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .withdrawInternalMin) - && Objects.equals( - this.depositDust, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .depositDust) - && Objects.equals( - this.minConfirm, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner.minConfirm) - && Objects.equals( - this.unLockConfirm, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .unLockConfirm) - && Objects.equals( - this.sameAddress, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .sameAddress) - && Objects.equals( - this.estimatedArrivalTime, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .estimatedArrivalTime) - && Objects.equals( - this.busy, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner.busy) - && Objects.equals( - this.contractAddressUrl, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .contractAddressUrl) - && Objects.equals( - this.contractAddress, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .contractAddress) - && Objects.equals( - this.denomination, - allCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .denomination); - } - - @Override - public int hashCode() { - return Objects.hash( - network, - coin, - withdrawIntegerMultiple, - isDefault, - depositEnable, - withdrawEnable, - depositDesc, - withdrawDesc, - specialTips, - specialWithdrawTips, - name, - resetAddressStatus, - addressRegex, - memoRegex, - withdrawFee, - withdrawMin, - withdrawMax, - withdrawInternalMin, - depositDust, - minConfirm, - unLockConfirm, - sameAddress, - estimatedArrivalTime, - busy, - contractAddressUrl, - contractAddress, - denomination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner {\n"); - sb.append(" network: ").append(toIndentedString(network)).append("\n"); - sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); - sb.append(" withdrawIntegerMultiple: ") - .append(toIndentedString(withdrawIntegerMultiple)) - .append("\n"); - sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); - sb.append(" depositEnable: ").append(toIndentedString(depositEnable)).append("\n"); - sb.append(" withdrawEnable: ").append(toIndentedString(withdrawEnable)).append("\n"); - sb.append(" depositDesc: ").append(toIndentedString(depositDesc)).append("\n"); - sb.append(" withdrawDesc: ").append(toIndentedString(withdrawDesc)).append("\n"); - sb.append(" specialTips: ").append(toIndentedString(specialTips)).append("\n"); - sb.append(" specialWithdrawTips: ") - .append(toIndentedString(specialWithdrawTips)) - .append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" resetAddressStatus: ") - .append(toIndentedString(resetAddressStatus)) - .append("\n"); - sb.append(" addressRegex: ").append(toIndentedString(addressRegex)).append("\n"); - sb.append(" memoRegex: ").append(toIndentedString(memoRegex)).append("\n"); - sb.append(" withdrawFee: ").append(toIndentedString(withdrawFee)).append("\n"); - sb.append(" withdrawMin: ").append(toIndentedString(withdrawMin)).append("\n"); - sb.append(" withdrawMax: ").append(toIndentedString(withdrawMax)).append("\n"); - sb.append(" withdrawInternalMin: ") - .append(toIndentedString(withdrawInternalMin)) - .append("\n"); - sb.append(" depositDust: ").append(toIndentedString(depositDust)).append("\n"); - sb.append(" minConfirm: ").append(toIndentedString(minConfirm)).append("\n"); - sb.append(" unLockConfirm: ").append(toIndentedString(unLockConfirm)).append("\n"); - sb.append(" sameAddress: ").append(toIndentedString(sameAddress)).append("\n"); - sb.append(" estimatedArrivalTime: ") - .append(toIndentedString(estimatedArrivalTime)) - .append("\n"); - sb.append(" busy: ").append(toIndentedString(busy)).append("\n"); - sb.append(" contractAddressUrl: ") - .append(toIndentedString(contractAddressUrl)) - .append("\n"); - sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); - sb.append(" denomination: ").append(toIndentedString(denomination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object networkValue = getNetwork(); - String networkValueAsString = ""; - networkValueAsString = networkValue.toString(); - sb.append("network=").append(urlEncode(networkValueAsString)).append(""); - Object coinValue = getCoin(); - String coinValueAsString = ""; - coinValueAsString = coinValue.toString(); - sb.append("coin=").append(urlEncode(coinValueAsString)).append(""); - Object withdrawIntegerMultipleValue = getWithdrawIntegerMultiple(); - String withdrawIntegerMultipleValueAsString = ""; - withdrawIntegerMultipleValueAsString = withdrawIntegerMultipleValue.toString(); - sb.append("withdrawIntegerMultiple=") - .append(urlEncode(withdrawIntegerMultipleValueAsString)) - .append(""); - Object isDefaultValue = getIsDefault(); - String isDefaultValueAsString = ""; - isDefaultValueAsString = isDefaultValue.toString(); - sb.append("isDefault=").append(urlEncode(isDefaultValueAsString)).append(""); - Object depositEnableValue = getDepositEnable(); - String depositEnableValueAsString = ""; - depositEnableValueAsString = depositEnableValue.toString(); - sb.append("depositEnable=").append(urlEncode(depositEnableValueAsString)).append(""); - Object withdrawEnableValue = getWithdrawEnable(); - String withdrawEnableValueAsString = ""; - withdrawEnableValueAsString = withdrawEnableValue.toString(); - sb.append("withdrawEnable=").append(urlEncode(withdrawEnableValueAsString)).append(""); - Object depositDescValue = getDepositDesc(); - String depositDescValueAsString = ""; - depositDescValueAsString = depositDescValue.toString(); - sb.append("depositDesc=").append(urlEncode(depositDescValueAsString)).append(""); - Object withdrawDescValue = getWithdrawDesc(); - String withdrawDescValueAsString = ""; - withdrawDescValueAsString = withdrawDescValue.toString(); - sb.append("withdrawDesc=").append(urlEncode(withdrawDescValueAsString)).append(""); - Object specialTipsValue = getSpecialTips(); - String specialTipsValueAsString = ""; - specialTipsValueAsString = specialTipsValue.toString(); - sb.append("specialTips=").append(urlEncode(specialTipsValueAsString)).append(""); - Object specialWithdrawTipsValue = getSpecialWithdrawTips(); - String specialWithdrawTipsValueAsString = ""; - specialWithdrawTipsValueAsString = specialWithdrawTipsValue.toString(); - sb.append("specialWithdrawTips=") - .append(urlEncode(specialWithdrawTipsValueAsString)) - .append(""); - Object nameValue = getName(); - String nameValueAsString = ""; - nameValueAsString = nameValue.toString(); - sb.append("name=").append(urlEncode(nameValueAsString)).append(""); - Object resetAddressStatusValue = getResetAddressStatus(); - String resetAddressStatusValueAsString = ""; - resetAddressStatusValueAsString = resetAddressStatusValue.toString(); - sb.append("resetAddressStatus=") - .append(urlEncode(resetAddressStatusValueAsString)) - .append(""); - Object addressRegexValue = getAddressRegex(); - String addressRegexValueAsString = ""; - addressRegexValueAsString = addressRegexValue.toString(); - sb.append("addressRegex=").append(urlEncode(addressRegexValueAsString)).append(""); - Object memoRegexValue = getMemoRegex(); - String memoRegexValueAsString = ""; - memoRegexValueAsString = memoRegexValue.toString(); - sb.append("memoRegex=").append(urlEncode(memoRegexValueAsString)).append(""); - Object withdrawFeeValue = getWithdrawFee(); - String withdrawFeeValueAsString = ""; - withdrawFeeValueAsString = withdrawFeeValue.toString(); - sb.append("withdrawFee=").append(urlEncode(withdrawFeeValueAsString)).append(""); - Object withdrawMinValue = getWithdrawMin(); - String withdrawMinValueAsString = ""; - withdrawMinValueAsString = withdrawMinValue.toString(); - sb.append("withdrawMin=").append(urlEncode(withdrawMinValueAsString)).append(""); - Object withdrawMaxValue = getWithdrawMax(); - String withdrawMaxValueAsString = ""; - withdrawMaxValueAsString = withdrawMaxValue.toString(); - sb.append("withdrawMax=").append(urlEncode(withdrawMaxValueAsString)).append(""); - Object withdrawInternalMinValue = getWithdrawInternalMin(); - String withdrawInternalMinValueAsString = ""; - withdrawInternalMinValueAsString = withdrawInternalMinValue.toString(); - sb.append("withdrawInternalMin=") - .append(urlEncode(withdrawInternalMinValueAsString)) - .append(""); - Object depositDustValue = getDepositDust(); - String depositDustValueAsString = ""; - depositDustValueAsString = depositDustValue.toString(); - sb.append("depositDust=").append(urlEncode(depositDustValueAsString)).append(""); - Object minConfirmValue = getMinConfirm(); - String minConfirmValueAsString = ""; - minConfirmValueAsString = minConfirmValue.toString(); - sb.append("minConfirm=").append(urlEncode(minConfirmValueAsString)).append(""); - Object unLockConfirmValue = getUnLockConfirm(); - String unLockConfirmValueAsString = ""; - unLockConfirmValueAsString = unLockConfirmValue.toString(); - sb.append("unLockConfirm=").append(urlEncode(unLockConfirmValueAsString)).append(""); - Object sameAddressValue = getSameAddress(); - String sameAddressValueAsString = ""; - sameAddressValueAsString = sameAddressValue.toString(); - sb.append("sameAddress=").append(urlEncode(sameAddressValueAsString)).append(""); - Object estimatedArrivalTimeValue = getEstimatedArrivalTime(); - String estimatedArrivalTimeValueAsString = ""; - estimatedArrivalTimeValueAsString = estimatedArrivalTimeValue.toString(); - sb.append("estimatedArrivalTime=") - .append(urlEncode(estimatedArrivalTimeValueAsString)) - .append(""); - Object busyValue = getBusy(); - String busyValueAsString = ""; - busyValueAsString = busyValue.toString(); - sb.append("busy=").append(urlEncode(busyValueAsString)).append(""); - Object contractAddressUrlValue = getContractAddressUrl(); - String contractAddressUrlValueAsString = ""; - contractAddressUrlValueAsString = contractAddressUrlValue.toString(); - sb.append("contractAddressUrl=") - .append(urlEncode(contractAddressUrlValueAsString)) - .append(""); - Object contractAddressValue = getContractAddress(); - String contractAddressValueAsString = ""; - contractAddressValueAsString = contractAddressValue.toString(); - sb.append("contractAddress=").append(urlEncode(contractAddressValueAsString)).append(""); - Object denominationValue = getDenomination(); - String denominationValueAsString = ""; - denominationValueAsString = denominationValue.toString(); - sb.append("denomination=").append(urlEncode(denominationValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("network"); - openapiFields.add("coin"); - openapiFields.add("withdrawIntegerMultiple"); - openapiFields.add("isDefault"); - openapiFields.add("depositEnable"); - openapiFields.add("withdrawEnable"); - openapiFields.add("depositDesc"); - openapiFields.add("withdrawDesc"); - openapiFields.add("specialTips"); - openapiFields.add("specialWithdrawTips"); - openapiFields.add("name"); - openapiFields.add("resetAddressStatus"); - openapiFields.add("addressRegex"); - openapiFields.add("memoRegex"); - openapiFields.add("withdrawFee"); - openapiFields.add("withdrawMin"); - openapiFields.add("withdrawMax"); - openapiFields.add("withdrawInternalMin"); - openapiFields.add("depositDust"); - openapiFields.add("minConfirm"); - openapiFields.add("unLockConfirm"); - openapiFields.add("sameAddress"); - openapiFields.add("estimatedArrivalTime"); - openapiFields.add("busy"); - openapiFields.add("contractAddressUrl"); - openapiFields.add("contractAddress"); - openapiFields.add("denomination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner" - + " is not found in the empty JSON string", - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) - && !jsonObj.get("network").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `network` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("network").toString())); - } - if ((jsonObj.get("coin") != null && !jsonObj.get("coin").isJsonNull()) - && !jsonObj.get("coin").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `coin` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("coin").toString())); - } - if ((jsonObj.get("withdrawIntegerMultiple") != null - && !jsonObj.get("withdrawIntegerMultiple").isJsonNull()) - && !jsonObj.get("withdrawIntegerMultiple").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawIntegerMultiple` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("withdrawIntegerMultiple").toString())); - } - if ((jsonObj.get("depositDesc") != null && !jsonObj.get("depositDesc").isJsonNull()) - && !jsonObj.get("depositDesc").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `depositDesc` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("depositDesc").toString())); - } - if ((jsonObj.get("withdrawDesc") != null && !jsonObj.get("withdrawDesc").isJsonNull()) - && !jsonObj.get("withdrawDesc").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawDesc` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("withdrawDesc").toString())); - } - if ((jsonObj.get("specialTips") != null && !jsonObj.get("specialTips").isJsonNull()) - && !jsonObj.get("specialTips").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `specialTips` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("specialTips").toString())); - } - if ((jsonObj.get("specialWithdrawTips") != null - && !jsonObj.get("specialWithdrawTips").isJsonNull()) - && !jsonObj.get("specialWithdrawTips").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `specialWithdrawTips` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("specialWithdrawTips").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("addressRegex") != null && !jsonObj.get("addressRegex").isJsonNull()) - && !jsonObj.get("addressRegex").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `addressRegex` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("addressRegex").toString())); - } - if ((jsonObj.get("memoRegex") != null && !jsonObj.get("memoRegex").isJsonNull()) - && !jsonObj.get("memoRegex").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `memoRegex` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("memoRegex").toString())); - } - if ((jsonObj.get("withdrawFee") != null && !jsonObj.get("withdrawFee").isJsonNull()) - && !jsonObj.get("withdrawFee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawFee` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("withdrawFee").toString())); - } - if ((jsonObj.get("withdrawMin") != null && !jsonObj.get("withdrawMin").isJsonNull()) - && !jsonObj.get("withdrawMin").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawMin` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("withdrawMin").toString())); - } - if ((jsonObj.get("withdrawMax") != null && !jsonObj.get("withdrawMax").isJsonNull()) - && !jsonObj.get("withdrawMax").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawMax` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("withdrawMax").toString())); - } - if ((jsonObj.get("withdrawInternalMin") != null - && !jsonObj.get("withdrawInternalMin").isJsonNull()) - && !jsonObj.get("withdrawInternalMin").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `withdrawInternalMin` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("withdrawInternalMin").toString())); - } - if ((jsonObj.get("depositDust") != null && !jsonObj.get("depositDust").isJsonNull()) - && !jsonObj.get("depositDust").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `depositDust` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("depositDust").toString())); - } - if ((jsonObj.get("contractAddressUrl") != null - && !jsonObj.get("contractAddressUrl").isJsonNull()) - && !jsonObj.get("contractAddressUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `contractAddressUrl` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("contractAddressUrl").toString())); - } - if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) - && !jsonObj.get("contractAddress").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `contractAddress` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("contractAddress").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.class - .isAssignableFrom(type.getRawType())) { - return null; // this class only serializes - // 'AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - .class)); - - return (TypeAdapter) - new TypeAdapter< - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner>() { - @Override - public void write( - JsonWriter out, - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner given - * an JSON string - * - * @param jsonString JSON string - * @return An instance of AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - * @throws IOException if the JSON string is invalid with respect to - * AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner - */ - public static AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner fromJson( - String jsonString) throws IOException { - return JSON.getGson() - .fromJson( - jsonString, - AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner.class); - } - - /** - * Convert an instance of AllCoinsInformationResponseInnerNetworkListInnerNetworkListInner to an - * JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/CheckQuestionnaireRequirementsResponse.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/CheckQuestionnaireRequirementsResponse.java new file mode 100644 index 000000000..00b665bd3 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/CheckQuestionnaireRequirementsResponse.java @@ -0,0 +1,229 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** CheckQuestionnaireRequirementsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CheckQuestionnaireRequirementsResponse { + public static final String SERIALIZED_NAME_QUESTIONNAIRE_COUNTRY_CODE = + "questionnaireCountryCode"; + + @SerializedName(SERIALIZED_NAME_QUESTIONNAIRE_COUNTRY_CODE) + @jakarta.annotation.Nullable + private String questionnaireCountryCode; + + public CheckQuestionnaireRequirementsResponse() {} + + public CheckQuestionnaireRequirementsResponse questionnaireCountryCode( + @jakarta.annotation.Nullable String questionnaireCountryCode) { + this.questionnaireCountryCode = questionnaireCountryCode; + return this; + } + + /** + * Get questionnaireCountryCode + * + * @return questionnaireCountryCode + */ + @jakarta.annotation.Nullable + public String getQuestionnaireCountryCode() { + return questionnaireCountryCode; + } + + public void setQuestionnaireCountryCode( + @jakarta.annotation.Nullable String questionnaireCountryCode) { + this.questionnaireCountryCode = questionnaireCountryCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckQuestionnaireRequirementsResponse checkQuestionnaireRequirementsResponse = + (CheckQuestionnaireRequirementsResponse) o; + return Objects.equals( + this.questionnaireCountryCode, + checkQuestionnaireRequirementsResponse.questionnaireCountryCode); + } + + @Override + public int hashCode() { + return Objects.hash(questionnaireCountryCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckQuestionnaireRequirementsResponse {\n"); + sb.append(" questionnaireCountryCode: ") + .append(toIndentedString(questionnaireCountryCode)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object questionnaireCountryCodeValue = getQuestionnaireCountryCode(); + String questionnaireCountryCodeValueAsString = ""; + questionnaireCountryCodeValueAsString = questionnaireCountryCodeValue.toString(); + sb.append("questionnaireCountryCode=") + .append(urlEncode(questionnaireCountryCodeValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("questionnaireCountryCode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CheckQuestionnaireRequirementsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CheckQuestionnaireRequirementsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CheckQuestionnaireRequirementsResponse" + + " is not found in the empty JSON string", + CheckQuestionnaireRequirementsResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("questionnaireCountryCode") != null + && !jsonObj.get("questionnaireCountryCode").isJsonNull()) + && !jsonObj.get("questionnaireCountryCode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `questionnaireCountryCode` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("questionnaireCountryCode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CheckQuestionnaireRequirementsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CheckQuestionnaireRequirementsResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CheckQuestionnaireRequirementsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CheckQuestionnaireRequirementsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CheckQuestionnaireRequirementsResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CheckQuestionnaireRequirementsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckQuestionnaireRequirementsResponse + * @throws IOException if the JSON string is invalid with respect to + * CheckQuestionnaireRequirementsResponse + */ + public static CheckQuestionnaireRequirementsResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CheckQuestionnaireRequirementsResponse.class); + } + + /** + * Convert an instance of CheckQuestionnaireRequirementsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryResponseInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryResponseInner.java index f99382494..0e81ff6b7 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryResponseInner.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryResponseInner.java @@ -120,6 +120,12 @@ public class DepositHistoryResponseInner { @jakarta.annotation.Nullable private Long walletType; + public static final String SERIALIZED_NAME_TRAVEL_RULE_STATUS = "travelRuleStatus"; + + @SerializedName(SERIALIZED_NAME_TRAVEL_RULE_STATUS) + @jakarta.annotation.Nullable + private Long travelRuleStatus; + public DepositHistoryResponseInner() {} public DepositHistoryResponseInner id(@jakarta.annotation.Nullable String id) { @@ -392,6 +398,26 @@ public void setWalletType(@jakarta.annotation.Nullable Long walletType) { this.walletType = walletType; } + public DepositHistoryResponseInner travelRuleStatus( + @jakarta.annotation.Nullable Long travelRuleStatus) { + this.travelRuleStatus = travelRuleStatus; + return this; + } + + /** + * Get travelRuleStatus + * + * @return travelRuleStatus + */ + @jakarta.annotation.Nullable + public Long getTravelRuleStatus() { + return travelRuleStatus; + } + + public void setTravelRuleStatus(@jakarta.annotation.Nullable Long travelRuleStatus) { + this.travelRuleStatus = travelRuleStatus; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -414,7 +440,9 @@ public boolean equals(Object o) { && Objects.equals(this.transferType, depositHistoryResponseInner.transferType) && Objects.equals(this.confirmTimes, depositHistoryResponseInner.confirmTimes) && Objects.equals(this.unlockConfirm, depositHistoryResponseInner.unlockConfirm) - && Objects.equals(this.walletType, depositHistoryResponseInner.walletType); + && Objects.equals(this.walletType, depositHistoryResponseInner.walletType) + && Objects.equals( + this.travelRuleStatus, depositHistoryResponseInner.travelRuleStatus); } @Override @@ -433,7 +461,8 @@ public int hashCode() { transferType, confirmTimes, unlockConfirm, - walletType); + walletType, + travelRuleStatus); } @Override @@ -454,6 +483,7 @@ public String toString() { sb.append(" confirmTimes: ").append(toIndentedString(confirmTimes)).append("\n"); sb.append(" unlockConfirm: ").append(toIndentedString(unlockConfirm)).append("\n"); sb.append(" walletType: ").append(toIndentedString(walletType)).append("\n"); + sb.append(" travelRuleStatus: ").append(toIndentedString(travelRuleStatus)).append("\n"); sb.append("}"); return sb.toString(); } @@ -517,6 +547,10 @@ public String toUrlQueryString() { String walletTypeValueAsString = ""; walletTypeValueAsString = walletTypeValue.toString(); sb.append("walletType=").append(urlEncode(walletTypeValueAsString)).append(""); + Object travelRuleStatusValue = getTravelRuleStatus(); + String travelRuleStatusValueAsString = ""; + travelRuleStatusValueAsString = travelRuleStatusValue.toString(); + sb.append("travelRuleStatus=").append(urlEncode(travelRuleStatusValueAsString)).append(""); return sb.toString(); } @@ -559,6 +593,7 @@ private String toIndentedString(Object o) { openapiFields.add("confirmTimes"); openapiFields.add("unlockConfirm"); openapiFields.add("walletType"); + openapiFields.add("travelRuleStatus"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OnboardedVaspListResponse.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2Response.java similarity index 76% rename from clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OnboardedVaspListResponse.java rename to clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2Response.java index 68f94eb11..86e05e219 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OnboardedVaspListResponse.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2Response.java @@ -31,12 +31,12 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** OnboardedVaspListResponse */ +/** DepositHistoryV2Response */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class OnboardedVaspListResponse extends ArrayList { - public OnboardedVaspListResponse() {} +public class DepositHistoryV2Response extends ArrayList { + public DepositHistoryV2Response() {} @Override public boolean equals(Object o) { @@ -57,7 +57,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class OnboardedVaspListResponse {\n"); + sb.append("class DepositHistoryV2Response {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append("}"); return sb.toString(); @@ -103,7 +103,7 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OnboardedVaspListResponse + * @throws IOException if the JSON Element is invalid with respect to DepositHistoryV2Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (!jsonElement.isJsonArray()) { @@ -116,16 +116,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray array = jsonElement.getAsJsonArray(); // validate array items for (JsonElement element : array) { - OnboardedVaspListResponseInner.validateJsonElement(element); + DepositHistoryV2ResponseInner.validateJsonElement(element); } if (jsonElement == null) { - if (!OnboardedVaspListResponse.openapiRequiredFields + if (!DepositHistoryV2Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in OnboardedVaspListResponse is not found" + "The required field(s) %s in DepositHistoryV2Response is not found" + " in the empty JSON string", - OnboardedVaspListResponse.openapiRequiredFields.toString())); + DepositHistoryV2Response.openapiRequiredFields.toString())); } } } @@ -134,25 +134,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!OnboardedVaspListResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OnboardedVaspListResponse' and its + if (!DepositHistoryV2Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DepositHistoryV2Response' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(OnboardedVaspListResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DepositHistoryV2Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, OnboardedVaspListResponse value) + public void write(JsonWriter out, DepositHistoryV2Response value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); elementAdapter.write(out, obj); } @Override - public OnboardedVaspListResponse read(JsonReader in) throws IOException { + public DepositHistoryV2Response read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -162,18 +162,18 @@ public OnboardedVaspListResponse read(JsonReader in) throws IOException { } /** - * Create an instance of OnboardedVaspListResponse given an JSON string + * Create an instance of DepositHistoryV2Response given an JSON string * * @param jsonString JSON string - * @return An instance of OnboardedVaspListResponse - * @throws IOException if the JSON string is invalid with respect to OnboardedVaspListResponse + * @return An instance of DepositHistoryV2Response + * @throws IOException if the JSON string is invalid with respect to DepositHistoryV2Response */ - public static OnboardedVaspListResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OnboardedVaspListResponse.class); + public static DepositHistoryV2Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DepositHistoryV2Response.class); } /** - * Convert an instance of OnboardedVaspListResponse to an JSON string + * Convert an instance of DepositHistoryV2Response to an JSON string * * @return JSON string */ diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInner.java new file mode 100644 index 000000000..1046f8a3f --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInner.java @@ -0,0 +1,728 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DepositHistoryV2ResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DepositHistoryV2ResponseInner { + public static final String SERIALIZED_NAME_DEPOSIT_ID = "depositId"; + + @SerializedName(SERIALIZED_NAME_DEPOSIT_ID) + @jakarta.annotation.Nullable + private String depositId; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_NETWORK = "network"; + + @SerializedName(SERIALIZED_NAME_NETWORK) + @jakarta.annotation.Nullable + private String network; + + public static final String SERIALIZED_NAME_COIN = "coin"; + + @SerializedName(SERIALIZED_NAME_COIN) + @jakarta.annotation.Nullable + private String coin; + + public static final String SERIALIZED_NAME_DEPOSIT_STATUS = "depositStatus"; + + @SerializedName(SERIALIZED_NAME_DEPOSIT_STATUS) + @jakarta.annotation.Nullable + private Long depositStatus; + + public static final String SERIALIZED_NAME_TRAVEL_RULE_REQ_STATUS = "travelRuleReqStatus"; + + @SerializedName(SERIALIZED_NAME_TRAVEL_RULE_REQ_STATUS) + @jakarta.annotation.Nullable + private Long travelRuleReqStatus; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + + @SerializedName(SERIALIZED_NAME_ADDRESS) + @jakarta.annotation.Nullable + private String address; + + public static final String SERIALIZED_NAME_ADDRESS_TAG = "addressTag"; + + @SerializedName(SERIALIZED_NAME_ADDRESS_TAG) + @jakarta.annotation.Nullable + private String addressTag; + + public static final String SERIALIZED_NAME_TX_ID = "txId"; + + @SerializedName(SERIALIZED_NAME_TX_ID) + @jakarta.annotation.Nullable + private String txId; + + public static final String SERIALIZED_NAME_TRANSFER_TYPE = "transferType"; + + @SerializedName(SERIALIZED_NAME_TRANSFER_TYPE) + @jakarta.annotation.Nullable + private Long transferType; + + public static final String SERIALIZED_NAME_CONFIRM_TIMES = "confirmTimes"; + + @SerializedName(SERIALIZED_NAME_CONFIRM_TIMES) + @jakarta.annotation.Nullable + private String confirmTimes; + + public static final String SERIALIZED_NAME_REQUIRE_QUESTIONNAIRE = "requireQuestionnaire"; + + @SerializedName(SERIALIZED_NAME_REQUIRE_QUESTIONNAIRE) + @jakarta.annotation.Nullable + private Boolean requireQuestionnaire; + + public static final String SERIALIZED_NAME_QUESTIONNAIRE = "questionnaire"; + + @SerializedName(SERIALIZED_NAME_QUESTIONNAIRE) + @jakarta.annotation.Nullable + private DepositHistoryV2ResponseInnerQuestionnaire questionnaire; + + public static final String SERIALIZED_NAME_INSERT_TIME = "insertTime"; + + @SerializedName(SERIALIZED_NAME_INSERT_TIME) + @jakarta.annotation.Nullable + private Long insertTime; + + public DepositHistoryV2ResponseInner() {} + + public DepositHistoryV2ResponseInner depositId(@jakarta.annotation.Nullable String depositId) { + this.depositId = depositId; + return this; + } + + /** + * Get depositId + * + * @return depositId + */ + @jakarta.annotation.Nullable + public String getDepositId() { + return depositId; + } + + public void setDepositId(@jakarta.annotation.Nullable String depositId) { + this.depositId = depositId; + } + + public DepositHistoryV2ResponseInner amount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public DepositHistoryV2ResponseInner network(@jakarta.annotation.Nullable String network) { + this.network = network; + return this; + } + + /** + * Get network + * + * @return network + */ + @jakarta.annotation.Nullable + public String getNetwork() { + return network; + } + + public void setNetwork(@jakarta.annotation.Nullable String network) { + this.network = network; + } + + public DepositHistoryV2ResponseInner coin(@jakarta.annotation.Nullable String coin) { + this.coin = coin; + return this; + } + + /** + * Get coin + * + * @return coin + */ + @jakarta.annotation.Nullable + public String getCoin() { + return coin; + } + + public void setCoin(@jakarta.annotation.Nullable String coin) { + this.coin = coin; + } + + public DepositHistoryV2ResponseInner depositStatus( + @jakarta.annotation.Nullable Long depositStatus) { + this.depositStatus = depositStatus; + return this; + } + + /** + * Get depositStatus + * + * @return depositStatus + */ + @jakarta.annotation.Nullable + public Long getDepositStatus() { + return depositStatus; + } + + public void setDepositStatus(@jakarta.annotation.Nullable Long depositStatus) { + this.depositStatus = depositStatus; + } + + public DepositHistoryV2ResponseInner travelRuleReqStatus( + @jakarta.annotation.Nullable Long travelRuleReqStatus) { + this.travelRuleReqStatus = travelRuleReqStatus; + return this; + } + + /** + * Get travelRuleReqStatus + * + * @return travelRuleReqStatus + */ + @jakarta.annotation.Nullable + public Long getTravelRuleReqStatus() { + return travelRuleReqStatus; + } + + public void setTravelRuleReqStatus(@jakarta.annotation.Nullable Long travelRuleReqStatus) { + this.travelRuleReqStatus = travelRuleReqStatus; + } + + public DepositHistoryV2ResponseInner address(@jakarta.annotation.Nullable String address) { + this.address = address; + return this; + } + + /** + * Get address + * + * @return address + */ + @jakarta.annotation.Nullable + public String getAddress() { + return address; + } + + public void setAddress(@jakarta.annotation.Nullable String address) { + this.address = address; + } + + public DepositHistoryV2ResponseInner addressTag( + @jakarta.annotation.Nullable String addressTag) { + this.addressTag = addressTag; + return this; + } + + /** + * Get addressTag + * + * @return addressTag + */ + @jakarta.annotation.Nullable + public String getAddressTag() { + return addressTag; + } + + public void setAddressTag(@jakarta.annotation.Nullable String addressTag) { + this.addressTag = addressTag; + } + + public DepositHistoryV2ResponseInner txId(@jakarta.annotation.Nullable String txId) { + this.txId = txId; + return this; + } + + /** + * Get txId + * + * @return txId + */ + @jakarta.annotation.Nullable + public String getTxId() { + return txId; + } + + public void setTxId(@jakarta.annotation.Nullable String txId) { + this.txId = txId; + } + + public DepositHistoryV2ResponseInner transferType( + @jakarta.annotation.Nullable Long transferType) { + this.transferType = transferType; + return this; + } + + /** + * Get transferType + * + * @return transferType + */ + @jakarta.annotation.Nullable + public Long getTransferType() { + return transferType; + } + + public void setTransferType(@jakarta.annotation.Nullable Long transferType) { + this.transferType = transferType; + } + + public DepositHistoryV2ResponseInner confirmTimes( + @jakarta.annotation.Nullable String confirmTimes) { + this.confirmTimes = confirmTimes; + return this; + } + + /** + * Get confirmTimes + * + * @return confirmTimes + */ + @jakarta.annotation.Nullable + public String getConfirmTimes() { + return confirmTimes; + } + + public void setConfirmTimes(@jakarta.annotation.Nullable String confirmTimes) { + this.confirmTimes = confirmTimes; + } + + public DepositHistoryV2ResponseInner requireQuestionnaire( + @jakarta.annotation.Nullable Boolean requireQuestionnaire) { + this.requireQuestionnaire = requireQuestionnaire; + return this; + } + + /** + * Get requireQuestionnaire + * + * @return requireQuestionnaire + */ + @jakarta.annotation.Nullable + public Boolean getRequireQuestionnaire() { + return requireQuestionnaire; + } + + public void setRequireQuestionnaire(@jakarta.annotation.Nullable Boolean requireQuestionnaire) { + this.requireQuestionnaire = requireQuestionnaire; + } + + public DepositHistoryV2ResponseInner questionnaire( + @jakarta.annotation.Nullable DepositHistoryV2ResponseInnerQuestionnaire questionnaire) { + this.questionnaire = questionnaire; + return this; + } + + /** + * Get questionnaire + * + * @return questionnaire + */ + @jakarta.annotation.Nullable + @Valid + public DepositHistoryV2ResponseInnerQuestionnaire getQuestionnaire() { + return questionnaire; + } + + public void setQuestionnaire( + @jakarta.annotation.Nullable DepositHistoryV2ResponseInnerQuestionnaire questionnaire) { + this.questionnaire = questionnaire; + } + + public DepositHistoryV2ResponseInner insertTime(@jakarta.annotation.Nullable Long insertTime) { + this.insertTime = insertTime; + return this; + } + + /** + * Get insertTime + * + * @return insertTime + */ + @jakarta.annotation.Nullable + public Long getInsertTime() { + return insertTime; + } + + public void setInsertTime(@jakarta.annotation.Nullable Long insertTime) { + this.insertTime = insertTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DepositHistoryV2ResponseInner depositHistoryV2ResponseInner = + (DepositHistoryV2ResponseInner) o; + return Objects.equals(this.depositId, depositHistoryV2ResponseInner.depositId) + && Objects.equals(this.amount, depositHistoryV2ResponseInner.amount) + && Objects.equals(this.network, depositHistoryV2ResponseInner.network) + && Objects.equals(this.coin, depositHistoryV2ResponseInner.coin) + && Objects.equals(this.depositStatus, depositHistoryV2ResponseInner.depositStatus) + && Objects.equals( + this.travelRuleReqStatus, depositHistoryV2ResponseInner.travelRuleReqStatus) + && Objects.equals(this.address, depositHistoryV2ResponseInner.address) + && Objects.equals(this.addressTag, depositHistoryV2ResponseInner.addressTag) + && Objects.equals(this.txId, depositHistoryV2ResponseInner.txId) + && Objects.equals(this.transferType, depositHistoryV2ResponseInner.transferType) + && Objects.equals(this.confirmTimes, depositHistoryV2ResponseInner.confirmTimes) + && Objects.equals( + this.requireQuestionnaire, + depositHistoryV2ResponseInner.requireQuestionnaire) + && Objects.equals(this.questionnaire, depositHistoryV2ResponseInner.questionnaire) + && Objects.equals(this.insertTime, depositHistoryV2ResponseInner.insertTime); + } + + @Override + public int hashCode() { + return Objects.hash( + depositId, + amount, + network, + coin, + depositStatus, + travelRuleReqStatus, + address, + addressTag, + txId, + transferType, + confirmTimes, + requireQuestionnaire, + questionnaire, + insertTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DepositHistoryV2ResponseInner {\n"); + sb.append(" depositId: ").append(toIndentedString(depositId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); + sb.append(" depositStatus: ").append(toIndentedString(depositStatus)).append("\n"); + sb.append(" travelRuleReqStatus: ") + .append(toIndentedString(travelRuleReqStatus)) + .append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" addressTag: ").append(toIndentedString(addressTag)).append("\n"); + sb.append(" txId: ").append(toIndentedString(txId)).append("\n"); + sb.append(" transferType: ").append(toIndentedString(transferType)).append("\n"); + sb.append(" confirmTimes: ").append(toIndentedString(confirmTimes)).append("\n"); + sb.append(" requireQuestionnaire: ") + .append(toIndentedString(requireQuestionnaire)) + .append("\n"); + sb.append(" questionnaire: ").append(toIndentedString(questionnaire)).append("\n"); + sb.append(" insertTime: ").append(toIndentedString(insertTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object depositIdValue = getDepositId(); + String depositIdValueAsString = ""; + depositIdValueAsString = depositIdValue.toString(); + sb.append("depositId=").append(urlEncode(depositIdValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object networkValue = getNetwork(); + String networkValueAsString = ""; + networkValueAsString = networkValue.toString(); + sb.append("network=").append(urlEncode(networkValueAsString)).append(""); + Object coinValue = getCoin(); + String coinValueAsString = ""; + coinValueAsString = coinValue.toString(); + sb.append("coin=").append(urlEncode(coinValueAsString)).append(""); + Object depositStatusValue = getDepositStatus(); + String depositStatusValueAsString = ""; + depositStatusValueAsString = depositStatusValue.toString(); + sb.append("depositStatus=").append(urlEncode(depositStatusValueAsString)).append(""); + Object travelRuleReqStatusValue = getTravelRuleReqStatus(); + String travelRuleReqStatusValueAsString = ""; + travelRuleReqStatusValueAsString = travelRuleReqStatusValue.toString(); + sb.append("travelRuleReqStatus=") + .append(urlEncode(travelRuleReqStatusValueAsString)) + .append(""); + Object addressValue = getAddress(); + String addressValueAsString = ""; + addressValueAsString = addressValue.toString(); + sb.append("address=").append(urlEncode(addressValueAsString)).append(""); + Object addressTagValue = getAddressTag(); + String addressTagValueAsString = ""; + addressTagValueAsString = addressTagValue.toString(); + sb.append("addressTag=").append(urlEncode(addressTagValueAsString)).append(""); + Object txIdValue = getTxId(); + String txIdValueAsString = ""; + txIdValueAsString = txIdValue.toString(); + sb.append("txId=").append(urlEncode(txIdValueAsString)).append(""); + Object transferTypeValue = getTransferType(); + String transferTypeValueAsString = ""; + transferTypeValueAsString = transferTypeValue.toString(); + sb.append("transferType=").append(urlEncode(transferTypeValueAsString)).append(""); + Object confirmTimesValue = getConfirmTimes(); + String confirmTimesValueAsString = ""; + confirmTimesValueAsString = confirmTimesValue.toString(); + sb.append("confirmTimes=").append(urlEncode(confirmTimesValueAsString)).append(""); + Object requireQuestionnaireValue = getRequireQuestionnaire(); + String requireQuestionnaireValueAsString = ""; + requireQuestionnaireValueAsString = requireQuestionnaireValue.toString(); + sb.append("requireQuestionnaire=") + .append(urlEncode(requireQuestionnaireValueAsString)) + .append(""); + Object questionnaireValue = getQuestionnaire(); + String questionnaireValueAsString = ""; + questionnaireValueAsString = questionnaireValue.toString(); + sb.append("questionnaire=").append(urlEncode(questionnaireValueAsString)).append(""); + Object insertTimeValue = getInsertTime(); + String insertTimeValueAsString = ""; + insertTimeValueAsString = insertTimeValue.toString(); + sb.append("insertTime=").append(urlEncode(insertTimeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("depositId"); + openapiFields.add("amount"); + openapiFields.add("network"); + openapiFields.add("coin"); + openapiFields.add("depositStatus"); + openapiFields.add("travelRuleReqStatus"); + openapiFields.add("address"); + openapiFields.add("addressTag"); + openapiFields.add("txId"); + openapiFields.add("transferType"); + openapiFields.add("confirmTimes"); + openapiFields.add("requireQuestionnaire"); + openapiFields.add("questionnaire"); + openapiFields.add("insertTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DepositHistoryV2ResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DepositHistoryV2ResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DepositHistoryV2ResponseInner is not" + + " found in the empty JSON string", + DepositHistoryV2ResponseInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("depositId") != null && !jsonObj.get("depositId").isJsonNull()) + && !jsonObj.get("depositId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `depositId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("depositId").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) + && !jsonObj.get("network").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `network` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("network").toString())); + } + if ((jsonObj.get("coin") != null && !jsonObj.get("coin").isJsonNull()) + && !jsonObj.get("coin").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `coin` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("coin").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) + && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `address` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("address").toString())); + } + if ((jsonObj.get("addressTag") != null && !jsonObj.get("addressTag").isJsonNull()) + && !jsonObj.get("addressTag").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `addressTag` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("addressTag").toString())); + } + if ((jsonObj.get("txId") != null && !jsonObj.get("txId").isJsonNull()) + && !jsonObj.get("txId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txId").toString())); + } + if ((jsonObj.get("confirmTimes") != null && !jsonObj.get("confirmTimes").isJsonNull()) + && !jsonObj.get("confirmTimes").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `confirmTimes` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("confirmTimes").toString())); + } + // validate the optional field `questionnaire` + if (jsonObj.get("questionnaire") != null && !jsonObj.get("questionnaire").isJsonNull()) { + DepositHistoryV2ResponseInnerQuestionnaire.validateJsonElement( + jsonObj.get("questionnaire")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DepositHistoryV2ResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DepositHistoryV2ResponseInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DepositHistoryV2ResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DepositHistoryV2ResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DepositHistoryV2ResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DepositHistoryV2ResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DepositHistoryV2ResponseInner + * @throws IOException if the JSON string is invalid with respect to + * DepositHistoryV2ResponseInner + */ + public static DepositHistoryV2ResponseInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DepositHistoryV2ResponseInner.class); + } + + /** + * Convert an instance of DepositHistoryV2ResponseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInnerQuestionnaire.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInnerQuestionnaire.java new file mode 100644 index 000000000..8c49c9a59 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DepositHistoryV2ResponseInnerQuestionnaire.java @@ -0,0 +1,260 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DepositHistoryV2ResponseInnerQuestionnaire */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DepositHistoryV2ResponseInnerQuestionnaire { + public static final String SERIALIZED_NAME_VASP_NAME = "vaspName"; + + @SerializedName(SERIALIZED_NAME_VASP_NAME) + @jakarta.annotation.Nullable + private String vaspName; + + public static final String SERIALIZED_NAME_DEPOSIT_ORIGINATOR = "depositOriginator"; + + @SerializedName(SERIALIZED_NAME_DEPOSIT_ORIGINATOR) + @jakarta.annotation.Nullable + private Long depositOriginator; + + public DepositHistoryV2ResponseInnerQuestionnaire() {} + + public DepositHistoryV2ResponseInnerQuestionnaire vaspName( + @jakarta.annotation.Nullable String vaspName) { + this.vaspName = vaspName; + return this; + } + + /** + * Get vaspName + * + * @return vaspName + */ + @jakarta.annotation.Nullable + public String getVaspName() { + return vaspName; + } + + public void setVaspName(@jakarta.annotation.Nullable String vaspName) { + this.vaspName = vaspName; + } + + public DepositHistoryV2ResponseInnerQuestionnaire depositOriginator( + @jakarta.annotation.Nullable Long depositOriginator) { + this.depositOriginator = depositOriginator; + return this; + } + + /** + * Get depositOriginator + * + * @return depositOriginator + */ + @jakarta.annotation.Nullable + public Long getDepositOriginator() { + return depositOriginator; + } + + public void setDepositOriginator(@jakarta.annotation.Nullable Long depositOriginator) { + this.depositOriginator = depositOriginator; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DepositHistoryV2ResponseInnerQuestionnaire depositHistoryV2ResponseInnerQuestionnaire = + (DepositHistoryV2ResponseInnerQuestionnaire) o; + return Objects.equals(this.vaspName, depositHistoryV2ResponseInnerQuestionnaire.vaspName) + && Objects.equals( + this.depositOriginator, + depositHistoryV2ResponseInnerQuestionnaire.depositOriginator); + } + + @Override + public int hashCode() { + return Objects.hash(vaspName, depositOriginator); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DepositHistoryV2ResponseInnerQuestionnaire {\n"); + sb.append(" vaspName: ").append(toIndentedString(vaspName)).append("\n"); + sb.append(" depositOriginator: ").append(toIndentedString(depositOriginator)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object vaspNameValue = getVaspName(); + String vaspNameValueAsString = ""; + vaspNameValueAsString = vaspNameValue.toString(); + sb.append("vaspName=").append(urlEncode(vaspNameValueAsString)).append(""); + Object depositOriginatorValue = getDepositOriginator(); + String depositOriginatorValueAsString = ""; + depositOriginatorValueAsString = depositOriginatorValue.toString(); + sb.append("depositOriginator=") + .append(urlEncode(depositOriginatorValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("vaspName"); + openapiFields.add("depositOriginator"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DepositHistoryV2ResponseInnerQuestionnaire + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DepositHistoryV2ResponseInnerQuestionnaire.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DepositHistoryV2ResponseInnerQuestionnaire is not found in" + + " the empty JSON string", + DepositHistoryV2ResponseInnerQuestionnaire.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("vaspName") != null && !jsonObj.get("vaspName").isJsonNull()) + && !jsonObj.get("vaspName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `vaspName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("vaspName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DepositHistoryV2ResponseInnerQuestionnaire.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'DepositHistoryV2ResponseInnerQuestionnaire' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DepositHistoryV2ResponseInnerQuestionnaire.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DepositHistoryV2ResponseInnerQuestionnaire value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DepositHistoryV2ResponseInnerQuestionnaire read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DepositHistoryV2ResponseInnerQuestionnaire given an JSON string + * + * @param jsonString JSON string + * @return An instance of DepositHistoryV2ResponseInnerQuestionnaire + * @throws IOException if the JSON string is invalid with respect to + * DepositHistoryV2ResponseInnerQuestionnaire + */ + public static DepositHistoryV2ResponseInnerQuestionnaire fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, DepositHistoryV2ResponseInnerQuestionnaire.class); + } + + /** + * Convert an instance of DepositHistoryV2ResponseInnerQuestionnaire to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/VaspListResponse.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/VaspListResponse.java new file mode 100644 index 000000000..9adcff3d9 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/VaspListResponse.java @@ -0,0 +1,182 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** VaspListResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class VaspListResponse extends ArrayList { + public VaspListResponse() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VaspListResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to VaspListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + VaspListResponseInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!VaspListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in VaspListResponse is not found in the" + + " empty JSON string", + VaspListResponse.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VaspListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VaspListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(VaspListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VaspListResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public VaspListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VaspListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of VaspListResponse + * @throws IOException if the JSON string is invalid with respect to VaspListResponse + */ + public static VaspListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VaspListResponse.class); + } + + /** + * Convert an instance of VaspListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OnboardedVaspListResponseInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/VaspListResponseInner.java similarity index 76% rename from clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OnboardedVaspListResponseInner.java rename to clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/VaspListResponseInner.java index 424a965ad..871a8a22d 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OnboardedVaspListResponseInner.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/VaspListResponseInner.java @@ -31,11 +31,11 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** OnboardedVaspListResponseInner */ +/** VaspListResponseInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class OnboardedVaspListResponseInner { +public class VaspListResponseInner { public static final String SERIALIZED_NAME_VASP_NAME = "vaspName"; @SerializedName(SERIALIZED_NAME_VASP_NAME) @@ -48,9 +48,9 @@ public class OnboardedVaspListResponseInner { @jakarta.annotation.Nullable private String vaspCode; - public OnboardedVaspListResponseInner() {} + public VaspListResponseInner() {} - public OnboardedVaspListResponseInner vaspName(@jakarta.annotation.Nullable String vaspName) { + public VaspListResponseInner vaspName(@jakarta.annotation.Nullable String vaspName) { this.vaspName = vaspName; return this; } @@ -69,7 +69,7 @@ public void setVaspName(@jakarta.annotation.Nullable String vaspName) { this.vaspName = vaspName; } - public OnboardedVaspListResponseInner vaspCode(@jakarta.annotation.Nullable String vaspCode) { + public VaspListResponseInner vaspCode(@jakarta.annotation.Nullable String vaspCode) { this.vaspCode = vaspCode; return this; } @@ -96,10 +96,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - OnboardedVaspListResponseInner onboardedVaspListResponseInner = - (OnboardedVaspListResponseInner) o; - return Objects.equals(this.vaspName, onboardedVaspListResponseInner.vaspName) - && Objects.equals(this.vaspCode, onboardedVaspListResponseInner.vaspCode); + VaspListResponseInner vaspListResponseInner = (VaspListResponseInner) o; + return Objects.equals(this.vaspName, vaspListResponseInner.vaspName) + && Objects.equals(this.vaspCode, vaspListResponseInner.vaspCode); } @Override @@ -110,7 +109,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class OnboardedVaspListResponseInner {\n"); + sb.append("class VaspListResponseInner {\n"); sb.append(" vaspName: ").append(toIndentedString(vaspName)).append("\n"); sb.append(" vaspCode: ").append(toIndentedString(vaspCode)).append("\n"); sb.append("}"); @@ -167,18 +166,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * OnboardedVaspListResponseInner + * @throws IOException if the JSON Element is invalid with respect to VaspListResponseInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!OnboardedVaspListResponseInner.openapiRequiredFields + if (!VaspListResponseInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in OnboardedVaspListResponseInner is not" - + " found in the empty JSON string", - OnboardedVaspListResponseInner.openapiRequiredFields.toString())); + "The required field(s) %s in VaspListResponseInner is not found in" + + " the empty JSON string", + VaspListResponseInner.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -204,27 +202,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!OnboardedVaspListResponseInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OnboardedVaspListResponseInner' and its - // subtypes + if (!VaspListResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VaspListResponseInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OnboardedVaspListResponseInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(VaspListResponseInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, OnboardedVaspListResponseInner value) + public void write(JsonWriter out, VaspListResponseInner value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public OnboardedVaspListResponseInner read(JsonReader in) - throws IOException { + public VaspListResponseInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -234,19 +229,18 @@ public OnboardedVaspListResponseInner read(JsonReader in) } /** - * Create an instance of OnboardedVaspListResponseInner given an JSON string + * Create an instance of VaspListResponseInner given an JSON string * * @param jsonString JSON string - * @return An instance of OnboardedVaspListResponseInner - * @throws IOException if the JSON string is invalid with respect to - * OnboardedVaspListResponseInner + * @return An instance of VaspListResponseInner + * @throws IOException if the JSON string is invalid with respect to VaspListResponseInner */ - public static OnboardedVaspListResponseInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OnboardedVaspListResponseInner.class); + public static VaspListResponseInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VaspListResponseInner.class); } /** - * Convert an instance of OnboardedVaspListResponseInner to an JSON string + * Convert an instance of VaspListResponseInner to an JSON string * * @return JSON string */ diff --git a/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java b/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java index dd8c46619..39f12fd3e 100644 --- a/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java +++ b/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java @@ -12,8 +12,6 @@ package com.binance.connector.client.wallet.rest.api; -import static org.junit.Assert.assertEquals; - import com.binance.connector.client.common.ApiClient; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -26,16 +24,15 @@ import com.binance.connector.client.wallet.rest.model.BrokerWithdrawRequest; import com.binance.connector.client.wallet.rest.model.BrokerWithdrawResponse; import com.binance.connector.client.wallet.rest.model.DepositHistoryTravelRuleResponse; -import com.binance.connector.client.wallet.rest.model.OnboardedVaspListResponse; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireRequest; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireResponse; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleRequest; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleResponse; +import com.binance.connector.client.wallet.rest.model.VaspListResponse; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV1Response; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV2Response; import com.binance.connector.client.wallet.rest.model.WithdrawTravelRuleRequest; import com.binance.connector.client.wallet.rest.model.WithdrawTravelRuleResponse; -import jakarta.validation.constraints.*; import okhttp3.Call; import okhttp3.Request; import org.bouncycastle.crypto.CryptoException; @@ -44,6 +41,8 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mockito; +import static org.junit.Assert.assertEquals; + /** API tests for TravelRuleApi */ public class TravelRuleApiTest { @@ -205,7 +204,8 @@ public void depositHistoryTravelRuleTest() throws ApiException, CryptoException */ @Test public void onboardedVaspListTest() throws ApiException, CryptoException { - ApiResponse response = api.onboardedVaspList(); + Long recvWindow = 5000L; + ApiResponse vaspListResponseApiResponse = api.vaspList(recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -217,9 +217,9 @@ public void onboardedVaspListTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("timestamp=1736393892000", signInputCaptor.getValue()); + assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "53668e00dc92eb93de0b253c301e9fc0c20042b13db384a0ad94b38688a5a84c", + "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", actualRequest.url().queryParameter("signature")); assertEquals("/sapi/v1/localentity/vasp", actualRequest.url().encodedPath()); } diff --git a/examples/crypto-loan/pom.xml b/examples/crypto-loan/pom.xml index 3af125d68..790e62f50 100644 --- a/examples/crypto-loan/pom.xml +++ b/examples/crypto-loan/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-crypto-loan - 2.1.1 + 3.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-coin-futures/pom.xml b/examples/derivatives-trading-coin-futures/pom.xml index 491f70bdf..507077c5f 100644 --- a/examples/derivatives-trading-coin-futures/pom.xml +++ b/examples/derivatives-trading-coin-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-coin-futures - 2.0.1 + 3.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/pom.xml b/examples/derivatives-trading-options/pom.xml index c809f9cb2..fde7cafbc 100644 --- a/examples/derivatives-trading-options/pom.xml +++ b/examples/derivatives-trading-options/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-options - 2.0.1 + 3.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/OptionMarginAccountInformationExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionMarginAccountInformationExample.java similarity index 97% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/OptionMarginAccountInformationExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionMarginAccountInformationExample.java index 1c409a733..a87fcf407 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/OptionMarginAccountInformationExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionMarginAccountInformationExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.rest.marketmakerendpoints; +package com.binance.connector.client.derivatives_trading_options.rest.account; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.api.DerivativesTradingOptionsRestApi; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; -/** API examples for MarketMakerEndpointsApi */ +/** API examples for AccountApi */ public class OptionMarginAccountInformationExample { private DerivativesTradingOptionsRestApi api; diff --git a/examples/derivatives-trading-portfolio-margin/pom.xml b/examples/derivatives-trading-portfolio-margin/pom.xml index 6fcfcab82..70ee98755 100644 --- a/examples/derivatives-trading-portfolio-margin/pom.xml +++ b/examples/derivatives-trading-portfolio-margin/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin - 2.0.1 + 3.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/ChangeAutoRepayFuturesStatusExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/ChangeAutoRepayFuturesStatusExample.java index 4c4197797..650483b1f 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/ChangeAutoRepayFuturesStatusExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/ChangeAutoRepayFuturesStatusExample.java @@ -48,7 +48,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { public void changeAutoRepayFuturesStatusExample() throws ApiException { ChangeAutoRepayFuturesStatusRequest changeAutoRepayFuturesStatusRequest = new ChangeAutoRepayFuturesStatusRequest(); - changeAutoRepayFuturesStatusRequest.autoRepay(""); + changeAutoRepayFuturesStatusRequest.autoRepay("true"); ApiResponse response = getApi().changeAutoRepayFuturesStatus(changeAutoRepayFuturesStatusRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-usds-futures/pom.xml b/examples/derivatives-trading-usds-futures/pom.xml index 7fd7de423..1fea47aed 100644 --- a/examples/derivatives-trading-usds-futures/pom.xml +++ b/examples/derivatives-trading-usds-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-usds-futures - 4.0.1 + 5.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/GetFundingRateHistoryExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/GetFundingRateHistoryExample.java index 4670737af..d4740a44d 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/GetFundingRateHistoryExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/GetFundingRateHistoryExample.java @@ -41,7 +41,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * Get Funding Rate History * *

Get Funding Rate History * If `startTime` and `endTime` are not sent, - * the most recent `limit` datas are returned. * If the number of data between + * the most recent 200 records are returned. * If the number of data between * `startTime` and `endTime` is larger than `limit`, return as * `startTime` + `limit`. * In ascending order. Weight: share 500/5min/IP * rate limit with GET /fapi/v1/fundingInfo diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java index cd43744b7..f323c097b 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java @@ -38,7 +38,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { } /** - * Symbol Price Ticker + * Symbol Price Ticker(Deprecated) * *

Latest price for a symbol or symbols. * If the symbol is not sent, prices for all symbols * will be returned in an array. Weight: 1 for a single symbol; 2 when the symbol parameter is diff --git a/examples/margin-trading/pom.xml b/examples/margin-trading/pom.xml index 74f1ad89a..c20d87546 100644 --- a/examples/margin-trading/pom.xml +++ b/examples/margin-trading/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-margin-trading - 3.0.1 + 4.0.0 \ No newline at end of file diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetLimitPricePairsExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetLimitPricePairsExample.java new file mode 100644 index 000000000..7c44fcd29 --- /dev/null +++ b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetLimitPricePairsExample.java @@ -0,0 +1,60 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.margin_trading.rest.marketdata; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; +import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; +import com.binance.connector.client.margin_trading.rest.model.GetLimitPricePairsResponse; + +/** API examples for MarketDataApi */ +public class GetLimitPricePairsExample { + private MarginTradingRestApi api; + + public MarginTradingRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + MarginTradingRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new MarginTradingRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Limit Price Pairs(MARKET_DATA) + * + *

Query trading pairs with restriction on limit price range. In margin trading, you can + * place orders with limit price. Limit price should be within (-15%, 15%) of current index + * price for a list of margin trading pairs. This rule only impacts limit sell orders with limit + * price that is lower than current index price and limit buy orders with limit price that is + * higher than current index price. - Buy order: Your order will be rejected with an error + * message notification if the limit price is 15% above the index price. - Sell order: Your + * order will be rejected with an error message notification if the limit price is 15% below the + * index price. Please review the limit price order placing strategy, backtest and calibrate the + * planned order size with the trading volume and order book depth to prevent trading loss. + * Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void getLimitPricePairsExample() throws ApiException { + ApiResponse response = getApi().getLimitPricePairs(); + System.out.println(response.getData()); + } +} diff --git a/examples/pay/pom.xml b/examples/pay/pom.xml index b4066c304..a1a6f364d 100644 --- a/examples/pay/pom.xml +++ b/examples/pay/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-pay - 2.1.1 + 3.0.0 \ No newline at end of file diff --git a/examples/pay/src/main/java/com/binance/connector/client/pay/rest/pay/GetPayTradeHistoryExample.java b/examples/pay/src/main/java/com/binance/connector/client/pay/rest/pay/GetPayTradeHistoryExample.java index 6716c1464..c4a873f27 100644 --- a/examples/pay/src/main/java/com/binance/connector/client/pay/rest/pay/GetPayTradeHistoryExample.java +++ b/examples/pay/src/main/java/com/binance/connector/client/pay/rest/pay/GetPayTradeHistoryExample.java @@ -45,21 +45,21 @@ public PayRestApi getApi() { * different return values in different orderTypes. * Sender's perspective when orderType is * C2C * payerInfo : binanceId * receiverInfo : name, * binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input) * - * Receiver's perspective when orderType is C2C * payerInfo : name, accountId * receiverInfo - * : binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * + * Receiver's perspective when orderType is C2C * payerInfo : name * receiverInfo : + * binanceId * Sender's perspective when orderType is CRYPTO_BOX * payerInfo : binanceId * * receiverInfo : name(the value is always \"Crypto Box\") * Receiver's - * perspective when orderType is CRYPTO_BOX * payerInfo : name, accountId * receiverInfo : - * binanceId * Sender's perspective when orderType is PAY * payerInfo : binanceId * - * receiverInfo : name * Receiver's perspective when orderType is PAY * payerInfo : name, - * accountId * receiverInfo : binanceId, name * Sender's perspective when orderType is - * PAY_REFUND * payerInfo : binanceId, name * receiverInfo : name, accountId * Receiver's - * perspective when orderType is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * - * Sender's perspective when orderType is PAYOUT * payerInfo : binanceId, name * - * receiverInfo : name, accountId * Receiver's perspective when orderType is PAYOUT * - * payerInfo : name * receiverInfo : binanceId * Receiver's perspective when orderType is - * CRYPTO_BOX_RF * payerInfo : name(the value is always \"Crypto Box\") * receiverInfo - * : binanceId * Sender's perspective when orderType is REMITTANCE * payerInfo : binanceId * - * receiverInfo : name, institutionName, cardNumber, digitalWalletId Weight: 3000 + * perspective when orderType is CRYPTO_BOX * payerInfo : name * receiverInfo : binanceId * + * Sender's perspective when orderType is PAY * payerInfo : binanceId * receiverInfo : name + * * Receiver's perspective when orderType is PAY * payerInfo : name * receiverInfo : + * binanceId, name * Sender's perspective when orderType is PAY_REFUND * payerInfo : + * binanceId, name * receiverInfo : name, accountId * Receiver's perspective when orderType + * is PAY_REFUND * payerInfo : name * receiverInfo : binanceId * Sender's perspective when + * orderType is PAYOUT * payerInfo : binanceId, name * receiverInfo : name, accountId * + * Receiver's perspective when orderType is PAYOUT * payerInfo : name * receiverInfo : + * binanceId * Receiver's perspective when orderType is CRYPTO_BOX_RF * payerInfo : name(the + * value is always \"Crypto Box\") * receiverInfo : binanceId * Sender's + * perspective when orderType is REMITTANCE * payerInfo : binanceId * receiverInfo : name, + * institutionName, cardNumber, digitalWalletId Weight: 3000 * * @throws ApiException if the Api call fails */ diff --git a/examples/simple-earn/pom.xml b/examples/simple-earn/pom.xml index 374184442..9c9074b40 100644 --- a/examples/simple-earn/pom.xml +++ b/examples/simple-earn/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-simple-earn - 2.1.1 + 3.0.0 \ No newline at end of file diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetCollateralRecordExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetCollateralRecordExample.java similarity index 96% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetCollateralRecordExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetCollateralRecordExample.java index 6614b953e..b736900bc 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetCollateralRecordExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetCollateralRecordExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetCollateralRecordResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetCollateralRecordExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexiblePersonalLeftQuotaExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexiblePersonalLeftQuotaExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexiblePersonalLeftQuotaExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexiblePersonalLeftQuotaExample.java index 9be3b5441..d6cd00026 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexiblePersonalLeftQuotaExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexiblePersonalLeftQuotaExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.account; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetFlexiblePersonalLeftQuotaResponse; -/** API examples for AccountApi */ +/** API examples for FlexibleLockedApi */ public class GetFlexiblePersonalLeftQuotaExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexibleProductPositionExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleProductPositionExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexibleProductPositionExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleProductPositionExample.java index 61c760417..aa37a2e49 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexibleProductPositionExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleProductPositionExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.account; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetFlexibleProductPositionResponse; -/** API examples for AccountApi */ +/** API examples for FlexibleLockedApi */ public class GetFlexibleProductPositionExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRedemptionRecordExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRedemptionRecordExample.java similarity index 96% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRedemptionRecordExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRedemptionRecordExample.java index 99b3277a5..ac7258929 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRedemptionRecordExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRedemptionRecordExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRedemptionRecordResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetFlexibleRedemptionRecordExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRewardsHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRewardsHistoryExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRewardsHistoryExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRewardsHistoryExample.java index ab55f4fd3..2be2956a5 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRewardsHistoryExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRewardsHistoryExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetFlexibleRewardsHistoryResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetFlexibleRewardsHistoryExample { private SimpleEarnRestApi api; @@ -51,7 +51,7 @@ public SimpleEarnRestApi getApi() { * @throws ApiException if the Api call fails */ public void getFlexibleRewardsHistoryExample() throws ApiException { - String type = "Bonus"; + String type = "s"; String productId = "1"; String asset = ""; Long startTime = 1623319461670L; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetFlexibleSubscriptionPreviewExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionPreviewExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetFlexibleSubscriptionPreviewExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionPreviewExample.java index 12349162a..40200a548 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetFlexibleSubscriptionPreviewExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionPreviewExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionPreviewResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class GetFlexibleSubscriptionPreviewExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleSubscriptionRecordExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionRecordExample.java similarity index 96% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleSubscriptionRecordExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionRecordExample.java index 57230dc16..b703793e1 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleSubscriptionRecordExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionRecordExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetFlexibleSubscriptionRecordResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetFlexibleSubscriptionRecordExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedPersonalLeftQuotaExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedPersonalLeftQuotaExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedPersonalLeftQuotaExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedPersonalLeftQuotaExample.java index 85f55c32b..2a43d565c 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedPersonalLeftQuotaExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedPersonalLeftQuotaExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.account; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetLockedPersonalLeftQuotaResponse; -/** API examples for AccountApi */ +/** API examples for FlexibleLockedApi */ public class GetLockedPersonalLeftQuotaExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedProductPositionExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedProductPositionExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedProductPositionExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedProductPositionExample.java index 385c5fe29..147b72f2b 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedProductPositionExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedProductPositionExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.account; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetLockedProductPositionResponse; -/** API examples for AccountApi */ +/** API examples for FlexibleLockedApi */ public class GetLockedProductPositionExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRedemptionRecordExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRedemptionRecordExample.java similarity index 96% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRedemptionRecordExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRedemptionRecordExample.java index 6aedf3d37..f6df86e88 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRedemptionRecordExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRedemptionRecordExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetLockedRedemptionRecordResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetLockedRedemptionRecordExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRewardsHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRewardsHistoryExample.java similarity index 96% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRewardsHistoryExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRewardsHistoryExample.java index 6a3c6e1f1..c6a6cfd83 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRewardsHistoryExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRewardsHistoryExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetLockedRewardsHistoryResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetLockedRewardsHistoryExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetLockedSubscriptionPreviewExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionPreviewExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetLockedSubscriptionPreviewExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionPreviewExample.java index 0c0cd5828..c82cf09d0 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetLockedSubscriptionPreviewExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionPreviewExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionPreviewResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class GetLockedSubscriptionPreviewExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedSubscriptionRecordExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionRecordExample.java similarity index 96% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedSubscriptionRecordExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionRecordExample.java index 82a892bc8..a59720ae9 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedSubscriptionRecordExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionRecordExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetLockedSubscriptionRecordResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetLockedSubscriptionRecordExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetRateHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetRateHistoryExample.java similarity index 96% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetRateHistoryExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetRateHistoryExample.java index 8a4bbf3ac..fe1cbe546 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetRateHistoryExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetRateHistoryExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.history; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetRateHistoryResponse; -/** API examples for HistoryApi */ +/** API examples for FlexibleLockedApi */ public class GetRateHistoryExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnFlexibleProductListExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnFlexibleProductListExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnFlexibleProductListExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnFlexibleProductListExample.java index b99c05fff..2d926f630 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnFlexibleProductListExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnFlexibleProductListExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.account; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnFlexibleProductListResponse; -/** API examples for AccountApi */ +/** API examples for FlexibleLockedApi */ public class GetSimpleEarnFlexibleProductListExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnLockedProductListExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnLockedProductListExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnLockedProductListExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnLockedProductListExample.java index 84afdb7e2..954ad3b0b 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnLockedProductListExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnLockedProductListExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.account; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnLockedProductListResponse; -/** API examples for AccountApi */ +/** API examples for FlexibleLockedApi */ public class GetSimpleEarnLockedProductListExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemFlexibleProductExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemFlexibleProductExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemFlexibleProductExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemFlexibleProductExample.java index 90edb0420..ce4071cb0 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemFlexibleProductExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemFlexibleProductExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -21,7 +21,7 @@ import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest; import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class RedeemFlexibleProductExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemLockedProductExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemLockedProductExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemLockedProductExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemLockedProductExample.java index 2d0507378..9cdb57aa5 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemLockedProductExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemLockedProductExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -21,7 +21,7 @@ import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductRequest; import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class RedeemLockedProductExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetFlexibleAutoSubscribeExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetFlexibleAutoSubscribeExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetFlexibleAutoSubscribeExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetFlexibleAutoSubscribeExample.java index a154008c0..6deb249c7 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetFlexibleAutoSubscribeExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetFlexibleAutoSubscribeExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -21,7 +21,7 @@ import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeRequest; import com.binance.connector.client.simple_earn.rest.model.SetFlexibleAutoSubscribeResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class SetFlexibleAutoSubscribeExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedAutoSubscribeExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedAutoSubscribeExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedAutoSubscribeExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedAutoSubscribeExample.java index 382333f5a..6bba8a69e 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedAutoSubscribeExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedAutoSubscribeExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -21,7 +21,7 @@ import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeRequest; import com.binance.connector.client.simple_earn.rest.model.SetLockedAutoSubscribeResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class SetLockedAutoSubscribeExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedProductRedeemOptionExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedProductRedeemOptionExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java index cf0c8000e..74b6c3ac1 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedProductRedeemOptionExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -21,7 +21,7 @@ import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionRequest; import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class SetLockedProductRedeemOptionExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/SimpleAccountExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SimpleAccountExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/SimpleAccountExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SimpleAccountExample.java index 10716a305..5f7791846 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/SimpleAccountExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SimpleAccountExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.account; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; import com.binance.connector.client.simple_earn.rest.model.SimpleAccountResponse; -/** API examples for AccountApi */ +/** API examples for FlexibleLockedApi */ public class SimpleAccountExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeFlexibleProductExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeFlexibleProductExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeFlexibleProductExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeFlexibleProductExample.java index 59931d768..840e44ed4 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeFlexibleProductExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeFlexibleProductExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -21,7 +21,7 @@ import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductRequest; import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class SubscribeFlexibleProductExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeLockedProductExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeLockedProductExample.java similarity index 95% rename from examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeLockedProductExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeLockedProductExample.java index bda3811b1..7b7c8aff1 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeLockedProductExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeLockedProductExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.simple_earn.rest.earn; +package com.binance.connector.client.simple_earn.rest.flexiblelocked; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -21,7 +21,7 @@ import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductRequest; import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductResponse; -/** API examples for EarnApi */ +/** API examples for FlexibleLockedApi */ public class SubscribeLockedProductExample { private SimpleEarnRestApi api; diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdAccountExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdAccountExample.java new file mode 100644 index 000000000..26eb5fc6b --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdAccountExample.java @@ -0,0 +1,52 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdAccountResponse; + +/** API examples for RwusdApi */ +public class GetRwusdAccountExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWUSD Account (USER_DATA) + * + *

Get RWUSD account information. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getRwusdAccountExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = getApi().getRwusdAccount(recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdQuotaDetailsExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdQuotaDetailsExample.java new file mode 100644 index 000000000..b5ff83d15 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdQuotaDetailsExample.java @@ -0,0 +1,54 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdQuotaDetailsResponse; + +/** API examples for RwusdApi */ +public class GetRwusdQuotaDetailsExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWUSD Quota Details (USER_DATA) + * + *

Get RWUSD quota details including subscription quota, fast redemption quota, and standard + * redemption quota. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getRwusdQuotaDetailsExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = + getApi().getRwusdQuotaDetails(recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRateHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRateHistoryExample.java new file mode 100644 index 000000000..89e605c70 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRateHistoryExample.java @@ -0,0 +1,65 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRateHistoryResponse; + +/** API examples for RwusdApi */ +public class GetRwusdRateHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWUSD Rate History (USER_DATA) + * + *

Get RWUSD rate history sorted by descending order. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getRwusdRateHistoryExample() throws ApiException { + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getRwusdRateHistory(startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRedemptionHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRedemptionHistoryExample.java new file mode 100644 index 000000000..6a050efd8 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRedemptionHistoryExample.java @@ -0,0 +1,64 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRedemptionHistoryResponse; + +/** API examples for RwusdApi */ +public class GetRwusdRedemptionHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWUSD Redemption History (USER_DATA) + * + *

Get RWUSD redemption history. * The time between `startTime` and + * `endTime` cannot be longer than 6 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, `endTime` will + * default to current time, and results from `startTime` onward will be returned. * If + * `endTime` is sent but `startTime` is not sent, `startTime` + * defaults to the current time minus one month, and data between `startTime` and + * `endTime` will be returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getRwusdRedemptionHistoryExample() throws ApiException { + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getRwusdRedemptionHistory(startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRewardsHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRewardsHistoryExample.java new file mode 100644 index 000000000..153f15f39 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRewardsHistoryExample.java @@ -0,0 +1,64 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdRewardsHistoryResponse; + +/** API examples for RwusdApi */ +public class GetRwusdRewardsHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWUSD Rewards History (USER_DATA) + * + *

Get RWUSD rewards history. * The time between `startTime` and + * `endTime` cannot be longer than 6 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, `endTime` will + * default to current time, and results from `startTime` onward will be returned. * If + * `endTime` is sent but `startTime` is not sent, `startTime` + * defaults to the current time minus one month, and data between `startTime` and + * `endTime` will be returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getRwusdRewardsHistoryExample() throws ApiException { + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getRwusdRewardsHistory(startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdSubscriptionHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdSubscriptionHistoryExample.java new file mode 100644 index 000000000..9f82fdcc7 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdSubscriptionHistoryExample.java @@ -0,0 +1,66 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetRwusdSubscriptionHistoryResponse; + +/** API examples for RwusdApi */ +public class GetRwusdSubscriptionHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWUSD subscription history(USER_DATA) + * + *

Get RWUSD subscription history * The time between `startTime` and + * `endTime` cannot be longer than 6 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, `endTime` will + * default to current time, and results from `startTime` onward will be returned. * If + * `endTime` is sent but `startTime` is not sent, `startTime` + * defaults to the current time advanced by one month, and data between `startTime` + * and `endTime` will be returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getRwusdSubscriptionHistoryExample() throws ApiException { + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getRwusdSubscriptionHistory( + asset, startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/RedeemRwusdExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/RedeemRwusdExample.java new file mode 100644 index 000000000..0bbb97867 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/RedeemRwusdExample.java @@ -0,0 +1,56 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.RedeemRwusdRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemRwusdResponse; + +/** API examples for RwusdApi */ +public class RedeemRwusdExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Redeem RWUSD(TRADE) + * + *

Redeem RWUSD to USDC * You need to open Enable Spot & Margin Trading permission for + * the API Key which requests this endpoint. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void redeemRwusdExample() throws ApiException { + RedeemRwusdRequest redeemRwusdRequest = new RedeemRwusdRequest(); + redeemRwusdRequest.amount(1.0d); + redeemRwusdRequest.type("s"); + ApiResponse response = getApi().redeemRwusd(redeemRwusdRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/SubscribeRwusdExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/SubscribeRwusdExample.java new file mode 100644 index 000000000..f2cb5fa02 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/SubscribeRwusdExample.java @@ -0,0 +1,57 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.rwusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeRwusdResponse; + +/** API examples for RwusdApi */ +public class SubscribeRwusdExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Subscribe RWUSD(TRADE) + * + *

Subscribe RWUSD * You need to open Enable Spot & Margin Trading permission for the API + * Key which requests this endpoint. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void subscribeRwusdExample() throws ApiException { + SubscribeRwusdRequest subscribeRwusdRequest = new SubscribeRwusdRequest(); + subscribeRwusdRequest.asset(""); + subscribeRwusdRequest.amount(1.0d); + ApiResponse response = + getApi().subscribeRwusd(subscribeRwusdRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/staking/pom.xml b/examples/staking/pom.xml index 8d875a231..1c61c1d66 100644 --- a/examples/staking/pom.xml +++ b/examples/staking/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-staking - 2.1.1 + 3.0.0 \ No newline at end of file diff --git a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingProductListExample.java b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingProductListExample.java new file mode 100644 index 000000000..d8d9c971a --- /dev/null +++ b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingProductListExample.java @@ -0,0 +1,55 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.softstaking; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.staking.rest.StakingRestApiUtil; +import com.binance.connector.client.staking.rest.api.StakingRestApi; +import com.binance.connector.client.staking.rest.model.GetSoftStakingProductListResponse; + +/** API examples for SoftStakingApi */ +public class GetSoftStakingProductListExample { + private StakingRestApi api; + + public StakingRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = StakingRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new StakingRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Soft Staking Product List (USER_DATA) + * + *

Get the available Soft Staking product list. Weight: 50 + * + * @throws ApiException if the Api call fails + */ + public void getSoftStakingProductListExample() throws ApiException { + String asset = ""; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getSoftStakingProductList(asset, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingRewardsHistoryExample.java b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingRewardsHistoryExample.java new file mode 100644 index 000000000..580729451 --- /dev/null +++ b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingRewardsHistoryExample.java @@ -0,0 +1,64 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.softstaking; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.staking.rest.StakingRestApiUtil; +import com.binance.connector.client.staking.rest.api.StakingRestApi; +import com.binance.connector.client.staking.rest.model.GetSoftStakingRewardsHistoryResponse; + +/** API examples for SoftStakingApi */ +public class GetSoftStakingRewardsHistoryExample { + private StakingRestApi api; + + public StakingRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = StakingRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new StakingRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Soft Staking Rewards History(USER_DATA) + * + *

* The time between `startTime` and `endTime` cannot be longer than 3 + * months. * If `startTime` and `endTime` are both not sent, then the last + * 30 days' data will be returned. * If `startTime` is sent but + * `endTime` is not sent, the next 30 days' data beginning from + * `startTime` will be returned. * If `endTime` is sent but + * `startTime` is not sent, the 30 days' data before `endTime` will be + * returned. Weight: 50 + * + * @throws ApiException if the Api call fails + */ + public void getSoftStakingRewardsHistoryExample() throws ApiException { + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getSoftStakingRewardsHistory( + asset, startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/SetSoftStakingExample.java b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/SetSoftStakingExample.java new file mode 100644 index 000000000..d1bcb964f --- /dev/null +++ b/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/SetSoftStakingExample.java @@ -0,0 +1,53 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.staking.rest.softstaking; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.staking.rest.StakingRestApiUtil; +import com.binance.connector.client.staking.rest.api.StakingRestApi; +import com.binance.connector.client.staking.rest.model.SetSoftStakingResponse; + +/** API examples for SoftStakingApi */ +public class SetSoftStakingExample { + private StakingRestApi api; + + public StakingRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = StakingRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new StakingRestApi(clientConfiguration); + } + return api; + } + + /** + * Set Soft Staking (USER_DATA) + * + *

Enable or disable Soft Staking. Weight: 50 + * + * @throws ApiException if the Api call fails + */ + public void setSoftStakingExample() throws ApiException { + Boolean softStaking = true; + Long recvWindow = 5000L; + ApiResponse response = + getApi().setSoftStaking(softStaking, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/vip-loan/pom.xml b/examples/vip-loan/pom.xml index a6d9fa24e..3b6572485 100644 --- a/examples/vip-loan/pom.xml +++ b/examples/vip-loan/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-vip-loan - 1.2.1 + 2.0.0 \ No newline at end of file diff --git a/examples/wallet/pom.xml b/examples/wallet/pom.xml index a99961835..5d5d88d61 100644 --- a/examples/wallet/pom.xml +++ b/examples/wallet/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-wallet - 2.1.1 + 3.0.0 \ No newline at end of file diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserWalletBalanceExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserWalletBalanceExample.java index 802ac3d46..39ec15ae2 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserWalletBalanceExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserWalletBalanceExample.java @@ -39,8 +39,7 @@ public WalletRestApi getApi() { /** * Query User Wallet Balance (USER_DATA) * - *

Query User Wallet Balance * You need to open Permits Universal Transfer permission for the - * API Key which requests this endpoint. Weight: 60 + *

Query User Wallet Balance Weight: 60 * * @throws ApiException if the Api call fails */ diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/WithdrawExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/WithdrawExample.java index a246db9c1..3005cb6bd 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/WithdrawExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/WithdrawExample.java @@ -43,7 +43,12 @@ public WalletRestApi getApi() { *

Submit a withdraw request. * If `network` not send, return with default network * of the coin. * You can get `network` and `isDefault` in * `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall - * (HMAC SHA256)`. Weight: 900 + * (HMAC SHA256)`. * To check if travel rule is required, by using `GET + * /sapi/v1/localentity/questionnaire-requirements` and if it returns anything other than + * `NIL` you will need update SAPI to `POST + * /sapi/v1/localentity/withdraw/apply` else you can continue `POST + * /sapi/v1/capital/withdraw/apply`. Please note that if you are required to comply to + * travel rule please refer to the Travel Rule SAPI. Weight: 900 * * @throws ApiException if the Api call fails */ diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/OnboardedVaspListExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/CheckQuestionnaireRequirementsExample.java similarity index 66% rename from examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/OnboardedVaspListExample.java rename to examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/CheckQuestionnaireRequirementsExample.java index 1b8574a17..440199e65 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/OnboardedVaspListExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/CheckQuestionnaireRequirementsExample.java @@ -18,10 +18,10 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.wallet.rest.WalletRestApiUtil; import com.binance.connector.client.wallet.rest.api.WalletRestApi; -import com.binance.connector.client.wallet.rest.model.OnboardedVaspListResponse; +import com.binance.connector.client.wallet.rest.model.CheckQuestionnaireRequirementsResponse; /** API examples for TravelRuleApi */ -public class OnboardedVaspListExample { +public class CheckQuestionnaireRequirementsExample { private WalletRestApi api; public WalletRestApi getApi() { @@ -37,20 +37,18 @@ public WalletRestApi getApi() { } /** - * Onboarded VASP list (for local entities that require travel rule) (supporting network) - * (USER_DATA) + * Check Questionnaire Requirements (for local entities that require travel rule) (supporting + * network) (USER_DATA) * - *

Fetch the onboarded VASP list for local entities that required travel rule. * This - * endpoint specifically uses per second IP rate limit, user's total second level IP rate - * Weight: 18000 Request limit: 10 requests per second > * This endpoint specifically uses - * per second IP rate limit, user's total second level IP rate limit is 180000/second. - * Response from the endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight - * used by the current IP. + *

This API will return user-specific Travel Rule questionnaire requirement information in + * reference to the current API key. Weight: 1 * * @throws ApiException if the Api call fails */ - public void onboardedVaspListExample() throws ApiException { - ApiResponse response = getApi().onboardedVaspList(); + public void checkQuestionnaireRequirementsExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = + getApi().checkQuestionnaireRequirements(recvWindow); System.out.println(response.getData()); } } diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java new file mode 100644 index 000000000..3389156dc --- /dev/null +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java @@ -0,0 +1,74 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.wallet.rest.travelrule; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.wallet.rest.WalletRestApiUtil; +import com.binance.connector.client.wallet.rest.api.WalletRestApi; +import com.binance.connector.client.wallet.rest.model.DepositHistoryV2Response; + +/** API examples for TravelRuleApi */ +public class DepositHistoryV2Example { + private WalletRestApi api; + + public WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Deposit History V2 (for local entities that required travel rule) (supporting network) + * (USER_DATA) + * + *

Fetch deposit history for local entities that with required travel rule information. * + * Please notice the default `startTime` and `endTime` to make sure that + * time interval is within * If both ``startTime`` and + * ``endTime`` are sent, time between ``startTime`` and + * ``endTime`` must Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void depositHistoryV2Example() throws ApiException { + String depositId = "1"; + String txId = "1"; + String network = ""; + String coin = ""; + Boolean retrieveQuestionnaire = true; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long offset = 0L; + Long limit = 7L; + ApiResponse response = + getApi().depositHistoryV2( + depositId, + txId, + network, + coin, + retrieveQuestionnaire, + startTime, + endTime, + offset, + limit); + System.out.println(response.getData()); + } +} diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java index 817a9ed21..5d5175cff 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java @@ -39,13 +39,15 @@ public WalletRestApi getApi() { /** * Fetch address verification list (USER_DATA) * - *

Fetch address verification list Weight: 10 + *

Fetch address verification list for user to check on status and other details for the + * addresses stored in Address Book. Weight: 1 * * @throws ApiException if the Api call fails */ public void fetchAddressVerificationListExample() throws ApiException { + Long recvWindow = 5000L; ApiResponse response = - getApi().fetchAddressVerificationList(); + getApi().fetchAddressVerificationList(recvWindow); System.out.println(response.getData()); } } diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/VaspListExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/VaspListExample.java new file mode 100644 index 000000000..63d09bb2b --- /dev/null +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/VaspListExample.java @@ -0,0 +1,51 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.wallet.rest.travelrule; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.wallet.rest.WalletRestApiUtil; +import com.binance.connector.client.wallet.rest.api.WalletRestApi; +import com.binance.connector.client.wallet.rest.model.VaspListResponse; + +/** API examples for TravelRuleApi */ +public class VaspListExample { + private WalletRestApi api; + + public WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) + * + *

Fetch the VASP list for local entities. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void vaspListExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = getApi().vaspList(recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV1Example.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV1Example.java index b4921f0a0..018e3cf1c 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV1Example.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV1Example.java @@ -40,15 +40,11 @@ public WalletRestApi getApi() { * Withdraw History (for local entities that require travel rule) (supporting network) * (USER_DATA) * - *

Fetch withdraw history for local entities that required travel rule. * This endpoint - * specifically uses per second IP rate limit, user's total second level IP rate * - * `network` may not be in the response for old withdraw. * Please notice the default + *

Fetch withdraw history for local entities that required travel rule. * `network` + * may not be in the response for old withdraw. * Please notice the default * `startTime` and `endTime` to make sure that time interval is within * If * both `startTime` and `endTime`are sent, time between - * `startTime`and `endTime`must be less Weight: 18000 Request limit: 10 - * requests per second > * This endpoint specifically uses per second IP rate limit, - * user's total second level IP rate limit is 180000/second. Response from the endpoint - * contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP. + * `startTime`and `endTime`must be less Weight: 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV2Example.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV2Example.java index c902f7444..9cf2efd93 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV2Example.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV2Example.java @@ -40,9 +40,8 @@ public WalletRestApi getApi() { * Withdraw History V2 (for local entities that require travel rule) (supporting network) * (USER_DATA) * - *

Fetch withdraw history for local entities that required travel rule. * This endpoint - * specifically uses per second IP rate limit, user's total second level IP rate * - * `network` may not be in the response for old withdraw. * Withdrawal made through + *

Fetch withdraw history for local entities that required travel rule. * `network` + * may not be in the response for old withdraw. * Withdrawal made through * /sapi/v1/capital/withdraw/apply may not be in the response. * Please notice the default * `startTime` and `endTime` to make sure that time interval is within * If * both `startTime` and `endTime`are sent, time between @@ -50,11 +49,7 @@ public WalletRestApi getApi() { * between startTime and endTime must be less than 7 days. * If withdrawOrderId is sent, * startTime and endTime are not sent, will return last 7 days records by default. * Maximum * support trId,txId number is 45. * WithdrawOrderId only support 1. * If responsible does not - * include withdrawalStatus, please input trId or txId retrieve the data. Weight: 18000 Request - * limit: 10 requests per second > * This endpoint specifically uses per second IP rate - * limit, user's total second level IP rate limit is 180000/second. Response from the - * endpoint contains header key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the - * current IP. + * include withdrawalStatus, please input trId or txId retrieve the data. Weight: 1 * * @throws ApiException if the Api call fails */